본문 바로가기
파이썬

파이썬 PyQt4에서 QString을 만드는 방법은 무엇입니까?

by º기록 2021. 1. 30.
반응형
>>> from PyQt4 import QtCore
>>> str = QtCore.QString('Hello')
AttributeError: 'module' object has no attribute 'QString'

>>> QtCore.QString._init_(self)
AttributeError: 'module' object has no attribute 'QString' 


문서에 지정된대로 QtCore 에서 QString 을 가져올 수없는 이유는 무엇입니까?

 

해결 방법

 

In [1]: from PyQt4 import QtCore
In [2]: s = QtCore.QString('foo')
In [3]: s
Out[3]: PyQt4.QtCore.QString(u'foo')

 

참조 페이지 https://stackoverflow.com/questions/1400858

 

 

반응형

댓글