Skip to content

Commit d8d1a47

Browse files
committed
add update in MainWindows to refreshed the brush when the shortcut is enable.
1 parent 978ef8d commit d8d1a47

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/main_window.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,19 @@ ImageCanvas * MainWindow::getCurrentImageCanvas() {
436436

437437
void MainWindow::swapView() {
438438
checkbox_watershed_mask->setCheckState(checkbox_watershed_mask->checkState() == Qt::CheckState::Checked ? Qt::CheckState::Unchecked : Qt::CheckState::Checked);
439+
update();
440+
}
441+
442+
void MainWindow::update() {
443+
QWidget::update();
439444
ImageCanvas * ic = getCurrentImageCanvas();
440445
if (ic == NULL)return;
441446
ic->update();
442447
}
443448

444449
void MainWindow::onLabelShortcut(int row) {
445-
if(list_label->isEnabled())
446-
list_label->setCurrentRow(row);
447-
}
450+
if (list_label->isEnabled()) {
451+
list_label->setCurrentRow(row);
452+
update();
453+
}
454+
}

src/main_window.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public slots:
8282
void updateConnect(int index);
8383
void treeWidgetClicked();
8484
void onLabelShortcut(int row);
85+
void update();
8586
};
8687

8788
#endif

0 commit comments

Comments
 (0)