Results 1 to 6 of 6

Thread: Qcombobox and model/item based question

  1. #1
    Join Date
    May 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qcombobox and model/item based question

    Good to all, I'm new to Qt4 and I have 2 questions
    1-adraft 3 Qcombobox (country, province, town) to be charged based on the select from the parent. As the data is in three tables in the database want to use the ide SQLQuerymodel is right or should I use Qabstracitemview? someone could show me a basic example how do that.

    2 - When should you use models? serious as the number of records to determine model or item

    Thanks for everything

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Qcombobox and model/item based question

    Quote Originally Posted by yaguis View Post
    1-adraft 3 Qcombobox (country, province, town) to be charged based on the select from the parent. As the data is in three tables in the database want to use the ide SQLQuerymodel is right or should I use Qabstracitemview? someone could show me a basic example how do that.
    Look at QDataWidgetMapper, it contains some example code.
    Here's another example: http://doc.qt.nokia.com/4.6/itemview...getmapper.html
    And another: http://doc.qt.nokia.com/4.6/itemview...getmapper.html

    2 - When should you use models? serious as the number of records to determine model or item
    Whenever you can, as much as possible, always. This means, always try to use models and only use the convenience widgets to show a very simple list.

  3. #3
    Join Date
    May 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qcombobox and model/item based question

    thanks for your answer,but that work with data not filtered..i think.. i need that the combos go filtering for his parent this is the table structure

    country:
    id
    country

    providence
    id
    providence
    idcountry

    person.
    id
    name
    idcountry
    idprovidence

    when i setup the relation and push the combo providence its populate with all providence, and i need that populate with only the providence of his country parent

    Thanks

  4. #4
    Join Date
    May 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qcombobox and model/item based question

    nobody solution? thanks

  5. #5
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Qcombobox and model/item based question

    Create 3 models. One for the country, one for the province and one for the person.
    When you select a country in the first combo, update the select statement of the second and third combo.
    Etc...

  6. #6
    Join Date
    May 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qcombobox and model/item based question

    Quote Originally Posted by tbscope View Post
    Create 3 models. One for the country, one for the province and one for the person.
    When you select a country in the first combo, update the select statement of the second and third combo.
    Etc...

    thanks soo much!

Similar Threads

  1. QComboBox (model based) - provide an empty entry
    By antarctic in forum Qt Programming
    Replies: 0
    Last Post: 21st October 2009, 18:45
  2. QcomboBox item height
    By Beppe in forum Qt Programming
    Replies: 9
    Last Post: 16th June 2009, 11:31
  3. Quick question about filtering item model
    By maverick_pol in forum Qt Programming
    Replies: 1
    Last Post: 20th December 2007, 16:29
  4. Replies: 14
    Last Post: 9th November 2006, 08:35
  5. QComboBox and item
    By drow in forum Qt Programming
    Replies: 4
    Last Post: 14th June 2006, 09:04

Tags for this Thread

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.