Commit 3ada0bce authored by Laurent Montel's avatar Laurent Montel 😁

Improve autotest

parent 6f91442a
......@@ -40,12 +40,16 @@ void RecentAddressWidgetTest::shouldHaveDefaultValue()
KPIM::RecentAddressWidget w;
KLineEdit *lineedit = w.findChild<KLineEdit *>(QStringLiteral("line_edit"));
QVERIFY(lineedit);
QVERIFY(lineedit->isClearButtonEnabled());
QVERIFY(lineedit->trapReturnKey());
QVERIFY(lineedit->text().isEmpty());
QToolButton *newButton = w.findChild<QToolButton *>(QStringLiteral("new_button"));
QVERIFY(newButton);
QToolButton *removeButton = w.findChild<QToolButton *>(QStringLiteral("remove_button"));
QVERIFY(removeButton);
QVERIFY(!removeButton->isEnabled());
QListWidget *listview = w.findChild<QListWidget *>(QStringLiteral("list_view"));
QVERIFY(listview);
......
......@@ -46,6 +46,7 @@ RecentAddressWidget::RecentAddressWidget(QWidget *parent)
mLineEdit->setObjectName(QStringLiteral("line_edit"));
mLineEdit->setTrapReturnKey(true);
mLineEdit->installEventFilter(this);
mLineEdit->setClearButtonEnabled(true);
connect(mLineEdit, &KLineEdit::returnPressed, this, &RecentAddressWidget::slotAddItem);
lineLayout->addWidget(mLineEdit);
......
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