QGIS/python/gui/attributetable/qgsdualview.sip.in

307 lines
7.4 KiB
Plaintext
Raw Normal View History

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 *
************************************************************************/
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.
%End
2017-06-08 15:51:05 +02:00
%TypeHeaderCode
#include "qgsdualview.h"
%End
public:
2014-01-27 09:22:24 +01:00
enum ViewMode
{
2017-06-08 15:51:05 +02:00
AttributeTable,
2017-06-08 15:51:05 +02:00
AttributeEditor
};
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
2017-06-08 15:51:05 +02:00
void init( QgsVectorLayer *layer, QgsMapCanvas *mapCanvas, const QgsFeatureRequest &request = QgsFeatureRequest(), const QgsAttributeEditorContext &context = QgsAttributeEditorContext(),
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
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
.. seealso:: :py:func:`view`
2017-06-08 15:51:05 +02:00
%End
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.
.. seealso:: :py:func:`setView`
2017-12-15 10:36:55 -04:00
2017-06-08 15:51:05 +02:00
.. versionadded:: 2.16
%End
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
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
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
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
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
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
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
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
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
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
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
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
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
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
public slots:
2017-06-08 15:51:05 +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
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
void openConditionalStyles();
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
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
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
%End
void cancelProgress( );
%Docstring
2017-12-15 10:36:55 -04:00
Cancel the progress dialog (if any)
.. versionadded:: 3.0
2017-06-08 15:51:05 +02:00
%End
signals:
2017-06-08 15:51:05 +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
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
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
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
%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
protected:
virtual void hideEvent( QHideEvent *event );
};
2013-06-24 08:43:47 +02:00
class QgsAttributeTableAction : QAction
{
2017-06-08 15:51:05 +02:00
%TypeHeaderCode
2017-06-08 15:51:05 +02:00
#include "qgsdualview.h"
%End
public:
2017-06-08 15:51:05 +02: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
public slots:
void execute();
void featureForm();
2017-06-08 15:51:05 +02:00
};
class QgsAttributeTableMapLayerAction : QAction
{
2017-06-08 15:51:05 +02:00
%TypeHeaderCode
2017-06-08 15:51:05 +02:00
#include "qgsdualview.h"
%End
public:
QgsAttributeTableMapLayerAction( const QString &name, QgsDualView *dualView, QgsMapLayerAction *action, const QModelIndex &fieldIdx );
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 *
************************************************************************/