Results 1 to 7 of 7

Thread: QToolButton will not display its icon

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2007
    Posts
    31
    Thanks
    11

    Default QToolButton will not display its icon

    Hello,

    First, I want to thank the Qt Forum community for providing this great service. Many, many thanks.

    My latest problem with a port from Qt 3 to Qt 4 is a QToolButton will not display its icon.
    This was working code in Qt 3:

    Qt Code:
    1. QToolButton* myToolButton;
    2. QWidget* layoutWidget;
    3. QHBoxLayout* hboxLayout;
    4.  
    5. myToolButton = new QToolButton(layoutWidget);
    6. myToolButton->setObjectName(QString::fromUtf8("myToolButton"));
    7. myToolButton->setIcon(QIcon(QString::fromUtf8("images/icon_xpm")));
    8. myToolButton->setCheckable(true);
    9.  
    10. hboxLayout->addWidget(myToolButton);
    11.  
    12. myToolButton->setToolTip("...");
    13. myToolButton->setText(QString("..."));
    14.  
    15. editModeButtonGroup_->addButton(myToolButton, 0);
    To copy to clipboard, switch view to plain text mode 


    The dialog box displays and the buttons function, but they don't display their icon image. Any insight as to what's wrong?

    Thanks again,
    Jim Brown
    Last edited by wysota; 9th March 2007 at 00:58. Reason: missing [code] tags

Similar Threads

  1. Replies: 8
    Last Post: 18th March 2011, 11:27
  2. QSystemTrayIcon doesn't show icon ?
    By probine in forum Qt Programming
    Replies: 3
    Last Post: 25th January 2007, 19:17
  3. Problem with qtoolbutton
    By moowy in forum Qt Programming
    Replies: 1
    Last Post: 22nd September 2006, 13:30
  4. Displaying Icon
    By Seema Rao in forum Qt Programming
    Replies: 4
    Last Post: 9th February 2006, 20:43
  5. How to dispay an icon in the first column of QTreeView
    By yogeshm02 in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2006, 15:51

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.