eric
29th November 2007, 16:56
Hello!
My program adds widgets (QPushButtons) like this:
Layout->addWidget(MyWidget);
and removes them like this:
Layout->removeWidget(MyWidget);
several times during the code execution.
Although this simple approach works most of the time, sometimes I get weird results. Sometimes after removing my QPushButton, it no loger functions but it is still there and sitting on top of another widget that is supposed to replace it.
Questions:
1. Do you have to check for the presence of a widget before you attempt to remove it? How do you do it?
2. Does something need to be specifically refreshed or redrawn after the widget has been removed?
Thank you!
My program adds widgets (QPushButtons) like this:
Layout->addWidget(MyWidget);
and removes them like this:
Layout->removeWidget(MyWidget);
several times during the code execution.
Although this simple approach works most of the time, sometimes I get weird results. Sometimes after removing my QPushButton, it no loger functions but it is still there and sitting on top of another widget that is supposed to replace it.
Questions:
1. Do you have to check for the presence of a widget before you attempt to remove it? How do you do it?
2. Does something need to be specifically refreshed or redrawn after the widget has been removed?
Thank you!