Add search help pop-up
* Support ! modifier (same as '-') * Create reusable PopupHelpWidget as self-contained popup that can be positioned around a parent widget and will follow the movement and sizing of the window * Eliminated KEEPASSXC_MAIN_WINDOW macro and replaced with getMainWindow() function * Add tests to cover search help show/hide
This commit is contained in:
@@ -802,10 +802,22 @@ void TestGui::testSearch()
|
||||
auto* clearButton = searchWidget->findChild<QAction*>("clearIcon");
|
||||
QVERIFY(!clearButton->isVisible());
|
||||
|
||||
auto* helpButton = searchWidget->findChild<QAction*>("helpIcon");
|
||||
auto* helpPanel = searchWidget->findChild<QWidget*>("SearchHelpWidget");
|
||||
QVERIFY(helpButton->isVisible());
|
||||
QVERIFY(!helpPanel->isVisible());
|
||||
|
||||
// Enter search
|
||||
QTest::mouseClick(searchTextEdit, Qt::LeftButton);
|
||||
QTRY_VERIFY(searchTextEdit->hasFocus());
|
||||
QTRY_VERIFY(!clearButton->isVisible());
|
||||
// Show/Hide search help
|
||||
helpButton->trigger();
|
||||
QTRY_VERIFY(helpPanel->isVisible());
|
||||
QTest::mouseClick(searchTextEdit, Qt::LeftButton);
|
||||
QTRY_VERIFY(helpPanel->isVisible());
|
||||
helpButton->trigger();
|
||||
QTRY_VERIFY(!helpPanel->isVisible());
|
||||
// Search for "ZZZ"
|
||||
QTest::keyClicks(searchTextEdit, "ZZZ");
|
||||
QTRY_COMPARE(searchTextEdit->text(), QString("ZZZ"));
|
||||
|
||||
Reference in New Issue
Block a user