#include "LineEditWithKeyboard.h" #include #include "keyboard.h" LineEditWithKeyboard::LineEditWithKeyboard(QWidget *parent) : QLineEdit(parent), m_keyboard(nullptr) { } void LineEditWithKeyboard::mousePressEvent(QMouseEvent *event) { qDebug() << "LineEditWithKeyboard::mousePressEvent"; emit signalMousePressed(); keyboard::GetInstance(this); QLineEdit::mousePressEvent(event); } void LineEditWithKeyboard::slotWordChoose(QString word) { setText(text() + word); } void LineEditWithKeyboard::keyPressEvent(QKeyEvent* event) { //qDebug() << "LineEditWithKeyboard::keyPressEvent"; emit signalMousePressed(); QWidget* w = dynamic_cast(parent()); if(w) w->setFocus(); QLineEdit::keyPressEvent(event); }