Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. The opengl window only flashes........
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.4k 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.
  • S Offline
    S Offline
    shadowfox
    wrote on last edited by
    #1

    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
    0
    • Q Offline
      Q Offline
      qxoz
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • S Offline
        S Offline
        shadowfox
        wrote on last edited by
        #3

        [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
        0
        • Q Offline
          Q Offline
          qxoz
          wrote on last edited by
          #4

          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
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved