Re: [Interest] clazy - why signals shouldn't be const?

2018-07-09 Thread Sérgio Martins via Interest

On 2018-07-09 11:43, Tomasz Siekierda wrote:

Hi,

perhaps not the best list to ask, but hopefully somebody more familiar 
with

clazy will comment.

Why does clazy complain about const signals?


It's not wrong to use const signals.
That check is for developers that don't like changing state from const 
methods (and a signal implies state was changed).

If it doesn't bother you then you can disable the check.

But I'll remove it from the default group, make it opt-in and update the 
readme. As you're not the first one to ask.




Regards,
--
Sérgio Martins | sergio.mart...@kdab.com | Senior Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel: Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - The Qt, C++ and OpenGL Experts
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] clazy - why signals shouldn't be const?

2018-07-09 Thread Tomasz Siekierda
On Mon, 9 Jul 2018 at 13:17, Sérgio Martins  wrote:

> On 2018-07-09 11:43, Tomasz Siekierda wrote:
> > Hi,
> >
> > perhaps not the best list to ask, but hopefully somebody more familiar
> > with
> > clazy will comment.
> >
> > Why does clazy complain about const signals?
>
> It's not wrong to use const signals.
> That check is for developers that don't like changing state from const
> methods (and a signal implies state was changed).
> If it doesn't bother you then you can disable the check.
>
> But I'll remove it from the default group, make it opt-in and update the
> readme. As you're not the first one to ask.
>

Thank you for replying and the explanation :-)



>
>
>
> Regards,
> --
> Sérgio Martins | sergio.mart...@kdab.com | Senior Software Engineer
> Klarälvdalens Datakonsult AB, a KDAB Group company
> Tel: Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
> KDAB - The Qt, C++ and OpenGL Experts
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] clazy - why signals shouldn't be const?

2018-07-09 Thread Tomasz Siekierda
Hi,

perhaps not the best list to ask, but hopefully somebody more familiar with
clazy will comment.

Why does clazy complain about const signals?

While I agree marking signals as const is not terribly important, I've had
a few situations in code where I was emitting from const method - and then
it only works when the signal is const, too. Besides, marking a signal as
const does not result in any loss of performance etc. Is there any strong
reason not to mark signals as const?

For reference:
https://github.com/KDE/clazy/blob/master/docs/checks/README-const-signal-or-slot.md
"For signals, it's just pointless to mark them as const."
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest