QgsComposerShapeWidget::QgsComposerShapeWidget( QgsComposerShape* composerShape ): QgsComposerItemBaseWidget( 0, composerShape ), mComposerShape( composerShape ) { setupUi( this ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, composerShape ); //shapes don't use background or frame, since the symbol style is set through a QgsSymbolV2SelectorDialog itemPropertiesWidget->showBackgroundGroup( false ); itemPropertiesWidget->showFrameGroup( false ); mainLayout->addWidget( itemPropertiesWidget ); blockAllSignals( true ); //shape types mShapeComboBox->addItem( tr( "Ellipse" ) ); mShapeComboBox->addItem( tr( "Rectangle" ) ); mShapeComboBox->addItem( tr( "Triangle" ) ); setGuiElementValues(); blockAllSignals( false ); if ( mComposerShape ) { connect( mComposerShape, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); } }
QgsComposerPictureWidget::QgsComposerPictureWidget( QgsComposerPicture* picture ): QgsComposerItemBaseWidget( 0, picture ), mPicture( picture ), mPreviewsLoaded( false ) { setupUi( this ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, picture ); mainLayout->addWidget( itemPropertiesWidget ); setGuiElementValues(); mPreviewsLoadingLabel->hide(); mPreviewListWidget->setIconSize( QSize( 30, 30 ) ); // mSearchDirectoriesGroupBox is a QgsCollapsibleGroupBoxBasic, so its collapsed state should not be saved/restored mSearchDirectoriesGroupBox->setCollapsed( true ); // setup connection for loading previews on first expansion of group box connect( mSearchDirectoriesGroupBox, SIGNAL( collapsedStateChanged( bool ) ), this, SLOT( loadPicturePreviews( bool ) ) ); connect( mPicture, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); connect( mPicture, SIGNAL( pictureRotationChanged( double ) ), this, SLOT( setPicRotationSpinValue( double ) ) ); QgsAtlasComposition* atlas = atlasComposition(); if ( atlas ) { // repopulate data defined buttons if atlas layer changes connect( atlas, SIGNAL( coverageLayerChanged( QgsVectorLayer* ) ), this, SLOT( populateDataDefinedButtons() ) ); connect( atlas, SIGNAL( toggled( bool ) ), this, SLOT( populateDataDefinedButtons() ) ); } //connections for data defined buttons connect( mSourceDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( updateDataDefinedProperty() ) ); connect( mSourceDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( updateDataDefinedProperty() ) ); connect( mSourceDDBtn, SIGNAL( dataDefinedActivated( bool ) ), mPictureLineEdit, SLOT( setDisabled( bool ) ) ); }
QgsComposerArrowWidget::QgsComposerArrowWidget( QgsComposerArrow* arrow ): QgsComposerItemBaseWidget( 0, arrow ), mArrow( arrow ) { setupUi( this ); mRadioButtonGroup = new QButtonGroup( this ); mRadioButtonGroup->addButton( mDefaultMarkerRadioButton ); mRadioButtonGroup->addButton( mNoMarkerRadioButton ); mRadioButtonGroup->addButton( mSvgMarkerRadioButton ); mRadioButtonGroup->setExclusive( true ); //disable the svg related gui elements by default on_mSvgMarkerRadioButton_toggled( false ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, mArrow ); mainLayout->addWidget( itemPropertiesWidget ); mArrowHeadOutlineColorButton->setColorDialogTitle( tr( "Select arrow head outline color" ) ); mArrowHeadOutlineColorButton->setAllowAlpha( true ); mArrowHeadOutlineColorButton->setContext( "composer" ); mArrowHeadOutlineColorButton->setNoColorString( tr( "Transparent outline" ) ); mArrowHeadOutlineColorButton->setShowNoColor( true ); mArrowHeadFillColorButton->setColorDialogTitle( tr( "Select arrow head fill color" ) ); mArrowHeadFillColorButton->setAllowAlpha( true ); mArrowHeadFillColorButton->setContext( "composer" ); mArrowHeadFillColorButton->setNoColorString( tr( "Transparent fill" ) ); mArrowHeadFillColorButton->setShowNoColor( true ); setGuiElementValues(); if ( arrow ) { connect( arrow, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); } }
QgsComposerHtmlWidget::QgsComposerHtmlWidget( QgsComposerHtml* html, QgsComposerFrame* frame ): QgsComposerItemBaseWidget( 0, html ), mHtml( html ), mFrame( frame ) { setupUi( this ); blockSignals( true ); mResizeModeComboBox->addItem( tr( "Use existing frames" ), QgsComposerMultiFrame::UseExistingFrames ); mResizeModeComboBox->addItem( tr( "Extend to next page" ), QgsComposerMultiFrame::ExtendToNextPage ); mResizeModeComboBox->addItem( tr( "Repeat on every page" ), QgsComposerMultiFrame::RepeatOnEveryPage ); mResizeModeComboBox->addItem( tr( "Repeat until finished" ), QgsComposerMultiFrame::RepeatUntilFinished ); blockSignals( false ); setGuiElementValues(); if ( mHtml ) { QObject::connect( mHtml, SIGNAL( changed() ), this, SLOT( setGuiElementValues() ) ); } //embed widget for general options if ( mFrame ) { //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, mFrame ); mainLayout->addWidget( itemPropertiesWidget ); } }
QgsComposerHtmlWidget::QgsComposerHtmlWidget( QgsComposerHtml* html, QgsComposerFrame* frame ) : QgsComposerItemBaseWidget( 0, html ) , mHtml( html ) , mFrame( frame ) { setupUi( this ); //setup html editor mHtmlEditor = new QgsCodeEditorHTML( this ); connect( mHtmlEditor, SIGNAL( textChanged() ), this, SLOT( htmlEditorChanged() ) ); htmlEditorLayout->addWidget( mHtmlEditor ); //setup stylesheet editor mStylesheetEditor = new QgsCodeEditorCSS( this ); connect( mStylesheetEditor, SIGNAL( textChanged() ), this, SLOT( stylesheetEditorChanged() ) ); stylesheetEditorLayout->addWidget( mStylesheetEditor ); blockSignals( true ); mResizeModeComboBox->addItem( tr( "Use existing frames" ), QgsComposerMultiFrame::UseExistingFrames ); mResizeModeComboBox->addItem( tr( "Extend to next page" ), QgsComposerMultiFrame::ExtendToNextPage ); mResizeModeComboBox->addItem( tr( "Repeat on every page" ), QgsComposerMultiFrame::RepeatOnEveryPage ); mResizeModeComboBox->addItem( tr( "Repeat until finished" ), QgsComposerMultiFrame::RepeatUntilFinished ); blockSignals( false ); setGuiElementValues(); if ( mHtml ) { QObject::connect( mHtml, SIGNAL( changed() ), this, SLOT( setGuiElementValues() ) ); QgsAtlasComposition* atlas = atlasComposition(); if ( atlas ) { // repopulate data defined buttons if atlas layer changes connect( atlas, SIGNAL( coverageLayerChanged( QgsVectorLayer* ) ), this, SLOT( populateDataDefinedButtons() ) ); connect( atlas, SIGNAL( toggled( bool ) ), this, SLOT( populateDataDefinedButtons() ) ); } } //embed widget for general options if ( mFrame ) { //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, mFrame ); mainLayout->addWidget( itemPropertiesWidget ); } //connections for data defined buttons connect( mUrlDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( updateDataDefinedProperty() ) ); connect( mUrlDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( updateDataDefinedProperty() ) ); connect( mUrlDDBtn, SIGNAL( dataDefinedActivated( bool ) ), mUrlLineEdit, SLOT( setDisabled( bool ) ) ); }
QgsComposerLabelWidget::QgsComposerLabelWidget( QgsComposerLabel* label ): QWidget(), mComposerLabel( label ) { setupUi( this ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, label ); toolBox->addItem( itemPropertiesWidget, tr( "General options" ) ); if ( mComposerLabel ) { setGuiElementValues(); connect( mComposerLabel, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); } }
QgsComposerLabelWidget::QgsComposerLabelWidget( QgsComposerLabel* label ): QWidget(), mComposerLabel( label ) { setupUi( this ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, label ); mainLayout->addWidget( itemPropertiesWidget ); if ( mComposerLabel ) { setGuiElementValues(); connect( mComposerLabel, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); } }
QgsComposerPictureWidget::QgsComposerPictureWidget( QgsComposerPicture* picture ): QWidget(), mPicture( picture ) { setupUi( this ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, picture ); mainLayout->addWidget( itemPropertiesWidget ); setGuiElementValues(); mPreviewsLoadingLabel->hide(); mPreviewListWidget->setIconSize( QSize( 30, 30 ) ); connect( mPicture, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); connect( mPicture, SIGNAL( rotationChanged( double ) ), this, SLOT( setGuiElementValues() ) ); }
QgsComposerLabelWidget::QgsComposerLabelWidget( QgsComposerLabel* label ): QgsComposerItemBaseWidget( 0, label ), mComposerLabel( label ) { setupUi( this ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, label ); mainLayout->addWidget( itemPropertiesWidget ); mFontColorButton->setColorDialogTitle( tr( "Select font color" ) ); mFontColorButton->setContext( "composer" ); if ( mComposerLabel ) { setGuiElementValues(); connect( mComposerLabel, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); } }
QgsComposerPictureWidget::QgsComposerPictureWidget( QgsComposerPicture* picture ): QWidget(), mPicture( picture ) { setupUi( this ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, picture ); toolBox->addItem( itemPropertiesWidget, tr( "General options" ) ); mWidthLineEdit->setValidator( new QDoubleValidator( this ) ); mHeightLineEdit->setValidator( new QDoubleValidator( this ) ); setGuiElementValues(); mPreviewListWidget->setIconSize( QSize( 30, 30 ) ); connect( mPicture, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); connect( mPicture, SIGNAL( rotationChanged( double ) ), this, SLOT( setGuiElementValues() ) ); }
QgsComposerLabelWidget::QgsComposerLabelWidget( QgsComposerLabel* label ): QgsComposerItemBaseWidget( nullptr, label ), mComposerLabel( label ) { setupUi( this ); setPanelTitle( tr( "Label properties" ) ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, label ); mainLayout->addWidget( itemPropertiesWidget ); mFontColorButton->setColorDialogTitle( tr( "Select font color" ) ); mFontColorButton->setContext( QStringLiteral( "composer" ) ); mMarginXDoubleSpinBox->setClearValue( 0.0 ); mMarginYDoubleSpinBox->setClearValue( 0.0 ); if ( mComposerLabel ) { setGuiElementValues(); connect( mComposerLabel, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); } }
QgsComposerMapWidget::QgsComposerMapWidget( QgsComposerMap* composerMap ): QWidget(), mComposerMap( composerMap ) { setupUi( this ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, composerMap ); toolBox->addItem( itemPropertiesWidget, tr( "General options" ) ); mWidthLineEdit->setValidator( new QDoubleValidator( mWidthLineEdit ) ); mHeightLineEdit->setValidator( new QDoubleValidator( mHeightLineEdit ) ); mScaleLineEdit->setValidator( new QDoubleValidator( mScaleLineEdit ) ); mXMinLineEdit->setValidator( new QDoubleValidator( mXMinLineEdit ) ); mXMaxLineEdit->setValidator( new QDoubleValidator( mXMaxLineEdit ) ); mYMinLineEdit->setValidator( new QDoubleValidator( mYMinLineEdit ) ); mYMaxLineEdit->setValidator( new QDoubleValidator( mYMaxLineEdit ) ); blockAllSignals( true ); mPreviewModeComboBox->insertItem( 0, tr( "Cache" ) ); mPreviewModeComboBox->insertItem( 1, tr( "Render" ) ); mPreviewModeComboBox->insertItem( 2, tr( "Rectangle" ) ); mGridTypeComboBox->insertItem( 0, tr( "Solid" ) ); mGridTypeComboBox->insertItem( 1, tr( "Cross" ) ); mAnnotationFormatComboBox->insertItem( 0, tr( "Decimal" ) ); mAnnotationFormatComboBox->insertItem( 1, tr( "DegreeMinute" ) ); mAnnotationFormatComboBox->insertItem( 2, tr( "DegreeMinuteSecond" ) ); insertAnnotationPositionEntries( mAnnotationPositionLeftComboBox ); insertAnnotationPositionEntries( mAnnotationPositionRightComboBox ); insertAnnotationPositionEntries( mAnnotationPositionTopComboBox ); insertAnnotationPositionEntries( mAnnotationPositionBottomComboBox ); insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxLeft ); insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxRight ); insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxTop ); insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxBottom ); mFrameStyleComboBox->insertItem( 0, tr( "No frame" ) ); mFrameStyleComboBox->insertItem( 1, tr( "Zebra" ) ); if ( composerMap ) { connect( composerMap, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); } updateOverviewSymbolMarker(); updateGuiElements(); blockAllSignals( false ); }
QgsComposerPictureWidget::QgsComposerPictureWidget( QgsComposerPicture* picture ): QWidget(), mPicture( picture ), mPreviewsLoaded( false ) { setupUi( this ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, picture ); mainLayout->addWidget( itemPropertiesWidget ); setGuiElementValues(); mPreviewsLoadingLabel->hide(); mPreviewListWidget->setIconSize( QSize( 30, 30 ) ); // mSearchDirectoriesGroupBox is a QgsCollapsibleGroupBoxBasic, so its collapsed state should not be saved/restored mSearchDirectoriesGroupBox->setCollapsed( true ); // setup connection for loading previews on first expansion of group box connect( mSearchDirectoriesGroupBox, SIGNAL( collapsedStateChanged( bool ) ), this, SLOT( loadPicturePreviews( bool ) ) ); connect( mPicture, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); connect( mPicture, SIGNAL( pictureRotationChanged( double ) ), this, SLOT( setPicRotationSpinValue( double ) ) ); connect( mPictureExpressionLineEdit, SIGNAL( editingFinished() ), this, SLOT( setPictureExpression() ) ); }
QgsComposerArrowWidget::QgsComposerArrowWidget( QgsComposerArrow* arrow ): QWidget( 0 ), mArrow( arrow ) { setupUi( this ); mRadioButtonGroup = new QButtonGroup( this ); mRadioButtonGroup->addButton( mDefaultMarkerRadioButton ); mRadioButtonGroup->addButton( mNoMarkerRadioButton ); mRadioButtonGroup->addButton( mSvgMarkerRadioButton ); mRadioButtonGroup->setExclusive( true ); //disable the svg related gui elements by default on_mSvgMarkerRadioButton_toggled( false ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, mArrow ); mainLayout->addWidget( itemPropertiesWidget ); setGuiElementValues(); if ( arrow ) { connect( arrow, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); } }
QgsComposerPictureWidget::QgsComposerPictureWidget( QgsComposerPicture *picture ): QgsComposerItemBaseWidget( nullptr, picture ), mPicture( picture ), mPreviewsLoaded( false ) { setupUi( this ); setPanelTitle( tr( "Picture properties" ) ); mFillColorButton->setAllowOpacity( true ); mFillColorButton->setColorDialogTitle( tr( "Select fill color" ) ); mFillColorButton->setContext( QStringLiteral( "composer" ) ); mStrokeColorButton->setAllowOpacity( true ); mStrokeColorButton->setColorDialogTitle( tr( "Select stroke color" ) ); mStrokeColorButton->setContext( QStringLiteral( "composer" ) ); mNorthTypeComboBox->blockSignals( true ); mNorthTypeComboBox->addItem( tr( "Grid north" ), QgsComposerPicture::GridNorth ); mNorthTypeComboBox->addItem( tr( "True north" ), QgsComposerPicture::TrueNorth ); mNorthTypeComboBox->blockSignals( false ); mPictureRotationOffsetSpinBox->setClearValue( 0.0 ); mPictureRotationSpinBox->setClearValue( 0.0 ); //add widget for general composer item properties QgsComposerItemWidget *itemPropertiesWidget = new QgsComposerItemWidget( this, picture ); mainLayout->addWidget( itemPropertiesWidget ); if ( mPicture->composition() ) { mComposerMapComboBox->setComposition( mPicture->composition() ); mComposerMapComboBox->setItemType( QgsComposerItem::ComposerMap ); connect( mComposerMapComboBox, &QgsComposerItemComboBox::itemChanged, this, &QgsComposerPictureWidget::composerMapChanged ); } setGuiElementValues(); mPreviewsLoadingLabel->hide(); mPreviewListWidget->setIconSize( QSize( 30, 30 ) ); // mSearchDirectoriesGroupBox is a QgsCollapsibleGroupBoxBasic, so its collapsed state should not be saved/restored mSearchDirectoriesGroupBox->setCollapsed( true ); // setup connection for loading previews on first expansion of group box connect( mSearchDirectoriesGroupBox, &QgsCollapsibleGroupBoxBasic::collapsedStateChanged, this, &QgsComposerPictureWidget::loadPicturePreviews ); connect( mPicture, &QgsComposerObject::itemChanged, this, &QgsComposerPictureWidget::setGuiElementValues ); connect( mPicture, &QgsComposerPicture::pictureRotationChanged, this, &QgsComposerPictureWidget::setPicRotationSpinValue ); //connections for data defined buttons connect( mSourceDDBtn, &QgsPropertyOverrideButton::activated, mPictureLineEdit, &QLineEdit::setDisabled ); registerDataDefinedButton( mSourceDDBtn, QgsComposerObject::PictureSource ); registerDataDefinedButton( mFillColorDDBtn, QgsComposerObject::PictureSvgBackgroundColor ); registerDataDefinedButton( mStrokeColorDDBtn, QgsComposerObject::PictureSvgStrokeColor ); registerDataDefinedButton( mStrokeWidthDDBtn, QgsComposerObject::PictureSvgStrokeWidth ); }
QgsComposerShapeWidget::QgsComposerShapeWidget( QgsComposerShape* composerShape ): QWidget( 0 ), mComposerShape( composerShape ) { setupUi( this ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, composerShape ); toolBox->addItem( itemPropertiesWidget, tr( "General options" ) ); blockAllSignals( true ); //shape types mShapeComboBox->addItem( tr( "Ellipse" ) ); mShapeComboBox->addItem( tr( "Rectangle" ) ); mShapeComboBox->addItem( tr( "Triangle" ) ); setGuiElementValues(); blockAllSignals( false ); if ( mComposerShape ) { connect( mComposerShape, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); } }
QgsComposerArrowWidget::QgsComposerArrowWidget( QgsComposerArrow *arrow ): QgsComposerItemBaseWidget( nullptr, arrow ), mArrow( arrow ) { setupUi( this ); connect( mStrokeWidthSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsComposerArrowWidget::mStrokeWidthSpinBox_valueChanged ); connect( mArrowHeadWidthSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsComposerArrowWidget::mArrowHeadWidthSpinBox_valueChanged ); connect( mArrowHeadFillColorButton, &QgsColorButton::colorChanged, this, &QgsComposerArrowWidget::mArrowHeadFillColorButton_colorChanged ); connect( mArrowHeadStrokeColorButton, &QgsColorButton::colorChanged, this, &QgsComposerArrowWidget::mArrowHeadStrokeColorButton_colorChanged ); connect( mDefaultMarkerRadioButton, &QRadioButton::toggled, this, &QgsComposerArrowWidget::mDefaultMarkerRadioButton_toggled ); connect( mNoMarkerRadioButton, &QRadioButton::toggled, this, &QgsComposerArrowWidget::mNoMarkerRadioButton_toggled ); connect( mSvgMarkerRadioButton, &QRadioButton::toggled, this, &QgsComposerArrowWidget::mSvgMarkerRadioButton_toggled ); connect( mStartMarkerLineEdit, &QLineEdit::textChanged, this, &QgsComposerArrowWidget::mStartMarkerLineEdit_textChanged ); connect( mEndMarkerLineEdit, &QLineEdit::textChanged, this, &QgsComposerArrowWidget::mEndMarkerLineEdit_textChanged ); connect( mStartMarkerToolButton, &QToolButton::clicked, this, &QgsComposerArrowWidget::mStartMarkerToolButton_clicked ); connect( mEndMarkerToolButton, &QToolButton::clicked, this, &QgsComposerArrowWidget::mEndMarkerToolButton_clicked ); connect( mLineStyleButton, &QPushButton::clicked, this, &QgsComposerArrowWidget::mLineStyleButton_clicked ); setPanelTitle( tr( "Arrow properties" ) ); mRadioButtonGroup = new QButtonGroup( this ); mRadioButtonGroup->addButton( mDefaultMarkerRadioButton ); mRadioButtonGroup->addButton( mNoMarkerRadioButton ); mRadioButtonGroup->addButton( mSvgMarkerRadioButton ); mRadioButtonGroup->setExclusive( true ); //disable the svg related gui elements by default mSvgMarkerRadioButton_toggled( false ); //add widget for general composer item properties QgsComposerItemWidget *itemPropertiesWidget = new QgsComposerItemWidget( this, mArrow ); mainLayout->addWidget( itemPropertiesWidget ); mArrowHeadStrokeColorButton->setColorDialogTitle( tr( "Select Arrow Head Stroke Color" ) ); mArrowHeadStrokeColorButton->setAllowOpacity( true ); mArrowHeadStrokeColorButton->setContext( QStringLiteral( "composer" ) ); mArrowHeadStrokeColorButton->setNoColorString( tr( "Transparent stroke" ) ); mArrowHeadStrokeColorButton->setShowNoColor( true ); mArrowHeadFillColorButton->setColorDialogTitle( tr( "Select Arrow Head Fill Color" ) ); mArrowHeadFillColorButton->setAllowOpacity( true ); mArrowHeadFillColorButton->setContext( QStringLiteral( "composer" ) ); mArrowHeadFillColorButton->setNoColorString( tr( "Transparent fill" ) ); mArrowHeadFillColorButton->setShowNoColor( true ); setGuiElementValues(); if ( arrow ) { connect( arrow, &QgsComposerObject::itemChanged, this, &QgsComposerArrowWidget::setGuiElementValues ); } }
QgsComposerMapWidget::QgsComposerMapWidget( QgsComposerMap* composerMap ): QWidget(), mComposerMap( composerMap ) { setupUi( this ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, composerMap ); toolBox->addItem( itemPropertiesWidget, tr( "General options" ) ); mWidthLineEdit->setValidator( new QDoubleValidator( mWidthLineEdit ) ); mHeightLineEdit->setValidator( new QDoubleValidator( mHeightLineEdit ) ); mScaleLineEdit->setValidator( new QDoubleValidator( mScaleLineEdit ) ); mXMinLineEdit->setValidator( new QDoubleValidator( mXMinLineEdit ) ); mXMaxLineEdit->setValidator( new QDoubleValidator( mXMaxLineEdit ) ); mYMinLineEdit->setValidator( new QDoubleValidator( mYMinLineEdit ) ); mYMaxLineEdit->setValidator( new QDoubleValidator( mYMaxLineEdit ) ); blockAllSignals( true ); mPreviewModeComboBox->insertItem( 0, tr( "Cache" ) ); mPreviewModeComboBox->insertItem( 1, tr( "Render" ) ); mPreviewModeComboBox->insertItem( 2, tr( "Rectangle" ) ); mGridTypeComboBox->insertItem( 0, tr( "Solid" ) ); mGridTypeComboBox->insertItem( 1, tr( "Cross" ) ); mAnnotationPositionComboBox->insertItem( 0, tr( "Inside frame" ) ); mAnnotationPositionComboBox->insertItem( 1, tr( "Outside frame" ) ); mAnnotationDirectionComboBox->insertItem( 0, tr( "Horizontal" ) ); mAnnotationDirectionComboBox->insertItem( 1, tr( "Vertical" ) ); mAnnotationDirectionComboBox->insertItem( 2, tr( "Horizontal and Vertical" ) ); mAnnotationDirectionComboBox->insertItem( 2, tr( "Boundary direction" ) ); if ( composerMap ) { connect( composerMap, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); } updateGuiElements(); blockAllSignals( false ); }
QgsLayoutLabelWidget::QgsLayoutLabelWidget( QgsLayoutItemLabel *label ) : QgsLayoutItemBaseWidget( nullptr, label ) , mLabel( label ) { setupUi( this ); connect( mHtmlCheckBox, &QCheckBox::stateChanged, this, &QgsLayoutLabelWidget::mHtmlCheckBox_stateChanged ); connect( mTextEdit, &QPlainTextEdit::textChanged, this, &QgsLayoutLabelWidget::mTextEdit_textChanged ); connect( mInsertExpressionButton, &QPushButton::clicked, this, &QgsLayoutLabelWidget::mInsertExpressionButton_clicked ); connect( mMarginXDoubleSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutLabelWidget::mMarginXDoubleSpinBox_valueChanged ); connect( mMarginYDoubleSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutLabelWidget::mMarginYDoubleSpinBox_valueChanged ); connect( mFontColorButton, &QgsColorButton::colorChanged, this, &QgsLayoutLabelWidget::mFontColorButton_colorChanged ); connect( mCenterRadioButton, &QRadioButton::clicked, this, &QgsLayoutLabelWidget::mCenterRadioButton_clicked ); connect( mLeftRadioButton, &QRadioButton::clicked, this, &QgsLayoutLabelWidget::mLeftRadioButton_clicked ); connect( mRightRadioButton, &QRadioButton::clicked, this, &QgsLayoutLabelWidget::mRightRadioButton_clicked ); connect( mTopRadioButton, &QRadioButton::clicked, this, &QgsLayoutLabelWidget::mTopRadioButton_clicked ); connect( mBottomRadioButton, &QRadioButton::clicked, this, &QgsLayoutLabelWidget::mBottomRadioButton_clicked ); connect( mMiddleRadioButton, &QRadioButton::clicked, this, &QgsLayoutLabelWidget::mMiddleRadioButton_clicked ); setPanelTitle( tr( "Label properties" ) ); mFontButton->setMode( QgsFontButton::ModeQFont ); //add widget for general composer item properties mItemPropertiesWidget = new QgsLayoutItemPropertiesWidget( this, label ); mainLayout->addWidget( mItemPropertiesWidget ); mFontColorButton->setColorDialogTitle( tr( "Select Font Color" ) ); mFontColorButton->setContext( QStringLiteral( "composer" ) ); mMarginXDoubleSpinBox->setClearValue( 0.0 ); mMarginYDoubleSpinBox->setClearValue( 0.0 ); if ( mLabel ) { setGuiElementValues(); connect( mLabel, &QgsLayoutObject::changed, this, &QgsLayoutLabelWidget::setGuiElementValues ); } connect( mFontButton, &QgsFontButton::changed, this, &QgsLayoutLabelWidget::fontChanged ); connect( mJustifyRadioButton, &QRadioButton::clicked, this, &QgsLayoutLabelWidget::justifyClicked ); }
bool QgsLayoutLabelWidget::setNewItem( QgsLayoutItem *item ) { if ( item->type() != QgsLayoutItemRegistry::LayoutLabel ) return false; if ( mLabel ) { disconnect( mLabel, &QgsLayoutObject::changed, this, &QgsLayoutLabelWidget::setGuiElementValues ); } mLabel = qobject_cast< QgsLayoutItemLabel * >( item ); mItemPropertiesWidget->setItem( mLabel ); if ( mLabel ) { connect( mLabel, &QgsLayoutObject::changed, this, &QgsLayoutLabelWidget::setGuiElementValues ); } setGuiElementValues(); return true; }
QgsComposerPolygonWidget::QgsComposerPolygonWidget( QgsComposerPolygon* composerPolygon ): QgsComposerItemBaseWidget( nullptr, composerPolygon ) , mComposerPolygon( composerPolygon ) { setupUi( this ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, composerPolygon ); //shapes don't use background or frame, since the symbol style is set through a QgsSymbolSelectorDialog itemPropertiesWidget->showBackgroundGroup( false ); itemPropertiesWidget->showFrameGroup( false ); mainLayout->addWidget( itemPropertiesWidget ); // update style icon updatePolygonStyle(); if ( mComposerPolygon ) { connect( mComposerPolygon, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); } }
bool QgsLayoutPolylineWidget::setNewItem( QgsLayoutItem *item ) { if ( item->type() != QgsLayoutItemRegistry::LayoutPolyline ) return false; if ( mPolyline ) { disconnect( mPolyline, &QgsLayoutObject::changed, this, &QgsLayoutPolylineWidget::setGuiElementValues ); } mPolyline = qobject_cast< QgsLayoutItemPolyline * >( item ); mItemPropertiesWidget->setItem( mPolyline ); if ( mPolyline ) { connect( mPolyline, &QgsLayoutObject::changed, this, &QgsLayoutPolylineWidget::setGuiElementValues ); mLineStyleButton->registerExpressionContextGenerator( mPolyline ); } setGuiElementValues(); return true; }
QgsLayoutPolylineWidget::QgsLayoutPolylineWidget( QgsLayoutItemPolyline *polyline ) : QgsLayoutItemBaseWidget( nullptr, polyline ) , mPolyline( polyline ) { setupUi( this ); setPanelTitle( tr( "Polyline Properties" ) ); connect( mStrokeWidthSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutPolylineWidget::arrowStrokeWidthChanged ); connect( mArrowHeadWidthSpinBox, static_cast < void ( QDoubleSpinBox::* )( double ) > ( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutPolylineWidget::arrowHeadWidthChanged ); connect( mArrowHeadFillColorButton, &QgsColorButton::colorChanged, this, &QgsLayoutPolylineWidget::arrowHeadFillColorChanged ); connect( mArrowHeadStrokeColorButton, &QgsColorButton::colorChanged, this, &QgsLayoutPolylineWidget::arrowHeadStrokeColorChanged ); connect( mRadioStartArrow, &QRadioButton::toggled, this, &QgsLayoutPolylineWidget::startArrowHeadToggled ); connect( mRadioStartNoMarker, &QRadioButton::toggled, this, &QgsLayoutPolylineWidget::startNoMarkerToggled ); connect( mRadioStartSVG, &QRadioButton::toggled, this, &QgsLayoutPolylineWidget::startSvgMarkerToggled ); connect( mRadioEndArrow, &QRadioButton::toggled, this, &QgsLayoutPolylineWidget::endArrowHeadToggled ); connect( mRadioEndNoMarker, &QRadioButton::toggled, this, &QgsLayoutPolylineWidget::endNoMarkerToggled ); connect( mRadioEndSvg, &QRadioButton::toggled, this, &QgsLayoutPolylineWidget::endSvgMarkerToggled ); connect( mStartMarkerLineEdit, &QLineEdit::textChanged, this, &QgsLayoutPolylineWidget::mStartMarkerLineEdit_textChanged ); connect( mEndMarkerLineEdit, &QLineEdit::textChanged, this, &QgsLayoutPolylineWidget::mEndMarkerLineEdit_textChanged ); connect( mStartMarkerToolButton, &QToolButton::clicked, this, &QgsLayoutPolylineWidget::mStartMarkerToolButton_clicked ); connect( mEndMarkerToolButton, &QToolButton::clicked, this, &QgsLayoutPolylineWidget::mEndMarkerToolButton_clicked ); setPanelTitle( tr( "Arrow Properties" ) ); QButtonGroup *startMarkerGroup = new QButtonGroup( this ); startMarkerGroup->addButton( mRadioStartNoMarker ); startMarkerGroup->addButton( mRadioStartArrow ); startMarkerGroup->addButton( mRadioStartSVG ); startMarkerGroup->setExclusive( true ); QButtonGroup *endMarkerGroup = new QButtonGroup( this ); endMarkerGroup->addButton( mRadioEndNoMarker ); endMarkerGroup->addButton( mRadioEndArrow ); endMarkerGroup->addButton( mRadioEndSvg ); endMarkerGroup->setExclusive( true ); //disable the svg related gui elements by default enableStartSvgInputElements( false ); enableEndSvgInputElements( false ); mArrowHeadStrokeColorButton->setColorDialogTitle( tr( "Select Arrow Head Stroke Color" ) ); mArrowHeadStrokeColorButton->setAllowOpacity( true ); mArrowHeadStrokeColorButton->setContext( QStringLiteral( "composer" ) ); mArrowHeadStrokeColorButton->setNoColorString( tr( "Transparent stroke" ) ); mArrowHeadStrokeColorButton->setShowNoColor( true ); mArrowHeadFillColorButton->setColorDialogTitle( tr( "Select Arrow Head Fill Color" ) ); mArrowHeadFillColorButton->setAllowOpacity( true ); mArrowHeadFillColorButton->setContext( QStringLiteral( "composer" ) ); mArrowHeadFillColorButton->setNoColorString( tr( "Transparent fill" ) ); mArrowHeadFillColorButton->setShowNoColor( true ); //add widget for general composer item properties mItemPropertiesWidget = new QgsLayoutItemPropertiesWidget( this, polyline ); //shapes don't use background or frame, since the symbol style is set through a QgsSymbolSelectorWidget mItemPropertiesWidget->showBackgroundGroup( false ); mItemPropertiesWidget->showFrameGroup( false ); mainLayout->addWidget( mItemPropertiesWidget ); mLineStyleButton->setSymbolType( QgsSymbol::Line ); connect( mLineStyleButton, &QgsSymbolButton::changed, this, &QgsLayoutPolylineWidget::symbolChanged ); if ( mPolyline ) { connect( mPolyline, &QgsLayoutObject::changed, this, &QgsLayoutPolylineWidget::setGuiElementValues ); mLineStyleButton->registerExpressionContextGenerator( mPolyline ); } setGuiElementValues(); mLineStyleButton->registerExpressionContextGenerator( mPolyline ); mLineStyleButton->setLayer( coverageLayer() ); if ( mPolyline->layout() ) { connect( &mPolyline->layout()->reportContext(), &QgsLayoutReportContext::layerChanged, mLineStyleButton, &QgsSymbolButton::setLayer ); } }
QgsComposerMapWidget::QgsComposerMapWidget( QgsComposerMap* composerMap ) : QgsComposerItemBaseWidget( nullptr, composerMap ) , mComposerMap( composerMap ) { setupUi( this ); setPanelTitle( tr( "Map properties" ) ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, composerMap ); mainLayout->addWidget( itemPropertiesWidget ); mScaleLineEdit->setValidator( new QDoubleValidator( mScaleLineEdit ) ); mXMinLineEdit->setValidator( new QDoubleValidator( mXMinLineEdit ) ); mXMaxLineEdit->setValidator( new QDoubleValidator( mXMaxLineEdit ) ); mYMinLineEdit->setValidator( new QDoubleValidator( mYMinLineEdit ) ); mYMaxLineEdit->setValidator( new QDoubleValidator( mYMaxLineEdit ) ); blockAllSignals( true ); mPreviewModeComboBox->insertItem( 0, tr( "Cache" ) ); mPreviewModeComboBox->insertItem( 1, tr( "Render" ) ); mPreviewModeComboBox->insertItem( 2, tr( "Rectangle" ) ); // follow preset combo mFollowVisibilityPresetCombo->setModel( new QStringListModel( mFollowVisibilityPresetCombo ) ); connect( mFollowVisibilityPresetCombo, SIGNAL( currentIndexChanged( int ) ), this, SLOT( followVisibilityPresetSelected( int ) ) ); connect( QgsProject::instance()->mapThemeCollection(), SIGNAL( presetsChanged() ), this, SLOT( onPresetsChanged() ) ); onPresetsChanged(); // keep layers from preset button QMenu* menuKeepLayers = new QMenu( this ); mLayerListFromPresetButton->setMenu( menuKeepLayers ); mLayerListFromPresetButton->setIcon( QgsApplication::getThemeIcon( "/mActionShowAllLayers.svg" ) ); mLayerListFromPresetButton->setToolTip( tr( "Set layer list from a map theme" ) ); connect( menuKeepLayers, SIGNAL( aboutToShow() ), this, SLOT( aboutToShowKeepLayersVisibilityPresetsMenu() ) ); if ( composerMap ) { mLabel->setText( tr( "Map %1" ).arg( composerMap->id() ) ); connect( composerMap, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); QgsAtlasComposition* atlas = atlasComposition(); if ( atlas ) { connect( atlas, SIGNAL( coverageLayerChanged( QgsVectorLayer* ) ), this, SLOT( atlasLayerChanged( QgsVectorLayer* ) ) ); connect( atlas, SIGNAL( toggled( bool ) ), this, SLOT( compositionAtlasToggled( bool ) ) ); compositionAtlasToggled( atlas->enabled() ); } mOverviewFrameMapComboBox->setComposition( composerMap->composition() ); mOverviewFrameMapComboBox->setItemType( QgsComposerItem::ComposerMap ); mOverviewFrameMapComboBox->setExceptedItemList( QList< QgsComposerItem* >() << composerMap ); connect( mOverviewFrameMapComboBox, SIGNAL( itemChanged( QgsComposerItem* ) ), this, SLOT( overviewMapChanged( QgsComposerItem* ) ) ); } updateGuiElements(); loadGridEntries(); loadOverviewEntries(); populateDataDefinedButtons(); blockAllSignals( false ); }
mComposerMapComboBox->setComposition( mPicture->composition() ); mComposerMapComboBox->setItemType( QgsComposerItem::ComposerMap ); connect( mComposerMapComboBox, SIGNAL( itemChanged( QgsComposerItem* ) ), this, SLOT( composerMapChanged( QgsComposerItem* ) ) ); } setGuiElementValues(); mPreviewsLoadingLabel->hide(); mPreviewListWidget->setIconSize( QSize( 30, 30 ) ); // mSearchDirectoriesGroupBox is a QgsCollapsibleGroupBoxBasic, so its collapsed state should not be saved/restored mSearchDirectoriesGroupBox->setCollapsed( true ); // setup connection for loading previews on first expansion of group box connect( mSearchDirectoriesGroupBox, SIGNAL( collapsedStateChanged( bool ) ), this, SLOT( loadPicturePreviews( bool ) ) ); connect( mPicture, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); connect( mPicture, SIGNAL( pictureRotationChanged( double ) ), this, SLOT( setPicRotationSpinValue( double ) ) ); QgsAtlasComposition* atlas = atlasComposition(); if ( atlas ) { // repopulate data defined buttons if atlas layer changes connect( atlas, SIGNAL( coverageLayerChanged( QgsVectorLayer* ) ), this, SLOT( populateDataDefinedButtons() ) ); connect( atlas, SIGNAL( toggled( bool ) ), this, SLOT( populateDataDefinedButtons() ) ); } //connections for data defined buttons connect( mSourceDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( updateDataDefinedProperty() ) ); connect( mSourceDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( updateDataDefinedProperty() ) ); connect( mSourceDDBtn, SIGNAL( dataDefinedActivated( bool ) ), mPictureLineEdit, SLOT( setDisabled( bool ) ) );
QgsComposerMapWidget::QgsComposerMapWidget( QgsComposerMap* composerMap ): QWidget(), mComposerMap( composerMap ) { setupUi( this ); //add widget for general composer item properties QgsComposerItemWidget* itemPropertiesWidget = new QgsComposerItemWidget( this, composerMap ); mainLayout->addWidget( itemPropertiesWidget ); mScaleLineEdit->setValidator( new QDoubleValidator( mScaleLineEdit ) ); mXMinLineEdit->setValidator( new QDoubleValidator( mXMinLineEdit ) ); mXMaxLineEdit->setValidator( new QDoubleValidator( mXMaxLineEdit ) ); mYMinLineEdit->setValidator( new QDoubleValidator( mYMinLineEdit ) ); mYMaxLineEdit->setValidator( new QDoubleValidator( mYMaxLineEdit ) ); blockAllSignals( true ); mPreviewModeComboBox->insertItem( 0, tr( "Cache" ) ); mPreviewModeComboBox->insertItem( 1, tr( "Render" ) ); mPreviewModeComboBox->insertItem( 2, tr( "Rectangle" ) ); mGridTypeComboBox->insertItem( 0, tr( "Solid" ) ); mGridTypeComboBox->insertItem( 1, tr( "Cross" ) ); mAnnotationFormatComboBox->insertItem( 0, tr( "Decimal" ) ); mAnnotationFormatComboBox->insertItem( 1, tr( "DegreeMinute" ) ); mAnnotationFormatComboBox->insertItem( 2, tr( "DegreeMinuteSecond" ) ); mAnnotationFontColorButton->setColorDialogTitle( tr( "Select font color" ) ); mAnnotationFontColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); insertAnnotationPositionEntries( mAnnotationPositionLeftComboBox ); insertAnnotationPositionEntries( mAnnotationPositionRightComboBox ); insertAnnotationPositionEntries( mAnnotationPositionTopComboBox ); insertAnnotationPositionEntries( mAnnotationPositionBottomComboBox ); insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxLeft ); insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxRight ); insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxTop ); insertAnnotationDirectionEntries( mAnnotationDirectionComboBoxBottom ); mFrameStyleComboBox->insertItem( 0, tr( "No frame" ) ); mFrameStyleComboBox->insertItem( 1, tr( "Zebra" ) ); mGridFramePenColorButton->setColorDialogTitle( tr( "Select grid frame color" ) ); mGridFramePenColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); mGridFrameFill1ColorButton->setColorDialogTitle( tr( "Select grid frame fill color" ) ); mGridFrameFill1ColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); mGridFrameFill2ColorButton->setColorDialogTitle( tr( "Select grid frame fill color" ) ); mGridFrameFill2ColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); //set initial state of frame style controls toggleFrameControls( false ); connect( mGridCheckBox, SIGNAL( toggled( bool ) ), mDrawAnnotationCheckableGroupBox, SLOT( setEnabled( bool ) ) ); connect( mAtlasCheckBox, SIGNAL( toggled( bool ) ), this, SLOT( atlasToggled( bool ) ) ); if ( composerMap ) { connect( composerMap, SIGNAL( itemChanged() ), this, SLOT( setGuiElementValues() ) ); //get composition QgsComposition* composition = mComposerMap->composition(); if ( composition ) { QgsAtlasComposition* atlas = &composition->atlasComposition(); connect( atlas, SIGNAL( coverageLayerChanged( QgsVectorLayer* ) ), this, SLOT( atlasLayerChanged( QgsVectorLayer* ) ) ); connect( atlas, SIGNAL( toggled( bool ) ), this, SLOT( compositionAtlasToggled( bool ) ) ); } } updateOverviewSymbolMarker(); updateLineSymbolMarker(); updateGuiElements(); blockAllSignals( false ); }