#include <qtxsystem_intf.h>
Inherited by adtf::ui::v1::cQtWindow.
|
| virtual QString | GetStateIdentifier () const=0 |
| |
| virtual void | OnLoadState (const QString &strStateFolder, uint32_t ui32LoadStateFlags)=0 |
| |
| virtual void | OnSaveState (const QString &strStateFolder, uint32_t ui32SaveStateFlags) const=0 |
| |
|
|
| ~IWindowState ()=default |
| | protected DTOR
|
| |
Window state callback interface.
While registering a window with IQtXSystem::CreateWindow you are allowed to use the window creation flag WCF_HasWindowState. The implementation of parameter pWindow must derive by IWindow and IWindowState.
◆ StateFlags
State flags indicating the reason of the call and folder location within OnLoadState and OnSaveState.
The window state is defined by 2 different parts:
- Content: The actual data shown within the window(s), e.g. selected items, filter parameters, etc.
- Layout: The arrangement of the window, e.g. size, position, docked state, etc.
Runlevel changes are always called with both StateFlags::Content and StateFlags::Layout set, while perspective changes are called with StateFlags::Layout calls only. Concrete user interactions to load a state while importing are additionally indicated by StateFlags::Interactive.
| Enumerator |
|---|
| Content | If state exists restore or save it partially. Content in the meaning of:
- The actual data shown within the window(s), e.g. selected items, filter parameters, etc.
- Current history, signal paths , etc.
|
| Layout | If state exists update or save layout of existing views only. Layout in the meaning of:
- The arrangement of the window, e.g. size, position, docked state, etc.
- table column and row sizes, splitter states, tree expansions etc.
|
| Interactive | State folder was created on export/import actions by user interaction.
- This indicates that the user actively requested to load or save a state.
|
◆ GetStateIdentifier()
| virtual QString adtf::ui::v1::IQtXSystem::IWindowState::GetStateIdentifier |
( |
| ) |
const |
|
pure virtual |
◆ OnLoadState()
| virtual void adtf::ui::v1::IQtXSystem::IWindowState::OnLoadState |
( |
const QString & | strStateFolder, |
|
|
uint32_t | ui32LoadStateFlags ) |
|
pure virtual |
Callback function to load the internal window state from the given folder strStateFolder. We recommend to use QSettings to save and load a UI View Settings file.
void cMyFilter::OnLoadState(const QString& strStateFolder, uint32_t ui32LoadStateFlags)
{
const auto strUISettingsFile = strStateFolder + "/my_ui_view.settings";
if (QFileInfo(strUISettingsFile).exists())
{
QSettings oSettings(strUISettingsFile, QSettings::IniFormat);
oSettings.beginGroup("my_window");
oSettings.endGroup();
}
else
{
{
THROW_ERROR_DESC(ERR_INVALID_FILE, "UI View Settings file not found: %s",
strUISettingsFile.toStdString().c_str());
}
}
}
@ Interactive
State folder was created on export/import actions by user interaction.
Definition qtxsystem_intf.h:453
- Parameters
-
| [in] | strStateFolder | The folder to save the UI View Settings files to. |
| [in] | ui32LoadStateFlags | Flags indicating the reason of the call and folder location. Only the StateFlags::Interactive indicates an user interactions with the view. An exception during this interaction will result in a error message box, while all other calls will and only log the tResult error. |
- See also
- StateFlags
◆ OnSaveState()
| virtual void adtf::ui::v1::IQtXSystem::IWindowState::OnSaveState |
( |
const QString & | strStateFolder, |
|
|
uint32_t | ui32SaveStateFlags ) const |
|
pure virtual |
Callback function to save the internal window state to the given folder strStateFolder. We recommend to use QSettings to save and load a UI View Settings file.
void cMyFilter::OnSaveState(const QString& strStateFolder,[[maybe_unused]] uint32_t ui32SaveStateFlags) const
{
QSettings oSettings(strStateFolder + "/my_ui_view.settings", QSettings::IniFormat);
oSettings.beginGroup("my_window");
oSettings.endGroup();
}
- Parameters
-
| [in] | strStateFolder | The folder to save the UI View Settings files to. |
| [in] | ui32SaveStateFlags | Flags indicating the reason of the call and folder location. |
- See also
- StateFlags
The documentation for this class was generated from the following file: