我使用的是PyQt + Qt Designer,並將它連接到我的PostgreSQL數據庫。當我嘗試從我這個代碼數據庫顯示記錄:以奇怪的形式顯示的數字類型
if self.Kirurg_checkBox.isChecked():
Kirurg_query = QSqlQueryModel()
Kirurg_query.setQuery("SELECT * FROM kirurg")
global view_Kirurg
view_Kirurg = QtGui.QTableView()
view_Kirurg.setModel(Kirurg_query)
view_Kirurg.setWindowTitle('kirurg')
view_Kirurg.show()
數字列是這樣的:2.3177e + 09,而他們應該像他們在我的數據庫,它是這樣看:2317698765.這一直工作得很好,直到我將(PostgreSQL內部)列類型從字符(11)更改爲數字(11,0)(這是我要求的)。有沒有辦法讓這些列以正常方式顯示價值,而不是這個奇怪的方式?
編輯:
我已經把是否列== 0(原因這就是怪異價值,而且在最後一列,第4列)。它完全刪除我的第一列(列0),它修復了最後一列(4列),所以它看起來很好,它給了我很多的錯誤行:
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
AttributeError: 'float' object has no attribute 'toString'
Traceback (most recent call last):
File "C:\Python34\Lib\site-packages\PyQt4\BazaPodataka\bazapodataka.py", line 50, in paint
textQString = indexQModelIndex.model().data(indexQModelIndex, QtCore.Qt.EditRole).toString()
....
....
....
和一大堆更多的人,所有的相同。
我修改了我的帖子。 – Luka 2014-09-06 10:46:23
'indexQModelIndex.model().method(indexQModelIndex,QtCore.Qt.EditRole)'的Meybe返回值是float數據類型(不是'QVariant')。好的,把它轉換成字符串。檢查我的編輯帖子。我有問題,你的PyQt版本是什麼?謝謝。 – 2014-09-06 17:36:39
它現在正在工作!你是拯救者,再一次:)。我使用PyQt4,這個版本:PyQt4-4.11.1-gpl-Py3.4-Qt4.8.6-x64.exe。讓我再問你一件事。我已經把如果列== 2,並且它適用於我所有的數字列,爲什麼?例如,它適用於我的ID列(第0列)和我的電話號碼列(第4列)? – Luka 2014-09-06 21:28:23