×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    45

    How do I align text below and icon on a QPushButton?

    Hi,

    This is probably a simple one to answer, but can someone tell me how to have an icon and text on the same QPushButton aligned correctly using a stylesheet in Qt Designer, i.e. the icon aligned to the top and the text aligned to the bottom? All I can seem to get is the text displaying over the icon as it is centrally aligned.

    Cheers,

    Northers.

  2. #2
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: How do I align text below and icon on a QPushButton?

    No simple way to do it cleanly. Several different fudge techniques, depending on how accurate you want to be and what specific effects you want.

    I generally overlay the button with labels to contain the info, then put a clear button over everything and wire it to animateClick() on the original button.

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    45

    Re: How do I align text below and icon on a QPushButton?

    Cheers for the reply. How about if I use a QToolButton. I see that they have an option for aligning text under an icon using ToolButtonStyle. Every time I try this though, the icon never displays and the text appears centrally aligned.

    Any ideas?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×