Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33557 from rldhont/backport-33476-to-release-3_10
[Backport Release-3_10] Fix inconsistent dependency to project in QgsRelation/QgsRelationManager
- Loading branch information
Showing
16 changed files
with
1,139 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/qgsrelationcontext.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
class QgsRelationContext | ||
{ | ||
%Docstring | ||
Context for relations. Used to resolve layers from projects. | ||
|
||
.. versionadded:: 3.11 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsrelationcontext.h" | ||
%End | ||
public: | ||
|
||
QgsRelationContext( QgsProject *project = 0 ); | ||
%Docstring | ||
Constructor for QgsRelationContext. | ||
%End | ||
|
||
const QgsProject *project() const; | ||
%Docstring | ||
Gets the associated project | ||
|
||
If there is no associated project, then it will return the global | ||
project instance | ||
%End | ||
|
||
~QgsRelationContext(); | ||
|
||
QgsRelationContext( const QgsRelationContext &other ); | ||
%Docstring | ||
Copy constructor | ||
%End | ||
|
||
|
||
}; | ||
|
||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/qgsrelationcontext.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/*************************************************************************** | ||
qgsrelationcontext.cpp | ||
-------------------------------------- | ||
Date : 20.12.2019 | ||
Copyright : (C) 2019 David Marteau | ||
Email : dmarteau at 3liz dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
#include "qgsproject.h" | ||
#include "qgsrelationcontext.h" | ||
|
||
QgsRelationContext::QgsRelationContext( QgsProject *project ) | ||
: mProject( project ) | ||
{ | ||
} | ||
|
||
QgsRelationContext::~QgsRelationContext() = default; | ||
|
||
QgsRelationContext::QgsRelationContext( const QgsRelationContext &other ) | ||
: mProject( other.mProject ) | ||
{ | ||
} | ||
|
||
QgsRelationContext &QgsRelationContext::operator=( const QgsRelationContext &other ) | ||
{ | ||
mProject = other.mProject; | ||
return *this; | ||
} | ||
|
||
const QgsProject *QgsRelationContext::project() const | ||
{ | ||
if ( mProject ) | ||
{ | ||
return mProject; | ||
} | ||
|
||
// Fallback to qgis instance | ||
return QgsProject::instance(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/*************************************************************************** | ||
qgsrelationcontext.h | ||
-------------------------------------- | ||
Date : 20.12.2019 | ||
Copyright : (C) 2019 David Marteau | ||
Email : dmarteau at 3liz dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGSRELATIONCONTEXT_H | ||
#define QGSRELATIONCONTEXT_H | ||
|
||
#include "qgis_core.h" | ||
#include "qgis_sip.h" | ||
|
||
class QgsProject; | ||
|
||
|
||
/** | ||
* \ingroup core | ||
* \class QgsRelationContext | ||
* Context for relations. Used to resolve layers from projects. | ||
* \since QGIS 3.11 | ||
*/ | ||
class CORE_EXPORT QgsRelationContext | ||
{ | ||
public: | ||
|
||
/** | ||
* Constructor for QgsRelationContext. | ||
*/ | ||
QgsRelationContext( QgsProject *project = nullptr ); | ||
|
||
/** | ||
* Gets the associated project | ||
* | ||
* If there is no associated project, then it will return the global | ||
* project instance | ||
*/ | ||
const QgsProject *project() const; | ||
|
||
~QgsRelationContext(); | ||
|
||
/** | ||
* Copy constructor | ||
*/ | ||
QgsRelationContext( const QgsRelationContext &other ); | ||
|
||
/** | ||
* Assignment operator | ||
*/ | ||
QgsRelationContext &operator=( const QgsRelationContext &other ); | ||
|
||
private: | ||
QgsProject *mProject = nullptr; | ||
|
||
}; | ||
|
||
#endif // QGSRELATIONCONTEXT_H | ||
|
Oops, something went wrong.