Results 1 to 4 of 4

Thread: QToolButton doesn't fit to text width

  1. #1
    Join Date
    Nov 2014
    Posts
    4
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QToolButton doesn't fit to text width

    Hi, I have a QToolButton which doesn't fit to text width on Linux.
    Is there a "FitToText" method I can call?
    Thx
    Last edited by nnzz; 13th July 2016 at 11:31.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QToolButton doesn't fit to text width

    It should do that by default.
    Do you have the button on a toolbar? or in a layout?

    Cheers,
    _

  3. #3
    Join Date
    Nov 2014
    Posts
    4
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QToolButton doesn't fit to text width

    It's in a layout. The text on one ToolButton is a bit longer than the others, and it is clipped

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QToolButton doesn't fit to text width

    Check that there are no size restrictions, like a minimum size or any of the button's parents not being in a layout, etc.

    Cheers,
    _

Similar Threads

  1. Align text and icon of QToolButton on center
    By bibhukalyana in forum Qt Programming
    Replies: 7
    Last Post: 24th November 2014, 12:46
  2. Replies: 1
    Last Post: 7th March 2013, 20:47
  3. Hhilight text of QToolButton or QPushButton
    By bahbah30 in forum Qt Programming
    Replies: 1
    Last Post: 15th September 2011, 08:25
  4. QToolButton - doesn't change icons when pressed
    By walsha3000 in forum Qt Programming
    Replies: 1
    Last Post: 21st February 2010, 10:03
  5. QToolButton text alignment
    By Vladimir in forum Qt Programming
    Replies: 6
    Last Post: 2nd March 2007, 07:42

Tags for this Thread

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.