A horizontal or vertical line is just a QFrame with some properties set. In C++, the code that is generated to create a line looks like this:
line = new QFrame(w);
line->setObjectName(QString::fromUtf8("line"));
line->setGeometry(QRect(320, 150, 118, 3));
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);