35 #include <QGridLayout>
36 #include <QVBoxLayout>
37 #include <QTableWidget>
46 toptopLayout =
new QVBoxLayout(
this);
52 mTableWidget->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
57 toptopLayout->addStretch();
64 QStringList horizontalHeaders;
65 horizontalHeaders <<
"Description";
66 horizontalHeaders <<
"Value";
67 mTableWidget->setHorizontalHeaderLabels(horizontalHeaders);
68 mTableWidget->horizontalHeaderItem(0)->setTextAlignment(Qt::AlignLeft);
69 mTableWidget->horizontalHeaderItem(1)->setTextAlignment(Qt::AlignLeft);
74 boldFont.setBold(
true);
77 std::map<std::string, std::string>::iterator it;
78 for(it = info.begin(); it != info.end(); ++it)
80 QTableWidgetItem *descriptionItem =
new QTableWidgetItem(
qstring_cast(it->first));
81 descriptionItem->setFont(boldFont);
82 descriptionItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
85 QTableWidgetItem *valueItem =
new QTableWidgetItem(
qstring_cast(it->second));
86 valueItem->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
QString qstring_cast(const T &val)