19#include "ui_qgsdualviewbase.h"
27#include <QStackedWidget>
46class GUI_EXPORT
QgsDualView :
public QStackedWidget,
private Ui::QgsDualViewBase
81 Q_ENUM( FeatureListBrowsingAction )
107 bool loadFeatures =
true,
108 bool showFirstFeature =
true
117 void setView( ViewMode view );
123 ViewMode view()
const;
145 void setSelectedOnTop(
bool selectedOnTop );
160 int filteredFeatureCount();
169 Q_DECL_DEPRECATED
void setFilteredFeatures(
const QgsFeatureIds &filteredFeatures );
221 void setSortExpression(
const QString &sortExpression, Qt::SortOrder sortOrder = Qt::AscendingOrder );
226 QString sortExpression()
const;
256 bool saveEditChanges();
258 void openConditionalStyles();
263 void setMultiEditEnabled(
bool enabled );
269 void toggleSearchMode(
bool enabled );
274 void copyCellContent()
const;
279 void cancelProgress();
289 void parentFormValueChanged(
const QString &attribute,
const QVariant &value );
325 void hideEvent( QHideEvent *event )
override;
329 void featureListAboutToChangeEditSelection(
bool &ok );
336 void featureListCurrentEditSelectionChanged(
const QgsFeature &feat );
338 void previewExpressionBuilder();
340 void previewColumnChanged( QAction *previewAction,
const QString &expression );
342 void viewWillShowContextMenu( QMenu *menu,
const QModelIndex &atIndex );
344 void widgetWillShowContextMenu(
QgsActionMenu *menu,
const QModelIndex &atIndex );
346 void showViewHeaderMenu( QPoint point );
348 void organizeColumns();
350 void tableColumnResized(
int column,
int width );
356 void resizeAllColumns();
358 void autosizeColumn();
360 void autosizeAllColumns();
362 void previewExpressionChanged(
const QString &expression );
364 void onSortColumnChanged();
366 void updateSelectedFeatures();
367 void updateEditedAddedFeatures();
369 void extentChanged();
376 void featureFormAttributeChanged(
const QString &attribute,
const QVariant &value,
bool attributeChanged );
384 virtual void progress(
int i,
bool &cancel );
390 virtual void finished();
393 void zoomToCurrentFeature();
395 void panToCurrentFeature();
397 void flashCurrentFeature();
399 void rebuildFullLayerCache();
401 void panZoomGroupButtonToggled( QAbstractButton *button,
bool checked );
403 void flashButtonClicked(
bool clicked );
405 void filterError(
const QString &errorMessage );
413 void initAttributeForm(
const QgsFeature &feature );
418 void columnBoxInit();
419 void initLayerCache(
bool cacheGeometry );
421 void restoreRecentDisplayExpressions();
422 void saveRecentDisplayExpressions()
const;
423 void setDisplayExpression(
const QString &expression );
424 void insertRecentlyUsedDisplayExpression(
const QString &expression );
425 void updateEditSelectionProgress(
int progress,
int count );
428 void setBrowsingAutoPanScaleAllowed(
bool allowed );
433 static const std::unique_ptr<QgsSettingsEntryVariant> conditionalFormattingSplitterState;
434 static const std::unique_ptr<QgsSettingsEntryVariant> attributeEditorSplitterState;
442 QMenu *mPreviewColumnsMenu =
nullptr;
443 QMenu *mPreviewActionMenu =
nullptr;
444 QAction *mLastDisplayExpressionAction =
nullptr;
445 QMenu *mHorizontalHeaderMenu =
nullptr;
447 QPointer<QgsVectorLayer> mLayer =
nullptr;
448 QProgressDialog *mProgressDlg =
nullptr;
450 QString mDisplayExpression;
454 bool mBrowsingAutoPanScaleAllowed =
true;
476 : QAction( name, dualView )
477 , mDualView( dualView )
479 , mFieldIdx( fieldIdx )
489 QModelIndex mFieldIdx;
503 : QAction( name, dualView )
504 , mDualView( dualView )
506 , mFieldIdx( fieldIdx )
515 QModelIndex mFieldIdx;
Contains context information for attribute editor widgets.
QgsAttributeTableAction(const QString &name, QgsDualView *dualView, QUuid action, const QModelIndex &fieldIdx)
Create a new attribute table action.
A container for configuration of the attribute table.
A proxy model for filtering an attribute table model.
FilterMode
The filter mode defines how the rows should be filtered.
QgsAttributeTableMapLayerAction(const QString &name, QgsDualView *dualView, QgsMapLayerAction *action, const QModelIndex &fieldIdx)
A model backed by a QgsVectorLayerCache which is able to provide feature/attribute information to a Q...
Provides a table view of features of a QgsVectorLayer.
This widget is used to show the attributes of a set of features of a QgsVectorLayer.
void showContextMenuExternally(QgsActionMenu *menu, QgsFeatureId fid)
Emitted when selecting context menu on the feature list to create the context menu individually.
ViewMode
The view modes, in which this widget can present information.
@ AttributeTable
Shows the features and attributes in a table layout.
@ AttributeEditor
Show a list of the features, where one can be chosen and the according attribute dialog will be prese...
friend class TestQgsAttributeTable
QgsAttributeTableFilterModel::FilterMode filterMode()
Gets the filter mode.
QgsFeatureIds filteredFeatures()
Gets a list of currently visible feature ids.
void filterChanged()
Emitted whenever the filter changes.
QgsDualView(QWidget *parent=nullptr)
Constructor.
QgsAttributeTableView * tableView()
Returns the table view.
void formModeChanged(QgsAttributeEditorContext::Mode mode)
Emitted when the form changes mode.
FeatureListBrowsingAction
Action on the map canvas when browsing the list of features.
@ 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.
void hideEvent(QHideEvent *event) override
void filterExpressionSet(const QString &expression, QgsAttributeForm::FilterType type)
Emitted when a filter expression is set using the view.
friend class TestQgsDualView
void displayExpressionChanged(const QString &expression)
Emitted whenever the display expression is successfully changed.
QgsAttributeTableModel * masterModel() const
Returns the model which has the information about all features (not only filtered).
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Handles parsing and evaluation of expressions (formerly called "search strings").
A proxy model for feature lists.
Wraps a request for features to a vector layer (or directly its vector data provider).
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Is an interface class to abstract feature selection handling.
Map canvas is a class for displaying all GIS data types on a canvas.
An action which can run on map layers.
A variant settings entry.
Caches features for a given QgsVectorLayer.
Represents a vector layer which manages a vector based dataset.
Q_DECLARE_METATYPE(QModelIndex)
QSet< QgsFeatureId > QgsFeatureIds
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features
QList< int > QgsAttributeList