[Qt-interest] [SOLVED] Re: Q_ENUM registering Problem
Aaron Lewis
aaron.lewis1989 at gmail.com
Thu Apr 15 12:12:53 CEST 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 04/15/2010 04:23 PM, Reece Dunn wrote:
>
> Anything defined in a class needs to be qualified by that class name
> (it acts like a namespace scope). Therefore, you need to access MState
> as mpainter::MState.
Thanks for that.
>
> Enumeration values in C++ do not have the enumeration name as a scope
> qualifier. Therefore, you don't access ready through
> mpainter::MState::ready, but mpainter::ready.
>
> Thus, you have:
> QString aa = fetchPic(mpainter::ready);
>
> Also, by default, anything declared in a class is private, so you may
> get an error about not being able to access the enumeration or its
> values. You therefore need something like this:
>
> public:
> enum MState{ready,wait,lost};
Yeah , you got it Reece , anything by default is private , i should put
it in public clearly.
>
> HTH,
> - Reece
- --
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkvG5qUACgkQvf41sEptMqCtUgCePcTCx89U0UD/UEz5yeimW6SM
CZ0Ani/WEuhMg8hxOPPZsIVDLjqu8yqu
=btK8
-----END PGP SIGNATURE-----
More information about the Qt-interest-old
mailing list