COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
Panel to view and modify options of an object. More...
#include <CentralPanel.hpp>
Inherits QWidget.
Public Slots | |
void | bt_apply_clicked () |
Slot called when user clicks on "Commit changes" button. More... | |
Public Member Functions | |
CentralPanel (QWidget *parent=nullptr) | |
Constructor. More... | |
~CentralPanel () | |
Destructor. More... | |
bool | is_modified () const |
Indicates wether at least one option has been modified. More... | |
void | list_modified_options (core::CommitDetails &commitDetails) const |
Build containers with modified options. More... | |
QString | current_path () const |
Gives the current path. More... | |
Private Slots | |
void | current_index_changed (const QModelIndex &newIndex, const QModelIndex &oldIndex) |
Slot called when the model current index changed. More... | |
void | advanced_mode_changed (bool advanced) |
Slot called when the model advanced status has changed. More... | |
void | data_changed (const QModelIndex &first, const QModelIndex &last) |
Slot called when data changed in the underlying model. More... | |
void | bt_see_changes_clicked () |
Slot called when user wants to see what options have been modified. More... | |
void | bt_forget_clicked () |
Slot called when user wants to clear all the changes. More... | |
void | value_changed () |
Slot called when an option value has been modified. More... | |
Private Member Functions | |
void | set_options (const QList< boost::shared_ptr< cf3::common::Option > > &list) |
Sets new graphical options. More... | |
void | set_buttons_visible (bool visible) |
Set the buttons to a visible/invisible state. More... | |
void | set_buttons_enabled (bool enabled) |
Set the buttons to a enabled/disabled state. More... | |
Private Attributes | |
QScrollArea * | m_scroll_basic_options |
Scroll area for basic options. More... | |
QScrollArea * | m_scroll_advanced_options |
Scroll area for advanced options. More... | |
OptionLayout * | m_basic_option_layout |
List containing basic options components. More... | |
OptionLayout * | m_advanced_option_layout |
List containing advanced options components. More... | |
QPushButton * | m_bt_apply |
Button used to commit changes made. More... | |
QPushButton * | m_bt_forget |
Button used to reset changes. More... | |
QPushButton * | m_bt_see_changes |
Button used to see changes made. More... | |
QGridLayout * | m_main_layout |
Main layout containing basic and advanced option panels. More... | |
QGroupBox * | m_gbox_basic_options |
Its layout is #m_basicOptionsLayout . More... | |
QGroupBox * | m_gbox_advanced_options |
Its layout is #m_advancedOptionsLayout . More... | |
bool | m_advanced_mode |
Indicates if the panel is in advanced mode or not. More... | |
QString | m_current_path |
The path of the component of which options are currently displayed. More... | |
QSplitter * | m_splitter |
Splitter between basic and advanced options. More... | |
Panel to view and modify options of an object.
This class allows user to display and modify options of an object.
Definition at line 46 of file CentralPanel.hpp.
CentralPanel | ( | QWidget * | parent = nullptr | ) |
Constructor.
Builds an CentralPanel
with no options. The panel is neither in read-only mode nor advanced mode.
parent | The parent widget. Default value is nullptr |
Definition at line 32 of file CentralPanel.cpp.
~CentralPanel | ( | ) |
Destructor.
Frees the allocated memory. Parent is not destroyed.
Definition at line 100 of file CentralPanel.cpp.
|
privateslot |
Slot called when the model advanced status has changed.
If status is advanced, the basic options layout is always visible, so that the user knows he is playing with advanced options. If the current option has no advanced option, the advanced option layout remains hidden.
advanced | If true , advanced options are showed up. |
Definition at line 268 of file CentralPanel.cpp.
|
slot |
Slot called when user clicks on "Commit changes" button.
If at least one option has been modified, changesMade
signal is emitted.
Definition at line 230 of file CentralPanel.cpp.
|
privateslot |
Slot called when user wants to clear all the changes.
Definition at line 315 of file CentralPanel.cpp.
|
privateslot |
Slot called when user wants to see what options have been modified.
Definition at line 304 of file CentralPanel.cpp.
|
privateslot |
Slot called when the model current index changed.
Options are replaced by the new ones.
newIndex | The new current index. |
oldIndex | The old current index. This parameter is not used. |
Definition at line 258 of file CentralPanel.cpp.
QString current_path | ( | ) | const |
Gives the current path.
Definition at line 197 of file CentralPanel.cpp.
|
privateslot |
Slot called when data changed in the underlying model.
This slot considers that only one index has changed, instead of a range. If the first
, the last
and the model current indexes are the same and valid, the option layouts are updated with the new options.
first | The first index of the range. |
last | The last index of the range. |
Definition at line 294 of file CentralPanel.cpp.
bool is_modified | ( | ) | const |
Indicates wether at least one option has been modified.
true
if at least one option has been modified. Definition at line 179 of file CentralPanel.cpp.
void list_modified_options | ( | core::CommitDetails & | commitDetails | ) | const |
Build containers with modified options.
This method allows to get old and new values of each modified option. The old value is the original one, that the option had when it was created. The new value is the current option value. All intermediate values (i.e. : if user modified several times the same option) are ignored.
commitDetails | The object where values will be stored. |
Definition at line 186 of file CentralPanel.cpp.
|
private |
Set the buttons to a enabled/disabled state.
enabled | If true , buttons are set to enabled. |
Definition at line 217 of file CentralPanel.cpp.
|
private |
Set the buttons to a visible/invisible state.
visible | If true , buttons are set to visible. |
Definition at line 208 of file CentralPanel.cpp.
|
private |
Sets new graphical options.
All existing options in the layouts are removed.
list | The list of options to set. Can be empty. |
Definition at line 125 of file CentralPanel.cpp.
|
privateslot |
Slot called when an option value has been modified.
Definition at line 322 of file CentralPanel.cpp.
|
private |
Indicates if the panel is in advanced mode or not.
If true
, the panel is in advanced mode. Advanced options() (if any) are displayed. Otherwise, they are m_hidden.
Definition at line 172 of file CentralPanel.hpp.
|
private |
List containing advanced options components.
Definition at line 140 of file CentralPanel.hpp.
|
private |
List containing basic options components.
Definition at line 137 of file CentralPanel.hpp.
|
private |
Button used to commit changes made.
Definition at line 143 of file CentralPanel.hpp.
|
private |
Button used to reset changes.
Definition at line 146 of file CentralPanel.hpp.
|
private |
Button used to see changes made.
Definition at line 149 of file CentralPanel.hpp.
|
private |
The path of the component of which options are currently displayed.
Definition at line 175 of file CentralPanel.hpp.
|
private |
Its layout is #m_advancedOptionsLayout
.
Groupbox used to display advanced options() components with a titled border.
Definition at line 166 of file CentralPanel.hpp.
|
private |
Its layout is #m_basicOptionsLayout
.
Groupbox used to display basic options() components with a titled border.
Definition at line 160 of file CentralPanel.hpp.
|
private |
Main layout containing basic and advanced option panels.
This layout is composed of three lines and one column.
Definition at line 154 of file CentralPanel.hpp.
|
private |
Scroll area for advanced options.
Definition at line 134 of file CentralPanel.hpp.
|
private |
Scroll area for basic options.
Definition at line 131 of file CentralPanel.hpp.
|
private |
Splitter between basic and advanced options.
Definition at line 178 of file CentralPanel.hpp.
Send comments to: COOLFluiD Web Admin |