串口如何稳定接收数据(转帖)
Chinese
30
Posts
4
Posters
24.6k
Views
2
Watching
-
@
#include "mainwindow.h"
#include "ui_mainwindow.h"MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
_timer.setInterval(10);for(int i = 0; i<1024;i++) { message += "1"; } connect(&_timer,&QTimer::timeout,this,&MainWindow::updateText); _timer.start();
}
MainWindow::~MainWindow()
{
delete ui;
}void MainWindow::updateText()
{
ui->textEdit->append(message);
}
@
I did a simple application and test it. It works fine.
You can try it and adjust parameters. -
I think you should ask this question on http://qt-project.org/forums/viewforum/10/
because more people will answer you. -
I think you should ask this question on http://qt-project.org/forums/viewforum/10/
because more people will answer you.