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. Completer should use an extern library to complete the path

Completer should use an extern library to complete the path

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 187 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.
  • Q Offline
    Q Offline
    Qwyyn
    wrote on last edited by Qwyyn
    #1

    In a first try I created a simple tree, where the user can give a symbol via a dialog window (for example a symbol that belongs to a class "sym"). This string is then transferd to a function of a QAbstractItemModel symbolModel, that checks in a external library if this symbol is existing. If it is existing, it creates an AbstactItem for it and in a recursive call all members (for example "foo") of the class are added to the AbstractItem as children ("sym.foo"). With that I can represent the symbols with QTreeView.

    Now in a next step, I want that there is a completer that helps the user to write the possible symbols. But all the possible symbols are in an external library (or on a drive ) and not yet in a model, since I just want the symbols in the model symbolModel that are really needed by the user.

    My only idea is to create an intermediateModel (maybe a QStringListModel) that saves all symbols that start with the first letter given by the user. As soon as the user gives a second letter, the intermediateModel deletes all "twigs" that do not match the second letter (and holds just a subset of the start set). As soon as the user has decided which symbol it should be, this one will then be delegated to the QAbstractItemModel that is used by the QTreeView.

    Does somebody know, how I can code this? Thanks a lot for any help

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Why not parse that external data at the start of your application to build the data for your completer ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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