
Classes | |
| struct | Command |
| 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) |
| Set the storage destination. | |
| virtual void | save (QDataStream &s) |
| Serialize session data. | |
| virtual void | restore (const QDataStream &s) |
| Deserialize session data. | |
Public Member Functions | |
| QEditSession (QObject *p=0) | |
| ctor | |
| virtual | ~QEditSession () |
| dtor | |
| int | autoUpdateInterval () const |
| QString | fileName () const |
Protected Member Functions | |
| virtual void | saved (QEditor *e) |
| Called whenever an editor is saved. | |
| virtual void | timerEvent (QTimerEvent *e) |
| virtual QEditor * | createEditor () |
Protected Attributes | |
| int | m_id |
| int | m_delay |
| QString | m_fileName |
| QList< QPointer< QEditor * > > | m_editors |
| QList< Document * > | m_sessionData |
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 |
| QString QEditSession::fileName | ( | ) | const |
| void QEditSession::saved | ( | QEditor * | e | ) | [protected, virtual] |
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
| void QEditSession::setAutoUpdateInterval | ( | int | ms | ) | [virtual, slot] |
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.
| void QEditSession::setFileName | ( | const QString & | filename | ) | [virtual, slot] |
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.
| void QEditSession::updateData | ( | ) | [virtual, slot] |
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.
1.5.7.1