sipify gui attribute table

This commit is contained in:
Denis Rouzaud 2017-06-08 15:51:05 +02:00
parent f5c3b8a1f8
commit 2454e56b32
19 changed files with 1285 additions and 857 deletions

View File

@ -41,19 +41,6 @@ core/composer/qgspaperitem.sip
core/composer/qgsscalebarstyle.sip
core/composer/qgssingleboxscalebarstyle.sip
core/composer/qgsticksscalebarstyle.sip
gui/attributetable/qgsattributetabledelegate.sip
gui/attributetable/qgsattributetablefiltermodel.sip
gui/attributetable/qgsattributetablemodel.sip
gui/attributetable/qgsattributetableview.sip
gui/attributetable/qgsdualview.sip
gui/attributetable/qgsfeaturelistmodel.sip
gui/attributetable/qgsfeaturelistview.sip
gui/attributetable/qgsfeaturelistviewdelegate.sip
gui/attributetable/qgsfeaturemodel.sip
gui/attributetable/qgsfeatureselectionmodel.sip
gui/attributetable/qgsfieldconditionalformatwidget.sip
gui/attributetable/qgsifeatureselectionmanager.sip
gui/attributetable/qgsorganizetablecolumnsdialog.sip
gui/symbology-ng/qgs25drendererwidget.sip
gui/symbology-ng/qgsarrowsymbollayerwidget.sip
gui/symbology-ng/qgsbrushstylecombobox.sip

View File

@ -1,53 +1,86 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsattributetabledelegate.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsAttributeTableDelegate : QItemDelegate
{
%TypeHeaderCode
#include <qgsattributetabledelegate.h>
%Docstring
A delegate item class for QgsAttributeTable (see Qt documentation for
QItemDelegate).
%End
QgsVectorLayer *layer( const QAbstractItemModel *model ) const;
%TypeHeaderCode
#include "qgsattributetabledelegate.h"
%End
public:
/** Constructor
* @param parent parent object
*/
QgsAttributeTableDelegate( QObject *parent /TransferThis/ = 0 );
/** Used to create an editor for when the user tries to
* change the contents of a cell */
QWidget * createEditor(
QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index ) const;
%Docstring
Constructor
\param parent parent object
%End
/** Overloads the paint method form the QItemDelegate bas class */
void paint(
QPainter * painter,
const QStyleOptionViewItem & option,
const QModelIndex &index ) const;
virtual QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const;
/**
* Sets data from editor back to model. Overloads default method
* @param editor editor which was created by create editor function in this class
* @param model model where data should be updated
* @param index index of field which is to be modified
*/
void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const;
%Docstring
Used to create an editor for when the user tries to
change the contents of a cell
:rtype: QWidget
%End
/**
* Sets data from model into the editor. Overloads default method
* @param editor editor which was created by create editor function in this class
* @param index index of field which is to be retrieved
*/
void setEditorData( QWidget *editor, const QModelIndex &index ) const;
virtual void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const;
%Docstring
Overloads the paint method form the QItemDelegate base class
%End
virtual void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const;
%Docstring
Sets data from editor back to model. Overloads default method
\param editor editor which was created by create editor function in this class
\param model model where data should be updated
\param index index of field which is to be modified
%End
virtual void setEditorData( QWidget *editor, const QModelIndex &index ) const;
%Docstring
Sets data from model into the editor. Overloads default method
\param editor editor which was created by create editor function in this class
\param index index of field which is to be retrieved
%End
void setFeatureSelectionModel( QgsFeatureSelectionModel *featureSelectionModel );
signals:
/**
* Is emitted when an action column item is painted.
* The consumer of this signal can initialize the index widget.
*
* @note This signal is emitted repeatedly whenever the item is being painted.
* It is the consumers responsibility to check if initialization has already
* happened before.
*/
void actionColumnItemPainted( const QModelIndex &index ) const;
%Docstring
Is emitted when an action column item is painted.
The consumer of this signal can initialize the index widget.
.. note::
This signal is emitted repeatedly whenever the item is being painted.
It is the consumers responsibility to check if initialization has already
happened before.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsattributetabledelegate.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,12 +1,23 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsattributetablefiltermodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsAttributeTableFilterModel: QSortFilterProxyModel, QgsFeatureModel
{
%TypeHeaderCode
#include <qgsattributetablefiltermodel.h>
#include "qgsattributetablefiltermodel.h"
%End
public:
/**
* The filter mode defines how the rows should be filtered.
*/
enum FilterMode
{
ShowAll,
@ -16,123 +27,132 @@ class QgsAttributeTableFilterModel: QSortFilterProxyModel, QgsFeatureModel
ShowEdited
};
/**
* The type of a column.
*/
enum ColumnType
{
ColumnTypeField, //!< This column shows a field
ColumnTypeActionButton //!< This column shows action buttons
ColumnTypeField,
ColumnTypeActionButton
};
/**
* The additional roles defined by this filter model.
* The values of these roles start just after the roles defined by
* QgsAttributeTableModel so they do not conflict.
*/
enum Role
{
TypeRole = QgsAttributeTableModel::UserRole //!< The type of a given column
TypeRole
};
/**
* Make sure, the master model is already loaded, so the selection will get synchronized.
*
* @param parent parent object (owner)
* @param sourceModel The QgsAttributeTableModel to use as source (mostly referred to as master model)
* @param canvas The mapCanvas. Used to identify the currently visible features.
*/
QgsAttributeTableFilterModel( QgsMapCanvas *canvas, QgsAttributeTableModel *sourceModel, QObject *parent /TransferThis/ = 0 );
%Docstring
Make sure, the master model is already loaded, so the selection will get synchronized.
\param parent parent object (owner)
\param sourceModel The QgsAttributeTableModel to use as source (mostly referred to as master model)
\param canvas The mapCanvas. Used to identify the currently visible features.
%End
/**
* Set the attribute table model that backs this model
*
* @param sourceModel The model
*
* @note added in 2.0
*/
void setSourceModel( QgsAttributeTableModel *sourceModel );
%Docstring
Set the attribute table model that backs this model
\param sourceModel The model
.. versionadded:: 2.0
%End
/**
* Changes the sort order of the features. If set to true, selected features
* will be sorted on top, regardless of the current sort column
*
* @param selectedOnTop Specify, if selected features should be sorted on top
*/
void setSelectedOnTop( bool selectedOnTop );
%Docstring
Changes the sort order of the features. If set to true, selected features
will be sorted on top, regardless of the current sort column
\param selectedOnTop Specify, if selected features should be sorted on top
%End
/**
* Returns if selected features are currently shown on top
*
* @return True if selected are shown on top
*/
bool selectedOnTop();
%Docstring
Returns if selected features are currently shown on top
:return: True if selected are shown on top
:rtype: bool
%End
/**
* Specify a list of features, which the filter will accept.
* The filter mode will automatically be adjusted to show only these features (ShowFilteredList).
*
* @param ids The list of feature ids which will be accepted by the filter
*/
virtual void setFilteredFeatures( const QgsFeatureIds &ids );
%Docstring
Specify a list of features, which the filter will accept.
The filter mode will automatically be adjusted to show only these features (ShowFilteredList).
\param ids The list of feature ids which will be accepted by the filter
%End
/**
* Get a list of currently filtered feature ids
*
* @return A list of feature ids
*/
QgsFeatureIds filteredFeatures();
%Docstring
Get a list of currently filtered feature ids
:return: A list of feature ids
:rtype: QgsFeatureIds
%End
/**
* Set the filter mode the filter will use.
*
* @param filterMode Sets the current mode of the filter
*/
void setFilterMode( FilterMode filterMode );
%Docstring
Set the filter mode the filter will use.
\param filterMode Sets the current mode of the filter
%End
/**
* The current filterModel
*/
FilterMode filterMode();
%Docstring
The current filterModel
:rtype: FilterMode
%End
/**
* Returns the layer this filter acts on.
*
* @return Abovementioned layer
*/
QgsVectorLayer *layer() const;
%Docstring
Returns the layer this filter acts on.
:return: Abovementioned layer
:rtype: QgsVectorLayer
%End
/**
* Returns the layerCache this filter acts on.
*
* @return The layer cache
*/
QgsVectorLayerCache *layerCache() const;
%Docstring
Returns the layerCache this filter acts on.
:return: The layer cache
:rtype: QgsVectorLayerCache
%End
/**
* Returns the table model this filter is using
*
* @return the table model in quesion
*/
QgsAttributeTableModel *masterModel() const;
%Docstring
Returns the table model this filter is using
:return: the table model in quesion
:rtype: QgsAttributeTableModel
%End
/**
* Returns the feature id for a given model index.
*
* @param row A model index of the row in question
*
* @return The feature id of the feature visible in the provided row
*/
QgsFeatureId rowToId( const QModelIndex &row );
%Docstring
Returns the feature id for a given model index.
\param row A model index of the row in question
:return: The feature id of the feature visible in the provided row
:rtype: QgsFeatureId
%End
virtual QModelIndex fidToIndex( QgsFeatureId fid );
QModelIndex fidToIndex( QgsFeatureId fid );
QModelIndexList fidToIndexList( QgsFeatureId fid );
%Docstring
:rtype: QModelIndexList
%End
virtual QModelIndex mapToMaster( const QModelIndex &proxyIndex ) const;
QModelIndex mapToMaster( const QModelIndex &proxyIndex ) const;
%Docstring
:rtype: QModelIndex
%End
QModelIndex mapFromMaster( const QModelIndex &sourceIndex ) const;
%Docstring
:rtype: QModelIndex
%End
virtual QModelIndex mapToSource( const QModelIndex &proxyIndex ) const;
@ -140,85 +160,107 @@ class QgsAttributeTableFilterModel: QSortFilterProxyModel, QgsFeatureModel
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
/**
* Sort by the given column using the given order.
* Prefetches all the data from the layer to speed up sorting.
*
* @param column The column which should be sorted
* @param order The order ( Qt::AscendingOrder or Qt::DescendingOrder )
*/
virtual void sort( int column, Qt::SortOrder order = Qt::AscendingOrder );
%Docstring
Sort by the given column using the given order.
Prefetches all the data from the layer to speed up sorting.
/**
* Sort by the given expression using the given order.
* Prefetches all the data from the layer to speed up sorting.
*
* @param expression The expression which should be used for sorting
* @param order The order ( Qt::AscendingOrder or Qt::DescendingOrder )
*/
void sort( QString expression, Qt::SortOrder order = Qt::AscendingOrder );
\param column The column which should be sorted
\param order The order ( Qt.AscendingOrder or Qt.DescendingOrder )
%End
void sort( const QString &expression, Qt::SortOrder order = Qt::AscendingOrder );
%Docstring
Sort by the given expression using the given order.
Prefetches all the data from the layer to speed up sorting.
\param expression The expression which should be used for sorting
\param order The order ( Qt.AscendingOrder or Qt.DescendingOrder )
%End
/**
* The expression which is used to sort the attribute table.
*/
QString sortExpression() const;
%Docstring
The expression which is used to sort the attribute table.
:rtype: str
%End
/** Returns the map canvas*/
QgsMapCanvas *mapCanvas() const;
%Docstring
Returns the map canvas
:rtype: QgsMapCanvas
%End
virtual QVariant data( const QModelIndex &index, int role ) const;
QVariant headerData( int section, Qt::Orientation orientation, int role ) const;
virtual QVariant headerData( int section, Qt::Orientation orientation, int role ) const;
/**
* Get the index of the first column that contains an action widget.
* Returns -1 if none is defined.
*/
int actionColumnIndex() const;
%Docstring
Get the index of the first column that contains an action widget.
Returns -1 if none is defined.
:rtype: int
%End
virtual int columnCount( const QModelIndex &parent ) const;
int columnCount( const QModelIndex &parent ) const;
/**
* Set the attribute table configuration to control which fields are shown,
* in which order they are shown as well as if and where an action column
* is shown.
*/
void setAttributeTableConfig( const QgsAttributeTableConfig &config );
%Docstring
Set the attribute table configuration to control which fields are shown,
in which order they are shown as well as if and where an action column
is shown.
%End
signals:
/**
* Is emitted whenever the sort column is changed
* @param column The sort column
* @param order The sort order
*/
void sortColumnChanged( int column, Qt::SortOrder order );
%Docstring
Is emitted whenever the sort column is changed
\param column The sort column
\param order The sort order
%End
protected:
/**
* Returns true if the source row will be accepted
*
* @param sourceRow row from the source model
* @param sourceParent parent index in the source model
*/
bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const;
/**
* Updates the list of currently visible features on the map canvas.
* Is called automatically when the filter mode is adjusted or the extents changed.
*/
virtual bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const;
%Docstring
Returns true if the source row will be accepted
\param sourceRow row from the source model
\param sourceParent parent index in the source model
:rtype: bool
%End
void generateListOfVisibleFeatures();
%Docstring
Updates the list of currently visible features on the map canvas.
Is called automatically when the filter mode is adjusted or the extents changed.
%End
/**
* Used by the sorting algorithm. Compares the two model indices. Will also consider the
* selection state of the feature in case selected features are to be shown on top.
*/
bool lessThan( const QModelIndex &left, const QModelIndex &right ) const;
virtual bool lessThan( const QModelIndex &left, const QModelIndex &right ) const;
%Docstring
Used by the sorting algorithm. Compares the two model indices. Will also consider the
selection state of the feature in case selected features are to be shown on top.
:rtype: bool
%End
public slots:
/**
* Is called upon every change of the visible extents on the map canvas.
* When a change is signalled, the filter is updated and invalidated if needed.
*/
void extentsChanged();
%Docstring
Is called upon every change of the visible extents on the map canvas.
When a change is signalled, the filter is updated and invalidated if needed.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsattributetablefiltermodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,229 +1,290 @@
class QgsAttributeTableModel : QAbstractTableModel
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsattributetablemodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsAttributeTableModel: QAbstractTableModel
{
%Docstring
A model backed by a QgsVectorLayerCache which is able to provide
feature/attribute information to a QAbstractItemView.
\brief
Is able to generate editor widgets for its QModelIndexes as well.
Is mostly referred to as "master model" within this doc and the source.
.. seealso:: <a href="http://doc.qt.digia.com/qt/model-view-programming.html">Qt Model View Programming</a>
%End
%TypeHeaderCode
#include <qgsattributetablemodel.h>
#include <qgsmaplayeractionregistry.h>
#include "qgsattributetablemodel.h"
%End
public:
enum Role
{
SortRole,
FeatureIdRole,
FieldIndexRole
FieldIndexRole,
UserRole
};
public:
/**
* Constructor
* @param layerCache A layer cache to use as backend
* @param parent The parent QObject (owner)
*/
QgsAttributeTableModel( QgsVectorLayerCache *layerCache, QObject *parent = 0 );
%Docstring
Constructor
\param layerCache A layer cache to use as backend
\param parent The parent QObject (owner)
%End
virtual ~QgsAttributeTableModel();
/**
* Returns the number of rows
* @param parent parent index
*/
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
%Docstring
Returns the number of rows
\param parent parent index
:rtype: int
%End
/**
* Returns the number of columns
* @param parent parent index
*/
int columnCount( const QModelIndex &parent = QModelIndex() ) const;
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
/**
* Returns header data
* @param section required section
* @param orientation horizontal or vertical orientation
* @param role data role
*/
QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
%Docstring
Returns the number of columns
\param parent parent index
:rtype: int
%End
virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
%Docstring
Returns header data
\param section required section
\param orientation horizontal or vertical orientation
\param role data role
:rtype: QVariant
%End
/**
* Returns data on the given index
* @param index model index
* @param role data role
*/
virtual QVariant data( const QModelIndex &index, int role ) const;
%Docstring
Returns data on the given index
\param index model index
\param role data role
:rtype: QVariant
%End
/**
* Updates data on given index
* @param index model index
* @param value new data value
* @param role data role
*/
virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );
%Docstring
Updates data on given index
\param index model index
\param value new data value
\param role data role
:rtype: bool
%End
/**
* Returns item flags for the index
* @param index model index
*/
Qt::ItemFlags flags( const QModelIndex &index ) const;
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
%Docstring
Returns item flags for the index
\param index model index
:rtype: Qt.ItemFlags
%End
/**
* Reloads the model data between indices
* @param index1 start index
* @param index2 end index
*/
void reload( const QModelIndex &index1, const QModelIndex &index2 );
%Docstring
Reloads the model data between indices
\param index1 start index
\param index2 end index
%End
/**
* Remove rows
*/
bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() );
virtual bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() );
%Docstring
Remove rows
:rtype: bool
%End
/**
* Resets the model
*/
void resetModel();
%Docstring
Resets the model
Alias to loadLayer()
%End
/**
* Maps feature id to table row
* @param id feature id
*/
int idToRow( QgsFeatureId id ) const;
%Docstring
Maps feature id to table row
\param id feature id
:rtype: int
%End
QModelIndex idToIndex( QgsFeatureId id ) const;
%Docstring
:rtype: QModelIndex
%End
QModelIndexList idToIndexList( QgsFeatureId id ) const;
%Docstring
:rtype: QModelIndexList
%End
/**
* get field index from column
*/
int fieldIdx( int col ) const;
%Docstring
get field index from column
:rtype: int
%End
/**
* get column from field index
*/
int fieldCol( int idx ) const;
%Docstring
get column from field index
:rtype: int
%End
/**
* Maps row to feature id
* @param row row number
*/
QgsFeatureId rowToId( int row ) const;
%Docstring
Maps row to feature id
\param row row number
:rtype: QgsFeatureId
%End
/**
* Swaps two rows
* @param a first row
* @param b second row
*/
void swapRows( QgsFeatureId a, QgsFeatureId b );
%Docstring
Swaps two rows
\param a first row
\param b second row
%End
/**
* Returns the layer this model uses as backend. Retrieved from the layer cache.
*/
QgsVectorLayer *layer() const;
%Docstring
Returns the layer this model uses as backend. Retrieved from the layer cache.
:rtype: QgsVectorLayer
%End
/**
* Returns the layer cache this model uses as backend.
*/
QgsVectorLayerCache *layerCache() const;
%Docstring
Returns the layer cache this model uses as backend.
:rtype: QgsVectorLayerCache
%End
/**
* Execute an action
*/
void executeAction( const QString &action, const QModelIndex &idx ) const;
void executeAction( const QUuid &action, const QModelIndex &idx ) const;
%Docstring
Execute an action
%End
/**
* Execute a QgsMapLayerAction
*/
void executeMapLayerAction( QgsMapLayerAction *action, const QModelIndex &idx ) const;
%Docstring
Execute a QgsMapLayerAction
%End
/**
* Return the feature attributes at given model index
* @return feature attributes at given model index
*/
QgsFeature feature( const QModelIndex &idx ) const;
%Docstring
Return the feature attributes at given model index
:return: feature attributes at given model index
:rtype: QgsFeature
%End
/**
* Caches the entire data for one column. This should be called prior to sorting,
* so the data does not have to be fetched for every single comparison.
* Specify -1 as column to invalidate the cache
*
* @param column The column index of the field to catch
*/
void prefetchColumnData( int column );
%Docstring
Caches the entire data for one column. This should be called prior to sorting,
so the data does not have to be fetched for every single comparison.
Specify -1 as column to invalidate the cache
\param column The column index of the field to catch
%End
/**
* Prefetches the entire data for one expression. Based on this cached information
* the sorting can later be done in a performant way.
*
* @param expression The expression to cache
*/
void prefetchSortData( const QString &expression );
%Docstring
Prefetches the entire data for one expression. Based on this cached information
the sorting can later be done in a performant way.
\param expression The expression to cache
%End
/**
* The expression which was used to fill the sorting cache
*/
QString sortCacheExpression() const;
%Docstring
The expression which was used to fill the sorting cache
:rtype: str
%End
/**
* Set a request that will be used to fill this attribute table model.
* In contrast to a filter, the request will constrain the data shown without the possibility
* to dynamically adjust it.
*
* @param request The request to use to fill this table model.
*/
void setRequest( const QgsFeatureRequest &request );
%Docstring
Set a request that will be used to fill this attribute table model.
In contrast to a filter, the request will constrain the data shown without the possibility
to dynamically adjust it.
\param request The request to use to fill this table model.
%End
/**
* Get the the feature request
*/
const QgsFeatureRequest &request() const;
%Docstring
:rtype: QgsFeatureRequest
%End
/**
* Sets the context in which this table is shown.
* Will be forwarded to any editor widget created when editing data on this model.
*
* @param context The context
*/
void setEditorContext( const QgsAttributeEditorContext &context );
%Docstring
Sets the context in which this table is shown.
Will be forwarded to any editor widget created when editing data on this model.
\param context The context
%End
/**
* Returns the context in which this table is shown.
* Will be forwarded to any editor widget created when editing data on this model.
*
* @return The context
*/
const QgsAttributeEditorContext &editorContext() const;
%Docstring
Returns the context in which this table is shown.
Will be forwarded to any editor widget created when editing data on this model.
:return: The context
:rtype: QgsAttributeEditorContext
%End
/**
* Empty extra columns to announce from this model.
* Any extra columns need to be implemented by proxy models in front of this model.
*/
int extraColumns() const;
%Docstring
Empty extra columns to announce from this model.
Any extra columns need to be implemented by proxy models in front of this model.
:rtype: int
%End
/**
* Empty extra columns to announce from this model.
* Any extra columns need to be implemented by proxy models in front of this model.
*/
void setExtraColumns( int extraColumns );
%Docstring
Empty extra columns to announce from this model.
Any extra columns need to be implemented by proxy models in front of this model.
%End
public slots:
/**
* Loads the layer into the model
* Preferably to be called, before using this model as source for any other proxy model
*/
virtual void loadLayer();
%Docstring
Loads the layer into the model
Preferably to be called, before using this model as source for any other proxy model
%End
/** Handles updating the model when the conditional style for a field changes.
* @param fieldName name of field whose conditional style has changed
* @note added in QGIS 2.12
*/
void fieldConditionalStyleChanged( const QString &fieldName );
%Docstring
Handles updating the model when the conditional style for a field changes.
\param fieldName name of field whose conditional style has changed
.. versionadded:: 2.12
%End
signals:
/**
* Model has been changed
*/
void modelChanged();
//! @note not available in python bindings
// void progress( int i, bool &cancel );
void modelChanged();
%Docstring
Model has been changed
%End
void finished();
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsattributetablemodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,112 +1,150 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsattributetableview.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsAttributeTableView : QTableView
{
%TypeHeaderCode
#include <qgsattributetableview.h>
%Docstring
\brief
Provides a table view of features of a QgsVectorLayer.
This can either be used as a standalone widget. QgsBrowser features a reference implementation.
Or this can be used within the QgsDualView stacked widget.
%End
%TypeHeaderCode
#include "qgsattributetableview.h"
%End
public:
QgsAttributeTableView( QWidget *parent /TransferThis/ = 0 );
virtual ~QgsAttributeTableView();
virtual void setModel( QgsAttributeTableFilterModel *filterModel );
/**
* @brief setFeatureSelectionManager
* @param featureSelectionManager We will take ownership
*/
void setFeatureSelectionManager( QgsIFeatureSelectionManager *featureSelectionManager /Transfer/ );
%Docstring
setFeatureSelectionManager
\param featureSelectionManager We will take ownership
%End
/**
* This event filter is installed on the verticalHeader to intercept mouse press and release
* events. These are used to disable / enable live synchronisation with the map canvas selection
* which can be slow due to recurring canvas repaints.
*
* @param object The object which is the target of the event.
* @param event The intercepted event
*
* @return Returns always false, so the event gets processed
*/
virtual bool eventFilter( QObject *object, QEvent *event );
%Docstring
This event filter is installed on the verticalHeader to intercept mouse press and release
events. These are used to disable / enable live synchronisation with the map canvas selection
which can be slow due to recurring canvas repaints.
\param object The object which is the target of the event.
\param event The intercepted event
:return: Returns always false, so the event gets processed
:rtype: bool
%End
/**
* Set the attribute table config which should be used to control
* the appearance of the attribute table.
* @note added in QGIS 2.16
*/
void setAttributeTableConfig( const QgsAttributeTableConfig &config );
%Docstring
Set the attribute table config which should be used to control
the appearance of the attribute table.
.. versionadded:: 2.16
%End
protected:
/**
* Called for mouse press events on a table cell.
* Disables selection change for these events.
*
* @param event The mouse event
*/
void mousePressEvent( QMouseEvent *event );
/**
* Called for mouse release events on a table cell.
* Disables selection change for these events.
*
* @param event The mouse event
*/
void mouseReleaseEvent( QMouseEvent *event );
virtual void mousePressEvent( QMouseEvent *event );
/**
* Called for mouse move events on a table cell.
* Disables selection change for these events.
*
* @param event The mouse event
*/
void mouseMoveEvent( QMouseEvent *event );
%Docstring
Called for mouse press events on a table cell.
Disables selection change for these events.
/**
* Called for key press events
* Disables selection change by only pressing an arrow key
*
* @param event The mouse event
*/
void keyPressEvent( QKeyEvent *event );
\param event The mouse event
%End
/**
* @brief
* Is called when the context menu will be shown. Emits a @link willShowContextMenu @endlink signal,
* so the menu can be populated by other parts of the application.
*
* @param event The associated event object.
*/
void contextMenuEvent( QContextMenuEvent *event );
virtual void mouseReleaseEvent( QMouseEvent *event );
/**
* Saves geometry to the settings on close
* @param event not used
*/
void closeEvent( QCloseEvent *event );
%Docstring
Called for mouse release events on a table cell.
Disables selection change for these events.
\param event The mouse event
%End
virtual void mouseMoveEvent( QMouseEvent *event );
%Docstring
Called for mouse move events on a table cell.
Disables selection change for these events.
\param event The mouse event
%End
virtual void keyPressEvent( QKeyEvent *event );
%Docstring
Called for key press events
Disables selection change by only pressing an arrow key
\param event The mouse event
%End
virtual void contextMenuEvent( QContextMenuEvent *event );
%Docstring
\brief
Is called when the context menu will be shown. Emits a willShowContextMenu() signal,
so the menu can be populated by other parts of the application.
\param event The associated event object.
%End
virtual void closeEvent( QCloseEvent *event );
%Docstring
Saves geometry to the settings on close
\param event not used
%End
signals:
/**
* @brief
* Is emitted, in order to provide a hook to add additional* menu entries to the context menu.
*
* @param menu If additional QMenuItems are added, they will show up in the context menu.
* @param atIndex The QModelIndex, to which the context menu belongs. Relative to the source model.
* In most cases, this will be a @link QgsAttributeTableFilterModel @endlink
*/
void willShowContextMenu( QMenu *menu, const QModelIndex &atIndex );
%Docstring
\brief
Is emitted, in order to provide a hook to add additional* menu entries to the context menu.
\param menu If additional QMenuItems are added, they will show up in the context menu.
\param atIndex The QModelIndex, to which the context menu belongs. Relative to the source model.
In most cases, this will be a QgsAttributeTableFilterModel
%End
void columnResized( int column, int width );
%Docstring
Emitted when a column in the view has been resized.
\param column column index (starts at 0)
\param width new width in pixel
.. versionadded:: 2.16
%End
void finished();
/** Emitted when a column in the view has been resized.
* @param column column index (starts at 0)
* @param width new width in pixel
* @note added in QGIS 2.16
*/
void columnResized( int column, int width );
public slots:
void repaintRequested( const QModelIndexList &indexes );
void repaintRequested();
virtual void selectAll();
virtual void selectRow( int row );
virtual void _q_selectRow( int row );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsattributetableview.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,239 +1,277 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsdualview.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsDualView : QStackedWidget
{
%TypeHeaderCode
#include <qgsdualview.h>
%Docstring
This widget is used to show the attributes of a set of features of a QgsVectorLayer.
The attributes can be edited.
It supports two different layouts: the table layout, in which the attributes for the features
are shown in a table and the editor layout, where the features are shown as a selectable list
and the attributes for the currently selected feature are shown in a form.
%End
%TypeHeaderCode
#include "qgsdualview.h"
%End
public:
/**
* The view modes, in which this widget can present information.
* Relates to the QStackedWidget stacks.
*
*/
enum ViewMode
{
/**
* Shows the features and attributes in a table layout
*/
AttributeTable,
/**
* Show a list of the features, where one can be chosen
* and the according attribute dialog will be presented
* in the neighbouring frame.
*/
AttributeEditor
};
/**
* @brief Constructor
* @param parent The parent widget
*/
explicit QgsDualView( QWidget *parent /TransferThis/ = 0 );
virtual ~QgsDualView();
%Docstring
Constructor
\param parent The parent widget
%End
void init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, const QgsFeatureRequest& request = QgsFeatureRequest(), const QgsAttributeEditorContext& context = QgsAttributeEditorContext(),
void init( QgsVectorLayer *layer, QgsMapCanvas *mapCanvas, const QgsFeatureRequest &request = QgsFeatureRequest(), const QgsAttributeEditorContext &context = QgsAttributeEditorContext(),
bool loadFeatures = true );
%Docstring
Has to be called to initialize the dual view.
\param layer The layer which should be used to fetch features
\param mapCanvas The mapCanvas (used for the FilterMode
QgsAttributeTableFilterModel.ShowVisible)
\param request Use a modified request to limit the shown features
\param context The context in which this view is shown
\param loadFeatures whether to initially load all features into the view. If set to
false, limited features can later be loaded using setFilterMode()
%End
/**
* Change the current view mode.
*
* @param view The view mode to set
* @see view()
*/
void setView( ViewMode view );
%Docstring
Change the current view mode.
\param view The view mode to set
.. seealso:: view()
%End
/**
* Returns the current view mode.
* @see setView()
* @note added in QGIS 2.16
*/
ViewMode view() const;
%Docstring
Returns the current view mode.
.. seealso:: setView()
.. versionadded:: 2.16
:rtype: ViewMode
%End
/**
* Set the filter mode
*
* @param filterMode
*/
void setFilterMode( QgsAttributeTableFilterModel::FilterMode filterMode );
%Docstring
Set the filter mode
\param filterMode
%End
/**
* Get the filter mode
*
* @return the filter mode
*/
QgsAttributeTableFilterModel::FilterMode filterMode();
%Docstring
Get the filter mode
:return: the filter mode
:rtype: QgsAttributeTableFilterModel.FilterMode
%End
/**
* Toggle the selectedOnTop flag. If enabled, selected features will be moved to top.
*
* @param selectedOnTop True: Show selected features on top.
* False: Use defined sorting column.
*/
void setSelectedOnTop( bool selectedOnTop );
%Docstring
Toggle the selectedOnTop flag. If enabled, selected features will be moved to top.
\param selectedOnTop True: Show selected features on top.
False: Use defined sorting column.
%End
/**
* Returns the number of features on the layer.
*
* @return Number of features
*/
int featureCount();
%Docstring
Returns the number of features on the layer.
:return: Number of features
:rtype: int
%End
/**
* Returns the number of features which are currently visible, according to the
* filter restrictions
*
* @return Number of features
*/
int filteredFeatureCount();
%Docstring
Returns the number of features which are currently visible, according to the
filter restrictions
:return: Number of features
:rtype: int
%End
/**
* Set a list of currently visible features
*
* @param filteredFeatures A list of feature ids
*
*/
void setFilteredFeatures( const QgsFeatureIds &filteredFeatures );
%Docstring
Set a list of currently visible features
\param filteredFeatures A list of feature ids
%End
/**
* Get a list of currently visible feature ids.
*/
QgsFeatureIds filteredFeatures();
%Docstring
Get a list of currently visible feature ids.
:rtype: QgsFeatureIds
%End
/**
* Returns the model which has the information about all features (not only filtered)
*
* @return The master model
*/
QgsAttributeTableModel *masterModel() const;
%Docstring
Returns the model which has the information about all features (not only filtered)
:return: The master model
:rtype: QgsAttributeTableModel
%End
/**
* Set the request
*
* @param request The request
*/
void setRequest( const QgsFeatureRequest &request );
%Docstring
Set the request
\param request The request
%End
/**
* Set the feature selection model
*
* @param featureSelectionManager the feature selection model
*/
void setFeatureSelectionManager( QgsIFeatureSelectionManager *featureSelectionManager );
%Docstring
Set the feature selection model
\param featureSelectionManager the feature selection model
%End
/**
* Returns the table view
*
* @return The table view
*/
QgsAttributeTableView *tableView();
%Docstring
Returns the table view
:return: The table view
:rtype: QgsAttributeTableView
%End
/**
* Set the attribute table config which should be used to control
* the appearance of the attribute table.
*/
void setAttributeTableConfig( const QgsAttributeTableConfig &config );
%Docstring
Set the attribute table config which should be used to control
the appearance of the attribute table.
%End
/**
* Set the expression used for sorting the table and feature list.
*/
void setSortExpression( const QString &sortExpression , Qt::SortOrder sortOrder = Qt::AscendingOrder );
void setSortExpression( const QString &sortExpression, Qt::SortOrder sortOrder = Qt::AscendingOrder );
%Docstring
Set the expression used for sorting the table and feature list.
%End
/**
* Get the expression used for sorting the table and feature list.
*/
QString sortExpression() const;
%Docstring
Get the expression used for sorting the table and feature list.
:rtype: str
%End
protected:
/**
* Initializes widgets which depend on the attributes of this layer
*/
void columnBoxInit();
virtual void hideEvent( QHideEvent * );
virtual void focusOutEvent( QFocusEvent * );
void columnBoxInit();
%Docstring
Initializes widgets which depend on the attributes of this layer
%End
public slots:
/**
* @brief Set the current edit selection in the {@link AttributeEditor} mode.
*
* @param fids A list of edited features (Currently only one at a time is supported)
*/
void setCurrentEditSelection( const QgsFeatureIds &fids );
/**
* @brief saveEditChanges
*
* @return true if the saving was ok. false is possible due to connected
* validation logic.
*/
void setCurrentEditSelection( const QgsFeatureIds &fids );
%Docstring
Set the current edit selection in the AttributeEditor mode.
\param fids A list of edited features (Currently only one at a time is supported)
%End
bool saveEditChanges();
%Docstring
saveEditChanges
:return: true if the saving was ok. false is possible due to connected
validation logic.
:rtype: bool
%End
void openConditionalStyles();
/** Sets whether multi edit mode is enabled.
* @note added in QGIS 2.16
*/
void setMultiEditEnabled( bool enabled );
%Docstring
Sets whether multi edit mode is enabled.
.. versionadded:: 2.16
%End
/** Toggles whether search mode should be enabled in the form.
* @param enabled set to true to switch on search mode
* @note added in QGIS 2.16
*/
void toggleSearchMode( bool enabled );
%Docstring
Toggles whether search mode should be enabled in the form.
\param enabled set to true to switch on search mode
.. versionadded:: 2.16
%End
/**
* Copy the content of the selected cell in the clipboard.
* @note added in QGIS 1.16
*/
void copyCellContent() const;
%Docstring
Copy the content of the selected cell in the clipboard.
.. versionadded:: 1.16
%End
signals:
/**
* Is emitted, whenever the display expression is successfully changed
* @param expression The expression that was applied
*/
void displayExpressionChanged( const QString &expression );
%Docstring
Is emitted, whenever the display expression is successfully changed
\param expression The expression that was applied
%End
/**
* Is emitted, whenever the filter changes
*/
void filterChanged();
%Docstring
Is emitted, whenever the filter changes
%End
/** Is emitted when a filter expression is set using the view.
* @param expression filter expression
* @param type filter type
* @note added in QGIS 2.16
*/
void filterExpressionSet( const QString &expression, QgsAttributeForm::FilterType type );
%Docstring
Is emitted when a filter expression is set using the view.
\param expression filter expression
\param type filter type
.. versionadded:: 2.16
%End
/** Emitted when the form changes mode.
* @param mode new mode
*/
void formModeChanged( QgsAttributeForm::Mode mode );
%Docstring
Emitted when the form changes mode.
\param mode new mode
%End
};
class QgsAttributeTableAction : QAction
{
%TypeHeaderCode
#include <qgsdualview.h>
%End
%TypeHeaderCode
#include "qgsdualview.h"
%End
public:
QgsAttributeTableAction( const QString &name, QgsDualView *dualView, const QUuid &action, const QModelIndex &fieldIdx );
%Docstring
Create a new attribute table action.
.. versionadded:: 3.0
%End
public slots:
void execute();
void featureForm();
};
class QgsAttributeTableMapLayerAction : QAction
{
%TypeHeaderCode
#include <qgsdualview.h>
%End
%TypeHeaderCode
#include "qgsdualview.h"
%End
public:
QgsAttributeTableMapLayerAction( const QString &name, QgsDualView *dualView, QgsMapLayerAction *action, const QModelIndex &fieldIdx );
@ -241,3 +279,12 @@ class QgsAttributeTableMapLayerAction : QAction
void execute();
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsdualview.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,15 +1,29 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsfeaturelistmodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsFeatureListModel : QAbstractProxyModel, QgsFeatureModel
{
%TypeHeaderCode
#include <qgsfeaturelistmodel.h>
#include "qgsfeaturelistmodel.h"
%End
public:
struct FeatureInfo
{
public:
FeatureInfo();
bool isNew;
bool isEdited;
public:
FeatureInfo();
bool isNew;
bool isEdited;
};
enum Role
@ -24,64 +38,111 @@ class QgsFeatureListModel : QAbstractProxyModel, QgsFeatureModel
virtual void setSourceModel( QgsAttributeTableFilterModel *sourceModel );
QgsVectorLayerCache *layerCache();
%Docstring
:rtype: QgsVectorLayerCache
%End
virtual QVariant data( const QModelIndex &index, int role ) const;
virtual Qt::ItemFlags flags( const QModelIndex &index ) const;
/**
* @brief If true is specified, a NULL value will be injected
* @param injectNull state of null value injection
* @note added in 2.9
*/
void setInjectNull( bool injectNull );
%Docstring
If true is specified, a NULL value will be injected
\param injectNull state of null value injection
.. versionadded:: 2.9
%End
/**
* @brief Returns the current state of null value injection
* @return If a NULL value is added
* @note added in 2.9
*/
bool injectNull();
%Docstring
Returns the current state of null value injection
:return: If a NULL value is added
.. versionadded:: 2.9
:rtype: bool
%End
QgsAttributeTableModel *masterModel();
%Docstring
:rtype: QgsAttributeTableModel
%End
/**
* @param expression A {@link QgsExpression} compatible string.
* @return true if the expression could be set, false if there was a parse error.
* If it fails, the old expression will still be applied. Call {@link parserErrorString()}
* for a meaningful error message.
*/
bool setDisplayExpression( const QString &expression );
%Docstring
\param expression A QgsExpression compatible string.
:return: true if the expression could be set, false if there was a parse error.
If it fails, the old expression will still be applied. Call parserErrorString()
for a meaningful error message.
:rtype: bool
%End
/**
* @brief Returns a detailed message about errors while parsing a QgsExpression.
* @return A message containing information about the parser error.
*/
QString parserErrorString();
%Docstring
Returns a detailed message about errors while parsing a QgsExpression.
:return: A message containing information about the parser error.
:rtype: str
%End
QString displayExpression() const;
%Docstring
:rtype: str
%End
bool featureByIndex( const QModelIndex &index, QgsFeature &feat );
%Docstring
:rtype: bool
%End
QgsFeatureId idxToFid( const QModelIndex &index ) const;
%Docstring
:rtype: QgsFeatureId
%End
QModelIndex fidToIdx( const QgsFeatureId fid ) const;
%Docstring
:rtype: QModelIndex
%End
virtual QModelIndex mapToSource( const QModelIndex &proxyIndex ) const;
virtual QModelIndex mapFromSource( const QModelIndex &sourceIndex ) const;
virtual QModelIndex mapToMaster( const QModelIndex &proxyIndex ) const;
%Docstring
:rtype: QModelIndex
%End
virtual QModelIndex mapFromMaster( const QModelIndex &sourceIndex ) const;
%Docstring
:rtype: QModelIndex
%End
virtual QItemSelection mapSelectionFromMaster( const QItemSelection &selection ) const;
%Docstring
:rtype: QItemSelection
%End
virtual QItemSelection mapSelectionToMaster( const QItemSelection &selection ) const;
%Docstring
:rtype: QItemSelection
%End
virtual QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const;
virtual QModelIndex parent( const QModelIndex &child ) const;
virtual int columnCount( const QModelIndex&parent = QModelIndex() ) const;
virtual int columnCount( const QModelIndex &parent = QModelIndex() ) const;
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
QModelIndex fidToIndex( QgsFeatureId fid );
virtual QModelIndex fidToIndex( QgsFeatureId fid );
QModelIndexList fidToIndexList( QgsFeatureId fid );
%Docstring
:rtype: QModelIndexList
%End
public slots:
void onBeginRemoveRows( const QModelIndex &parent, int first, int last );
void onEndRemoveRows( const QModelIndex &parent, int first, int last );
void onBeginInsertRows( const QModelIndex &parent, int first, int last );
void onEndInsertRows( const QModelIndex &parent, int first, int last );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsfeaturelistmodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,85 +1,107 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsfeaturelistview.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsFeatureListView : QListView
{
%Docstring
Shows a list of features and renders a edit button next to each feature.
Accepts a display expression to define the way, features are rendered.
Uses a QgsFeatureListModel as source model.
%End
%TypeHeaderCode
#include <qgsfeaturelistview.h>
#include "qgsfeaturelistview.h"
%End
public:
/**
* Creates a feature list view
*
* @param parent owner
*/
explicit QgsFeatureListView( QWidget *parent /TransferThis/ = 0 );
%Docstring
Creates a feature list view
/**
* Destructor
*/
virtual ~QgsFeatureListView();
\param parent owner
%End
/**
* Returns the layer cache
* @return the layer cache used as backend
*/
QgsVectorLayerCache *layerCache();
%Docstring
Returns the layer cache
:return: the layer cache used as backend
:rtype: QgsVectorLayerCache
%End
/**
* Set the {@link QgsFeatureListModel} which is used to retrieve information
*
* @param featureListModel The model to use
*/
virtual void setModel( QgsFeatureListModel *featureListModel );
/**
* Get the featureListModel used by this view
*
* @return The model in use
*/
%Docstring
Set the QgsFeatureListModel which is used to retrieve information
\param featureListModel The model to use
%End
QgsFeatureListModel *featureListModel();
%Docstring
Get the featureListModel used by this view
/**
* The display expression is an expression used to render the fields into a single string
* which is displaied.
*
* @param displayExpression The expression used to render the feature
*
* @see QgsExpression
*/
bool setDisplayExpression( const QString displayExpression );
:return: The model in use
:rtype: QgsFeatureListModel
%End
bool setDisplayExpression( const QString &displayExpression );
%Docstring
The display expression is an expression used to render the fields into a single string
which is displaied.
\param displayExpression The expression used to render the feature
.. seealso:: QgsExpression
:rtype: bool
%End
/**
* Returns the expression which is currently used to render the features.
*
* @return A string containing the currend display expression
*
* @see QgsExpression
*/
const QString displayExpression() const;
%Docstring
Returns the expression which is currently used to render the features.
:return: A string containing the currend display expression
.. seealso:: QgsExpression
:rtype: str
%End
/**
* Returns a detailed message about errors while parsing a QgsExpression.
*
* @return A message containing information about the parser error.
*/
QString parserErrorString();
%Docstring
Returns a detailed message about errors while parsing a QgsExpression.
:return: A message containing information about the parser error.
:rtype: str
%End
/**
* Get the currentEditSelection
*
* @return A list of edited feature ids
*/
QgsFeatureIds currentEditSelection();
%Docstring
Get the currentEditSelection
:return: A list of edited feature ids
:rtype: QgsFeatureIds
%End
/**
* Sets if the currently shown form has received any edit events so far.
*
* @param state The state
*/
void setCurrentFeatureEdited( bool state );
%Docstring
Sets if the currently shown form has received any edit events so far.
\param state The state
%End
/**
* @brief setFeatureSelectionManager
* @param featureSelectionManager We will take ownership
*/
void setFeatureSelectionManager( QgsIFeatureSelectionManager *featureSelectionManager /Transfer/ );
%Docstring
setFeatureSelectionManager
\param featureSelectionManager We will take ownership
%End
protected:
virtual void mouseMoveEvent( QMouseEvent *event );
@ -89,42 +111,52 @@ class QgsFeatureListView : QListView
virtual void contextMenuEvent( QContextMenuEvent *event );
signals:
/**
* Is emitted, whenever the current edit selection has been changed.
*
* @param feat the feature, which will be edited.
*/
void currentEditSelectionChanged( QgsFeature &feat );
%Docstring
Is emitted, whenever the current edit selection has been changed.
\param feat the feature, which will be edited.
%End
/**
* Is emitted, whenever the display expression is successfully changed
* @param expression The expression that was applied
*/
void displayExpressionChanged( const QString &expression );
%Docstring
Is emitted, whenever the display expression is successfully changed
\param expression The expression that was applied
%End
//void aboutToChangeEditSelection( bool &ok );
public slots:
/**
* Set the feature(s) to be edited
*
* @param fids A list of features to be edited
*/
void setEditSelection( const QgsFeatureIds &fids );
%Docstring
Set the feature(s) to be edited
\param fids A list of features to be edited
%End
/**
* Set the feature(s) to be edited
*
* @param index The selection to set
* @param command selection update mode
*/
void setEditSelection( const QModelIndex &index, QItemSelectionModel::SelectionFlags command );
%Docstring
Set the feature(s) to be edited
\param index The selection to set
\param command selection update mode
%End
/**
* Select all currently visible features
*/
virtual void selectAll();
%Docstring
Select all currently visible features
%End
void repaintRequested( QModelIndexList indexes );
void repaintRequested( const QModelIndexList &indexes );
void repaintRequested();
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsfeaturelistview.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,7 +1,18 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsfeaturelistviewdelegate.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsFeatureListViewDelegate : QItemDelegate
{
%TypeHeaderCode
#include <qgsfeaturelistviewdelegate.h>
#include "qgsfeaturelistviewdelegate.h"
%End
public:
static const int ICON_SIZE;
@ -17,6 +28,9 @@ class QgsFeatureListViewDelegate : QItemDelegate
void setEditSelectionModel( QItemSelectionModel *editSelectionModel );
Element positionToElement( QPoint pos );
%Docstring
:rtype: Element
%End
void setFeatureSelectionModel( QgsFeatureSelectionModel *featureSelectionModel );
@ -28,4 +42,13 @@ class QgsFeatureListViewDelegate : QItemDelegate
protected:
virtual QSize sizeHint( const QStyleOptionViewItem &option, const QModelIndex &index ) const;
virtual void paint( QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index ) const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsfeaturelistviewdelegate.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,9 +1,31 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsfeaturemodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsFeatureModel
{
%TypeHeaderCode
#include <qgsfeaturemodel.h>
#include "qgsfeaturemodel.h"
%End
public:
virtual ~QgsFeatureModel();
virtual QModelIndex fidToIndex( QgsFeatureId fid ) = 0;
%Docstring
:rtype: QModelIndex
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsfeaturemodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,77 +1,103 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsfeatureselectionmodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsFeatureSelectionModel : QItemSelectionModel
{
%TypeHeaderCode
#include <attributetable/qgsfeatureselectionmodel.h>
#include "qgsfeatureselectionmodel.h"
%End
public:
explicit QgsFeatureSelectionModel( QAbstractItemModel *model, QgsFeatureModel *featureModel, QgsIFeatureSelectionManager *featureSelectionHandler, QObject *parent /TransferThis/ );
/**
* Enables or disables synchronisation to the {@link QgsVectorLayer}
* When synchronisation is disabled, any selection change will be buffered inside this selection model.
* When enabled, any buffered changes are communicated to the layer and the buffer is emptied.
* Mainly to be used for performance reasons, because selection change on the layer can cost time as it
* repaints the layer.
*
* @param enable The synchronisation status to set.
*/
void enableSync( bool enable );
%Docstring
Enables or disables synchronisation to the QgsVectorLayer
When synchronisation is disabled, any selection change will be buffered inside this selection model.
When enabled, any buffered changes are communicated to the layer and the buffer is emptied.
Mainly to be used for performance reasons, because selection change on the layer can cost time as it
repaints the layer.
\param enable The synchronisation status to set.
%End
/**
* Returns the selection status of a given feature id.
*
* @param fid The featureid to determine the selection status of
*
* @return The selection status
*/
virtual bool isSelected( QgsFeatureId fid );
/**
* Returns the selection status of a given QModelIndex.
*
* @param index The index to determine the selection status of
*
* @return The selection status
*/
%Docstring
Returns the selection status of a given feature id.
\param fid The featureid to determine the selection status of
:return: The selection status
:rtype: bool
%End
virtual bool isSelected( const QModelIndex &index );
%Docstring
Returns the selection status of a given QModelIndex.
\param index The index to determine the selection status of
:return: The selection status
:rtype: bool
%End
signals:
/**
* Request a repaint of a list of model indexes.
* Views using this model should connect to and properly process this signal.
*
* @param indexes The model indexes which need to be repainted
*/
void requestRepaint( const QModelIndexList &indexes );
/**
* Request a repaint of the visible items of connected views.
* Views using this model should connect to and properly process this signal.
*/
void requestRepaint( const QModelIndexList &indexes );
%Docstring
Request a repaint of a list of model indexes.
Views using this model should connect to and properly process this signal.
\param indexes The model indexes which need to be repainted
%End
void requestRepaint();
%Docstring
Request a repaint of the visible items of connected views.
Views using this model should connect to and properly process this signal.
%End
public slots:
/**
* Overwritten to do NOTHING (we handle selection ourselves)
*
* @see selectFeatures( const QItemSelection&, SelectionFlags )
*/
virtual void select( const QModelIndex &index, SelectionFlags command );
%Docstring
Overwritten to do NOTHING (we handle selection ourselves)
.. seealso:: selectFeatures( const QItemSelection&, SelectionFlags )
%End
/**
* Overwritten to do NOTHING (we handle selection ourselves)
*
* @see selectFeatures( const QItemSelection&, SelectionFlags )
*/
virtual void select( const QItemSelection &selection, SelectionFlags command );
%Docstring
Overwritten to do NOTHING (we handle selection ourselves)
/**
* Select features on this table. Is to be used in favor of the stock select methods.
*
* @param selection The QItemSelection which will be selected
* @param command The command to apply. Select, Deselect and ClearAndSelect are processed.
*/
virtual void selectFeatures( const QItemSelection &selection, const SelectionFlags &command );
.. seealso:: selectFeatures( const QItemSelection&, SelectionFlags )
%End
virtual void selectFeatures( const QItemSelection &selection, SelectionFlags command );
%Docstring
Select features on this table. Is to be used in favor of the stock select methods.
\param selection The QItemSelection which will be selected
\param command The command to apply. Select, Deselect and ClearAndSelect are processed.
%End
virtual void setFeatureSelectionManager( QgsIFeatureSelectionManager *featureSelectionManager /Transfer/ );
virtual void setFeatureSelectionManager( QgsIFeatureSelectionManager *featureSelectionManager );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsfeatureselectionmodel.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,65 +1,93 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsfieldconditionalformatwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/** \ingroup gui
* \class QgsFieldConditionalFormatWidget
* A widget for customising conditional formatting options.
* \note added in QGIS 2.12
*/
class QgsFieldConditionalFormatWidget : QWidget
{
%TypeHeaderCode
#include <attributetable/qgsfieldconditionalformatwidget.h>
%Docstring
A widget for customising conditional formatting options.
.. versionadded:: 2.12
%End
%TypeHeaderCode
#include "qgsfieldconditionalformatwidget.h"
%End
public:
/** Constructor for QgsFieldConditionalFormatWidget.
* @param parent parent widget
*/
explicit QgsFieldConditionalFormatWidget( QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsFieldConditionalFormatWidget.
\param parent parent widget
%End
~QgsFieldConditionalFormatWidget();
/** Switches the widget to the rules page.
*/
void viewRules();
%Docstring
Switches the widget to the rules page.
%End
/** Sets the vector layer associated with the widget.
* @param layer vector layer
*/
void setLayer( QgsVectorLayer *layer );
%Docstring
Sets the vector layer associated with the widget.
\param layer vector layer
%End
/** Switches the widget to the edit style mode for the specified style.
* @param index index of conditional style to edit
* @param style initial conditional styling options
*/
void editStyle( int index, const QgsConditionalStyle &style );
%Docstring
Switches the widget to the edit style mode for the specified style.
\param index index of conditional style to edit
\param style initial conditional styling options
%End
/**
* @param style initial conditional styling options
*/
void loadStyle( const QgsConditionalStyle &style );
%Docstring
\param style initial conditional styling options
%End
/** Resets the formatting options to their default state.
*/
void reset();
%Docstring
Resets the formatting options to their default state.
%End
/**
* @brief Set the presets that can be used for quick pick
* @param styles A list of styles used as presets
*/
void setPresets( const QList<QgsConditionalStyle> &styles );
%Docstring
Set the presets that can be used for quick pick
\param styles A list of styles used as presets
%End
/**
* @brief The default presets for the widget. Normally set when the widget is
* created however called setPresets will override the default styles.
* @return List of default presets.
*/
QList<QgsConditionalStyle> defaultPresets() const;
%Docstring
The default presets for the widget. Normally set when the widget is
created however called setPresets will override the default styles.
:return: List of default presets.
:rtype: list of QgsConditionalStyle
%End
signals:
/** Emitted when the conditional styling rules are updated.
* @param fieldName name of field whose rules have been modified.
*/
void rulesUpdated( const QString &fieldName );
%Docstring
Emitted when the conditional styling rules are updated.
\param fieldName name of field whose rules have been modified.
%End
public slots:
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsfieldconditionalformatwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,77 +1,84 @@
/***************************************************************************
qgsifeatureselectionmanager.sip
--------------------------------------
Date : 6.6.2013
Copyright : (C) 2013 Matthias Kuhn
Email : matthias at opengis dot ch
***************************************************************************
* *
* 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. *
* *
***************************************************************************/
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsifeatureselectionmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
/**
* Is an interface class to abstract feature selection handling.
*
* e.g. { @link QgsVectorLayer } implements this interface to manage its selections.
*/
class QgsIFeatureSelectionManager : QObject
{
%Docstring
Is an interface class to abstract feature selection handling.
e.g. QgsVectorLayer implements this interface to manage its selections.
%End
%TypeHeaderCode
#include <qgsifeatureselectionmanager.h>
#include "qgsifeatureselectionmanager.h"
%End
public:
QgsIFeatureSelectionManager( QObject *parent /TransferThis/ );
/**
* The number of features that are selected in this layer
*
* @return See description
*/
virtual int selectedFeatureCount() = 0;
%Docstring
The number of features that are selected in this layer
:return: See description
:rtype: int
%End
/**
* Select features
*
* @param ids Feature ids to select
*/
virtual void select( const QgsFeatureIds &ids ) = 0;
%Docstring
Select features
\param ids Feature ids to select
%End
/**
* Deselect features
*
* @param ids Feature ids to deselect
*/
virtual void deselect( const QgsFeatureIds &ids ) = 0;
%Docstring
Deselect features
\param ids Feature ids to deselect
%End
/**
* Change selection to the new set of features. Dismisses the current selection.
* Will emit the { @link selectionChanged( const QgsFeatureIds&, const QgsFeatureIds&, bool ) } signal with the
* clearAndSelect flag set.
*
* @param ids The ids which will be the new selection
*/
virtual void setSelectedFeatures( const QgsFeatureIds &ids ) = 0;
%Docstring
Change selection to the new set of features. Dismisses the current selection.
Will emit the selectionChanged( const QgsFeatureIds&, const QgsFeatureIds&, bool ) signal with the
clearAndSelect flag set.
\param ids The ids which will be the new selection
%End
/**
* Return reference to identifiers of selected features
*
* @return A list of { @link QgsFeatureId } 's
* @see selectedFeatures()
*/
virtual const QgsFeatureIds &selectedFeatureIds() const = 0;
%Docstring
Return reference to identifiers of selected features
:return: A list of QgsFeatureId's
.. seealso:: selectedFeatures()
:rtype: QgsFeatureIds
%End
signals:
/**
* This signal is emitted when selection was changed
*
* @param selected Newly selected feature ids
* @param deselected Ids of all features which have previously been selected but are not any more
* @param clearAndSelect In case this is set to true, the old selection was dismissed and the new selection corresponds to selected
*/
void selectionChanged( const QgsFeatureIds &selected, const QgsFeatureIds &deselected, const bool clearAndSelect );
%Docstring
This signal is emitted when selection was changed
\param selected Newly selected feature ids
\param deselected Ids of all features which have previously been selected but are not any more
\param clearAndSelect In case this is set to true, the old selection was dismissed and the new selection corresponds to selected
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsifeatureselectionmanager.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,43 +1,62 @@
/** /class QgsOrganizeTableColumnsDialog
* /ingroup gui
* Dialog for organising (hiding and reordering) columns in the attributes table.
* /note added in QGIS 2.16
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsorganizetablecolumnsdialog.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsOrganizeTableColumnsDialog : QDialog
{
%TypeHeaderCode
#include <qgsorganizetablecolumnsdialog.h>
%Docstring
Dialog for organising (hiding and reordering) columns in the attributes table.
.. versionadded:: 2.16
%End
%TypeHeaderCode
#include "qgsorganizetablecolumnsdialog.h"
%End
public:
/**
* Constructor
* @param vl The concerned vector layer
* @param visible the current list of visible fields name
* @param parent parent object
* @param flags window flags
*/
QgsOrganizeTableColumnsDialog(const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = Qt::Window );
/**
* Destructor
*/
QgsOrganizeTableColumnsDialog( const QgsVectorLayer *vl, QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = Qt::Window );
%Docstring
Constructor
\param vl The concerned vector layer
\param parent parent object
\param flags window flags
%End
~QgsOrganizeTableColumnsDialog();
/**
* Get the updated configuration
*/
QgsAttributeTableConfig config() const;
%Docstring
Get the updated configuration
:rtype: QgsAttributeTableConfig
%End
public slots:
/**
* showAll checks all the fields to show them all in the attribute table
*/
void showAll();
/**
* hideAll unchecks all the fields to hide them all in the attribute table
*/
void showAll();
%Docstring
showAll checks all the fields to show them all in the attribute table
%End
void hideAll();
%Docstring
hideAll unchecks all the fields to hide them all in the attribute table
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsorganizetablecolumnsdialog.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -119,6 +119,7 @@ class GUI_EXPORT QgsFeatureListView : public QListView
* \param featureSelectionManager We will take ownership
*/
void setFeatureSelectionManager( QgsIFeatureSelectionManager *featureSelectionManager SIP_TRANSFER );
protected:
virtual void mouseMoveEvent( QMouseEvent *event ) override;
virtual void mousePressEvent( QMouseEvent *event ) override;

View File

@ -32,7 +32,7 @@ class GUI_EXPORT QgsFeatureListViewDelegate : public QItemDelegate
Q_OBJECT
public:
static int const ICON_SIZE = 24;
static const int ICON_SIZE = 24;
enum Element
{

View File

@ -15,13 +15,14 @@
#ifndef QGSFEATUREMODEL_H
#define QGSFEATUREMODEL_H
#include "qgis_gui.h"
#include "qgsfeature.h" // QgsFeatureId
#include <QModelIndex>
/** \ingroup gui
* \class QgsFeatureModel
*/
class QgsFeatureModel
class GUI_EXPORT QgsFeatureModel
{
public:
virtual ~QgsFeatureModel() = default;

View File

@ -104,7 +104,7 @@ class GUI_EXPORT QgsFeatureSelectionModel : public QItemSelectionModel
*/
virtual void selectFeatures( const QItemSelection &selection, SelectionFlags command );
virtual void setFeatureSelectionManager( QgsIFeatureSelectionManager *featureSelectionManager );
virtual void setFeatureSelectionManager( QgsIFeatureSelectionManager *featureSelectionManager SIP_TRANSFER );
private slots:
virtual void layerSelectionChanged( const QgsFeatureIds &selected, const QgsFeatureIds &deselected, bool clearAndSelect );

View File

@ -43,7 +43,7 @@ class GUI_EXPORT QgsOrganizeTableColumnsDialog : public QDialog, private Ui::Qgs
* \param parent parent object
* \param flags window flags
*/
QgsOrganizeTableColumnsDialog( const QgsVectorLayer *vl, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::Window );
QgsOrganizeTableColumnsDialog( const QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags flags = Qt::Window );
~QgsOrganizeTableColumnsDialog();