본문 바로가기
Programming/Python

[python] PyQt QString Unresolved reference

by NAMP 2016. 3. 9.

PyQt QString Unresolved reference

QString

PyQT4 Tutorials 내용중 QT4 Tables 코드에서 에러 발생 (PyQt QString Unresolved reference)

How to create QString in PyQt4? 내용을 참고하면, Python3 에서 QString은 자동적으로 네이티브 파이썬 string으로 매핑된다고 함.

In Python 3, QString is automatically mapped to the native Python string by default:

The QString class is implemented as a mapped type that is automatically converted to and from a Python string. In addition a None is converted to a null QString. However, a null QString is converted to an empty Python string (and not None). (This is because Qt often returns a null QString when it should probably return an empty QString.)

The QChar and QStringRef classes are implemented as mapped types that are automatically converted to and from Python strings.

The QStringList class is implemented as a mapped type that is automatically converted to and from Python lists of strings.

The QLatin1Char, QLatin1String and QStringMatcher classes are not implemented.
http://pyqt.sourceforge.net/Docs/PyQt4/qstring.html

따라서 해당 코드는 QString을 제거하는 방식으로 해결.

# set label
table.setHorizontalHeaderLabels("H1;H2;").split(";"))
table.setVerticalHeaderLabels(("V1;V2;V3;V4").split(";"))

참고


댓글