QtDataSync  4.2.0
A simple offline-first synchronisation framework, to synchronize data of Qt applications between devices
Public Member Functions | List of all members
de::skycoder42::QtDataSync::EventLog Class Reference

The QML bindings for the static methods of of QtDataSync::EventCursor. More...

#include <qqmleventcursor.h>

+ Inheritance diagram for de::skycoder42::QtDataSync::EventLog:

Public Member Functions

Q_INVOKABLE QtDataSync::EventCursorfirst (QObject *parent=nullptr)
 Create a cursor positioned on the oldest change event. More...
 
Q_INVOKABLE QtDataSync::EventCursorfirst (const QString &setupName, QObject *parent=nullptr)
 Create a cursor positioned on the oldest change event. More...
 
Q_INVOKABLE QtDataSync::EventCursorlast (QObject *parent=nullptr)
 Create a cursor positioned on the newest change event. More...
 
Q_INVOKABLE QtDataSync::EventCursorlast (const QString &setupName, QObject *parent=nullptr)
 Create a cursor positioned on the newest change event. More...
 
Q_INVOKABLE QtDataSync::EventCursorcreate (quint64 index, QObject *parent=nullptr)
 Create a cursor positioned on the given index, if it is a valid index. More...
 
Q_INVOKABLE QtDataSync::EventCursorcreate (quint64 index, const QString &setupName, QObject *parent=nullptr)
 Create a cursor positioned on the given index, if it is a valid index. More...
 
Q_INVOKABLE QtDataSync::EventCursorload (const QByteArray &data, QObject *parent=nullptr)
 Create a cursor positioned on the index provided by the previously stored data, if still valid. More...
 
Q_INVOKABLE QtDataSync::EventCursorload (const QByteArray &data, const QString &setupName, QObject *parent=nullptr)
 Create a cursor positioned on the index provided by the previously stored data, if still valid. More...
 

Detailed Description

The QML bindings for the static methods of of QtDataSync::EventCursor.

Since
4.2
See also
QtDataSync::EventCursor

Definition at line 16 of file qqmleventcursor.h.

Member Function Documentation

◆ create() [1/2]

Q_INVOKABLE QtDataSync::EventCursor* de::skycoder42::QtDataSync::EventLog::create ( quint64  index,
QObject parent = nullptr 
)

Create a cursor positioned on the given index, if it is a valid index.

Parameters
indexThe index of the change event to position the cursor on
parentThe parent object to set as parent of the event cursor
Returns
A valid eventcursor, positioned on the given index, or an invalid cursor if no changes exist for that index
Exceptions
EventCursorExceptionThrown if access to the underlying database failed

If no setup name is specified, the cursor is created for the default setup name

See also
EventCursor::first, EventCursor::last, EventCursor::load, EventCursor::valid, EventCursor::isEventLogActive

◆ create() [2/2]

Q_INVOKABLE QtDataSync::EventCursor* de::skycoder42::QtDataSync::EventLog::create ( quint64  index,
const QString setupName,
QObject parent = nullptr 
)

Create a cursor positioned on the given index, if it is a valid index.

Parameters
setupNameThe name of the setup to create the cursor for
indexThe index of the change event to position the cursor on
parentThe parent object to set as parent of the event cursor
Returns
A valid eventcursor, positioned on the given index, or an invalid cursor if no changes exist for that index
Exceptions
EventCursorExceptionThrown if access to the underlying database failed

If no setup name is specified, the cursor is created for the default setup name

See also
EventCursor::first, EventCursor::last, EventCursor::load, EventCursor::valid, EventCursor::isEventLogActive

◆ first() [1/2]

Q_INVOKABLE QtDataSync::EventCursor* de::skycoder42::QtDataSync::EventLog::first ( QObject parent = nullptr)

Create a cursor positioned on the oldest change event.

Parameters
parentThe parent object to set as parent of the event cursor
Returns
A valid eventcursor, positioned on the oldest available change, or an invalid cursor if no changes exist
Exceptions
EventCursorExceptionThrown if access to the underlying database failed

If no setup name is specified, the cursor is created for the default setup name

See also
EventCursor::last, EventCursor::create, EventCursor::load, EventCursor::valid, EventCursor::isEventLogActive

◆ first() [2/2]

Q_INVOKABLE QtDataSync::EventCursor* de::skycoder42::QtDataSync::EventLog::first ( const QString setupName,
QObject parent = nullptr 
)

Create a cursor positioned on the oldest change event.

Parameters
setupNameThe name of the setup to create the cursor for
parentThe parent object to set as parent of the event cursor
Returns
A valid eventcursor, positioned on the oldest available change, or an invalid cursor if no changes exist
Exceptions
EventCursorExceptionThrown if access to the underlying database failed

If no setup name is specified, the cursor is created for the default setup name

See also
EventCursor::last, EventCursor::create, EventCursor::load, EventCursor::valid, EventCursor::isEventLogActive

◆ last() [1/2]

Q_INVOKABLE QtDataSync::EventCursor* de::skycoder42::QtDataSync::EventLog::last ( QObject parent = nullptr)

Create a cursor positioned on the newest change event.

Parameters
parentThe parent object to set as parent of the event cursor
Returns
A valid eventcursor, positioned on the newest available change, or an invalid cursor if no changes exist
Exceptions
EventCursorExceptionThrown if access to the underlying database failed

If no setup name is specified, the cursor is created for the default setup name

See also
EventCursor::first, EventCursor::create, EventCursor::load, EventCursor::valid, EventCursor::isEventLogActive

◆ last() [2/2]

Q_INVOKABLE QtDataSync::EventCursor* de::skycoder42::QtDataSync::EventLog::last ( const QString setupName,
QObject parent = nullptr 
)

Create a cursor positioned on the newest change event.

Parameters
setupNameThe name of the setup to create the cursor for
parentThe parent object to set as parent of the event cursor
Returns
A valid eventcursor, positioned on the newest available change, or an invalid cursor if no changes exist
Exceptions
EventCursorExceptionThrown if access to the underlying database failed

If no setup name is specified, the cursor is created for the default setup name

See also
EventCursor::first, EventCursor::create, EventCursor::load, EventCursor::valid, EventCursor::isEventLogActive

◆ load() [1/2]

Q_INVOKABLE QtDataSync::EventCursor* de::skycoder42::QtDataSync::EventLog::load ( const QByteArray data,
QObject parent = nullptr 
)

Create a cursor positioned on the index provided by the previously stored data, if still valid.

Parameters
dataThe data to create the cursor from
parentThe parent object to set as parent of the event cursor
Returns
A valid eventcursor, positioned on the index part of the data, or an invalid cursor if no changes exist for that index
Exceptions
EventCursorExceptionThrown if access to the underlying database failed

If no setup name is specified, the cursor is created for the default setup name. The following properties are restored from the data:

  • EventCursor::index
  • EventCursor::skipObsolete

Use save() to save the data of an existing cursor so you can later load it again using this method.

Note
The index is only set in case the returned cursor is valid. For an invalid cursor, only the skipObsolete property will be set.
See also
EventCursor::first, EventCursor::last, EventCursor::create, EventCursor::valid, EventCursor::isEventLogActive, EventCursor::save, EventCursor::skipObsolete

◆ load() [2/2]

Q_INVOKABLE QtDataSync::EventCursor* de::skycoder42::QtDataSync::EventLog::load ( const QByteArray data,
const QString setupName,
QObject parent = nullptr 
)

Create a cursor positioned on the index provided by the previously stored data, if still valid.

Parameters
setupNameThe name of the setup to create the cursor for
dataThe data to create the cursor from
parentThe parent object to set as parent of the event cursor
Returns
A valid eventcursor, positioned on the index part of the data, or an invalid cursor if no changes exist for that index
Exceptions
EventCursorExceptionThrown if access to the underlying database failed

If no setup name is specified, the cursor is created for the default setup name. The following properties are restored from the data:

  • EventCursor::index
  • EventCursor::skipObsolete

Use save() to save the data of an existing cursor so you can later load it again using this method.

Note
The index is only set in case the returned cursor is valid. For an invalid cursor, only the skipObsolete property will be set.
See also
EventCursor::first, EventCursor::last, EventCursor::create, EventCursor::valid, EventCursor::isEventLogActive, EventCursor::save, EventCursor::skipObsolete

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