Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
Qt tree model for configuration variant registry. More...
#include <bayeux/datatools/configuration/ui/variant_registry_tree_model.h>
Public Slots | |
void | slot_broadcast_data_change (const QModelIndex &, const QModelIndex &) |
Slot: broadcast data change. More... | |
void | slot_store_to_restore_buffer (std::string *buffer_=0) |
Slot: store the current status to a buffer. More... | |
void | slot_load_from_restore_buffer (const std::string *buffer_=0) |
Slot: load the current status from a buffer. More... | |
void | slot_store_to_reg_file (const QString &out_reg_filename_) const |
Slot: store the current status to a file. More... | |
void | slot_load_from_reg_file (const QString &in_reg_filename_) |
Slot: load the current status from a file. More... | |
Signals | |
void | sig_read_only_changed (bool) |
void | sig_registry_name_changed () |
void | sig_logging_changed () |
void | sig_registry_changed (std::string) |
void | sig_registry_data_changed (std::string, std::string) |
Public Member Functions | |
variant_registry_tree_model (QObject *parent_=0) | |
Constructor. More... | |
virtual | ~variant_registry_tree_model () |
Destructor. More... | |
bool | has_root () const |
Check if the model has a root. More... | |
void | set_root (tree_item *node_) |
Set the root node. More... | |
tree_item * | grab_root () |
Return the root node/item. More... | |
const tree_item * | get_root () const |
Return the root node/item. More... | |
QModelIndex | rootIndex () const |
Return the model index associated to the root. More... | |
QModelIndex | index (int row_, int column_, const QModelIndex &parent_) const |
Return the model index associated to a given row, column and parent. More... | |
QModelIndex | parent (const QModelIndex &child_) const |
Return the parent model index associated to a child model index. More... | |
Qt::ItemFlags | flags (const QModelIndex &index_) const |
Return the flags associated to a model index. More... | |
int | rowCount (const QModelIndex &parent_) const |
Return the number of rows of a model index. More... | |
int | columnCount (const QModelIndex &parent_) const |
Return the number of columns of a model index. More... | |
QVariant | data (const QModelIndex &index_, int role_) const |
Return the value of the data associated to a given model index and role. More... | |
bool | setData (const QModelIndex &index_, const QVariant &value_, int role_=Qt::EditRole) |
Set the value of the data associated to a given model index and role. More... | |
bool | unsetData (const QModelIndex &index_, int role_=Qt::EditRole) |
Unset the value of the data associated to a given model index and role. More... | |
QVariant | headerData (int section_, Qt::Orientation orientation_, int role_) const |
Return the value of the header data associated to a given role. More... | |
void | construct (variant_registry ®istry_, const std::string ®istry_name_="") |
Construct the model from a registry and a registry name. More... | |
void | set_registry_name (const std::string ®istry_name_) |
Set the name of the registry. More... | |
const std::string & | get_registry_name () const |
void | set_logging (datatools::logger::priority p_) |
Set the logging priority. More... | |
datatools::logger::priority | get_logging () const |
Return the logging priority. More... | |
bool | is_read_only () const |
Check the read-only flag. More... | |
void | set_read_only (bool) |
Set the read-only flag. More... | |
bool | has_registry () const |
Check if a registry is handled. More... | |
variant_registry & | grab_registry () |
Return a reference to the mutable registry. More... | |
const variant_registry & | get_registry () const |
Return a reference to the non mutable registry. More... | |
bool | has_restore_buffer () const |
Check if a restore buffer is available. More... | |
void | reset_restore_buffer () |
Reset the restore buffer is available. More... | |
virtual void | tree_dump (std::ostream &out=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const |
Smart print. More... | |
tree_item * | node_from_index (const QModelIndex &index_) const |
Return the node/item associated to a given model index. More... | |
Public Member Functions inherited from datatools::i_tree_dumpable | |
i_tree_dumpable () | |
Constructor. More... | |
virtual | ~i_tree_dumpable () |
Destructor. More... | |
virtual void | print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const |
Main new interface method for printing. More... | |
void | print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const |
Printing with jsonized options. More... | |
void | print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const |
Printing with jsonized options. More... | |
void | tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const |
void | tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const |
void | smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const |
Static Public Member Functions | |
static const std::string & | default_top_label () |
Return the default label for top variant. More... | |
Static Public Member Functions inherited from datatools::i_tree_dumpable | |
static const boost::property_tree::ptree & | empty_options () |
static boost::property_tree::ptree | make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false) |
static std::ostream & | last_skip_tag (std::ostream &out_) |
static std::ostream & | skip_tag (std::ostream &out_) |
static std::ostream & | last_tag (std::ostream &out_) |
static std::ostream & | tag (std::ostream &out_) |
Additional Inherited Members | |
Public Types inherited from datatools::i_tree_dumpable | |
enum | ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 } |
Enumeration for standard output streams. More... | |
Qt tree model for configuration variant registry.
datatools::configuration::ui::variant_registry_tree_model::variant_registry_tree_model | ( | QObject * | parent_ = 0 | ) |
Constructor.
|
virtual |
Destructor.
int datatools::configuration::ui::variant_registry_tree_model::columnCount | ( | const QModelIndex & | parent_ | ) | const |
Return the number of columns of a model index.
void datatools::configuration::ui::variant_registry_tree_model::construct | ( | variant_registry & | registry_, |
const std::string & | registry_name_ = "" |
||
) |
Construct the model from a registry and a registry name.
QVariant datatools::configuration::ui::variant_registry_tree_model::data | ( | const QModelIndex & | index_, |
int | role_ | ||
) | const |
Return the value of the data associated to a given model index and role.
|
static |
Return the default label for top variant.
Qt::ItemFlags datatools::configuration::ui::variant_registry_tree_model::flags | ( | const QModelIndex & | index_ | ) | const |
Return the flags associated to a model index.
datatools::logger::priority datatools::configuration::ui::variant_registry_tree_model::get_logging | ( | ) | const |
Return the logging priority.
const variant_registry& datatools::configuration::ui::variant_registry_tree_model::get_registry | ( | ) | const |
Return a reference to the non mutable registry.
const std::string& datatools::configuration::ui::variant_registry_tree_model::get_registry_name | ( | ) | const |
Return the root node/item.
variant_registry& datatools::configuration::ui::variant_registry_tree_model::grab_registry | ( | ) |
Return a reference to the mutable registry.
tree_item* datatools::configuration::ui::variant_registry_tree_model::grab_root | ( | ) |
Return the root node/item.
bool datatools::configuration::ui::variant_registry_tree_model::has_registry | ( | ) | const |
Check if a registry is handled.
bool datatools::configuration::ui::variant_registry_tree_model::has_restore_buffer | ( | ) | const |
Check if a restore buffer is available.
bool datatools::configuration::ui::variant_registry_tree_model::has_root | ( | ) | const |
Check if the model has a root.
QVariant datatools::configuration::ui::variant_registry_tree_model::headerData | ( | int | section_, |
Qt::Orientation | orientation_, | ||
int | role_ | ||
) | const |
Return the value of the header data associated to a given role.
QModelIndex datatools::configuration::ui::variant_registry_tree_model::index | ( | int | row_, |
int | column_, | ||
const QModelIndex & | parent_ | ||
) | const |
Return the model index associated to a given row, column and parent.
bool datatools::configuration::ui::variant_registry_tree_model::is_read_only | ( | ) | const |
Check the read-only flag.
tree_item* datatools::configuration::ui::variant_registry_tree_model::node_from_index | ( | const QModelIndex & | index_ | ) | const |
Return the node/item associated to a given model index.
QModelIndex datatools::configuration::ui::variant_registry_tree_model::parent | ( | const QModelIndex & | child_ | ) | const |
Return the parent model index associated to a child model index.
void datatools::configuration::ui::variant_registry_tree_model::reset_restore_buffer | ( | ) |
Reset the restore buffer is available.
QModelIndex datatools::configuration::ui::variant_registry_tree_model::rootIndex | ( | ) | const |
Return the model index associated to the root.
int datatools::configuration::ui::variant_registry_tree_model::rowCount | ( | const QModelIndex & | parent_ | ) | const |
Return the number of rows of a model index.
void datatools::configuration::ui::variant_registry_tree_model::set_logging | ( | datatools::logger::priority | p_ | ) |
Set the logging priority.
void datatools::configuration::ui::variant_registry_tree_model::set_read_only | ( | bool | ) |
Set the read-only flag.
void datatools::configuration::ui::variant_registry_tree_model::set_registry_name | ( | const std::string & | registry_name_ | ) |
Set the name of the registry.
void datatools::configuration::ui::variant_registry_tree_model::set_root | ( | tree_item * | node_ | ) |
Set the root node.
bool datatools::configuration::ui::variant_registry_tree_model::setData | ( | const QModelIndex & | index_, |
const QVariant & | value_, | ||
int | role_ = Qt::EditRole |
||
) |
Set the value of the data associated to a given model index and role.
|
signal |
|
signal |
|
signal |
|
signal |
|
signal |
|
slot |
Slot: broadcast data change.
|
slot |
Slot: load the current status from a file.
|
slot |
Slot: load the current status from a buffer.
|
slot |
Slot: store the current status to a file.
|
slot |
Slot: store the current status to a buffer.
|
virtual |
Smart print.
Reimplemented from datatools::i_tree_dumpable.
bool datatools::configuration::ui::variant_registry_tree_model::unsetData | ( | const QModelIndex & | index_, |
int | role_ = Qt::EditRole |
||
) |
Unset the value of the data associated to a given model index and role.