[PyQt] [pyqt]Replace a character in qlineedit from a dictionary(Qcompleter?)
maziar.parsijani at gmail.com
Fri Sep 7 19:20:50 BST 2018
I Have found an answer to this problem but still I want to know how to set
a bigger font for pop-up window :
self.setModel(QStringListModel(['أ', 'إ', 'آ', 'ٱ']))
e = QLineEdit()
c = CustomCompleter()
On Wed, Sep 5, 2018 at 4:55 PM Maziar Parsijani <maziar.parsijani at gmail.com>
> I use the following code for qcompleter .In this method if you write "c"
> then you can just choose "completion" or any other is starts with "c" in
> the stringlist.
> def get_data(model): model.setStringList(["completion", "data", "goes", "here"]) edit = QLineEdit() completer = QCompleter() edit.setCompleter(completer) model = QStringListModel() completer.setModel(model) get_data(model)
> how could I replace a character that is not related to the input.for
> example :
> I want to be able when a key like *"h"* pressed or input the completer
> menu appears and would be able to choose "b"or"a"or"c"or"d" and *replace*
> it in the qlineedit character.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt