Qt Forum

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

    The opengl window only flashes........

    General and Desktop
    2
    4
    2231
    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.
    • S
      shadowfox last edited by

      i create an opengl widget and want the windows to show up when i push the button (not in main(),but in other func)
      this is my code ,when i push the button ,the windows only flashes and i can not see what has been paint in the window.

      @void Widget::startrun(){
      visualazition grvisual;
      grvisual.show();
      }@

      the func "startrun" has already been connectd to the button(cleck()). visualization is the class name of my opengl widget class.
      how can i solve the problem?

      1 Reply Last reply Reply Quote 0
      • Q
        qxoz last edited by

        if visualazition inherit from QWidget try
        @
        visualazition *grvisual = new visualazition;
        grvisual->show();
        @

        1 Reply Last reply Reply Quote 0
        • S
          shadowfox last edited by

          [quote author="qxoz" date="1322369122"]if visualazition inherit from QWidget try
          @
          visualazition *grvisual = new visualazition;
          grvisual->show();
          @[/quote]

          it works! thanks a lot! through it actually inherit from qglwidgt.
          why it's that? is there any difference between pointers & normal class?

          1 Reply Last reply Reply Quote 0
          • Q
            qxoz last edited by

            I`l glad to,
            but my English is very bad, and i do't think that i can give right explanation
            search here about function scope(or vision area )
            "http://www.cprogramming.com/tutorial.html":http://www.cprogramming.com/tutorial.html
            "http://www.learncpp.com/":http://www.learncpp.com/
            "http://www.cplusplus.com/doc/tutorial/":http://www.cplusplus.com/doc/tutorial/

            and of course
            "http://qt.nokia.com/learning":http://qt.nokia.com/learning

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