QtDataSync
4.2.0
A simple offline-first synchronisation framework, to synchronize data of Qt applications between devices
|
The QML binding of QtDataSync::UserExchangeManager. More...
#include <qqmluserexchangemanager.h>
Signals | |
void | setupNameChanged (QString setupName) |
NOTIFY accessor for AccountManager::setupName. | |
void | managerChanged (QQmlAccountManager *manager) |
NOTIFY accessor for AccountManager::manager. | |
void | validChanged (bool valid) |
NOTIFY accessor for AccountManager::valid. | |
![]() | |
void | userDataReceived (const QtDataSync::UserInfo &userInfo, bool trusted, QPrivateSignal) |
Is emitted, when a user identity was received from the given user. More... | |
void | exchangeError (const QString &errorString, QPrivateSignal) |
Is emitted when an error occured trying to export or import. More... | |
QT_DATASYNC_REVISION_2 void | setupNameChanged (const QString &setupName, QPrivateSignal) |
NOTIFY accessor for UserInfo::setupName. | |
void | activeChanged (bool active, QPrivateSignal) |
NOTIFY accessor for UserInfo::active. | |
void | devicesChanged (QList< QtDataSync::UserInfo > devices, QPrivateSignal) |
NOTIFY accessor for UserInfo::users. | |
Public Member Functions | |
Q_INVOKABLE void | importFrom (const QtDataSync::UserInfo &userInfo, const QJSValue &completedFn, bool keepData=false) |
Imports the untrusted user data previously received by the given user. More... | |
Q_INVOKABLE void | importTrustedFrom (const QtDataSync::UserInfo &userInfo, const QString &password, const QJSValue &completedFn, bool keepData=false) |
Imports the trusted user data previously received by the given user. More... | |
![]() | |
UserExchangeManager (QObject *parent=nullptr) | |
Default constructor, uses the default setup. More... | |
UserExchangeManager (const QString &setupName, QObject *parent=nullptr) | |
Constructor with an explicit setup. More... | |
UserExchangeManager (AccountManager *manager, QObject *parent=nullptr) | |
Constructor with an account manager to use for account import and export. More... | |
AccountManager * | accountManager () const |
The internally used account manager used to export and import data. More... | |
QString | setupName () const |
NOTIFY accessor for UserInfo::setupName. | |
quint16 | port () const |
Returns the currently used port. More... | |
bool | isActive () const |
READ accessor for UserInfo::active. | |
QList< UserInfo > | devices () const |
READ accessor for UserInfo::users. | |
Q_INVOKABLE void | exportTo (const QtDataSync::UserInfo &userInfo, bool includeServer) |
Sends the user identity to the given user as untrusted export. More... | |
Q_INVOKABLE void | exportTrustedTo (const QtDataSync::UserInfo &userInfo, bool includeServer, const QString &password) |
Sends the user identity to the given user as trusted export. More... | |
void | importFrom (const QtDataSync::UserInfo &userInfo, const std::function< void(bool, QString)> &completedFn, bool keepData=false) |
Imports the untrusted user data previously received by the given user. More... | |
void | importTrustedFrom (const QtDataSync::UserInfo &userInfo, const QString &password, const std::function< void(bool, QString)> &completedFn, bool keepData=false) |
Imports the trusted user data previously received by the given user. More... | |
![]() | |
virtual const QMetaObject * | metaObject () const const |
virtual void * | qt_metacast (const char *) |
virtual int | qt_metacall (QMetaObject::Call, int, void **) |
QObject (QObject *parent) | |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
QString | objectName () const const |
void | setObjectName (const QString &name) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
bool | signalsBlocked () const const |
bool | blockSignals (bool block) |
QThread * | thread () const const |
void | moveToThread (QThread *targetThread) |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
void | killTimer (int id) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
const QObjectList & | children () const 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 const |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectTree () |
void | dumpObjectInfo () |
void | dumpObjectTree () const const |
void | dumpObjectInfo () const const |
bool | setProperty (const char *name, const QVariant &value) |
QVariant | property (const char *name) const const |
QList< QByteArray > | dynamicPropertyNames () const const |
void | destroyed (QObject *obj) |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
bool | inherits (const char *className) const const |
void | deleteLater () |
Properties | |
quint16 | DataExchangePort |
The default port (13742) for the data exchange. More... | |
QString | setupName |
Holds the name of the setup this manager operates on. More... | |
QQmlAccountManager | manager |
Holds the data store this model operates on. More... | |
bool | valid |
Specifies if the object was correctly initialized. More... | |
![]() | |
QString | setupName |
Holds the name of the setup this manager operates on. More... | |
bool | active |
Reports whether the instance is currently exchanging or not. More... | |
QList< QtDataSync::UserInfo > | devices |
Holds all currently discovered devices. More... | |
![]() | |
objectName | |
Additional Inherited Members | |
![]() | |
bool | startExchange (quint16 port=DataExchangePort) |
Start the exchange discovery on the specified port. More... | |
bool | startExchange (const QHostAddress &listenAddress, quint16 port=DataExchangePort) |
Start the exchange discovery on the specified address and port. More... | |
void | stopExchange () |
Stops the exchange discovery. More... | |
![]() | |
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) |
![]() | |
static const quint16 | DataExchangePort |
The default port (13742) for the data exchange. | |
![]() | |
QObject * | sender () const const |
int | senderSignalIndex () const const |
int | receivers (const char *signal) const const |
bool | isSignalConnected (const QMetaMethod &signal) const 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) |
The QML binding of QtDataSync::UserExchangeManager.
Definition at line 21 of file qqmluserexchangemanager.h.
Q_INVOKABLE void de::skycoder42::QtDataSync::UserExchangeManager::importFrom | ( | const QtDataSync::UserInfo & | userInfo, |
const QJSValue & | completedFn, | ||
bool | keepData = false |
||
) |
Imports the untrusted user data previously received by the given user.
userInfo | The user to that sent the data to import |
completedFn | A function that is called once the import has been finished |
keepData | Specify whether the stored data should be preserved |
Use this method to perform the actual import of an identity after receiving it via userDataReceived(). This only works if data has been received from the user that way. Otherwise the operation will fail.
Internally, AccountManager::importAccount is used to perform the actual import. The received data is simply passed to that method. See that documentation for more details.
Q_INVOKABLE void de::skycoder42::QtDataSync::UserExchangeManager::importTrustedFrom | ( | const QtDataSync::UserInfo & | userInfo, |
const QString & | password, | ||
const QJSValue & | completedFn, | ||
bool | keepData = false |
||
) |
Imports the trusted user data previously received by the given user.
userInfo | The user to that sent the data to import |
password | The password used to decrypt the imported data with. Must be the same as used for the export |
completedFn | A function that is called once the import has been finished |
keepData | Specify whether the stored data should be preserved |
Use this method to perform the actual import of an identity after receiving it via userDataReceived(). This only works if data has been received from the user that way. Otherwise the operation will fail.
Internally, AccountManager::importAccountTrusted is used to perform the actual import. The received data is simply passed to that method. See that documentation for more details.
|
read |
The default port (13742) for the data exchange.
Default: 13742
Accessors | |
---|---|
MEMBER | DataExchangePort |
READ ONLY |
Definition at line 43 of file qqmluserexchangemanager.h.
|
readwrite |
Holds the data store this model operates on.
Default: nullptr
Allows you to specify a datastore instead of a setup to initialize the model
Accessors | |
---|---|
MEMBER | setupName |
NOTIFY | setupNameChanged() |
Definition at line 78 of file qqmluserexchangemanager.h.
|
readwrite |
Holds the name of the setup this manager operates on.
Default: QtDataSync::DefaultSetup
Allows you to specify the name of the setup that this manager should use
Accessors | |
---|---|
MEMBER | setupName |
NOTIFY | setupNameChanged() |
Definition at line 61 of file qqmluserexchangemanager.h.
|
read |
Specifies if the object was correctly initialized.
Default: false
Only becomes true if the given setup name resolves to a valid datasync instance or if the given manager is valid
Accessors | |
---|---|
MEMBER | valid |
NOTIFY | validChanged() |
READ ONLY |
Definition at line 94 of file qqmluserexchangemanager.h.