1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

35 lines
690 B
C++
Raw Normal View History

#include "mainwindow.h"
2017-10-17 21:45:34 +08:00
#include "ui_mainwindow.h"
2018-04-23 10:00:09 +08:00
2017-11-23 19:12:48 +08:00
MainWindow::MainWindow ( QWidget* parent ) :
QMainWindow ( parent ),
ui ( new Ui::MainWindow )
2017-10-17 21:45:34 +08:00
{
2017-11-23 19:12:48 +08:00
ui->setupUi ( this );
2017-10-18 08:05:58 +08:00
// serialport example
// tcpsocket example
// websocket?
//
2018-04-23 10:00:09 +08:00
p = QQtClientConnectionInstance ( this );
connect ( p, SIGNAL ( signalServerSay ( QString ) ),
this, SLOT ( on_recv_say_hello ( QString ) ) );
2017-10-17 21:45:34 +08:00
}
MainWindow::~MainWindow()
{
delete ui;
}
2018-04-23 10:00:09 +08:00
void MainWindow::on_pushButton_clicked()
{
p->sendA1Command ( ui->lineEdit->text() );
}
void MainWindow::on_recv_say_hello ( QString a )
{
2018-04-23 13:39:10 +08:00
pline() << a;
//ui->plainTextEdit->appendPlainText ( a );
2018-04-23 10:00:09 +08:00
}