mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-11 07:52:03 +08:00
GL spinner fix (#20684)
* GL spinner fix * update larch spinner Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
@@ -10,9 +10,7 @@
|
||||
#include "spinner.hpp"
|
||||
#include "qt_window.hpp"
|
||||
|
||||
// TrackWidget
|
||||
|
||||
TrackWidget::TrackWidget(QWidget *parent) {
|
||||
TrackWidget::TrackWidget(QWidget *parent) : QOpenGLWidget(parent) {
|
||||
setFixedSize(spinner_size);
|
||||
setAutoFillBackground(false);
|
||||
|
||||
@@ -56,7 +54,7 @@ Spinner::Spinner(QWidget *parent) {
|
||||
main_layout->setSpacing(0);
|
||||
main_layout->setMargin(200);
|
||||
|
||||
main_layout->addWidget(new TrackWidget(), 0, 0, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
main_layout->addWidget(new TrackWidget(this), 0, 0, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||
|
||||
text = new QLabel();
|
||||
text->setVisible(false);
|
||||
@@ -113,6 +111,16 @@ void Spinner::update(int n) {
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
QSurfaceFormat fmt;
|
||||
#ifdef __APPLE__
|
||||
fmt.setVersion(3, 2);
|
||||
fmt.setProfile(QSurfaceFormat::OpenGLContextProfile::CoreProfile);
|
||||
fmt.setRenderableType(QSurfaceFormat::OpenGL);
|
||||
#else
|
||||
fmt.setRenderableType(QSurfaceFormat::OpenGLES);
|
||||
#endif
|
||||
QSurfaceFormat::setDefaultFormat(fmt);
|
||||
|
||||
QApplication a(argc, argv);
|
||||
Spinner spinner;
|
||||
setMainWindow(&spinner);
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user