Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an editor widget for QVariantList
- Loading branch information
Patrick Valsecchi
committed
Sep 13, 2016
1 parent
abc55f4
commit 57d0094
Showing
33 changed files
with
941 additions
and
81 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
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,32 @@ | ||
/** \ingroup gui | ||
* Widget allowing to edit a QVariantList, using a table. | ||
* @note added in QGIS 3.0 | ||
*/ | ||
class QgsListWidget : public QgsTableWidgetBase | ||
{ | ||
%TypeHeaderCode | ||
#include "qgslistwidget.h" | ||
%End | ||
public: | ||
/** | ||
* Constructor. | ||
*/ | ||
explicit QgsListWidget( QVariant::Type subType, QWidget* parent = nullptr ); | ||
|
||
/** | ||
* Set the initial value of the widget. | ||
*/ | ||
void setList( const QVariantList& list ); | ||
|
||
/** | ||
* Get the edit value. | ||
* @return the QVariantList | ||
*/ | ||
QVariantList list() const; | ||
|
||
/** | ||
* Check the content is valid | ||
* @return true if valid | ||
*/ | ||
bool valid() const; | ||
}; |
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,28 @@ | ||
/** \ingroup gui | ||
* Base widget allowing to edit a collection, using a table. | ||
* @note added in QGIS 3.0 | ||
*/ | ||
class QgsTableWidgetBase: public QWidget | ||
{ | ||
%TypeHeaderCode | ||
#include "qgstablewidgetbase.h" | ||
%End | ||
public: | ||
/** | ||
* Constructor. | ||
*/ | ||
explicit QgsTableWidgetBase( QWidget* parent ); | ||
|
||
protected: | ||
/** | ||
* Initialise the table with the given model. | ||
* Must be called once in the child class' constructor. | ||
*/ | ||
void init( QAbstractTableModel* model ); | ||
|
||
signals: | ||
/** | ||
* Emitted each time a key or a value is changed. | ||
*/ | ||
void valueChanged(); | ||
}; |
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
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.