mirror of
https://github.com/Fishwaldo/qt-openzwave.git
synced 2025-07-11 15:48:21 +00:00
a BugFix on setting Properties, and add a isLocked Method to the Options Class
This commit is contained in:
parent
ed0b8778c5
commit
43aa14837d
5 changed files with 15 additions and 4 deletions
|
@ -136,8 +136,7 @@ public:
|
|||
bool GetOptionAsBool(QString option);
|
||||
qint32 GetOptionAsInt(QString option);
|
||||
QString GetOptionAsString(QString option);
|
||||
|
||||
|
||||
bool isLocked();
|
||||
|
||||
Q_SIGNALS:
|
||||
void ConfigPathChanged(QString ConfigPath);
|
||||
|
|
|
@ -51,4 +51,6 @@ class QTOZWOptions {
|
|||
SLOT(bool GetOptionAsBool(QString option))
|
||||
SLOT(qint32 GetOptionAsInt(QString option))
|
||||
SLOT(QString GetOptionAsString(QString option))
|
||||
SLOT(bool isLocked());
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ public Q_SLOTS:
|
|||
bool GetOptionAsBool(QString option);
|
||||
qint32 GetOptionAsInt(QString option);
|
||||
QString GetOptionAsString(QString option);
|
||||
bool isLocked();
|
||||
|
||||
private Q_SLOTS:
|
||||
void pvt_ConfigPathChanged(QString value);
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
#define CALL_DPTR(x) if (this->m_connectionType == QTOZWOptions::connectionType::Local) this->d_ptr_internal->x; else this->d_ptr_replica->x;
|
||||
#define CALL_DPTR_PROP(x) if (this->m_connectionType == QTOZWOptions::connectionType::Local) return this->d_ptr_internal->x; else return this->d_ptr_replica->x;
|
||||
#define CALL_DPTR_PROP_SET(x) if (this->m_connectionType == QTOZWOptions::connectionType::Local) { \
|
||||
this->d_ptr_internal->setProperty("x", x); \
|
||||
this->d_ptr_internal->setProperty(#x, x); \
|
||||
} else { \
|
||||
QSignalSpy spy(this, SIGNAL(xChanged)); \
|
||||
this->d_ptr_replica->setProperty("x", x); \
|
||||
this->d_ptr_replica->setProperty(#x, x); \
|
||||
spy.wait(); \
|
||||
}
|
||||
#define CALL_DPTR_METHOD_RTN(x, y) if (this->m_connectionType == QTOZWOptions::connectionType::Local) \
|
||||
|
@ -326,3 +326,7 @@ qint32 QTOZWOptions::GetOptionAsInt(QString option) {
|
|||
QString QTOZWOptions::GetOptionAsString(QString option) {
|
||||
CALL_DPTR_METHOD_RTN(GetOptionAsString(option), QString);
|
||||
}
|
||||
|
||||
bool QTOZWOptions::isLocked() {
|
||||
CALL_DPTR_METHOD_RTN(isLocked(), bool);
|
||||
}
|
||||
|
|
|
@ -85,6 +85,11 @@ QString QTOZWOptions_Internal::GetOptionAsString(QString option) {
|
|||
return QString();
|
||||
}
|
||||
|
||||
bool QTOZWOptions_Internal::isLocked() {
|
||||
return this->m_options->AreLocked();
|
||||
}
|
||||
|
||||
|
||||
bool QTOZWOptions_Internal::populateProperties() {
|
||||
this->m_updating = true;
|
||||
this->setConfigPath(this->GetOptionAsString("ConfigPath"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue