[PyQt] Possible display bug with editable QTreeWidgetItem on Linux

Vincent Michel vxgmichel at gmail.com
Tue Sep 9 09:02:26 BST 2014


I noticed a strange display bug when I ran a code using an editable
QTreeItemWidget on a Linux machine (this doesn't happen on Windows).

While editing the widget, the previous value is still visible and messes
up with the new value that is being typed.

It is reproducible by creating a QTreeWidgetItem and setting the right
flags. See that simple piece of code:

    from PyQt4 import QtCore, QtGui
    app = QtGui.QApplication([])
    widget = QtGui.QTreeWidget()
    item = QtGui.QTreeWidgetItem(widget, ['x'*8])
    item.setFlags(QtCore.Qt.ItemIsEditable | QtCore.Qt.ItemIsEnabled)
    widget.show()
    app.exec_()

Then edit the item. This is what happens:

    http://postimg.org/image/x4r7tscl5/

I updated my configuration to make sure that this hasn't been fixed in a
newer release, but I kept getting the same issue.

My configuration:

    OS: Ubuntu 14.04 LTS
    Qt version: 4.8.6
    SIP version: 4.16.2
    PyQt version: 4.11.1

I couldn't find anything on the internet about this problem.
Is that a known issue or I am missing something?

Vincent Michel






More information about the PyQt mailing list