简体   繁体   English

如何在Qt5中启用已弃用的函数

[英]How enable deprecated functions in Qt5

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. 我想将Qt4程序移植到Qt5并且没有定义一些函数(例如QHeaderView :: setMoveable),但我在qheaderview.h文件中看到,有了一些魔术定义(QT_DEPRECATED_SINCE),应该可以重新启用它们。 What do I have to do in order to let QHeaderView::setMovable reappear? 为了让QHeaderView :: setMovable重新出现,我该怎么办? I do not want to rewrite my code if there is a way like that. 不想重写我的代码,如果有这样的一种方式。

您可以在.pro文件中添加以下行:

DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM