00001 /*************************************************************************** 00002 qgsdbtablemodel.h - description 00003 ------------------- 00004 begin : Dec 2007 00005 copyright : (C) 2007 by Marco Hugentobler 00006 email : marco dot hugentobler at karto dot baug dot ethz dot ch 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #include <QStandardItemModel> 00019 class QIcon; 00020 #include "qgis.h" 00021 00025 class QgsDbTableModel: public QStandardItemModel 00026 { 00027 Q_OBJECT 00028 public: 00029 QgsDbTableModel(); 00030 ~QgsDbTableModel(); 00032 void addTableEntry( QString type, QString schemaName, QString tableName, QString geometryColName, QString Sql ); 00034 void setSql( const QModelIndex& index, const QString& sql ); 00037 void setGeometryTypesForTable( const QString& schema, const QString& table, const QString& attribute, const QString& type ); 00039 int tableCount() const {return mTableCount;} 00040 00041 private: 00043 int mTableCount; 00044 00045 QIcon iconForType( QGis::WkbType type ) const; 00046 QString displayStringForType( QGis::WkbType type ) const; 00048 QGis::WkbType qgisTypeFromDbType( const QString& dbType ) const; 00049 }; 00050
1.5.1