Bug - Context menus not refreshing properly on pyqt5.14.x
BPL <[email protected]> Tue, 31 Mar 2020 16:59:10 +0200
| Newsgroups | gmane.comp.python.pyqt-pykde |
|---|---|
| Message-ID | <CAAfY3fZ4e65hs2QTi-nFf1bGO+3gYOaaqd2gb=p0seDheWPr=w@mail.gmail.com> |
There is a really nasty bug related to context menu refreshing with
versions 5.14.0, 5.14.1, please take a look:
- On versions 5.13.0, 5.13.1, 5.13.2 there is NO bug, demo here
<https://dl.dropboxusercontent.com/s/0q29e06om06an2i/2020-03-31_16-51-23.mp4>
- On versions 5.14.0, 5.14.1 there IS a bug, demo here
<https://dl.dropboxusercontent.com/s/qjg38hy4cxy4ukp/2020-03-31_16-55-00.mp4>
Mcve below:
from PyQt5.Qt import *
if __name__ == '__main__':
app = QApplication([])
x = QTreeWidget()
x.setContextMenuPolicy(Qt.CustomContextMenu)
i1 = QTreeWidgetItem(x, ["A"])
i2 = QTreeWidgetItem(i1, ["bar", "i", "ii"])
i3 = QTreeWidgetItem(i2, ["baz", "a", "b"])
def callback(point):
menu = QMenu()
menu.addAction("Foo")
menu.addSeparator()
menu.addAction("Bar")
menu.exec_(x.mapToGlobal(point))
x.customContextMenuRequested.connect(callback)
x.show()
app.exec_()
I've tested this on windows7 / python3.6.2.
Could you please confirm/advice? I would really like to upgrade my apps to
>5.14 :/
_______________________________________________
PyQt mailing list [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt