From 4e5e0e6ec5668a0f0397dd8acbee0bd2f4bd0f67 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 12 Jan 2019 17:51:29 +0100 Subject: Make NewPicsDialog usable by keyboard Fix focus policy: only change focus between MappingTreeWidget and MappingTreeResultView. Also, block updating the selection of MappingTreeWidget when removing an item from the result view. That operation resets the result selection and by signal changes the selection of the mapping tree. The easiest way I could come up with was a member flag that is set in removeMapping and checked and cleared in resultSelectionChanged. Clearing the flag right after removing the item doesn't work, most likely because of thread affinity (just a guess, didn't check it). If it has side effects remains to be seen... --- mappingeditwidget.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mappingeditwidget.h') diff --git a/mappingeditwidget.h b/mappingeditwidget.h index 3044d80..54fdf0c 100644 --- a/mappingeditwidget.h +++ b/mappingeditwidget.h @@ -23,6 +23,7 @@ class MappingEditWidget : public QWidget { explicit MappingEditWidget(QWidget *parent = nullptr); MappingTreeResultModel *model() const { return mResultModel; } MappingTreeWidget *treeWidget() const { return mMappingTree; } + void blockResultChange(bool c) { mBlockResultChange = c; } public slots: void addMapping(); @@ -42,6 +43,7 @@ class MappingEditWidget : public QWidget { MappingTreeWidget *mMappingTree; MappingTreeResultView *mMappingResult; MappingTreeResultModel *mResultModel; + bool mBlockResultChange = false; }; #endif // MAPPINGEDITWIDGET_H -- cgit v1.2.3-70-g09d2