From 97552ff2ecd13eb4398231650e2f719f7a7ba052 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Sun, 26 Apr 2015 01:41:29 +0200 Subject: Generate Q_PROPERTY entries out of KConfigSkeleton classes It adds a configuration setting that makes it possible to generate Q_PROPERTY instances out of each variable exposed by the configuration class. Especially useful when it comes to exposing these classes to QtQuick interfaces. REVIEW: 123367 CHANGELOG: Generate QML-proof classes using the kconfigcompiler --- autotests/kconfig_compiler/test_signal.h.ref | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'autotests/kconfig_compiler/test_signal.h.ref') diff --git a/autotests/kconfig_compiler/test_signal.h.ref b/autotests/kconfig_compiler/test_signal.h.ref index 19b8b400..e9f9c94c 100644 --- a/autotests/kconfig_compiler/test_signal.h.ref +++ b/autotests/kconfig_compiler/test_signal.h.ref @@ -12,11 +12,6 @@ class TestSignal : public KConfigSkeleton Q_OBJECT public: - enum { - signalEmoticonSettingsChanged = 0x1, - signalStyleChanged = 0x2 - }; - static TestSignal *self(); ~TestSignal(); @@ -26,7 +21,7 @@ class TestSignal : public KConfigSkeleton static void setEmoticonTheme( const QString & v ) { - if (!self()->isImmutable( QString::fromLatin1( "emoticonTheme" ) )) { + if (v != self()->mEmoticonTheme && !self()->isImmutable( QString::fromLatin1( "emoticonTheme" ) )) { self()->mEmoticonTheme = v; self()->mSettingsChanged |= signalEmoticonSettingsChanged; } @@ -47,7 +42,7 @@ class TestSignal : public KConfigSkeleton static void setUseEmoticon( bool v ) { - if (!self()->isImmutable( QString::fromLatin1( "useEmoticon" ) )) { + if (v != self()->mUseEmoticon && !self()->isImmutable( QString::fromLatin1( "useEmoticon" ) )) { self()->mUseEmoticon = v; self()->mSettingsChanged |= signalEmoticonSettingsChanged; } @@ -68,7 +63,7 @@ class TestSignal : public KConfigSkeleton static void setEmoticonRequireSpace( bool v ) { - if (!self()->isImmutable( QString::fromLatin1( "emoticonRequireSpace" ) )) { + if (v != self()->mEmoticonRequireSpace && !self()->isImmutable( QString::fromLatin1( "emoticonRequireSpace" ) )) { self()->mEmoticonRequireSpace = v; self()->mSettingsChanged |= signalEmoticonSettingsChanged; } @@ -89,7 +84,7 @@ class TestSignal : public KConfigSkeleton static void setStylePath( const QString & v ) { - if (!self()->isImmutable( QString::fromLatin1( "stylePath" ) )) { + if (v != self()->mStylePath && !self()->isImmutable( QString::fromLatin1( "stylePath" ) )) { self()->mStylePath = v; self()->mSettingsChanged |= signalStyleChanged; } @@ -124,6 +119,11 @@ class TestSignal : public KConfigSkeleton } + enum { + signalEmoticonSettingsChanged = 0x1, + signalStyleChanged = 0x2 + }; + Q_SIGNALS: void emoticonSettingsChanged(); -- cgit v1.2.1