Skip to content
Permalink
Browse files

Rule based labeling RAII

  • Loading branch information
m-kuhn committed Mar 10, 2019
1 parent 34a792f commit 2ab58c94dbf488976a680f0fe822805b6bee714d
@@ -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

0 comments on commit 2ab58c9

Please sign in to comment.
You can’t perform that action at this time.