From 6cea6e84220cd40c05e43627909806f7043c5d61 Mon Sep 17 00:00:00 2001 From: Iceyer Date: Fri, 26 Oct 2018 17:50:23 +0800 Subject: [PATCH] fix: radio setting widget height error Change-Id: I756f22bc6815114905ec5d3593e393e1de247f48 --- src/widgets/dsettingsdialog.cpp | 2 +- src/widgets/dsettingswidgetfactory.cpp | 1 + src/widgets/private/settings/content.cpp | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/widgets/dsettingsdialog.cpp b/src/widgets/dsettingsdialog.cpp index b1c716994..1a0552958 100644 --- a/src/widgets/dsettingsdialog.cpp +++ b/src/widgets/dsettingsdialog.cpp @@ -80,7 +80,7 @@ DSettingsDialog::DSettingsDialog(QWidget *parent) : d->rightFrame = new QFrame; d->rightFrame->setObjectName("RightFrame"); d->rightLayout = new QVBoxLayout(d->rightFrame); - d->rightLayout->setContentsMargins(1, 5, 5, 0); + d->rightLayout->setContentsMargins(1, 0, 0, 0); d->rightLayout->setSpacing(0); d->content = new Content; diff --git a/src/widgets/dsettingswidgetfactory.cpp b/src/widgets/dsettingswidgetfactory.cpp index 16bcbbc69..45ac45ed5 100644 --- a/src/widgets/dsettingswidgetfactory.cpp +++ b/src/widgets/dsettingswidgetfactory.cpp @@ -408,6 +408,7 @@ QWidget *createRadioGroupOptionHandle(QObject *opt) } rightWidget->setStyleSheet("QGroupBox{border: none;}"); + optionWidget->setFixedHeight(24 * items.length() + 8); return optionWidget; } diff --git a/src/widgets/private/settings/content.cpp b/src/widgets/private/settings/content.cpp index c6b5feede..2a836fa78 100644 --- a/src/widgets/private/settings/content.cpp +++ b/src/widgets/private/settings/content.cpp @@ -196,7 +196,9 @@ void Content::updateSettings(const QByteArray &translateContext, QPointerwidgetFactory->createWidget(translateContext, option); + if (widget) { +// qDebug() << widget << widget->height(); d->contentLayout->addWidget(widget); widget->setParent(d->contentFrame); }