[Qt-interest] Display a widget inside its parent widget

J-P Nurmi jpnurmi at gmail.com
Sun Dec 12 17:34:14 CET 2010


On Sun, Dec 12, 2010 at 5:45 PM, Zhongmiao Li <mars.leezm at gmail.com> wrote:
>
> There should be a blue widget in the up-left corner of the parent widget. But in fact there is not. But if I change into  QWidget* smallWidget =new QWidget (widget);
>
> It will be OK( a blue widget appears). So can you tell me why this happens? Really thanks very much!!!

Hi,

See Qt Style Sheets Reference:
http://doc.qt.nokia.com/4.7/stylesheet-reference.html#qwidget-widget

"If you subclass from QWidget, you need to provide a paintEvent for
your custom QWidget..."

--
J-P Nurmi




More information about the Qt-interest-old mailing list