Can't see any text append in UI?
I got a problem to use the QTextEdit with append function.
Code:
MainWindow::ui->textDumpMessage->append("Before the QStringList fileList line");
if (fileList.isEmpty())
{
return false;
}
MainWindow::ui->textDumpMessage->append("After the QStringList fileList line");
qDebug() << "Load csv";
the QTextEdit can show first append text but fail to get the second append text. I doubt the problem is on QStringList or QFileDialog. Does any body encounter the same issue?
I use QT 4.7.2 with mingw32 on windows XP.
Re: Can't see any text append in UI?
Hi, try inserting a new append inside the isEmpty() check, so that you can know whether the execution gets there: i.e:
Code:
MainWindow::ui->textDumpMessage->append("Before the QStringList fileList line");
if (fileList.isEmpty())
{
MainWindow::ui->textDumpMessage->append("File is Empty");
return false;
}
MainWindow::ui->textDumpMessage->append("After the QStringList fileList line");
qDebug() << "Load csv";
Notice the new line I have added before return false;.
Now tell us what happens then.
Re: Can't see any text append in UI?
Hello,
I insert the line as you describe. Here is the result
1. If I select file or files, I still can't get the second text append in QTextEdit. qDebug work as usual. The program still runs.
2. If I don't select the file, I can get the "File is Empty" append in QTextEdit.
Any comment? welcome. :)
Added after 1 54 minutes:
Some new finding...
If the function is finished. The all append text can be shown on the QTextEdit. In other word, if the "QStringList" object (fileList in this case) is destoryed, I can get all update to QTextEdit. Why? does QStringList queues all the message passing to UI? how can I solved this problem. I have to use QStringList.
Re: Can't see any text append in UI?
I got some new finding on this Keeping_the_GUI_ResponsiveMaybe I need to use different thread to keep the GUI responsive.