Skip to content

Commit fd22a32

Browse files
committed
Fix FDO Secrets GUI test crashes
* Fixes #13307
1 parent 7c7ca45 commit fd22a32

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

tests/gui/TestGuiFdoSecrets.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,13 +1707,7 @@ void TestGuiFdoSecrets::unlockDatabaseInBackend()
17071707

17081708
void TestGuiFdoSecrets::processEvents()
17091709
{
1710-
// Couldn't use QApplication::processEvents, because per Qt documentation:
1711-
// events that are posted while the function runs will be queued until a later round of event processing.
1712-
// and we may post QTimer single shot events during event handling to achieve async method.
1713-
// So we directly call event dispatcher in a loop until no events can be handled
1714-
while (QAbstractEventDispatcher::instance()->processEvents(QEventLoop::AllEvents)) {
1715-
// pass
1716-
}
1710+
QApplication::processEvents();
17171711
}
17181712

17191713
// the following functions have return value, switch macros to the version supporting that
@@ -1825,6 +1819,8 @@ TestGuiFdoSecrets::encryptPassword(QByteArray value, QString contentType, const
18251819

18261820
bool TestGuiFdoSecrets::driveAccessControlDialog(bool remember, bool includeFutureEntries)
18271821
{
1822+
// Call process events twice to ensure queued timers fire on second call
1823+
processEvents();
18281824
processEvents();
18291825
for (auto w : QApplication::topLevelWidgets()) {
18301826
if (!w->isWindow()) {
@@ -1897,6 +1893,8 @@ bool TestGuiFdoSecrets::driveNewDatabaseWizard()
18971893

18981894
bool TestGuiFdoSecrets::driveUnlockDialog(DatabaseWidget* target)
18991895
{
1896+
// Call process events twice to ensure queued timers fire on second call
1897+
processEvents();
19001898
processEvents();
19011899
auto dbOpenDlg = m_tabWidget->findChild<DatabaseOpenDialog*>();
19021900
VERIFY(dbOpenDlg);

0 commit comments

Comments
 (0)