NameValueLabelPair.cpp
Go to the documentation of this file.
1 #include <DatabaseUtils/GUI/NameValueLabelPair.h>
2 #include <QtGui/QHBoxLayout>
3 
4 namespace dbutils {
5 namespace gui {
6 
9  QWidget(parent)
10 {
11  QHBoxLayout* hboxLayout = new QHBoxLayout;
12  hboxLayout->setContentsMargins(0,0,0,0);
13 
14  name.append(": ");
15  QLabel* nameLabel = new QLabel(tr(name.c_str()));
16  //nameLabel->setFrameStyle(QFrame::Box);
17  hboxLayout->addWidget(nameLabel);
18 
19  _valueLabel = new QLabel(tr("unknown"));
20  //_valueLabel->setFrameStyle(QFrame::Box);
21  _valueLabel->setStyleSheet("background: white");
22  _valueLabel->setContentsMargins(5, 0, 5, 0);
23  hboxLayout->addWidget(_valueLabel);
24 
25  hboxLayout->addStretch();
26 
27  this->setLayout(hboxLayout);
28 }
29 
31 {
32  _valueLabel->setText(value.c_str());
33 }
34 
35 } // end of namespace gui
36 } // end of namespace dbutils
NameValueLabelPair(std::string name, QWidget *parent=0)
const XML_Char * name
Definition: expat.h:151
const XML_Char int const XML_Char * value
Definition: expat.h:331
void setValue(const std::string &value)
enum BeamMode string