Commit b99be61d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use auto + add parent

parent 1d02fd1a
Pipeline #51762 passed with stage
in 54 minutes and 28 seconds
......@@ -17,10 +17,9 @@ MailMergeDialog::MailMergeDialog(QWidget *parent)
: QDialog(parent)
, mMailMergeWidget(new MailMergeWidget(this))
{
auto mainLayout = new QVBoxLayout(this);
setWindowTitle(i18nc("@title:window", "Mail Merge"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
mMailMergeWidget->setObjectName(QStringLiteral("mailmergewidget"));
......
......@@ -12,7 +12,7 @@ using namespace MailMerge;
AddressBookWidget::AddressBookWidget(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *mainLayout = new QHBoxLayout(this);
auto mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
}
......
......@@ -17,11 +17,11 @@ CsvWidget::CsvWidget(QWidget *parent)
: QWidget(parent)
, mCvsUrlRequester(new KUrlRequester(this))
{
QVBoxLayout *csvWidgetLayout = new QVBoxLayout(this);
auto csvWidgetLayout = new QVBoxLayout(this);
csvWidgetLayout->setObjectName(QStringLiteral("csvWidgetLayout"));
csvWidgetLayout->setContentsMargins({});
QLabel *lab = new QLabel(i18n("Path:"), this);
auto lab = new QLabel(i18n("Path:"), this);
lab->setObjectName(QStringLiteral("label"));
csvWidgetLayout->addWidget(lab);
mCvsUrlRequester->setObjectName(QStringLiteral("cvsurlrequester"));
......
......@@ -27,12 +27,12 @@ MailMergeWidget::MailMergeWidget(QWidget *parent)
, mCsvWidget(new MailMerge::CsvWidget(this))
, mAddressbookWidget(new MailMerge::AddressBookWidget(this))
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QHBoxLayout *hbox = new QHBoxLayout;
auto hbox = new QHBoxLayout;
mainLayout->addLayout(hbox);
QLabel *lab = new QLabel(i18n("Source:"), this);
auto lab = new QLabel(i18n("Source:"), this);
hbox->addWidget(lab);
mSource->setObjectName(QStringLiteral("source"));
......
......@@ -17,17 +17,17 @@ SelectAttachmentDialog::SelectAttachmentDialog(QWidget *parent)
{
setWindowTitle(i18nc("@title:window", "Attachment"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
auto mainLayout = new QVBoxLayout(this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
QWidget *w = new QWidget;
QVBoxLayout *vbox = new QVBoxLayout;
auto w = new QWidget;
auto vbox = new QVBoxLayout;
w->setLayout(vbox);
QLabel *lab = new QLabel(i18n("Select attachment:"));
auto lab = new QLabel(i18n("Select attachment:"), this);
lab->setObjectName(QStringLiteral("selectattachment_label"));
vbox->addWidget(lab);
mUrlRequester = new KUrlRequester(this);
......
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