Results 1 to 2 of 2

Thread: Use Organigramm to manage database

  1. #1
    Join Date
    Mar 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Use Organigramm to manage database

    Hello!

    This is my first post in this forum, so a big "Hello World"

    I'm from germany so excuse my bad english please...

    I'm currently writing a chatbot based on Regular Expression for Triggers and Outputs stored in a database. That is right now working very well and you can already chat with the bot. The bot can also make "real conversations" about the "statement->answer->forget" sheme... In the database, there are two more fields that can either specify a topic (if the field in the entry is filled) or check whether a topic is currently set and only match the regex if the topics match. Here's a short example on how that works:

    User: Hello Bot!
    Bot: Hello User.
    User: How are you?
    Bot: I'm fine, and how are you? <---- Here the topic is set to... hm, let's say "feeling"
    User: I'm fine, too. <--- Now, only database fields with the "If Topic"-Field "feeling" will be compared to the user entry.
    Bot: That's nice

    That would mean, if the user would have entred the "I'm fine, too." without the question by the bot before, the bot wouldn't have recognized the answer and outputed "That's nice". But that is not too important for my question.

    After I've finished the said i now want to create a dialog in that the user can modify the database, with an optimized view for my needings. I've currently an QTableView, but that doesn't look very nice with over 1000 entries for bot answers. The table showes only 20 entries so the scrollbar on the right side is very small and scrolls very much entries with every moving

    Now i've slept over the whole thing one night and, as i hoped it would, i got a nice idea how to solve that. Above i wrote that conditions in the database can be connected via "topics" to other conditions, that can be itself be connected to some condition(s) again and so on. So the best way to solve this would be to display the database in a kind of family tree, that get it's relation-model out of the "topic" system in the database.

    So my first question is: Is it possible to create some kind of family tree in QT or is there any workaround that would allow me to do it?
    And the first question: Could it be used with a database as I said above?

    Thanks a lot in advance,

    Jonathan

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Use Organigramm to manage database

    Yes, it's possible although it's a bit of work. You need to implement a proxy model that will sit between the sql model and the tree view (you have to switch to using QTreeView instead of QTableView) and translate the flat model to a hierarchical one.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Threads and database connection
    By probine in forum Qt Programming
    Replies: 9
    Last Post: 7th August 2013, 08:30
  2. Multiple database connections
    By cyberboy in forum Qt Programming
    Replies: 3
    Last Post: 30th March 2008, 16:56
  3. Database Master-Detail Entry Form
    By Phan Sin Tian in forum Newbie
    Replies: 4
    Last Post: 3rd February 2008, 14:31
  4. How to manage QSqlTableModel database operations?
    By Abk in forum Qt Programming
    Replies: 1
    Last Post: 19th September 2007, 10:44
  5. Filling combobox from database
    By Philip_Anselmo in forum Qt Programming
    Replies: 3
    Last Post: 11th May 2006, 17:53

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.