This class manages the tree view.
More...
#include <TreeView.hpp>
Inherits QTreeView.
|
bool | confirm_change_options (const QModelIndex &index, bool okIfSameIndex=false) |
| Asks user to commit or rollback before changing options() in options() panel. More...
|
|
This class manages the tree view.
- Author
- Gasper Quentin
Definition at line 46 of file TreeView.hpp.
Constructor.
- Parameters
-
optionsPanel | Panel options() of the selected node will be displayed. |
parent | Parent window. May be nullptr . |
- Exceptions
-
std::invalid_argument | if optionsPanel is nullptr . |
Definition at line 41 of file TreeView.cpp.
Destructor.
Frees all allocated memory. Neither the options() panel nor the parent are destroyed.
Definition at line 79 of file TreeView.cpp.
bool confirm_change_options |
( |
const QModelIndex & |
index, |
|
|
bool |
okIfSameIndex = false |
|
) |
| |
|
private |
Asks user to commit or rollback before changing options() in options() panel.
If modifications were committed, nothing is asked and the method immediately returns true
. If the commit is requested by the user, it is processed by this method.
- Parameters
-
index | Node index on which user clicked. If it is equals to #currentIndexInPanel nothing is asked and the method immediately returns true . |
okIfSameIndex | If false , the method checks if indexes are the same. If true , no check is done. |
- Returns
- Returns
false
if the user clicked on "Cancel" ; otherwise returns true
.
Definition at line 266 of file TreeView.cpp.
void current_index_changed |
( |
const QModelIndex & |
newIndex, |
|
|
const QModelIndex & |
oldIndex |
|
) |
| |
|
privateslot |
QIcon icon_from_index |
( |
const QModelIndex & |
index | ) |
|
bool is_read_only |
( |
| ) |
const |
Indicates whether the tree m_view is in read-only mode or not.
- Returns
- Returns
true
if the tree m_view is in read-only mode. Otherwise, returns false
.
Definition at line 93 of file TreeView.cpp.
void item_double_clicked |
( |
const QModelIndex & |
index | ) |
|
|
signal |
void keyPressEvent |
( |
QKeyEvent * |
event | ) |
|
|
protectedvirtual |
void mouseDoubleClickEvent |
( |
QMouseEvent * |
event | ) |
|
|
protectedvirtual |
void mousePressEvent |
( |
QMouseEvent * |
event | ) |
|
|
protectedvirtual |
Method called when a mouse button is pressed in the Client.
This method overloads parent class method. Four cases are possible :
- If user right-clicks, a context menu is displayed.
- If user left-clicks on another node than the currently selected one and
confirmChangeOptions()
returns true
, options() in the options() panel are changed.
- If user left-clicks on the selected node nothing is done.
- Middle button has no effect.
- Parameters
-
Definition at line 175 of file TreeView.cpp.
URI path_from_index |
( |
const QModelIndex & |
index | ) |
|
URI selected_path |
( |
| ) |
const |
void set_filter |
( |
const QString & |
pattern | ) |
|
void set_read_only |
( |
bool |
readOnly | ) |
|
Changes the read-only mode.
- Parameters
-
readOnly | If true , the tree m_view will switch to the read-only mode. |
Definition at line 86 of file TreeView.cpp.
QStringList m_abstract_types |
|
private |
Panel used to display and modify options() for a selected object.
Definition at line 120 of file TreeView.hpp.
bool m_context_menu_allowed |
|
private |
Filter for the Client.
Allows to switch between basic/advanced mode. The filter is used as the Client model. Its source is the tree model.
Definition at line 129 of file TreeView.hpp.
Indicates whether the tree m_view is in read-only mode or not.
If true
, the tree m_view is read-only mode. When it is read-only mode, all options() in the context that may modify an object are disbaled. "Delete", "Rename", "Add a child node" and "Add an option" m_items are then disabled.
Definition at line 137 of file TreeView.hpp.
The documentation for this class was generated from the following files: