how to remove border around qtreeview??
-
i want to remove border around a qtreeview widget?? i am using qtreeview under a vertical layout.. but it paints a rectangular border,, how can i remove that?
-
@abdullahzubair109 What border do you mean?
You probably need to remove the margins from your layout. -
Hi
https://doc.qt.io/qt-5/qlayout.html#setContentsMargins
It has 9-11 px default margin for any layout. -
hi
you can use stylesheet
tree->setStyleSheet("border: 0");
use
setFrameShape(QFrame::NoFrame); -
@abdullahzubair109
Hi
Well yes if you made a custom style that would draw the qtreeview without border but
i think its not trivial. You could also look into
https://doc.qt.io/qt-5/qproxystyle.html
but I cant tell what you would need to override to get rid of the border. -
@abdullahzubair109
ah. i missed it had setFrame function.
Good found :)