QSettingsDialog
1.0.0
A Qt library to easily create a settings dialog for user configurable settings
|
A loader to load properties from objects and gadgets. More...
#include <qsettingspropertyloader.h>
Public Slots | |
void | loadData () override |
void | saveData (const QVariant &data) override |
void | resetData () override |
Public Slots inherited from QAsyncSettingsLoader | |
virtual void | loadData ()=0 |
Will be called asynchronously to load data from the objects thread. More... | |
virtual void | saveData (const QVariant &data)=0 |
Will be called asynchronously to save data to the objects thread. More... | |
virtual void | resetData ()=0 |
Will be called asynchronously to reset data to the objects thread. More... | |
Public Member Functions | |
QSettingsPropertyLoader (const char *propertyName, QObject *object) | |
Creates a loader for a property on an object. | |
QSettingsPropertyLoader (const QMetaProperty &metaProperty, QObject *object) | |
Creates a loader for a property on an object. | |
QSettingsPropertyLoader (const char *propertyName, QMetaObject *metaObject, void *gadget) | |
Creates a loader for a property on an gadget, with the gadgets static metaobject. | |
QSettingsPropertyLoader (const QMetaProperty &metaProperty, void *gadget) | |
Creates a loader for a property on an gadget. | |
~QSettingsPropertyLoader () | |
Destructor. | |
int | metatypeId () const |
Returns the properties metatype id. Can be used for the QSettingsEntry. More... | |
bool | isValid () const |
Returns whether the constructed loader points to a valid property on a valid object/gadget. | |
Public Member Functions inherited from QAsyncSettingsLoader | |
QAsyncSettingsLoader () | |
Constructs a new loader (without a parent) | |
bool | isAsync () const final |
Specifies, whether this loader is async or not. | |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
virtual const QMetaObject * | metaObject () const |
QString | objectName () const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const |
bool | isWindowType () const |
bool | signalsBlocked () const |
bool | blockSignals (bool block) |
QThread * | thread () const |
void | moveToThread (QThread *targetThread) |
int | startTimer (int interval, Qt::TimerType timerType) |
void | killTimer (int id) |
T | findChild (const QString &name, Qt::FindChildOptions options) const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const |
const QObjectList & | children () const |
void | setParent (QObject *parent) |
void | installEventFilter (QObject *filterObj) |
void | removeEventFilter (QObject *obj) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const |
bool | disconnect (const QObject *receiver, const char *method) const |
void | dumpObjectTree () |
void | dumpObjectInfo () |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const |
QList< QByteArray > | dynamicPropertyNames () const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const |
bool | inherits (const char *className) const |
void | deleteLater () |
Public Member Functions inherited from QSettingsLoader | |
virtual | ~QSettingsLoader () |
Virtual destructor. | |
QSimpleSettingsLoader * | simple () |
Casts this instance to a QSimpleSettingsLoader. Will assert if the conversion fails. | |
QAsyncSettingsLoader * | async () |
Casts this instance to a QAsyncSettingsLoader. Will assert if the conversion fails. | |
Additional Inherited Members | |
Signals inherited from QAsyncSettingsLoader | |
void | loadDone (bool successful, const QVariant &data, bool isUserEdited=true) |
Has to be emitted when loading was completed. More... | |
void | saveDone (bool successful) |
Has to be emitted when saving was completed. More... | |
void | resetDone (bool successful) |
Has to be emitted when resetting was completed. More... | |
Static Public Member Functions inherited from QObject | |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
Protected Member Functions inherited from QObject | |
QObject * | sender () const |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
Properties inherited from QObject | |
objectName | |
A loader to load properties from objects and gadgets.
The loader can be created on any QObject or any class marked as #Q_GADGET. It relays the dialogs loading calls to read and write a specific property on that object/gadget. The loader is an async loader and thus can be created on any thread. This allows you to load properties from object on any thread, without having to care about synchronisation or other thread problems.
QSettingsPropertyLoader::metatypeId | ( | ) | const |
Returns the properties metatype id. Can be used for the QSettingsEntry.
This function simply uses QMetaProperty::type (and QMetaProperty::userType) to get the type id for the property. This can be used with a settings entry, to find a fitting edit widget for that type. To simplify this, have a look a the QSettingsPropertyEntry.