Results 1 to 4 of 4

Thread: QTableWidget + Icon

  1. #1
    Join Date
    Apr 2008
    Posts
    196
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 8 Times in 6 Posts
    Wiki edits
    1

    Default QTableWidget + Icon

    Hey @all,

    i have a QTableWidget with 5 Columns. Column 1, 3, 4, 5 were filled with data.
    In Column 2 i would like to add 1 or more Statesymbols. With 1 Symbol there aren't any problems:
    Qt Code:
    1. QIcon icon(":/images/symbol.png");
    2. icon_item->setIcon(icon);
    3. icon_item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
    4. table->setItem(row, col++, icon_item);
    To copy to clipboard, switch view to plain text mode 

    How can i add 2, 3 or more symbols after the other within 1 column?

    Lg NoRulez

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

    Default Re: QTableWidget + Icon

    You may use delegates for that, and make the delegate draw the icons

  3. #3
    Join Date
    Apr 2008
    Posts
    196
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 8 Times in 6 Posts
    Wiki edits
    1

    Default Re: QTableWidget + Icon

    I don't know about delegates, can you give me an Example

    Thanks
    Kind Regards

    NoRulez

  4. #4
    Join Date
    Mar 2008
    Posts
    25
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1

    Default Re: QTableWidget + Icon

    Quote Originally Posted by NoRulez View Post
    I don't know about delegates, can you give me an Example

    Thanks
    Kind Regards

    NoRulez
    Demos And The Assistant is the best examples for you.
    Try to look sideward Star Delegate Example

    Good luck

Similar Threads

  1. QMessageBox missing icon
    By zanth in forum Qt Programming
    Replies: 3
    Last Post: 8th July 2010, 21:20
  2. button with backgr and icon using stylesheets
    By s_p_t10 in forum Qt Programming
    Replies: 0
    Last Post: 7th May 2008, 20:19
  3. Couple of questions: main window icon + toolbar icon
    By bpackard in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2008, 19:03
  4. Mac application and the Dock Icon
    By sekelsenmat in forum Qt Programming
    Replies: 3
    Last Post: 26th September 2007, 10:23
  5. QSystemTrayIcon doesn't show icon ?
    By probine in forum Qt Programming
    Replies: 3
    Last Post: 25th January 2007, 19:17

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
  •  
Qt is a trademark of The Qt Company.