[Qt-interest] [QCompleter] Incrementally filling hierarchical item model

Maik Beckmann beckmann.maik at googlemail.com
Mon Nov 16 15:41:53 CET 2009


Hello,

I like to implement tab-completion in a QLineEdit for a scripting
engine.  Its only practical if the Item-Model can fill itself as
needed.  I.e. the user enters "fo<TAB>", then the Item-Model should
should fill itself with the global symbols by asking the script
engine, then the completer performs.  If the user does "foo.ba<TAB>",
the Item-Model i.e. adds an child for the "foo" and fills it with the
properties the engine returns for "foo", then the completer performs.

It would be nice if the completer could send the content parent path
elements, i.e. foo.bar in foo.bar.baz<TAB>, to the model, so it can
fetch content from the engine.  After the model method for this
returned,  the actual completion should be performed.

Is signaling some data to the model within the completer (not
Model-Indexes) covered by the @Completor<->QAbstractItemModel design?

Best,
 -- Maik



More information about the Qt-interest-old mailing list