QGIS API Documentation
3.8.0-Zanzibar (11aff65)
|
This widget is used to show the attributes of a set of features of a QgsVectorLayer. More...
#include <qgsdualview.h>
Public Types | |
enum | FeatureListBrowsingAction { NoAction = 0, PanToFeature, ZoomToFeature } |
Action on the map canvas when browsing the list of features. More... | |
enum | ViewMode { AttributeTable = 0, AttributeEditor = 1 } |
The view modes, in which this widget can present information. More... | |
Public Slots | |
void | cancelProgress () |
Cancel the progress dialog (if any) More... | |
void | copyCellContent () const |
Copy the content of the selected cell in the clipboard. More... | |
void | openConditionalStyles () |
bool | saveEditChanges () |
saveEditChanges More... | |
void | setCurrentEditSelection (const QgsFeatureIds &fids) |
Set the current edit selection in the AttributeEditor mode. More... | |
void | setMultiEditEnabled (bool enabled) |
Sets whether multi edit mode is enabled. More... | |
void | toggleSearchMode (bool enabled) |
Toggles whether search mode should be enabled in the form. More... | |
Signals | |
void | displayExpressionChanged (const QString &expression) |
Emitted whenever the display expression is successfully changed. More... | |
void | filterChanged () |
Emitted whenever the filter changes. More... | |
void | filterExpressionSet (const QString &expression, QgsAttributeForm::FilterType type) |
Emitted when a filter expression is set using the view. More... | |
void | formModeChanged (QgsAttributeEditorContext::Mode mode) |
Emitted when the form changes mode. More... | |
void | showContextMenuExternally (QgsActionMenu *menu, QgsFeatureId fid) |
Emitted when selecting context menu on the feature list to create the context menu individually. More... | |
Public Member Functions | |
QgsDualView (QWidget *parent=nullptr) | |
Constructor. More... | |
QgsAttributeTableConfig | attributeTableConfig () const |
The config used for the attribute table. More... | |
int | featureCount () |
Returns the number of features on the layer. More... | |
int | filteredFeatureCount () |
Returns the number of features which are currently visible, according to the filter restrictions. More... | |
QgsFeatureIds | filteredFeatures () |
Gets a list of currently visible feature ids. More... | |
QgsAttributeTableFilterModel::FilterMode | filterMode () |
Gets the filter mode. More... | |
void | init (QgsVectorLayer *layer, QgsMapCanvas *mapCanvas, const QgsFeatureRequest &request=QgsFeatureRequest(), const QgsAttributeEditorContext &context=QgsAttributeEditorContext(), bool loadFeatures=true) |
Has to be called to initialize the dual view. More... | |
QgsAttributeTableModel * | masterModel () const |
Returns the model which has the information about all features (not only filtered) More... | |
void | setAttributeTableConfig (const QgsAttributeTableConfig &config) |
Set the attribute table config which should be used to control the appearance of the attribute table. More... | |
void | setFeatureSelectionManager (QgsIFeatureSelectionManager *featureSelectionManager) |
Set the feature selection model. More... | |
void | setFilteredFeatures (const QgsFeatureIds &filteredFeatures) |
Set a list of currently visible features. More... | |
void | setFilterMode (QgsAttributeTableFilterModel::FilterMode filterMode) |
Set the filter mode. More... | |
void | setRequest (const QgsFeatureRequest &request) |
Set the request. More... | |
void | setSelectedOnTop (bool selectedOnTop) |
Toggle the selectedOnTop flag. More... | |
void | setSortExpression (const QString &sortExpression, Qt::SortOrder sortOrder=Qt::AscendingOrder) |
Set the expression used for sorting the table and feature list. More... | |
void | setView (ViewMode view) |
Change the current view mode. More... | |
QString | sortExpression () const |
Gets the expression used for sorting the table and feature list. More... | |
QgsAttributeTableView * | tableView () |
Returns the table view. More... | |
ViewMode | view () const |
Returns the current view mode. More... | |
Protected Member Functions | |
void | hideEvent (QHideEvent *event) override |
Friends | |
class | TestQgsAttributeTable |
class | TestQgsDualView |
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.
Definition at line 41 of file qgsdualview.h.
Action on the map canvas when browsing the list of features.
Enumerator | |
---|---|
NoAction | No action is done. |
PanToFeature | The map is panned to the center of the feature bounding-box. |
ZoomToFeature | The map is zoomed to contained the feature bounding-box. |
Definition at line 71 of file qgsdualview.h.
The view modes, in which this widget can present information.
Relates to the QStackedWidget stacks.
Definition at line 52 of file qgsdualview.h.
|
explicit |
QgsAttributeTableConfig QgsDualView::attributeTableConfig | ( | ) | const |
The config used for the attribute table.
Definition at line 1036 of file qgsdualview.cpp.
|
slot |
|
slot |
Copy the content of the selected cell in the clipboard.
Definition at line 619 of file qgsdualview.cpp.
|
signal |
Emitted whenever the display expression is successfully changed.
expression | The expression that was applied |
int QgsDualView::featureCount | ( | ) |
Returns the number of features on the layer.
Definition at line 609 of file qgsdualview.cpp.
|
signal |
Emitted whenever the filter changes.
int QgsDualView::filteredFeatureCount | ( | ) |
Returns the number of features which are currently visible, according to the filter restrictions.
Definition at line 614 of file qgsdualview.cpp.
|
inline |
Gets a list of currently visible feature ids.
Definition at line 165 of file qgsdualview.h.
|
signal |
Emitted when a filter expression is set using the view.
expression | filter expression |
type | filter type |
|
inline |
|
signal |
Emitted when the form changes mode.
mode | new mode |
|
overrideprotected |
Definition at line 637 of file qgsdualview.cpp.
void QgsDualView::init | ( | QgsVectorLayer * | layer, |
QgsMapCanvas * | mapCanvas, | ||
const QgsFeatureRequest & | request = QgsFeatureRequest() , |
||
const QgsAttributeEditorContext & | context = QgsAttributeEditorContext() , |
||
bool | loadFeatures = true |
||
) |
Has to be called to initialize the dual view.
layer | The layer which should be used to fetch features |
mapCanvas | The mapCanvas (used for the FilterMode QgsAttributeTableFilterModel::ShowVisible) |
request | Use a modified request to limit the shown features |
context | The context in which this view is shown |
loadFeatures | whether to initially load all features into the view. If set to false , limited features can later be loaded using setFilterMode() |
Definition at line 97 of file qgsdualview.cpp.
|
inline |
Returns the model which has the information about all features (not only filtered)
Definition at line 172 of file qgsdualview.h.
|
slot |
Definition at line 543 of file qgsdualview.cpp.
|
slot |
saveEditChanges
true
if the saving was OK. false
is possible due to connected validation logic. Definition at line 538 of file qgsdualview.cpp.
void QgsDualView::setAttributeTableConfig | ( | const QgsAttributeTableConfig & | config | ) |
Set the attribute table config which should be used to control the appearance of the attribute table.
Definition at line 1010 of file qgsdualview.cpp.
|
slot |
Set the current edit selection in the AttributeEditor mode.
fids | A list of edited features (Currently only one at a time is supported) |
Definition at line 532 of file qgsdualview.cpp.
void QgsDualView::setFeatureSelectionManager | ( | QgsIFeatureSelectionManager * | featureSelectionManager | ) |
Set the feature selection model.
featureSelectionManager | the feature selection model |
Definition at line 999 of file qgsdualview.cpp.
void QgsDualView::setFilteredFeatures | ( | const QgsFeatureIds & | filteredFeatures | ) |
Set a list of currently visible features.
filteredFeatures | A list of feature ids |
Definition at line 989 of file qgsdualview.cpp.
void QgsDualView::setFilterMode | ( | QgsAttributeTableFilterModel::FilterMode | filterMode | ) |
|
slot |
Sets whether multi edit mode is enabled.
Definition at line 549 of file qgsdualview.cpp.
void QgsDualView::setRequest | ( | const QgsFeatureRequest & | request | ) |
void QgsDualView::setSelectedOnTop | ( | bool | selectedOnTop | ) |
Toggle the selectedOnTop flag.
If enabled, selected features will be moved to top.
selectedOnTop | true: Show selected features on top. false: Use defined sorting column. |
Definition at line 294 of file qgsdualview.cpp.
void QgsDualView::setSortExpression | ( | const QString & | sortExpression, |
Qt::SortOrder | sortOrder = Qt::AscendingOrder |
||
) |
Set the expression used for sorting the table and feature list.
Definition at line 1019 of file qgsdualview.cpp.
void QgsDualView::setView | ( | QgsDualView::ViewMode | view | ) |
Change the current view mode.
view | The view mode to set |
Definition at line 215 of file qgsdualview.cpp.
|
signal |
Emitted when selecting context menu on the feature list to create the context menu individually.
menu | context menu |
fid | feature id of the selected feature |
QString QgsDualView::sortExpression | ( | ) | const |
Gets the expression used for sorting the table and feature list.
Definition at line 1031 of file qgsdualview.cpp.
|
inline |
|
slot |
Toggles whether search mode should be enabled in the form.
enabled | set to true to switch on search mode |
Definition at line 557 of file qgsdualview.cpp.
QgsDualView::ViewMode QgsDualView::view | ( | ) | const |
Returns the current view mode.
Definition at line 220 of file qgsdualview.cpp.
|
friend |
Definition at line 411 of file qgsdualview.h.
|
friend |
Definition at line 410 of file qgsdualview.h.