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 d1b3dd2a authored by Laurent Montel's avatar Laurent Montel 😁

Assign parent directly. Remove setLayout(...) when not necessary

parent dcdc6643
......@@ -39,18 +39,17 @@ FollowUpReminderInfoDialog::FollowUpReminderInfoDialog(QWidget *parent)
{
setWindowTitle(i18n("Configure"));
setWindowIcon(QIcon::fromTheme(QStringLiteral("kmail")));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mWidget = new FollowUpReminderInfoWidget(this);
mWidget->setObjectName(QStringLiteral("FollowUpReminderInfoWidget"));
mainLayout->addWidget(mWidget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
connect(buttonBox, &QDialogButtonBox::accepted, this, &FollowUpReminderInfoDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &FollowUpReminderInfoDialog::reject);
mWidget = new FollowUpReminderInfoWidget;
mWidget->setObjectName(QStringLiteral("FollowUpReminderInfoWidget"));
mainLayout->addWidget(mWidget);
mainLayout->addWidget(buttonBox);
readConfig();
......
......@@ -67,9 +67,9 @@ FollowUpReminderInfoWidget::FollowUpReminderInfoWidget(QWidget *parent)
, mChanged(false)
{
setObjectName(QStringLiteral("FollowUpReminderInfoWidget"));
QHBoxLayout *hbox = new QHBoxLayout;
QHBoxLayout *hbox = new QHBoxLayout(this);
hbox->setMargin(0);
mTreeWidget = new QTreeWidget;
mTreeWidget = new QTreeWidget(this);
mTreeWidget->setObjectName(QStringLiteral("treewidget"));
QStringList headers;
headers << i18n("To")
......@@ -91,7 +91,6 @@ FollowUpReminderInfoWidget::FollowUpReminderInfoWidget(QWidget *parent)
connect(mTreeWidget, &QTreeWidget::customContextMenuRequested, this, &FollowUpReminderInfoWidget::customContextMenuRequested);
hbox->addWidget(mTreeWidget);
setLayout(hbox);
}
FollowUpReminderInfoWidget::~FollowUpReminderInfoWidget()
......
......@@ -28,14 +28,13 @@
ConfigureDialog::ConfigureDialog(QWidget *parent)
: QDialog(parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mConfigureWidget = new ConfigureWidget(this);
mConfigureWidget->setObjectName(QStringLiteral("configurewidget"));
mainLayout->addWidget(mConfigureWidget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonbox"));
mainLayout->addWidget(buttonBox);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
......
......@@ -37,9 +37,8 @@ SendLaterConfigureDialog::SendLaterConfigureDialog(QWidget *parent)
{
setWindowTitle(i18n("Configure"));
setWindowIcon(QIcon::fromTheme(QStringLiteral("kmail")));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
setLayout(mainLayout);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
......
......@@ -58,7 +58,6 @@ AddEmailToExistingContactDialog::AddEmailToExistingContactDialog(QWidget *parent
mEmailSelectionWidget = new Akonadi::EmailAddressSelectionWidget(false, model, this);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
setLayout(mainLayout);
mainLayout->addWidget(mEmailSelectionWidget);
mEmailSelectionWidget->view()->setSelectionMode(QAbstractItemView::SingleSelection);
readConfig();
......
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