Skip to content

Commit

Permalink
Add Title and Help button to "Symbol levels" dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ committed Dec 9, 2017
1 parent a4cf840 commit 41ca084
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gui/symbology/qgssymbollevelsdialog.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -184,19 +184,26 @@ QgsSymbolLevelsDialog::QgsSymbolLevelsDialog( QgsFeatureRenderer *renderer, bool
QVBoxLayout *vLayout = new QVBoxLayout(); QVBoxLayout *vLayout = new QVBoxLayout();
mWidget = new QgsSymbolLevelsWidget( renderer, usingSymbolLevels ); mWidget = new QgsSymbolLevelsWidget( renderer, usingSymbolLevels );
vLayout->addWidget( mWidget ); vLayout->addWidget( mWidget );
QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal ); QDialogButtonBox *bbox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok, Qt::Horizontal );
connect( bbox, &QDialogButtonBox::accepted, mWidget, &QgsSymbolLevelsWidget::apply ); connect( bbox, &QDialogButtonBox::accepted, mWidget, &QgsSymbolLevelsWidget::apply );
connect( bbox, &QDialogButtonBox::accepted, this, &QgsSymbolLevelsDialog::accept ); connect( bbox, &QDialogButtonBox::accepted, this, &QgsSymbolLevelsDialog::accept );
connect( bbox, &QDialogButtonBox::rejected, this, &QgsSymbolLevelsDialog::reject ); connect( bbox, &QDialogButtonBox::rejected, this, &QgsSymbolLevelsDialog::reject );
connect( bbox, &QDialogButtonBox::helpRequested, this, &QgsSymbolLevelsDialog::showHelp );
vLayout->addWidget( bbox ); vLayout->addWidget( bbox );
setLayout( vLayout ); setLayout( vLayout );
setWindowTitle( tr( "Symbol Levels" ) );
} }


void QgsSymbolLevelsDialog::setForceOrderingEnabled( bool enabled ) void QgsSymbolLevelsDialog::setForceOrderingEnabled( bool enabled )
{ {
mWidget->setForceOrderingEnabled( enabled ); mWidget->setForceOrderingEnabled( enabled );
} }


void QgsSymbolLevelsDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#symbols-levels" ) );
}

/// @cond PRIVATE /// @cond PRIVATE


QWidget *SpinBoxDelegate::createEditor( QWidget *parent, const QStyleOptionViewItem &, const QModelIndex & ) const QWidget *SpinBoxDelegate::createEditor( QWidget *parent, const QStyleOptionViewItem &, const QModelIndex & ) const
Expand Down
3 changes: 3 additions & 0 deletions src/gui/symbology/qgssymbollevelsdialog.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ class GUI_EXPORT QgsSymbolLevelsDialog : public QDialog


QgsSymbolLevelsWidget *mWidget = nullptr; QgsSymbolLevelsWidget *mWidget = nullptr;


private slots:

void showHelp();
}; };


#ifndef SIP_RUN #ifndef SIP_RUN
Expand Down

0 comments on commit 41ca084

Please sign in to comment.