17#include "moc_qgslayoutitemwidget.cpp"
32#include <QButtonGroup>
40 , mLayoutObject( layoutObject )
42 if ( mLayoutObject->layout() )
45 this, [ = ] { updateDataDefinedButtons(); } );
53void QgsLayoutConfigObject::updateDataDefinedProperty()
74 if ( propertyAssociatesWithMultiFrame )
80 multiFrame->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
81 multiFrame->refresh();
86 multiFrame->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
87 multiFrame->refresh();
90 else if ( mLayoutObject )
92 mLayoutObject->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
93 mLayoutObject->refresh();
97void QgsLayoutConfigObject::updateDataDefinedButtons()
99 const QList< QgsPropertyOverrideButton * > buttons = findChildren< QgsPropertyOverrideButton * >();
108 button->blockSignals(
true );
112 button->blockSignals(
false );
127 if ( propertyAssociatesWithMultiFrame )
133 whileBlocking( button )->setToProperty( multiFrame->dataDefinedProperties().property( key ) );
138 whileBlocking( button )->setToProperty( multiFrame->dataDefinedProperties().property( key ) );
141 else if ( mLayoutObject )
143 whileBlocking( button )->setToProperty( mLayoutObject->dataDefinedProperties().property( key ) );
153 if ( !mLayoutObject )
158 QgsPrintLayout *printLayout = qobject_cast< QgsPrintLayout * >( mLayoutObject->layout() );
165 return printLayout->
atlas();
170 mLayoutObject = object;
175 if ( !mLayoutObject )
178 QgsLayout *layout = mLayoutObject->layout();
193 , mObject( layoutObject )
212 oldConfigObject->deleteLater();
219 mConfigObject->deleteLater();
220 mConfigObject = oldConfigObject;
231 const auto symbolButtonWidgets = findChildren<QgsSymbolButton *>();
234 symbolWidget->setMessageBar( iface->
messageBar() );
236 const auto fontButtonWidgets = findChildren<QgsFontButton *>();
239 fontButton->setMessageBar( iface->
messageBar() );
283 mBlockVariableUpdates =
true;
285 mVariableEditor->setContext( &context );
290 const int multiFrameScopeIndex = context.
indexOfScope( tr(
"Multiframe Item" ) );
291 const int itemScopeIndex = context.
indexOfScope( tr(
"Layout Item" ) );
292 if ( multiFrameScopeIndex >= 0 )
293 mVariableEditor->setEditableScopeIndex( multiFrameScopeIndex );
294 else if ( itemScopeIndex >= 0 )
295 mVariableEditor->setEditableScopeIndex( itemScopeIndex );
296 mBlockVariableUpdates =
false;
305 mVariableEditor->setMinimumHeight( mVariableEditor->fontMetrics().height() * 15 );
307 mItemRotationSpinBox->setClearValue( 0 );
308 mStrokeUnitsComboBox->linkToWidget( mStrokeWidthSpinBox );
313 exportGroupLineEdit->setPlaceholderText( tr(
"Not set" ) );
314 mExportGroupNameCombo->setLineEdit( exportGroupLineEdit );
316 mPosUnitsComboBox->linkToWidget( mXPosSpin );
317 mPosUnitsComboBox->linkToWidget( mYPosSpin );
318 mSizeUnitsComboBox->linkToWidget( mWidthSpin );
319 mSizeUnitsComboBox->linkToWidget( mHeightSpin );
324 mPosLockAspectRatio->setWidthSpinBox( mXPosSpin );
325 mPosLockAspectRatio->setHeightSpinBox( mYPosSpin );
326 mSizeLockAspectRatio->setWidthSpinBox( mWidthSpin );
327 mSizeLockAspectRatio->setHeightSpinBox( mHeightSpin );
329 mItemFrameColorDDBtn->registerLinkedWidget( mFrameColorButton );
330 mItemBackgroundColorDDBtn->registerLinkedWidget( mBackgroundColorButton );
333 connect( mBackgroundColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutItemPropertiesWidget::mBackgroundColorButton_colorChanged );
334 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mStrokeWidthSpinBox_valueChanged );
336 connect( mFrameGroupBox, &QgsCollapsibleGroupBoxBasic::toggled,
this, &QgsLayoutItemPropertiesWidget::mFrameGroupBox_toggled );
337 connect( mFrameJoinStyleCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutItemPropertiesWidget::mFrameJoinStyleCombo_currentIndexChanged );
338 connect( mBackgroundGroupBox, &QgsCollapsibleGroupBoxBasic::toggled,
this, &QgsLayoutItemPropertiesWidget::mBackgroundGroupBox_toggled );
339 connect( mItemIdLineEdit, &QLineEdit::editingFinished,
this, &QgsLayoutItemPropertiesWidget::mItemIdLineEdit_editingFinished );
340 connect( mExportGroupNameCombo, &QComboBox::currentTextChanged,
this, &QgsLayoutItemPropertiesWidget::exportGroupNameEditingFinished );
341 connect( mPageSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mPageSpinBox_valueChanged );
342 connect( mXPosSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mXPosSpin_valueChanged );
343 connect( mYPosSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mYPosSpin_valueChanged );
345 connect( mWidthSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mWidthSpin_valueChanged );
346 connect( mHeightSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mHeightSpin_valueChanged );
348 connect( mUpperLeftRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mUpperLeftCheckBox_stateChanged );
349 connect( mUpperMiddleRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mUpperMiddleCheckBox_stateChanged );
350 connect( mUpperRightRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mUpperRightCheckBox_stateChanged );
351 connect( mMiddleLeftRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mMiddleLeftCheckBox_stateChanged );
352 connect( mMiddleRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mMiddleCheckBox_stateChanged );
353 connect( mMiddleRightRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mMiddleRightCheckBox_stateChanged );
354 connect( mLowerLeftRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mLowerLeftCheckBox_stateChanged );
355 connect( mLowerMiddleRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mLowerMiddleCheckBox_stateChanged );
356 connect( mLowerRightRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mLowerRightCheckBox_stateChanged );
357 connect( mBlendModeCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutItemPropertiesWidget::mBlendModeCombo_currentIndexChanged );
358 connect( mItemRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mItemRotationSpinBox_valueChanged );
359 connect( mExcludeFromPrintsCheckBox, &QCheckBox::toggled,
this, &QgsLayoutItemPropertiesWidget::mExcludeFromPrintsCheckBox_toggled );
362 QButtonGroup *buttonGroup =
new QButtonGroup(
this );
363 buttonGroup->addButton( mUpperLeftRadioButton );
364 buttonGroup->addButton( mUpperMiddleRadioButton );
365 buttonGroup->addButton( mUpperRightRadioButton );
366 buttonGroup->addButton( mMiddleLeftRadioButton );
367 buttonGroup->addButton( mMiddleRadioButton );
368 buttonGroup->addButton( mMiddleRightRadioButton );
369 buttonGroup->addButton( mLowerLeftRadioButton );
370 buttonGroup->addButton( mLowerMiddleRadioButton );
371 buttonGroup->addButton( mLowerRightRadioButton );
372 buttonGroup->setExclusive(
true );
383 if ( !mBlockVariableUpdates )
384 QgsLayoutItemPropertiesWidget::variablesChanged();
401 mBackgroundGroupBox->setVisible( showGroup );
406 mFrameGroupBox->setVisible( showGroup );
414 disconnect( mItem, &
QgsLayoutObject::changed,
this, &QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements );
420 connect( mItem, &
QgsLayoutObject::changed,
this, &QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements );
425 setValuesForGuiElements();
439void QgsLayoutItemPropertiesWidget::mFrameColorButton_colorChanged(
const QColor &newFrameColor )
446 mItem->setFrameStrokeColor( newFrameColor );
447 mItem->layout()->undoStack()->endCommand();
451void QgsLayoutItemPropertiesWidget::mBackgroundColorButton_colorChanged(
const QColor &newBackgroundColor )
458 mItem->setBackgroundColor( newBackgroundColor );
459 mItem->layout()->undoStack()->endCommand();
460 mItem->invalidateCache();
463void QgsLayoutItemPropertiesWidget::changeItemPosition()
470 const QgsLayoutPoint point( mXPosSpin->value(), mYPosSpin->value(), mPosUnitsComboBox->unit() );
471 mItem->attemptMove( point,
true,
false, mPageSpinBox->value() - 1 );
473 mItem->layout()->undoStack()->endCommand();
481 mItem->layout()->undoStack()->beginCommand( mItem, tr(
"Change Item Reference" ) );
482 mItem->setReferencePoint( point );
483 mItem->layout()->undoStack()->endCommand();
486void QgsLayoutItemPropertiesWidget::changeItemSize()
493 const QgsLayoutSize size( mWidthSpin->value(), mHeightSpin->value(), mSizeUnitsComboBox->unit() );
494 mItem->attemptResize( size );
496 mItem->layout()->undoStack()->endCommand();
499void QgsLayoutItemPropertiesWidget::variablesChanged()
504 if (
QgsLayoutFrame *frame = qobject_cast< QgsLayoutFrame * >( mItem ) )
519 if ( mUpperLeftRadioButton->isChecked() )
523 else if ( mUpperMiddleRadioButton->isChecked() )
527 else if ( mUpperRightRadioButton->isChecked() )
531 else if ( mMiddleLeftRadioButton->isChecked() )
535 else if ( mMiddleRadioButton->isChecked() )
539 else if ( mMiddleRightRadioButton->isChecked() )
543 else if ( mLowerLeftRadioButton->isChecked() )
547 else if ( mLowerMiddleRadioButton->isChecked() )
551 else if ( mLowerRightRadioButton->isChecked() )
558void QgsLayoutItemPropertiesWidget::mStrokeWidthSpinBox_valueChanged(
double d )
567 mItem->layout()->undoStack()->endCommand();
570void QgsLayoutItemPropertiesWidget::strokeUnitChanged(
Qgis::LayoutUnit unit )
579 mItem->layout()->undoStack()->endCommand();
582void QgsLayoutItemPropertiesWidget::mFrameJoinStyleCombo_currentIndexChanged(
int index )
590 mItem->layout()->undoStack()->beginCommand( mItem, tr(
"Change Frame Join Style" ) );
591 mItem->setFrameJoinStyle( mFrameJoinStyleCombo->penJoinStyle() );
592 mItem->layout()->undoStack()->endCommand();
595void QgsLayoutItemPropertiesWidget::mFrameGroupBox_toggled(
bool state )
602 mItem->layout()->undoStack()->beginCommand( mItem, state ? tr(
"Enable Frame" ) : tr(
"Disable Frame" ) );
603 mItem->setFrameEnabled( state );
605 mItem->layout()->undoStack()->endCommand();
608void QgsLayoutItemPropertiesWidget::mBackgroundGroupBox_toggled(
bool state )
615 mItem->layout()->undoStack()->beginCommand( mItem, state ? tr(
"Enable Background" ) : tr(
"Disable Background" ) );
616 mItem->setBackgroundEnabled( state );
617 mItem->layout()->undoStack()->endCommand();
618 mItem->invalidateCache();
622void QgsLayoutItemPropertiesWidget::setValuesForGuiPositionElements()
629 auto block = [ = ](
bool blocked )
631 mXPosSpin->blockSignals( blocked );
632 mYPosSpin->blockSignals( blocked );
633 mPosUnitsComboBox->blockSignals( blocked );
634 mWidthSpin->blockSignals( blocked );
635 mHeightSpin->blockSignals( blocked );
636 mSizeUnitsComboBox->blockSignals( blocked );
637 mUpperLeftRadioButton->blockSignals( blocked );
638 mUpperMiddleRadioButton->blockSignals( blocked );
639 mUpperRightRadioButton->blockSignals( blocked );
640 mMiddleLeftRadioButton->blockSignals( blocked );
641 mMiddleRadioButton->blockSignals( blocked );
642 mMiddleRightRadioButton->blockSignals( blocked );
643 mLowerLeftRadioButton->blockSignals( blocked );
644 mLowerMiddleRadioButton->blockSignals( blocked );
645 mLowerRightRadioButton->blockSignals( blocked );
646 mPageSpinBox->blockSignals( blocked );
652 if ( !mFreezeXPosSpin )
653 mXPosSpin->setValue( point.
x() );
654 if ( !mFreezeYPosSpin )
655 mYPosSpin->setValue( point.
y() );
656 mPosUnitsComboBox->setUnit( point.
units() );
658 switch ( mItem->referencePoint() )
662 mUpperLeftRadioButton->setChecked(
true );
668 mUpperMiddleRadioButton->setChecked(
true );
674 mUpperRightRadioButton->setChecked(
true );
680 mMiddleLeftRadioButton->setChecked(
true );
686 mMiddleRadioButton->setChecked(
true );
692 mMiddleRightRadioButton->setChecked(
true );
698 mLowerLeftRadioButton->setChecked(
true );
704 mLowerMiddleRadioButton->setChecked(
true );
710 mLowerRightRadioButton->setChecked(
true );
716 if ( !mFreezeWidthSpin )
717 mWidthSpin->setValue( size.
width() );
718 if ( !mFreezeHeightSpin )
719 mHeightSpin->setValue( size.
height() );
721 mSizeUnitsComboBox->setUnit( size.
units() );
723 mSizeLockAspectRatio->resetRatio();
724 mPosLockAspectRatio->resetRatio();
726 if ( !mFreezePageSpin )
727 mPageSpinBox->setValue( mItem->page() + 1 );
732void QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements()
739 whileBlocking( mBackgroundColorButton )->setColor( mItem->backgroundColor(
false ) );
740 whileBlocking( mFrameColorButton )->setColor( mItem->frameStrokeColor() );
741 whileBlocking( mStrokeUnitsComboBox )->setUnit( mItem->frameStrokeWidth().units() );
742 whileBlocking( mStrokeWidthSpinBox )->setValue( mItem->frameStrokeWidth().length() );
743 whileBlocking( mFrameJoinStyleCombo )->setPenJoinStyle( mItem->frameJoinStyle() );
745 whileBlocking( mFrameGroupBox )->setChecked( mItem->frameEnabled() );
746 whileBlocking( mBackgroundGroupBox )->setChecked( mItem->hasBackground() );
747 whileBlocking( mBlendModeCombo )->setBlendMode( mItem->blendMode() );
748 whileBlocking( mOpacityWidget )->setOpacity( mItem->itemOpacity() );
749 whileBlocking( mItemRotationSpinBox )->setValue( mItem->itemRotation() );
750 whileBlocking( mExcludeFromPrintsCheckBox )->setChecked( mItem->excludeFromExports() );
751 whileBlocking( mExportGroupNameCombo )->setCurrentText( mItem->customProperty( QStringLiteral(
"pdfExportGroup" ) ).toString() );
770 const QList< QgsPropertyOverrideButton * > buttons = findChildren< QgsPropertyOverrideButton * >();
777void QgsLayoutItemPropertiesWidget::setValuesForGuiElements()
784 mBackgroundColorButton->setColorDialogTitle( tr(
"Select Background Color" ) );
785 mBackgroundColorButton->setAllowOpacity(
true );
786 mBackgroundColorButton->setContext( QStringLiteral(
"composer" ) );
787 mFrameColorButton->setColorDialogTitle( tr(
"Select Frame Color" ) );
788 mFrameColorButton->setAllowOpacity(
true );
789 mFrameColorButton->setContext( QStringLiteral(
"composer" ) );
791 if (
QgsLayout *layout = mItem->layout() )
794 QList< QgsLayoutItem * > items;
795 layout->layoutItems( items );
796 QStringList existingGroups;
799 const QString groupName = item->customProperty( QStringLiteral(
"pdfExportGroup" ) ).toString();
800 if ( !groupName.isEmpty() && !existingGroups.contains( groupName ) )
801 existingGroups.append( groupName );
804 std::sort( existingGroups.begin(), existingGroups.end(), [ = ](
const QString & a,
const QString & b ) ->
bool
806 return a.localeAwareCompare( b ) < 0;
810 whileBlocking( mExportGroupNameCombo )->addItems( existingGroups );
813 setValuesForGuiPositionElements();
814 setValuesForGuiNonPositionElements();
820void QgsLayoutItemPropertiesWidget::mBlendModeCombo_currentIndexChanged(
int index )
825 mItem->layout()->undoStack()->beginCommand( mItem, tr(
"Change Blend Mode" ) );
826 mItem->setBlendMode( mBlendModeCombo->blendMode() );
827 mItem->layout()->undoStack()->endCommand();
831void QgsLayoutItemPropertiesWidget::opacityChanged(
double value )
836 mItem->setItemOpacity( value );
837 mItem->layout()->undoStack()->endCommand();
841void QgsLayoutItemPropertiesWidget::mItemIdLineEdit_editingFinished()
846 mItem->setId( mItemIdLineEdit->text() );
847 mItemIdLineEdit->setText( mItem->id() );
848 mItem->layout()->undoStack()->endCommand();
852void QgsLayoutItemPropertiesWidget::exportGroupNameEditingFinished()
857 mItem->setCustomProperty( QStringLiteral(
"pdfExportGroup" ), mExportGroupNameCombo->currentText() );
858 mItem->layout()->undoStack()->endCommand();
862void QgsLayoutItemPropertiesWidget::mPageSpinBox_valueChanged(
int )
864 mFreezePageSpin =
true;
865 changeItemPosition();
866 mFreezePageSpin =
false;
869void QgsLayoutItemPropertiesWidget::mXPosSpin_valueChanged(
double )
871 mFreezeXPosSpin =
true;
872 changeItemPosition();
873 mFreezeXPosSpin =
false;
876void QgsLayoutItemPropertiesWidget::mYPosSpin_valueChanged(
double )
878 mFreezeYPosSpin =
true;
879 changeItemPosition();
880 mFreezeYPosSpin =
false;
885 changeItemPosition();
888void QgsLayoutItemPropertiesWidget::mWidthSpin_valueChanged(
double )
890 mFreezeWidthSpin =
true;
892 mFreezeWidthSpin =
false;
895void QgsLayoutItemPropertiesWidget::mHeightSpin_valueChanged(
double )
897 mFreezeHeightSpin =
true;
899 mFreezeHeightSpin =
false;
907void QgsLayoutItemPropertiesWidget::mUpperLeftCheckBox_stateChanged(
bool state )
916 setValuesForGuiPositionElements();
919void QgsLayoutItemPropertiesWidget::mUpperMiddleCheckBox_stateChanged(
bool state )
927 setValuesForGuiPositionElements();
930void QgsLayoutItemPropertiesWidget::mUpperRightCheckBox_stateChanged(
bool state )
938 setValuesForGuiPositionElements();
941void QgsLayoutItemPropertiesWidget::mMiddleLeftCheckBox_stateChanged(
bool state )
949 setValuesForGuiPositionElements();
952void QgsLayoutItemPropertiesWidget::mMiddleCheckBox_stateChanged(
bool state )
960 setValuesForGuiPositionElements();
963void QgsLayoutItemPropertiesWidget::mMiddleRightCheckBox_stateChanged(
bool state )
971 setValuesForGuiPositionElements();
974void QgsLayoutItemPropertiesWidget::mLowerLeftCheckBox_stateChanged(
bool state )
982 setValuesForGuiPositionElements();
985void QgsLayoutItemPropertiesWidget::mLowerMiddleCheckBox_stateChanged(
bool state )
993 setValuesForGuiPositionElements();
996void QgsLayoutItemPropertiesWidget::mLowerRightCheckBox_stateChanged(
bool state )
1004 setValuesForGuiPositionElements();
1007void QgsLayoutItemPropertiesWidget::mItemRotationSpinBox_valueChanged(
double val )
1012 mItem->setItemRotation( val,
true );
1014 mItem->layout()->undoStack()->endCommand();
1018void QgsLayoutItemPropertiesWidget::mExcludeFromPrintsCheckBox_toggled(
bool checked )
1022 mItem->layout()->undoStack()->beginCommand( mItem, checked ? tr(
"Exclude from Exports" ) : tr(
"Include in Exports" ) );
1023 mItem->setExcludeFromExports( checked );
1024 mItem->layout()->undoStack()->endCommand();
LayoutUnit
Layout measurement units.
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.
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
void setShowClearButton(bool visible)
Sets whether the widget's clear button is visible.
Class used to render QgsLayout as an atlas, by iterating over the features from an associated vector ...
void toggled(bool enabled)
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.
@ UndoExportLayerName
Export layer name.
@ 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.
@ PositionX
X position on page.
@ ItemWidth
Width of item.
@ ExcludeFromExports
Exclude item from exports.
@ ItemRotation
Rotation of item.
@ PositionY
Y position on page.
@ ItemHeight
Height of item.
@ BackgroundColor
Item background color.
@ BlendMode
Item blend mode.
@ 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.
double y() const
Returns y coordinate of point.
Qgis::LayoutUnit units() const
Returns the units for the 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...
double height() const
Returns the height of the size.
Qgis::LayoutUnit units() const
Returns the units for the size.
double width() const
Returns the width of the size.
void unitChanged(Qgis::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.
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.