Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Issue with QTextBrowser not redrawing after append until the widget is resized



  • Apologies if this is discussed elsewhere.
    Was part of a bigger application that I had just started writing but simplified it right back.

    Form with a push button and a textbrowser.

    Button appends text via signal/slot to textbrowser.
    Text is not visible until I resize the window.

    If I make the signal slot a Queued connection then it displays the text immediately.

    This is compiled on 5.12.8

    Problem on Mac OSX10.14.6 but behaves fine on OSX 10.13 without the queued connection.
    Advice welcome.

    PS the timer printing to the debugger is so I could check the event loop is running - which it is.

    Code that has odd behaviour on MAC OSX 10.14 :

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QDateTime>
    #include <QDebug>

    MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    connect(ui->pushButton, &QPushButton::clicked, this, &MainWindow::something);
    t.setInterval(1000);
    t.start();
    connect(&t, &QTimer::timeout, this, this {
    qDebug()<<tCount++;
    });
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }

    void MainWindow::something() {
    ui->textBrowser->append(QDateTime::currentDateTime().toString());
    }


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Did you check whether you have the same issue with a more recent version of Qt ?



  • Thank you for the reply. It seems that if compiled with an SDK before 10.14 then this is an issue on any 10.14 machines running the app. If compiled with SDK pre 10.14 and run on pre 10.14 OSX then all is fine. If compiled using 10.14 SDK then runs fine on all OSX. I was just hoping to keep support for OSX 10.11 which I cannot do if I move to QT5.12 and SDK 10.14


  • Lifetime Qt Champion

    There's one phrase that is a bit contradictory, once you say that with the 10.14 SDK, it fails on macOS 10.14 and in another that it runs well everywhere.


Log in to reply