|
|
On 16.06.06 11:58:29, Andrew Medico wrote:
> How would I go about subclassing a widget (say a QLabel) so that the base
> class
> widget is a child of the subclass? (I want to draw the base class widget
> inside
> a QFrame)
Huh?
> I know I could do this by making a custom QWidget and making a QLabel a
> member
> object, but then I'd have to do a ton of overhead to wrap all the QLabel's
> signals and slots.
Aah.
> Any thoughts? I hope it's possible and I'm just missing something basic.
I think you're taking the wrong approach. Could you explain a bit more
what you're trying to accomplish? Just painting a QLabel onto a QFrame
can be done without any subclassing, by just making the label a child
object of the frame.
Extending the painting of the label can be done by subclassing and
overriding the paintEvent method, possibly calling the QLabel's paint
event. Then you'd put an instance of the subclass as qlabel onto your
frame.
Andreas
--
Alimony and bribes will engage a large share of your wealth.
--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/
|
|