No I did not, I just found out that the problem existed after giving a beta version of the cross platform application I work on. I tested in a virtual machine on my MacOS machine and I can replicate the issue.
I don't really have a clue how I could replicate the same application or even a portion of it in C++ to be honest...
Well if the functionality is a couple of Widgets, you can create a python minimal application with those and open a bug report, so we can check that out. Additionally, you can use on that small application our /not 100% compatible/ pyside6-qtpy2cpp that's is installed to create a c++ version of that in case you want to report it to Qt/C++
Scrolling through 6.8 changelog I saw a lot of bug fixes regarding W11 UI problems, I will try to update to the last version and see if the fix might reside in there somewhere 🤞
I still have my doubts since the old release built in the same way with Qt 6.4 seems to behave correctly
Rolled back to 6.4.3 and everything is rendered "as it should"
Loosing dark mode is a bummer but I really can't understand what has changed.
Ссылка click to show
I had another go and tried running the Python code using PySide 6.8.0.2 directly on Windows 11 without packaging it through PyInstaller.
The same exact problem is present. No issues if the style is set to "Fusion": https://pasteboard.co/pt2v4i1unjku.png
Even though I must admit it looks quite bad in Windows 11...
I think I found the culprit!
I have some custom delegates on most of my models to accept both comma and dot decimal separated numbers and cohere both to dot notation.
If I remove these delegates from the QTableView the problem disappears.
It does not solve the layout problem on the left though...
As a reference this is the code for one of the delegates:
class NumberFormatDelegate(QItemDelegate):
def __init__(
self,
parent=None,
bottom: float = -float("inf"),
top: float = float("inf"),
decimals: int = -1,
) -> None:
super().__init__(parent)
self.bottom = bottom
self.top = top
self.decimals = decimals
def createEditor(self, parent, option, index):
editor = LineSpinBox(
parent,
bottom=self.bottom,
top=self.top,
decimals=self.decimals,
)
return editor
def setEditorData(self, editor, index):
data = index.data(Qt.DisplayRole)
editor.setText(data)
def setModelData(self, editor, model, index):
model.setData(index, editor.text(), Qt.EditRole)
LineSpinBox is just a subclass of a LineEdit with some validation on top.
L
Does something changed for delegates between 6.4 and 6.8?
i'm using pyqt and pyside for about 2 years, and i have learned a lot by myself and one many things since then. but is there any structured course available to learn things with their best practices especially advanced materials?
I have been working with PySide since 2018 when I started my master thesis and in all these years I have not found one definitive course that really covers "everything"
As I said multiple times here the only resource I feel like suggesting (apart from the official docs obviously) is this "old" book on PyQt4: "Rapid GUI Programming with Python and Qt" by Mark Summerfield
It is out of print but can be found... well you know... on the internet 🏴☠️
It is super well written, it has a lot of well thought examples and in my experience most of it is perfectly transferable to PySide6.
Finally fixed! For further reference if anyone will ever end up in the same silly situation: QStyledItemDelegate is to be preferred over QItemDelagate in Views
It was also written in the docs, burried in the QStyledItemDelegate description. My bad for not finding it out before! 😵💫
In 6.4 probably the windows style was not differing this much and as such in never came up as a problem
QTBUG-52622 (fixed in 6.7.0) and QTBUG-71217 look somewhat similar, although not identical. I've filed QTBUG-131723, discovering PySide6.QtGui.QIcon.ThemeIcon along the way.