mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-29 02:22:09 +08:00
GL spinner fix (#20684)
* GL spinner fix * update larch spinner Co-authored-by: Comma Device <device@comma.ai> old-commit-hash: aaa8d937f504e4240444454a32b85de6977bf8b6
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);
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:dcf0ea9e0aad69be5f31e349297454433792daabbbc228e42873f37ce3e3a742
|
||||
size 539856
|
||||
oid sha256:a62f29ddc8abe620c85140d9ba2fb4cb5c869b5aae92ff83b39960d1a82dbd03
|
||||
size 662096
|
||||
|
||||
Reference in New Issue
Block a user