Overloading virtual method of widget without inheriting (PyQt)

Alex Gusarov alex.m.gusarov at gmail.com
Wed May 28 13:13:01 EDT 2008


> I have a feeling that the form produced by Qt Designer, once converted to
> code, contains references to QCalendarWidget where you really want to use a
> customized calendar widget. If so, you should "promote" the calendar widget
> in Qt Designer to use your widget instead, and make sure you import the
> module that supplies it in your application.

David, thanks for noticing about "promoting" within designer, it helped me.

> Anyway, IIRC (it's a long time since I used Qt), QT allows to connect
>  more than one slot with the same signal, so you should not need to
> subclass or to create your own multi-dispatcher. Just doing:
>
> calendar.paintCell.signal( SOME_SIGNAL_NAME, my_paint_method )
>
> should work. I don't know which signal you should connect to, however.
>
> This link gives you some detail on signal/slots in PyQT:

Thanks, but actually, paintCell is not a signal, it's simply a virtual
method of caledarwidget.

--
Best regards, Alex Gusarov



More information about the Python-list mailing list