Public Member Functions | List of all members
dbutils::gui::NamedConfigTree Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-02/DatabaseUtils/cxx/include/GUI/NamedConfigTree.h"

Inheritance diagram for dbutils::gui::NamedConfigTree:

Public Member Functions

 NamedConfigTree (QWidget *parent=0)
 
void loadData (dbutils::daqconfig::NamedConfigUtils::GlobalNameSpecMap nameSpecMap)
 
std::string getSelectedConfigName () const
 
std::string getSelectedDCMOpMode () const
 
std::string getSelectedTime () const
 

Detailed Description

Author
Kurt Biery
Version
Revision
1.1.24.1
Date
2019/09/27 00:07:04

Definition at line 17 of file NamedConfigTree.h.

Constructor & Destructor Documentation

dbutils::gui::NamedConfigTree::NamedConfigTree ( QWidget *  parent = 0)

Creates the tree display for editing configuration data from a single database table.

Definition at line 14 of file NamedConfigTree.cpp.

References loadData().

14  : QTreeView(parent)
15 {
16  this->setAlternatingRowColors(true);
17  this->setSelectionBehavior(QAbstractItemView::SelectItems);
18  this->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
19  this->setAnimated(false);
20  this->setAllColumnsShowFocus(true);
21  this->setSelectionBehavior(QAbstractItemView::SelectRows);
22 }

Member Function Documentation

std::string dbutils::gui::NamedConfigTree::getSelectedConfigName ( ) const

Definition at line 52 of file NamedConfigTree.cpp.

References dbutils::gui::NamedConfigDataModel::data().

Referenced by dbutils::gui::ConfigSelectionDialog::getSelectedConfigName().

53 {
54  NamedConfigDataModel *model =
55  static_cast<NamedConfigDataModel *>(this->model());
56  if (model == 0) {return "";}
57 
58  QModelIndex currentIndex = this->selectionModel()->currentIndex();
59  if (! currentIndex.isValid()) {return "";}
60  QModelIndex columnIndex = currentIndex.sibling(currentIndex.row(),0);
61  if (! columnIndex.isValid()) {return "";}
62 
63  return model->data(columnIndex).toString().toStdString();
64 }
const XML_Char XML_Content * model
Definition: expat.h:151
std::string dbutils::gui::NamedConfigTree::getSelectedDCMOpMode ( ) const

Definition at line 66 of file NamedConfigTree.cpp.

References dbutils::gui::NamedConfigDataModel::data().

Referenced by dbutils::gui::ConfigSelectionDialog::getSelectedDCMOpMode().

67 {
68  NamedConfigDataModel *model =
69  static_cast<NamedConfigDataModel *>(this->model());
70  if (model == 0) {return "";}
71 
72  QModelIndex currentIndex = this->selectionModel()->currentIndex();
73  if (! currentIndex.isValid()) {return "";}
74  QModelIndex columnIndex = currentIndex.sibling(currentIndex.row(),1);
75  if (! columnIndex.isValid()) {return "";}
76 
77  return model->data(columnIndex).toString().toStdString();
78 }
const XML_Char XML_Content * model
Definition: expat.h:151
std::string dbutils::gui::NamedConfigTree::getSelectedTime ( ) const

Definition at line 80 of file NamedConfigTree.cpp.

References dbutils::gui::NamedConfigDataModel::data().

Referenced by dbutils::gui::ConfigSelectionDialog::getSelectedTime().

81 {
82  NamedConfigDataModel *model =
83  static_cast<NamedConfigDataModel *>(this->model());
84  if (model == 0) {return "";}
85 
86  QModelIndex currentIndex = this->selectionModel()->currentIndex();
87  if (! currentIndex.isValid()) {return "";}
88  QModelIndex columnIndex = currentIndex.sibling(currentIndex.row(),2);
89  if (! columnIndex.isValid()) {return "";}
90 
91  return model->data(columnIndex).toString().toStdString();
92 }
const XML_Char XML_Content * model
Definition: expat.h:151
void dbutils::gui::NamedConfigTree::loadData ( dbutils::daqconfig::NamedConfigUtils::GlobalNameSpecMap  nameSpecMap)

Definition at line 25 of file NamedConfigTree.cpp.

References dbutils::gui::NamedConfigDataModel::columnCount(), dbutils::gui::NamedConfigDataModel::index(), and dbutils::gui::NamedConfigDataModel::loadData().

Referenced by dbutils::gui::ConfigSelectionDialog::ConfigSelectionDialog(), and NamedConfigTree().

26 {
27  NamedConfigDataModel *model =
28  static_cast<NamedConfigDataModel *>(this->model());
29 
30  if (model == 0) {
31  model = new NamedConfigDataModel(this);
32  model->loadData(nameSpecMap);
33  this->setModel(model);
34  }
35  else {
36  model->loadData(nameSpecMap);
37  }
38 
39  this->expandAll();
40  for (int column = 0; column < model->columnCount(); ++column) {
41  this->resizeColumnToContents(column);
42  }
43  this->collapseAll();
44  //this->expandToDepth(-1);
45 
46  QModelIndex firstRow = model->index(0, 0);
47  if (firstRow.isValid()) {
48  this->setCurrentIndex(firstRow);
49  }
50 }
const XML_Char XML_Content * model
Definition: expat.h:151

The documentation for this class was generated from the following files: