How enable deprecated functions in Qt5

问题:Qt5中如何启用以 QT_DEPRECATED_SINCE标识的已经废弃/过时的方法?

I want to port a Qt4 program to Qt5 and some functions are not defined (such as QHeaderView::setMoveable), but I see in the qheaderview.h file that with some magic defines (QT_DEPRECATED_SINCE) it should be possible to reenable them. What do I have to do in order to let QHeaderView::setMovable reappear? I do not want to rewrite my code if there is a way like that.

答:You can add to your ***.pro file the following line,即在工程文件中添加如下的定义:

DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0

猜你喜欢

转载自www.cnblogs.com/rainbow70626/p/10385599.html
今日推荐