diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2018-10-28 14:50:48 +0100 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2018-10-28 14:50:48 +0100 |
commit | 37580292277b2998b7152489060a7161fdcf3fd7 (patch) | |
tree | f88845a0d16740ffa8033bf20f6d4374824e6645 /gui | |
parent | 436c2a0444a38b2f25e39a400de3bf805b6adbe8 (diff) | |
download | nextpnr-37580292277b2998b7152489060a7161fdcf3fd7.tar.gz nextpnr-37580292277b2998b7152489060a7161fdcf3fd7.tar.bz2 nextpnr-37580292277b2998b7152489060a7161fdcf3fd7.zip |
fix unselect from tree
Diffstat (limited to 'gui')
-rw-r--r-- | gui/designwidget.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gui/designwidget.cc b/gui/designwidget.cc index 069f4cfa..29e9ed0c 100644 --- a/gui/designwidget.cc +++ b/gui/designwidget.cc @@ -552,9 +552,6 @@ void DesignWidget::onClickedPip(PipId pip, bool keep) void DesignWidget::onSelectionChanged(int num, const QItemSelection &, const QItemSelection &)
{
- if (selectionModel[num]->selectedIndexes().size() == 0)
- return;
-
int num_selected = 0;
std::vector<DecalXY> decals;
for(int i=0;i<6;i++) {
@@ -565,10 +562,11 @@ void DesignWidget::onSelectionChanged(int num, const QItemSelection &, const QIt std::move(d.begin(), d.end(), std::back_inserter(decals));
}
}
- if (num_selected>1) {
+ if (num_selected>1 || (selectionModel[num]->selectedIndexes().size() == 0)) {
Q_EMIT selected(decals, false);
return;
}
+
QModelIndex index = selectionModel[num]->selectedIndexes().at(0);
if (!index.isValid())
return;
|