Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-3_40] Add help button to labeling placement rules dialogs #59946

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Sets the placement engine ``version``, which dictates how the label placement pr

QList< QgsAbstractLabelingEngineRule * > rules();
%Docstring
Returns a list of labeling engine rules which must be satifisfied
Returns a list of labeling engine rules which must be satisfied
while placing labels.

.. seealso:: :py:func:`addRule`
Expand All @@ -260,7 +260,7 @@ while placing labels.

void addRule( QgsAbstractLabelingEngineRule *rule /Transfer/ );
%Docstring
Adds a labeling engine ``rule`` which must be satifisfied
Adds a labeling engine ``rule`` which must be satisfied
while placing labels.

Ownership of the rule is transferred to the settings.
Expand All @@ -274,7 +274,7 @@ Ownership of the rule is transferred to the settings.

void setRules( const QList< QgsAbstractLabelingEngineRule * > &rules /Transfer/ );
%Docstring
Sets the labeling engine ``rules`` which must be satifisfied
Sets the labeling engine ``rules`` which must be satisfied
while placing labels.

Ownership of the rules are transferred to the settings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Sets the placement engine ``version``, which dictates how the label placement pr

QList< QgsAbstractLabelingEngineRule * > rules();
%Docstring
Returns a list of labeling engine rules which must be satifisfied
Returns a list of labeling engine rules which must be satisfied
while placing labels.

.. seealso:: :py:func:`addRule`
Expand All @@ -260,7 +260,7 @@ while placing labels.

void addRule( QgsAbstractLabelingEngineRule *rule /Transfer/ );
%Docstring
Adds a labeling engine ``rule`` which must be satifisfied
Adds a labeling engine ``rule`` which must be satisfied
while placing labels.

Ownership of the rule is transferred to the settings.
Expand All @@ -274,7 +274,7 @@ Ownership of the rule is transferred to the settings.

void setRules( const QList< QgsAbstractLabelingEngineRule * > &rules /Transfer/ );
%Docstring
Sets the labeling engine ``rules`` which must be satifisfied
Sets the labeling engine ``rules`` which must be satisfied
while placing labels.

Ownership of the rules are transferred to the settings.
Expand Down
8 changes: 4 additions & 4 deletions src/core/labeling/qgslabelingenginesettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class CORE_EXPORT QgsLabelingEngineSettings
void setPlacementVersion( Qgis::LabelPlacementEngineVersion version );

/**
* Returns a list of labeling engine rules which must be satifisfied
* Returns a list of labeling engine rules which must be satisfied
* while placing labels.
*
* \see addRule()
Expand All @@ -253,7 +253,7 @@ class CORE_EXPORT QgsLabelingEngineSettings
QList< QgsAbstractLabelingEngineRule * > rules();

/**
* Returns a list of labeling engine rules which must be satifisfied
* Returns a list of labeling engine rules which must be satisfied
* while placing labels.
*
* \see addRule()
Expand All @@ -263,7 +263,7 @@ class CORE_EXPORT QgsLabelingEngineSettings
QList< const QgsAbstractLabelingEngineRule * > rules() const SIP_SKIP;

/**
* Adds a labeling engine \a rule which must be satifisfied
* Adds a labeling engine \a rule which must be satisfied
* while placing labels.
*
* Ownership of the rule is transferred to the settings.
Expand All @@ -275,7 +275,7 @@ class CORE_EXPORT QgsLabelingEngineSettings
void addRule( QgsAbstractLabelingEngineRule *rule SIP_TRANSFER );

/**
* Sets the labeling engine \a rules which must be satifisfied
* Sets the labeling engine \a rules which must be satisfied
* while placing labels.
*
* Ownership of the rules are transferred to the settings.
Expand Down
6 changes: 5 additions & 1 deletion src/gui/labeling/qgslabelingengineruleswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "qgslabelingenginerule.h"
#include "qgslabelingenginerulewidget.h"
#include "qgsgui.h"
#include "qgshelp.h"

#include <QMenu>
#include <QAction>
Expand Down Expand Up @@ -408,14 +409,17 @@ 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 );
QgsGui::enableAutoGeometryRestore( this );

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<QgsAbstractLabelingEngineRule *> &rules )
Expand Down
6 changes: 5 additions & 1 deletion src/gui/labeling/qgslabelingenginerulewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "moc_qgslabelingenginerulewidget.cpp"
#include "qgslabelingenginerule_impl.h"
#include "qgsgui.h"
#include "qgshelp.h"

#include <QDialogButtonBox>
#include <QPushButton>
Expand All @@ -36,14 +37,17 @@ 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 );
QgsGui::enableAutoGeometryRestore( this );

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 )
Expand Down
1 change: 0 additions & 1 deletion src/ui/labeling/qgslabelingengineruleswidgetbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
</widget>
<resources>
<include location="../../../images/images.qrc"/>
<include location="../../../images/images.qrc"/>
</resources>
<connections/>
</ui>
Loading