2017-06-08 15:51:05 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/attributetable/qgsdualview.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
class QgsDualView : QStackedWidget
|
|
|
|
{
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
2013-06-22 19:37:41 +02:00
|
|
|
%End
|
|
|
|
|
2017-06-08 15:51:05 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsdualview.h"
|
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
public:
|
2014-01-27 09:22:24 +01:00
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
enum ViewMode
|
|
|
|
{
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
AttributeTable,
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
AttributeEditor
|
|
|
|
};
|
|
|
|
|
2017-08-29 16:22:20 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
explicit QgsDualView( QWidget *parent /TransferThis/ = 0 );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
|
|
|
Constructor
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param parent: The parent widget
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2017-06-08 15:51:05 +02:00
|
|
|
void init( QgsVectorLayer *layer, QgsMapCanvas *mapCanvas, const QgsFeatureRequest &request = QgsFeatureRequest(), const QgsAttributeEditorContext &context = QgsAttributeEditorContext(),
|
2017-02-21 11:17:48 +10:00
|
|
|
bool loadFeatures = true );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Has to be called to initialize the dual view.
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
: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()
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2014-01-27 09:22:24 +01:00
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
void setView( ViewMode view );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Change the current view mode.
|
|
|
|
|
|
|
|
:param view: The view mode to set
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`view`
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2016-03-08 14:11:33 +11:00
|
|
|
ViewMode view() const;
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the current view mode.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setView`
|
2017-12-15 10:36:55 -04:00
|
|
|
|
2017-06-08 15:51:05 +02:00
|
|
|
.. versionadded:: 2.16
|
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
void setFilterMode( QgsAttributeTableFilterModel::FilterMode filterMode );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the filter mode
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param filterMode:
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
QgsAttributeTableFilterModel::FilterMode filterMode();
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Get the filter mode
|
|
|
|
|
|
|
|
:return: the filter mode
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2014-05-27 23:22:50 +02:00
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
void setSelectedOnTop( bool selectedOnTop );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Toggle the selectedOnTop flag. If enabled, selected features will be moved to top.
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param selectedOnTop: True: Show selected features on top.
|
|
|
|
False: Use defined sorting column.
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
|
|
|
|
int featureCount();
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the number of features on the layer.
|
|
|
|
|
|
|
|
:return: Number of features
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
|
|
|
|
int filteredFeatureCount();
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the number of features which are currently visible, according to the
|
|
|
|
filter restrictions
|
|
|
|
|
|
|
|
:return: Number of features
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void setFilteredFeatures( const QgsFeatureIds &filteredFeatures );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set a list of currently visible features
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param filteredFeatures: A list of feature ids
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2014-05-27 23:22:50 +02:00
|
|
|
QgsFeatureIds filteredFeatures();
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Get a list of currently visible feature ids.
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2014-05-27 23:22:50 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsAttributeTableModel *masterModel() const;
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the model which has the information about all features (not only filtered)
|
|
|
|
|
|
|
|
:return: The master model
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void setRequest( const QgsFeatureRequest &request );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the request
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param request: The request
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2014-01-27 09:22:24 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void setFeatureSelectionManager( QgsIFeatureSelectionManager *featureSelectionManager );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the feature selection model
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param featureSelectionManager: the feature selection model
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2014-01-27 09:22:24 +01:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsAttributeTableView *tableView();
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the table view
|
|
|
|
|
|
|
|
:return: The table view
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2016-07-07 17:25:54 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void setAttributeTableConfig( const QgsAttributeTableConfig &config );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the attribute table config which should be used to control
|
|
|
|
the appearance of the attribute table.
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2016-02-24 08:54:50 +01:00
|
|
|
|
2017-06-08 15:51:05 +02:00
|
|
|
void setSortExpression( const QString &sortExpression, Qt::SortOrder sortOrder = Qt::AscendingOrder );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the expression used for sorting the table and feature list.
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2016-04-08 19:18:20 +02:00
|
|
|
|
|
|
|
QString sortExpression() const;
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Get the expression used for sorting the table and feature list.
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2016-04-08 19:18:20 +02:00
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
public slots:
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void setCurrentEditSelection( const QgsFeatureIds &fids );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
|
|
|
Set the current edit selection in the AttributeEditor mode.
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param fids: A list of edited features (Currently only one at a time is supported)
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
|
2014-01-27 09:22:24 +01:00
|
|
|
bool saveEditChanges();
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
|
|
|
saveEditChanges
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:return: true if the saving was OK. false is possible due to connected
|
|
|
|
validation logic.
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2014-01-27 09:22:24 +01:00
|
|
|
|
2016-01-04 22:51:18 +11:00
|
|
|
void openConditionalStyles();
|
|
|
|
|
2016-03-08 14:11:33 +11:00
|
|
|
void setMultiEditEnabled( bool enabled );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets whether multi edit mode is enabled.
|
|
|
|
|
2017-06-08 15:51:05 +02:00
|
|
|
.. versionadded:: 2.16
|
|
|
|
%End
|
2016-03-08 14:11:33 +11:00
|
|
|
|
2016-05-17 14:16:17 +10:00
|
|
|
void toggleSearchMode( bool enabled );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Toggles whether search mode should be enabled in the form.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param enabled: set to true to switch on search mode
|
|
|
|
|
2017-06-08 15:51:05 +02:00
|
|
|
.. versionadded:: 2.16
|
|
|
|
%End
|
2016-05-17 14:16:17 +10:00
|
|
|
|
2016-05-27 18:56:17 +02:00
|
|
|
void copyCellContent() const;
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Copy the content of the selected cell in the clipboard.
|
|
|
|
|
2017-06-08 15:51:05 +02:00
|
|
|
.. versionadded:: 1.16
|
2017-12-09 16:07:02 +01:00
|
|
|
%End
|
|
|
|
|
|
|
|
void cancelProgress( );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Cancel the progress dialog (if any)
|
|
|
|
|
2017-12-09 16:07:02 +01:00
|
|
|
.. versionadded:: 3.0
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2016-05-27 18:56:17 +02:00
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
signals:
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void displayExpressionChanged( const QString &expression );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Is emitted, whenever the display expression is successfully changed
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param expression: The expression that was applied
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
|
|
|
|
void filterChanged();
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Is emitted, whenever the filter changes
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2016-05-17 14:16:17 +10:00
|
|
|
|
2017-05-01 18:13:15 +02:00
|
|
|
void filterExpressionSet( const QString &expression, QgsAttributeForm::FilterType type );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Is emitted when a filter expression is set using the view.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param expression: filter expression
|
|
|
|
:param type: filter type
|
|
|
|
|
2017-06-08 15:51:05 +02:00
|
|
|
.. versionadded:: 2.16
|
|
|
|
%End
|
2016-05-17 14:16:17 +10:00
|
|
|
|
|
|
|
void formModeChanged( QgsAttributeForm::Mode mode );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Emitted when the form changes mode.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param mode: new mode
|
2017-12-29 14:19:53 +01:00
|
|
|
%End
|
|
|
|
|
|
|
|
void showContextMenuExternally( QgsActionMenu *menu, const QgsFeatureId fid );
|
|
|
|
%Docstring
|
|
|
|
Emitted when selecting context menu on the feature list to create the context menu individually
|
|
|
|
|
|
|
|
:param menu: context menu
|
|
|
|
:param fid: feature id of the selected feature
|
2017-06-08 15:51:05 +02:00
|
|
|
%End
|
2016-05-17 14:16:17 +10:00
|
|
|
|
2017-09-05 18:15:11 +02:00
|
|
|
protected:
|
|
|
|
virtual void hideEvent( QHideEvent *event );
|
|
|
|
|
2017-12-15 08:57:22 +10:00
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
};
|
|
|
|
|
2013-06-24 08:43:47 +02:00
|
|
|
class QgsAttributeTableAction : QAction
|
2013-06-22 19:37:41 +02:00
|
|
|
{
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
%TypeHeaderCode
|
2017-06-08 15:51:05 +02:00
|
|
|
#include "qgsdualview.h"
|
2013-06-22 19:37:41 +02:00
|
|
|
%End
|
|
|
|
public:
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2018-02-02 14:33:38 +10:00
|
|
|
QgsAttributeTableAction( const QString &name, QgsDualView *dualView, QUuid action, const QModelIndex &fieldIdx );
|
2017-06-08 15:51:05 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Create a new attribute table action.
|
2017-06-08 15:51:05 +02:00
|
|
|
|
|
|
|
.. versionadded:: 3.0
|
|
|
|
%End
|
2013-06-22 19:37:41 +02:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void execute();
|
|
|
|
void featureForm();
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2013-06-22 19:37:41 +02:00
|
|
|
};
|
2014-01-19 23:04:24 +11:00
|
|
|
|
|
|
|
class QgsAttributeTableMapLayerAction : QAction
|
|
|
|
{
|
2017-06-08 15:51:05 +02:00
|
|
|
|
2014-01-19 23:04:24 +11:00
|
|
|
%TypeHeaderCode
|
2017-06-08 15:51:05 +02:00
|
|
|
#include "qgsdualview.h"
|
2014-01-19 23:04:24 +11:00
|
|
|
%End
|
|
|
|
public:
|
2017-05-01 18:13:15 +02:00
|
|
|
QgsAttributeTableMapLayerAction( const QString &name, QgsDualView *dualView, QgsMapLayerAction *action, const QModelIndex &fieldIdx );
|
2014-01-19 23:04:24 +11:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void execute();
|
|
|
|
|
|
|
|
};
|
2017-06-08 15:51:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/attributetable/qgsdualview.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|