-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3916628
commit f4eae28
Showing
8 changed files
with
268 additions
and
69 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,58 @@ | ||
#include "qgsdatumtransformtablemodel.h" | ||
|
||
QgsDatumTransformTableModel::QgsDatumTransformTableModel(QObject *parent) | ||
: QAbstractTableModel(parent) | ||
{ | ||
} | ||
|
||
void QgsDatumTransformTableModel::setTransformContext(QgsCoordinateTransformContext &context) | ||
{ | ||
mTransformContext = context; | ||
reset(); | ||
} | ||
|
||
int QgsDatumTransformTableModel::rowCount(const QModelIndex &parent) const | ||
{ | ||
return mTransformContext.sourceDestinationDatumTransforms().count() | ||
+ mTransformContext.sourceDatumTransforms().count() | ||
+ mTransformContext.destinationDatumTransforms().count(); | ||
} | ||
|
||
int QgsDatumTransformTableModel::columnCount(const QModelIndex &parent) const | ||
{ | ||
return 4; | ||
} | ||
|
||
QVariant QgsDatumTransformTableModel::data(const QModelIndex &index, int role) const | ||
{ | ||
|
||
|
||
return QVariant(); | ||
} | ||
|
||
QVariant QgsDatumTransformTableModel::headerData(int section, Qt::Orientation orientation, int role) const | ||
{ | ||
if (orientation == Qt::Vertical) | ||
return QVariant(); | ||
|
||
switch (role) { | ||
case Qt::DisplayRole: | ||
switch (section) { | ||
case SourceCrsHeader: | ||
return tr("Source CRS"); | ||
case SourceTransformHeader: | ||
return tr("Source datum transform"); | ||
case DestinationCrsHeader: | ||
return tr("Destination CRS"); | ||
case DestinationTransformHeader: | ||
return tr("Destination datum transform"); | ||
default: | ||
break; | ||
} | ||
break; | ||
default: | ||
break; | ||
} | ||
|
||
return QVariant(); | ||
} |
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,36 @@ | ||
#ifndef QGSDATUMTRANSFORMTABLEMODEL_H | ||
#define QGSDATUMTRANSFORMTABLEMODEL_H | ||
|
||
|
||
#include <QAbstractTableModel> | ||
|
||
#include "qgis_app.h" | ||
#include "qgscoordinatetransformcontext.h" | ||
|
||
class APP_EXPORT QgsDatumTransformTableModel : public QAbstractTableModel | ||
{ | ||
Q_OBJECT | ||
public: | ||
|
||
enum Headers { | ||
SourceCrsHeader = 0, | ||
SourceTransformHeader, | ||
DestinationCrsHeader, | ||
DestinationTransformHeader, | ||
}; | ||
|
||
QgsDatumTransformTableModel( QObject* parent = nullptr); | ||
|
||
void setTransformContext( QgsCoordinateTransformContext &context ); | ||
|
||
public: | ||
int rowCount(const QModelIndex &parent) const override; | ||
int columnCount(const QModelIndex &parent) const override; | ||
QVariant data(const QModelIndex &index, int role) const override; | ||
QVariant headerData(int section, Qt::Orientation orientation, int role) const override; | ||
|
||
private: | ||
QgsCoordinateTransformContext mTransformContext; | ||
}; | ||
|
||
#endif // QGSDATUMTRANSFORMTABLEMODEL_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
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.