diff options
author | Gary Wang <wzc782970009@gmail.com> | 2022-09-27 00:50:11 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2022-09-26 13:32:22 -0400 |
commit | 43a058c0957bec3fc564a7a019bdc03829e32e70 (patch) | |
tree | d65af48c979cab3ee80d4fd98abcbc6503df45cd | |
parent | b7ae8dc9b7af0e9b7cf05e8d86058e455753e8d2 (diff) | |
download | deduper-43a058c0957bec3fc564a7a019bdc03829e32e70.tar.xz |
Avoid using setCencelButton() for hiding the button
-rw-r--r-- | qdeduper/mingui.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<QPushButton*>(); + 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<std::pair<fs::path, bool>> 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<QPushButton*>(); + if (Q_LIKELY(cancelbtn)) cancelbtn->setVisible(true); auto f = QtConcurrent::run([this, paths] { FileScanner *fs = new FileScanner(); this->fsc = fs; |