Results 1 to 4 of 4

Thread: Custom role in custom QAbstractTableModel

  1. #1
    Join Date
    Dec 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Custom role in custom QAbstractTableModel

    Hello,

    i have a customized QAbstractTableModel and in the lines of a column i want to display an QIcon and a QImage and some text, side by side. Im using Qt:ecorationRole for the QIcon and Qt:isplayRole for the text, but i don't really know how can i include the QImage too. Any help? I tried to create a custom role, but i couldn't make it work :T

  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: Custom role in custom QAbstractTableModel

    You don't create custom roles, you just use them. You need to provide a delegate that will be aware of your custom role and will render it to the item.
    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. #3
    Join Date
    Dec 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Custom role in custom QAbstractTableModel

    Okay... how do i make this delegate?

  4. #4
    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: Custom role in custom QAbstractTableModel

    Well... you implement it.
    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. QAbstractTableModel , custom data
    By akon in forum Newbie
    Replies: 0
    Last Post: 17th April 2009, 16: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.