mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-13 00:07:27 -05:00
Rule based labeling RAII
This commit is contained in:
parent
34a792ffdc
commit
2ab58c94db
@ -269,6 +269,7 @@ Constructs the labeling from given tree of rules (takes ownership)
|
||||
~QgsRuleBasedLabeling();
|
||||
|
||||
QgsRuleBasedLabeling::Rule *rootRule();
|
||||
const Rule *rootRule() const;
|
||||
|
||||
static QgsRuleBasedLabeling *create( const QDomElement &element, const QgsReadWriteContext &context ) /Factory/;
|
||||
%Docstring
|
||||
|
||||
@ -411,7 +411,16 @@ QgsRuleBasedLabeling *QgsRuleBasedLabeling::clone() const
|
||||
|
||||
QgsRuleBasedLabeling::~QgsRuleBasedLabeling()
|
||||
{
|
||||
delete mRootRule;
|
||||
}
|
||||
|
||||
QgsRuleBasedLabeling::Rule *QgsRuleBasedLabeling::rootRule()
|
||||
{
|
||||
return mRootRule.get();
|
||||
}
|
||||
|
||||
const QgsRuleBasedLabeling::Rule *QgsRuleBasedLabeling::rootRule() const SIP_SKIP
|
||||
{
|
||||
return mRootRule.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -346,8 +346,8 @@ class CORE_EXPORT QgsRuleBasedLabeling : public QgsAbstractVectorLayerLabeling
|
||||
explicit QgsRuleBasedLabeling( QgsRuleBasedLabeling::Rule *root SIP_TRANSFER );
|
||||
~QgsRuleBasedLabeling() override;
|
||||
|
||||
QgsRuleBasedLabeling::Rule *rootRule() { return mRootRule; }
|
||||
const Rule *rootRule() const SIP_SKIP { return mRootRule; }
|
||||
QgsRuleBasedLabeling::Rule *rootRule();
|
||||
const Rule *rootRule() const;
|
||||
|
||||
//! Create the instance from a DOM element with saved configuration
|
||||
static QgsRuleBasedLabeling *create( const QDomElement &element, const QgsReadWriteContext &context ) SIP_FACTORY;
|
||||
@ -375,7 +375,7 @@ class CORE_EXPORT QgsRuleBasedLabeling : public QgsAbstractVectorLayerLabeling
|
||||
void toSld( QDomNode &parent, const QgsStringMap &props ) const override;
|
||||
|
||||
protected:
|
||||
Rule *mRootRule = nullptr;
|
||||
std::unique_ptr<Rule> mRootRule;
|
||||
};
|
||||
|
||||
#ifndef SIP_RUN
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user