27 #include <QFormLayout>
55 content =
new QGroupBox(
this);
56 content->setSizePolicy(
57 QSizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding));
58 contentLayout =
new QGridLayout();
59 content->setLayout(contentLayout);
62 QBoxLayout* boxLayout =
new QBoxLayout(QBoxLayout::TopToBottom,
this);
63 boxLayout->addWidget(content);
74 fullTitle =
"Properties for " + title;
75 content->setTitle(fullTitle);
81 QString fullLabel =
"<b>" + label +
": </b>";
82 auto rowCount = contentLayout->rowCount();
83 contentLayout->addWidget(
new QLabel(fullLabel), rowCount, 0);
84 contentLayout->addWidget(propertyWidget, rowCount, 1);
85 contentLayout->addItem(
new QSpacerItem(50, 10, QSizePolicy::Expanding), rowCount, 2);
91 auto rowCount = contentLayout->rowCount();
96 setProperty(
int row,
const QString& label,
const QString& text)
98 QString fullLabel =
"<b>" + label +
": </b>";
99 QLabel* textLabel =
new QLabel(
this);
100 textLabel->setText(text);
101 textLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
103 QLabel* labelLabel =
new QLabel(fullLabel);
105 contentLayout->addWidget(labelLabel, row, 0);
106 contentLayout->addWidget(textLabel, row, 1);
107 contentLayout->addItem(
new QSpacerItem(50, 10, QSizePolicy::Expanding), row, 2);
114 for (row = 0; row < contentLayout->rowCount(); ++row)
116 if (!contentLayout->itemAtPosition(row, 0))
120 QLabel* labelWidget =
121 qobject_cast<QLabel*>(contentLayout->itemAtPosition(row, 0)->widget());
126 qobject_cast<QLabel*>(contentLayout->itemAtPosition(row, 1)->widget());
129 textWidget->setText(text);
140 QString fullHeading =
"<b>" + heading +
": </b>";
141 QLabel* textLabel =
new QLabel(
this);
142 textLabel->setText(fullHeading);
143 textLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
145 auto rowCount = contentLayout->rowCount();
146 contentLayout->addWidget(textLabel, rowCount, 0, 1, 3);
152 auto rowCount = contentLayout->rowCount();
153 contentLayout->addWidget(widget, rowCount, 0, 1, 3);
162 return contentLayout;
167 QGridLayout* contentLayout;