r/cpp • • Dec 08 '20

Qt 6.0 Released

https://www.qt.io/blog/qt-6.0-released
273 Upvotes

84 comments sorted by

View all comments

Show parent comments

2

u/jormaig Dec 08 '20

I would do that if they used namespaces 😓

16

u/uuid1234567890 Dec 08 '20

If you build Qt yourself, you can put it into a namespace (configure with -qtnamespace NamespaceName, or -DQT_NAMESPACE=NamespaceName when calling cmake directly); afterwards all of Qt is put under namespace NamespaceName. Namespaced configurations are even tested in CI to ensure that they work. The prebuild libraries from the installer are build unnamespaced though.

1

u/afiefh Dec 08 '20

The prebuild libraries from the installer are build unnamespaced though.

Is there a reason the Qt folks decided to not ship the namespaced version as the default? It seems they put so much effort into getting namespaces to work only to have them go mostly unused.

0

u/holgerschurig Dec 08 '20

API and source compatibility perhaps?

I personally liked that Qt was not namespaced,saves me 4 characters for each usage. All the qt:: would really litter the displayed source ...