[Development] Enum classes in signals?

Thiago Macieira thiago.macieira at intel.com
Tue Feb 5 17:58:02 CET 2019

On Tuesday, 5 February 2019 08:43:03 PST Jason H wrote:
> While I prefer enum classes myself, I just had to connect to a signal with
> one in it. This was unfortunate as I was attempting to use the old
> connection syntax SIGNAL()/SLOT() macros. I was not aware that the old
> syntax were being deprecated? What is the policy on this?

They're not exactly deprecated, but they're older than the new syntax and they 
don't check at compile time that the connection can succeed.

> Should signals not use enum classes?

Unknown. I don't see why they shouldn't, but you haven't shared any error 
messages, so I can't tell.

> Should Qt not use enum classes?

Enum classes are fine in Qt.

> Should Qt support old connection syntax? Where/when?

Yes. It should be supported for the millions of lines of code that existed 
before the new syntax was introduced in 2012.

> Should all new connections be in the modern syntax?

Yes, if you can.

Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center

More information about the Development mailing list