سؤال

According to Qt's documentation QPainter has a drawStaticText method that was added in version 4.7. However I can't use it in PySide or PyQt4, even though their respective Qt versions are newer.

PySide.QtCore.__version__ is 4.8.5

PyQt4.QtCore.PYQT_VERSION_STR is 4.10.3

PyQt4.QtCore.QT_VERSION_STR is 4.8.5 as well

Is it just not supported or am I missing something?

EDIT

I was mistaken, the method is available in PyQt but not in PySide.

هل كانت مفيدة؟

المحلول

Support for Qt-4.7 was added in PyQt-4.8 (the versions don't necessarily stay in sync any more). A check of the PyQt-4.8 source code shows that drawStaticText was there from the start, and it's also there in PyQt-4.8.5. I don't have access to a PyQt-4.8.x build at the moment, but drawStaticText is definitely usable in PyQt-4.9.5 and later versions.

But the question might be not so much what version of PyQt you're using, but what version of Qt was it built against? IOW, what does the following reveal?

    PyQt4.QtCore.QT_VERSION_STR

EDIT:

It seems that QPainter.drawStaticText is not included in PySide (as of version 1.2.1), which is corroborated by their documentation. If you want to see if anything can be done about this, I would suggest you ask on the PySide mailing list.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top