Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Windows 8.1 not repainting QGLWidget when using high contrast theme
Qt 6.11 is out! See what's new in the release blog

Windows 8.1 not repainting QGLWidget when using high contrast theme

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nikita158
    wrote on last edited by
    #1

    Repaints happen only if window is resized or moved outside desktop.
    Tested on Qt 4.8.6/5.4.0 minGW/MSVC

    main.cpp:
    @#include <QApplication>
    #include "glwidget.h"

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    GLWidget w;
    w.show();
    return a.exec();
    }@

    glwidget.h:
    @#ifndef GLWIDGET_H
    #define GLWIDGET_H

    #include <QGLWidget>
    #include <QTime>

    class GLWidget : public QGLWidget
    {
    Q_OBJECT
    public:
    GLWidget() : QGLWidget() {}
    private:
    GLclampf R() { return GLclampf(rand() % 255) / 255; }
    protected:
    void mousePressEvent(QMouseEvent *e) {
    qDebug("\nMouse clicked. Going to repaint...");

        update();
        //updateGL();
    }
    void paintGL() {
        glClearColor(R(), R(), R(), 1.0);
        glClear(GL_COLOR_BUFFER_BIT);
    
        qDebug("repainted " + QTime::currentTime().toString().toAscii());
    }
    

    };

    #endif // GLWIDGET_H@

    saw same strangeness on Linux with AMD's proprietary drivers.

    rebooted 10 times after changing appereance theme ;)

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi, and welcome to the Qt Dev Net!

      QGLWidget has multiple known issues, and it has been deprecated in Qt 5.4.

      Please use "QOpenGLWidget":http://doc.qt.io/qt-5/qopenglwidget.html instead.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nikita158
        wrote on last edited by
        #3

        Thankx for answer&welcomes
        Moving to QOpenGLWidget doesnt solve the problem.

        hellogl2 example from Qt 5.4 also doesnt show anything till I set:
        @QSurfaceFormat fmt;
        ...
        fmt.setSwapBehavior(QSurfaceFormat::SingleBuffer);
        QSurfaceFormat::setDefaultFormat(fmt);@

        1 Reply Last reply
        0
        • N Offline
          N Offline
          nikita158
          wrote on last edited by
          #4

          Seems that problem is Qt-independent
          Almost all OpenGL apps using double buffer doent show anything

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved