33#include <QButtonGroup>
36#include "moc_qgslayoutitemwidget.cpp"
38using namespace Qt::StringLiterals;
46 , mLayoutObject( layoutObject )
48 if ( mLayoutObject->layout() )
50 connect( &mLayoutObject->layout()->reportContext(), &QgsLayoutReportContext::layerChanged, this, [this] { updateDataDefinedButtons(); } );
58void QgsLayoutConfigObject::updateDataDefinedProperty()
61 QgsPropertyOverrideButton *ddButton = qobject_cast<QgsPropertyOverrideButton *>( sender() );
79 if ( propertyAssociatesWithMultiFrame )
81 if ( QgsLayoutFrame *frame =
dynamic_cast<QgsLayoutFrame *
>( mLayoutObject.data() ) )
83 if ( QgsLayoutMultiFrame *multiFrame = frame->multiFrame() )
85 multiFrame->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
86 multiFrame->refresh();
89 else if ( QgsLayoutMultiFrame *multiFrame =
dynamic_cast<QgsLayoutMultiFrame *
>( mLayoutObject.data() ) )
91 multiFrame->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
92 multiFrame->refresh();
95 else if ( mLayoutObject )
97 mLayoutObject->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
98 mLayoutObject->refresh();
102void QgsLayoutConfigObject::updateDataDefinedButtons()
104 const QList<QgsPropertyOverrideButton *> buttons = findChildren<QgsPropertyOverrideButton *>();
105 for ( QgsPropertyOverrideButton *button : buttons )
113 button->blockSignals(
true );
117 button->blockSignals(
false );
132 if ( propertyAssociatesWithMultiFrame )
138 whileBlocking( button )->setToProperty( multiFrame->dataDefinedProperties().property( key ) );
143 whileBlocking( button )->setToProperty( multiFrame->dataDefinedProperties().property( key ) );
146 else if ( mLayoutObject )
148 whileBlocking( button )->setToProperty( mLayoutObject->dataDefinedProperties().property( key ) );
158 if ( !mLayoutObject )
163 QgsPrintLayout *printLayout = qobject_cast<QgsPrintLayout *>( mLayoutObject->layout() );
170 return printLayout->
atlas();
175 mLayoutObject = object;
180 if ( !mLayoutObject )
183 QgsLayout *layout = mLayoutObject->layout();
216 oldConfigObject->deleteLater();
223 mConfigObject->deleteLater();
224 mConfigObject = oldConfigObject;
235 const auto symbolButtonWidgets = findChildren<QgsSymbolButton *>();
238 symbolWidget->setMessageBar( iface->
messageBar() );
240 const auto fontButtonWidgets = findChildren<QgsFontButton *>();
243 fontButton->setMessageBar( iface->
messageBar() );
253 mConfigObject->initializeDataDefinedButton( button, property );
258 mConfigObject->updateDataDefinedButton( button );
263 return mConfigObject->coverageLayer();
273 return mConfigObject->layoutAtlas();
286 mBlockVariableUpdates =
true;
288 mVariableEditor->setContext( &context );
293 const int multiFrameScopeIndex = context.
indexOfScope( tr(
"Multiframe Item" ) );
294 const int itemScopeIndex = context.
indexOfScope( tr(
"Layout Item" ) );
295 if ( multiFrameScopeIndex >= 0 )
296 mVariableEditor->setEditableScopeIndex( multiFrameScopeIndex );
297 else if ( itemScopeIndex >= 0 )
298 mVariableEditor->setEditableScopeIndex( itemScopeIndex );
299 mBlockVariableUpdates =
false;
308 mVariableEditor->setMinimumHeight( mVariableEditor->fontMetrics().height() * 15 );
310 mItemRotationSpinBox->setClearValue( 0 );
311 mStrokeUnitsComboBox->linkToWidget( mStrokeWidthSpinBox );
316 exportGroupLineEdit->setPlaceholderText( tr(
"Not set" ) );
317 mExportGroupNameCombo->setLineEdit( exportGroupLineEdit );
319 mPosUnitsComboBox->linkToWidget( mXPosSpin );
320 mPosUnitsComboBox->linkToWidget( mYPosSpin );
321 mSizeUnitsComboBox->linkToWidget( mWidthSpin );
322 mSizeUnitsComboBox->linkToWidget( mHeightSpin );
327 mPosLockAspectRatio->setWidthSpinBox( mXPosSpin );
328 mPosLockAspectRatio->setHeightSpinBox( mYPosSpin );
329 mSizeLockAspectRatio->setWidthSpinBox( mWidthSpin );
330 mSizeLockAspectRatio->setHeightSpinBox( mHeightSpin );
332 mItemFrameColorDDBtn->registerLinkedWidget( mFrameColorButton );
333 mItemBackgroundColorDDBtn->registerLinkedWidget( mBackgroundColorButton );
336 connect( mBackgroundColorButton, &
QgsColorButton::colorChanged,
this, &QgsLayoutItemPropertiesWidget::mBackgroundColorButton_colorChanged );
337 connect( mStrokeWidthSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mStrokeWidthSpinBox_valueChanged );
339 connect( mFrameGroupBox, &QgsCollapsibleGroupBoxBasic::toggled,
this, &QgsLayoutItemPropertiesWidget::mFrameGroupBox_toggled );
340 connect( mFrameJoinStyleCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutItemPropertiesWidget::mFrameJoinStyleCombo_currentIndexChanged );
341 connect( mBackgroundGroupBox, &QgsCollapsibleGroupBoxBasic::toggled,
this, &QgsLayoutItemPropertiesWidget::mBackgroundGroupBox_toggled );
342 connect( mItemIdLineEdit, &QLineEdit::editingFinished,
this, &QgsLayoutItemPropertiesWidget::mItemIdLineEdit_editingFinished );
343 connect( mExportGroupNameCombo, &QComboBox::currentTextChanged,
this, &QgsLayoutItemPropertiesWidget::exportGroupNameEditingFinished );
344 connect( mPageSpinBox,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mPageSpinBox_valueChanged );
345 connect( mXPosSpin,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mXPosSpin_valueChanged );
346 connect( mYPosSpin,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mYPosSpin_valueChanged );
348 connect( mWidthSpin,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mWidthSpin_valueChanged );
349 connect( mHeightSpin,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mHeightSpin_valueChanged );
351 connect( mUpperLeftRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mUpperLeftCheckBox_stateChanged );
352 connect( mUpperMiddleRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mUpperMiddleCheckBox_stateChanged );
353 connect( mUpperRightRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mUpperRightCheckBox_stateChanged );
354 connect( mMiddleLeftRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mMiddleLeftCheckBox_stateChanged );
355 connect( mMiddleRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mMiddleCheckBox_stateChanged );
356 connect( mMiddleRightRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mMiddleRightCheckBox_stateChanged );
357 connect( mLowerLeftRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mLowerLeftCheckBox_stateChanged );
358 connect( mLowerMiddleRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mLowerMiddleCheckBox_stateChanged );
359 connect( mLowerRightRadioButton, &QRadioButton::toggled,
this, &QgsLayoutItemPropertiesWidget::mLowerRightCheckBox_stateChanged );
360 connect( mBlendModeCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsLayoutItemPropertiesWidget::mBlendModeCombo_currentIndexChanged );
361 connect( mItemRotationSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsLayoutItemPropertiesWidget::mItemRotationSpinBox_valueChanged );
362 connect( mExcludeFromPrintsCheckBox, &QCheckBox::toggled,
this, &QgsLayoutItemPropertiesWidget::mExcludeFromPrintsCheckBox_toggled );
365 QButtonGroup *buttonGroup =
new QButtonGroup(
this );
366 buttonGroup->addButton( mUpperLeftRadioButton );
367 buttonGroup->addButton( mUpperMiddleRadioButton );
368 buttonGroup->addButton( mUpperRightRadioButton );
369 buttonGroup->addButton( mMiddleLeftRadioButton );
370 buttonGroup->addButton( mMiddleRadioButton );
371 buttonGroup->addButton( mMiddleRightRadioButton );
372 buttonGroup->addButton( mLowerLeftRadioButton );
373 buttonGroup->addButton( mLowerMiddleRadioButton );
374 buttonGroup->addButton( mLowerRightRadioButton );
375 buttonGroup->setExclusive(
true );
385 if ( !mBlockVariableUpdates )
386 QgsLayoutItemPropertiesWidget::variablesChanged();
403 mBackgroundGroupBox->setVisible( showGroup );
408 mFrameGroupBox->setVisible( showGroup );
416 disconnect( mItem, &
QgsLayoutObject::changed,
this, &QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements );
422 connect( mItem, &
QgsLayoutObject::changed,
this, &QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements );
425 mConfigObject->setObject( mItem );
427 setValuesForGuiElements();
441void QgsLayoutItemPropertiesWidget::mFrameColorButton_colorChanged(
const QColor &newFrameColor )
448 mItem->setFrameStrokeColor( newFrameColor );
449 mItem->layout()->undoStack()->endCommand();
453void QgsLayoutItemPropertiesWidget::mBackgroundColorButton_colorChanged(
const QColor &newBackgroundColor )
460 mItem->setBackgroundColor( newBackgroundColor );
461 mItem->layout()->undoStack()->endCommand();
462 mItem->invalidateCache();
465void QgsLayoutItemPropertiesWidget::changeItemPosition()
472 const QgsLayoutPoint point( mXPosSpin->value(), mYPosSpin->value(), mPosUnitsComboBox->unit() );
473 mItem->attemptMove( point,
true,
false, mPageSpinBox->value() - 1 );
475 mItem->layout()->undoStack()->endCommand();
483 mItem->layout()->undoStack()->beginCommand( mItem, tr(
"Change Item Reference" ) );
484 mItem->setReferencePoint( point );
485 mItem->layout()->undoStack()->endCommand();
488void QgsLayoutItemPropertiesWidget::changeItemSize()
495 const QgsLayoutSize size( mWidthSpin->value(), mHeightSpin->value(), mSizeUnitsComboBox->unit() );
496 mItem->attemptResize( size );
498 mItem->layout()->undoStack()->endCommand();
501void QgsLayoutItemPropertiesWidget::variablesChanged()
506 if ( QgsLayoutFrame *frame = qobject_cast<QgsLayoutFrame *>( mItem ) )
508 if ( QgsLayoutMultiFrame *mf = frame->multiFrame() )
521 if ( mUpperLeftRadioButton->isChecked() )
525 else if ( mUpperMiddleRadioButton->isChecked() )
529 else if ( mUpperRightRadioButton->isChecked() )
533 else if ( mMiddleLeftRadioButton->isChecked() )
537 else if ( mMiddleRadioButton->isChecked() )
541 else if ( mMiddleRightRadioButton->isChecked() )
545 else if ( mLowerLeftRadioButton->isChecked() )
549 else if ( mLowerMiddleRadioButton->isChecked() )
553 else if ( mLowerRightRadioButton->isChecked() )
560void QgsLayoutItemPropertiesWidget::mStrokeWidthSpinBox_valueChanged(
double d )
568 mItem->setFrameStrokeWidth( QgsLayoutMeasurement( d, mStrokeUnitsComboBox->unit() ) );
569 mItem->layout()->undoStack()->endCommand();
572void QgsLayoutItemPropertiesWidget::strokeUnitChanged(
Qgis::LayoutUnit unit )
580 mItem->setFrameStrokeWidth( QgsLayoutMeasurement( mStrokeWidthSpinBox->value(), unit ) );
581 mItem->layout()->undoStack()->endCommand();
584void QgsLayoutItemPropertiesWidget::mFrameJoinStyleCombo_currentIndexChanged(
int index )
592 mItem->layout()->undoStack()->beginCommand( mItem, tr(
"Change Frame Join Style" ) );
593 mItem->setFrameJoinStyle( mFrameJoinStyleCombo->penJoinStyle() );
594 mItem->layout()->undoStack()->endCommand();
597void QgsLayoutItemPropertiesWidget::mFrameGroupBox_toggled(
bool state )
604 mItem->layout()->undoStack()->beginCommand( mItem, state ? tr(
"Enable Frame" ) : tr(
"Disable Frame" ) );
605 mItem->setFrameEnabled( state );
607 mItem->layout()->undoStack()->endCommand();
610void QgsLayoutItemPropertiesWidget::mBackgroundGroupBox_toggled(
bool state )
617 mItem->layout()->undoStack()->beginCommand( mItem, state ? tr(
"Enable Background" ) : tr(
"Disable Background" ) );
618 mItem->setBackgroundEnabled( state );
619 mItem->layout()->undoStack()->endCommand();
620 mItem->invalidateCache();
624void QgsLayoutItemPropertiesWidget::setValuesForGuiPositionElements()
631 auto block = [
this](
bool blocked ) {
632 mXPosSpin->blockSignals( blocked );
633 mYPosSpin->blockSignals( blocked );
634 mPosUnitsComboBox->blockSignals( blocked );
635 mWidthSpin->blockSignals( blocked );
636 mHeightSpin->blockSignals( blocked );
637 mSizeUnitsComboBox->blockSignals( blocked );
638 mUpperLeftRadioButton->blockSignals( blocked );
639 mUpperMiddleRadioButton->blockSignals( blocked );
640 mUpperRightRadioButton->blockSignals( blocked );
641 mMiddleLeftRadioButton->blockSignals( blocked );
642 mMiddleRadioButton->blockSignals( blocked );
643 mMiddleRightRadioButton->blockSignals( blocked );
644 mLowerLeftRadioButton->blockSignals( blocked );
645 mLowerMiddleRadioButton->blockSignals( blocked );
646 mLowerRightRadioButton->blockSignals( blocked );
647 mPageSpinBox->blockSignals( blocked );
651 const QgsLayoutPoint point = mItem->pagePositionWithUnits();
653 if ( !mFreezeXPosSpin )
654 mXPosSpin->setValue( point.
x() );
655 if ( !mFreezeYPosSpin )
656 mYPosSpin->setValue( point.
y() );
657 mPosUnitsComboBox->setUnit( point.
units() );
659 switch ( mItem->referencePoint() )
663 mUpperLeftRadioButton->setChecked(
true );
669 mUpperMiddleRadioButton->setChecked(
true );
675 mUpperRightRadioButton->setChecked(
true );
681 mMiddleLeftRadioButton->setChecked(
true );
687 mMiddleRadioButton->setChecked(
true );
693 mMiddleRightRadioButton->setChecked(
true );
699 mLowerLeftRadioButton->setChecked(
true );
705 mLowerMiddleRadioButton->setChecked(
true );
711 mLowerRightRadioButton->setChecked(
true );
716 const QgsLayoutSize size = mItem->sizeWithUnits();
717 if ( !mFreezeWidthSpin )
718 mWidthSpin->setValue( size.
width() );
719 if ( !mFreezeHeightSpin )
720 mHeightSpin->setValue( size.
height() );
722 mSizeUnitsComboBox->setUnit( size.
units() );
724 mSizeLockAspectRatio->resetRatio();
725 mPosLockAspectRatio->resetRatio();
727 if ( !mFreezePageSpin )
728 mPageSpinBox->setValue( mItem->page() + 1 );
733void QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements()
740 whileBlocking( mBackgroundColorButton )->setColor( mItem->backgroundColor(
false ) );
741 whileBlocking( mFrameColorButton )->setColor( mItem->frameStrokeColor() );
742 whileBlocking( mStrokeUnitsComboBox )->setUnit( mItem->frameStrokeWidth().units() );
743 whileBlocking( mStrokeWidthSpinBox )->setValue( mItem->frameStrokeWidth().length() );
744 whileBlocking( mFrameJoinStyleCombo )->setPenJoinStyle( mItem->frameJoinStyle() );
746 whileBlocking( mFrameGroupBox )->setChecked( mItem->frameEnabled() );
747 whileBlocking( mBackgroundGroupBox )->setChecked( mItem->hasBackground() );
748 whileBlocking( mBlendModeCombo )->setBlendMode( mItem->blendMode() );
749 whileBlocking( mOpacityWidget )->setOpacity( mItem->itemOpacity() );
750 whileBlocking( mItemRotationSpinBox )->setValue( mItem->itemRotation() );
751 whileBlocking( mExcludeFromPrintsCheckBox )->setChecked( mItem->excludeFromExports() );
752 whileBlocking( mExportGroupNameCombo )->setCurrentText( mItem->customProperty( u
"pdfExportGroup"_s ).toString() );
771 const QList<QgsPropertyOverrideButton *> buttons = findChildren<QgsPropertyOverrideButton *>();
774 mConfigObject->updateDataDefinedButton( button );
778void QgsLayoutItemPropertiesWidget::setValuesForGuiElements()
785 mBackgroundColorButton->setColorDialogTitle( tr(
"Select Background Color" ) );
786 mBackgroundColorButton->setAllowOpacity(
true );
787 mBackgroundColorButton->setContext( u
"composer"_s );
788 mFrameColorButton->setColorDialogTitle( tr(
"Select Frame Color" ) );
789 mFrameColorButton->setAllowOpacity(
true );
790 mFrameColorButton->setContext( u
"composer"_s );
792 if ( QgsLayout *layout = mItem->layout() )
795 QList<QgsLayoutItem *> items;
796 layout->layoutItems( items );
797 QStringList existingGroups;
798 for (
const QgsLayoutItem *item : std::as_const( items ) )
800 const QString groupName = item->customProperty( u
"pdfExportGroup"_s ).toString();
801 if ( !groupName.isEmpty() && !existingGroups.contains( groupName ) )
802 existingGroups.append( groupName );
805 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( u
"pdfExportGroup"_s, 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.
Used to render QgsLayout as an atlas, by iterating over the features from an associated vector layer.
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.
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.
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.
QgsVectorLayer * layer() const
Returns the vector layer associated with the layout's context.
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 dataset.
QgsSignalBlocker< Object > whileBlocking(Object *object)
Temporarily blocks signals from a QObject while calling a single method from the object.