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... --- mappingtreewidget.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'mappingtreewidget.cpp') diff --git a/mappingtreewidget.cpp b/mappingtreewidget.cpp index b1a2b8b..38e6c9a 100644 --- a/mappingtreewidget.cpp +++ b/mappingtreewidget.cpp @@ -86,6 +86,7 @@ MappingTreeWidget::MappingTreeWidget(QWidget *parent) : QWidget(parent){ // filter + refresh QIcon swordIcon(Helper::icon(Qt::transparent, qApp->palette().color(QPalette::Text), QChar(0x2694), true, false)); mFilter = new QLineEdit; + mFilter->setFocusPolicy(Qt::ClickFocus); connect(mFilter, &QLineEdit::returnPressed, this, &MappingTreeWidget::filter); QToolBar *filterTB = new QToolBar; QAction *doFilterA = new QAction(Helper::icon(Qt::transparent, qApp->palette().color(QPalette::Text), QChar(0x2245), true, false), tr("Filter"), this); -- cgit v1.2.3-70-g09d2