Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    QGLWidget in a plugin

    General and Desktop
    2
    3
    1522
    Loading More Posts
    • 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.
    • Z
      zzz9 last edited by

      My application uses plugins which have forms for options, etc. When I use simple forms with simple widgets like push buttons and labels everything works ok, form appears in main application but when I use QGLWidget I receive the following message: "QApplication must be created before QPainterDevice", then main application crashes. How to embed QGLWidget in a plugin in a proper way?

      1 Reply Last reply Reply Quote 0
      • M
        mlong last edited by

        May be silly to ask, but are you creating a QGLWidget before your QApplication (that is, are you instantiating the QApplication first-hand before you load plugins, etc.?

        Software Engineer
        My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

        1 Reply Last reply Reply Quote 0
        • Z
          zzz9 last edited by

          I load plugin by clicking the button in the main window thus QApplication was already created by this moment. Just tell me if you have successfull practice in using QGLWidget in a plugin. I don't know if it is bug in my application or QGLWidget cannot really be used in a plugin.

          EDIT: Really, I use the class that has QGLWidget as a subclass. Tried to use QGLWidget instead. Everything ok. So the problem is in plugin.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post