no real OpenGL in Graphic in Qt Designer
This commit is contained in:
@@ -61,7 +61,7 @@ Graphic::Graphic(QWidget * parent): QFrame(parent), canvas(0), line_x_min(this),
|
||||
canvas_gl = 0;
|
||||
gesture_angle = 45.;
|
||||
leg_update = true;
|
||||
visible_update = fullscr = need_mouse_pan = false;
|
||||
visible_update = fullscr = need_mouse_pan = m_fakeGL = false;
|
||||
gestures =
|
||||
#ifdef Q_OS_ANDROID
|
||||
true;
|
||||
@@ -334,7 +334,7 @@ void Graphic::canvasPaintEvent() {
|
||||
}
|
||||
QPainter p;
|
||||
#ifdef HAS_GL
|
||||
if (isOGL) {
|
||||
if (isOGL && !m_fakeGL) {
|
||||
p.fillRect(canvas->rect(), Qt::black);
|
||||
glClearColor(0.f, 0.f, 0.f, 0.f);
|
||||
p.begin(canvas);
|
||||
@@ -358,7 +358,7 @@ void Graphic::canvasPaintEvent() {
|
||||
drawGrid();
|
||||
p.setRenderHint(QPainter::Antialiasing, aalias);
|
||||
#ifdef HAS_GL
|
||||
if (isOGL) {
|
||||
if (isOGL && !m_fakeGL) {
|
||||
if (aalias) glEnable(GL_MULTISAMPLE);
|
||||
else glDisable(GL_MULTISAMPLE);
|
||||
}
|
||||
@@ -370,7 +370,7 @@ void Graphic::canvasPaintEvent() {
|
||||
if (pause_) drawPause();
|
||||
emit graphicPaintEvent(painter);
|
||||
p.end();
|
||||
if (isOGL) return;
|
||||
if (isOGL && !m_fakeGL) return;
|
||||
p.begin(canvas);
|
||||
p.drawImage(0, 0, *buffer);
|
||||
p.end();
|
||||
@@ -863,7 +863,7 @@ void Graphic::exportGraphics(QString filename) {
|
||||
void Graphic::setOpenGL(bool on) {
|
||||
#ifdef HAS_GL
|
||||
isOGL = on;
|
||||
if (on) {
|
||||
if (on && !m_fakeGL) {
|
||||
if (!canvas_gl) {
|
||||
canvas_gl = new UGLWidget();
|
||||
ui->layoutCanvas->addWidget(canvas_gl);
|
||||
|
||||
Reference in New Issue
Block a user