VPTissue Reference Manual
|
A menu reflecting the structure of a ptree. More...
#include <PTreeMenu.h>
Signals | |
void | ItemTriggered (QString const &subtree=QString()) |
Public Member Functions | |
PTreeMenu (QString const &title, QString const &path_prefix=QString(), QWidget *parent=0) | |
virtual | ~PTreeMenu () |
Destructor does not do a thing, except be virtual. | |
virtual bool | IsOpened () const |
Test whether menu is in opened state. | |
bool | OpenPTree (boost::property_tree::ptree const &pt, int depth=-1) |
Open a ptree. 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 | 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 |
A menu reflecting the structure of a ptree.
Given a ptree, this class constructs a hierarchical menu reflecting the ptree structure. Each subtree can be selected, causing the menu to emit the ItemTriggered() signal.
Definition at line 39 of file PTreeMenu.h.
SimShell::Gui::PTreeMenu::PTreeMenu | ( | QString const & | title, |
QString const & | path_prefix = QString() , |
||
QWidget * | parent = 0 |
||
) |
title | Menu title. Will also be used as dock widget title. |
parent | Parent widget. |
Definition at line 34 of file PTreeMenu.cpp.
|
protectedvirtual |
Implements SimShell::Gui::HasUnsavedChanges.
Definition at line 55 of file PTreeMenu.cpp.
|
protectedvirtual |
Implements SimShell::Gui::HasUnsavedChanges.
Definition at line 67 of file PTreeMenu.cpp.
|
protectedvirtual |
Implements SimShell::Gui::HasUnsavedChanges.
Definition at line 72 of file PTreeMenu.cpp.
bool SimShell::Gui::PTreeMenu::OpenPTree | ( | boost::property_tree::ptree const & | pt, |
int | depth = -1 |
||
) |
Open a ptree.
Menu will reflect hierarchical structure of the ptree.
pt | PTree to display in menu. |
depth | Maximum depth of submenu hierarchy. If depth = -1, there is no maximum depth. |
Definition at line 82 of file PTreeMenu.cpp.
References SimShell::Gui::HasUnsavedChanges::SaveAndClose().
Referenced by SimShell::Gui::PTreeContainer::Open().