14 #include <QGridLayout> 15 #include <QVBoxLayout> 16 #include <QTableWidget> 25 toptopLayout =
new QVBoxLayout(
this);
26 toptopLayout->setMargin(0);
32 mTableWidget->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
37 toptopLayout->addStretch();
44 QStringList horizontalHeaders;
45 horizontalHeaders <<
"Description";
46 horizontalHeaders <<
"Value";
47 mTableWidget->setHorizontalHeaderLabels(horizontalHeaders);
48 mTableWidget->horizontalHeaderItem(0)->setTextAlignment(Qt::AlignLeft);
49 mTableWidget->horizontalHeaderItem(1)->setTextAlignment(Qt::AlignLeft);
54 boldFont.setBold(
true);
57 std::map<std::string, std::string>::iterator it;
58 for(it = info.begin(); it != info.end(); ++it)
60 QTableWidgetItem *descriptionItem =
new QTableWidgetItem(
qstring_cast(it->first));
61 descriptionItem->setFont(boldFont);
62 descriptionItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
65 QTableWidgetItem *valueItem =
new QTableWidgetItem(
qstring_cast(it->second));
66 valueItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
QString qstring_cast(const T &val)
Namespace for all CustusX production code.