I have 2 questions:
How can I access a
QFileDialog
and write the path of a file in the "File name" field using the Qt Test module?I am asking that because I am developing some GUI tests in Qt and now I need to open a text file. The following code creates the
QFileDialog
and gets the file path:QString filePath = QFileDialog::getOpenFileName( this, "Open", "", tr("Text Files (*.txt)") );
If I am using a thread (
QThread
) to load the content in this text file, how can I wait for this thread to finish in my GUI tests?I know I can use the
QTest::qSleep( milliseconds );
command, but I don't think it is a good practice in this case.
If possible show me an example, please.