QSettingsDialog  1.0.0
A Qt library to easily create a settings dialog for user configurable settings
Public Slots | Public Member Functions | List of all members
QSettingsPropertyLoader Class Reference

A loader to load properties from objects and gadgets. More...

#include <qsettingspropertyloader.h>

+ Inheritance diagram for QSettingsPropertyLoader:

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 QMetaObjectmetaObject () const
 
QString objectName () const
 
void setObjectName (const QString &name)
 
bool isWidgetType () const
 
bool isWindowType () const
 
bool signalsBlocked () const
 
bool blockSignals (bool block)
 
QThreadthread () const
 
void moveToThread (QThread *targetThread)
 
int startTimer (int interval, Qt::TimerType timerType)
 
void killTimer (int id)
 
findChild (const QString &name, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const
 
QList< T > findChildren (const QRegExp &regExp, 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< QByteArraydynamicPropertyNames () const
 
void destroyed (QObject *obj)
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const
 
bool inherits (const char *className) const
 
void deleteLater ()
 
- Public Member Functions inherited from QSettingsLoader
virtual ~QSettingsLoader ()
 Virtual destructor.
 
QSimpleSettingsLoadersimple ()
 Casts this instance to a QSimpleSettingsLoader. Will assert if the conversion fails.
 
QAsyncSettingsLoaderasync ()
 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
QObjectsender () 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
 

Detailed Description

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.

Attention
The loader must always live on the same thread as the object it was created for. It thats not the case, your application will most likely crash!

Member Function Documentation

QSettingsPropertyLoader::metatypeId ( ) const

Returns the properties metatype id. Can be used for the QSettingsEntry.

Returns
The properties metatype id.

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.


The documentation for this class was generated from the following files: