Changeset View
Changeset View
Standalone View
Standalone View
autotests/kconfig_compiler/test_notifiers.cpp.ref
1 | // This file is generated by kconfig_compiler_kf5 from test_notifiers.kcfg. | 1 | // This file is generated by kconfig_compiler_kf5 from test_notifiers.kcfg. | ||
---|---|---|---|---|---|
2 | // All changes you do to this file will be lost. | 2 | // All changes you do to this file will be lost. | ||
3 | 3 | | |||
4 | #include "test_notifiers.h" | 4 | #include "test_notifiers.h" | ||
5 | 5 | | |||
6 | TestNotifiers::TestNotifiers( int Number ) | 6 | TestNotifiers::TestNotifiers( int Number ) | ||
7 | : KConfigSkeleton( QStringLiteral( "test7rc" ) ) | 7 | : KConfigSkeleton( QStringLiteral( "test7rc" ) ) | ||
apol: Maybe it would be better to use the parent argument in KConfigSkeleton?
explicit… | |||||
It's what I attempted first, the problem was that it will create compatibility issues with existing code. From the generator perspective KConfigSkeleton might not be the base class and since we never enforced the parent chaining constructor before they might not have it. The tests using MyPrefs as base class exhibit that exact problem. That's why I ended up falling back on setParent... it doesn't have my preference but at least now we won't force the use of setParent in user code (even though we use it internally). ervin: It's what I attempted first, the problem was that it will create compatibility issues with… | |||||
8 | , mParamNumber(Number) | 8 | , mParamNumber(Number) | ||
9 | { | 9 | { | ||
10 | setCurrentGroup( QStringLiteral( "Foo" ) ); | 10 | setCurrentGroup( QStringLiteral( "Foo" ) ); | ||
11 | 11 | | |||
12 | KConfigSkeleton::ItemColor *itemColor; | 12 | KConfigSkeleton::ItemColor *itemColor; | ||
13 | itemColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "color #%1" ).arg( mParamNumber ), mColor, QColor( "red" ) ); | 13 | itemColor = new KConfigSkeleton::ItemColor( currentGroup(), QStringLiteral( "color #%1" ).arg( mParamNumber ), mColor, QColor( "red" ) ); | ||
14 | itemColor->setWriteFlags(KConfigBase::Notify); | 14 | itemColor->setWriteFlags(KConfigBase::Notify); | ||
15 | addItem( itemColor, QStringLiteral( "Color" ) ); | 15 | addItem( itemColor, QStringLiteral( "Color" ) ); | ||
Show All 19 Lines |
Maybe it would be better to use the parent argument in KConfigSkeleton?
explicit KConfigSkeleton(const QString &configname = QString(), QObject *parent = nullptr);