mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-07-31 12:58:39 +00:00
fix:避免子线程更新ui
This commit is contained in:
parent
0d840c4ed5
commit
a3ae0b2bbd
1 changed files with 9 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
#include "dialog.h"
|
#include "dialog.h"
|
||||||
#include "ui_dialog.h"
|
#include "ui_dialog.h"
|
||||||
|
@ -147,10 +148,14 @@ void Dialog::on_startAdbdBtn_clicked()
|
||||||
|
|
||||||
void Dialog::outLog(const QString &log, bool newLine)
|
void Dialog::outLog(const QString &log, bool newLine)
|
||||||
{
|
{
|
||||||
ui->outEdit->append(log);
|
// avoid sub thread update ui
|
||||||
if (newLine) {
|
QString backLog = log;
|
||||||
ui->outEdit->append("<br/>");
|
QTimer::singleShot(0, this, [this, backLog, newLine](){
|
||||||
}
|
ui->outEdit->append(backLog);
|
||||||
|
if (newLine) {
|
||||||
|
ui->outEdit->append("<br/>");
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Dialog::checkAdbRun()
|
bool Dialog::checkAdbRun()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue