View Full Version : how to draw a widget on another widget?
hashb
28th May 2012, 06:10
suppose I have a widget ,say, QTextEdit, it already has some corresponding attributes: text, font, color, ....
I want to draw it onto a widget of my own
how can I achieve that?
//mywidget.h
class MyWidget : public QWidget
...
//mywidget.cpp
void MyWidget :: paint()
{
//???
}
Santosh Reddy
28th May 2012, 08:41
Make your custom widget as the parent of QTextEdit
hashb
28th May 2012, 10:01
Hi Santosh, Thanks
it do works, but in some cases I have to PAINT an existing widget on my widget , any ideas about it ?
Santosh Reddy
28th May 2012, 10:16
How does these two differ? I see both of them as same.
hashb
28th May 2012, 10:29
here are some cases I can find out:
1) you can not set the widget as child
2) you want to get a snap shot
amleto
28th May 2012, 11:25
http://qt-project.org/doc/qt-4.8/qwidget.html#render
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.