Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt transparent window graphic card
Forum Updated to NodeBB v4.3 + New Features

Qt transparent window graphic card

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
15 Posts 2 Posters 5.2k 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.
  • A Offline
    A Offline
    alecs26
    wrote on last edited by
    #6

    There seems to be a bug report here from 2013 but it's not my field of expertise and I don't see any solution.
    https://bugreports.qt.io/browse/QTBUG-28214

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alecs26
      wrote on last edited by alecs26
      #7

      @SGaist

      I couldn't test right now but there are reports it works if the aero theme is set:
      http://stackoverflow.com/questions/42059468/qt-quick2-window-cant-be-transparent-without-aero

      However, I can't ask people to set an aero theme. Is it possible to force something similar in my Qt code ?

      Also, there is some software that use transparency (and works) on all these computers without the aero theme. But I don't think they were designed with Qt. One of them was designed with Qt (I see the file QtCore4.dll) but it was Qt4. I think the bug is for Qt5.

      Thanks !

      1 Reply Last reply
      0
      • A Offline
        A Offline
        alecs26
        wrote on last edited by
        #8

        I tested with the new Qt5.9 beta and it's the same problem.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #9

          Can you try forcing your application to use the desktop OpenGL ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alecs26
            wrote on last edited by alecs26
            #10

            @SGaist Thank you for your answer.

            From this link (http://doc.qt.io/qt-5/configure-options.html), they say to do "configure.bat -opengl desktop". I didn't do that, since I don't know how to do that but I found another way to include OpenGL, see the following.

            And from here (http://doc.qt.io/qt-5/qtopengl-index.html), they say for opengl : "Warning: This module should not be used anymore for new code. Please use the corresponding OpenGL classes in Qt GUI."
            From this same page, I include "#include <QtOpenGL>" and "QT += opengl" but it didn't change anything. I think it's normal since as I understand I should create a QWindow instead of my Application Window. However, I did not find how to mix QWindow and QML.

            Thank you very much,

            Alex

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #11

              No need for compilation, just set the Qt::AA_UseDesktopOpenGL application attribute..

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • A Offline
                A Offline
                alecs26
                wrote on last edited by
                #12

                @SGaist Thank you for your answer.

                I tried setting Qt::AA_UseDesktopOpenGL in my QML with flags but it did not work.
                I the documentation it says: "This attribute must be set before Q(Gui)Application is constructed."
                So I tried the following but the window is still black instead of being transparent. I guess it was the right way to set this attribute but I'm not sure.

                Thank you again,

                Alex

                int main(int argc, char *argv[])
                {
                    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
                    QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL, true);
                    QApplication app(argc, argv);
                
                    QQmlApplicationEngine engine;
                    ...
                
                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #13

                  Do you know what graphic card is used when your application fails ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    alecs26
                    wrote on last edited by
                    #14

                    Both NVIDIA graphic card or ATI RADEON fails in Win7 if the theme is not set to AERO.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #15

                      Ok, then you should take a look at the bug report system to see if it's something known.

                      Note that Vista has reached EOL on April 11 this year.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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