[Solved] Styling QTableView items
-
Hi everybody,
I have a problem styling the border of the selected item in a QTableView.
Although I set the selection mode to no selection the border of the currently selected item is still drawn and I'd like it removed.
Here is a screenshot of the problem:
!http://i278.photobucket.com/albums/kk113/V-Ronin/Test_zps010fec55.png(Screenshot of the problem)!
the table stylesheet is:
@
"background-color: rgba(255,0,0,255);"
"border: none;"
@I tried using ::item but with no results.
Thanks in advance for the help
Luca -
Try to remove the border by disabling the focus using method "setFocusPolicy":http://qt-project.org/doc/qt-5.0/qtwidgets/qwidget.html#focusPolicy-prop and argument Qt::NoFocus.
-
It worked fine for me but, just for curiosity, is there a way to do the same thing via stylesheet?
-
I haven't tried, but due to beeing a QObject-property you might be able to style it using <code>qproperty-focusPolicy: "Qt::NoFocus"</code>.
-
I meant removing the border, not disabling the focus :D