19#include "ui_qgsdualviewbase.h"
27#include <QStackedWidget>
48class GUI_EXPORT
QgsDualView :
public QStackedWidget,
private Ui::QgsDualViewBase
88 Q_ENUM( FeatureListBrowsingAction )
114 bool loadFeatures =
true,
115 bool showFirstFeature =
true
124 void setView( ViewMode view );
130 ViewMode view()
const;
152 void setSelectedOnTop(
bool selectedOnTop );
167 int filteredFeatureCount();
176 Q_DECL_DEPRECATED
void setFilteredFeatures(
const QgsFeatureIds &filteredFeatures );
228 void setSortExpression(
const QString &sortExpression, Qt::SortOrder sortOrder = Qt::AscendingOrder );
233 QString sortExpression()
const;
263 bool saveEditChanges();
265 void openConditionalStyles();
270 void setMultiEditEnabled(
bool enabled );
276 void toggleSearchMode(
bool enabled );
281 void copyCellContent()
const;
286 void cancelProgress();
296 void parentFormValueChanged(
const QString &attribute,
const QVariant &value );
332 void hideEvent( QHideEvent *event )
override;
336 void featureListAboutToChangeEditSelection(
bool &ok );
343 void featureListCurrentEditSelectionChanged(
const QgsFeature &feat );
345 void previewExpressionBuilder();
347 void previewColumnChanged( QAction *previewAction,
const QString &expression );
349 void viewWillShowContextMenu( QMenu *menu,
const QModelIndex &atIndex );
351 void widgetWillShowContextMenu(
QgsActionMenu *menu,
const QModelIndex &atIndex );
353 void showViewHeaderMenu( QPoint point );
355 void organizeColumns();
357 void tableColumnResized(
int column,
int width );
361 void fieldCalculator();
365 void resizeAllColumns();
367 void autosizeColumn();
369 void autosizeAllColumns();
371 void previewExpressionChanged(
const QString &expression );
373 void onSortColumnChanged();
375 void updateSelectedFeatures();
376 void updateEditedAddedFeatures();
378 void extentChanged();
385 void featureFormAttributeChanged(
const QString &attribute,
const QVariant &value,
bool attributeChanged );
393 virtual void progress(
int i,
bool &cancel );
399 virtual void finished();
402 void zoomToCurrentFeature();
404 void panToCurrentFeature();
406 void flashCurrentFeature();
408 void rebuildFullLayerCache();
410 void panZoomGroupButtonToggled( QAbstractButton *button,
bool checked );
412 void flashButtonClicked(
bool clicked );
414 void filterError(
const QString &errorMessage );
422 void initAttributeForm(
const QgsFeature &feature );
427 void columnBoxInit();
428 void initLayerCache(
bool cacheGeometry );
430 void restoreRecentDisplayExpressions();
431 void saveRecentDisplayExpressions()
const;
432 void setDisplayExpression(
const QString &expression );
433 void insertRecentlyUsedDisplayExpression(
const QString &expression );
434 void updateEditSelectionProgress(
int progress,
int count );
437 void setBrowsingAutoPanScaleAllowed(
bool allowed );
442 static const std::unique_ptr<QgsSettingsEntryVariant> conditionalFormattingSplitterState;
443 static const std::unique_ptr<QgsSettingsEntryVariant> attributeEditorSplitterState;
451 QMenu *mPreviewColumnsMenu =
nullptr;
452 QMenu *mPreviewActionMenu =
nullptr;
453 QAction *mLastDisplayExpressionAction =
nullptr;
454 QMenu *mHorizontalHeaderMenu =
nullptr;
456 QPointer<QgsVectorLayer> mLayer =
nullptr;
457 QProgressDialog *mProgressDlg =
nullptr;
459 QString mDisplayExpression;
463 bool mBrowsingAutoPanScaleAllowed =
true;
485 : QAction( name, dualView )
486 , mDualView( dualView )
488 , mFieldIdx( fieldIdx )
498 QModelIndex mFieldIdx;
512 : QAction( name, dualView )
513 , mDualView( dualView )
515 , mFieldIdx( fieldIdx )
524 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.
static const QgsSettingsEntryBool * settingsFeatureListHighlightFeature
static const QgsSettingsEntryInteger * settingsAttributeTableRowCache
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 boolean settings entry.
An integer settings entry.
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