From 43a058c0957bec3fc564a7a019bdc03829e32e70 Mon Sep 17 00:00:00 2001 From: Gary Wang Date: Tue, 27 Sep 2022 00:50:11 +0800 Subject: Avoid using setCencelButton() for hiding the button --- qdeduper/mingui.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qdeduper') diff --git a/qdeduper/mingui.cpp b/qdeduper/mingui.cpp index 253dfe1..5d12e7c 100644 --- a/qdeduper/mingui.cpp +++ b/qdeduper/mingui.cpp @@ -211,7 +211,8 @@ void DeduperMainWindow::setup_menu() pd->setMinimum(0); pd->setLabelText("Loading database..."); pd->open(); - pd->setCancelButton(nullptr); + QPushButton *cancelbtn = pd->findChild(); + if (Q_LIKELY(cancelbtn)) cancelbtn->setVisible(false); auto f = QtConcurrent::run([this, dbpath]() -> bool { return this->sdb->load(qstring_to_path(dbpath)); }); @@ -629,7 +630,8 @@ void DeduperMainWindow::scan_dirs(std::vector> paths) this->pd->setLabelText("Preparing for database creation..."); this->pd->setMinimum(0); this->pd->setMaximum(0); - this->pd->setCancelButton(new QPushButton("Cancel")); + QPushButton *cancelbtn = this->pd->findChild(); + if (Q_LIKELY(cancelbtn)) cancelbtn->setVisible(true); auto f = QtConcurrent::run([this, paths] { FileScanner *fs = new FileScanner(); this->fsc = fs; -- cgit v1.2.3