Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Solved : Problems using QGLWidget as base to promote to own class
Forum Updated to NodeBB v4.3 + New Features

Solved : Problems using QGLWidget as base to promote to own class

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 2 Posters 1.6k 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.
  • U Offline
    U Offline
    UKall
    wrote on last edited by
    #1

    Hi all!
    To add some graph plotting to a widget I want to use QGLWidget as base widget in designer and promote to my own derived class. But QGLWidget does not show up in the list. So I tried to promote from QWidget directly but the resulting code does not compile.
    As i presume the error is somewhere else, (i am exporting my code into a library first), my first question is:

    • is the way i described it the way it should work (e.g. use of the base class should work, too?)
      And secondly:
    • why is QGLWidget not available for selection to promote from in design mode? (using QtCreator2.8.1).

    any help would be appreciated.

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2

      In Designer you can use a QWidget as a placeholder and RMB on it to promote it as explained "in this article":http://qt-project.org/doc/qt-4.8/designer-using-custom-widgets.html

      I haven't done it with QGLwidget myself though, but should work.

      hope this helps

      Qt Certified Specialist
      www.edalsolutions.be

      1 Reply Last reply
      0
      • U Offline
        U Offline
        UKall
        wrote on last edited by
        #3

        Ok, thx.
        So i'll check for the library inclusion first.

        1 Reply Last reply
        0
        • U Offline
          U Offline
          UKall
          wrote on last edited by
          #4

          Hmm. I found that the linker explicitly seeks for a directly QWidget-derived class, so without being able to choose QGLWidget as base, I think I will not be able to use the designer ui-file and thus need to code the ui manually again :-(.
          Is it generally impossible to promote through more than one level of inheritance?

          EDIT:
          After finding out some more about the use of libraries under Qt,Win32 and MSVC, I can confirm that use of QWidget as placeholder is possible, so multiple levels of inheritance work here and designer can be used as I hoped without knowing the one-below-top-level derived class.

          1 Reply Last reply
          0
          • EddyE Offline
            EddyE Offline
            Eddy
            wrote on last edited by
            #5

            Thanks for confirming your findings to the forum

            happy coding!

            Qt Certified Specialist
            www.edalsolutions.be

            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