On Apr 11, 2012, at 9:57 AM, ext BogDan wrote: > Hi Girish, > > I know that almost all QPA API are internal, I'm using them from the > > very begging :) ! > > > The problem is sometime if you want to create a clean API you also > > must to change other APIs which are public. Let me give you an example > > for better understanding. The QMenu subclass QWidget class, so you > > can use QWidget::show() method to show the menu, the problem is that > > method is not virtual and can not be overwritten in QMenu. Why I want to > > overwrite it? Because I don't want to show the QMenu widget on Android, > I want to use Android's native menu system, this means that show method > > must be changed to virtual, but I'm afraid that you can not do it after the > API/ABI is labeled as stable. Qt 5.0 will guarantee the API/ABI stability for > the entire life of Qt 5.x meaning that the next chance to do these changes > will be 5-10 years from now!
I think you are going about it the wrong way here. Subclassing and re-implementing virtual functions from the public API is a tool for application developers, not for platform developers. What you (and I) do instead is to change the QMenu::show implementation to not show a widget on the platform in question. In Qt 4 we've done this with Q_WS #ifdefs, in Qt 5 we aim to have a much better QPlatformMenu API. Morten _______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
