KGuiAddons and QGestures like tap/click-and-hold to open context menu?

David Faure faure at kde.org
Wed Mar 15 08:39:01 UTC 2017


On mercredi 15 mars 2017 09:27:28 CET René J.V. Bertin wrote:
> On Wednesday March 15 2017 09:07:48 David Faure wrote:
> >Definitely. But there's another solution: QObject::setProperty,
> >which supports dynamic properties so you can store anything you want in
> >there.
> I did think of something like that, but didn't get around yet to figuring
> out how.
> 
> Any idea how much overhead that  method comes with? A priori I'd just need
> to store a boolean.

Go for it, it's just one more QVariant.

> Talking about overhead, what would be cheaper, storing the result of a
> dynamic_cast in a temp. variable or calling obj->inherits()? (I could peek
> at the sources and run benchmarks but I'm not convinced it'd be worth the
> time.)

Neither, use qobject_cast.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list