Commit ecd0f24c authored by Laurent Montel's avatar Laurent Montel 😁

Assign parent directly

parent 3c31690b
......@@ -32,8 +32,7 @@
TestMailDndAttachment::TestMailDndAttachment(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *vbox = new QVBoxLayout;
setLayout(vbox);
QVBoxLayout *vbox = new QVBoxLayout(this);
MessageViewer::Viewer *viewer = new MessageViewer::Viewer(nullptr, nullptr, new KActionCollection(
this));
vbox->addWidget(viewer);
......
......@@ -32,8 +32,7 @@
TestMailMBoxWebEngine::TestMailMBoxWebEngine(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *vbox = new QVBoxLayout;
setLayout(vbox);
QVBoxLayout *vbox = new QVBoxLayout(this);
MessageViewer::Viewer *viewer = new MessageViewer::Viewer(nullptr, nullptr, new KActionCollection(
this));
vbox->addWidget(viewer);
......
......@@ -36,13 +36,12 @@ ViewerPluginTest::ViewerPluginTest(QWidget *parent)
: QWidget(parent)
{
QMenuBar *menuBar = new QMenuBar(this);
QVBoxLayout *vbox = new QVBoxLayout;
setLayout(vbox);
QVBoxLayout *vbox = new QVBoxLayout(this);
vbox->addWidget(menuBar);
QTextEdit *textEdit = new QTextEdit;
QTextEdit *textEdit = new QTextEdit(this);
vbox->addWidget(textEdit);
QWidget *toolManagerWidget = new QWidget;
QWidget *toolManagerWidget = new QWidget(this);
vbox->addWidget(toolManagerWidget);
vbox = new QVBoxLayout;
vbox->setMargin(0);
......
......@@ -44,9 +44,8 @@ VCardViewer::VCardViewer(QWidget *parent, const QByteArray &vCard)
, mAddresseeListIndex(0)
{
setWindowTitle(i18n("vCard Viewer"));
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QVBoxLayout *mainLayout = new QVBoxLayout;
setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(this);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this);
QPushButton *user1Button = new QPushButton;
buttonBox->addButton(user1Button, QDialogButtonBox::ActionRole);
mUser2Button = new QPushButton;
......
......@@ -27,9 +27,8 @@
TemplateConfigureTestWidget::TemplateConfigureTestWidget(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *lay = new QHBoxLayout;
lay->addWidget(new TemplateParser::TemplatesConfiguration());
setLayout(lay);
QHBoxLayout *lay = new QHBoxLayout(this);
lay->addWidget(new TemplateParser::TemplatesConfiguration(this));
}
TemplateConfigureTestWidget::~TemplateConfigureTestWidget()
......
......@@ -29,9 +29,8 @@
TemplateEditorTestWidget::TemplateEditorTestWidget(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *lay = new QHBoxLayout;
lay->addWidget(new TemplateParser::TemplatesTextEdit);
setLayout(lay);
QHBoxLayout *lay = new QHBoxLayout(this);
lay->addWidget(new TemplateParser::TemplatesTextEdit(this));
}
TemplateEditorTestWidget::~TemplateEditorTestWidget()
......
......@@ -28,8 +28,7 @@
TestDndWebEngine::TestDndWebEngine(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *vbox = new QVBoxLayout;
setLayout(vbox);
QVBoxLayout *vbox = new QVBoxLayout(this);
QHBoxLayout *layout = new QHBoxLayout;
vbox->addLayout(layout);
pageView = new WebEngineViewer::WebEngineView(this);
......
......@@ -28,8 +28,7 @@
TestSelectionChangedEngine::TestSelectionChangedEngine(QWidget *parent)
: QWidget(parent)
{
QVBoxLayout *vbox = new QVBoxLayout;
setLayout(vbox);
QVBoxLayout *vbox = new QVBoxLayout(this);
QHBoxLayout *layout = new QHBoxLayout;
vbox->addLayout(layout);
pageView = new WebEngineViewer::WebEngineView(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