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/test13.cpp.ref | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 autotests/kconfig_compiler/test13.cpp.ref (limited to 'autotests/kconfig_compiler/test13.cpp.ref') diff --git a/autotests/kconfig_compiler/test13.cpp.ref b/autotests/kconfig_compiler/test13.cpp.ref new file mode 100644 index 00000000..4eac1034 --- /dev/null +++ b/autotests/kconfig_compiler/test13.cpp.ref @@ -0,0 +1,34 @@ +// This file is generated by kconfig_compiler_kf5 from test13.kcfg. +// All changes you do to this file will be lost. + +#include "test13.h" + +Test13::Test13( ) + : KConfigSkeleton( QLatin1String( "muondatasourcesrc" ) ) +{ + KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast(&Test13::itemChanged); + + setCurrentGroup( QLatin1String( "kamoso" ) ); + + KConfigSkeleton::ItemUrl *itemPicturesDir; + itemPicturesDir = new KConfigSkeleton::ItemUrl( currentGroup(), QLatin1String( "picturesDir" ), mPicturesDir ); + addItem( itemPicturesDir, QLatin1String( "picturesDir" ) ); + KConfigCompilerSignallingItem *itemBrightness; + itemBrightness = new KConfigCompilerSignallingItem(new KConfigSkeleton::ItemDouble( currentGroup(), QLatin1String( "brightness" ), mBrightness ), this, notifyFunction, signalBrightnessChanged); + addItem( itemBrightness, QLatin1String( "brightness" ) ); +} + +Test13::~Test13() +{ +} + + +void Test13::itemChanged(quint64 flags) { + + if ( flags & signalBrightnessChanged ) { + Q_EMIT brightnessChanged(); + } +} + +#include "test13.moc" + -- cgit v1.2.1