Forcing Q_SLOTS on non frameworks code

Albert Astals Cid aacid at kde.org
Sat Dec 14 15:04:46 UTC 2013


El Dissabte, 14 de desembre de 2013, a les 15:58:49, Albert Astals Cid va 
escriure:
> El Dissabte, 14 de desembre de 2013, a les 14:30:14, Kevin Ottens va 
escriure:
> > On Saturday 14 December 2013 13:55:50 Albert Astals Cid wrote:
> > > Hi there, so here I am at the KF5 porting sprint at Barcelona trying to
> > > port libkdegames and I am realizing that I can not use code like
> > > 
> > >   private slots:
> > > anymore.
> > > 
> > > I understand that for frameworks libraries it is interesting to have
> > > -DQT_NO_SIGNALS_SLOTS_KEYWORDS defined so we end up with code that is as
> > > widely includable from anywhere, but forcing that to the rest of the
> > > world
> > > is a bit too much if you ask me.
> > 
> > I don't think that was intended.
> > 
> > > Can we somehow make it so that people using frameworks are not forced to
> > > add a remove_definitions so they get their code compiling?
> > 
> > Definitely need to be fixed... we need to find what ends up activating it
> > for everyone. I would guess you get the same thing for the implicit ascii
> > casts? That would not be intended either.
> 
> Yep, it's the same, I'll have a look to see where they come from.

Easy peasy.

extra-cmake-modules/kde-modules/KDECompilerSettings.cmake does

add_definitions(-DQT_NO_CAST_TO_ASCII
                -DQT_NO_CAST_FROM_ASCII
                -DQT_STRICT_ITERATORS
                -DQT_NO_URL_CAST_FROM_STRING
                -DQT_NO_CAST_FROM_BYTEARRAY
                -DQT_NO_SIGNALS_SLOTS_KEYWORDS
                -DQT_USE_FAST_CONCATENATION
                -DQT_USE_FAST_OPERATOR_PLUS
               )

I guess that'd need to be refined into something that is enabled on demand 
(i.e. for frameworks).

I am by far a cmake expert but if you guys tell me what needs to be done I can 
try to make it happen.

Cheers,
  Albert


> 
> Cheers,
>   Albert
> 
> > Regards.
> 
> _______________________________________________
> Kde-frameworks-devel mailing list
> Kde-frameworks-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kde-frameworks-devel



More information about the Kde-frameworks-devel mailing list