good man
good man

Reputation: 339

How to draw a simple horizontal rule in a QWidget?

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?

Upvotes: 11

Views: 4186

Answers (1)

Arnold Spence
Arnold Spence

Reputation: 22282

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 :)

Upvotes: 17

Related Questions