KDE/kdelibs/kdeui
Thiago Macieira
thiago at kde.org
Sat Mar 11 12:56:55 GMT 2006
Peter Kümmel wrote:
>Thiago Macieira wrote:
>> Christian Ehrlicher wrote:
>>> We discussed this two weeks ago and came to the conclusion to write
>>> it in front like Qt does. We already define KDE_DEPRECATED to
>>> Q_DECL_DEPRECATED so there is no more problem with gcc version which
>>> don't like it in the front.
>>
>> What I failed to notice when looking at the Qt4 headers is that it
>> doesn't turn Q_DECL_DEPRECATED on by default.
>
>Don't know what you mean, Q_DECL_DEPRECATED is always defined when a
> deprecated mechanism is available:
>
>qglobal.h:
>
>#if defined(Q_MOC_RUN)
># define Q_DECL_DEPRECATED Q_DECL_DEPRECATED
>#elif defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 ||
> (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2)) # define
> Q_DECL_DEPRECATED __attribute__ ((__deprecated__))
>#elif defined(Q_CC_MSVC) && (_MSC_VER >= 1300)
># define Q_DECL_DEPRECATED __declspec(deprecated)
># if defined (Q_CC_INTEL)
># define Q_DECL_VARIABLE_DEPRECATED
># else
># endif
>#else
># define Q_DECL_DEPRECATED
>#endif
I meant this section:
#if defined(QT3_SUPPORT_WARNINGS)
# if !defined(QT_COMPAT_WARNINGS) /* also enable compat */
# define QT_COMPAT_WARNINGS
# endif
# undef QT3_SUPPORT
# define QT3_SUPPORT Q_DECL_DEPRECATED
# undef QT3_SUPPORT_VARIABLE
# define QT3_SUPPORT_VARIABLE Q_DECL_VARIABLE_DEPRECATED
# undef QT3_SUPPORT_CONSTRUCTOR
# define QT3_SUPPORT_CONSTRUCTOR explicit Q_DECL_CONSTRUCTOR_DEPRECATED
You'll notice that QT3_SUPPORT is used everywhere throughout
Qt{Core,Gui,Xml,Network} between the modifier and the return type. But
it's defined to be empty unless QT3_SUPPORT_WARNINGS is defined.
The same goes for QT_COMPAT and QT_COMPAT_WARNINGS.
>my problem was that kdemacros.h does not include qglobal.h so all
>all the qt macros are unknown and the disabling in case of msvc
>does not work:
It should include QtCore/qglobal.h.
And, as I said in other emails, we should define our own
KDE_DEPRECATED_WARNINGS to turn it on and off.
Developers should use a recent compiler and turn that warning on when
writing their application, but it should not be on by default. Just like
in Qt.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
1. On frumscafte, hwonne time_t wæs náht, se scieppend þone circolwyrde
wundorcræftlíge cennede and seo eorðe wæs idel and hit wæs gód.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060311/4f32e788/attachment.sig>
More information about the kde-core-devel
mailing list