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