diff --git a/QtScrcpy/dialog.cpp b/QtScrcpy/dialog.cpp index f777671..b54c1b7 100644 --- a/QtScrcpy/dialog.cpp +++ b/QtScrcpy/dialog.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "dialog.h" #include "ui_dialog.h" @@ -147,10 +148,14 @@ void Dialog::on_startAdbdBtn_clicked() void Dialog::outLog(const QString &log, bool newLine) { - ui->outEdit->append(log); - if (newLine) { - ui->outEdit->append("
"); - } + // avoid sub thread update ui + QString backLog = log; + QTimer::singleShot(0, this, [this, backLog, newLine](){ + ui->outEdit->append(backLog); + if (newLine) { + ui->outEdit->append("
"); + } + }); } bool Dialog::checkAdbRun()