Results 1 to 4 of 4

Thread: Table view->model->set data

  1. #1
    Join Date
    Mar 2009
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Question Table view->model->set data

    I would like to display a multi coloured string in a table view. "setData" gives me the option of coloring the entite string.
    What could be alternative in this situation?

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Table view->model->set data

    create you own delegate and reimplement QItemDelegate::drawDisplay.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Mar 2009
    Posts
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Table view->model->set data

    hi sprit,

    could u be a bit more elaborative?

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Table view->model->set data

    You will need to use your own delegates for such drawing.
    Have a look at QItemDelegate and QStyledItemDelegate.

    You will need to set the delegate on your view. QAbstractItemView::setItemDelegate

Similar Threads

  1. Replies: 1
    Last Post: 18th November 2009, 23:21
  2. Table Widget Vs. Table View
    By winston2020 in forum Qt Programming
    Replies: 2
    Last Post: 19th October 2008, 09:56
  3. Table Model / View Problem -- Data Not Displaying
    By jhendersen in forum Qt Programming
    Replies: 1
    Last Post: 22nd April 2007, 06:45
  4. Model, View and Proxy
    By No-Nonsense in forum Qt Programming
    Replies: 2
    Last Post: 21st November 2006, 08:50
  5. Table model / view editing issue
    By Caius Aérobus in forum Qt Programming
    Replies: 9
    Last Post: 7th April 2006, 11:03

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.