QGIS API Documentation 4.3.0-Master (0de80482b60)
Loading...
Searching...
No Matches
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
21{
22 QgsMessageLog::logMessage( "QgsRelationContext constructed without specified project. This will be removed in QGIS 5.0.", "QgsRelationContext", Qgis::Warning );
23}
24
28
30
31
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}
@ Warning
Warning message.
Definition qgis.h:162
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).
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:114
static QgsProject * instance()
Returns the QgsProject singleton instance.
QgsRelationContext()
Constructor for QgsRelationContext.
const QgsProject * project() const
Gets the associated project.