QTableView: hide vertical lines on windows?
-
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); }");so: how do we get RID of those vertical lines??

-
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-qtableview@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? -
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 ?
-
yes, windows 11
-
Can you try again forcing the style to
windowsvista? -
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.
@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")); -
your suspicion is correct: vista style has no lines:

-
-
your suspicion is correct: vista style has no lines:

@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"windows11style.Seems like you have to wait until it works correctly (or/and use other styles like
fusionorwindowsvistain 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.
-
i have 6.9 beta 2, it is NOT fixed.
are you talking about 6.9 beta 3?