QgisInterface::getFeatureForm() returns a QgsAttributeDialog

And some API comments
This commit is contained in:
Matthias Kuhn 2014-08-18 10:57:30 +02:00
parent 81055452e4
commit 4ade943937
4 changed files with 31 additions and 4 deletions

View File

@ -517,7 +517,7 @@ class QgisInterface : QObject
*/
virtual bool openFeatureForm( QgsVectorLayer *l, QgsFeature &f, bool updateFeatureOnly = false ) = 0;
virtual QDialog* getFeatureForm( QgsVectorLayer *l, QgsFeature &f ) = 0;
virtual QgsAttributeDialog* getFeatureForm( QgsVectorLayer *l, QgsFeature &f ) = 0;
virtual QgsVectorLayerTools* vectorLayerTools() = 0;

View File

@ -619,7 +619,7 @@ void QgisAppInterface::cacheloadForm( QString uifile )
}
}
QDialog* QgisAppInterface::getFeatureForm( QgsVectorLayer *l, QgsFeature &feature )
QgsAttributeDialog* QgisAppInterface::getFeatureForm( QgsVectorLayer *l, QgsFeature &feature )
{
QgsDistanceArea myDa;

View File

@ -450,7 +450,7 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
*
* @return A feature form
*/
virtual QDialog* getFeatureForm( QgsVectorLayer *layer, QgsFeature &feature );
virtual QgsAttributeDialog* getFeatureForm( QgsVectorLayer *layer, QgsFeature &feature );
/**
* Access the vector layer tools instance.

View File

@ -25,6 +25,7 @@ class QDockWidget;
class QMainWindow;
class QWidget;
class QgsAttributeDialog;
class QgsComposerView;
class QgsFeature;
class QgsLayerTreeView;
@ -571,10 +572,36 @@ class GUI_EXPORT QgisInterface : public QObject
*/
virtual bool openFeatureForm( QgsVectorLayer *l, QgsFeature &f, bool updateFeatureOnly = false ) = 0;
virtual QDialog* getFeatureForm( QgsVectorLayer *l, QgsFeature &f ) = 0;
/**
* Returns a feature form for a given feature
*
* @param layer The layer for which the dialog will be created
* @param feature The feature for which the dialog will be created
*
* @return A feature form
*/
virtual QgsAttributeDialog* getFeatureForm( QgsVectorLayer *l, QgsFeature &f ) = 0;
/**
* Access the vector layer tools instance.
* With the help of this you can access methods like addFeature, startEditing
* or stopEditing while giving the user the appropriate dialogs.
*
* @return An instance of the vector layer tools
*/
virtual QgsVectorLayerTools* vectorLayerTools() = 0;
/** This method is only needed when using a UI form with a custom widget plugin and calling
* openFeatureForm or getFeatureForm from Python (PyQt4) and you havn't used the info tool first.
* Python will crash bringing QGIS wtih it
* if the custom form is not loaded from a C++ method call.
*
* This method uses a QTimer to call QUiLoader in order to load the form via C++
* you only need to call this once after that you can call openFeatureForm/getFeatureForm
* like normal
*
* More information here: http://qt-project.org/forums/viewthread/27098/
*/
virtual void preloadForm( QString uifile ) = 0;
/** Return vector layers in edit mode