[Development] Qt LTS & C++11 plans (CopperSpice)
Thiago Macieira
thiago.macieira at intel.com
Tue Jun 30 22:01:49 CEST 2015
On Tuesday 30 June 2015 09:37:59 Ansel Sermersheim wrote:
> Our goal with CopperSpice is to use modern C++ internally to leverage
> everything we can from the language. We want developers of CopperSpice
> applications to have the full power of C++ available in all parts of
> their code. For example, with moc removed we support template classes
> that inherit from QObject. We support passing method pointers as signal
> arguments.
You need to use -fvisibility-inlines-hidden and retry. I don't think your
solution works under those circumstances.
> We are going to fully support exceptions, and make
> exception safety guarantees where possible.
Unless you're going to rewrite the entire GUI, widgets, networking and other
libraries from scratch, you're not going to get exception-safety.
> We are working on
> redesigning the QObject lifetime model so that it works smoothly with
> C++11 smart pointers.
I researched that 4 or 5 years ago and I found two problems:
First, you must either choose to use smart pointers everywhere or not at all.
You can't pick and choose, which is what caused most of the problems.
Second, and most importantly, all the QWidget-derived classes share state with
their parent widgets. You MUST delete the children when the parent is getting
deleted, which is incompatible with smart pointers. Like I said above for
exceptions, you'll need to redesign the entire stack to get support for smart
pointers here.
> These are some of the limitations that frustrated us when using Qt in an
> existing codebase.
You're making trade-offs. One of them, given your presentation, is that there's
no current version of MSVC that will work with your codebase. Another is that
you're replacing a code generator by a lot of boilerplate macros.
And, critically, like I mentioned above, is that I don't think your solution
works with -fvisibility-inlines-hidden, due to taking and comparing addresses
of inline functions.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Development
mailing list