Results 1 to 3 of 3

Thread: windowTitle truncated

  1. #1
    Join Date
    Aug 2013
    Posts
    5
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default windowTitle truncated

    Hello,

    I have a QDialog with a title. The title is relatively long and as such the default size for the window (the sizeHint) is such that the windowTitle is truncated. Is there a way to set a property on a widget that causes the length of the windowTitle to be taken into consideration when calculating the size hint or do I have to either manually override the sizeHint and re implement it or provide a hardcoded minimum size?

    It seems to me that this should be handled automatically by the layout manager if desired by the user.

    Thanks.

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 453 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: windowTitle truncated

    Is there a way to set a property on a widget that causes the length of the windowTitle to be taken into consideration when calculating the size hint or do I have to either manually override the sizeHint and re implement it or provide a hardcoded minimum size?
    It is not possible directly, you will have write a custom sizeHint() based on the length of the text in the title, and font used by the theme of window.

    It seems to me that this should be handled automatically by the layout manager if desired by the user.
    Layout managers are responsible for layout inside the widget, and title bar is not part of the widget, it is frame provided by OS window manager which is not manged by applciation, so there is no way layout manager can poke into it.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. The following user says thank you to Santosh Reddy for this useful post:

    sandsaturn22 (3rd September 2013)

  4. #3
    Join Date
    Aug 2013
    Posts
    5
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: windowTitle truncated

    Ok that makes sense. Thank you.

Similar Threads

  1. QListWidget's strings get truncated in dialog
    By alxobr in forum Qt Programming
    Replies: 2
    Last Post: 7th June 2011, 12:43
  2. Avoiding Truncated Labels
    By ChrisW67 in forum Qwt
    Replies: 5
    Last Post: 7th July 2009, 07:34
  3. QFile resized files gets truncated after writing
    By MaximA in forum Qt Programming
    Replies: 1
    Last Post: 24th May 2008, 17:23
  4. windowTitle in an MDI application
    By charlesD in forum Qt Programming
    Replies: 2
    Last Post: 21st November 2006, 14:23
  5. QGroupBox title truncated on both sides
    By Gopala Krishna in forum Qt Programming
    Replies: 2
    Last Post: 7th October 2006, 15:02

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.