31#include <QButtonGroup>
39 , mLayoutObject( layoutObject )
41 if ( mLayoutObject->layout() )
44 this, [ = ] { updateDataDefinedButtons(); } );
52void QgsLayoutConfigObject::updateDataDefinedProperty()
73 if ( propertyAssociatesWithMultiFrame )
79 multiFrame->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
80 multiFrame->refresh();
85 multiFrame->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
86 multiFrame->refresh();
89 else if ( mLayoutObject )
91 mLayoutObject->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
92 mLayoutObject->refresh();
96void QgsLayoutConfigObject::updateDataDefinedButtons()
98 const QList< QgsPropertyOverrideButton * > buttons = findChildren< QgsPropertyOverrideButton * >();
107 button->blockSignals(
true );
111 button->blockSignals(
false );
126 if ( propertyAssociatesWithMultiFrame )
132 whileBlocking( button )->setToProperty( multiFrame->dataDefinedProperties().property( key ) );
137 whileBlocking( button )->setToProperty( multiFrame->dataDefinedProperties().property( key ) );
140 else if ( mLayoutObject )
142 whileBlocking( button )->setToProperty( mLayoutObject->dataDefinedProperties().property( key ) );
152 if ( !mLayoutObject )
157 QgsPrintLayout *printLayout = qobject_cast< QgsPrintLayout * >( mLayoutObject->layout() );
164 return printLayout->
atlas();
169 mLayoutObject = object;
174 if ( !mLayoutObject )
177 QgsLayout *layout = mLayoutObject->layout();
192 , mObject( layoutObject )
211 oldConfigObject->deleteLater();
218 mConfigObject->deleteLater();
219 mConfigObject = oldConfigObject;
230 const auto symbolButtonWidgets = findChildren<QgsSymbolButton *>();
233 symbolWidget->setMessageBar( iface->
messageBar() );
235 const auto fontButtonWidgets = findChildren<QgsFontButton *>();
238 fontButton->setMessageBar( iface->
messageBar() );
282 mBlockVariableUpdates =
true;
284 mVariableEditor->setContext( &context );
289 const int multiFrameScopeIndex = context.
indexOfScope( tr(
"Multiframe Item" ) );
290 const int itemScopeIndex = context.
indexOfScope( tr(
"Layout Item" ) );
291 if ( multiFrameScopeIndex >= 0 )
292 mVariableEditor->setEditableScopeIndex( multiFrameScopeIndex );
293 else if ( itemScopeIndex >= 0 )
294 mVariableEditor->setEditableScopeIndex( itemScopeIndex );
295 mBlockVariableUpdates =
false;
304 mVariableEditor->setMinimumHeight( mVariableEditor->fontMetrics().height() * 15 );
306 mItemRotationSpinBox->setClearValue( 0 );
307 mStrokeUnitsComboBox->linkToWidget( mStrokeWidthSpinBox );
312 exportGroupLineEdit->setPlaceholderText( tr(
"Not set" ) );
313 mExportGroupNameCombo->setLineEdit( exportGroupLineEdit );
315 mPosUnitsComboBox->linkToWidget( mXPosSpin );
316 mPosUnitsComboBox->linkToWidget( mYPosSpin );
317 mSizeUnitsComboBox->linkToWidget( mWidthSpin );
318 mSizeUnitsComboBox->linkToWidget( mHeightSpin );
323 mPosLockAspectRatio->setWidthSpinBox( mXPosSpin );
324 mPosLockAspectRatio->setHeightSpinBox( mYPosSpin );
325 mSizeLockAspectRatio->setWidthSpinBox( mWidthSpin );
326 mSizeLockAspectRatio->setHeightSpinBox( mHeightSpin );
328 mItemFrameColorDDBtn->registerLinkedWidget( mFrameColorButton );
329 mItemBackgroundColorDDBtn->registerLinkedWidget( mBackgroundColorButton );
332 connect( mBackgroundColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutItemPropertiesWidget::mBackgroundColorButton_colorChanged );
333 connect( mStrokeWidthSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mStrokeWidthSpinBox_valueChanged );
335 connect( mFrameGroupBox, &QgsCollapsibleGroupBoxBasic::toggled,
this, &QgsLayoutItemPropertiesWidget::mFrameGroupBox_toggled );
336 connect( mFrameJoinStyleCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutItemPropertiesWidget::mFrameJoinStyleCombo_currentIndexChanged );
337 connect( mBackgroundGroupBox, &QgsCollapsibleGroupBoxBasic::toggled,
this, &QgsLayoutItemPropertiesWidget::mBackgroundGroupBox_toggled );
338 connect( mItemIdLineEdit, &QLineEdit::editingFinished,
this, &QgsLayoutItemPropertiesWidget::mItemIdLineEdit_editingFinished );
339 connect( mExportGroupNameCombo, &QComboBox::currentTextChanged,
this, &QgsLayoutItemPropertiesWidget::exportGroupNameEditingFinished );
340 connect( mPageSpinBox,
static_cast < void ( QSpinBox::* )(
int )
> ( &QSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mPageSpinBox_valueChanged );
341 connect( mXPosSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mXPosSpin_valueChanged );
342 connect( mYPosSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mYPosSpin_valueChanged );
344 connect( mWidthSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mWidthSpin_valueChanged );
345 connect( mHeightSpin,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mHeightSpin_valueChanged );
347 connect( mUpperLeftRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mUpperLeftCheckBox_stateChanged );
348 connect( mUpperMiddleRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mUpperMiddleCheckBox_stateChanged );
349 connect( mUpperRightRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mUpperRightCheckBox_stateChanged );
350 connect( mMiddleLeftRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mMiddleLeftCheckBox_stateChanged );
351 connect( mMiddleRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mMiddleCheckBox_stateChanged );
352 connect( mMiddleRightRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mMiddleRightCheckBox_stateChanged );
353 connect( mLowerLeftRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mLowerLeftCheckBox_stateChanged );
354 connect( mLowerMiddleRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mLowerMiddleCheckBox_stateChanged );
355 connect( mLowerRightRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mLowerRightCheckBox_stateChanged );
356 connect( mBlendModeCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutItemPropertiesWidget::mBlendModeCombo_currentIndexChanged );
357 connect( mItemRotationSpinBox,
static_cast < void ( QDoubleSpinBox::* )(
double )
> ( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mItemRotationSpinBox_valueChanged );
358 connect( mExcludeFromPrintsCheckBox, &QCheckBox::toggled,
this, &QgsLayoutItemPropertiesWidget::mExcludeFromPrintsCheckBox_toggled );
361 QButtonGroup *buttonGroup =
new QButtonGroup(
this );
362 buttonGroup->addButton( mUpperLeftRadioButton );
363 buttonGroup->addButton( mUpperMiddleRadioButton );
364 buttonGroup->addButton( mUpperRightRadioButton );
365 buttonGroup->addButton( mMiddleLeftRadioButton );
366 buttonGroup->addButton( mMiddleRadioButton );
367 buttonGroup->addButton( mMiddleRightRadioButton );
368 buttonGroup->addButton( mLowerLeftRadioButton );
369 buttonGroup->addButton( mLowerMiddleRadioButton );
370 buttonGroup->addButton( mLowerRightRadioButton );
371 buttonGroup->setExclusive(
true );
382 if ( !mBlockVariableUpdates )
383 QgsLayoutItemPropertiesWidget::variablesChanged();
400 mBackgroundGroupBox->setVisible( showGroup );
405 mFrameGroupBox->setVisible( showGroup );
413 disconnect( mItem, &
QgsLayoutObject::changed,
this, &QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements );
419 connect( mItem, &
QgsLayoutObject::changed,
this, &QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements );
424 setValuesForGuiElements();
438void QgsLayoutItemPropertiesWidget::mFrameColorButton_colorChanged(
const QColor &newFrameColor )
445 mItem->setFrameStrokeColor( newFrameColor );
446 mItem->layout()->undoStack()->endCommand();
450void QgsLayoutItemPropertiesWidget::mBackgroundColorButton_colorChanged(
const QColor &newBackgroundColor )
457 mItem->setBackgroundColor( newBackgroundColor );
458 mItem->layout()->undoStack()->endCommand();
459 mItem->invalidateCache();
462void QgsLayoutItemPropertiesWidget::changeItemPosition()
469 const QgsLayoutPoint point( mXPosSpin->value(), mYPosSpin->value(), mPosUnitsComboBox->unit() );
470 mItem->attemptMove( point,
true,
false, mPageSpinBox->value() - 1 );
472 mItem->layout()->undoStack()->endCommand();
480 mItem->layout()->undoStack()->beginCommand( mItem, tr(
"Change Item Reference" ) );
481 mItem->setReferencePoint( point );
482 mItem->layout()->undoStack()->endCommand();
485void QgsLayoutItemPropertiesWidget::changeItemSize()
492 const QgsLayoutSize size( mWidthSpin->value(), mHeightSpin->value(), mSizeUnitsComboBox->unit() );
493 mItem->attemptResize( size );
495 mItem->layout()->undoStack()->endCommand();
498void QgsLayoutItemPropertiesWidget::variablesChanged()
503 if (
QgsLayoutFrame *frame = qobject_cast< QgsLayoutFrame * >( mItem ) )
518 if ( mUpperLeftRadioButton->isChecked() )
522 else if ( mUpperMiddleRadioButton->isChecked() )
526 else if ( mUpperRightRadioButton->isChecked() )
530 else if ( mMiddleLeftRadioButton->isChecked() )
534 else if ( mMiddleRadioButton->isChecked() )
538 else if ( mMiddleRightRadioButton->isChecked() )
542 else if ( mLowerLeftRadioButton->isChecked() )
546 else if ( mLowerMiddleRadioButton->isChecked() )
550 else if ( mLowerRightRadioButton->isChecked() )
557void QgsLayoutItemPropertiesWidget::mStrokeWidthSpinBox_valueChanged(
double d )
566 mItem->layout()->undoStack()->endCommand();
569void QgsLayoutItemPropertiesWidget::strokeUnitChanged(
Qgis::LayoutUnit unit )
578 mItem->layout()->undoStack()->endCommand();
581void QgsLayoutItemPropertiesWidget::mFrameJoinStyleCombo_currentIndexChanged(
int index )
589 mItem->layout()->undoStack()->beginCommand( mItem, tr(
"Change Frame Join Style" ) );
590 mItem->setFrameJoinStyle( mFrameJoinStyleCombo->penJoinStyle() );
591 mItem->layout()->undoStack()->endCommand();
594void QgsLayoutItemPropertiesWidget::mFrameGroupBox_toggled(
bool state )
601 mItem->layout()->undoStack()->beginCommand( mItem, state ? tr(
"Enable Frame" ) : tr(
"Disable Frame" ) );
602 mItem->setFrameEnabled( state );
604 mItem->layout()->undoStack()->endCommand();
607void QgsLayoutItemPropertiesWidget::mBackgroundGroupBox_toggled(
bool state )
614 mItem->layout()->undoStack()->beginCommand( mItem, state ? tr(
"Enable Background" ) : tr(
"Disable Background" ) );
615 mItem->setBackgroundEnabled( state );
616 mItem->layout()->undoStack()->endCommand();
617 mItem->invalidateCache();
621void QgsLayoutItemPropertiesWidget::setValuesForGuiPositionElements()
628 auto block = [ = ](
bool blocked )
630 mXPosSpin->blockSignals( blocked );
631 mYPosSpin->blockSignals( blocked );
632 mPosUnitsComboBox->blockSignals( blocked );
633 mWidthSpin->blockSignals( blocked );
634 mHeightSpin->blockSignals( blocked );
635 mSizeUnitsComboBox->blockSignals( blocked );
636 mUpperLeftRadioButton->blockSignals( blocked );
637 mUpperMiddleRadioButton->blockSignals( blocked );
638 mUpperRightRadioButton->blockSignals( blocked );
639 mMiddleLeftRadioButton->blockSignals( blocked );
640 mMiddleRadioButton->blockSignals( blocked );
641 mMiddleRightRadioButton->blockSignals( blocked );
642 mLowerLeftRadioButton->blockSignals( blocked );
643 mLowerMiddleRadioButton->blockSignals( blocked );
644 mLowerRightRadioButton->blockSignals( blocked );
645 mPageSpinBox->blockSignals( blocked );
651 if ( !mFreezeXPosSpin )
652 mXPosSpin->setValue( point.
x() );
653 if ( !mFreezeYPosSpin )
654 mYPosSpin->setValue( point.
y() );
655 mPosUnitsComboBox->setUnit( point.
units() );
657 switch ( mItem->referencePoint() )
661 mUpperLeftRadioButton->setChecked(
true );
667 mUpperMiddleRadioButton->setChecked(
true );
673 mUpperRightRadioButton->setChecked(
true );
679 mMiddleLeftRadioButton->setChecked(
true );
685 mMiddleRadioButton->setChecked(
true );
691 mMiddleRightRadioButton->setChecked(
true );
697 mLowerLeftRadioButton->setChecked(
true );
703 mLowerMiddleRadioButton->setChecked(
true );
709 mLowerRightRadioButton->setChecked(
true );
715 if ( !mFreezeWidthSpin )
716 mWidthSpin->setValue( size.
width() );
717 if ( !mFreezeHeightSpin )
718 mHeightSpin->setValue( size.
height() );
720 mSizeUnitsComboBox->setUnit( size.
units() );
722 mSizeLockAspectRatio->resetRatio();
723 mPosLockAspectRatio->resetRatio();
725 if ( !mFreezePageSpin )
726 mPageSpinBox->setValue( mItem->page() + 1 );
731void QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements()
738 whileBlocking( mBackgroundColorButton )->setColor( mItem->backgroundColor(
false ) );
739 whileBlocking( mFrameColorButton )->setColor( mItem->frameStrokeColor() );
740 whileBlocking( mStrokeUnitsComboBox )->setUnit( mItem->frameStrokeWidth().units() );
741 whileBlocking( mStrokeWidthSpinBox )->setValue( mItem->frameStrokeWidth().length() );
742 whileBlocking( mFrameJoinStyleCombo )->setPenJoinStyle( mItem->frameJoinStyle() );
744 whileBlocking( mFrameGroupBox )->setChecked( mItem->frameEnabled() );
745 whileBlocking( mBackgroundGroupBox )->setChecked( mItem->hasBackground() );
746 whileBlocking( mBlendModeCombo )->setBlendMode( mItem->blendMode() );
747 whileBlocking( mOpacityWidget )->setOpacity( mItem->itemOpacity() );
748 whileBlocking( mItemRotationSpinBox )->setValue( mItem->itemRotation() );
749 whileBlocking( mExcludeFromPrintsCheckBox )->setChecked( mItem->excludeFromExports() );
750 whileBlocking( mExportGroupNameCombo )->setCurrentText( mItem->customProperty( QStringLiteral(
"pdfExportGroup" ) ).toString() );
769 const QList< QgsPropertyOverrideButton * > buttons = findChildren< QgsPropertyOverrideButton * >();
776void QgsLayoutItemPropertiesWidget::setValuesForGuiElements()
783 mBackgroundColorButton->setColorDialogTitle( tr(
"Select Background Color" ) );
784 mBackgroundColorButton->setAllowOpacity(
true );
785 mBackgroundColorButton->setContext( QStringLiteral(
"composer" ) );
786 mFrameColorButton->setColorDialogTitle( tr(
"Select Frame Color" ) );
787 mFrameColorButton->setAllowOpacity(
true );
788 mFrameColorButton->setContext( QStringLiteral(
"composer" ) );
790 if (
QgsLayout *layout = mItem->layout() )
793 QList< QgsLayoutItem * > items;
794 layout->layoutItems( items );
795 QStringList existingGroups;
798 const QString groupName = item->customProperty( QStringLiteral(
"pdfExportGroup" ) ).toString();
799 if ( !groupName.isEmpty() && !existingGroups.contains( groupName ) )
800 existingGroups.append( groupName );
803 std::sort( existingGroups.begin(), existingGroups.end(), [ = ](
const QString & a,
const QString & b ) ->
bool
805 return a.localeAwareCompare( b ) < 0;
809 whileBlocking( mExportGroupNameCombo )->addItems( existingGroups );
812 setValuesForGuiPositionElements();
813 setValuesForGuiNonPositionElements();
819void QgsLayoutItemPropertiesWidget::mBlendModeCombo_currentIndexChanged(
int index )
824 mItem->layout()->undoStack()->beginCommand( mItem, tr(
"Change Blend Mode" ) );
825 mItem->setBlendMode( mBlendModeCombo->blendMode() );
826 mItem->layout()->undoStack()->endCommand();
830void QgsLayoutItemPropertiesWidget::opacityChanged(
double value )
835 mItem->setItemOpacity( value );
836 mItem->layout()->undoStack()->endCommand();
840void QgsLayoutItemPropertiesWidget::mItemIdLineEdit_editingFinished()
845 mItem->setId( mItemIdLineEdit->text() );
846 mItemIdLineEdit->setText( mItem->id() );
847 mItem->layout()->undoStack()->endCommand();
851void QgsLayoutItemPropertiesWidget::exportGroupNameEditingFinished()
856 mItem->setCustomProperty( QStringLiteral(
"pdfExportGroup" ), mExportGroupNameCombo->currentText() );
857 mItem->layout()->undoStack()->endCommand();
861void QgsLayoutItemPropertiesWidget::mPageSpinBox_valueChanged(
int )
863 mFreezePageSpin =
true;
864 changeItemPosition();
865 mFreezePageSpin =
false;
868void QgsLayoutItemPropertiesWidget::mXPosSpin_valueChanged(
double )
870 mFreezeXPosSpin =
true;
871 changeItemPosition();
872 mFreezeXPosSpin =
false;
875void QgsLayoutItemPropertiesWidget::mYPosSpin_valueChanged(
double )
877 mFreezeYPosSpin =
true;
878 changeItemPosition();
879 mFreezeYPosSpin =
false;
884 changeItemPosition();
887void QgsLayoutItemPropertiesWidget::mWidthSpin_valueChanged(
double )
889 mFreezeWidthSpin =
true;
891 mFreezeWidthSpin =
false;
894void QgsLayoutItemPropertiesWidget::mHeightSpin_valueChanged(
double )
896 mFreezeHeightSpin =
true;
898 mFreezeHeightSpin =
false;
906void QgsLayoutItemPropertiesWidget::mUpperLeftCheckBox_stateChanged(
bool state )
915 setValuesForGuiPositionElements();
918void QgsLayoutItemPropertiesWidget::mUpperMiddleCheckBox_stateChanged(
bool state )
926 setValuesForGuiPositionElements();
929void QgsLayoutItemPropertiesWidget::mUpperRightCheckBox_stateChanged(
bool state )
937 setValuesForGuiPositionElements();
940void QgsLayoutItemPropertiesWidget::mMiddleLeftCheckBox_stateChanged(
bool state )
948 setValuesForGuiPositionElements();
951void QgsLayoutItemPropertiesWidget::mMiddleCheckBox_stateChanged(
bool state )
959 setValuesForGuiPositionElements();
962void QgsLayoutItemPropertiesWidget::mMiddleRightCheckBox_stateChanged(
bool state )
970 setValuesForGuiPositionElements();
973void QgsLayoutItemPropertiesWidget::mLowerLeftCheckBox_stateChanged(
bool state )
981 setValuesForGuiPositionElements();
984void QgsLayoutItemPropertiesWidget::mLowerMiddleCheckBox_stateChanged(
bool state )
992 setValuesForGuiPositionElements();
995void QgsLayoutItemPropertiesWidget::mLowerRightCheckBox_stateChanged(
bool state )
1003 setValuesForGuiPositionElements();
1006void QgsLayoutItemPropertiesWidget::mItemRotationSpinBox_valueChanged(
double val )
1011 mItem->setItemRotation( val,
true );
1013 mItem->layout()->undoStack()->endCommand();
1017void QgsLayoutItemPropertiesWidget::mExcludeFromPrintsCheckBox_toggled(
bool checked )
1021 mItem->layout()->undoStack()->beginCommand( mItem, checked ? tr(
"Exclude from Exports" ) : tr(
"Include in Exports" ) );
1022 mItem->setExcludeFromExports( checked );
1023 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.