Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Smarter default edit widgets with plugins to pick them
Now the widgets factories can give a score on how good they could handle a widget. Additionaly, plugins can be added to choose a widget factory in function of an external information. One of them uses a table in PostgresQL to allow specification of the widget type and configuration. I took the opportunity to remove a few deprecated method in relation to this.
- Loading branch information
Patrick Valsecchi
committed
Aug 29, 2016
1 parent
235204f
commit 24bde35
Showing
61 changed files
with
909 additions
and
234 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
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,41 @@ | ||
/*************************************************************************** | ||
qgseditorwidgetautoconf.sip | ||
--------------------- | ||
begin : July 2016 | ||
copyright : (C) 2016 by Patrick Valsecchi | ||
email : patrick.valsecchi at camptocamp.com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
/** | ||
* Base class for plugins allowing to pick automatically a widget type for editing fields. | ||
* | ||
* @note added in QGIS 3.0 | ||
*/ | ||
class QgsEditorWidgetAutoConfPlugin | ||
{ | ||
%TypeHeaderCode | ||
#include <qgseditorwidgetautoconf.h> | ||
%End | ||
|
||
public: | ||
/** | ||
* Typical scores are: | ||
* * 0: no matching type found. | ||
* * 10: a widget has been guessed from the type of field. | ||
* * 20: a widget has been determined from an external configuration (for example a database table) | ||
* | ||
* @param vl The vector layer for which this widget will be created | ||
* @param fieldName The field name on the specified layer for which this widget will be created | ||
* @param score Where the score is returned (default to 0) | ||
* | ||
* @return and integer value rating how good is the setup provided by this plugin. | ||
*/ | ||
virtual QgsEditorWidgetSetup editorWidgetSetup( const QgsVectorLayer* vl, const QString& fieldName, int& score /Out/ ) const = 0; | ||
}; |
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
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.