QGIS API Documentation
4.1.0-Master (60fea48833c)
Loading...
Searching...
No Matches
src
core
vector
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"
22
#include "
qgsexpressioncontext.h
"
23
31
class
CORE_EXPORT
QgsVectorLayerToolsContext
32
{
33
public
:
34
QgsVectorLayerToolsContext
() =
default
;
35
36
QgsVectorLayerToolsContext
(
const
QgsVectorLayerToolsContext
&other );
37
QgsVectorLayerToolsContext
&
operator=
(
const
QgsVectorLayerToolsContext
&other );
38
45
void
setExpressionContext
(
const
QgsExpressionContext
*context );
46
52
QgsExpressionContext
*
expressionContext
()
const
;
53
59
void
setAdditionalExpressionContextScope
(
const
QgsExpressionContextScope
*scope );
60
65
const
QgsExpressionContextScope
*
additionalExpressionContextScope
()
const
;
66
70
QWidget *
parentWidget
()
const
{
return
mParentWidget; }
71
76
void
setParentWidget
( QWidget *parent ) { mParentWidget = parent; }
77
81
bool
showModal
()
const
{
return
mShowModal; }
82
86
void
setShowModal
(
bool
modal ) { mShowModal = modal; }
87
91
bool
hideParent
()
const
{
return
mHideParent; }
92
96
void
setHideParent
(
bool
hide ) { mHideParent = hide; }
97
98
private
:
99
std::unique_ptr< QgsExpressionContext > mExpressionContext;
100
std::unique_ptr< QgsExpressionContextScope > mAdditionalExpressionContextScope;
101
102
QWidget *mParentWidget =
nullptr
;
103
bool
mShowModal =
true
;
104
bool
mHideParent =
false
;
105
};
106
107
#endif
// QGSVECTORLAYERTOOLSCONTEXT_H
QgsExpressionContextScope
Single scope for storing variables and functions for use within a QgsExpressionContext.
Definition
qgsexpressioncontext.h:119
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition
qgsexpressioncontext.h:491
QgsVectorLayerToolsContext::QgsVectorLayerToolsContext
QgsVectorLayerToolsContext()=default
QgsVectorLayerToolsContext::additionalExpressionContextScope
const QgsExpressionContextScope * additionalExpressionContextScope() const
Returns an additional expression context scope to be made available when calculating expressions.
Definition
qgsvectorlayertoolscontext.cpp:81
QgsVectorLayerToolsContext::setParentWidget
void setParentWidget(QWidget *parent)
Sets the widget which should be parented to tools' dialogues.
Definition
qgsvectorlayertoolscontext.h:76
QgsVectorLayerToolsContext::setExpressionContext
void setExpressionContext(const QgsExpressionContext *context)
Sets the optional expression context used by the vector layer tools.
Definition
qgsvectorlayertoolscontext.cpp:60
QgsVectorLayerToolsContext::hideParent
bool hideParent() const
Returns whether the parent widget should be hidden when showing tools' dialogues.
Definition
qgsvectorlayertoolscontext.h:91
QgsVectorLayerToolsContext::operator=
QgsVectorLayerToolsContext & operator=(const QgsVectorLayerToolsContext &other)
Definition
qgsvectorlayertoolscontext.cpp:37
QgsVectorLayerToolsContext::setHideParent
void setHideParent(bool hide)
Sets whether the parent widget should be hidden when showing tools' dialogues.
Definition
qgsvectorlayertoolscontext.h:96
QgsVectorLayerToolsContext::expressionContext
QgsExpressionContext * expressionContext() const
Returns the optional expression context used by the vector layer tools.
Definition
qgsvectorlayertoolscontext.cpp:68
QgsVectorLayerToolsContext::showModal
bool showModal() const
Returns whether tools' dialogues should be modal.
Definition
qgsvectorlayertoolscontext.h:81
QgsVectorLayerToolsContext::setAdditionalExpressionContextScope
void setAdditionalExpressionContextScope(const QgsExpressionContextScope *scope)
Sets an additional expression context scope to be made available when calculating expressions.
Definition
qgsvectorlayertoolscontext.cpp:73
QgsVectorLayerToolsContext::setShowModal
void setShowModal(bool modal)
Sets whether tools' dialogues should be modal.
Definition
qgsvectorlayertoolscontext.h:86
QgsVectorLayerToolsContext::parentWidget
QWidget * parentWidget() const
Returns the widget which should be parented to tools dialogues.
Definition
qgsvectorlayertoolscontext.h:70
qgsexpressioncontext.h
Generated on
for QGIS API Documentation by
1.15.0