A
Alex Gusarov
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). The only thing I done its
full replacement of handler:
calendar.paintCell = myPaintCell
def myPaintCell(self):
pass
Operator += don't work with methods. So, I can't add handler or call
standart handler from my (infinite recursion, cause my handler
replaced standart)
Please, give me some advice, I know Python must be good enough to do
such things fast and elegant.
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). The only thing I done its
full replacement of handler:
calendar.paintCell = myPaintCell
def myPaintCell(self):
pass
Operator += don't work with methods. So, I can't add handler or call
standart handler from my (infinite recursion, cause my handler
replaced standart)
Please, give me some advice, I know Python must be good enough to do
such things fast and elegant.