28 , mLayerName( layerName )
38 mHideDeprecatedCheckBox->setChecked( settings.
value(
"/Windows/DatumTransformDialog/hideDeprecated",
false ).
toBool() );
39 mRememberSelectionCheckBox->setChecked( settings.
value(
"/Windows/DatumTransformDialog/rememberSelection",
false ).
toBool() );
41 mLabelSrcDescription->setText(
"" );
42 mLabelDstDescription->setText(
"" );
44 for (
int i = 0; i < 2; i++ )
46 mDatumTransformTreeWidget->setColumnWidth( i, settings.
value(
QString(
"/Windows/DatumTransformDialog/columnWidths/%1" ).arg( i ), mDatumTransformTreeWidget->columnWidth( i ) ).toInt() );
52 void QgsDatumTransformDialog::load()
56 mDatumTransformTreeWidget->clear();
62 bool itemDisabled =
false;
63 bool itemHidden =
false;
65 for (
int i = 0; i < 2 && i < it->
size(); ++i )
68 item->
setData( i, Qt::UserRole, nr );
75 QString srcGeoProj, destGeoProj, remarks, scope;
77 bool preferred, deprecated;
81 if ( mHideDeprecatedCheckBox->isChecked() && deprecated )
87 if ( gridShiftTransformation( item->
text( i ) ) )
93 toolTipString.
append(
QString(
"<p><b>EPSG Transformations Code:</b> %1</p>" ).arg( epsgNr ) );
95 toolTipString.
append(
QString(
"<p><b>Source CRS:</b> %1</p><p><b>Destination CRS:</b> %2</p>" ).arg( srcGeoProj, destGeoProj ) );
98 toolTipString.
append(
QString(
"<p><b>Remarks:</b> %1</p>" ).arg( remarks ) );
100 toolTipString.
append(
QString(
"<p><b>Scope:</b> %1</p>" ).arg( scope ) );
102 toolTipString.
append(
"<p><b>Preferred transformation</b></p>" );
104 toolTipString.
append(
"<p><b>Deprecated transformation</b></p>" );
108 if ( gridShiftTransformation( item->
text( i ) ) && !testGridShiftFileAvailability( item, i ) )
117 mDatumTransformTreeWidget->addTopLevelItem( item );
130 settings.
setValue(
"/Windows/DatumTransformDialog/hideDeprecated", mHideDeprecatedCheckBox->isChecked() );
131 settings.
setValue(
"/Windows/DatumTransformDialog/rememberSelection", mRememberSelectionCheckBox->isChecked() );
133 for (
int i = 0; i < 2; i++ )
135 settings.
setValue(
QString(
"/Windows/DatumTransformDialog/columnWidths/%1" ).arg( i ), mDatumTransformTreeWidget->columnWidth( i ) );
143 mSrcCRSauthId = srcCRSauthId;
144 mDestCRSauthId = destCRSauthId;
154 for (
int i = 0; i < 2; ++i )
156 int transformNr = item->
data( i, Qt::UserRole ).
toInt();
165 return mRememberSelectionCheckBox->isChecked();
168 bool QgsDatumTransformDialog::gridShiftTransformation(
const QString& itemText )
const 170 return !itemText.
isEmpty() && !itemText.
contains(
"towgs84", Qt::CaseInsensitive );
173 bool QgsDatumTransformDialog::testGridShiftFileAvailability(
QTreeWidgetItem* item,
int col )
const 186 char* projLib = getenv(
"PROJ_LIB" );
194 for (
int i = 1; i < itemEqualSplit.
size(); ++i )
200 filename.
append( itemEqualSplit.
at( i ) );
203 QDir projDir( projLib );
209 for ( ; fileIt != fileList.
constEnd(); ++fileIt )
211 #if defined(Q_OS_WIN) 212 if ( fileIt->compare( filename, Qt::CaseInsensitive ) == 0 )
214 if ( fileIt->compare( filename ) == 0 )
236 mLabelSrcDescription->setText( current->
toolTip( 0 ) );
237 mLabelDstDescription->setText( current->
toolTip( 1 ) );
240 void QgsDatumTransformDialog::updateTitle()
242 mLabelLayer->setText( mLayerName );
QByteArray toByteArray() const
QString & append(QChar ch)
QStringList split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const
const T & at(int i) const
QString tr(const char *sourceText, const char *disambiguation, int n)
bool createFromString(const QString &theDefinition)
Set up this CRS from a string definition, by default a WKT definition.
void setValue(const QString &key, const QVariant &value)
int toInt(bool *ok) const
void setOverrideCursor(const QCursor &cursor)
QString description() const
Returns the descriptive name of the CRS, eg "WGS 84" or "GDA 94 / Vicgrid94".
void restoreOverrideCursor()
bool contains(QChar ch, Qt::CaseSensitivity cs) const
QVariant value(const QString &key, const QVariant &defaultValue) const
QString absolutePath() const
QStringList entryList(QFlags< QDir::Filter > filters, QFlags< QDir::SortFlag > sort) const
Class for storing a coordinate reference system (CRS)
void setText(int column, const QString &text)
const_iterator constEnd() const
const_iterator constBegin() const
QString text(int column) const
bool isValid() const
Returns whether this CRS is correctly initialized and usable.