Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dialog to select datum transformation
- Loading branch information
Showing
7 changed files
with
167 additions
and
13 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
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,51 @@ | ||
#include "qgsdatumtransformdialog.h" | ||
|
||
QgsDatumTransformDialog::QgsDatumTransformDialog( const QList< QList< int > >& dt, QWidget* parent, Qt::WindowFlags f ): QDialog( parent, f ) | ||
{ | ||
setupUi( this ); | ||
QList< QList< int > >::const_iterator it = dt.constBegin(); | ||
for ( ; it != dt.constEnd(); ++it ) | ||
{ | ||
QTreeWidgetItem* item = new QTreeWidgetItem(); | ||
QString itemText; | ||
for ( int i = 0; i < 2; ++i ) | ||
{ | ||
itemText = QString::number( it->at( i ) ); | ||
if ( itemText.compare( "-1" ) != 0 ) | ||
{ | ||
item->setText( i, itemText ); | ||
} | ||
} | ||
mDatumTransformTreeWidget->addTopLevelItem( item ); | ||
} | ||
} | ||
|
||
QgsDatumTransformDialog::~QgsDatumTransformDialog() | ||
{ | ||
} | ||
|
||
QgsDatumTransformDialog::QgsDatumTransformDialog(): QDialog() | ||
{ | ||
setupUi( this ); | ||
} | ||
|
||
QList< int > QgsDatumTransformDialog::selectedDatumTransform() | ||
{ | ||
QList<int> list; | ||
QTreeWidgetItem * item = mDatumTransformTreeWidget->currentItem(); | ||
if ( item ) | ||
{ | ||
for ( int i = 0; i < 2; ++i ) | ||
{ | ||
bool conversionOk = false; | ||
QString itemText = item->text( i ); | ||
int transformNr = itemText.toInt( &conversionOk ); | ||
if ( !itemText.isEmpty() && conversionOk ) | ||
{ | ||
list << transformNr; | ||
} | ||
} | ||
} | ||
|
||
return list; | ||
} |
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,17 @@ | ||
#ifndef QGSDATUMTRANSFORMDIALOG_H | ||
#define QGSDATUMTRANSFORMDIALOG_H | ||
|
||
#include "ui_qgsdatumtransformdialogbase.h" | ||
|
||
class QgsDatumTransformDialog: public QDialog, private Ui::QgsDatumTransformDialogBase | ||
{ | ||
public: | ||
QgsDatumTransformDialog( const QList< QList< int > >& dt, QWidget * parent = 0, Qt::WindowFlags f = 0 ); | ||
~QgsDatumTransformDialog(); | ||
|
||
QList< int > selectedDatumTransform(); | ||
private: | ||
QgsDatumTransformDialog(); | ||
}; | ||
|
||
#endif // QGSDATUMTRANSFORMDIALOG_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
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,78 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>QgsDatumTransformDialogBase</class> | ||
<widget class="QDialog" name="QgsDatumTransformDialogBase"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>346</width> | ||
<height>237</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>Dialog</string> | ||
</property> | ||
<layout class="QGridLayout" name="gridLayout"> | ||
<item row="0" column="0"> | ||
<widget class="QTreeWidget" name="mDatumTransformTreeWidget"> | ||
<column> | ||
<property name="text"> | ||
<string/> | ||
</property> | ||
</column> | ||
<column> | ||
<property name="text"> | ||
<string/> | ||
</property> | ||
</column> | ||
</widget> | ||
</item> | ||
<item row="1" column="0"> | ||
<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>accepted()</signal> | ||
<receiver>QgsDatumTransformDialogBase</receiver> | ||
<slot>accept()</slot> | ||
<hints> | ||
<hint type="sourcelabel"> | ||
<x>248</x> | ||
<y>254</y> | ||
</hint> | ||
<hint type="destinationlabel"> | ||
<x>157</x> | ||
<y>274</y> | ||
</hint> | ||
</hints> | ||
</connection> | ||
<connection> | ||
<sender>buttonBox</sender> | ||
<signal>rejected()</signal> | ||
<receiver>QgsDatumTransformDialogBase</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> |