QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgsrelationcontext.cpp
Go to the documentation of this file.
1
/***************************************************************************
2
qgsrelationcontext.cpp
3
--------------------------------------
4
Date : 20.12.2019
5
Copyright : (C) 2019 David Marteau
6
Email : dmarteau at 3liz dot com
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
#include "
qgsrelationcontext.h
"
16
17
#include "
qgsmessagelog.h
"
18
#include "
qgsproject.h
"
19
20
QgsRelationContext::QgsRelationContext
()
21
{
22
QgsMessageLog::logMessage
(
"QgsRelationContext constructed without specified project. This will be removed in QGIS 5.0."
,
"QgsRelationContext"
,
Qgis::Warning
);
23
}
24
25
QgsRelationContext::QgsRelationContext
(
QgsProject
*
project
)
26
: mProject(
project
)
27
{}
28
29
QgsRelationContext::~QgsRelationContext
() =
default
;
30
31
32
const
QgsProject
*
QgsRelationContext::project
()
const
33
{
34
if
( mProject )
35
{
36
return
mProject;
37
}
38
39
// TODO QGIS 5.0 -- Remove the fallback to the QgsProject instance
40
// Fallback to qgis instance
41
return
QgsProject::instance
();
// skip-keyword-check
42
}
Qgis::Warning
@ Warning
Warning message.
Definition
qgis.h:162
QgsMessageLog::logMessage
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true, const char *file=__builtin_FILE(), const char *function=__builtin_FUNCTION(), int line=__builtin_LINE(), Qgis::StringFormat format=Qgis::StringFormat::PlainText)
Adds a message to the log instance (and creates it if necessary).
Definition
qgsmessagelog.cpp:35
QgsProject
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition
qgsproject.h:114
QgsProject::instance
static QgsProject * instance()
Returns the QgsProject singleton instance.
Definition
qgsproject.cpp:490
QgsRelationContext::QgsRelationContext
QgsRelationContext()
Constructor for QgsRelationContext.
Definition
qgsrelationcontext.cpp:20
QgsRelationContext::~QgsRelationContext
~QgsRelationContext()
QgsRelationContext::project
const QgsProject * project() const
Gets the associated project.
Definition
qgsrelationcontext.cpp:32
qgsmessagelog.h
qgsproject.h
qgsrelationcontext.h
Generated on
for QGIS API Documentation by
1.17.0