Results 1 to 20 of 24

Thread: setText in QToolButton ( qt4 )

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Posts
    157
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Default setText in QToolButton ( qt4 )

    Hi,

    I have a QToolButton which is having a "QPixmap" loading from resourcefile ( MyResourceFile.qrc ) , with Qt3Support.

    After setting setting pixmap , am setting text in QToolButton uisng setText(). But in GUI it is not showing the TEXT , instead displays only the QOixmap.

    see the code..
    Qt Code:
    1. MyMainWindow::MyMainWindow()
    2. {
    3. --------
    4. ---------
    5.  
    6. QToolButton *btn= new QToolButton( QIcon(":Images/imageOne.png"), tr("Quit"),
    7. tr("Quit"), this, SLOT( close() ), myToolBar, "Quit"); //setting pixmap in QToolButton
    8.  
    9. btn->setText("My Text......"); //setting text in QToolButton
    10.  
    11.  
    12. ---------
    13. ---------
    14. -------
    15. }
    To copy to clipboard, switch view to plain text mode 


    Why this is not showing the text in QToolButton...??????
    please help me
    Last edited by jacek; 3rd July 2007 at 20:39. Reason: wrapped too long line

Similar Threads

  1. QToolButton text alignment
    By Vladimir in forum Qt Programming
    Replies: 6
    Last Post: 2nd March 2007, 07:42
  2. QSqlRelationalDelegate Draw a clickable QToolButton
    By patrik08 in forum Qt Programming
    Replies: 5
    Last Post: 1st March 2007, 20:59
  3. Replies: 1
    Last Post: 26th November 2006, 09:32
  4. Problem with qtoolbutton
    By moowy in forum Qt Programming
    Replies: 1
    Last Post: 22nd September 2006, 13:30
  5. Need help with QToolButton
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 22nd April 2006, 14:55

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.