From a15b9a159b8d3a275f81f999375c6ed5789e9503 Mon Sep 17 00:00:00 2001 From: Harrissou Sant-anna Date: Mon, 16 Dec 2024 01:15:36 +0100 Subject: [PATCH] Add help button to labeling rules dialogs --- src/gui/labeling/qgslabelingengineruleswidget.cpp | 6 +++++- src/gui/labeling/qgslabelingenginerulewidget.cpp | 6 +++++- src/ui/labeling/qgslabelingengineruleswidgetbase.ui | 1 - 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gui/labeling/qgslabelingengineruleswidget.cpp b/src/gui/labeling/qgslabelingengineruleswidget.cpp index 1ef812863a6e..7780f88b1be6 100644 --- a/src/gui/labeling/qgslabelingengineruleswidget.cpp +++ b/src/gui/labeling/qgslabelingengineruleswidget.cpp @@ -20,6 +20,7 @@ #include "qgslabelingenginerule.h" #include "qgslabelingenginerulewidget.h" #include "qgsgui.h" +#include "qgshelp.h" #include #include @@ -408,7 +409,7 @@ QgsLabelingEngineRulesDialog::QgsLabelingEngineRulesDialog( QWidget *parent, Qt: QVBoxLayout *layout = new QVBoxLayout( this ); layout->addWidget( mWidget ); - mButtonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this ); + mButtonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, Qt::Horizontal, this ); layout->addWidget( mButtonBox ); setLayout( layout ); @@ -416,6 +417,9 @@ QgsLabelingEngineRulesDialog::QgsLabelingEngineRulesDialog( QWidget *parent, Qt: connect( mButtonBox->button( QDialogButtonBox::Ok ), &QAbstractButton::clicked, this, &QDialog::accept ); connect( mButtonBox->button( QDialogButtonBox::Cancel ), &QAbstractButton::clicked, this, &QDialog::reject ); + connect( mButtonBox, &QDialogButtonBox::helpRequested, this, [=] { + QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#labeling-rules" ) ); + } ); } void QgsLabelingEngineRulesDialog::setRules( const QList &rules ) diff --git a/src/gui/labeling/qgslabelingenginerulewidget.cpp b/src/gui/labeling/qgslabelingenginerulewidget.cpp index 806a70be6632..c90ddd4b2393 100644 --- a/src/gui/labeling/qgslabelingenginerulewidget.cpp +++ b/src/gui/labeling/qgslabelingenginerulewidget.cpp @@ -17,6 +17,7 @@ #include "moc_qgslabelingenginerulewidget.cpp" #include "qgslabelingenginerule_impl.h" #include "qgsgui.h" +#include "qgshelp.h" #include #include @@ -36,7 +37,7 @@ QgsLabelingEngineRuleDialog::QgsLabelingEngineRuleDialog( QgsLabelingEngineRuleW QVBoxLayout *layout = new QVBoxLayout( this ); layout->addWidget( mWidget ); - mButtonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this ); + mButtonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, Qt::Horizontal, this ); layout->addWidget( mButtonBox ); setLayout( layout ); @@ -44,6 +45,9 @@ QgsLabelingEngineRuleDialog::QgsLabelingEngineRuleDialog( QgsLabelingEngineRuleW connect( mButtonBox->button( QDialogButtonBox::Ok ), &QAbstractButton::clicked, this, &QDialog::accept ); connect( mButtonBox->button( QDialogButtonBox::Cancel ), &QAbstractButton::clicked, this, &QDialog::reject ); + connect( mButtonBox, &QDialogButtonBox::helpRequested, this, [=] { + QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#labeling-rules" ) ); + } ); } void QgsLabelingEngineRuleDialog::setRule( const QgsAbstractLabelingEngineRule *rule ) diff --git a/src/ui/labeling/qgslabelingengineruleswidgetbase.ui b/src/ui/labeling/qgslabelingengineruleswidgetbase.ui index 89058051ea53..95ff5c7ce7a7 100644 --- a/src/ui/labeling/qgslabelingengineruleswidgetbase.ui +++ b/src/ui/labeling/qgslabelingengineruleswidgetbase.ui @@ -105,7 +105,6 @@ -