summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-10-23 12:01:47 (GMT)
committerMontel Laurent <montel@kde.org>2016-10-23 12:02:02 (GMT)
commit8b879db57b6093fffe84e5a707736fa794cbcacd (patch)
tree96e7fa772e9343ddd4341797acd8c305da927c62
parentbc1d1c83c1b8b5b3a6710617c7e15e68f81e1dee (diff)
Add parent
-rw-r--r--plugins/customtoolsplugins/shorturlplugin/shorturl/shorturlconfigurewidget.cpp7
-rw-r--r--plugins/customtoolsplugins/shorturlplugin/shorturl/shorturlwidgetng.cpp21
-rw-r--r--plugins/customtoolsplugins/translatorplugin/translatorview.cpp3
3 files changed, 15 insertions, 16 deletions
diff --git a/plugins/customtoolsplugins/shorturlplugin/shorturl/shorturlconfigurewidget.cpp b/plugins/customtoolsplugins/shorturlplugin/shorturl/shorturlconfigurewidget.cpp
index f4c0a93..c7f29b6 100644
--- a/plugins/customtoolsplugins/shorturlplugin/shorturl/shorturlconfigurewidget.cpp
+++ b/plugins/customtoolsplugins/shorturlplugin/shorturl/shorturlconfigurewidget.cpp
@@ -47,16 +47,15 @@ ShortUrlConfigureWidget::ShortUrlConfigureWidget(QWidget *parent)
: QWidget(parent),
d(new ShortUrlConfigureWidgetPrivate)
{
- QHBoxLayout *lay = new QHBoxLayout;
+ QHBoxLayout *lay = new QHBoxLayout(this);
lay->setMargin(0);
- QLabel *lab = new QLabel(i18n("Select Short URL server:"));
+ QLabel *lab = new QLabel(i18n("Select Short URL server:"), this);
lay->addWidget(lab);
- d->mShortUrlServer = new QComboBox;
+ d->mShortUrlServer = new QComboBox(this);
connect(d->mShortUrlServer, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &ShortUrlConfigureWidget::slotChanged);
lay->addWidget(d->mShortUrlServer);
- setLayout(lay);
init();
loadConfig();
}
diff --git a/plugins/customtoolsplugins/shorturlplugin/shorturl/shorturlwidgetng.cpp b/plugins/customtoolsplugins/shorturlplugin/shorturl/shorturlwidgetng.cpp
index 57db016..a2407ea 100644
--- a/plugins/customtoolsplugins/shorturlplugin/shorturl/shorturlwidgetng.cpp
+++ b/plugins/customtoolsplugins/shorturlplugin/shorturl/shorturlwidgetng.cpp
@@ -47,9 +47,8 @@ ShortUrlWidgetNg::ShortUrlWidgetNg(QWidget *parent)
mShorturlServiceName(Q_NULLPTR),
mCurrentEngine(Q_NULLPTR)
{
- QGridLayout *grid = new QGridLayout;
+ QGridLayout *grid = new QGridLayout(this);
grid->setMargin(2);
- setLayout(grid);
QToolButton *closeBtn = new QToolButton(this);
closeBtn->setIcon(QIcon::fromTheme(QStringLiteral("dialog-close")));
@@ -63,14 +62,14 @@ ShortUrlWidgetNg::ShortUrlWidgetNg(QWidget *parent)
grid->addWidget(closeBtn, 0, 0);
- mIndicatorLabel = new KPIM::ProgressIndicatorLabel(i18n("Generating short URL..."));
+ mIndicatorLabel = new KPIM::ProgressIndicatorLabel(i18n("Generating short URL..."), this);
grid->addWidget(mIndicatorLabel, 0, 1);
- QPushButton *configure = new QPushButton(i18n("Configure..."));
+ QPushButton *configure = new QPushButton(i18n("Configure..."), this);
connect(configure, &QPushButton::clicked, this, &ShortUrlWidgetNg::slotConfigure);
grid->addWidget(configure, 0, 2);
- mShorturlServiceName = new QLabel(/*mEngine->shortUrlName()*/);
+ mShorturlServiceName = new QLabel(/*mEngine->shortUrlName()*/this);
grid->addWidget(mShorturlServiceName, 1, 1);
mConvertButton = new QPushButton(i18n("Convert"));
@@ -81,29 +80,29 @@ ShortUrlWidgetNg::ShortUrlWidgetNg(QWidget *parent)
connect(mInsertShortUrl, &QPushButton::clicked, this, &ShortUrlWidgetNg::slotInsertShortUrl);
grid->addWidget(mInsertShortUrl, 2, 2);
- QLabel *lab = new QLabel(i18n("Original URL:"));
+ QLabel *lab = new QLabel(i18n("Original URL:"), this);
grid->addWidget(lab, 3, 0);
- mOriginalUrl = new KLineEdit;
+ mOriginalUrl = new KLineEdit(this);
mOriginalUrl->setClearButtonEnabled(true);
mOriginalUrl->setTrapReturnKey(true);
connect(mOriginalUrl, &KLineEdit::textChanged, this, &ShortUrlWidgetNg::slotOriginalUrlChanged);
connect(mOriginalUrl, &KLineEdit::returnPressed, this, &ShortUrlWidgetNg::slotConvertUrl);
grid->addWidget(mOriginalUrl, 3, 1);
- mCopyToClipboard = new QPushButton(i18n("Copy to clipboard"));
+ mCopyToClipboard = new QPushButton(i18n("Copy to clipboard"), this);
connect(mCopyToClipboard, &QPushButton::clicked, this, &ShortUrlWidgetNg::slotPasteToClipboard);
grid->addWidget(mCopyToClipboard, 3, 2);
- lab = new QLabel(i18n("Short URL:"));
+ lab = new QLabel(i18n("Short URL:"), this);
grid->addWidget(lab, 4, 0);
- mShortUrl = new QLineEdit;
+ mShortUrl = new QLineEdit(this);
connect(mShortUrl, &QLineEdit::textChanged, this, &ShortUrlWidgetNg::slotShortUrlChanged);
mShortUrl->setReadOnly(true);
grid->addWidget(mShortUrl, 4, 1);
- mOpenShortUrl = new QPushButton(i18n("Open Short URL"));
+ mOpenShortUrl = new QPushButton(i18n("Open Short URL"), this);
connect(mOpenShortUrl, &QPushButton::clicked, this, &ShortUrlWidgetNg::slotOpenShortUrl);
grid->addWidget(mOpenShortUrl, 4, 2);
diff --git a/plugins/customtoolsplugins/translatorplugin/translatorview.cpp b/plugins/customtoolsplugins/translatorplugin/translatorview.cpp
index 2c78a9e..418a817 100644
--- a/plugins/customtoolsplugins/translatorplugin/translatorview.cpp
+++ b/plugins/customtoolsplugins/translatorplugin/translatorview.cpp
@@ -27,7 +27,8 @@
TranslatorView::TranslatorView(KActionCollection *ac, QWidget *parent)
: PimCommon::CustomToolsViewInterface(parent),
- mAction(Q_NULLPTR)
+ mAction(Q_NULLPTR),
+ mTranslatorWidget(Q_NULLPTR)
{
QHBoxLayout *layout = new QHBoxLayout;
layout->setMargin(0);