hi friends ,
in normal QWidget() and QDialog() we can use
layout()->setSizeConstraint(QLayout::SetFixedSize); to prevent user to resize the teh window ..
how can i do it for graphicsView class ... there is no layout ..?
hi friends ,
in normal QWidget() and QDialog() we can use
layout()->setSizeConstraint(QLayout::SetFixedSize); to prevent user to resize the teh window ..
how can i do it for graphicsView class ... there is no layout ..?
But graphics view is normally contained in a parent widget, which has a layout. So you should try the magic there.
If graphics view is the top-level widget, guess you can use setFixedSize(QSize).
As graphics view is a scroll area it has a viewport widget (which actually displays the scene). So you might want to make that also fixed size and switch off the scrollbars. Haven't tried that part yet.
- Juergen
wagmare (24th February 2009)
I had a slightly different problem, (setting the maximum-size after which a user cannot make a window larger). But this is almost the same as setting a fixed size.
I have an example in qt designer (log in to this forum so you can see the images) in the start post here, that works for simple dialogs, but not for qmainwindows (because these have their own layout handler).
Bookmarks