[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Re-implemented function doesn't get called from internal
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2009-11-25 17:09:24
Message-ID: 074347a0487d5f5b7cd46ca4cfc805fd () localhost
[Download RAW message or body]

On Wed, 25 Nov 2009 15:15:37 +0000, Jugdish <jugdizh@gmail.com> wrote:
> I have written my own class derived from QTabBar with a re-implementation
> of
> the QTabBar::initStyleOption() method, but for some reason it never gets
> executed.
> 
> Here is my code:
> 
> ########################################
> from PyQt4 import QtGui
> 
> class MyTabBar(QtGui.QTabBar):
> 
>     def initStyleOption(self, option, tabIndex):
>         print "inside initStyleOption"
>         QtGui.QTabBar.initStyleOption(self, option, tabIndex)
> ########################################
> 
> Looking at the Qt source code for QTabBar (qtabbar.cpp), I see that
> initStyleOption() is called inside the paintEvent() method, so I should
be
> seeing my print statement on every paint event.
> 
> Any idea what I'm doing wrong?

The C++ method isn't virtual so you can't reimplement it.

Phil
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic