wizard: add space when autocompleting words

This commit is contained in:
tobtoht 2024-10-14 22:46:25 +02:00
parent 2707a26d3c
commit 5acbd9a20f
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
3 changed files with 14 additions and 2 deletions

View file

@ -4,6 +4,7 @@
#ifndef FEATHER_COMPONENTS_H
#define FEATHER_COMPONENTS_H
#include <QCompleter>
#include <QPushButton>
#include <QHBoxLayout>
#include <QDialog>
@ -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

View file

@ -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();
}
}

View file

@ -8,6 +8,8 @@
#include <QCompleter>
#include <QStringListModel>
#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;
};