UI doesn´t refresh on Android
-
Hi,
I just started building an app for android, but the behaviour is not what I expected.
I just added a button and a label to simply test something, and I deploy the app on my phone. With the button, I do:
void MainWindow::on_pushButton_pressed() { ui->label->setText("AAA"); ui->label->hide(); qDebug() << "AAA" << ui->label->text(); }
But the UI doesn´t refresh, the label doesn´t hide, and it doesn´t change text either, but the print shows that the text changed.
After that, I added another button:
void MainWindow::on_pushButton_2_clicked() { ui->label->show(); }
This button somehow "updates" all the UI, and qt throws a messaage: I ImeTracker: org.qtproject.example.untitled3:d03c1066: onRequestHide at ORIGIN_CLIENT reason HIDE_SOFT_INPUT fromUser false
I´d like to understand what´s going on here and why is the UI not updating when I click the first button, many thanks to whoever can help me.
-
Are you using QtWidgets or QtQuick+QML ?
Seems like you're using QtWidgets which has never been intended to be used for mobile devices, which lead to creation of QtQuick and QML that are far better appropriate for those devices.
-
@ankou29666 Thanks, I am indeed using QtWidgets.
I first tried to create QtQuick but it doesn´t create it for some reason, I click on finish and it doesn´t do anything.
EDIT: This is apparently due to some kwnon issues with windows 11.
Still, I belikeve the qwidget application should work? Not sure why the GUI doesn´t udpate.