Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw a simple horizontal rule in a QWidget?

Tags:

qt

pyqt

I just want to add a horizontal rule (just like <hr> in HTML, see below) to a QWidget.


But I failed to find such a class in the documentation.
Could anyone give me example code?
like image 925
good man Avatar asked Dec 09 '10 10:12

good man


1 Answers

This can be done using a QFrame and setting the shape with setFrameShape(QFrame::HLine) and frame shadow using setFrameShadow(QFrame::Sunken). I just noticed that you are working in Python. My answer uses C++ syntax. Hopefully it is sufficient :)

like image 75
Arnold Spence Avatar answered Sep 20 '22 17:09

Arnold Spence