Overloading virtual method of widget without inheriting (PyQt)

Alex Gusarov alex.m.gusarov at gmail.com
Mon May 26 11:37:04 EDT 2008


Hello, I have strong .NET background with C# and want to do some familiar
things from it with Python, but don't know how. For example, I created form
in qt designer with QCalendarWidget, translated it into Python module and
want to overload virtual method paintCell of QCalendarWidget. In C# I can
write following (abstract) code:

this.calendar.PaintCell += new PaintEventHandler(myPaintCellHandler);

void myPaintCellHandler(object sender, PaintEventArgs e) {
    // some work here
}

I can't find how I can do similar thing in Python without inheriting
QCalendarWidget and overloading this method in inherited class (it's long
and I must create additional class). So, I need to run my code whenever
paintCell is called by Qt internals and I have no enough experience with
Python for it. Please, give me some advice, I know Python must be good
enough to do such things.

--
Best regards, Alex Gusarov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080526/4b07c987/attachment.html>


More information about the Python-list mailing list