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

Zhongmiao Li mars.leezm at gmail.com
Sun Dec 12 23:02:57 CET 2010


Thanks!  And is someone familiar with QScript?
What usually causes the following error meesage?

TypeError: Result of expression 'canvas' [undefined] is not an object.

My code is
var canvas = document.getElementById('tutorial');
    var ctx = canvas.getContext('2d');

The error is throwed in the second line.
 Thanks a lot !

On 12/12/10, J-P Nurmi <jpnurmi at gmail.com> wrote:
> 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
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>


-- 
Best regards
Li Zhongmiao
Digital Media, College of Computer Science, Zhejiang University




More information about the Qt-interest-old mailing list