VPTissue Reference Manual
SimPT_Shell::Gui::PTreeEditor Class Reference

Stand-alone Property Tree editor. More...

#include <PTreeEditor.h>

Inheritance diagram for SimPT_Shell::Gui::PTreeEditor:
Inheritance graph
Collaboration diagram for SimPT_Shell::Gui::PTreeEditor:
Collaboration graph

Public Member Functions

 PTreeEditor (QWidget *parent=0)
 
virtual bool IsOpened () const
 Test whether app is in opened state.
 
bool OpenPath (std::string const &path)
 Open file. More...
 
bool SavePath (std::string const &path)
 Save opened file to a given path. More...
 
- Public Member Functions inherited from SimShell::Gui::HasUnsavedChangesPrompt
 HasUnsavedChangesPrompt (std::string &&title)
 
bool PromptClose (QWidget *parent=nullptr)
 Display dialog window containing a list (or tree) of widgets that contain unsaved changes. More...
 
- Public Member Functions inherited from SimShell::Gui::HasUnsavedChanges
 HasUnsavedChanges (std::string &&title)
 
virtual ~HasUnsavedChanges ()
 Virtual destructor.
 
ChildrenType::iterator begin ()
 Get iterator to first child.
 
ChildrenType::const_iterator begin () const
 Get iterator to first child.
 
ChildrenType::iterator end ()
 Get iterator to one position after last child.
 
ChildrenType::const_iterator end () const
 Get iterator to one position after last child.
 
void ForceClose ()
 Force this object and its children to go back to unopened state so it can be safely deleted.
 
const std::string & GetTitle ()
 Get title of this object.
 
bool IsClean () const
 
bool Save ()
 Try to save this widget's (and its children's) changes. More...
 
bool SaveAndClose ()
 Try to save this object (and its children) and, if successful, close them all.
 

Protected Member Functions

virtual void closeEvent (QCloseEvent *event)
 Re-implemented from QMainWindow. More...
 
virtual void InternalForceClose ()
 
virtual bool InternalIsClean () const
 
virtual bool InternalSave ()
 
- Protected Member Functions inherited from SimShell::Gui::HasUnsavedChanges
void AddChild (ChildrenType::value_type &&v)
 Add child.
 
virtual void InternalPreForceClose ()
 Additional things to do before closing children of this widget.
 
void SetChildren (ChildrenType &&c)
 Set children.
 

Additional Inherited Members

- Public Types inherited from SimShell::Gui::HasUnsavedChanges
typedef std::vector< HasUnsavedChanges * > ChildrenType
 

Detailed Description

Stand-alone Property Tree editor.

Definition at line 51 of file PTreeEditor.h.

Member Function Documentation

void SimPT_Shell::Gui::PTreeEditor::closeEvent ( QCloseEvent *  event)
protectedvirtual

Re-implemented from QMainWindow.

Closes file if file is opened, possibly displaying 'save changes?'-dialog. Event is accepted only if this results in the application remaining in an unopened state.

See also
QWidget::closeEvent

Definition at line 198 of file PTreeEditor.cpp.

void SimPT_Shell::Gui::PTreeEditor::InternalForceClose ( )
protectedvirtual
See also
HasUnsavedChanges

Implements SimShell::Gui::HasUnsavedChanges.

Definition at line 207 of file PTreeEditor.cpp.

bool SimPT_Shell::Gui::PTreeEditor::InternalIsClean ( ) const
protectedvirtual
See also
HasUnsavedChanges

Implements SimShell::Gui::HasUnsavedChanges.

Definition at line 220 of file PTreeEditor.cpp.

bool SimPT_Shell::Gui::PTreeEditor::InternalSave ( )
protectedvirtual
See also
HasUnsavedChanges

Implements SimShell::Gui::HasUnsavedChanges.

Definition at line 225 of file PTreeEditor.cpp.

bool SimPT_Shell::Gui::PTreeEditor::OpenPath ( std::string const &  path)

Open file.

If a file is already opened, it is closed first.

Parameters
pathPath to file to open.
Returns
true if succesful.

Definition at line 237 of file PTreeEditor.cpp.

bool SimPT_Shell::Gui::PTreeEditor::SavePath ( std::string const &  path)

Save opened file to a given path.

If no file is opened, nothing happens.

Parameters
pathPath to save file to.
Returns
true if application is in clean state and opened_path is equal to given argument.

Definition at line 415 of file PTreeEditor.cpp.


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