Results 1 to 6 of 6

Thread: Button icon and text

  1. #1
    Join Date
    Oct 2009
    Posts
    30
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Button icon and text

    Hi all,




    I get screen shot like this

    As follows:How can I do?


  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: Button icon and text

    You can use style sheet.
    QPushButton{
    background-image: url(:/images/ImageNamepng)
    background-position: top center;
    }

  3. #3
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Button icon and text

    what you want to achieve.. the first one or the 2nd or both?

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Button icon and text

    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  5. #5
    Join Date
    Oct 2009
    Posts
    30
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Button icon and text

    sorry form my bat english
    I write the name of the button config file
    buttonsNames = stringToList(std::string("buttonsname"));

    looks like this is the first image.

    I like the image to obtain the second picture.

    How should I follow a method?

  6. #6
    Join Date
    Oct 2009
    Posts
    30
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Button icon and text

    Hi i don't edit my message and i must write this message as so sory

    I want to showing picture and text in QPushButton. But text is showing right the picture. How can i show picture is top and text is buttom?

    P.S: @spirit i don't used QToolButtonStyle. must i be include to library?
    Last edited by electronicboy; 9th October 2009 at 22:32.

Similar Threads

  1. Differentiate the icon and text in a QTreeView column
    By gmat4321 in forum Qt Programming
    Replies: 0
    Last Post: 25th February 2009, 15:38
  2. How to write some text next to the system tray icon?
    By alex chpenst in forum Qt Programming
    Replies: 3
    Last Post: 5th September 2008, 08:43
  3. button with backgr and icon using stylesheets
    By s_p_t10 in forum Qt Programming
    Replies: 0
    Last Post: 7th May 2008, 20:19
  4. QPushButton, Icon right of text [solved]
    By Mike in forum Qt Programming
    Replies: 5
    Last Post: 31st January 2008, 20:53
  5. Icon only button
    By bruccutler in forum Newbie
    Replies: 9
    Last Post: 19th January 2007, 19:20

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.