QGIS API Documentation 3.39.0-Master (47f7b3a4989)
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
39
45
47
54 void setExpressionContext( const QgsExpressionContext *context );
55
61 QgsExpressionContext *expressionContext() const;
62
68 void setAdditionalExpressionContextScope( const QgsExpressionContextScope *scope );
69
74 const QgsExpressionContextScope *additionalExpressionContextScope() const;
75
79 QWidget *parentWidget() const { return mParentWidget; }
80
85 void setParentWidget( QWidget *parent ) { mParentWidget = parent; }
86
90 bool showModal() const { return mShowModal; }
91
95 void setShowModal( bool modal ) { mShowModal = modal; }
96
100 bool hideParent() const { return mHideParent; }
101
105 void setHideParent( bool hide ) { mHideParent = hide; }
106
107 private:
108
109 std::unique_ptr< QgsExpressionContext > mExpressionContext;
110 std::unique_ptr< QgsExpressionContextScope > mAdditionalExpressionContextScope;
111
112 QWidget *mParentWidget = nullptr;
113 bool mShowModal = true;
114 bool mHideParent = false;
115};
116
117#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
Constructor for QgsVectorLayerToolsContext.
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.