ACF $AcfVersion:0$
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
iqtdoc::CSingleDocumentWorkspaceGuiComp Class Reference

Qt-based workspace implementation of a single document manager. More...

#include <CSingleDocumentWorkspaceGuiComp.h>

Inheritance diagram for iqtdoc::CSingleDocumentWorkspaceGuiComp:
iqtdoc::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > > > idoc::CSingleDocumentManagerBase iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > > idoc::CTmplBasedDocumentManagerBase imod::CSingleModelObserverBase iqtgui::TGuiComponentBase< QWidget > idoc::IDocumentManager imod::IObserver iqtgui::CGuiComponentBase istd::IChangeable idoc::IDocumentTypesInfo istd::IPolymorphic iqtgui::TMakeIconProviderCompWrap< ibase::TLocalizableWrap< icomp::CComponentBase > > iqtgui::IGuiObject istd::IPolymorphic istd::IPolymorphic iqtgui::TDesignSchemaHandlerWrap< Base > iqtgui::CIconProvider istd::IPolymorphic

Public Types

enum  GroupId { GI_WINDOW = 0x300 , GI_DOCUMENT , GI_VIEW }
 
typedef iqtdoc::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > > > BaseClass
 
- Public Types inherited from iqtdoc::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > > >
typedef idoc::CSingleDocumentManagerBase BaseClass
 
typedef BaseClass::Ids Ids
 
- Public Types inherited from idoc::IDocumentManager
enum  ChangeFlags {
  CF_DOCUMENT_RENAMED = 0x834d670 , CF_DOCUMENT_CREATED , CF_DOCUMENT_REMOVED , CF_DOCUMENT_COUNT_CHANGED ,
  CF_VIEW_ACTIVATION_CHANGED
}
 Possible changes in the manager data model. More...
 
enum  OperationFlags {
  OF_FILE_NEW = 0x0001 , OF_FILE_OPEN = 0x0002 , OF_FILE_SAVE = 0x0004 , OF_FILE_SAVE_AS = 0x0008 ,
  OF_KNOWN_PATH = 0x0010
}
 Flags describing possible operations that can be performed by the document manager. More...
 
typedef QMap< QString, QByteArray > FileToTypeMap
 Map from file path to document type ID's.
 
- Public Types inherited from istd::IChangeable
enum  ChangeFlags {
  CF_ACF_INTERNAL = 0 , CF_ALL_DATA , CF_ANY , CF_DESTROYING ,
  CF_DELEGATED , CF_NO_UNDO
}
 Data model change notification flags. More...
 
enum  SupportedOperations {
  SO_NONE = 0 , SO_OBSERVE = 1 << 0 , SO_COPY = 1 << 1 , SO_CLONE = 1 << 2 ,
  SO_COMPARE = 1 << 3 , SO_RESET = 1 << 4
}
 Flags for supported operations. More...
 
enum  CompatibilityMode { CM_STRICT , CM_WITHOUT_REFS , CM_WITH_REFS , CM_CONVERT }
 Control how relationship betweeen objects are interpreted. More...
 
typedef QMultiMap< QByteArray, QVariant > ChangeInfoMap
 
- Public Types inherited from idoc::IDocumentTypesInfo
enum  SupportedFeatures { SF_NEW_DOCUMENT = 0x0001 , SF_EDIT_DOCUMENT = 0x0010 , SF_DEFAULT = 0xffff }
 Enumeration for supported types of operations with documents. More...
 
typedef QVector< QByteArray > Ids
 Type definition for document type ID collections.
 
- Public Types inherited from iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > >
typedef iqtgui::TGuiComponentBase< QWidget > BaseClass
 
- Public Types inherited from iqtgui::TGuiComponentBase< QWidget >
typedef CGuiComponentBase BaseClass
 
- Public Types inherited from iqtgui::CGuiComponentBase
typedef TMakeIconProviderCompWrap< ibase::TLocalizableWrap< icomp::CComponentBase > > BaseClass
 
- Public Types inherited from iqtgui::TMakeIconProviderCompWrap< ibase::TLocalizableWrap< icomp::CComponentBase > >
typedef ibase::TLocalizableWrap< icomp::CComponentBaseBaseClass
 
- Public Types inherited from iqtgui::TDesignSchemaHandlerWrap< Base >
typedef Base BaseClass
 

Public Member Functions

 CSingleDocumentWorkspaceGuiComp ()
 
virtual void SetActiveView (istd::IPolymorphic *viewPtr) override
 Indicate that some view is active now.
 
virtual void OnTryClose (bool *ignoredPtr=NULL) override
 Called when the application is attempting to close.
 
- Public Member Functions inherited from iqtdoc::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > > >
virtual void OnSaveSettings (QSettings &settings) const override
 
virtual QString GetSaveFilePath (const QByteArray &documentTypeId, const istd::IChangeable *dataObjectPtr, const QString &currentFilePath) const override
 
- Public Member Functions inherited from idoc::CSingleDocumentManagerBase
 CSingleDocumentManagerBase ()
 
virtual idoc::IUndoManagerGetUndoManagerForDocument (const istd::IChangeable *documentPtr) const override
 Return undo manager for document documentPtr.
 
virtual int GetDocumentsCount () const override
 Get number of opened documents.
 
virtual istd::IChangeableGetDocumentFromIndex (int index, DocumentInfo *documentInfoPtr=NULL) const override
 Get document at specified index.
 
virtual int GetViewsCount (int documentIndex) const override
 Get number of view for specified document.
 
virtual istd::IPolymorphicGetViewFromIndex (int documentIndex, int viewIndex) const override
 Get single view using its and document indices.
 
virtual istd::IPolymorphicGetActiveView () const override
 Return the active document.
 
virtual istd::IChangeableGetDocumentFromView (const istd::IPolymorphic &view, DocumentInfo *documentInfoPtr=NULL) const override
 Return the document assigned to view.
 
virtual istd::IPolymorphicAddViewToDocument (const istd::IChangeable &document, const QByteArray &viewTypeId=QByteArray()) override
 Add a new view to the document.
 
virtual QByteArray GetDocumentTypeId (const istd::IChangeable &document) const override
 Get ID of document type managed by this object.
 
virtual bool InsertNewDocument (const QByteArray &documentTypeId, bool createView=true, const QByteArray &viewTypeId="", istd::IChangeableSharedPtr *newDocumentPtr=nullptr, bool beQuiet=false, bool *ignoredPtr=NULL) override
 Creates a new document with the document ID documentTypeId.
 
virtual bool OpenDocument (const QByteArray *documentTypeIdPtr, const QString *fileNamePtr=NULL, bool createView=true, const QByteArray &viewTypeId="", istd::IChangeableSharedPtr *documentPtr=nullptr, FileToTypeMap *loadedMapPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL, ibase::IProgressManager *progressManagerPtr=NULL) override
 Opens document(s) from the file list.
 
virtual bool SaveDocument (int documentIndex=-1, bool requestFileName=false, FileToTypeMap *savedMapPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL, ibase::IProgressManager *progressManagerPtr=NULL) override
 Save document.
 
virtual bool SaveDirtyDocuments (bool beQuiet=false, bool *ignoredPtr=NULL) override
 Ask user (optional) and save all dirty (changed) documents.
 
virtual bool CloseDocument (int documentIndex=-1, bool beQuiet=false, bool *ignoredPtr=NULL) override
 Close document and all its views.
 
virtual bool CloseView (istd::IPolymorphic *viewPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL) override
 Close view.
 
- Public Member Functions inherited from idoc::CTmplBasedDocumentManagerBase
 CTmplBasedDocumentManagerBase ()
 
virtual int GetAllowedOperationFlags (const istd::IPolymorphic *viewPtr=NULL) const override
 Get flags of allowed operations.
 
virtual bool IsFeatureSupported (int featureFlags, const QByteArray &documentTypeId) const override
 Return true, if the feature(s) is supported by this document template.
 
virtual Ids GetDocumentTypeIds () const override
 Get list of supported document type IDs.
 
virtual QString GetDocumentTypeName (const QByteArray &documentTypeId) const override
 Get human readable name of some document type ID.
 
virtual ifile::IFileTypeInfoGetDocumentFileTypeInfo (const QByteArray &documentTypeId) const override
 Get file type information object for some selected document type.
 
virtual Ids GetDocumentTypeIdsForFile (const QString &filePath) const override
 Get list of supported document IDs that can handle the specified file.
 
virtual QString GetDefaultDirectory (const QString &sugestedDir="", const QByteArray *documentTypeIdPtr=NULL) const override
 Return default directory for specified document type.
 
- Public Member Functions inherited from istd::IChangeable
virtual int GetSupportedOperations () const
 Get set of flags for supported operations.
 
virtual bool CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 Copy this object from another one.
 
virtual bool IsEqual (const IChangeable &object) const
 Compare this object with another object.
 
virtual istd::TUniqueInterfacePtr< istd::IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const
 Make a copy of this object.
 
virtual bool ResetData (CompatibilityMode mode=CM_WITHOUT_REFS)
 Reset data to its default state.
 
virtual void BeginChanges (const ChangeSet &changeSet)
 Starts the change transaction.
 
virtual void EndChanges (const ChangeSet &changeSet)
 Ends the change transaction.
 
virtual void BeginChangeGroup (const ChangeSet &changeSet)
 Starts group of changes.
 
virtual void EndChangeGroup (const ChangeSet &changeSet)
 Ends group of changes.
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 
- Public Member Functions inherited from iqtgui::TGuiComponentBase< QWidget >
 TGuiComponentBase ()
 
virtual QWidget * GetQtWidget () const
 
virtual QWidget * CreateQtWidget (QWidget *parentPtr) override
 Create slave widget object.
 
- Public Member Functions inherited from iqtgui::CGuiComponentBase
 I_REGISTER_SUBELEMENT_INTERFACE_T (VisualStatus, IVisualStatus, ExtractVisualStatus)
 
 I_REGISTER_SUBELEMENT_INTERFACE_T (VisualStatus, istd::IChangeable, ExtractVisualStatus)
 
 I_REGISTER_SUBELEMENT_INTERFACE_T (VisualStatus, imod::IModel, ExtractVisualStatus)
 
 CGuiComponentBase ()
 
bool IsGuiShown () const
 
virtual bool IsGuiCreated () const override
 Checks if the GUI has been initialized and created.
 
virtual QWidget * GetWidget () const override
 Gets access to the internal QWidget object.
 
- Public Member Functions inherited from iqtgui::TDesignSchemaHandlerWrap< Base >
 TDesignSchemaHandlerWrap ()
 
virtual void EnableDesignHandler (bool enable=true)
 If enabled, listen to the design schema change events from the application context.
 
- Public Member Functions inherited from iqtgui::CIconProvider
virtual QIcon GetIcon (const QString &iconName) const
 
virtual QString GetIconPath (const QString &iconName) const
 
virtual QString GetStyleSheetPath (const QString &styleSheetPath) const
 
QByteArray GetCurrentThemeId () const
 
void SetThemeId (const QByteArray &themeId)
 

Protected Member Functions

virtual void UpdateTitle ()
 Update titles of views or all views of specified document.
 
virtual QString GenerateDocumentTitle () const
 Generate the title of the current document.
 
virtual QString GetOpenFilePath (const QByteArray *documentTypeIdPtr=NULL) const override
 Gets open file names.
 
virtual void OnViewRegistered (istd::IPolymorphic *viewPtr) override
 Called after view is registered.
 
virtual void OnViewRemoved (istd::IPolymorphic *viewPtr) override
 Called before view is removed.
 
virtual void OnDocumentRegistered () override
 Called after document is registered.
 
virtual void OnDocumentClosed () override
 Called before document is closed.
 
virtual bool QueryDocumentSave (bool *ignoredPtr) override
 Query user if this document can be closed.
 
virtual void OnGuiCreated () override
 Called just after GUI is initialized.
 
virtual void OnGuiDestroyed () override
 Called just before GUI is released.
 
virtual void OnComponentCreated () override
 
virtual void OnEndChanges (const ChangeSet &changeSet) override
 Callback function for end change event.
 
virtual void OnRestoreSettings (const QSettings &settings) override
 
 I_TEXTATTR (m_defaultDocumentTitleAttrPtr)
 
- Protected Member Functions inherited from iqtdoc::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > > >
virtual QStringList CreateFileDialogFilters (const QByteArray *documentTypeIdPtr, const istd::IChangeable *dataObjectPtr, int flags) const
 Creates the filter for the file selection dialog.
 
void UpdateLastDirectory (const QString &filePath) const
 
virtual QStringList GetOpenFilePathesFromDialog (const QByteArray *documentTypeIdPtr) const
 
- Protected Member Functions inherited from idoc::CSingleDocumentManagerBase
virtual void BeforeSavingDocument (const QString &filePath)
 Called just before the document is saved via persistence.
 
virtual void AfterSavingDocument (bool saveState)
 Called immediately after saving the document via persistence.
 
virtual bool OpenSingleDocument (const QString &filePath, bool createView, const QByteArray &viewTypeId, QByteArray &documentTypeId, bool beQuiet, bool *ignoredPtr, ibase::IProgressManager *progressManagerPtr)
 Open single document using its file path.
 
bool NewDocument (const QByteArray &documentTypeId, bool createView, const QByteArray &viewTypeId, bool initialize, bool beQuiet, bool *ignoredPtr)
 Create instance of specified document without attaching to this manager.
 
bool RegisterDocument ()
 Register (attach) created document as new working document.
 
void EnsureViewRemoved ()
 
QString GetCurrentDocumentFilePath () const
 
bool HasDocumentPendingChanges () const
 
void OnUndoManagerUpdate (const istd::IChangeable::ChangeSet &changeSet)
 
virtual void OnUpdate (const istd::IChangeable::ChangeSet &changeSet) override
 Called on update of observed model.
 
bool SerializeOpenDocument (iser::IArchive &archive)
 Serializes open documents information.
 
- Protected Member Functions inherited from idoc::CTmplBasedDocumentManagerBase
virtual const idoc::IDocumentTemplateGetDocumentTemplate () const
 
void SetDocumentTemplate (const idoc::IDocumentTemplate *documentTemplatePtr)
 
- Protected Member Functions inherited from istd::IChangeable
virtual void OnBeginChanges ()
 Callback function for begin change event.
 
- Protected Member Functions inherited from imod::CSingleModelObserverBase
void SetModelPtr (imod::IModel *modelPtr)
 Set internal model pointer to specified value.
 
 CSingleModelObserverBase ()
 
virtual ~CSingleModelObserverBase ()
 
imod::IModelGetObservedModel () const
 Get access to observed model.
 
imod::IModelGetModelPtr () const
 Get access to observed model.
 
void EnsureModelDetached ()
 Make sure this observer is detached.
 
void SetObservedIds (const istd::IChangeable::ChangeSet &changeMask)
 Set list of ID's beeing observed.
 
virtual bool IsModelAttached (const imod::IModel *modelPtr=NULL) const override
 Checks if the specified model is currently attached to this observer.
 
virtual bool OnModelAttached (imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask) override
 Callback invoked when an observable model is about to be attached to this observer.
 
virtual bool OnModelDetached (imod::IModel *modelPtr) override
 Callback invoked when an observable model is about to be detached from this observer.
 
virtual void BeforeUpdate (imod::IModel *modelPtr) override
 Callback invoked before an update of the observer's content occurs.
 
virtual void AfterUpdate (imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet) override
 Callback invoked after an update of the observer's content occurs.
 
- Protected Member Functions inherited from iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > >
virtual bool CreateGui (QWidget *parentPtr) override
 
virtual bool DestroyGui () override
 
- Protected Member Functions inherited from iqtgui::CGuiComponentBase
virtual void OnGuiDesignChanged ()
 
virtual void OnGuiShown ()
 Called from widget event filter when slave widget is shown.
 
virtual void OnGuiHidden ()
 Called from widget event filter when slave widget is hidden.
 
virtual bool OnKeyPressed (QKeyEvent *event)
 Called from widget event filter when key is pressed.
 
virtual void OnRetranslate ()
 Called when non-GUI elements (like commands) should be retranslated.
 
virtual void OnGuiRetranslate ()
 Called from widget event filter when GUI should be retranslated.
 
void SetStatusIcon (const QIcon &icon)
 Set status icon;.
 
void SetStatusText (const QString &text)
 Set status text;.
 
void SetDefaultVisualStatus ()
 
virtual void OnLanguageChanged () override
 
virtual void OnDesignSchemaChanged (const QByteArray &themeId) override
 
virtual bool eventFilter (QObject *sourcePtr, QEvent *eventPtr) override
 
virtual void OnComponentDestroyed () override
 
- Protected Member Functions inherited from iqtgui::CIconProvider
virtual QIcon CreateIcon (const QString &iconName) const
 

Protected Attributes

iqtgui::IGuiObjectm_lastViewPtr
 
QString m_organizationName
 
QString m_applicationName
 
- Protected Attributes inherited from iqtgui::CGuiComponentBase
imod::TModelWrap< VisualStatusm_visualStatus
 

Additional Inherited Members

- Static Public Member Functions inherited from istd::IChangeable
static const ChangeSetGetNoChanges ()
 Get empty set of changes.
 
static const ChangeSetGetAnyChange ()
 Get anonymous change set.
 
static const ChangeSetGetAllChanges ()
 Get anonymous change set.
 
static const ChangeSetGetDelegatedChanges ()
 Get delegated change set.
 
- Protected Types inherited from imod::CSingleModelObserverBase
typedef imod::IModel ModelType
 
- Static Protected Attributes inherited from imod::CSingleModelObserverBase
static const istd::IChangeable::ChangeSet s_undoChanges
 

Detailed Description

Qt-based workspace implementation of a single document manager.

This component provides a workspace widget for Single Document Interface (SDI) applications. It manages a single document at a time, creating and displaying views within the workspace. When a new document is opened, it replaces the current document.

SDI applications typically have one main window with one document, similar to:

Component Attributes
  • DefaultDocumentTitle - Title for untitled documents (default: "<no name>")
  • RememberOpenDocumentOnExit - Restore last document on restart (default: false)
Component References
  • DocumentTemplate - Document template for creating documents (required)
Configuration Example
DefaultDocumentTitle = "Untitled"
RememberOpenDocumentOnExit = true
DocumentTemplate = MyDocumentTemplate
}
Qt-based workspace implementation of a single document manager.
Usage in Main Window
ApplicationInfo = AppInfo
DocumentManager = DocumentManager
// Add workspace as child component
DocumentTemplate = TextDocumentTemplate
DefaultDocumentTitle = "New Document"
RememberOpenDocumentOnExit = true
}
}
Standard main window component for any document-based application.
Features
  • Automatic view management (creates and destroys views as needed)
  • Window title updates with document name
  • Optional document persistence between sessions
  • Clean workspace for single-document workflows
  • Integrated with ACF GUI restoration system
Typical Workflow
  1. User opens document via File > Open
  2. Workspace creates view for document
  3. View is displayed in workspace widget
  4. Window title updates to show document name
  5. User works with document
  6. On File > Open (another document), previous document is closed (with save prompt if dirty)
  7. New document and view are created
See also
CMainWindowGuiComp, CSingleDocumentManagerBase, CMultiDocumentWorkspaceGuiComp

Definition at line 90 of file CSingleDocumentWorkspaceGuiComp.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 102 of file CSingleDocumentWorkspaceGuiComp.h.

Member Enumeration Documentation

◆ GroupId

Enumerator
GI_WINDOW 
GI_DOCUMENT 
GI_VIEW 

Definition at line 111 of file CSingleDocumentWorkspaceGuiComp.h.

Constructor & Destructor Documentation

◆ CSingleDocumentWorkspaceGuiComp()

iqtdoc::CSingleDocumentWorkspaceGuiComp::CSingleDocumentWorkspaceGuiComp ( )

Member Function Documentation

◆ GenerateDocumentTitle()

virtual QString iqtdoc::CSingleDocumentWorkspaceGuiComp::GenerateDocumentTitle ( ) const
protectedvirtual

Generate the title of the current document.

◆ GetOpenFilePath()

virtual QString iqtdoc::CSingleDocumentWorkspaceGuiComp::GetOpenFilePath ( const QByteArray *  documentTypeIdPtr = NULL) const
overrideprotectedvirtual

Gets open file names.

Implements idoc::CSingleDocumentManagerBase.

◆ I_TEXTATTR()

iqtdoc::CSingleDocumentWorkspaceGuiComp::I_TEXTATTR ( m_defaultDocumentTitleAttrPtr  )
protected

◆ OnComponentCreated()

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnComponentCreated ( )
overrideprotectedvirtual

Reimplemented from iqtgui::CGuiComponentBase.

◆ OnDocumentClosed()

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnDocumentClosed ( )
overrideprotectedvirtual

Called before document is closed.

Implements idoc::CSingleDocumentManagerBase.

◆ OnDocumentRegistered()

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnDocumentRegistered ( )
overrideprotectedvirtual

Called after document is registered.

Implements idoc::CSingleDocumentManagerBase.

◆ OnEndChanges()

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnEndChanges ( const ChangeSet changeSet)
overrideprotectedvirtual

Callback function for end change event.

Reimplemented from istd::IChangeable.

◆ OnGuiCreated()

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnGuiCreated ( )
overrideprotectedvirtual

Called just after GUI is initialized.

Reimplemented from iqtgui::CGuiComponentBase.

◆ OnGuiDestroyed()

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnGuiDestroyed ( )
overrideprotectedvirtual

Called just before GUI is released.

Reimplemented from iqtgui::CGuiComponentBase.

◆ OnRestoreSettings()

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnRestoreSettings ( const QSettings &  settings)
overrideprotectedvirtual

◆ OnTryClose()

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnTryClose ( bool *  ignoredPtr = NULL)
overridevirtual

Called when the application is attempting to close.

This method is invoked before the application closes, giving the GUI component a chance to prevent the close operation (e.g., to save unsaved data, show confirmation dialogs, or perform cleanup operations).

Parameters
ignoredPtrOptional pointer to a boolean flag. If not nullptr and the component wants to prevent closing (e.g., user cancels a save dialog), the implementation should set *ignoredPtr to true. If nullptr, the close operation cannot be prevented.
Note
If ignoredPtr is nullptr, the implementation must not try to prevent closing and should only perform necessary cleanup.
This method may be called multiple times if the close is initially prevented but later attempted again.
// Example implementation
virtual void OnTryClose(bool* ignoredPtr)
{
if (m_hasUnsavedData) {
if (ignoredPtr) {
// Show save dialog
int result = QMessageBox::question(GetWidget(),
"Unsaved Changes",
"Do you want to save your changes?",
QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
if (result == QMessageBox::Save) {
SaveData();
} else if (result == QMessageBox::Cancel) {
*ignoredPtr = true; // Prevent closing
return;
}
}
}
// Perform cleanup if needed
}
virtual void OnTryClose(bool *ignoredPtr=NULL) override
Called when the application is attempting to close.
virtual QWidget * GetWidget() const override
Gets access to the internal QWidget object.
See also
DestroyGui()

Reimplemented from iqtgui::CGuiComponentBase.

◆ OnViewRegistered()

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnViewRegistered ( istd::IPolymorphic viewPtr)
overrideprotectedvirtual

Called after view is registered.

Implements idoc::CSingleDocumentManagerBase.

◆ OnViewRemoved()

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::OnViewRemoved ( istd::IPolymorphic viewPtr)
overrideprotectedvirtual

Called before view is removed.

Implements idoc::CSingleDocumentManagerBase.

◆ QueryDocumentSave()

virtual bool iqtdoc::CSingleDocumentWorkspaceGuiComp::QueryDocumentSave ( bool *  ignoredPtr)
overrideprotectedvirtual

Query user if this document can be closed.

Parameters
ignoredPtroptional return flag indicating that user ignored this close operation.

Implements idoc::CSingleDocumentManagerBase.

◆ SetActiveView()

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::SetActiveView ( istd::IPolymorphic viewPtr)
overridevirtual

Indicate that some view is active now.

Implements idoc::IDocumentManager.

◆ UpdateTitle()

virtual void iqtdoc::CSingleDocumentWorkspaceGuiComp::UpdateTitle ( )
protectedvirtual

Update titles of views or all views of specified document.

Member Data Documentation

◆ m_applicationName

QString iqtdoc::CSingleDocumentWorkspaceGuiComp::m_applicationName
protected

Definition at line 166 of file CSingleDocumentWorkspaceGuiComp.h.

◆ m_lastViewPtr

iqtgui::IGuiObject* iqtdoc::CSingleDocumentWorkspaceGuiComp::m_lastViewPtr
protected

Definition at line 163 of file CSingleDocumentWorkspaceGuiComp.h.

◆ m_organizationName

QString iqtdoc::CSingleDocumentWorkspaceGuiComp::m_organizationName
protected

Definition at line 165 of file CSingleDocumentWorkspaceGuiComp.h.


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