QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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
19#include <memory>
20
21#include "qgis_core.h"
23
32{
33 public:
34
36
39
46 void setExpressionContext( const QgsExpressionContext *context );
47
54
61
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...
QgsVectorLayerToolsContext()=default
const QgsExpressionContextScope * additionalExpressionContextScope() const
Returns an additional expression context scope to be made available when calculating expressions.
void setParentWidget(QWidget *parent)
Sets the widget which should be parented to tools' dialogues.
void setExpressionContext(const QgsExpressionContext *context)
Sets the optional expression context used by the vector layer tools.
bool hideParent() const
Returns whether the parent widget should be hidden when showing tools' dialogues.
QgsVectorLayerToolsContext & operator=(const QgsVectorLayerToolsContext &other)
void setHideParent(bool hide)
Sets whether the parent widget should be hidden when showing tools' dialogues.
QgsExpressionContext * expressionContext() const
Returns the optional expression context used by the vector layer tools.
bool showModal() const
Returns whether tools' dialogues should be modal.
void setAdditionalExpressionContextScope(const QgsExpressionContextScope *scope)
Sets an additional expression context scope to be made available when calculating expressions.
void setShowModal(bool modal)
Sets whether tools' dialogues should be modal.
QWidget * parentWidget() const
Returns the widget which should be parented to tools dialogues.