1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsdualview.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsDualView : QStackedWidget
{
%Docstring(signature="appended")
This widget is used to show the attributes of a set of features of a
:py:class:`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.
%End
%TypeHeaderCode
#include "qgsdualview.h"
%End
public:
enum ViewMode /BaseType=IntEnum/
{
AttributeTable,
AttributeEditor
};
enum FeatureListBrowsingAction /BaseType=IntEnum/
{
NoAction,
PanToFeature,
ZoomToFeature,
};
explicit QgsDualView( QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor
:param parent: The parent widget
%End
~QgsDualView();
void init( QgsVectorLayer *layer, QgsMapCanvas *mapCanvas, const QgsFeatureRequest &request = QgsFeatureRequest(), const QgsAttributeEditorContext &context = QgsAttributeEditorContext(), bool loadFeatures = true, bool showFirstFeature = true );
%Docstring
Has to be called to initialize the dual view.
:param layer: The layer which should be used to fetch features
:param mapCanvas: The mapCanvas (used for the FilterMode
:py:class:`QgsAttributeTableFilterModel`.ShowVisible)
:param request: Use a modified request to limit the shown features
:param context: The context in which this view is shown
:param loadFeatures: whether to initially load all features into the
view. If set to ``False``, limited features can
later be loaded using
:py:func:`~QgsDualView.setFilterMode`
:param showFirstFeature: whether to initially show the first feature
form upon initializing the dual view
%End
void setView( ViewMode view );
%Docstring
Change the current view mode.
:param view: The view mode to set
.. seealso:: :py:func:`view`
%End
ViewMode view() const;
%Docstring
Returns the current view mode.
.. seealso:: :py:func:`setView`
%End
void setFilterMode( QgsAttributeTableFilterModel::FilterMode filterMode );
%Docstring
Set the filter mode
:param filterMode:
%End
QgsAttributeTableFilterModel::FilterMode filterMode();
%Docstring
Gets the filter mode
:return: the filter mode
%End
void setSelectedOnTop( bool selectedOnTop );
%Docstring
Toggle the selectedOnTop flag. If enabled, selected features will be
moved to top.
:param selectedOnTop: ``True``: Show selected features on top.
``False``: Use defined sorting column.
%End
int featureCount();
%Docstring
Returns the number of features on the layer.
:return: Number of features
%End
int filteredFeatureCount();
%Docstring
Returns the number of features which are currently visible, according to
the filter restrictions
:return: Number of features
%End
void setFilteredFeatures( const QgsFeatureIds &filteredFeatures );
%Docstring
Set a list of currently visible features
:param filteredFeatures: A list of feature ids
.. deprecated:: 3.40
Since filterFeatures is handled in the attribute filter model itself.
%End
void filterFeatures( const QgsExpression &filterExpression, const QgsExpressionContext &context );
%Docstring
Sets the expression and Updates the filtered features in the filter
model. It is called when the filter expression changed.
.. versionadded:: 3.10.3
%End
QgsFeatureIds filteredFeatures();
%Docstring
Gets a list of currently visible feature ids.
%End
QgsAttributeTableModel *masterModel() const;
%Docstring
Returns the model which has the information about all features (not only
filtered)
:return: The master model
%End
void setRequest( const QgsFeatureRequest &request );
%Docstring
Set the request
:param request: The request
%End
void setFeatureSelectionManager( QgsIFeatureSelectionManager *featureSelectionManager );
%Docstring
Set the feature selection model
:param featureSelectionManager: the feature selection model
%End
QgsAttributeTableView *tableView();
%Docstring
Returns the table view
:return: The table view
%End
void setAttributeTableConfig( const QgsAttributeTableConfig &config );
%Docstring
Set the attribute table config which should be used to control the
appearance of the attribute table.
%End
void setSortExpression( const QString &sortExpression, Qt::SortOrder sortOrder = Qt::AscendingOrder );
%Docstring
Set the expression used for sorting the table and feature list.
%End
QString sortExpression() const;
%Docstring
Gets the expression used for sorting the table and feature list.
%End
QgsAttributeTableConfig attributeTableConfig() const;
%Docstring
The config used for the attribute table.
:return: The config used for the attribute table.
%End
static QgsAttributeList requiredAttributes( const QgsVectorLayer *layer );
%Docstring
Returns the list of required attributes according to the attribute table
configuration of the ``layer``, only visible attributes and virtual
fields referenced fields are returned.
.. versionadded:: 3.32
%End
public slots:
void setCurrentEditSelection( const QgsFeatureIds &fids );
%Docstring
Set the current edit selection in the AttributeEditor mode.
:param fids: A list of edited features (Currently only one at a time is
supported)
%End
bool saveEditChanges();
%Docstring
saveEditChanges
:return: ``True`` if the saving was OK. ``False`` is possible due to
connected validation logic.
%End
void openConditionalStyles();
void setMultiEditEnabled( bool enabled );
%Docstring
Sets whether multi edit mode is enabled.
%End
void toggleSearchMode( bool enabled );
%Docstring
Toggles whether search mode should be enabled in the form.
:param enabled: set to ``True`` to switch on search mode
%End
void copyCellContent() const;
%Docstring
Copy the content of the selected cell in the clipboard.
%End
void cancelProgress();
%Docstring
Cancel the progress dialog (if any)
%End
void parentFormValueChanged( const QString &attribute, const QVariant &value );
%Docstring
Called in embedded forms when an ``attribute`` ``value`` in the parent
form has changed.
Notify the form widgets that something has changed in case they have
filter expression that depend on the parent form scope.
.. versionadded:: 3.14
%End
signals:
void displayExpressionChanged( const QString &expression );
%Docstring
Emitted whenever the display expression is successfully changed
:param expression: The expression that was applied
%End
void filterChanged();
%Docstring
Emitted whenever the filter changes
%End
void filterExpressionSet( const QString &expression, QgsAttributeForm::FilterType type );
%Docstring
Emitted when a filter expression is set using the view.
:param expression: filter expression
:param type: filter type
%End
void formModeChanged( QgsAttributeEditorContext::Mode mode );
%Docstring
Emitted when the form changes mode.
:param mode: new mode
%End
void showContextMenuExternally( QgsActionMenu *menu, QgsFeatureId fid );
%Docstring
Emitted when selecting context menu on the feature list to create the
context menu individually
:param menu: context menu
:param fid: feature id of the selected feature
%End
protected:
virtual void hideEvent( QHideEvent *event );
};
class QgsAttributeTableAction : QAction
{
%TypeHeaderCode
#include "qgsdualview.h"
%End
public:
QgsAttributeTableAction( const QString &name, QgsDualView *dualView, QUuid action, const QModelIndex &fieldIdx );
%Docstring
Create a new attribute table action.
%End
public slots:
void execute();
void featureForm();
};
class QgsAttributeTableMapLayerAction : QAction
{
%TypeHeaderCode
#include "qgsdualview.h"
%End
public:
QgsAttributeTableMapLayerAction( const QString &name, QgsDualView *dualView, QgsMapLayerAction *action, const QModelIndex &fieldIdx );
public slots:
void execute();
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/attributetable/qgsdualview.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|