[Development] Dropping the Q prefix from class names

Sivan Greenberg sivan at omniqueue.com
Sun Apr 1 17:22:29 CEST 2012


Hey Joao,

On Sun, Apr 1, 2012 at 6:04 PM,  <joao.abecasis at nokia.com> wrote:
> The first one introduces a Q namespace, which replaces the Q prefix in
> Qt5. The second patch drops the prefix in class names. This brings the
> C++ API more in line with the QML/JavaScript one and will hopefully help
> move all remaining C++ developers to JavaScript.
>
Do we really want to force all devs to move to JavaScript? From the
feedback I'm seeing around the community and companies that do
professional Qt development (Nokia included ;)) C++ is still the
serious way to do thing, while QML is for the UI and UX.

If We're already in the state where Qt's C++ interface can be replaced
with the QML one, then this makes a lot of sense. If this is not the
situation, then I suggest to have a transition period where which both
the namespace and the Q* in class name are still supported.

I imagine there are quite some Qt users who'd like to leverage the
performance improvements in Qt5, without having to rewrite every
single piece of code in QML. I also understand that startup times for
QML are somewhat long, even through that has been improved.

> Still pending are patches to:
>
> - propagate the change to the various modules;
> - drop the q prefix from file names
> - update fixqt4headers script to automatically fix user code
> - rename the Q::Qt namespace to Q::t
>
what does the 't' in Q::t stands for? And right, this is an intrusive
change that could bring a lot of rebuilding to existing software as
per your list of pending patches ;) Even if fixqt4headers fixes
everything automatically as per this change. Does it? :-)


> While we're at this, it would be good to improve our interoperability
> with C++11. I have another patch in the works that drops camelCase, in
> favor of the standardized names_with_underscores. The extra separation
> between words will be welcomed by those of us that use small fonts and
> ALL-CAPS editors.

Agreed! What can we do to automate legacy code support in this regard as well?

>
> We'll need a script to fix user code. Ideally, user classes and APIs
> also get ported to the new style. (I hear there's ongoing work for a
> refactoring tool in Creator, which should land Real Soon Now (tm))
>
Ah, nice does this answer my previous question?

> Again, given the impact these changes will have, I urge everyone to
> pitch in, review and help bring this effort to good harbor.
>
> Qt 5 is going to be revolutionary.
>
Qt has already been revolutionary! But I wonder how far QML is from
having similar startup times to C++ Qt, and when everything you can do
from C++ will be possible from within QML.

> Cheers,
>
>
> João
>
> PS - Help with testing alpha packages is also welcome ;-)
>
If I manage to find the time (is always a short)  I'll try to give it
some testing as well. /me wonders if it can be tested using Neccesitas
already.


Thank you for the hard work, I salute you the Qt team. The rate of
improvements and changes in the last couple of months have been
revolutionary by its own regard.

-Sivan



More information about the Development mailing list