[Qt-interest] squeeze a string for display

Daniel Franke franke.daniel at gmail.com
Thu Jun 3 22:08:20 CEST 2010


Hi all.

I want to compress/squeeze a string for display, but can't find the proper way 
to do it.

Consider:

      +---------------------------------+
      | A string too long for this widget as it overruns the border
      +---------------------------------+

I'd like to display this either as

      +---------------------------------+
      | A string too long for this ...  |
      +---------------------------------+
or
      +---------------------------------+
      | A string too ... the border     |
      +---------------------------------+

instead of increasing the widget, which is what I currently have:

      +------------------------------------------------------------+
      | A string too long for this widget as it overruns the border|
      +------------------------------------------------------------+

Could someone be so kind to point me to the appropriate section of the docs?
I can't find anything myself.

Thanks

	Daniel


P.S. In case it's significant: the string to squeeze is the title of a 
groupbox which shall be a filename - depending on the filesystem, this title 
may be rather long.



More information about the Qt-interest-old mailing list