You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Sunday, August 7th 2005, 4:13pm

How to disable automatic dialog resizing?

Hi, I have a modeless dialog in Qt4 that I fill with some text labels that changes dynamically.
Sometimes, the text labels are rather long, which results in a rather big dialog.
Even more annoying is that the dialog changes it size frequently.
Is there a way to disable automatic resize, but still allow the user to resize the dialog manually?
I cannot and dont want to use word wrapping, it's ok if the string is cut of.

Thanks,
r.

Michiel

Trainee

  • "Michiel" is male

Posts: 112

Location: The Netherlands

Occupation: Student / Programmer

  • Send private message

2

Sunday, August 7th 2005, 4:38pm

Try giving the dialog a maximum-width. I haven't tried it, but it should work.

Widgets stubbornly stop resizing if they're at their minimum or maximum sizes.

3

Sunday, August 7th 2005, 6:01pm

That doesn't work I'm afraid, the user should still be able to resize the dialog to whatever size he sees fit. I just want to disable the automatic resizing.

  • "wysota" is male

Posts: 4,276

Location: Warsaw, POLAND

  • Send private message

4

Sunday, August 7th 2005, 9:12pm

Subclass QLabel and have it cut off the text if it is too wide. Alternatively don't put those labels in a layout, this way the parent widget won't be resize for the content to fit.

5

Tuesday, August 9th 2005, 12:34am

Uset setSizeGripEnabled to turn off resizing grip and setFixedSize to setup ur desired size... should work (works for me)
GOD BLESS THE MANUALS AND FORUMS!