-
Notifications
You must be signed in to change notification settings - Fork 1
/
form.cpp
40 lines (34 loc) · 1006 Bytes
/
form.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "form.h"
#include "ui_form.h"
Form::Form(QWidget *parent) :
QWidget(parent),
ui(new Ui::Form)
{
ui->setupUi(this);
setWindowTitle("Virtual Keyboard");
_keyboard = new widgetKeyBoard(false, this, false, ui->frame);
_keyboard->enableSwitchingEcho(true);
_keyboard->createKeyboard();
_keyboard->show(this);
connect(_keyboard,SIGNAL(keySignalReceived()),this,SLOT(returnWidgetSignalReceived()));
externalLineEditPointer = nullptr;
}
Form::~Form()
{
delete ui;
}
void Form::returnWidgetSignalReceived()
{
QLineEdit* currentQLineEdit = _keyboard->currentTextBox();
QString currentText = currentQLineEdit->text();
if(externalLineEditPointer != nullptr)
{
externalLineEditPointer->setText(currentText);
}
}
void Form::setExternalLineEdit(QLineEdit* myExtLineEdit)
{
externalLineEditPointer = myExtLineEdit;
QLineEdit* currentQLineEdit = _keyboard->currentTextBox();
currentQLineEdit->setText((myExtLineEdit->text()));
}