Results 1 to 3 of 3

Thread: Best (and easiest) approach, QCombobox and QTableView...

  1. #1
    Join Date
    Jan 2011
    Location
    Richmond, VA
    Posts
    94
    Thanks
    14
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Best (and easiest) approach, QCombobox and QTableView...

    Soliciting thoughts from the pros out there...

    I'm working on a "nice to have" for an app and wondering what everyone's thoughts are to the best approach to what I'm trying to do...To keep it simple and not bore everyone with my father-in-law's business, consider the following example...

    A QSqlTableModel/QTableView of a DB table containing a First Name, Last Name, Sport, and Year Played.

    The model/view is not editable unless the user clicks an Add row button...

    Right now the user is entering these 4 fields by simply typing in the data -- per my father-in-law's request -- but being an Oracle programmer in real life, I'd prefer to have combobox's defined and displayed for the Sport and Year Played columns...These are separate validation/lookup tables in my DB and I can easily populate the comboboxes from them but I'm wondering what ya'll think is the easiest solution to including them in my model/view?

    Should I follow this approach? http://www.qtcentre.org/threads/4004...-in-QTableView

    Or can I use setindexwidget() to accomplish this?

    thanks!


    scott

  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: Best (and easiest) approach, QCombobox and QTableView...

    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.


  3. The following user says thank you to wysota for this useful post:

    scott_hollen (29th March 2011)

  4. #3
    Join Date
    Jan 2011
    Location
    Richmond, VA
    Posts
    94
    Thanks
    14
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Best (and easiest) approach, QCombobox and QTableView...

    Well, I feel stupid now...I'm using a delegate elsewhere but not in the same way...Didn't realize it automagically provided the combobox like this...

    Thanks!


    scott

Similar Threads

  1. Replies: 16
    Last Post: 28th April 2020, 15:40
  2. Width QTableView for QCombobox with multiple columns
    By visor_ua in forum Qt Programming
    Replies: 7
    Last Post: 21st June 2011, 11:54
  3. QComboBox in QTableView
    By giker in forum Qt Programming
    Replies: 1
    Last Post: 23rd December 2010, 11:39
  4. Replies: 10
    Last Post: 20th June 2010, 23:29
  5. QCombobox as QTableView delegate
    By martonmiklos in forum Qt Programming
    Replies: 7
    Last Post: 13th June 2010, 16:23

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.