0
我需要一些帮助。有一些大项目(使用Qt4
创建),我尝试使用Qt5
运行。如您所知QWindowStyle
已在Qt5
中删除,但使用了一个函数。我用QProxyStyle
替换它,但它没有帮助。Qt5项目部署 - QProxyStyle使用
编译器说:QProxyStyle::drawComplexControl Illegal call to non-static member function
它曾与Qt4的它为什么不在这里工作了?或者使用QProxyStyle不是个好主意?
继承人一些代码
.h文件中类声明
class MultiAxesPlot::LegendStyle:public QStyle
{
Q_OBJECT
public:
LegendStyle(LegendStyle const &other){}
LegendStyle(){}
~LegendStyle(){}
virtual void drawComplexControl(ComplexControl control, const QStyleOptionComplex * option, QPainter * painter, const QWidget * widget = 0) const;
};
问题功能
在我看来,你想要继承'QProxyStyle'而不是'QStyle'。 – thuga
@thuga好了,当我用'QProxyStyle'替换'QStyle'时,会出现更多的错误,比如'base class undefined',它不能识别'ComplexControl'参数 – DanilGholtsman
'base class undefined'通常意味着你在某处有循环依赖。 – thuga