[Development] Use QT_DEPRECATED_SINCE macro for specific enum values

Denis Shienkov denis.shienkov at gmail.com
Wed Aug 12 21:12:43 CEST 2015


 > If you remove C due to the macro, then D is now equal to 3 from 
incrementing its value based off of B's value instead of C.

Yes, I know it... But I talk not about it.. I talk about using 
QT_DEPRECATED_SINCE in common case, according to enum values.

What if I need to deprecate the specific value, then how need to do it 
(how to say to user about it)?

E.g. currently it does with this way:

enum Foo {
   A, B, C, D
}

#ifdef QT_DEPRECATED
#if defined _MSC_VER
#pragma deprecated(C)
#endif
#endif

So, my question is: how to deprecate the specific enum value with a 
right way for all compilers/platforms?

 > ... and that becomes a problem when you, for instance, have saved the 
value as a setting or in a data file,

hmmm.. yes.. it can be..

 > to say nothing about binary compatibility.

But BC breaks in any case when you are use QT_DEPRECATED_SINCE macro 
(yes?). E.g. when you deprecate some of public API.




12.08.2015 21:05, André Somers пишет:
>
>
> Op 12 aug. 2015 om 19:52 heeft Keith Gardner <kreios4004 at gmail.com 
> <mailto:kreios4004 at gmail.com>> het volgende geschreven:
>
>>
>>
>> On Wed, Aug 12, 2015 at 11:54 AM Denis Shienkov 
>> <denis.shienkov at gmail.com <mailto:denis.shienkov at gmail.com>> wrote:
>>
>>     > skips three making Four == 3.
>>
>>     yes, and what? :)
>>
>>
>>     > This obviously needs to be:
>>     > Four = 4
>>
>>     Ok, seems it was a bad example with One-Four.. Let's consider
>>     another abstract example:
>>
>>     enum Foo {
>>         A,
>>         B,
>>      #if QT_DEPRECATED_SINCE(5, 2)
>>         C,
>>     #endif
>>         D
>>     };
>>
>>
>> From your example, the initial values are the following:
>>   A = 0
>>   B = 1
>>   C = 2
>>   D = 3
>>
>> If you remove C due to the macro, then D is now equal to 3 from 
>> incrementing its value based off of B's value instead of C.
>
> ... and that becomes a problem when you, for instance, have saved the 
> value as a setting or in a data file, to say nothing about binary 
> compatibility.
>
> André
>
>> _______________________________________________
>> Development mailing list
>> Development at qt-project.org <mailto:Development at qt-project.org>
>> http://lists.qt-project.org/mailman/listinfo/development
>
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150812/3d613734/attachment.html>


More information about the Development mailing list