QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsvectorlayertoolscontext.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsvectorlayertoolscontext.h
3 ------------------------
4 begin : May 2024
5 copyright : (C) 2024 by Mathieu Pellerin
6 email : mathieu at opengis dot ch
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSVECTORLAYERTOOLSCONTEXT_H
17#define QGSVECTORLAYERTOOLSCONTEXT_H
18
20#include "qgis_core.h"
21
22#include <memory>
23
32{
33 public:
34
36
39
46 void setExpressionContext( const QgsExpressionContext *context );
47
53 QgsExpressionContext *expressionContext() const;
54
60 void setAdditionalExpressionContextScope( const QgsExpressionContextScope *scope );
61
66 const QgsExpressionContextScope *additionalExpressionContextScope() const;
67
71 QWidget *parentWidget() const { return mParentWidget; }
72
77 void setParentWidget( QWidget *parent ) { mParentWidget = parent; }
78
82 bool showModal() const { return mShowModal; }
83
87 void setShowModal( bool modal ) { mShowModal = modal; }
88
92 bool hideParent() const { return mHideParent; }
93
97 void setHideParent( bool hide ) { mHideParent = hide; }
98
99 private:
100
101 std::unique_ptr< QgsExpressionContext > mExpressionContext;
102 std::unique_ptr< QgsExpressionContextScope > mAdditionalExpressionContextScope;
103
104 QWidget *mParentWidget = nullptr;
105 bool mShowModal = true;
106 bool mHideParent = false;
107};
108
109#endif // QGSVECTORLAYERTOOLSCONTEXT_H
Single scope for storing variables and functions for use within a QgsExpressionContext.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Contains settings which reflect the context in which vector layer tool operations should consider.
QgsVectorLayerToolsContext()=default
void setParentWidget(QWidget *parent)
Sets the widget which should be parented to tools' dialogues.
bool hideParent() const
Returns whether the parent widget should be hidden when showing tools' dialogues.
void setHideParent(bool hide)
Sets whether the parent widget should be hidden when showing tools' dialogues.
bool showModal() const
Returns whether tools' dialogues should be modal.
void setShowModal(bool modal)
Sets whether tools' dialogues should be modal.
QWidget * parentWidget() const
Returns the widget which should be parented to tools dialogues.