Commit 96360b07 authored by Laurent Montel's avatar Laurent Montel 😁

Assign parent directly

parent fb024c43
......@@ -66,8 +66,7 @@ private:
ExportCertificatesDialog::Private::Private(ExportCertificatesDialog *qq)
: q(qq)
{
QVBoxLayout *mainLayout = new QVBoxLayout;
q->setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(q);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, qq);
mOkButton = buttonBox->button(QDialogButtonBox::Ok);
mOkButton->setDefault(true);
......
......@@ -53,10 +53,9 @@ class GenCardKeyDialog::Private
public:
Private(GenCardKeyDialog *qq): q(qq)
{
auto *vBox = new QVBoxLayout;
auto *vBox = new QVBoxLayout(q);
auto *grid = new QGridLayout;
vBox->addLayout(grid);
q->setLayout(vBox);
auto bbox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, qq);
......
......@@ -86,8 +86,7 @@ private:
setupUi(mainWidget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QVBoxLayout *mainLayout = new QVBoxLayout;
q->setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(q);
mainLayout->addWidget(mainWidget);
okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
......
......@@ -94,7 +94,7 @@ public:
QStringLiteral("</h2>")));
backH->addStretch(-1);
QVBoxLayout *vLay = new QVBoxLayout;
QVBoxLayout *vLay = new QVBoxLayout(q);
connect(backBtn, &QPushButton::clicked, q, [this] () {Q_EMIT (q->backRequested());});
......@@ -112,7 +112,6 @@ public:
vLay->addWidget(mPlaceHolderWidget);
vLay->addStretch(-1);
q->setLayout(vLay);
connect (ReaderStatus::instance(), &ReaderStatus::cardChanged, q, [this] (unsigned int /*slot*/) {
const auto cards = ReaderStatus::instance()->getCards();
......
......@@ -59,7 +59,7 @@ class WelcomeWidget::Private
public:
Private(WelcomeWidget *qq): q(qq)
{
auto vLay = new QVBoxLayout;
auto vLay = new QVBoxLayout(q);
auto hLay = new QHBoxLayout;
const QString welcome = i18nc("%1 is version", "Welcome to Kleopatra %1",
......@@ -118,8 +118,6 @@ public:
hLay->addStretch(-1);
hLay->addWidget(label);
hLay->addStretch(-1);
q->setLayout(vLay);
}
void import()
......
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