Add Title and Help button to "Symbol levels" dialog

This commit is contained in:
Harrissou Sant-anna 2017-11-26 11:36:12 +01:00
parent a4cf840d5c
commit 41ca084d55
2 changed files with 11 additions and 1 deletions

View File

@ -184,12 +184,14 @@ QgsSymbolLevelsDialog::QgsSymbolLevelsDialog( QgsFeatureRenderer *renderer, bool
QVBoxLayout *vLayout = new QVBoxLayout();
mWidget = new QgsSymbolLevelsWidget( renderer, usingSymbolLevels );
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, this, &QgsSymbolLevelsDialog::accept );
connect( bbox, &QDialogButtonBox::rejected, this, &QgsSymbolLevelsDialog::reject );
connect( bbox, &QDialogButtonBox::helpRequested, this, &QgsSymbolLevelsDialog::showHelp );
vLayout->addWidget( bbox );
setLayout( vLayout );
setWindowTitle( tr( "Symbol Levels" ) );
}
void QgsSymbolLevelsDialog::setForceOrderingEnabled( bool enabled )
@ -197,6 +199,11 @@ void QgsSymbolLevelsDialog::setForceOrderingEnabled( bool enabled )
mWidget->setForceOrderingEnabled( enabled );
}
void QgsSymbolLevelsDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#symbols-levels" ) );
}
/// @cond PRIVATE
QWidget *SpinBoxDelegate::createEditor( QWidget *parent, const QStyleOptionViewItem &, const QModelIndex & ) const

View File

@ -102,6 +102,9 @@ class GUI_EXPORT QgsSymbolLevelsDialog : public QDialog
QgsSymbolLevelsWidget *mWidget = nullptr;
private slots:
void showHelp();
};
#ifndef SIP_RUN