[Solved] How to enable QT_DEPRECATED in Qt 5.4.0 build
-
Hi all,
How do I enable the QT_DEPRECATED flag when I build Qt 5.4.0? I am trying to build zbar against Qt, but it uses deprecated members and functions.
In file included from qt/QZBarThread.h:30:0, from qt/QZBar.cpp:28: ./include/zbar/QZBarImage.h: In constructor ‘zbar::QZBarImage::QZBarImage(const QImage&)’: ./include/zbar/QZBarImage.h:57:38: error: ‘const class QImage’ has no member named ‘numBytes’ unsigned long datalen = qimg.numBytes(); ^ qt/QZBar.cpp: In constructor ‘zbar::QZBar::QZBar(QWidget*)’: qt/QZBar.cpp:52:39: error: ‘x11Info’ was not declared in this scope thread->window.attach(x11Info().display(), winId()); ^ ...
QtGui/qimage.h:
... #if QT_DEPRECATED_SINCE(5, 0) QT_DEPRECATED inline int numColors() const; QT_DEPRECATED inline void setNumColors(int); QT_DEPRECATED inline int numBytes() const; #endif ...
Thanks
-
-
Add
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900
to your pro file and your should be good to go