19#include "ui_qgsdualviewbase.h"
27#include <QStackedWidget>
47class GUI_EXPORT
QgsDualView :
public QStackedWidget,
private Ui::QgsDualViewBase
82 Q_ENUM( FeatureListBrowsingAction )
118 bool loadFeatures =
true,
119 bool showFirstFeature =
true
156 void setSelectedOnTop(
bool selectedOnTop );
171 int filteredFeatureCount();
180 Q_DECL_DEPRECATED
void setFilteredFeatures(
const QgsFeatureIds &filteredFeatures );
232 void setSortExpression(
const QString &sortExpression, Qt::SortOrder sortOrder = Qt::AscendingOrder );
237 QString sortExpression()
const;
267 bool saveEditChanges();
269 void openConditionalStyles();
274 void setMultiEditEnabled(
bool enabled );
280 void toggleSearchMode(
bool enabled );
285 void copyCellContent()
const;
290 void cancelProgress();
300 void parentFormValueChanged(
const QString &attribute,
const QVariant &value );
336 void hideEvent( QHideEvent *event )
override;
340 void featureListAboutToChangeEditSelection(
bool &ok );
347 void featureListCurrentEditSelectionChanged(
const QgsFeature &feat );
349 void previewExpressionBuilder();
351 void previewColumnChanged( QAction *previewAction,
const QString &expression );
353 void viewWillShowContextMenu( QMenu *menu,
const QModelIndex &atIndex );
355 void widgetWillShowContextMenu(
QgsActionMenu *menu,
const QModelIndex &atIndex );
357 void showViewHeaderMenu( QPoint point );
359 void organizeColumns();
361 void tableColumnResized(
int column,
int width );
365 void fieldCalculator();
369 void resizeAllColumns();
371 void autosizeColumn();
373 void autosizeAllColumns();
375 void previewExpressionChanged(
const QString &expression );
377 void onSortColumnChanged();
379 void updateSelectedFeatures();
380 void updateEditedAddedFeatures();
382 void extentChanged();
389 void featureFormAttributeChanged(
const QString &attribute,
const QVariant &value,
bool attributeChanged );
397 virtual void progress(
int i,
bool &cancel );
403 virtual void finished();
406 void zoomToCurrentFeature();
408 void panToCurrentFeature();
410 void flashCurrentFeature();
412 void rebuildFullLayerCache();
414 void panZoomGroupButtonToggled( QAbstractButton *button,
bool checked );
416 void flashButtonClicked(
bool clicked );
418 void filterError(
const QString &errorMessage );
426 void initAttributeForm(
const QgsFeature &feature );
431 void columnBoxInit();
432 void initLayerCache(
bool cacheGeometry );
434 void restoreRecentDisplayExpressions();
435 void saveRecentDisplayExpressions()
const;
436 void setDisplayExpression(
const QString &expression );
437 void insertRecentlyUsedDisplayExpression(
const QString &expression );
438 void updateEditSelectionProgress(
int progress,
int count );
441 void setBrowsingAutoPanScaleAllowed(
bool allowed );
446 static const std::unique_ptr<QgsSettingsEntryVariant> conditionalFormattingSplitterState;
447 static const std::unique_ptr<QgsSettingsEntryVariant> attributeEditorSplitterState;
455 QMenu *mPreviewColumnsMenu =
nullptr;
456 QMenu *mPreviewActionMenu =
nullptr;
457 QAction *mLastDisplayExpressionAction =
nullptr;
458 QMenu *mHorizontalHeaderMenu =
nullptr;
460 QPointer<QgsVectorLayer> mLayer =
nullptr;
461 QProgressDialog *mProgressDlg =
nullptr;
463 QString mDisplayExpression;
467 bool mBrowsingAutoPanScaleAllowed =
true;
489 : QAction( name, dualView )
490 , mDualView( dualView )
492 , mFieldIdx( fieldIdx )
502 QModelIndex mFieldIdx;
516 : QAction( name, dualView )
517 , mDualView( dualView )
519 , mFieldIdx( fieldIdx )
528 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
Settings entry for whether features are highlighted/flashed in the feature list.
QgsDualView(QWidget *parent=nullptr)
Constructor.
ViewMode view() const
Returns the current view mode.
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.
void init(QgsVectorLayer *layer, QgsMapCanvas *mapCanvas, const QgsFeatureRequest &request=QgsFeatureRequest(), const QgsAttributeEditorContext &context=QgsAttributeEditorContext(), bool loadFeatures=true, bool showFirstFeature=true)
Has to be called to initialize the dual 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).
void setFilterMode(QgsAttributeTableFilterModel::FilterMode filterMode)
Set the filter mode.
void setView(ViewMode view)
Change the current view mode.
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.
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