Thank you for the tip Jérôme!
I will silence the warnings for that
https://forum.qt.io/topic/93238/disabling-compiler-warnings-in-creator-editor/12
Now I get that it the old style cast was about the "ay" to
GVariantType conversion, It would have been nice if QtCreator says
where it sees the cast
It's the macro G_VARIANT_TYPE_BYTESTRING itself that make the warning, you can
either edit the macro or simply add one that would not do the C cast:
(MyType)variable
which is not really safe and have better alternative for C++, since the type is
known a static_cast should be used instead:
but this is about G_VARIANT_TYPE_BYTESTRING which is #defined in
gvarianttype.h as commented in the original message and casting this
has no effect:
static_cast(G_VARIANT_TYPE_BYTESTRING)
On Tue, Aug 20, 2019 at 4:13 PM Jérôme Godbout wrote:
>
> You should use static_cast instead of old C cast:
Hi.
I am in the middle of refactoring a library, which I am going to publish
open source.
I found mysefl stuck reconsidering API in terms of interobject
communication.
There is a central class that have several signals, and I try to imagine
what library user could do in corresponding slots:
You should use static_cast instead of old C cast:
((const GVariantType *) "ay")
should be
static_cast("ay")
-Original Message-
From: Interest On Behalf Of Damian Ivanov
Sent: August 20, 2019 5:51 AM
To: interest@qt-project.org
Subject: [Interest] old style cast
Hello,
What is the
Hello,
What is the correct way to do the following so it doesn't warn about
the use of old stylecast?
//G_VARIANT_TYPE_BYTESTRING = is defined in gvarianttype.h
// #define G_VARIANT_TYPE_BYTESTRING ((const GVariantType *) "ay")
// value is of type GVariant *value
if