Create QListWidgetItemrepresenting a delimiter. Such an element should have been determined setSizeHint(), therefore, its height is small, and setFlags()should also be determined Qt::NoItemFlags, therefore, the element is not selected, etc. Then, adding the element to QListWidget, put a QFramewith its shape set to QFrame::HLine, as the widget of the element (using QListWidget::setItemWidget()).
Regarding your additional question from the comment which:
I want to add some space on each side of this line / border separator. How can I achieve this?
, , - QFrame QWidget QWidget (, QWidget -). : QWidget::setContentsMargins(int left, int top, int right, int bottom)