openpilot is an open source driver assistance system. openpilot performs the functions of Automated Lane Centering and Adaptive Cruise Control for over 200 supported car makes and models.

38 lines
998 B

#include "controls.hpp"
QFrame *horizontal_line(QWidget *parent) {
QFrame *line = new QFrame(parent);
line->setFrameShape(QFrame::StyledPanel);
line->setStyleSheet(R"(
margin-left: 40px;
margin-right: 40px;
border-width: 1px;
border-bottom-style: solid;
border-color: gray;
)");
line->setFixedHeight(2);
return line;
}
AbstractControl::AbstractControl(const QString &title, const QString &desc, const QString &icon) : QFrame() {
hlayout = new QHBoxLayout;
4 years ago
hlayout->setMargin(0);
hlayout->setSpacing(50);
// left icon
if (!icon.isEmpty()) {
QPixmap pix(icon);
QLabel *icon = new QLabel();
icon->setPixmap(pix.scaledToWidth(80, Qt::SmoothTransformation));
icon->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
hlayout->addWidget(icon);
}
// title
title_label = new QLabel(title);
title_label->setStyleSheet("font-size: 50px; font-weight: 400;");
hlayout->addWidget(title_label);
setLayout(hlayout);
}