次のコードはQMessageBox
、2 秒後に my を閉じます。しかし、ボックスが閉じているときにテキストが表示されます。ボックスが閉じる前に、非常に速く点滅します。ここで何が起こっているのですか?
QMessageBox *msgBox = new QMessageBox();
msgBox->setText("Coördinate is being created, please wait...");
msgBox->show();
QTimer::singleShot(2000, msgBox, SLOT(hide()));
これが表示され、閉じる直前にテキストが表示されます。
アップデート
シングル スレッド プログラムでの作業: メソッドWriteMultipleACLCommands()
に多くの時間がかかっています。たぶんそれが問題ですか?
QMessageBox *msgBox = new QMessageBox();
msgBox->setText("Coördinate is being created, please wait...");
msgBox->show();
QTimer::singleShot(2000, msgBox, SLOT(hide()));
singleton_SerialPortManager->WriteMultipleACLCommands();
//function writes a few bytes onto a serial connection