Skip to content

Commit

Permalink
Add Help button and some fixes to automated placement widget
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ authored and nyalldawson committed Mar 5, 2018
1 parent 0e80b72 commit ee43d54
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 57 deletions.
7 changes: 7 additions & 0 deletions src/app/qgslabelengineconfigdialog.cpp
Expand Up @@ -17,6 +17,7 @@
#include "qgslabelingenginesettings.h" #include "qgslabelingenginesettings.h"
#include "qgsproject.h" #include "qgsproject.h"
#include "pal/pal.h" #include "pal/pal.h"
#include "qgshelp.h"


#include <QPushButton> #include <QPushButton>


Expand All @@ -26,6 +27,7 @@ QgsLabelEngineConfigDialog::QgsLabelEngineConfigDialog( QWidget *parent )
setupUi( this ); setupUi( this );


connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsLabelEngineConfigDialog::onOK ); connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsLabelEngineConfigDialog::onOK );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsLabelEngineConfigDialog::showHelp );
connect( buttonBox->button( QDialogButtonBox::RestoreDefaults ), &QAbstractButton::clicked, connect( buttonBox->button( QDialogButtonBox::RestoreDefaults ), &QAbstractButton::clicked,
this, &QgsLabelEngineConfigDialog::setDefaults ); this, &QgsLabelEngineConfigDialog::setDefaults );


Expand Down Expand Up @@ -80,3 +82,8 @@ void QgsLabelEngineConfigDialog::setDefaults()
chkShowPartialsLabels->setChecked( p.getShowPartial() ); chkShowPartialsLabels->setChecked( p.getShowPartial() );
mDrawOutlinesChkBox->setChecked( true ); mDrawOutlinesChkBox->setChecked( true );
} }

void QgsLabelEngineConfigDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#labels-properties" ) );
}
4 changes: 4 additions & 0 deletions src/app/qgslabelengineconfigdialog.h
Expand Up @@ -31,6 +31,10 @@ class APP_EXPORT QgsLabelEngineConfigDialog : public QDialog, private Ui::QgsLab
void onOK(); void onOK();
void setDefaults(); void setDefaults();



private slots:
void showHelp();

protected: protected:
}; };


Expand Down
69 changes: 12 additions & 57 deletions src/ui/qgslabelengineconfigdialog.ui
Expand Up @@ -6,16 +6,10 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>336</width> <width>420</width>
<height>430</height> <height>358</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>336</width>
<height>0</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Automated Placement Engine</string> <string>Automated Placement Engine</string>
</property> </property>
Expand Down Expand Up @@ -215,76 +209,37 @@
<property name="verticalSpacing"> <property name="verticalSpacing">
<number>6</number> <number>6</number>
</property> </property>
<item row="3" column="2"> <item row="3" column="0">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0" colspan="3">
<widget class="QCheckBox" name="chkShowCandidates"> <widget class="QCheckBox" name="chkShowCandidates">
<property name="text"> <property name="text">
<string>Show candidates (for debugging)</string> <string>Show candidates (for debugging)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>(i.e. including colliding objects)</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="QCheckBox" name="chkShowAllLabels"> <widget class="QCheckBox" name="chkShowAllLabels">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="inputMethodHints">
<set>Qt::ImhNone</set>
</property>
<property name="text"> <property name="text">
<string>Show all labels for all layers</string> <string>Show all labels for all layers (i.e. including colliding objects)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="0" column="0">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>8</width>
<height>8</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="mDrawOutlinesChkBox"> <widget class="QCheckBox" name="mDrawOutlinesChkBox">
<property name="text"> <property name="text">
<string>Draw text as outlines (recommended)</string> <string>Draw text as outlines (recommended)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="3"> <item row="1" column="0">
<widget class="QCheckBox" name="chkShowPartialsLabels"> <widget class="QCheckBox" name="chkShowPartialsLabels">
<property name="text"> <property name="text">
<string>Show partial labels</string> <string>Show partial labels</string>
Expand Down Expand Up @@ -312,7 +267,7 @@
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set> <set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok|QDialogButtonBox::RestoreDefaults</set>
</property> </property>
</widget> </widget>
</item> </item>
Expand Down

0 comments on commit ee43d54

Please sign in to comment.