[Interest] OverflowError when setting datat on QStandardItem

Frank Rueter | OHUfx frank at ohufx.com
Sat Apr 29 05:41:36 CEST 2017


I am traversing a directory collecting file sizes in bytes and assigning 
them as custom data to QStandardItems.
Unfortunately I get an OverflowError when trying to set too large a 
number it would seem:

    i = QtGui.QStandardItem()
    i.setData(13003676769, QtCore.Qt.UserRole+1)

     File "/path/to/module.py", line 38, in <module>
       i.setData(13003676769, QtCore.Qt.UserRole+1)


I guess I could convert to KB, MB, GB etc, or even a string, but those 
all seem like band aids. Can somebody please help me understand why I am 
seeing this error and what the prescribed way of dealing with it is?
I couldn't find anything useful online.

This is Qt 4.8.7



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170429/9cd1d806/attachment.html>

More information about the Interest mailing list