17#include "moc_qgslayoutitemwidget.cpp" 
   32#include <QButtonGroup> 
   40  , mLayoutObject( layoutObject )
 
   42  if ( mLayoutObject->layout() )
 
 
   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 )
 
 
  210    oldConfigObject->deleteLater();
 
  217    mConfigObject->deleteLater();
 
  218    mConfigObject = oldConfigObject;
 
 
  229  const auto symbolButtonWidgets = findChildren<QgsSymbolButton *>();
 
  232    symbolWidget->setMessageBar( iface->
messageBar() );
 
  234  const auto fontButtonWidgets = findChildren<QgsFontButton *>();
 
  237    fontButton->setMessageBar( iface->
messageBar() );
 
 
  280  mBlockVariableUpdates = 
true;
 
  282  mVariableEditor->setContext( &context );
 
  287  const int multiFrameScopeIndex = context.
indexOfScope( tr( 
"Multiframe Item" ) );
 
  288  const int itemScopeIndex = context.
indexOfScope( tr( 
"Layout Item" ) );
 
  289  if ( multiFrameScopeIndex >= 0 )
 
  290    mVariableEditor->setEditableScopeIndex( multiFrameScopeIndex );
 
  291  else if ( itemScopeIndex >= 0 )
 
  292    mVariableEditor->setEditableScopeIndex( itemScopeIndex );
 
  293  mBlockVariableUpdates = 
false;
 
 
  302  mVariableEditor->setMinimumHeight( mVariableEditor->fontMetrics().height() * 15 );
 
  304  mItemRotationSpinBox->setClearValue( 0 );
 
  305  mStrokeUnitsComboBox->linkToWidget( mStrokeWidthSpinBox );
 
  310  exportGroupLineEdit->setPlaceholderText( tr( 
"Not set" ) );
 
  311  mExportGroupNameCombo->setLineEdit( exportGroupLineEdit );
 
  313  mPosUnitsComboBox->linkToWidget( mXPosSpin );
 
  314  mPosUnitsComboBox->linkToWidget( mYPosSpin );
 
  315  mSizeUnitsComboBox->linkToWidget( mWidthSpin );
 
  316  mSizeUnitsComboBox->linkToWidget( mHeightSpin );
 
  321  mPosLockAspectRatio->setWidthSpinBox( mXPosSpin );
 
  322  mPosLockAspectRatio->setHeightSpinBox( mYPosSpin );
 
  323  mSizeLockAspectRatio->setWidthSpinBox( mWidthSpin );
 
  324  mSizeLockAspectRatio->setHeightSpinBox( mHeightSpin );
 
  326  mItemFrameColorDDBtn->registerLinkedWidget( mFrameColorButton );
 
  327  mItemBackgroundColorDDBtn->registerLinkedWidget( mBackgroundColorButton );
 
  330  connect( mBackgroundColorButton, &
QgsColorButton::colorChanged, 
this, &QgsLayoutItemPropertiesWidget::mBackgroundColorButton_colorChanged );
 
  331  connect( mStrokeWidthSpinBox, 
static_cast<void ( QDoubleSpinBox::* )( 
double )
>( &QDoubleSpinBox::valueChanged ), 
this, &QgsLayoutItemPropertiesWidget::mStrokeWidthSpinBox_valueChanged );
 
  333  connect( mFrameGroupBox, &QgsCollapsibleGroupBoxBasic::toggled, 
this, &QgsLayoutItemPropertiesWidget::mFrameGroupBox_toggled );
 
  334  connect( mFrameJoinStyleCombo, 
static_cast<void ( QComboBox::* )( 
int )
>( &QComboBox::currentIndexChanged ), 
this, &QgsLayoutItemPropertiesWidget::mFrameJoinStyleCombo_currentIndexChanged );
 
  335  connect( mBackgroundGroupBox, &QgsCollapsibleGroupBoxBasic::toggled, 
this, &QgsLayoutItemPropertiesWidget::mBackgroundGroupBox_toggled );
 
  336  connect( mItemIdLineEdit, &QLineEdit::editingFinished, 
this, &QgsLayoutItemPropertiesWidget::mItemIdLineEdit_editingFinished );
 
  337  connect( mExportGroupNameCombo, &QComboBox::currentTextChanged, 
this, &QgsLayoutItemPropertiesWidget::exportGroupNameEditingFinished );
 
  338  connect( mPageSpinBox, 
static_cast<void ( QSpinBox::* )( 
int )
>( &QSpinBox::valueChanged ), 
this, &QgsLayoutItemPropertiesWidget::mPageSpinBox_valueChanged );
 
  339  connect( mXPosSpin, 
static_cast<void ( QDoubleSpinBox::* )( 
double )
>( &QDoubleSpinBox::valueChanged ), 
this, &QgsLayoutItemPropertiesWidget::mXPosSpin_valueChanged );
 
  340  connect( mYPosSpin, 
static_cast<void ( QDoubleSpinBox::* )( 
double )
>( &QDoubleSpinBox::valueChanged ), 
this, &QgsLayoutItemPropertiesWidget::mYPosSpin_valueChanged );
 
  342  connect( mWidthSpin, 
static_cast<void ( QDoubleSpinBox::* )( 
double )
>( &QDoubleSpinBox::valueChanged ), 
this, &QgsLayoutItemPropertiesWidget::mWidthSpin_valueChanged );
 
  343  connect( mHeightSpin, 
static_cast<void ( QDoubleSpinBox::* )( 
double )
>( &QDoubleSpinBox::valueChanged ), 
this, &QgsLayoutItemPropertiesWidget::mHeightSpin_valueChanged );
 
  345  connect( mUpperLeftRadioButton, &QRadioButton::toggled, 
this, &QgsLayoutItemPropertiesWidget::mUpperLeftCheckBox_stateChanged );
 
  346  connect( mUpperMiddleRadioButton, &QRadioButton::toggled, 
this, &QgsLayoutItemPropertiesWidget::mUpperMiddleCheckBox_stateChanged );
 
  347  connect( mUpperRightRadioButton, &QRadioButton::toggled, 
this, &QgsLayoutItemPropertiesWidget::mUpperRightCheckBox_stateChanged );
 
  348  connect( mMiddleLeftRadioButton, &QRadioButton::toggled, 
this, &QgsLayoutItemPropertiesWidget::mMiddleLeftCheckBox_stateChanged );
 
  349  connect( mMiddleRadioButton, &QRadioButton::toggled, 
this, &QgsLayoutItemPropertiesWidget::mMiddleCheckBox_stateChanged );
 
  350  connect( mMiddleRightRadioButton, &QRadioButton::toggled, 
this, &QgsLayoutItemPropertiesWidget::mMiddleRightCheckBox_stateChanged );
 
  351  connect( mLowerLeftRadioButton, &QRadioButton::toggled, 
this, &QgsLayoutItemPropertiesWidget::mLowerLeftCheckBox_stateChanged );
 
  352  connect( mLowerMiddleRadioButton, &QRadioButton::toggled, 
this, &QgsLayoutItemPropertiesWidget::mLowerMiddleCheckBox_stateChanged );
 
  353  connect( mLowerRightRadioButton, &QRadioButton::toggled, 
this, &QgsLayoutItemPropertiesWidget::mLowerRightCheckBox_stateChanged );
 
  354  connect( mBlendModeCombo, 
static_cast<void ( QComboBox::* )( 
int )
>( &QComboBox::currentIndexChanged ), 
this, &QgsLayoutItemPropertiesWidget::mBlendModeCombo_currentIndexChanged );
 
  355  connect( mItemRotationSpinBox, 
static_cast<void ( QDoubleSpinBox::* )( 
double )
>( &QDoubleSpinBox::valueChanged ), 
this, &QgsLayoutItemPropertiesWidget::mItemRotationSpinBox_valueChanged );
 
  356  connect( mExcludeFromPrintsCheckBox, &QCheckBox::toggled, 
this, &QgsLayoutItemPropertiesWidget::mExcludeFromPrintsCheckBox_toggled );
 
  359  QButtonGroup *buttonGroup = 
new QButtonGroup( 
this );
 
  360  buttonGroup->addButton( mUpperLeftRadioButton );
 
  361  buttonGroup->addButton( mUpperMiddleRadioButton );
 
  362  buttonGroup->addButton( mUpperRightRadioButton );
 
  363  buttonGroup->addButton( mMiddleLeftRadioButton );
 
  364  buttonGroup->addButton( mMiddleRadioButton );
 
  365  buttonGroup->addButton( mMiddleRightRadioButton );
 
  366  buttonGroup->addButton( mLowerLeftRadioButton );
 
  367  buttonGroup->addButton( mLowerMiddleRadioButton );
 
  368  buttonGroup->addButton( mLowerRightRadioButton );
 
  369  buttonGroup->setExclusive( 
true );
 
  379    if ( !mBlockVariableUpdates )
 
  380      QgsLayoutItemPropertiesWidget::variablesChanged();
 
 
  397  mBackgroundGroupBox->setVisible( showGroup );
 
 
  402  mFrameGroupBox->setVisible( showGroup );
 
 
  410    disconnect( mItem, &
QgsLayoutObject::changed, 
this, &QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements );
 
  416    connect( mItem, &
QgsLayoutObject::changed, 
this, &QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements );
 
  421  setValuesForGuiElements();
 
 
  435void QgsLayoutItemPropertiesWidget::mFrameColorButton_colorChanged( 
const QColor &newFrameColor )
 
  442  mItem->setFrameStrokeColor( newFrameColor );
 
  443  mItem->layout()->undoStack()->endCommand();
 
  447void QgsLayoutItemPropertiesWidget::mBackgroundColorButton_colorChanged( 
const QColor &newBackgroundColor )
 
  454  mItem->setBackgroundColor( newBackgroundColor );
 
  455  mItem->layout()->undoStack()->endCommand();
 
  456  mItem->invalidateCache();
 
  459void QgsLayoutItemPropertiesWidget::changeItemPosition()
 
  466  const QgsLayoutPoint point( mXPosSpin->value(), mYPosSpin->value(), mPosUnitsComboBox->unit() );
 
  467  mItem->attemptMove( point, 
true, 
false, mPageSpinBox->value() - 1 );
 
  469  mItem->layout()->undoStack()->endCommand();
 
  477  mItem->layout()->undoStack()->beginCommand( mItem, tr( 
"Change Item Reference" ) );
 
  478  mItem->setReferencePoint( point );
 
  479  mItem->layout()->undoStack()->endCommand();
 
  482void QgsLayoutItemPropertiesWidget::changeItemSize()
 
  489  const QgsLayoutSize size( mWidthSpin->value(), mHeightSpin->value(), mSizeUnitsComboBox->unit() );
 
  490  mItem->attemptResize( size );
 
  492  mItem->layout()->undoStack()->endCommand();
 
  495void QgsLayoutItemPropertiesWidget::variablesChanged()
 
  500  if ( 
QgsLayoutFrame *frame = qobject_cast<QgsLayoutFrame *>( mItem ) )
 
  515  if ( mUpperLeftRadioButton->isChecked() )
 
  519  else if ( mUpperMiddleRadioButton->isChecked() )
 
  523  else if ( mUpperRightRadioButton->isChecked() )
 
  527  else if ( mMiddleLeftRadioButton->isChecked() )
 
  531  else if ( mMiddleRadioButton->isChecked() )
 
  535  else if ( mMiddleRightRadioButton->isChecked() )
 
  539  else if ( mLowerLeftRadioButton->isChecked() )
 
  543  else if ( mLowerMiddleRadioButton->isChecked() )
 
  547  else if ( mLowerRightRadioButton->isChecked() )
 
 
  554void QgsLayoutItemPropertiesWidget::mStrokeWidthSpinBox_valueChanged( 
double d )
 
  563  mItem->layout()->undoStack()->endCommand();
 
  566void QgsLayoutItemPropertiesWidget::strokeUnitChanged( 
Qgis::LayoutUnit unit )
 
  575  mItem->layout()->undoStack()->endCommand();
 
  578void QgsLayoutItemPropertiesWidget::mFrameJoinStyleCombo_currentIndexChanged( 
int index )
 
  586  mItem->layout()->undoStack()->beginCommand( mItem, tr( 
"Change Frame Join Style" ) );
 
  587  mItem->setFrameJoinStyle( mFrameJoinStyleCombo->penJoinStyle() );
 
  588  mItem->layout()->undoStack()->endCommand();
 
  591void QgsLayoutItemPropertiesWidget::mFrameGroupBox_toggled( 
bool state )
 
  598  mItem->layout()->undoStack()->beginCommand( mItem, state ? tr( 
"Enable Frame" ) : tr( 
"Disable Frame" ) );
 
  599  mItem->setFrameEnabled( state );
 
  601  mItem->layout()->undoStack()->endCommand();
 
  604void QgsLayoutItemPropertiesWidget::mBackgroundGroupBox_toggled( 
bool state )
 
  611  mItem->layout()->undoStack()->beginCommand( mItem, state ? tr( 
"Enable Background" ) : tr( 
"Disable Background" ) );
 
  612  mItem->setBackgroundEnabled( state );
 
  613  mItem->layout()->undoStack()->endCommand();
 
  614  mItem->invalidateCache();
 
  618void QgsLayoutItemPropertiesWidget::setValuesForGuiPositionElements()
 
  625  auto block = [
this]( 
bool blocked ) {
 
  626    mXPosSpin->blockSignals( blocked );
 
  627    mYPosSpin->blockSignals( blocked );
 
  628    mPosUnitsComboBox->blockSignals( blocked );
 
  629    mWidthSpin->blockSignals( blocked );
 
  630    mHeightSpin->blockSignals( blocked );
 
  631    mSizeUnitsComboBox->blockSignals( blocked );
 
  632    mUpperLeftRadioButton->blockSignals( blocked );
 
  633    mUpperMiddleRadioButton->blockSignals( blocked );
 
  634    mUpperRightRadioButton->blockSignals( blocked );
 
  635    mMiddleLeftRadioButton->blockSignals( blocked );
 
  636    mMiddleRadioButton->blockSignals( blocked );
 
  637    mMiddleRightRadioButton->blockSignals( blocked );
 
  638    mLowerLeftRadioButton->blockSignals( blocked );
 
  639    mLowerMiddleRadioButton->blockSignals( blocked );
 
  640    mLowerRightRadioButton->blockSignals( blocked );
 
  641    mPageSpinBox->blockSignals( blocked );
 
  647  if ( !mFreezeXPosSpin )
 
  648    mXPosSpin->setValue( point.
x() );
 
  649  if ( !mFreezeYPosSpin )
 
  650    mYPosSpin->setValue( point.
y() );
 
  651  mPosUnitsComboBox->setUnit( point.
units() );
 
  653  switch ( mItem->referencePoint() )
 
  657      mUpperLeftRadioButton->setChecked( 
true );
 
  663      mUpperMiddleRadioButton->setChecked( 
true );
 
  669      mUpperRightRadioButton->setChecked( 
true );
 
  675      mMiddleLeftRadioButton->setChecked( 
true );
 
  681      mMiddleRadioButton->setChecked( 
true );
 
  687      mMiddleRightRadioButton->setChecked( 
true );
 
  693      mLowerLeftRadioButton->setChecked( 
true );
 
  699      mLowerMiddleRadioButton->setChecked( 
true );
 
  705      mLowerRightRadioButton->setChecked( 
true );
 
  711  if ( !mFreezeWidthSpin )
 
  712    mWidthSpin->setValue( size.
width() );
 
  713  if ( !mFreezeHeightSpin )
 
  714    mHeightSpin->setValue( size.
height() );
 
  716  mSizeUnitsComboBox->setUnit( size.
units() );
 
  718  mSizeLockAspectRatio->resetRatio();
 
  719  mPosLockAspectRatio->resetRatio();
 
  721  if ( !mFreezePageSpin )
 
  722    mPageSpinBox->setValue( mItem->page() + 1 );
 
  727void QgsLayoutItemPropertiesWidget::setValuesForGuiNonPositionElements()
 
  734  whileBlocking( mBackgroundColorButton )->setColor( mItem->backgroundColor( 
false ) );
 
  735  whileBlocking( mFrameColorButton )->setColor( mItem->frameStrokeColor() );
 
  736  whileBlocking( mStrokeUnitsComboBox )->setUnit( mItem->frameStrokeWidth().units() );
 
  737  whileBlocking( mStrokeWidthSpinBox )->setValue( mItem->frameStrokeWidth().length() );
 
  738  whileBlocking( mFrameJoinStyleCombo )->setPenJoinStyle( mItem->frameJoinStyle() );
 
  740  whileBlocking( mFrameGroupBox )->setChecked( mItem->frameEnabled() );
 
  741  whileBlocking( mBackgroundGroupBox )->setChecked( mItem->hasBackground() );
 
  742  whileBlocking( mBlendModeCombo )->setBlendMode( mItem->blendMode() );
 
  743  whileBlocking( mOpacityWidget )->setOpacity( mItem->itemOpacity() );
 
  744  whileBlocking( mItemRotationSpinBox )->setValue( mItem->itemRotation() );
 
  745  whileBlocking( mExcludeFromPrintsCheckBox )->setChecked( mItem->excludeFromExports() );
 
  746  whileBlocking( mExportGroupNameCombo )->setCurrentText( mItem->customProperty( QStringLiteral( 
"pdfExportGroup" ) ).toString() );
 
  765  const QList<QgsPropertyOverrideButton *> buttons = findChildren<QgsPropertyOverrideButton *>();
 
 
  772void QgsLayoutItemPropertiesWidget::setValuesForGuiElements()
 
  779  mBackgroundColorButton->setColorDialogTitle( tr( 
"Select Background Color" ) );
 
  780  mBackgroundColorButton->setAllowOpacity( 
true );
 
  781  mBackgroundColorButton->setContext( QStringLiteral( 
"composer" ) );
 
  782  mFrameColorButton->setColorDialogTitle( tr( 
"Select Frame Color" ) );
 
  783  mFrameColorButton->setAllowOpacity( 
true );
 
  784  mFrameColorButton->setContext( QStringLiteral( 
"composer" ) );
 
  786  if ( 
QgsLayout *layout = mItem->layout() )
 
  789    QList<QgsLayoutItem *> items;
 
  790    layout->layoutItems( items );
 
  791    QStringList existingGroups;
 
  794      const QString groupName = item->customProperty( QStringLiteral( 
"pdfExportGroup" ) ).toString();
 
  795      if ( !groupName.isEmpty() && !existingGroups.contains( groupName ) )
 
  796        existingGroups.append( groupName );
 
  799    std::sort( existingGroups.begin(), existingGroups.end(), []( 
const QString &a, 
const QString &b ) -> 
bool {
 
  800      return a.localeAwareCompare( b ) < 0;
 
  804    whileBlocking( mExportGroupNameCombo )->addItems( existingGroups );
 
  807  setValuesForGuiPositionElements();
 
  808  setValuesForGuiNonPositionElements();
 
  814void QgsLayoutItemPropertiesWidget::mBlendModeCombo_currentIndexChanged( 
int index )
 
  819    mItem->layout()->undoStack()->beginCommand( mItem, tr( 
"Change Blend Mode" ) );
 
  820    mItem->setBlendMode( mBlendModeCombo->blendMode() );
 
  821    mItem->layout()->undoStack()->endCommand();
 
  825void QgsLayoutItemPropertiesWidget::opacityChanged( 
double value )
 
  830    mItem->setItemOpacity( value );
 
  831    mItem->layout()->undoStack()->endCommand();
 
  835void QgsLayoutItemPropertiesWidget::mItemIdLineEdit_editingFinished()
 
  840    mItem->setId( mItemIdLineEdit->text() );
 
  841    mItemIdLineEdit->setText( mItem->id() );
 
  842    mItem->layout()->undoStack()->endCommand();
 
  846void QgsLayoutItemPropertiesWidget::exportGroupNameEditingFinished()
 
  851    mItem->setCustomProperty( QStringLiteral( 
"pdfExportGroup" ), mExportGroupNameCombo->currentText() );
 
  852    mItem->layout()->undoStack()->endCommand();
 
  856void QgsLayoutItemPropertiesWidget::mPageSpinBox_valueChanged( 
int )
 
  858  mFreezePageSpin = 
true;
 
  859  changeItemPosition();
 
  860  mFreezePageSpin = 
false;
 
  863void QgsLayoutItemPropertiesWidget::mXPosSpin_valueChanged( 
double )
 
  865  mFreezeXPosSpin = 
true;
 
  866  changeItemPosition();
 
  867  mFreezeXPosSpin = 
false;
 
  870void QgsLayoutItemPropertiesWidget::mYPosSpin_valueChanged( 
double )
 
  872  mFreezeYPosSpin = 
true;
 
  873  changeItemPosition();
 
  874  mFreezeYPosSpin = 
false;
 
  879  changeItemPosition();
 
  882void QgsLayoutItemPropertiesWidget::mWidthSpin_valueChanged( 
double )
 
  884  mFreezeWidthSpin = 
true;
 
  886  mFreezeWidthSpin = 
false;
 
  889void QgsLayoutItemPropertiesWidget::mHeightSpin_valueChanged( 
double )
 
  891  mFreezeHeightSpin = 
true;
 
  893  mFreezeHeightSpin = 
false;
 
  901void QgsLayoutItemPropertiesWidget::mUpperLeftCheckBox_stateChanged( 
bool state )
 
  910  setValuesForGuiPositionElements();
 
  913void QgsLayoutItemPropertiesWidget::mUpperMiddleCheckBox_stateChanged( 
bool state )
 
  921  setValuesForGuiPositionElements();
 
  924void QgsLayoutItemPropertiesWidget::mUpperRightCheckBox_stateChanged( 
bool state )
 
  932  setValuesForGuiPositionElements();
 
  935void QgsLayoutItemPropertiesWidget::mMiddleLeftCheckBox_stateChanged( 
bool state )
 
  943  setValuesForGuiPositionElements();
 
  946void QgsLayoutItemPropertiesWidget::mMiddleCheckBox_stateChanged( 
bool state )
 
  954  setValuesForGuiPositionElements();
 
  957void QgsLayoutItemPropertiesWidget::mMiddleRightCheckBox_stateChanged( 
bool state )
 
  965  setValuesForGuiPositionElements();
 
  968void QgsLayoutItemPropertiesWidget::mLowerLeftCheckBox_stateChanged( 
bool state )
 
  976  setValuesForGuiPositionElements();
 
  979void QgsLayoutItemPropertiesWidget::mLowerMiddleCheckBox_stateChanged( 
bool state )
 
  987  setValuesForGuiPositionElements();
 
  990void QgsLayoutItemPropertiesWidget::mLowerRightCheckBox_stateChanged( 
bool state )
 
  998  setValuesForGuiPositionElements();
 
 1001void QgsLayoutItemPropertiesWidget::mItemRotationSpinBox_valueChanged( 
double val )
 
 1006    mItem->setItemRotation( val, 
true );
 
 1008    mItem->layout()->undoStack()->endCommand();
 
 1012void QgsLayoutItemPropertiesWidget::mExcludeFromPrintsCheckBox_toggled( 
bool checked )
 
 1016    mItem->layout()->undoStack()->beginCommand( mItem, checked ? tr( 
"Exclude from Exports" ) : tr( 
"Include in Exports" ) );
 
 1017    mItem->setExcludeFromExports( checked );
 
 1018    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.
 
Provides a method of storing measurements for use in QGIS layouts using a variety of different measur...
 
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.
 
Provides a method of storing points, consisting of an x and y coordinate, for use in QGIS layouts.
 
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.
 
Provides a method of storing sizes, consisting of a width and height, for use in QGIS layouts.
 
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.