PDA

View Full Version : 4.3.1 vs 4.1.4 setfixedwidth (bugs??)



zorro68
23rd September 2007, 14:02
I worked with visual studio 2005 and 4.1.4. Now I have installed 4.3.1 and works fine (I thought). I have 2 QDockWidget, one I want to be fixed (it's width) and the other no fixed when i resize the windows.
When I compile my project with 4.1.4 version works fine, but with this version the two QtDockwidget resize. My code is:



glWidgetArea = new QScrollArea();
glWidgetArea->setWidget(glWidget);
glWidgetArea->setWidgetResizable(true);
glWidgetArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOf f);
glWidgetArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff) ;
glWidgetArea->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
glWidgetArea->setMinimumSize(100, 100);

QDockWidget *ogldock = new QDockWidget(parent);
ogldock->setAllowedAreas(Qt::LeftDockWidgetArea);
ogldock->setFeatures(QDockWidget::NoDockWidgetFeatures);
ogldock->setWidget(glWidgetArea); <- this resize

QDockWidget *gdock = new QDockWidget(parent);
gdock->setAllowedAreas(Qt::RightDockWidgetArea);
gdock->setFeatures(QDockWidget::NoDockWidgetFeatures);
gdock->setFixedWidth(250); <- this would be fixed, but it doesn't
gdock->setWidget(toolBox);


I have prove this at the end of this code



toolBox->setFixedWidth(250);


and toolBox inside gdock is fixed but the area around resize. ogldock and gdock area resize 50% for each.

zorro68
23rd September 2007, 14:21
I have just solve my problem with this line:

gdock->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Igno red);


Thanks