[Solved] Custom Completer Example - strange behavior



  • I all, I just follow this great example:
    http://qt-project.org/doc/qt-5.0/tools-customcompleter.html
    I copy the code exactly except some change with the modelFromFile method, here is it:
    @
    QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName)
    {
    QStringList words;
    words
    << "break"
    << "default"
    << "func"
    << "interface"
    << "select"
    << "case"
    << "defer"
    << "go"
    << "map"
    << "struct"
    << "chan"
    << "else"
    << "goto"
    << "package"
    << "switch"
    << "const"
    << "fallthrough"
    << "if"
    << "range"
    << "type"
    << "continue"
    << "for"
    << "import"
    << "return"
    << "var";
    return new QStringListModel(words, completer);
    }
    @
    The strange thing is when I type "fal" I'm waiting for "fallthrough" pop out, but I see nothing. It can work with "break" and some but not all words.
    I'm using Kubuntu 12.04 and my partner with Ubuntu 12.04 get this behavior.
    Qt Creator 2.4.1
    Based on Qt 4.8.0 (32 bit)



  • OK, now I realize that I need to sort my list.



  • Next time you find that your issue is solved, please add a [SOLVED] tag to your topic title by editing your first post. Thanks!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.