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.

19 lines
433 B

#include "selfdrive/ui/qt/util.h"
#include <QStyleOption>
#include <QDebug>
ClickableWidget::ClickableWidget(QWidget *parent) : QWidget(parent) { }
void ClickableWidget::mouseReleaseEvent(QMouseEvent *event) {
emit clicked();
}
// Fix stylesheets
void ClickableWidget::paintEvent(QPaintEvent *) {
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}