3 Attachment(s)
QWidegt->show() pops out a new window (windows only)
Hi,
I discovered a rather strange behavior in my application under Windows. I'm developing an application under Linux and use it on Windows machines also.
I have a GroupBox holding a widget, and hide and show the widget depending on the toggled Slot of the groupBox.
In Linux this works really fine.
In Windows however the widget doesn't show when I start the application. When I click on the checkBox a second time. A new Window containing my widget pops out. I have really no idea how this can happen.
Anyone any advice?
Although I have some experience I'm not sure if this isn't a very noobish mistake and therefore post it in the newbs group.
thx for the help
Code looks something like this:
Code:
void myWidget::gbToggled(bool on){
if(on)
otherWidger->show();
else
oderWidget->hide();
}
Attachment 7959Attachment 7960Attachment 7961
Re: QWidegt->show() pops out a new window (windows only)
Re: QWidegt->show() pops out a new window (windows only)
No it was not! Thx, now it doesn't pop out anymore.
It just refuses to show itself at all now. Just a little line under box text if the box is checked.
Re: QWidegt->show() pops out a new window (windows only)
Well, you have to make sure its not sharing the same space with other widget!
Use a layout.
Re: QWidegt->show() pops out a new window (windows only)
I do.
But maybe I'm doing t wrong.
Code:
gbTimePeriod
= new QGroupBox(tr
("Zeitraumbezogen"));
gbTimePeriod->setCheckable(true);
connect(gbTimePeriod, SIGNAL(toggled(bool)), this, SLOT(gbToggled(bool)));
layout->addWidget(gbTimePeriod, 0, 0);
cabw = new ContinuousActionBaseWidget(videoPlayer, this);
lPeriod->addWidget(cabw, 1, 0);
gbTimePeriod->setLayout(lPeriod);
Re: QWidegt->show() pops out a new window (windows only)
you embed your widget inside 'layout', but didn't set 'layout' to any widget.
Re: QWidegt->show() pops out a new window (windows only)
True, its not in this part.
the setLayout is at the end of the Constructor. Other widgets are added to the layout as well.
But nevermind I already found the bug, it was just me being extremely stupid. I still had the addWidget in comments on my Windows Machine and posted code from my VBox where i actually work.
I didn't consider that because I was so flubber gusted by the widget popping out.
Anyhow thank you very much for your help and patience, have an awesome day.