mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-23 14:22:06 +08:00
acd1bde496
* move android into own dir * fix name * maybe this works? qt ui doesn't work on mac * fix that * pc sound works * fix pc build * lowercase * that needs to be real_arch * split into classes * fix typo in lib * Fix cycle alerts * Add qt multimedia libs to install scripts * Add ui/android folder * Fix android build * Raise exception if sound init fails * add missing return Co-authored-by: Willem Melching <willem.melching@gmail.com> Co-authored-by: Comma Device <device@comma.ai>
57 lines
900 B
C++
57 lines
900 B
C++
#pragma once
|
|
|
|
#include <QWidget>
|
|
#include <QTimer>
|
|
#include <QGuiApplication>
|
|
#include <QOpenGLWidget>
|
|
#include <QOpenGLFunctions>
|
|
#include <QStackedLayout>
|
|
|
|
#include "qt/qt_sound.hpp"
|
|
#include "ui/ui.hpp"
|
|
|
|
class MainWindow : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainWindow(QWidget *parent = 0);
|
|
|
|
private:
|
|
QStackedLayout *main_layout;
|
|
|
|
public slots:
|
|
void openSettings();
|
|
void closeSettings();
|
|
|
|
};
|
|
|
|
|
|
class GLWindow : public QOpenGLWidget, protected QOpenGLFunctions
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
using QOpenGLWidget::QOpenGLWidget;
|
|
explicit GLWindow(QWidget *parent = 0);
|
|
~GLWindow();
|
|
|
|
protected:
|
|
void mousePressEvent(QMouseEvent *e) override;
|
|
void initializeGL() override;
|
|
void resizeGL(int w, int h) override;
|
|
void paintGL() override;
|
|
|
|
|
|
private:
|
|
QTimer * timer;
|
|
UIState * ui_state;
|
|
QtSound sound;
|
|
|
|
public slots:
|
|
void timerUpdate();
|
|
|
|
signals:
|
|
void openSettings();
|
|
};
|