From 5acbd9a20f7e206ec4c4b2e40897ecb17ba09ec7 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Mon, 14 Oct 2024 22:46:25 +0200 Subject: [PATCH] wizard: add space when autocompleting words --- src/components.h | 10 ++++++++++ src/wizard/PageWalletRestoreSeed.cpp | 2 +- src/wizard/PageWalletRestoreSeed.h | 4 +++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components.h b/src/components.h index 8a1059f..17b2604 100644 --- a/src/components.h +++ b/src/components.h @@ -4,6 +4,7 @@ #ifndef FEATHER_COMPONENTS_H #define FEATHER_COMPONENTS_H +#include #include #include #include @@ -117,4 +118,13 @@ public: } }; +class SpaceCompleter : public QCompleter { +protected: + QString pathFromIndex(const QModelIndex &index) const override + { + QString completion = QCompleter::pathFromIndex(index); + return completion + ' '; + } +}; + #endif //FEATHER_COMPONENTS_H diff --git a/src/wizard/PageWalletRestoreSeed.cpp b/src/wizard/PageWalletRestoreSeed.cpp index 624efdb..cb25118 100644 --- a/src/wizard/PageWalletRestoreSeed.cpp +++ b/src/wizard/PageWalletRestoreSeed.cpp @@ -237,4 +237,4 @@ void PageWalletRestoreSeed::onOptionsClicked() { m_fields->showSetRestoreHeightPage = check_overrideCreationDate.isChecked(); m_fields->showSetSeedPassphrasePage = check_setSeedPasshprase.isChecked(); m_fields->showSetSubaddressLookaheadPage = check_subaddressLookahead.isChecked(); -} \ No newline at end of file +} diff --git a/src/wizard/PageWalletRestoreSeed.h b/src/wizard/PageWalletRestoreSeed.h index 2c3bc83..ed02550 100644 --- a/src/wizard/PageWalletRestoreSeed.h +++ b/src/wizard/PageWalletRestoreSeed.h @@ -8,6 +8,8 @@ #include #include +#include "components.h" + namespace Ui { class PageWalletRestoreSeed; } @@ -41,7 +43,7 @@ private: int length; QStringList words; QStringListModel completerModel; - QCompleter completer; + SpaceCompleter completer; Seed::Type type; };