QTableView: hide vertical lines on windows?
-
wrote on 17 Feb 2025, 20:39 last edited by davecotter
they are correctly not showing up on mac, which is what i want.
but on windows, they incorrectly do show, no matter what i try:// nope: tableViewP->setShowGrid(false); // also nope: tableViewP->setStyleSheet("QTableView:{ border: none; outline: 0; gridline-color: rgba(255,0,0,0.0); border-right-color: rgba(255,0,0,0.0); border-left-color: rgba(255,0,0,0.0); }");
-
wrote on 18 Feb 2025, 23:16 last edited by
has anyone run into this?
i can see lots of folks have this question, but no "answers" seem to work:https://forum.qt.io/topic/135029/how-can-i-hide-the-borders-of-the-cells-in-a-qtableview
https://stackoverflow.com/questions/22455445/how-to-hide-vertical-horizontal-lines-in-qtablewidget
https://stackoverflow.com/questions/69076597/how-can-i-remove-the-outside-gridlines-of-qtablewidget-and-qheaderview
https://www.qtcentre.org/threads/57179-get-rid-of-grid-lines-amp-vertical-table-header-in-QTableView
https://www.qtcentre.org/threads/23958-Grid-QTableView-horizontal-onlyhere's one i have NOT tried but there MUST be a way to do this without creating a line draw delegate???
https://stackoverflow.com/questions/37429127/remove-the-vertical-grid-lines-of-a-qtableview -
has anyone run into this?
i can see lots of folks have this question, but no "answers" seem to work:https://forum.qt.io/topic/135029/how-can-i-hide-the-borders-of-the-cells-in-a-qtableview
https://stackoverflow.com/questions/22455445/how-to-hide-vertical-horizontal-lines-in-qtablewidget
https://stackoverflow.com/questions/69076597/how-can-i-remove-the-outside-gridlines-of-qtablewidget-and-qheaderview
https://www.qtcentre.org/threads/57179-get-rid-of-grid-lines-amp-vertical-table-header-in-QTableView
https://www.qtcentre.org/threads/23958-Grid-QTableView-horizontal-onlyhere's one i have NOT tried but there MUST be a way to do this without creating a line draw delegate???
https://stackoverflow.com/questions/37429127/remove-the-vertical-grid-lines-of-a-qtableviewwrote on 19 Feb 2025, 00:30 last edited by@davecotter said in QTableView: hide vertical lines on windows?:
i can see lots of folks have this question, but no "answers" seem to work:
AFAICS the solutions provided in most of the topics seem to work?!
So I believe it must be the right way "somehow"...
Have you tried the solutions discussed in @Simmania 's topic in a minimal/stripped-down example?!
Maybe some parent style in your huge project is overriding the stylesheet again? -
wrote on 19 Feb 2025, 04:37 last edited by davecotter
yes i tried that. there is an example called "Frozen Column" that demonstrates Table View using Widgets.
i added lines to set the grid pen to none, line that hides the grid, and another that set the grid to RED.
horizontal lines were removed (or 100% transparent?), but vertical lines were still showing, only in gray color, not RED.i actually think this must be a bug in Qt 6.9?
i guess if i HAVE to make a custom draw delegate i will, but wow that's a LOT of work for something that should be a one-liner.
-
Hi,
Any chances you are on Windows 11 ?
-
wrote on 19 Feb 2025, 21:53 last edited by
yes, windows 11
-
Can you try again forcing the style to
windowsvista
? -
wrote on 19 Feb 2025, 22:35 last edited by davecotter
you mean as a test? cuz, you know, i prefer the modern windows style
actually i'm not sure how to set the style? it's a widgets app.
-
you mean as a test? cuz, you know, i prefer the modern windows style
actually i'm not sure how to set the style? it's a widgets app.
wrote on 20 Feb 2025, 00:47 last edited by@davecotter said in QTableView: hide vertical lines on windows?:
actually i'm not sure how to set the style? it's a widgets app.
so...?!
Try
QApplication::setStyle(QStyleFactory::create("windowsvista"));
-
wrote on 20 Feb 2025, 00:55 last edited by
-
wrote on 20 Feb 2025, 01:00 last edited by
-
your suspicion is correct: vista style has no lines:
wrote on 20 Feb 2025, 01:01 last edited by Pl45m4@davecotter said in QTableView: hide vertical lines on windows?:
your suspicion is correct: vista style has no lines:
So what @SGaist was after:
There are still some bugs related the "new"windows11
style.Seems like you have to wait until it works correctly (or/and use other styles like
fusion
orwindowsvista
in the meantime)
Search the bugtracker for reports like these, if there aren't any, you may create your own bugreport so the dev team knows :)Edit: Ok you did already :)
-
@davecotter said in QTableView: hide vertical lines on windows?:
You can close it. It's fixed in Qt 6.9 already.
-
wrote on 20 Feb 2025, 15:34 last edited by
i have 6.9 beta 2, it is NOT fixed.
are you talking about 6.9 beta 3?
1/14