PDA

View Full Version : windowTitle truncated



sandsaturn22
30th August 2013, 20:13
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.

Santosh Reddy
31st August 2013, 11:49
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.

sandsaturn22
3rd September 2013, 14:32
Ok that makes sense. Thank you.