From a3ae0b2bbd4c5c3a6b69e206759428970c0cb31a Mon Sep 17 00:00:00 2001 From: Unknown <870709864@qq.com> Date: Sun, 27 Jan 2019 16:38:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=81=BF=E5=85=8D=E5=AD=90=E7=BA=BF?= =?UTF-8?q?=E7=A8=8B=E6=9B=B4=E6=96=B0ui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QtScrcpy/dialog.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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()