New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qt6: Rendering of overlay TreeView is broken #13760
Comments
@realthunder could you support here? |
I don't get this background. Why not remove it? |
Readability, models can have different color, have multiple lines etc so only way to ensure that tree items are easily readable in all scenarios is to provide background for items that will have good contrast against text and hide distracting stuff like lines fighting for attention around text. |
Thats why Realthunder added the text effect. |
It does not work well enough as with busy model it still is not readable enough, at least for me. |
Could you try the new added overlay stylesheets? |
People have different tolerance for things being readable or not, depending on various factors. Realthunder implemented it (but remember, that he also implemented other options - including one with background) in the same way as movie captions are done - white text with black outline so it should be readable in every scenario. Unfortunately this effect is mostly effective with big text (bigger outline separating text from the rest of the picture), while we deal with small fonts. In our case we can also get a lot of lines with similar thickness in small area making it very busy and so needing more brain power to process it, requiring to focus on that particular area instead of being able to quickly scan it. I don't mind making the background optional - if for somebody background is distracting (which totally could be the case), I do however mind taking away option of having it. This is not a thread for this discussion anyway, so let's not go off-topic anymore. |
I managed to fix the issue, writeup on how: https://stackoverflow.com/questions/78414383/qt6-disable-drawing-of-default-background-for-qtreeview-items/78421604#78421604 |
This aims to fix rendering of tree view items in Qt6. While I don't belive that this is a good way to fix this, I am worried that it is the only way to do ir. BC BREAK: This change introduces artificial QTreeView widget that can be targeted using QSS and can be used in the delegate for painting background of items. `QTreeView::item` would now be used to render background for the whole row, while each cell can be targeted using `#DocumentTreeItems` selector. More details on implementation: https://stackoverflow.com/questions/78414383/qt6-disable-drawing-of-default-background-for-qtreeview-items/78421604#78421604 Fixes: FreeCAD#13760
This aims to fix rendering of tree view items in Qt6. While I don't belive that this is a good way to fix this, I am worried that it is the only way to do ir. BC BREAK: This change introduces artificial QTreeView widget that can be targeted using QSS and can be used in the delegate for painting background of items. `QTreeView::item` would now be used to render background for the whole row, while each cell can be targeted using `#DocumentTreeItems` selector. More details on implementation: https://stackoverflow.com/questions/78414383/qt6-disable-drawing-of-default-background-for-qtreeview-items/78421604#78421604 Fixes: FreeCAD#13760
This aims to fix rendering of tree view items in Qt6. While I don't belive that this is a good way to fix this, I am worried that it is the only way to do ir. BC BREAK: This change introduces artificial QTreeView widget that can be targeted using QSS and can be used in the delegate for painting background of items. `QTreeView::item` would now be used to render background for the whole row, while each cell can be targeted using `#DocumentTreeItems` selector. More details on implementation: https://stackoverflow.com/questions/78414383/qt6-disable-drawing-of-default-background-for-qtreeview-items/78421604#78421604 Fixes: FreeCAD#13760
This aims to fix rendering of tree view items in Qt6. While I don't belive that this is a good way to fix this, I am worried that it is the only way to do ir. BC BREAK: This change introduces artificial QTreeView widget that can be targeted using QSS and can be used in the delegate for painting background of items. `QTreeView::item` would now be used to render background for the whole row, while each cell can be targeted using `#DocumentTreeItems` selector. More details on implementation: https://stackoverflow.com/questions/78414383/qt6-disable-drawing-of-default-background-for-qtreeview-items/78421604#78421604 Fixes: FreeCAD#13760
This aims to fix rendering of tree view items in Qt6. While I don't belive that this is a good way to fix this, I am worried that it is the only way to do ir. BC BREAK: This change introduces artificial QTreeView widget that can be targeted using QSS and can be used in the delegate for painting background of items. `QTreeView::item` would now be used to render background for the whole row, while each cell can be targeted using `#DocumentTreeItems` selector. More details on implementation: https://stackoverflow.com/questions/78414383/qt6-disable-drawing-of-default-background-for-qtreeview-items/78421604#78421604 Fixes: FreeCAD#13760
This aims to fix rendering of tree view items in Qt6. While I don't belive that this is a good way to fix this, I am worried that it is the only way to do ir. BC BREAK: This change introduces artificial QTreeView widget that can be targeted using QSS and can be used in the delegate for painting background of items. `QTreeView::item` would now be used to render background for the whole row, while each cell can be targeted using `#DocumentTreeItems` selector. More details on implementation: https://stackoverflow.com/questions/78414383/qt6-disable-drawing-of-default-background-for-qtreeview-items/78421604#78421604 Fixes: FreeCAD#13760
This aims to fix rendering of tree view items in Qt6. While I don't belive that this is a good way to fix this, I am worried that it is the only way to do ir. BC BREAK: This change introduces artificial QTreeView widget that can be targeted using QSS and can be used in the delegate for painting background of items. `QTreeView::item` would now be used to render background for the whole row, while each cell can be targeted using `#DocumentTreeItems` selector. More details on implementation: https://stackoverflow.com/questions/78414383/qt6-disable-drawing-of-default-background-for-qtreeview-items/78421604#78421604 Fixes: FreeCAD#13760
This aims to fix rendering of tree view items in Qt6. While I don't belive that this is a good way to fix this, I am worried that it is the only way to do ir. BC BREAK: This change introduces artificial QTreeView widget that can be targeted using QSS and can be used in the delegate for painting background of items. `QTreeView::item` would now be used to render background for the whole row, while each cell can be targeted using `#DocumentTreeItems` selector. More details on implementation: https://stackoverflow.com/questions/78414383/qt6-disable-drawing-of-default-background-for-qtreeview-items/78421604#78421604 Fixes: FreeCAD#13760
Is there an existing issue for this?
Problem description
When building against Qt6 (which now is forced for Arch linux users) tree view background is rendered for every column of the tree even for indentations:
This is not supposed to happen. This regression is caused by this commit in Qt: qt/qtbase@16e0e7c. Long story short, until Qt 6.5 Qt did not render items for non-alternating backgrounds, leaving that task for delegates. Delegate for rendering tree items relied on this behavior and now it is broken.
edit: It's even worse, there is another commit that is part of this regression: qt/qtbase@483ae6c. This one translates
PanelItemViewRow
s intoPanelItemViewItem
s to "properly" render background because it is non-styleable from qss. I don't know why it is done like that instead of introducing something like::row
into qss.I don't see any easy way around that issue as it is not guarded by any
if
statement that could be abused. My only idea is to somehow override behavior of theto be no-op but I don't know how to achieve that. One way would be to use
QProxyStyle
to override this but this is not compatible with QSS which renders this solution useless.Full version info
Subproject(s) affected?
None
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: