[Qt-interest] Problem with widget + opengl

Gilles Valette gilles.valette at univ-reims.fr
Mon Dec 7 20:04:17 CET 2009


Message de fungos <fungos at gmail.com>:

> Yeah, sorry about that. I added a (short) description of the problem
> as code comment and it got hidden by the code.
>
> "// Issue 1: Menu doesn't work - I can't click it" - It just doesn't
> receive clicks or doesn't respond to them. The menu is there, but it
> "does not work".
> "// Issue 2: Layout doesn't work - widgets get over each other" - I
> try to add some widget to a QVBoxLayout and all widgets get stuck in
> the same position.
>
> Anyway, this is not meant for debugging, the code is plain and simple,
> it must be some wrong usage that someone with Qt experience can spot
> very easily.
>

Hi,

Just change in Scene.cpp lines 26-29 to:

         widget->setLayout(new QVBoxLayout);
         widget->layout()->addWidget(new QCheckBox("Check 1"));
         widget->layout()->addWidget(new QCheckBox("Check 2"));
         widget->layout()->addWidget(new QCheckBox("Check 3"));

Menu and layout will work.

Regards,

Gilles





More information about the Qt-interest-old mailing list