Results 1 to 3 of 3

Thread: Icon in QToolBox

  1. #1
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Icon in QToolBox

    I tried simply
    Qt Code:
    1. toolBox->setItemIcon(0,QIcon(":/images/test.png"));
    To copy to clipboard, switch view to plain text mode 
    but nothing appear in the tab of the QToolBox.
    I have correctly update the resource file and save the image in images folder
    Something missing?

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Icon in QToolBox

    Your code is fine, means it will set the icon for sure. But the problem is its not finding the image file. There is some problem with your resource. You can prove it by giving absolute path of the image in QIcon for try only.

  3. #3
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Icon in QToolBox

    The file is there, and the same syntax I used also for other icons.
    I discovered that if I add the item with
    Qt Code:
    1. toolBox->addItem(widhte,icon,text);
    To copy to clipboard, switch view to plain text mode 
    all works.


Similar Threads

  1. QMessageBox missing icon
    By zanth in forum Qt Programming
    Replies: 3
    Last Post: 8th July 2010, 21:20
  2. Problem with application icon
    By sanjayshelke in forum Qt Programming
    Replies: 4
    Last Post: 8th September 2009, 10:21
  3. How to get pushbutton as an icon
    By Pembar in forum Newbie
    Replies: 1
    Last Post: 12th May 2009, 19:59
  4. Couple of questions: main window icon + toolbar icon
    By bpackard in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2008, 19:03
  5. Mac application and the Dock Icon
    By sekelsenmat in forum Qt Programming
    Replies: 3
    Last Post: 26th September 2007, 10: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
  •  
Qt is a trademark of The Qt Company.