QCodeEdit
2.2
|
A session recording class. More...
Classes | |
struct | Cursor |
struct | Document |
Public Slots | |
virtual void | addEditor (QEditor *e) |
Add an editor to the session. | |
virtual void | removeEditor (QEditor *e) |
Remove an editor from the session. | |
virtual void | updateData () |
Updates the data. | |
virtual void | setAutoUpdateInterval (int ms) |
Set the update interval. | |
virtual void | setFileName (const QString &filename, bool restore=false) |
Set the storage destination. | |
virtual void | clear (bool cleanup=false) |
virtual void | save () |
Serialize session data. | |
virtual void | restore () |
Serialize session data. | |
virtual void | save (QDataStream &s) |
Serialize session data. | |
virtual void | restore (QDataStream &s) |
Deserialize session data. |
Signals | |
void | restored (QEditor *e) |
Public Member Functions | |
QEditSession (QObject *p=0) | |
ctor | |
QEditSession (const QString &f, QObject *p=0) | |
ctor | |
virtual | ~QEditSession () |
dtor | |
int | autoUpdateInterval () const |
QString | fileName () const |
Protected Slots | |
virtual void | destroyed (QObject *o) |
virtual void | saved (QEditor *e, const QString &fn) |
Called whenever an editor is saved. | |
virtual void | loaded (QEditor *e, const QString &fn) |
Called whenever an editor is loaded with new content. |
Protected Member Functions | |
virtual void | timerEvent (QTimerEvent *e) |
virtual QEditor * | createEditor () |
virtual void | update (QEditor *e, Document *d) |
Protected Attributes | |
int | m_id |
int | m_delay |
QString | m_fileName |
QList< QEditor * > | m_editors |
QList< Document * > | m_sessionData |
A session recording class.
The purpose of this class is to collect session data from several QEditor object, to serialize it and to re-create the same session by deserializing the stored data.
int QEditSession::autoUpdateInterval | ( | ) | const |
A value of zero means the data is NOT automatically updated.
QString QEditSession::fileName | ( | ) | const |
If it is empty then no auto-save is performed.
|
protectedvirtualslot |
Called whenever an editor is loaded with new content.
This handler is responsible for updating file names and time stamps which is needed to avoid data loss upon session restoration
Referenced by addEditor(), removeEditor(), and restore().
|
protectedvirtualslot |
Called whenever an editor is saved.
This handler is responsible for updating file names and time stamps which is needed to avoid data loss upon session restoration
Referenced by addEditor(), removeEditor(), and restore().
|
virtualslot |
Set the update interval.
If ms is strictly positive then the data will be updated every ms milliseconds
If the session has been given a valid filename, the updated data will automatically be saved to that file.
|
virtualslot |
Set the storage destination.
Every time the data is updated, either when the autoupdate timer ticks or when updateData() is called programmatically, it will be written to that file, provided the filename is valid and points to a writeable location.
References restore().
Referenced by QEditSession().
|
virtualslot |
Updates the data.
Fetches up-to-date session data from the attached editors.
If the session has been given a valid filename the data will automatically be saved.
References save().