unshaven
8th August 2012, 17:17
Hallo,
on a MainForm, I stacked a few widgets (in designer, partially overlapping, some visible by default, some not).
I have a QWidget ontop of some other things, which has three buttons on it, and a QLineEdit above them.
Those buttons are already set disabled (enabled not checked) by QtCreator designer once in a while, even if I set them to enabled again.
The widget is invisible normally, only sometimes I make it visible to show the buttons & lineedit.
Now, in the code, before using the buttons, I set everything enabled explcitly, to make sure.
But it doesn't work, and the assert at the end fails:
ui->widgetPanel->setEnabled( true );
ui->btnNo->setEnabled( true );
ui->btnYes->setEnabled( true );
ui->widgetPanel->show();
Q_ASSERT( ui->btnNo->isEnabled() );
What could be the cause of this? Does Qt have problems with layers of widgets, even if some are invisible?
It was working for a while, though, and I was changing sizes and moving widgets around, then it stopped.
(and I did check in the "widget tree" that everything is correct in the hierarchy)
on a MainForm, I stacked a few widgets (in designer, partially overlapping, some visible by default, some not).
I have a QWidget ontop of some other things, which has three buttons on it, and a QLineEdit above them.
Those buttons are already set disabled (enabled not checked) by QtCreator designer once in a while, even if I set them to enabled again.
The widget is invisible normally, only sometimes I make it visible to show the buttons & lineedit.
Now, in the code, before using the buttons, I set everything enabled explcitly, to make sure.
But it doesn't work, and the assert at the end fails:
ui->widgetPanel->setEnabled( true );
ui->btnNo->setEnabled( true );
ui->btnYes->setEnabled( true );
ui->widgetPanel->show();
Q_ASSERT( ui->btnNo->isEnabled() );
What could be the cause of this? Does Qt have problems with layers of widgets, even if some are invisible?
It was working for a while, though, and I was changing sizes and moving widgets around, then it stopped.
(and I did check in the "widget tree" that everything is correct in the hierarchy)