Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Custom Completer Example - strange behavior
Forum Updated to NodeBB v4.3 + New Features

[Solved] Custom Completer Example - strange behavior

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nvcnvn
    wrote on last edited by
    #1

    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)

    1 Reply Last reply
    0
    • N Offline
      N Offline
      nvcnvn
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved