19#include "ui_qgsdualviewbase.h"
27#include <QStackedWidget>
46class GUI_EXPORT
QgsDualView :
public QStackedWidget,
private Ui::QgsDualViewBase
81 Q_ENUM( FeatureListBrowsingAction )
110 void setView( ViewMode view );
116 ViewMode view()
const;
138 void setSelectedOnTop(
bool selectedOnTop );
153 int filteredFeatureCount();
162 Q_DECL_DEPRECATED
void setFilteredFeatures(
const QgsFeatureIds &filteredFeatures );
214 void setSortExpression(
const QString &sortExpression, Qt::SortOrder sortOrder = Qt::AscendingOrder );
219 QString sortExpression()
const;
249 bool saveEditChanges();
251 void openConditionalStyles();
256 void setMultiEditEnabled(
bool enabled );
262 void toggleSearchMode(
bool enabled );
267 void copyCellContent()
const;
272 void cancelProgress();
282 void parentFormValueChanged(
const QString &attribute,
const QVariant &value );
318 void hideEvent( QHideEvent *event )
override;
322 void featureListAboutToChangeEditSelection(
bool &ok );
329 void featureListCurrentEditSelectionChanged(
const QgsFeature &feat );
331 void previewExpressionBuilder();
333 void previewColumnChanged( QAction *previewAction,
const QString &expression );
335 void viewWillShowContextMenu( QMenu *menu,
const QModelIndex &atIndex );
337 void widgetWillShowContextMenu(
QgsActionMenu *menu,
const QModelIndex &atIndex );
339 void showViewHeaderMenu( QPoint point );
341 void organizeColumns();
343 void tableColumnResized(
int column,
int width );
349 void resizeAllColumns();
351 void autosizeColumn();
353 void autosizeAllColumns();
355 void previewExpressionChanged(
const QString &expression );
357 void onSortColumnChanged();
359 void updateSelectedFeatures();
360 void updateEditedAddedFeatures();
362 void extentChanged();
369 void featureFormAttributeChanged(
const QString &attribute,
const QVariant &value,
bool attributeChanged );
377 virtual void progress(
int i,
bool &cancel );
383 virtual void finished();
386 void zoomToCurrentFeature();
388 void panToCurrentFeature();
390 void flashCurrentFeature();
392 void rebuildFullLayerCache();
394 void panZoomGroupButtonToggled( QAbstractButton *button,
bool checked );
396 void flashButtonClicked(
bool clicked );
398 void filterError(
const QString &errorMessage );
406 void initAttributeForm(
const QgsFeature &feature );
411 void columnBoxInit();
412 void initLayerCache(
bool cacheGeometry );
414 void restoreRecentDisplayExpressions();
415 void saveRecentDisplayExpressions()
const;
416 void setDisplayExpression(
const QString &expression );
417 void insertRecentlyUsedDisplayExpression(
const QString &expression );
418 void updateEditSelectionProgress(
int progress,
int count );
421 void setBrowsingAutoPanScaleAllowed(
bool allowed );
426 static const std::unique_ptr<QgsSettingsEntryVariant> conditionalFormattingSplitterState;
427 static const std::unique_ptr<QgsSettingsEntryVariant> attributeEditorSplitterState;
435 QMenu *mPreviewColumnsMenu =
nullptr;
436 QMenu *mPreviewActionMenu =
nullptr;
437 QAction *mLastDisplayExpressionAction =
nullptr;
438 QMenu *mHorizontalHeaderMenu =
nullptr;
440 QPointer<QgsVectorLayer> mLayer =
nullptr;
441 QProgressDialog *mProgressDlg =
nullptr;
443 QString mDisplayExpression;
447 bool mBrowsingAutoPanScaleAllowed =
true;
469 : QAction( name, dualView )
470 , mDualView( dualView )
472 , mFieldIdx( fieldIdx )
482 QModelIndex mFieldIdx;
496 : QAction( name, dualView )
497 , mDualView( dualView )
499 , mFieldIdx( fieldIdx )
508 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