VPTissue Reference Manual
|
Abstraction of workspace on the filesystem. More...
#include <WorkspaceQtModel.h>
Public Types | |
enum | ItemType { RootType, ProjectType, FileType } |
Public Member Functions | |
bool | Close () |
Close a project if opened. More... | |
bool | Close (const QModelIndex &index) |
Close project with given index. More... | |
virtual int | columnCount (QModelIndex const &parent=QModelIndex()) const |
virtual QVariant | data (QModelIndex const &index, int role=Qt::DisplayRole) const |
virtual Qt::ItemFlags | flags (QModelIndex const &index) const |
std::vector< QAction * > | GetContextMenuActions (const QModelIndex &index) const |
Get additional context menu actions specific to the selected index. More... | |
const std::string & | GetName (QModelIndex const &index) const |
Get name of given index. More... | |
ItemType | GetType (QModelIndex const &index) const |
Get type of given index. More... | |
virtual QVariant | headerData (int section, Qt::Orientation, int role) const |
virtual QModelIndex | index (int row, int column, QModelIndex const &parent=QModelIndex()) const |
virtual bool | insertRow (int row, QModelIndex const &parent=QModelIndex()) |
virtual bool | insertRows (int row, int count, QModelIndex const &parent=QModelIndex()) |
bool | IsOpened (const QModelIndex &index) const |
bool | Open (const QModelIndex &index) |
virtual QModelIndex | parent (QModelIndex const &index) const |
virtual bool | removeRow (int row, QModelIndex const &parent=QModelIndex()) |
virtual bool | removeRows (int row, int count, QModelIndex const &parent=QModelIndex()) |
virtual int | rowCount (QModelIndex const &parent=QModelIndex()) const |
std::shared_ptr< IWorkspace > | Workspace () |
Static Public Member Functions | |
static std::shared_ptr< WorkspaceQtModel > | Create (const std::shared_ptr< IWorkspace > &, Controller::ProjectController *c, QObject *parent=0) |
Abstraction of workspace on the filesystem.
Intended to be used with WorkspaceView widget. Once initiated, will 'watch' filesystem for changes. Uses Workspace template classes internally.
Definition at line 49 of file WorkspaceQtModel.h.
bool SimShell::Gui::WorkspaceQtModel::Close | ( | ) |
Close a project if opened.
Definition at line 95 of file WorkspaceQtModel.cpp.
bool SimShell::Gui::WorkspaceQtModel::Close | ( | const QModelIndex & | index | ) |
Close project with given index.
index | Index of project to close. |
Definition at line 100 of file WorkspaceQtModel.cpp.
vector< QAction * > SimShell::Gui::WorkspaceQtModel::GetContextMenuActions | ( | const QModelIndex & | index | ) | const |
Get additional context menu actions specific to the selected index.
Index must be valid and pointing to a project or file or an error will be thrown.
index | VALID index of which to get context menu actions. |
Exception | if index is invalid. See QModelIndex::isValid(). |
Definition at line 244 of file WorkspaceQtModel.cpp.
string const & SimShell::Gui::WorkspaceQtModel::GetName | ( | QModelIndex const & | index | ) | const |
Get name of given index.
Index must be valid and pointing to a project or file or an error will be thrown. Root is never visible and should not be tested for by external users of this class.
index | VALID index of which we want to know the type. |
Exception | if index is invalid. See QModelIndex::isValid(). |
Definition at line 261 of file WorkspaceQtModel.cpp.
WorkspaceQtModel::ItemType SimShell::Gui::WorkspaceQtModel::GetType | ( | QModelIndex const & | index | ) | const |
Get type of given index.
Index must be valid or an error will be thrown. An item of this model can be of three types: Root, Project and Leaf. Root is never visible and should not be tested for by external users of this class.
index | VALID index of which we want to know the type. |
Exception | if index is invalid. See QModelIndex::isValid(). |
Definition at line 278 of file WorkspaceQtModel.cpp.