Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit e7618fbd authored by Laurent Montel's avatar Laurent Montel 😁

Add parent directly

parent 1f6a4342
......@@ -41,9 +41,8 @@ ConfigureTestDialog::ConfigureTestDialog(PimCommon::AutoCorrection *autoCorrecti
: QDialog(parent)
{
setWindowTitle(QStringLiteral("Configure Autocorrection"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
......@@ -52,7 +51,7 @@ ConfigureTestDialog::ConfigureTestDialog(PimCommon::AutoCorrection *autoCorrecti
buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
mWidget = new PimCommon::AutoCorrectionWidget;
mWidget = new PimCommon::AutoCorrectionWidget(this);
mainLayout->addWidget(mWidget);
mainLayout->addWidget(buttonBox);
......@@ -108,7 +107,7 @@ AutocorrectionTestWidget::AutocorrectionTestWidget(QWidget *parent)
PimCommon::PimCommonSettings::self()->load();
mAutoCorrection = new PimCommon::AutoCorrection;
QVBoxLayout *lay = new QVBoxLayout;
QVBoxLayout *lay = new QVBoxLayout(this);
QToolBar *bar = new QToolBar;
lay->addWidget(bar);
bar->addAction(QStringLiteral("Configure..."), this, SLOT(slotConfigure()));
......@@ -123,8 +122,6 @@ AutocorrectionTestWidget::AutocorrectionTestWidget(QWidget *parent)
mEdit = new TextEditAutoCorrectionWidget(mAutoCorrection);
lay->addWidget(mEdit);
setLayout(lay);
}
AutocorrectionTestWidget::~AutocorrectionTestWidget()
......
......@@ -33,19 +33,18 @@
CustomToolWidgetNgTest::CustomToolWidgetNgTest(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *lay = new QVBoxLayout;
QVBoxLayout *lay = new QVBoxLayout(this);
QToolBar *menu = new QToolBar;
QToolBar *menu = new QToolBar(this);
lay->addWidget(menu);
mCustomTools = new PimCommon::CustomToolsWidgetNg(new KActionCollection(this));
mCustomTools = new PimCommon::CustomToolsWidgetNg(new KActionCollection(this), this);
const QList<KToggleAction *> lst = mCustomTools->actionList();
for (KToggleAction *act : lst) {
menu->addAction(act);
}
lay->addWidget(mCustomTools);
setLayout(lay);
}
CustomToolWidgetNgTest::~CustomToolWidgetNgTest()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment