From c791a9ff7c3fa2f180b63becf5ce940d2dc94e0c Mon Sep 17 00:00:00 2001 From: mgrojo Date: Sat, 29 Aug 2020 16:59:39 +0200 Subject: [PATCH] Remove the Default property of the fetching dialog Remove the default and auto-default properties of the cancel button in the "Fetching data..." dialog. See issue #2383 --- src/sqlitetablemodel.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/sqlitetablemodel.cpp b/src/sqlitetablemodel.cpp index 22ffa4e8..38cd4122 100644 --- a/src/sqlitetablemodel.cpp +++ b/src/sqlitetablemodel.cpp @@ -14,6 +14,8 @@ #include #include #include +#include + #include #include "RowLoader.h" @@ -1023,6 +1025,14 @@ bool SqliteTableModel::completeCache () const // cancel button if we allow cancellation here. This isn't QProgressDialog progress(tr("Fetching data..."), tr("Cancel"), 0, rowCount()); + + QPushButton* cancelButton = new QPushButton(tr("Cancel")); + // This is to prevent distracted cancelation of the fetching and avoid the + // Snap-To Windows optional feature. + cancelButton->setDefault(false); + cancelButton->setAutoDefault(false); + progress.setCancelButton(cancelButton); + progress.setWindowModality(Qt::ApplicationModal); progress.show();