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
This commit is contained in:
mgrojo
2020-08-29 16:59:39 +02:00
committed by Manuel
parent dfc7645079
commit c791a9ff7c

View File

@@ -14,6 +14,8 @@
#include <QtConcurrent/QtConcurrentRun>
#include <QProgressDialog>
#include <QRegularExpression>
#include <QPushButton>
#include <json.hpp>
#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();