A special class that allows access to the settings dialog from different threads.
More...
|
| QAsyncSettingsContainer (QSettingsDialog *settingsDialog, const QString &containerPath, QObject *parent=nullptr) |
| Creates a new container for a container at the given path for the given dialog.
|
|
| ~QAsyncSettingsContainer () |
| Destructor.
|
|
QSettingsDialog * | dialog () const override |
| Returns the dialog this container belongs to.
|
|
QString | containerPath () const override |
| Returns the container path this container has.
|
|
int | elementCount () const override |
| Returns the number of elements in this container.
|
|
bool | isEntry (int index) const override |
| Checks whether the element at the given index is an entry or not.
|
|
int | getEntryIndex (int id) const override |
| Searches for entries index. More...
|
|
int | getEntryId (int index) const override |
| Returns the id for the entry at the index. More...
|
|
QSharedPointer< QSettingsEntry > | getEntry (int id) const override |
| Returns the entry with the given id. More...
|
|
QSharedPointer< QSettingsEntry > | getEntryFromIndex (int index) const override |
| Returns the entry at the given index. More...
|
|
bool | transferElement (int indexFrom, QSettingsContainer *targetContainer, int indexTo) override |
| Tries to transfer the element at index to the target container. More...
|
|
| 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 () |
|
|
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) |
|
| objectName |
|
A special class that allows access to the settings dialog from different threads.
This special container allows synchronized and asynchronous access to a specific group of the settings dialog from a different thread than the mainthread. It internally uses Qts metasystem to make queued method invokations, making it completly threadsafe on a functional level.
- Warning
- Even though it's save to call all of the functions, there is no locking mechanism. This means that the state of the dialog can change between two function calls, making calls like
container->insertEntry(container->elementCount(), entry);
unsafe, if other components of the application are accessing the containers target group/section at the same time!
Synchronous Access:
All functions that are define by the QSettingsDialog interface are synchronous. This means they will block until the mainthread handled the request. Internally, a Qt::BlockingQueuedConnection is used to archiev this.
- Warning
- The blocking calls will block the calling thread until the mainthread was able to process the call. This means it is forbidden to call any of those from the mainthread itself.
Asynchronous Access:
The two functions QAsyncSettingsContainer::appendEntryAsync, QAsyncSettingsContainer::prependEntryAsync and QAsyncSettingsContainer::moveElementAsync can be used for asynchronous calls. They will return immediatly and post the event to the mainthread without waiting for it. It's safe to call those from everywhere.