diff --git a/selfdrive/ui/qt/body.cc b/selfdrive/ui/qt/body.cc index 8bc358a..6829d83 100644 --- a/selfdrive/ui/qt/body.cc +++ b/selfdrive/ui/qt/body.cc @@ -43,10 +43,6 @@ LogoWidget::LogoWidget(QWidget *parent) : QWidget(parent) { // connect(&m_anim, SIGNAL(valueChanged(QVariant)), SLOT(update())); } -void BodyWindow::paintEvent(QPaintEvent *event) { - QPainter painter(this); -} - BodyWindow::BodyWindow(QWidget *parent) : fuel_filter(1.0, 5., 1. / UI_FREQ), QWidget(parent) { QGridLayout *layout = new QGridLayout(this); main_layout->setSpacing(0); @@ -64,6 +60,10 @@ BodyWindow::BodyWindow(QWidget *parent) : fuel_filter(1.0, 5., 1. / UI_FREQ), QW QObject::connect(uiState(), &UIState::uiUpdate, this, &BodyWindow::updateState); } +void BodyWindow::paintEvent(QPaintEvent *event) { + QPainter painter(this); +} + void BodyWindow::updateState(const UIState &s) { // if (!isVisible()) { // return; diff --git a/selfdrive/ui/qt/body.h b/selfdrive/ui/qt/body.h index 36ba604..5a549ce 100644 --- a/selfdrive/ui/qt/body.h +++ b/selfdrive/ui/qt/body.h @@ -34,20 +34,20 @@ private: // void paintEvent(QPaintEvent*) override; // }; -// class BodyWindow : public QWidget { -// Q_OBJECT +class BodyWindow : public QWidget { + Q_OBJECT +public: + BodyWindow(QWidget* parent = 0); +private: + void paintEvent(QPaintEvent*) override; +} -// public: -// BodyWindow(QWidget* parent = 0); - -// private: -// bool charging = false; -// uint64_t last_button = 0; -// FirstOrderFilter fuel_filter; -// QLabel *face; -// QMovie *awake, *sleep; -// RecordButton *btn; -// void paintEvent(QPaintEvent*) override; + // bool charging = false; + // uint64_t last_button = 0; + // FirstOrderFilter fuel_filter; + // QLabel *face; + // QMovie *awake, *sleep; + // RecordButton *btn; // private slots: // void updateState(const UIState &s);