1
隨着PyQt4的,我一直能夠初始化QBrush和而QColor與無作爲參數(不產生顏色等):PyQt4的4.11.4不再接受QBrush(無)或參考QColor(無)
QBrush(None)
QColor(None)
但經過我從4.11.3升級到4.11.4(這是一個次要升級),我發現這些都不再接受:
>>> QColor(None)
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeError: arguments did not match any overloaded call:
QColor(Qt.GlobalColor): argument 1 has unexpected type 'NoneType'
QColor(int): too many arguments
QColor(QVariant): argument 1 has unexpected type 'NoneType'
QColor(): argument 1 has unexpected type 'NoneType'
QColor(int, int, int, int alpha=255): argument 1 has unexpected type 'NoneType'
我試圖在4.11.3和4.11之間的變化進行搜索。 4,但看不到任何解釋這一點的相關信息。我開始懷疑我是否在尋找正確的東西。
這是由Qt的變化引起的嗎?或PyQt4?或python-SIP?
另外我實際上並不明白Qt中的底層(C++)調用是什麼。它實際上是調用QBrush()和QColor()還是試圖將Python None更改爲c null?
謝謝,我希望我沒有錯過一些明顯的在線。
「可以在底層C++代碼接受NULL的地方指定None值」([PyQt Doc](http://pyqt.sourceforge.net/Docs/PyQt4/gotchas.html#none-and-null) )。但我不知道爲什麼'QBrush(None)'在之前而不是現在是有效的。 – Mel