Files
StarPilot/selfdrive/ui/qt/window.hpp
T
Willem Melching 473fb11d34 Qt ui for PC (#2023)
* qt ui boilerplate

* this kinda works

* cleanup

* render inside other widget

* cleanup

* more cleanup

* Not needed

* Handle click

* Draw at 20Hz

* create paint.hpp

* move stuff around

* update sidebar

* Draw vision

* this works again

* add clickable settings button

* Only collapse sidebar when started

* always use qt on linux

* fix width

* scrollable area

* talk to NetworkManager

* code to add a connection

* params toggles

* small cleanup

* add qt5 to dockerfile

* Qt on mac

* Add qt to release files

* fix macos build

* nore more ifdefs needed

* add icons

* make a bit nicer

* Hide scrollbar

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: e115c514521c7705112bd0cb2e4bf865b536501a
2020-08-20 17:16:44 +02:00

56 lines
891 B
C++

#pragma once
#include <QWidget>
#include <QTimer>
#include <QGuiApplication>
#include <QOpenGLWidget>
#include <QOpenGLFunctions>
#include <QStackedLayout>
#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;
pthread_t connect_thread_handle;
public slots:
void timerUpdate();
signals:
void openSettings();
};