diff --git a/kaccess/kaccess.cpp b/kaccess/kaccess.cpp --- a/kaccess/kaccess.cpp +++ b/kaccess/kaccess.cpp @@ -664,13 +664,11 @@ dialog->setObjectName(QStringLiteral("AccessXWarning")); dialog->setModal(true); - QWidget *topcontents = new QWidget(dialog); - topcontents->setLayout(new QVBoxLayout(topcontents)); + QVBoxLayout *topLayout = new QVBoxLayout(); - QWidget *contents = new QWidget(topcontents); - QHBoxLayout * lay = new QHBoxLayout(contents); + QHBoxLayout * lay = new QHBoxLayout(); - QLabel *label1 = new QLabel(contents); + QLabel *label1 = new QLabel(); QIcon icon = QIcon::fromTheme(QStringLiteral("dialog-warning")); if (icon.isNull()) icon = QMessageBox::standardIcon(QMessageBox::Warning); @@ -681,28 +679,31 @@ QVBoxLayout * vlay = new QVBoxLayout(); lay->addItem(vlay); - featuresLabel = new QLabel(QString(), contents); + featuresLabel = new QLabel(); featuresLabel->setAlignment(Qt::AlignVCenter); featuresLabel->setWordWrap(true); vlay->addWidget(featuresLabel); vlay->addStretch(); QHBoxLayout * hlay = new QHBoxLayout(); vlay->addItem(hlay); - QLabel *showModeLabel = new QLabel(i18n("&When a gesture was used:"), contents); + QLabel *showModeLabel = new QLabel(i18n("&When a gesture was used:")); hlay->addWidget(showModeLabel); - showModeCombobox = new KComboBox(contents); + showModeCombobox = new KComboBox(); hlay->addWidget(showModeCombobox); showModeLabel->setBuddy(showModeCombobox); showModeCombobox->insertItem(0, i18n("Change Settings Without Asking")); showModeCombobox->insertItem(1, i18n("Show This Confirmation Dialog")); showModeCombobox->insertItem(2, i18n("Deactivate All AccessX Features & Gestures")); showModeCombobox->setCurrentIndex(1); + topLayout->addLayout(lay); auto buttons = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::No, dialog); - lay->addWidget(buttons); + + topLayout->addWidget(buttons); + dialog->setLayout(topLayout); connect(buttons, &QDialogButtonBox::accepted, dialog, &QDialog::accept); connect(buttons, &QDialogButtonBox::rejected, dialog, &QDialog::reject);