Results 1 to 5 of 5

Thread: Widgets in TableView

  1. #1
    Join Date
    Jan 2006
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Widgets in TableView

    I've read several ways of going about this, and I was wondering what might be the best. Currently I have a table view/model and would like to place widgets in the cells of the table, such as a progress bar, and image, etc. Someone mentioned I might be better off just making a custom table using the grid layout. I can't seem to find any great documentation on how to do this, I would love to see an example of this somewhere.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Widgets in TableView

    Quote Originally Posted by boonie
    Currently I have a table view/model and would like to place widgets in the cells of the table, such as a progress bar, and image, etc.
    For images and progress bar a custom QItemDelegate might be a good solution.

  3. #3
    Join Date
    Jan 2006
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Widgets in TableView

    it seems like the delegate is only shown when you want to edit the cell though, or am I missing something from the model/view docs on trolltech site. Reading the api isn't helping me.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Widgets in TableView

    Quote Originally Posted by boonie
    it seems like the delegate is only shown when you want to edit the cell though, or am I missing something from the model/view docs on trolltech site.
    Actually item delegate is also responsible for drawing. See QItemDelegate::paint () method and pixelator example.

    Reading the api isn't helping me.
    It's a bit complicated. I guess there should be more examples and tutorials.

    Maybe these will help:
    http://scottcollins.net/blog/2005/09...mvc-in-qt.html
    http://scottcollins.net/blog/2005/09/more-on-mvc.html

  5. #5
    Join Date
    Feb 2006
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Widgets in TableView

    Hi Guys,

    I think I wouldbe realy interested in such example(s).
    I'm trying to come up with a layer selection widget that shows
    a QCheckBox, QLabel and QPushButton for each of such layer.
    All of this is achievable via a QGridLayout but it seems rather slow.
    QTableView seems a lot faster but I can't seem to view these
    three widgets types all the time.

Similar Threads

  1. Qt3 - Multiple transparent widgets
    By bythesea in forum Qt Programming
    Replies: 4
    Last Post: 11th September 2009, 11:24
  2. Mac OS X Top-Level Transparent Widgets
    By tinsuke in forum Qt Programming
    Replies: 0
    Last Post: 17th October 2008, 16:01
  3. Upper limit on number of widgets?
    By jdiewald in forum Qt Programming
    Replies: 1
    Last Post: 29th September 2008, 23:00
  4. Replies: 2
    Last Post: 16th May 2008, 14:39
  5. widgets behind hidden widgets not working
    By bpetty in forum Newbie
    Replies: 13
    Last Post: 7th September 2007, 20: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.