Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Added engine configuration dialog. It's possible to set number of can…
…didate labels that will be generated for every feature and the search method. git-svn-id: http://svn.osgeo.org/qgis/branches/symbology-ng-branch@10888 c8812cc2-4d05-0410-92ff-de0c093fc19c
- Loading branch information
wonder
committed
Jun 5, 2009
1 parent
9e111fb
commit 02d5b93
Showing
9 changed files
with
325 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "engineconfigdialog.h" | ||
|
||
#include "pallabeling.h" | ||
|
||
EngineConfigDialog::EngineConfigDialog(PalLabeling* lbl, QWidget* parent) | ||
: QDialog(parent), mLBL(lbl) | ||
{ | ||
setupUi(this); | ||
|
||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(onOK()) ); | ||
|
||
// search method | ||
cboSearchMethod->setCurrentIndex( mLBL->searchMethod() ); | ||
|
||
// candidate numbers | ||
int candPoint, candLine, candPolygon; | ||
mLBL->numCandidatePositions(candPoint, candLine, candPolygon); | ||
spinCandPoint->setValue(candPoint); | ||
spinCandLine->setValue(candLine); | ||
spinCandPolygon->setValue(candPolygon); | ||
} | ||
|
||
|
||
void EngineConfigDialog::onOK() | ||
{ | ||
// save | ||
mLBL->setSearchMethod( (PalLabeling::Search) cboSearchMethod->currentIndex() ); | ||
|
||
mLBL->setNumCandidatePositions(spinCandPoint->value(), | ||
spinCandLine->value(), | ||
spinCandPolygon->value()); | ||
|
||
accept(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef ENGINECONFIGDIALOG_H | ||
#define ENGINECONFIGDIALOG_H | ||
|
||
#include <QDialog> | ||
|
||
#include "ui_engineconfigdialog.h" | ||
|
||
class PalLabeling; | ||
|
||
class EngineConfigDialog : public QDialog, private Ui::EngineConfigDialog | ||
{ | ||
Q_OBJECT | ||
public: | ||
EngineConfigDialog(PalLabeling* lbl, QWidget* parent = NULL); | ||
|
||
public slots: | ||
void onOK(); | ||
|
||
protected: | ||
PalLabeling* mLBL; | ||
}; | ||
|
||
#endif // ENGINECONFIGDIALOG_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>EngineConfigDialog</class> | ||
<widget class="QDialog" name="EngineConfigDialog"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>286</width> | ||
<height>250</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Dialog</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout"> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout"> | ||
<item> | ||
<widget class="QLabel" name="label"> | ||
<property name="text"> | ||
<string>Search method</string> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QComboBox" name="cboSearchMethod"> | ||
<item> | ||
<property name="text"> | ||
<string>Chain (fastest)</string> | ||
</property> | ||
</item> | ||
<item> | ||
<property name="text"> | ||
<string>Popmusic Tabu</string> | ||
</property> | ||
</item> | ||
<item> | ||
<property name="text"> | ||
<string>Popmusic Chain</string> | ||
</property> | ||
</item> | ||
<item> | ||
<property name="text"> | ||
<string>Popmusic Tabu Chain</string> | ||
</property> | ||
</item> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<layout class="QHBoxLayout" name="horizontalLayout_2"> | ||
<item> | ||
<spacer name="horizontalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeType"> | ||
<enum>QSizePolicy::Preferred</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QGroupBox" name="groupBox"> | ||
<property name="title"> | ||
<string>Number of candidates</string> | ||
</property> | ||
<layout class="QGridLayout" name="gridLayout"> | ||
<item row="0" column="0"> | ||
<widget class="QLabel" name="label_2"> | ||
<property name="text"> | ||
<string>Point</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="0" column="1"> | ||
<widget class="QSpinBox" name="spinCandPoint"> | ||
<property name="minimum"> | ||
<number>1</number> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="1" column="0"> | ||
<widget class="QLabel" name="label_3"> | ||
<property name="text"> | ||
<string>Line</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="1" column="1"> | ||
<widget class="QSpinBox" name="spinCandLine"> | ||
<property name="minimum"> | ||
<number>1</number> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="2" column="0"> | ||
<widget class="QLabel" name="label_4"> | ||
<property name="text"> | ||
<string>Polygon</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
<item row="2" column="1"> | ||
<widget class="QSpinBox" name="spinCandPolygon"> | ||
<property name="minimum"> | ||
<number>1</number> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
</item> | ||
<item> | ||
<spacer name="horizontalSpacer_2"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="sizeType"> | ||
<enum>QSizePolicy::Preferred</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>40</width> | ||
<height>20</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<spacer name="verticalSpacer"> | ||
<property name="orientation"> | ||
<enum>Qt::Vertical</enum> | ||
</property> | ||
<property name="sizeHint" stdset="0"> | ||
<size> | ||
<width>20</width> | ||
<height>40</height> | ||
</size> | ||
</property> | ||
</spacer> | ||
</item> | ||
<item> | ||
<widget class="QDialogButtonBox" name="buttonBox"> | ||
<property name="orientation"> | ||
<enum>Qt::Horizontal</enum> | ||
</property> | ||
<property name="standardButtons"> | ||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources/> | ||
<connections> | ||
<connection> | ||
<sender>buttonBox</sender> | ||
<signal>rejected()</signal> | ||
<receiver>EngineConfigDialog</receiver> | ||
<slot>reject()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>316</x> | ||
<y>260</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>286</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
</connections> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.