[Qt-interest] update contents of QWidget
Nikos Chantziaras
realnc at arcor.de
Thu Jun 3 05:15:28 CEST 2010
On 06/03/2010 06:05 AM, Dr. X wrote:
> Hi All,
>
> I would like to dynamically add a set of QPushButton objects in a
> QWidget object after the program is in the main .exec() loop. The data
> hierarchy is like this:
> QMainWindow -> QWidget -> QPushButton
> ...
> -> QPushButton
> I know how to create and position QPushButton objects in a QWidget
> object before QMainWindow::show(). But after the program enter the main
> loop, any newly created objects under that QWidget are not shown. I
> checked out the painter example. But that is not what I want. Would you
> please help? Thanks a lot.
I assume the QWidget has been made the central widget with
QMainWindow::setCentralWidget(). In that case, anything you add to the
central widget must be shown explicitly. In your case, QPushButton::show().
More information about the Qt-interest-old
mailing list