You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
1.4 KiB
80 lines
1.4 KiB
// This file is generated by kconfig_compiler_kf5 from test_properties_minmax.kcfg. |
|
// All changes you do to this file will be lost. |
|
#ifndef TESTPROPERTIESMINMAX_H |
|
#define TESTPROPERTIESMINMAX_H |
|
|
|
#include <qglobal.h> |
|
#include <kconfigskeleton.h> |
|
#include <QCoreApplication> |
|
#include <QDebug> |
|
|
|
class TestPropertiesMinMax : public KConfigSkeleton |
|
{ |
|
Q_OBJECT |
|
public: |
|
|
|
TestPropertiesMinMax( KSharedConfig::Ptr config = KSharedConfig::openConfig() ); |
|
~TestPropertiesMinMax(); |
|
|
|
/** |
|
Set bar |
|
*/ |
|
void setBar( int v ) |
|
{ |
|
if (v < 36) |
|
{ |
|
qDebug() << "setBar: value " << v << " is less than the minimum value of 36"; |
|
v = 36; |
|
} |
|
|
|
if (v > 102) |
|
{ |
|
qDebug() << "setBar: value " << v << " is greater than the maximum value of 102"; |
|
v = 102; |
|
} |
|
|
|
if (v != mBar && !isBarImmutable()) { |
|
mBar = v; |
|
Q_EMIT barChanged(); |
|
} |
|
} |
|
|
|
Q_PROPERTY(int bar READ bar WRITE setBar NOTIFY barChanged) |
|
Q_PROPERTY(bool isBarImmutable READ isBarImmutable CONSTANT) |
|
/** |
|
Get bar |
|
*/ |
|
int bar() const |
|
{ |
|
return mBar; |
|
} |
|
|
|
/** |
|
Is bar Immutable |
|
*/ |
|
bool isBarImmutable() const |
|
{ |
|
return isImmutable( QStringLiteral( "bar" ) ); |
|
} |
|
|
|
|
|
enum { |
|
signalBarChanged = 0x1 |
|
}; |
|
|
|
Q_SIGNALS: |
|
void barChanged(); |
|
|
|
private: |
|
void itemChanged(quint64 flags); |
|
|
|
protected: |
|
|
|
// Something |
|
int mBar; |
|
|
|
private: |
|
}; |
|
|
|
#endif |
|
|
|
|