30#include <QButtonGroup>
38 , mLayoutObject( layoutObject )
40 if ( mLayoutObject->layout() )
43 this, [ = ] { updateDataDefinedButtons(); } );
51void QgsLayoutConfigObject::updateDataDefinedProperty()
72 if ( propertyAssociatesWithMultiFrame )
78 multiFrame->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
79 multiFrame->refresh();
84 multiFrame->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
85 multiFrame->refresh();
88 else if ( mLayoutObject )
90 mLayoutObject->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
91 mLayoutObject->refresh();
95void QgsLayoutConfigObject::updateDataDefinedButtons()
97 const QList< QgsPropertyOverrideButton * > buttons = findChildren< QgsPropertyOverrideButton * >();
106 button->blockSignals(
true );
110 button->blockSignals(
false );
125 if ( propertyAssociatesWithMultiFrame )
131 whileBlocking( button )->setToProperty( multiFrame->dataDefinedProperties().property( key ) );
136 whileBlocking( button )->setToProperty( multiFrame->dataDefinedProperties().property( key ) );
139 else if ( mLayoutObject )
141 whileBlocking( button )->setToProperty( mLayoutObject->dataDefinedProperties().property( key ) );
151 if ( !mLayoutObject )
156 QgsPrintLayout *printLayout = qobject_cast< QgsPrintLayout * >( mLayoutObject->layout() );
163 return printLayout->
atlas();
168 mLayoutObject = object;
173 if ( !mLayoutObject )
176 QgsLayout *layout = mLayoutObject->layout();
191 , mObject( layoutObject )
210 oldConfigObject->deleteLater();
217 mConfigObject->deleteLater();
218 mConfigObject = oldConfigObject;
229 const auto symbolButtonWidgets = findChildren<QgsSymbolButton *>();
232 symbolWidget->setMessageBar( iface->
messageBar() );
234 const auto fontButtonWidgets = findChildren<QgsFontButton *>();
237 fontButton->setMessageBar( iface->
messageBar() );
281 mBlockVariableUpdates =
true;
283 mVariableEditor->setContext( &context );
288 const int multiFrameScopeIndex = context.
indexOfScope( tr(
"Multiframe Item" ) );
289 const int itemScopeIndex = context.
indexOfScope( tr(
"Layout Item" ) );
290 if ( multiFrameScopeIndex >= 0 )
291 mVariableEditor->setEditableScopeIndex( multiFrameScopeIndex );
292 else if ( itemScopeIndex >= 0 )
293 mVariableEditor->setEditableScopeIndex( itemScopeIndex );
294 mBlockVariableUpdates =
false;
303 mVariableEditor->setMinimumHeight( mVariableEditor->fontMetrics().height() * 15 );
305 mItemRotationSpinBox->setClearValue( 0 );
306 mStrokeUnitsComboBox->linkToWidget( mStrokeWidthSpinBox );
309 mPosUnitsComboBox->linkToWidget( mXPosSpin );
310 mPosUnitsComboBox->linkToWidget( mYPosSpin );
311 mSizeUnitsComboBox->linkToWidget( mWidthSpin );
312 mSizeUnitsComboBox->linkToWidget( mHeightSpin );
317 mPosLockAspectRatio->setWidthSpinBox( mXPosSpin );
318 mPosLockAspectRatio->setHeightSpinBox( mYPosSpin );
319 mSizeLockAspectRatio->setWidthSpinBox( mWidthSpin );
320 mSizeLockAspectRatio->setHeightSpinBox( mHeightSpin );
322 mItemFrameColorDDBtn->registerLinkedWidget( mFrameColorButton );
323 mItemBackgroundColorDDBtn->registerLinkedWidget( mBackgroundColorButton );
326 connect( mBackgroundColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutItemPropertiesWidget::mBackgroundColorButton_colorChanged );
327 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mStrokeWidthSpinBox_valueChanged );
329 connect( mFrameGroupBox, &QgsCollapsibleGroupBoxBasic::toggled,
this, &QgsLayoutItemPropertiesWidget::mFrameGroupBox_toggled );
330 connect( mFrameJoinStyleCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutItemPropertiesWidget::mFrameJoinStyleCombo_currentIndexChanged );
331 connect( mBackgroundGroupBox, &QgsCollapsibleGroupBoxBasic::toggled,
this, &QgsLayoutItemPropertiesWidget::mBackgroundGroupBox_toggled );
332 connect( mItemIdLineEdit, &QLineEdit::editingFinished,
this, &QgsLayoutItemPropertiesWidget::mItemIdLineEdit_editingFinished );
333 connect( mPageSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mPageSpinBox_valueChanged );
334 connect( mXPosSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mXPosSpin_valueChanged );
335 connect( mYPosSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mYPosSpin_valueChanged );
337 connect( mWidthSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mWidthSpin_valueChanged );
338 connect( mHeightSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mHeightSpin_valueChanged );
340 connect( mUpperLeftRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mUpperLeftCheckBox_stateChanged );
341 connect( mUpperMiddleRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mUpperMiddleCheckBox_stateChanged );
342 connect( mUpperRightRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mUpperRightCheckBox_stateChanged );
343 connect( mMiddleLeftRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mMiddleLeftCheckBox_stateChanged );
344 connect( mMiddleRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mMiddleCheckBox_stateChanged );
345 connect( mMiddleRightRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mMiddleRightCheckBox_stateChanged );
346 connect( mLowerLeftRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mLowerLeftCheckBox_stateChanged );
347 connect( mLowerMiddleRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mLowerMiddleCheckBox_stateChanged );
348 connect( mLowerRightRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mLowerRightCheckBox_stateChanged );
349 connect( mBlendModeCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutItemPropertiesWidget::mBlendModeCombo_currentIndexChanged );
350 connect( mItemRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mItemRotationSpinBox_valueChanged );
351 connect( mExcludeFromPrintsCheckBox, &QCheckBox::toggled,
this, &QgsLayoutItemPropertiesWidget::mExcludeFromPrintsCheckBox_toggled );
354 QButtonGroup *buttonGroup =
new QButtonGroup(
this );
355 buttonGroup->addButton( mUpperLeftRadioButton );
356 buttonGroup->addButton( mUpperMiddleRadioButton );
357 buttonGroup->addButton( mUpperRightRadioButton );
358 buttonGroup->addButton( mMiddleLeftRadioButton );
359 buttonGroup->addButton( mMiddleRadioButton );
360 buttonGroup->addButton( mMiddleRightRadioButton );
361 buttonGroup->addButton( mLowerLeftRadioButton );
362 buttonGroup->addButton( mLowerMiddleRadioButton );
363 buttonGroup->addButton( mLowerRightRadioButton );
364 buttonGroup->setExclusive(
true );
375 if ( !mBlockVariableUpdates )
376 QgsLayoutItemPropertiesWidget::variablesChanged();
393 mBackgroundGroupBox->setVisible( showGroup );
398 mFrameGroupBox->setVisible( showGroup );
406 disconnect( mItem, &
QgsLayoutObject::changed,
this, &QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements );
412 connect( mItem, &
QgsLayoutObject::changed,
this, &QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements );
417 setValuesForGuiElements();
431void QgsLayoutItemPropertiesWidget::mFrameColorButton_colorChanged(
const QColor &newFrameColor )
438 mItem->setFrameStrokeColor( newFrameColor );
439 mItem->layout()->undoStack()->endCommand();
443void QgsLayoutItemPropertiesWidget::mBackgroundColorButton_colorChanged(
const QColor &newBackgroundColor )
450 mItem->setBackgroundColor( newBackgroundColor );
451 mItem->layout()->undoStack()->endCommand();
452 mItem->invalidateCache();
455void QgsLayoutItemPropertiesWidget::changeItemPosition()
462 const QgsLayoutPoint point( mXPosSpin->value(), mYPosSpin->value(), mPosUnitsComboBox->unit() );
463 mItem->attemptMove( point,
true,
false, mPageSpinBox->value() - 1 );
465 mItem->layout()->undoStack()->endCommand();
473 mItem->layout()->undoStack()->beginCommand( mItem, tr(
"Change Item Reference" ) );
474 mItem->setReferencePoint( point );
475 mItem->layout()->undoStack()->endCommand();
478void QgsLayoutItemPropertiesWidget::changeItemSize()
485 const QgsLayoutSize size( mWidthSpin->value(), mHeightSpin->value(), mSizeUnitsComboBox->unit() );
486 mItem->attemptResize( size );
488 mItem->layout()->undoStack()->endCommand();
491void QgsLayoutItemPropertiesWidget::variablesChanged()
496 if (
QgsLayoutFrame *frame = qobject_cast< QgsLayoutFrame * >( mItem ) )
511 if ( mUpperLeftRadioButton->isChecked() )
515 else if ( mUpperMiddleRadioButton->isChecked() )
519 else if ( mUpperRightRadioButton->isChecked() )
523 else if ( mMiddleLeftRadioButton->isChecked() )
527 else if ( mMiddleRadioButton->isChecked() )
531 else if ( mMiddleRightRadioButton->isChecked() )
535 else if ( mLowerLeftRadioButton->isChecked() )
539 else if ( mLowerMiddleRadioButton->isChecked() )
543 else if ( mLowerRightRadioButton->isChecked() )
550void QgsLayoutItemPropertiesWidget::mStrokeWidthSpinBox_valueChanged(
double d )
559 mItem->layout()->undoStack()->endCommand();
571 mItem->layout()->undoStack()->endCommand();
574void QgsLayoutItemPropertiesWidget::mFrameJoinStyleCombo_currentIndexChanged(
int index )
582 mItem->layout()->undoStack()->beginCommand( mItem, tr(
"Change Frame Join Style" ) );
583 mItem->setFrameJoinStyle( mFrameJoinStyleCombo->penJoinStyle() );
584 mItem->layout()->undoStack()->endCommand();
587void QgsLayoutItemPropertiesWidget::mFrameGroupBox_toggled(
bool state )
594 mItem->layout()->undoStack()->beginCommand( mItem, state ? tr(
"Enable Frame" ) : tr(
"Disable Frame" ) );
595 mItem->setFrameEnabled( state );
597 mItem->layout()->undoStack()->endCommand();
600void QgsLayoutItemPropertiesWidget::mBackgroundGroupBox_toggled(
bool state )
607 mItem->layout()->undoStack()->beginCommand( mItem, state ? tr(
"Enable Background" ) : tr(
"Disable Background" ) );
608 mItem->setBackgroundEnabled( state );
609 mItem->layout()->undoStack()->endCommand();
610 mItem->invalidateCache();
614void QgsLayoutItemPropertiesWidget::setValuesForGuiPositionElements()
621 auto block = [ = ](
bool blocked )
623 mXPosSpin->blockSignals( blocked );
624 mYPosSpin->blockSignals( blocked );
625 mPosUnitsComboBox->blockSignals( blocked );
626 mWidthSpin->blockSignals( blocked );
627 mHeightSpin->blockSignals( blocked );
628 mSizeUnitsComboBox->blockSignals( blocked );
629 mUpperLeftRadioButton->blockSignals( blocked );
630 mUpperMiddleRadioButton->blockSignals( blocked );
631 mUpperRightRadioButton->blockSignals( blocked );
632 mMiddleLeftRadioButton->blockSignals( blocked );
633 mMiddleRadioButton->blockSignals( blocked );
634 mMiddleRightRadioButton->blockSignals( blocked );
635 mLowerLeftRadioButton->blockSignals( blocked );
636 mLowerMiddleRadioButton->blockSignals( blocked );
637 mLowerRightRadioButton->blockSignals( blocked );
638 mPageSpinBox->blockSignals( blocked );
644 if ( !mFreezeXPosSpin )
645 mXPosSpin->setValue( point.
x() );
646 if ( !mFreezeYPosSpin )
647 mYPosSpin->setValue( point.
y() );
648 mPosUnitsComboBox->setUnit( point.
units() );
650 switch ( mItem->referencePoint() )
654 mUpperLeftRadioButton->setChecked(
true );
660 mUpperMiddleRadioButton->setChecked(
true );
666 mUpperRightRadioButton->setChecked(
true );
672 mMiddleLeftRadioButton->setChecked(
true );
678 mMiddleRadioButton->setChecked(
true );
684 mMiddleRightRadioButton->setChecked(
true );
690 mLowerLeftRadioButton->setChecked(
true );
696 mLowerMiddleRadioButton->setChecked(
true );
702 mLowerRightRadioButton->setChecked(
true );
708 if ( !mFreezeWidthSpin )
709 mWidthSpin->setValue( size.
width() );
710 if ( !mFreezeHeightSpin )
711 mHeightSpin->setValue( size.
height() );
713 mSizeUnitsComboBox->setUnit( size.
units() );
715 mSizeLockAspectRatio->resetRatio();
716 mPosLockAspectRatio->resetRatio();
718 if ( !mFreezePageSpin )
719 mPageSpinBox->setValue( mItem->page() + 1 );
724void QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements()
731 auto block = [ = ](
bool blocked )
733 mStrokeWidthSpinBox->blockSignals( blocked );
734 mStrokeUnitsComboBox->blockSignals( blocked );
735 mFrameGroupBox->blockSignals( blocked );
736 mBackgroundGroupBox->blockSignals( blocked );
737 mItemIdLineEdit->blockSignals( blocked );
738 mBlendModeCombo->blockSignals( blocked );
739 mOpacityWidget->blockSignals( blocked );
740 mFrameColorButton->blockSignals( blocked );
741 mFrameJoinStyleCombo->blockSignals( blocked );
742 mBackgroundColorButton->blockSignals( blocked );
743 mItemRotationSpinBox->blockSignals( blocked );
744 mExcludeFromPrintsCheckBox->blockSignals( blocked );
748 mBackgroundColorButton->setColor( mItem->backgroundColor() );
749 mFrameColorButton->setColor( mItem->frameStrokeColor() );
750 mStrokeUnitsComboBox->setUnit( mItem->frameStrokeWidth().units() );
751 mStrokeWidthSpinBox->setValue( mItem->frameStrokeWidth().length() );
752 mFrameJoinStyleCombo->setPenJoinStyle( mItem->frameJoinStyle() );
753 mItemIdLineEdit->setText( mItem->id() );
754 mFrameGroupBox->setChecked( mItem->frameEnabled() );
755 mBackgroundGroupBox->setChecked( mItem->hasBackground() );
756 mBlendModeCombo->setBlendMode( mItem->blendMode() );
757 mOpacityWidget->setOpacity( mItem->itemOpacity() );
758 mItemRotationSpinBox->setValue( mItem->itemRotation() );
759 mExcludeFromPrintsCheckBox->setChecked( mItem->excludeFromExports() );
780 const QList< QgsPropertyOverrideButton * > buttons = findChildren< QgsPropertyOverrideButton * >();
787void QgsLayoutItemPropertiesWidget::setValuesForGuiElements()
794 mBackgroundColorButton->setColorDialogTitle( tr(
"Select Background Color" ) );
795 mBackgroundColorButton->setAllowOpacity(
true );
796 mBackgroundColorButton->setContext( QStringLiteral(
"composer" ) );
797 mFrameColorButton->setColorDialogTitle( tr(
"Select Frame Color" ) );
798 mFrameColorButton->setAllowOpacity(
true );
799 mFrameColorButton->setContext( QStringLiteral(
"composer" ) );
801 setValuesForGuiPositionElements();
802 setValuesForGuiNonPositionElements();
808void QgsLayoutItemPropertiesWidget::mBlendModeCombo_currentIndexChanged(
int index )
813 mItem->layout()->undoStack()->beginCommand( mItem, tr(
"Change Blend Mode" ) );
814 mItem->setBlendMode( mBlendModeCombo->blendMode() );
815 mItem->layout()->undoStack()->endCommand();
819void QgsLayoutItemPropertiesWidget::opacityChanged(
double value )
824 mItem->setItemOpacity( value );
825 mItem->layout()->undoStack()->endCommand();
829void QgsLayoutItemPropertiesWidget::mItemIdLineEdit_editingFinished()
834 mItem->setId( mItemIdLineEdit->text() );
835 mItemIdLineEdit->setText( mItem->id() );
836 mItem->layout()->undoStack()->endCommand();
840void QgsLayoutItemPropertiesWidget::mPageSpinBox_valueChanged(
int )
842 mFreezePageSpin =
true;
843 changeItemPosition();
844 mFreezePageSpin =
false;
847void QgsLayoutItemPropertiesWidget::mXPosSpin_valueChanged(
double )
849 mFreezeXPosSpin =
true;
850 changeItemPosition();
851 mFreezeXPosSpin =
false;
854void QgsLayoutItemPropertiesWidget::mYPosSpin_valueChanged(
double )
856 mFreezeYPosSpin =
true;
857 changeItemPosition();
858 mFreezeYPosSpin =
false;
863 changeItemPosition();
866void QgsLayoutItemPropertiesWidget::mWidthSpin_valueChanged(
double )
868 mFreezeWidthSpin =
true;
870 mFreezeWidthSpin =
false;
873void QgsLayoutItemPropertiesWidget::mHeightSpin_valueChanged(
double )
875 mFreezeHeightSpin =
true;
877 mFreezeHeightSpin =
false;
885void QgsLayoutItemPropertiesWidget::mUpperLeftCheckBox_stateChanged(
bool state )
894 setValuesForGuiPositionElements();
897void QgsLayoutItemPropertiesWidget::mUpperMiddleCheckBox_stateChanged(
bool state )
905 setValuesForGuiPositionElements();
908void QgsLayoutItemPropertiesWidget::mUpperRightCheckBox_stateChanged(
bool state )
916 setValuesForGuiPositionElements();
919void QgsLayoutItemPropertiesWidget::mMiddleLeftCheckBox_stateChanged(
bool state )
927 setValuesForGuiPositionElements();
930void QgsLayoutItemPropertiesWidget::mMiddleCheckBox_stateChanged(
bool state )
938 setValuesForGuiPositionElements();
941void QgsLayoutItemPropertiesWidget::mMiddleRightCheckBox_stateChanged(
bool state )
949 setValuesForGuiPositionElements();
952void QgsLayoutItemPropertiesWidget::mLowerLeftCheckBox_stateChanged(
bool state )
960 setValuesForGuiPositionElements();
963void QgsLayoutItemPropertiesWidget::mLowerMiddleCheckBox_stateChanged(
bool state )
971 setValuesForGuiPositionElements();
974void QgsLayoutItemPropertiesWidget::mLowerRightCheckBox_stateChanged(
bool state )
982 setValuesForGuiPositionElements();
985void QgsLayoutItemPropertiesWidget::mItemRotationSpinBox_valueChanged(
double val )
990 mItem->setItemRotation( val,
true );
992 mItem->layout()->undoStack()->endCommand();
996void QgsLayoutItemPropertiesWidget::mExcludeFromPrintsCheckBox_toggled(
bool checked )
1000 mItem->layout()->undoStack()->beginCommand( mItem, checked ? tr(
"Exclude from Exports" ) : tr(
"Include in Exports" ) );
1001 mItem->setExcludeFromExports( checked );
1002 mItem->layout()->undoStack()->endCommand();
void customVariablesChanged()
Emitted whenever a custom global variable changes.
static QgsApplication * instance()
Returns the singleton instance of the QgsApplication.
static void setLayoutItemVariables(QgsLayoutItem *item, const QVariantMap &variables)
Sets all layout item context variables for an item.
static void setLayoutMultiFrameVariables(QgsLayoutMultiFrame *frame, const QVariantMap &variables)
Sets all layout multiframe context variables for an frame.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
int indexOfScope(QgsExpressionContextScope *scope) const
Returns the index of the specified scope if it exists within the context.
Class used to render QgsLayout as an atlas, by iterating over the features from an associated vector ...
void toggled(bool)
Emitted when atlas is enabled or disabled.
void coverageLayerChanged(QgsVectorLayer *layer)
Emitted when the coverage layer for the atlas changes.
An object for property widgets for layout items.
QgsLayoutAtlas * layoutAtlas() const
Returns the atlas for the layout, if available.
void setObject(QgsLayoutObject *object) SIP_SKIP
Links a new layout object to this QgsLayoutConfigObject.
void initializeDataDefinedButton(QgsPropertyOverrideButton *button, QgsLayoutObject::DataDefinedProperty key)
Registers a data defined button, setting up its initial value, connections and description.
QgsVectorLayer * coverageLayer() const
Returns the current layout context coverage layer (if set).
void updateDataDefinedButton(QgsPropertyOverrideButton *button)
Updates a data defined button to reflect the item's current properties.
QgsLayoutConfigObject(QWidget *parent SIP_TRANSFERTHIS, QgsLayoutObject *layoutObject)
Constructor for QgsLayoutConfigObject, linked with the specified layoutObject.
A common interface for layout designer dialogs and widgets.
virtual QgsMessageBar * messageBar()=0
Returns the designer's message bar.
Base class for frame items, which form a layout multiframe item.
Base class for graphical items within a QgsLayout.
@ UndoIncrementalMove
Layout item incremental movement, e.g. as a result of a keypress.
@ UndoBackgroundColor
Background color adjustment.
@ UndoOpacity
Opacity adjustment.
@ UndoIncrementalResize
Incremental resize.
@ UndoRotation
Rotation adjustment.
@ UndoStrokeWidth
Stroke width adjustment.
@ UndoSetId
Change item ID.
@ UndoStrokeColor
Stroke color adjustment.
ReferencePoint
Fixed position reference point.
@ LowerMiddle
Lower center of item.
@ MiddleLeft
Middle left of item.
@ UpperRight
Upper right corner of item.
@ LowerLeft
Lower left corner of item.
@ UpperLeft
Upper left corner of item.
@ UpperMiddle
Upper center of item.
@ MiddleRight
Middle right of item.
@ LowerRight
Lower right corner of item.
void sizePositionChanged()
Emitted when the item's size or position changes.
This class provides a method of storing measurements for use in QGIS layouts using a variety of diffe...
Abstract base class for layout items with the ability to distribute the content to several frames (Qg...
A base class for objects which belong to a layout.
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the layout object property definitions.
const QgsLayout * layout() const
Returns the layout the object is attached to.
void changed()
Emitted when the object's properties change.
DataDefinedProperty
Data defined properties for different item types.
@ ItemWidth
Width of item.
@ ItemHeight
Height of item.
@ BlendMode
Item blend mode.
@ PositionY
Y position on page.
@ ExcludeFromExports
Exclude item from exports.
@ BackgroundColor
Item background color.
@ ItemRotation
Rotation of item.
@ PositionX
X position on page.
@ FrameColor
Item frame color.
static bool propertyAssociatesWithParentMultiframe(DataDefinedProperty property)
Returns true if the specified property key is normally associated with the parent QgsLayoutMultiFrame...
void changed()
Emitted when pages are added or removed from the collection.
This class provides a method of storing points, consisting of an x and y coordinate,...
double x() const
Returns x coordinate of point.
QgsUnitTypes::LayoutUnit units() const
Returns the units for the point.
double y() const
Returns y coordinate of point.
void dpiChanged()
Emitted when the context's DPI is changed.
const QgsLayoutMeasurementConverter & measurementConverter() const
Returns the layout measurement converter to be used in the layout.
void layerChanged(QgsVectorLayer *layer)
Emitted when the context's layer is changed.
QgsVectorLayer * layer() const
Returns the vector layer associated with the layout's context.
This class provides a method of storing sizes, consisting of a width and height, for use in QGIS layo...
QgsUnitTypes::LayoutUnit units() const
Returns the units for the size.
double height() const
Returns the height of the size.
double width() const
Returns the width of the size.
void changed(QgsUnitTypes::LayoutUnit unit)
Emitted when the unit is changed.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
QgsLayoutRenderContext & renderContext()
Returns a reference to the layout's render context, which stores information relating to the current ...
QgsLayoutPageCollection * pageCollection()
Returns a pointer to the layout's page collection, which stores and manages page items in the layout.
void variablesChanged()
Emitted whenever the expression variables stored in the layout have been changed.
QgsLayoutReportContext & reportContext()
Returns a reference to the layout's report context, which stores information relating to the current ...
QgsProject * project() const
The project associated with the layout.
Interface for master layout type objects, such as print layouts and reports.
Print layout, a QgsLayout subclass for static or atlas-based layouts.
QgsLayoutAtlas * atlas()
Returns the print layout's atlas.
void nameChanged(const QString &name)
Emitted when the layout's name is changed.
void metadataChanged()
Emitted when the project's metadata is changed.
void customVariablesChanged()
Emitted whenever the expression variables stored in the project have been changed.
LayoutUnit
Layout measurement units.
Represents a vector layer which manages a vector based data sets.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.