Fix layout of RecordPanel
This commit is contained in:
parent
0dcee5f76c
commit
9dcca99e4c
2 changed files with 15 additions and 4 deletions
|
|
@ -132,7 +132,10 @@ void RecordPanel::rebuild()
|
|||
clearFields();
|
||||
|
||||
auto content = new QWidget;
|
||||
auto layout = new QFormLayout(content);
|
||||
auto outer = new QVBoxLayout(content);
|
||||
outer->setContentsMargins(0, 0, 0, 0);
|
||||
auto form = new QWidget(content);
|
||||
auto layout = new QFormLayout(form);
|
||||
layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
|
||||
|
||||
int row = m_rowIndex.row();
|
||||
|
|
@ -142,7 +145,7 @@ void RecordPanel::rebuild()
|
|||
QString name = newline < 0 ? header : header.left(newline);
|
||||
QString typeName = newline < 0 ? QString() : header.mid(newline + 1);
|
||||
|
||||
auto caption = new QWidget(content);
|
||||
auto caption = new QWidget(form);
|
||||
auto captionLayout = new QVBoxLayout(caption);
|
||||
captionLayout->setContentsMargins(0, 0, 0, 0);
|
||||
auto nameLabel = new QLabel(name, caption);
|
||||
|
|
@ -159,7 +162,7 @@ void RecordPanel::rebuild()
|
|||
QWidget *fieldWidget = nullptr;
|
||||
|
||||
if (isLongTextType(oid)) {
|
||||
auto container = new QWidget(content);
|
||||
auto container = new QWidget(form);
|
||||
auto containerLayout = new QVBoxLayout(container);
|
||||
containerLayout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
|
|
@ -189,7 +192,7 @@ void RecordPanel::rebuild()
|
|||
fieldWidget = container;
|
||||
}
|
||||
else {
|
||||
auto edit = new QLineEdit(content);
|
||||
auto edit = new QLineEdit(form);
|
||||
edit->setPlaceholderText(tr("null"));
|
||||
connect(edit, &QLineEdit::editingFinished, this, [this, edit]() { commitEditor(edit); });
|
||||
|
||||
|
|
@ -201,6 +204,9 @@ void RecordPanel::rebuild()
|
|||
m_fields.push_back(field);
|
||||
}
|
||||
|
||||
outer->addWidget(form);
|
||||
outer->addStretch(1);
|
||||
|
||||
setWidget(content);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue