Problem
I have a problem with Qt on Android in all my applications: after I close the QFileDialog (code below), I have a blank black window. I can't do anything in the application except close it.
Here is the code I use:
QFileDialog dialog(this, tr("Open Markdown File"));
dialog.setMimeTypeFilters({"text/markdown"});
dialog.setAcceptMode(QFileDialog::AcceptOpen);
if (dialog.exec() == QDialog::Accepted) {
const QString file = dialog.selectedFiles().at(0);
if (file == path || file.isEmpty()) return;
openFile(file);
}
Informations
- My Qt version is Qt 6.2.4
- Device running on: Samsung Galaxy S10e
- arm64-v8 build
- JDK version 17
- SDK-Version: 7.0
- NDK-Version: 22.1.7171670
- C++ version 17
Edit
Edit 2
After some more debugging i figured out, that it reaches the end of the code. I also tried to add Q[Core|Gui]Application::processEvents()
and QMainWindow::repaint()
but i istill have the blank screen as you cas see in the screenshot above.
Edit 3
The Code is in a QMainWindow
and is executed in the main thread. The APP has a QApplication
object. After the end of the code is reached, the main thread aka main event loop runs as usual, but I have a black window.
You can find all the code on GitHub, but only the part I showed causes problems.