35 #include <QGridLayout> 36 #include <QVBoxLayout> 37 #include <QTableWidget> 46 toptopLayout =
new QVBoxLayout(
this);
47 toptopLayout->setMargin(0);
53 mTableWidget->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
58 toptopLayout->addStretch();
65 QStringList horizontalHeaders;
66 horizontalHeaders <<
"Description";
67 horizontalHeaders <<
"Value";
68 mTableWidget->setHorizontalHeaderLabels(horizontalHeaders);
69 mTableWidget->horizontalHeaderItem(0)->setTextAlignment(Qt::AlignLeft);
70 mTableWidget->horizontalHeaderItem(1)->setTextAlignment(Qt::AlignLeft);
75 boldFont.setBold(
true);
78 std::map<std::string, std::string>::iterator it;
79 for(it = info.begin(); it != info.end(); ++it)
81 QTableWidgetItem *descriptionItem =
new QTableWidgetItem(
qstring_cast(it->first));
82 descriptionItem->setFont(boldFont);
83 descriptionItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
86 QTableWidgetItem *valueItem =
new QTableWidgetItem(
qstring_cast(it->second));
87 valueItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
QString qstring_cast(const T &val)
Namespace for all CustusX production code.