[Development] Qt5 missing features

BogDan bog_dan_ro at yahoo.com
Wed Apr 11 11:40:15 CEST 2012


----- Original Message -----

> From: "morten.sorvig at nokia.com" <morten.sorvig at nokia.com>
> To: development at qt-project.org
> Cc: 
> Sent: Wednesday, April 11, 2012 11:51 AM
> Subject: Re: [Development] Qt5 missing features
> 
> 
> 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
> 

There is no QMenu::show, and this is the problem !:). When you call QMenu::show it will actually call QWidget::show() and you'll end up with the widget on your screen. Of course there are workarounds to "fix" this problem, but they should be used in Qt4 not in Qt5! IMHO Qt5 should get rid of all these  workarounds.

BogDan.



More information about the Development mailing list