33#include <QButtonGroup>
35#include "moc_qgslayoutitemwidget.cpp"
43 , mLayoutObject( layoutObject )
45 if ( mLayoutObject->layout() )
47 connect( &mLayoutObject->layout()->reportContext(), &QgsLayoutReportContext::layerChanged, this, [this] { updateDataDefinedButtons(); } );
55void QgsLayoutConfigObject::updateDataDefinedProperty()
58 QgsPropertyOverrideButton *ddButton = qobject_cast<QgsPropertyOverrideButton *>( sender() );
76 if ( propertyAssociatesWithMultiFrame )
78 if ( QgsLayoutFrame *frame =
dynamic_cast<QgsLayoutFrame *
>( mLayoutObject.data() ) )
80 if ( QgsLayoutMultiFrame *multiFrame = frame->multiFrame() )
82 multiFrame->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
83 multiFrame->refresh();
86 else if ( QgsLayoutMultiFrame *multiFrame =
dynamic_cast<QgsLayoutMultiFrame *
>( mLayoutObject.data() ) )
88 multiFrame->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
89 multiFrame->refresh();
92 else if ( mLayoutObject )
94 mLayoutObject->dataDefinedProperties().setProperty( key, ddButton->
toProperty() );
95 mLayoutObject->refresh();
99void QgsLayoutConfigObject::updateDataDefinedButtons()
101 const QList<QgsPropertyOverrideButton *> buttons = findChildren<QgsPropertyOverrideButton *>();
102 for ( QgsPropertyOverrideButton *button : buttons )
110 button->blockSignals(
true );
114 button->blockSignals(
false );
129 if ( propertyAssociatesWithMultiFrame )
135 whileBlocking( button )->setToProperty( multiFrame->dataDefinedProperties().property( key ) );
140 whileBlocking( button )->setToProperty( multiFrame->dataDefinedProperties().property( key ) );
143 else if ( mLayoutObject )
145 whileBlocking( button )->setToProperty( mLayoutObject->dataDefinedProperties().property( key ) );
155 if ( !mLayoutObject )
160 QgsPrintLayout *printLayout = qobject_cast<QgsPrintLayout *>( mLayoutObject->layout() );
167 return printLayout->
atlas();
172 mLayoutObject = object;
177 if ( !mLayoutObject )
180 QgsLayout *layout = mLayoutObject->layout();
213 oldConfigObject->deleteLater();
220 mConfigObject->deleteLater();
221 mConfigObject = oldConfigObject;
232 const auto symbolButtonWidgets = findChildren<QgsSymbolButton *>();
235 symbolWidget->setMessageBar( iface->
messageBar() );
237 const auto fontButtonWidgets = findChildren<QgsFontButton *>();
240 fontButton->setMessageBar( iface->
messageBar() );
250 mConfigObject->initializeDataDefinedButton( button, property );
255 mConfigObject->updateDataDefinedButton( button );
260 return mConfigObject->coverageLayer();
270 return mConfigObject->layoutAtlas();
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 );
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 );
422 mConfigObject->setObject( mItem );
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 ) )
505 if ( QgsLayoutMultiFrame *mf = frame->multiFrame() )
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 )
565 mItem->setFrameStrokeWidth( QgsLayoutMeasurement( d, mStrokeUnitsComboBox->unit() ) );
566 mItem->layout()->undoStack()->endCommand();
569void QgsLayoutItemPropertiesWidget::strokeUnitChanged(
Qgis::LayoutUnit unit )
577 mItem->setFrameStrokeWidth( QgsLayoutMeasurement( mStrokeWidthSpinBox->value(), 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 = [
this](
bool blocked ) {
629 mXPosSpin->blockSignals( blocked );
630 mYPosSpin->blockSignals( blocked );
631 mPosUnitsComboBox->blockSignals( blocked );
632 mWidthSpin->blockSignals( blocked );
633 mHeightSpin->blockSignals( blocked );
634 mSizeUnitsComboBox->blockSignals( blocked );
635 mUpperLeftRadioButton->blockSignals( blocked );
636 mUpperMiddleRadioButton->blockSignals( blocked );
637 mUpperRightRadioButton->blockSignals( blocked );
638 mMiddleLeftRadioButton->blockSignals( blocked );
639 mMiddleRadioButton->blockSignals( blocked );
640 mMiddleRightRadioButton->blockSignals( blocked );
641 mLowerLeftRadioButton->blockSignals( blocked );
642 mLowerMiddleRadioButton->blockSignals( blocked );
643 mLowerRightRadioButton->blockSignals( blocked );
644 mPageSpinBox->blockSignals( blocked );
648 const QgsLayoutPoint point = mItem->pagePositionWithUnits();
650 if ( !mFreezeXPosSpin )
651 mXPosSpin->setValue( point.
x() );
652 if ( !mFreezeYPosSpin )
653 mYPosSpin->setValue( point.
y() );
654 mPosUnitsComboBox->setUnit( point.
units() );
656 switch ( mItem->referencePoint() )
660 mUpperLeftRadioButton->setChecked(
true );
666 mUpperMiddleRadioButton->setChecked(
true );
672 mUpperRightRadioButton->setChecked(
true );
678 mMiddleLeftRadioButton->setChecked(
true );
684 mMiddleRadioButton->setChecked(
true );
690 mMiddleRightRadioButton->setChecked(
true );
696 mLowerLeftRadioButton->setChecked(
true );
702 mLowerMiddleRadioButton->setChecked(
true );
708 mLowerRightRadioButton->setChecked(
true );
713 const QgsLayoutSize size = mItem->sizeWithUnits();
714 if ( !mFreezeWidthSpin )
715 mWidthSpin->setValue( size.
width() );
716 if ( !mFreezeHeightSpin )
717 mHeightSpin->setValue( size.
height() );
719 mSizeUnitsComboBox->setUnit( size.
units() );
721 mSizeLockAspectRatio->resetRatio();
722 mPosLockAspectRatio->resetRatio();
724 if ( !mFreezePageSpin )
725 mPageSpinBox->setValue( mItem->page() + 1 );
730void QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements()
737 whileBlocking( mBackgroundColorButton )->setColor( mItem->backgroundColor(
false ) );
738 whileBlocking( mFrameColorButton )->setColor( mItem->frameStrokeColor() );
739 whileBlocking( mStrokeUnitsComboBox )->setUnit( mItem->frameStrokeWidth().units() );
740 whileBlocking( mStrokeWidthSpinBox )->setValue( mItem->frameStrokeWidth().length() );
741 whileBlocking( mFrameJoinStyleCombo )->setPenJoinStyle( mItem->frameJoinStyle() );
743 whileBlocking( mFrameGroupBox )->setChecked( mItem->frameEnabled() );
744 whileBlocking( mBackgroundGroupBox )->setChecked( mItem->hasBackground() );
745 whileBlocking( mBlendModeCombo )->setBlendMode( mItem->blendMode() );
746 whileBlocking( mOpacityWidget )->setOpacity( mItem->itemOpacity() );
747 whileBlocking( mItemRotationSpinBox )->setValue( mItem->itemRotation() );
748 whileBlocking( mExcludeFromPrintsCheckBox )->setChecked( mItem->excludeFromExports() );
749 whileBlocking( mExportGroupNameCombo )->setCurrentText( mItem->customProperty( QStringLiteral(
"pdfExportGroup" ) ).toString() );
768 const QList<QgsPropertyOverrideButton *> buttons = findChildren<QgsPropertyOverrideButton *>();
771 mConfigObject->updateDataDefinedButton( button );
775void QgsLayoutItemPropertiesWidget::setValuesForGuiElements()
782 mBackgroundColorButton->setColorDialogTitle( tr(
"Select Background Color" ) );
783 mBackgroundColorButton->setAllowOpacity(
true );
784 mBackgroundColorButton->setContext( QStringLiteral(
"composer" ) );
785 mFrameColorButton->setColorDialogTitle( tr(
"Select Frame Color" ) );
786 mFrameColorButton->setAllowOpacity(
true );
787 mFrameColorButton->setContext( QStringLiteral(
"composer" ) );
789 if ( QgsLayout *layout = mItem->layout() )
792 QList<QgsLayoutItem *> items;
793 layout->layoutItems( items );
794 QStringList existingGroups;
795 for (
const QgsLayoutItem *item : std::as_const( items ) )
797 const QString groupName = item->customProperty( QStringLiteral(
"pdfExportGroup" ) ).toString();
798 if ( !groupName.isEmpty() && !existingGroups.contains( groupName ) )
799 existingGroups.append( groupName );
802 std::sort( existingGroups.begin(), existingGroups.end(), [](
const QString &a,
const QString &b ) ->
bool {
803 return a.localeAwareCompare( b ) < 0;
807 whileBlocking( mExportGroupNameCombo )->addItems( existingGroups );
810 setValuesForGuiPositionElements();
811 setValuesForGuiNonPositionElements();
817void QgsLayoutItemPropertiesWidget::mBlendModeCombo_currentIndexChanged(
int index )
822 mItem->layout()->undoStack()->beginCommand( mItem, tr(
"Change Blend Mode" ) );
823 mItem->setBlendMode( mBlendModeCombo->blendMode() );
824 mItem->layout()->undoStack()->endCommand();
828void QgsLayoutItemPropertiesWidget::opacityChanged(
double value )
833 mItem->setItemOpacity( value );
834 mItem->layout()->undoStack()->endCommand();
838void QgsLayoutItemPropertiesWidget::mItemIdLineEdit_editingFinished()
843 mItem->setId( mItemIdLineEdit->text() );
844 mItemIdLineEdit->setText( mItem->id() );
845 mItem->layout()->undoStack()->endCommand();
849void QgsLayoutItemPropertiesWidget::exportGroupNameEditingFinished()
854 mItem->setCustomProperty( QStringLiteral(
"pdfExportGroup" ), mExportGroupNameCombo->currentText() );
855 mItem->layout()->undoStack()->endCommand();
859void QgsLayoutItemPropertiesWidget::mPageSpinBox_valueChanged(
int )
861 mFreezePageSpin =
true;
862 changeItemPosition();
863 mFreezePageSpin =
false;
866void QgsLayoutItemPropertiesWidget::mXPosSpin_valueChanged(
double )
868 mFreezeXPosSpin =
true;
869 changeItemPosition();
870 mFreezeXPosSpin =
false;
873void QgsLayoutItemPropertiesWidget::mYPosSpin_valueChanged(
double )
875 mFreezeYPosSpin =
true;
876 changeItemPosition();
877 mFreezeYPosSpin =
false;
882 changeItemPosition();
885void QgsLayoutItemPropertiesWidget::mWidthSpin_valueChanged(
double )
887 mFreezeWidthSpin =
true;
889 mFreezeWidthSpin =
false;
892void QgsLayoutItemPropertiesWidget::mHeightSpin_valueChanged(
double )
894 mFreezeHeightSpin =
true;
896 mFreezeHeightSpin =
false;
904void QgsLayoutItemPropertiesWidget::mUpperLeftCheckBox_stateChanged(
bool state )
913 setValuesForGuiPositionElements();
916void QgsLayoutItemPropertiesWidget::mUpperMiddleCheckBox_stateChanged(
bool state )
924 setValuesForGuiPositionElements();
927void QgsLayoutItemPropertiesWidget::mUpperRightCheckBox_stateChanged(
bool state )
935 setValuesForGuiPositionElements();
938void QgsLayoutItemPropertiesWidget::mMiddleLeftCheckBox_stateChanged(
bool state )
946 setValuesForGuiPositionElements();
949void QgsLayoutItemPropertiesWidget::mMiddleCheckBox_stateChanged(
bool state )
957 setValuesForGuiPositionElements();
960void QgsLayoutItemPropertiesWidget::mMiddleRightCheckBox_stateChanged(
bool state )
968 setValuesForGuiPositionElements();
971void QgsLayoutItemPropertiesWidget::mLowerLeftCheckBox_stateChanged(
bool state )
979 setValuesForGuiPositionElements();
982void QgsLayoutItemPropertiesWidget::mLowerMiddleCheckBox_stateChanged(
bool state )
990 setValuesForGuiPositionElements();
993void QgsLayoutItemPropertiesWidget::mLowerRightCheckBox_stateChanged(
bool state )
1001 setValuesForGuiPositionElements();
1004void QgsLayoutItemPropertiesWidget::mItemRotationSpinBox_valueChanged(
double val )
1009 mItem->setItemRotation( val,
true );
1011 mItem->layout()->undoStack()->endCommand();
1015void QgsLayoutItemPropertiesWidget::mExcludeFromPrintsCheckBox_toggled(
bool checked )
1019 mItem->layout()->undoStack()->beginCommand( mItem, checked ? tr(
"Exclude from Exports" ) : tr(
"Include in Exports" ) );
1020 mItem->setExcludeFromExports( checked );
1021 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.