Commit 8fb5f4f4 authored by Laurent Montel's avatar Laurent Montel 😁

Add parent directly

parent 5d2ed64c
......@@ -87,9 +87,9 @@ ContactGroupEditorDialog::ContactGroupEditorDialog(Mode mode, QWidget *parent)
, d(new Private(this, mode))
{
setWindowTitle(mode == CreateMode ? i18n("New Contact Group") : i18n("Edit Contact Group"));
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);
d->okButton = buttonBox->button(QDialogButtonBox::Ok);
d->okButton->setDefault(true);
d->okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
......
......@@ -43,9 +43,9 @@ ContactGroupViewerDialog::ContactGroupViewerDialog(QWidget *parent)
, d(new Private)
{
setWindowTitle(i18n("Show Contact Group"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok, this);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
......
......@@ -70,11 +70,10 @@ ContactViewerDialog::ContactViewerDialog(QWidget *parent)
, d(new Private(this))
{
setWindowTitle(i18n("Show Contact"));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
QWidget *mainWidget = new QWidget(this);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
mainLayout->addWidget(mainWidget);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
......
......@@ -45,8 +45,7 @@ AddressLocationWidget::AddressLocationWidget(QWidget *parent)
mCurrentAddress(-1),
mCurrentMode(CreateAddress)
{
QVBoxLayout *topLayout = new QVBoxLayout;
setLayout(topLayout);
QVBoxLayout *topLayout = new QVBoxLayout(this);
QGridLayout *gridLayout = new QGridLayout;
topLayout->addLayout(gridLayout);
......
......@@ -31,10 +31,9 @@ using namespace Akonadi;
MailListWidget::MailListWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *topLayout = new QVBoxLayout;
QVBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->setMargin(0);
topLayout->setSpacing(0);
setLayout(topLayout);
QLabel *label = new QLabel(i18n("Email"), this);
label->setObjectName(QStringLiteral("emaillistlabel"));
......
......@@ -31,10 +31,9 @@ using namespace Akonadi;
MessagingListWidget::MessagingListWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *topLayout = new QVBoxLayout;
QVBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->setMargin(0);
topLayout->setSpacing(0);
setLayout(topLayout);
QLabel *label = new QLabel(i18n("Messaging"), this);
label->setObjectName(QStringLiteral("messaginglistlabel"));
......
......@@ -36,7 +36,7 @@ NameEditDialog::NameEditDialog(QWidget *parent)
{
setWindowTitle(i18n("Edit Contact Name"));
QVBoxLayout *mainLayout = new QVBoxLayout;
QVBoxLayout *mainLayout = new QVBoxLayout(this);
setLayout(mainLayout);
QFormLayout *layout = new QFormLayout;
......
......@@ -31,10 +31,9 @@ using namespace Akonadi;
PhoneListWidget::PhoneListWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *topLayout = new QVBoxLayout;
QVBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->setMargin(0);
topLayout->setSpacing(0);
setLayout(topLayout);
QLabel *label = new QLabel(i18n("Phone"), this);
label->setObjectName(QStringLiteral("phonelistlabel"));
......
......@@ -32,10 +32,9 @@ using namespace Akonadi;
WebListWidget::WebListWidget(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *topLayout = new QVBoxLayout;
QVBoxLayout *topLayout = new QVBoxLayout(this);
topLayout->setMargin(0);
topLayout->setSpacing(0);
setLayout(topLayout);
QLabel *label = new QLabel(i18n("Web"), this);
label->setObjectName(QStringLiteral("weblistlabel"));
......
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