Commit 49b06b1a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use QFormLayout

parent 294f4e76
Pipeline #47582 passed with stage
in 41 minutes and 30 seconds
......@@ -7,6 +7,8 @@
#include "remotecontentwidgettest.h"
#include "remote-content/remotecontentwidget.h"
#include <QTest>
#include <QFormLayout>
#include <QLineEdit>
QTEST_MAIN(RemoteContentWidgetTest)
RemoteContentWidgetTest::RemoteContentWidgetTest(QObject *parent)
: QObject(parent)
......@@ -17,5 +19,11 @@ RemoteContentWidgetTest::RemoteContentWidgetTest(QObject *parent)
void RemoteContentWidgetTest::shouldHaveDefaultValues()
{
MessageViewer::RemoteContentWidget w;
//TODO
auto mainLayout = w.findChild<QFormLayout *>(QStringLiteral("mainLayout"));
QVERIFY(mainLayout);
QCOMPARE(mainLayout->contentsMargins(), {});
auto mLineEdit = w.findChild<QLineEdit *>(QStringLiteral("mLineEdit"));
QVERIFY(mLineEdit);
QVERIFY(mLineEdit->text().isEmpty());
}
......@@ -6,7 +6,7 @@
#include "remotecontentwidget.h"
#include <QVBoxLayout>
#include <QFormLayout>
#include <QLabel>
#include <KLocalizedString>
#include <QLineEdit>
......@@ -16,15 +16,12 @@ RemoteContentWidget::RemoteContentWidget(QWidget *parent)
: QWidget(parent)
, mLineEdit(new QLineEdit(this))
{
auto mainLayout = new QVBoxLayout(this);
auto mainLayout = new QFormLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins({});
auto label = new QLabel(i18n("Url"), this);
label->setObjectName(QStringLiteral("label"));
mainLayout->addWidget(label);
mLineEdit->setObjectName(QStringLiteral("mLineEdit"));
mainLayout->addWidget(mLineEdit);
mainLayout->addRow(i18n("Url"), mLineEdit);
}
RemoteContentWidget::~RemoteContentWidget()
......
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