Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJonathan White <support@dmapps.us>2020-04-22 01:46:21 +0300
committerJonathan White <support@dmapps.us>2020-05-15 03:21:32 +0300
commit49487f9d4a717436856320b8a1601be4cfbd348b (patch)
tree9215fd8fc23468086c2aaaf48db4b509e214c11b /tests
parent51429810189cf17501b925712920f9340ec4f4d1 (diff)
Fix changing focus around the main window using tab
* Override Qt's default [broken] behavior of handling Tab/Shift+Tab to navigate around the MainWindow. Completely fixes trapped focus. * Improve handling of search results when navigating the UI. * Fix selecting first entry after ending a search. * Add keyboard shortcuts to directly focus on search (F1), Group List (F2), and Entry List (F3) * Fixes #2878, #4636, and #4221
Diffstat (limited to 'tests')
-rw-r--r--tests/gui/TestGui.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/gui/TestGui.cpp b/tests/gui/TestGui.cpp
index 7ce8a0f4a..b1513cadf 100644
--- a/tests/gui/TestGui.cpp
+++ b/tests/gui/TestGui.cpp
@@ -901,8 +901,8 @@ void TestGui::testSearch()
QTest::keyClick(searchTextEdit, Qt::Key_Down);
QTRY_VERIFY(entryView->hasFocus());
auto* searchedEntry = entryView->currentEntry();
- // Restore focus and search text selection
- QTest::keyClick(m_mainWindow.data(), Qt::Key_F, Qt::ControlModifier);
+ // Restore focus using F1 key and search text selection
+ QTest::keyClick(m_mainWindow.data(), Qt::Key_F1);
QTRY_COMPARE(searchTextEdit->selectedText(), QString("someTHING"));
QTRY_VERIFY(searchTextEdit->hasFocus());
@@ -965,12 +965,14 @@ void TestGui::testSearch()
searchWidget->setLimitGroup(false);
clickIndex(rootGroupIndex, groupView, Qt::LeftButton);
QCOMPARE(groupView->currentGroup(), m_db->rootGroup());
+ QVERIFY(!m_dbWidget->isSearchActive());
// Try to edit the first entry from the search view
// Refocus back to search edit
QTest::mouseClick(searchTextEdit, Qt::LeftButton);
QTRY_VERIFY(searchTextEdit->hasFocus());
- QVERIFY(m_dbWidget->isSearchActive());
+ QTest::keyClicks(searchTextEdit, "someTHING");
+ QTRY_VERIFY(m_dbWidget->isSearchActive());
QModelIndex item = entryView->model()->index(0, 1);
Entry* entry = entryView->entryFromIndex(item);