Skip to content
Permalink
Browse files

QgisInterface::getFeatureForm() returns a QgsAttributeDialog

And some API comments
  • Loading branch information
m-kuhn committed Aug 18, 2014
1 parent 8105545 commit 4ade943937fb90ef681fd5d11b0e0d5ccb304a05
Showing with 31 additions and 4 deletions.
  1. +1 −1 python/gui/qgisinterface.sip
  2. +1 −1 src/app/qgisappinterface.cpp
  3. +1 −1 src/app/qgisappinterface.h
  4. +28 −1 src/gui/qgisinterface.h
@@ -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;

@@ -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;

@@ -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.
@@ -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

0 comments on commit 4ade943

Please sign in to comment.
You can’t perform that action at this time.