mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-12 04:42:13 +08:00
473fb11d34
* 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
56 lines
891 B
C++
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();
|
|
};
|