Keep file navigation focused and open entries with Enter
This commit is contained in:
1 parent
043257cabf
commit
93a6277ca4
2 files changed
+26
-1
No files matched your search
@@ -133,6 +133,20 @@ private slots:
|
||||
tree->setFocus(); QTest::keyClick(tree, Qt::Key_Backspace);
|
||||
QCOMPARE(captured.message.command, uint8_t(MF_LIST)); QCOMPARE(QString::fromUtf8(captured.message.path), QString("documents"));
|
||||
QTest::keyClick(tree, Qt::Key_Backspace); QCOMPARE(QString::fromUtf8(captured.message.path), QString());
|
||||
QPushButton* up = nullptr;
|
||||
for (auto* button : browser.findChildren<QPushButton*>()) {
|
||||
QVERIFY(!button->autoDefault());
|
||||
if (button->text() == "Up") up = button;
|
||||
}
|
||||
QVERIFY(up);
|
||||
for (auto key : {Qt::Key_Return, Qt::Key_Enter}) {
|
||||
item = new QTreeWidgetItem(tree, {"folder"}); item->setData(0, Qt::UserRole, "folder");
|
||||
item->setData(0, Qt::UserRole + 1, MF_DIRECTORY); tree->setCurrentItem(item);
|
||||
QTest::keyClick(tree, key);
|
||||
QCOMPARE(captured.message.command, uint8_t(MF_LIST)); QCOMPARE(QString::fromUtf8(captured.message.path), QString("folder"));
|
||||
up->setFocus(); QTest::mouseClick(up, Qt::LeftButton);
|
||||
QVERIFY(tree->hasFocus()); QCOMPARE(QString::fromUtf8(captured.message.path), QString());
|
||||
}
|
||||
QTest::keyClick(tree, Qt::Key_Backspace); QCOMPARE(captured.message.owner, 0ULL);
|
||||
browser.setChannel("42", 11);
|
||||
item = new QTreeWidgetItem(tree, {"foreign.txt"}); item->setData(0, Qt::UserRole, "foreign.txt");
|
||||
|
||||
Reference in new issue
Block a user