Commit dce3718d authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add search line edit

parent 15ea7bc7
......@@ -7,6 +7,7 @@
#include "emoticontexteditselectortest.h"
#include "emoticon/emoticontexteditselector.h"
#include "emoticon/emoticonunicodetab.h"
#include <QLineEdit>
#include <QTest>
#include <QVBoxLayout>
QTEST_MAIN(EmoticonTextEditSelectorTest)
......@@ -25,4 +26,9 @@ void EmoticonTextEditSelectorTest::shouldHaveDefaultValues()
auto mUnicodeTab = w.findChild<KPIMTextEdit::EmoticonUnicodeTab *>(QStringLiteral("mUnicodeTab"));
QVERIFY(mUnicodeTab);
auto mSearchUnicodeLineEdit = w.findChild<QLineEdit *>(QStringLiteral("mSearchUnicodeLineEdit"));
QVERIFY(mSearchUnicodeLineEdit);
QVERIFY(mSearchUnicodeLineEdit->isClearButtonEnabled());
QVERIFY(mSearchUnicodeLineEdit->text().isEmpty());
}
......@@ -9,6 +9,7 @@
#include "emoticonunicodetab.h"
#include "textutils.h"
#include <QLineEdit>
#include <QVBoxLayout>
using namespace KPIMTextEdit;
......@@ -16,13 +17,18 @@ using namespace KPIMTextEdit;
EmoticonTextEditSelector::EmoticonTextEditSelector(QWidget *parent)
: QWidget(parent)
, mUnicodeTab(new EmoticonUnicodeTab(this))
, mSearchUnicodeLineEdit(new QLineEdit(this))
{
auto mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setSpacing(0);
mainLayout->setContentsMargins({});
mainLayout->addWidget(mUnicodeTab);
mUnicodeTab->setObjectName(QStringLiteral("mUnicodeTab"));
mSearchUnicodeLineEdit->setObjectName(QStringLiteral("mSearchUnicodeLineEdit"));
mSearchUnicodeLineEdit->setClearButtonEnabled(true);
mainLayout->addWidget(mSearchUnicodeLineEdit);
mainLayout->addWidget(mUnicodeTab);
connect(mUnicodeTab, &EmoticonUnicodeTab::itemSelected, this, &EmoticonTextEditSelector::slotItemSelected);
}
......
......@@ -9,6 +9,7 @@
#include "kpimtextedit_private_export.h"
#include <QWidget>
class QLineEdit;
namespace KPIMTextEdit
{
class EmoticonUnicodeTab;
......@@ -28,6 +29,7 @@ Q_SIGNALS:
private:
void slotItemSelected(const QString &str);
EmoticonUnicodeTab *const mUnicodeTab;
QLineEdit *const mSearchUnicodeLineEdit;
};
}
Supports Markdown
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