Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Potential QQuickWidget broken on Qt6.2?

Potential QQuickWidget broken on Qt6.2?

Scheduled Pinned Locked Moved Solved Qt 6
7 Posts 5 Posters 1.8k Views
  • 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.
  • C Offline
    C Offline
    ChiefyChief
    wrote on last edited by ChiefyChief
    #1

    Good afternoon all,

    I've recently tried upgrading to Qt6.2 from Qt5.12 recently and have hit an interesting issue I was hoping if anyone else noticed. Below is a barebones example so hopefully its reproducable, as I can reproduce it on my machine with just this.

    Basically the issue is that QMainWindow no longer likes having a QQuickWidget set as the Central Widget. If you run the code below, it will run perfectly fine as you would expect. However, if you uncomment _module = new QQuickWidget(); and comment _module = new QWidget(); the application will crash when trying to show(). Note, this also crashes with showMaximise(); but I assume those are connected.

    class Playground : public QMainWindow
    {
    public:
        Playground()
        {
            //_module = new QQuickWidget();
            _module = new QWidget();
            setCentralWidget(_module);
        }
    private:
        QWidget* _module = nullptr;
    };
    
    int main(int argc, char* argv[])
    {
        QApplication application(argc, argv);
    
        Playground playground;
        playground.show();
    
        return QApplication::exec();
    }
    

    As you would expect this is quite an issue! So I'm putting it out to see if anyone else has had this problem?

    The actual crash message is something I've never seen before as well

    ! Debugger reported unrelated range(s) for 0x00007ffcf393a77a: [0x00007ffcf393a37a..0x00007ffcf393a3ab]
    

    Additional notes:
    Fresh Qt6.2 on 05/10/2021
    IDE: CLion
    CMake
    OS: Windows

    Danke in advanced

    eyllanescE B 2 Replies Last reply
    0
    • C ChiefyChief

      Good afternoon all,

      I've recently tried upgrading to Qt6.2 from Qt5.12 recently and have hit an interesting issue I was hoping if anyone else noticed. Below is a barebones example so hopefully its reproducable, as I can reproduce it on my machine with just this.

      Basically the issue is that QMainWindow no longer likes having a QQuickWidget set as the Central Widget. If you run the code below, it will run perfectly fine as you would expect. However, if you uncomment _module = new QQuickWidget(); and comment _module = new QWidget(); the application will crash when trying to show(). Note, this also crashes with showMaximise(); but I assume those are connected.

      class Playground : public QMainWindow
      {
      public:
          Playground()
          {
              //_module = new QQuickWidget();
              _module = new QWidget();
              setCentralWidget(_module);
          }
      private:
          QWidget* _module = nullptr;
      };
      
      int main(int argc, char* argv[])
      {
          QApplication application(argc, argv);
      
          Playground playground;
          playground.show();
      
          return QApplication::exec();
      }
      

      As you would expect this is quite an issue! So I'm putting it out to see if anyone else has had this problem?

      The actual crash message is something I've never seen before as well

      ! Debugger reported unrelated range(s) for 0x00007ffcf393a77a: [0x00007ffcf393a37a..0x00007ffcf393a3ab]
      

      Additional notes:
      Fresh Qt6.2 on 05/10/2021
      IDE: CLion
      CMake
      OS: Windows

      Danke in advanced

      B Offline
      B Offline
      Bob64
      wrote on last edited by
      #3

      @ChiefyChief I have just installed 6.2 on Windows, just to have a look at. I tried your example and for the quickwidget case I see no window and this on the console:

      QQuickWidget is only supported on OpenGL. Use QQuickWindow::setGraphicsApi() to override the default.
      17:39:09: The program has unexpectedly finished.
      17:39:09: The process was ended forcefully.
      

      If I add this in main, before the Playground instantiation, it works for me:

      QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);

      1 Reply Last reply
      0
      • C ChiefyChief

        Good afternoon all,

        I've recently tried upgrading to Qt6.2 from Qt5.12 recently and have hit an interesting issue I was hoping if anyone else noticed. Below is a barebones example so hopefully its reproducable, as I can reproduce it on my machine with just this.

        Basically the issue is that QMainWindow no longer likes having a QQuickWidget set as the Central Widget. If you run the code below, it will run perfectly fine as you would expect. However, if you uncomment _module = new QQuickWidget(); and comment _module = new QWidget(); the application will crash when trying to show(). Note, this also crashes with showMaximise(); but I assume those are connected.

        class Playground : public QMainWindow
        {
        public:
            Playground()
            {
                //_module = new QQuickWidget();
                _module = new QWidget();
                setCentralWidget(_module);
            }
        private:
            QWidget* _module = nullptr;
        };
        
        int main(int argc, char* argv[])
        {
            QApplication application(argc, argv);
        
            Playground playground;
            playground.show();
        
            return QApplication::exec();
        }
        

        As you would expect this is quite an issue! So I'm putting it out to see if anyone else has had this problem?

        The actual crash message is something I've never seen before as well

        ! Debugger reported unrelated range(s) for 0x00007ffcf393a77a: [0x00007ffcf393a37a..0x00007ffcf393a3ab]
        

        Additional notes:
        Fresh Qt6.2 on 05/10/2021
        IDE: CLion
        CMake
        OS: Windows

        Danke in advanced

        eyllanescE Offline
        eyllanescE Offline
        eyllanesc
        wrote on last edited by
        #2

        @ChiefyChief I don't reproduce the problem on Linux with Qt6 6.2.0

        If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

        Q 1 Reply Last reply
        0
        • C ChiefyChief

          Good afternoon all,

          I've recently tried upgrading to Qt6.2 from Qt5.12 recently and have hit an interesting issue I was hoping if anyone else noticed. Below is a barebones example so hopefully its reproducable, as I can reproduce it on my machine with just this.

          Basically the issue is that QMainWindow no longer likes having a QQuickWidget set as the Central Widget. If you run the code below, it will run perfectly fine as you would expect. However, if you uncomment _module = new QQuickWidget(); and comment _module = new QWidget(); the application will crash when trying to show(). Note, this also crashes with showMaximise(); but I assume those are connected.

          class Playground : public QMainWindow
          {
          public:
              Playground()
              {
                  //_module = new QQuickWidget();
                  _module = new QWidget();
                  setCentralWidget(_module);
              }
          private:
              QWidget* _module = nullptr;
          };
          
          int main(int argc, char* argv[])
          {
              QApplication application(argc, argv);
          
              Playground playground;
              playground.show();
          
              return QApplication::exec();
          }
          

          As you would expect this is quite an issue! So I'm putting it out to see if anyone else has had this problem?

          The actual crash message is something I've never seen before as well

          ! Debugger reported unrelated range(s) for 0x00007ffcf393a77a: [0x00007ffcf393a37a..0x00007ffcf393a3ab]
          

          Additional notes:
          Fresh Qt6.2 on 05/10/2021
          IDE: CLion
          CMake
          OS: Windows

          Danke in advanced

          B Offline
          B Offline
          Bob64
          wrote on last edited by
          #3

          @ChiefyChief I have just installed 6.2 on Windows, just to have a look at. I tried your example and for the quickwidget case I see no window and this on the console:

          QQuickWidget is only supported on OpenGL. Use QQuickWindow::setGraphicsApi() to override the default.
          17:39:09: The program has unexpectedly finished.
          17:39:09: The process was ended forcefully.
          

          If I add this in main, before the Playground instantiation, it works for me:

          QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);

          1 Reply Last reply
          0
          • C Offline
            C Offline
            ChiefyChief
            wrote on last edited by
            #4

            Thank you both for your answers.

            @Bob64 This addition has made my application now work again, so thank you very much for this!
            @eyllanesc Thanks for confirming this on Linux too, but I'm curious that it actually worked for you without changing the Graphics Api!

            Danke

            eyllanescE 1 Reply Last reply
            0
            • C ChiefyChief

              Thank you both for your answers.

              @Bob64 This addition has made my application now work again, so thank you very much for this!
              @eyllanesc Thanks for confirming this on Linux too, but I'm curious that it actually worked for you without changing the Graphics Api!

              Danke

              eyllanescE Offline
              eyllanescE Offline
              eyllanesc
              wrote on last edited by
              #5

              @ChiefyChief Most likely, on Linux QSGRendererInterface::OpenGL is used by default

              If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

              1 Reply Last reply
              0
              • L Offline
                L Offline
                Larray.Feng
                wrote on last edited by Larray.Feng
                #6

                @Bob64
                you answer solves my problem, thank you so mack!

                1 Reply Last reply
                0
                • I Ioneater referenced this topic on
                • eyllanescE eyllanesc

                  @ChiefyChief I don't reproduce the problem on Linux with Qt6 6.2.0

                  Q Offline
                  Q Offline
                  Qter_sean
                  wrote on last edited by
                  #7

                  @eyllanesc so do I. add this code : QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);

                  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