Page 2 of 2 FirstFirst 12
Results 21 to 30 of 30

Thread: Render QWidget within QGLWidget

  1. #21
    Join Date
    Sep 2010
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Render QWidget within QGLWidget

    Just to put things into perspective im trying to load a heightmap in OpenGL which i know how to do.

    When i try to make a reasonably simple widget like eg

    http://i51.tinypic.com/30tjlmh.jpg

    the above image shows how far i am (the white square is the "space" where my heightmap will go dont worry about it)

    I cant edit the line edit or i cant move the box around, i have been tinkering with this for quite a while now. im not sure whynot, ive tried 3 different examples im doing the exact same thing as the other examples. i cant seem to click/select anything within my widgets

  2. #22
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Render QWidget within QGLWidget

    Have you overwritten the scenes event (mouse keyb) handlers? Then don't forget to call the inherited ones!

    Have you enabled the item flag focusable?

    Thx for sharing the screenshot. Puts things into perspective :->

    Joh

  3. #23
    Join Date
    Sep 2010
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Render QWidget within QGLWidget

    ive only implemented listeners for my openGLScene. for moving up down left and right through my scene (even they dont work properly yet but ill get there)

  4. #24
    Join Date
    Sep 2010
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Render QWidget within QGLWidget

    Feel like such an idiot. my problem was that i didnt pass the mouseMoveEvent/mousePressEvent to QGraphicsScene base class

  5. #25
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Render QWidget within QGLWidget

    That's what I said! call the inherited ones!

    Good night,

    Johannes

  6. #26
    Join Date
    Sep 2010
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Render QWidget within QGLWidget

    Im running into problems when i change the layout of my Widget in Qt designer, i clean project files, rebuild all and when i run the program it doesnt show the changes made to my widget. is there any reason for this? :O kinda stuck here?

  7. #27
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Render QWidget within QGLWidget

    Maybe you are editing a different file with the designer than the one that is used in the project?

    Create a new directory, copy your source files to it. Create an empty new project. Add your files to it. Make sure the project file is correct / compare with the old one. Go to bed :->

    BTW: This is a totally new question.. and has nothing to do with this thread.

    Joh
    Last edited by JohannesMunk; 21st September 2010 at 22:08.

  8. #28
    Join Date
    Sep 2010
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Render QWidget within QGLWidget

    ahh nvm i had it running the debug build instead of the release build. Ah learning new things the hard way
    Last edited by crazymonkey; 22nd September 2010 at 11:44.

  9. #29
    Join Date
    Sep 2010
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Render QWidget within QGLWidget

    Hey Joh

    When i try to render my scene in wireframe using

    glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

    It also "draws" my widget wireframe and it looks horrible

    any way in which i can circumvent this problem?

    edit: nvm
    Last edited by crazymonkey; 26th September 2010 at 13:54.

  10. #30
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Render QWidget within QGLWidget

    yes: reset that at the end of your drawing.

    OpenGL is a state machine. You always should revert things back to the way they were.

    Joh

Similar Threads

  1. Replies: 1
    Last Post: 7th May 2010, 17:20
  2. QGLWidget Render Text in the foreground
    By arpspatel in forum Qt Programming
    Replies: 1
    Last Post: 11th April 2010, 11:35
  3. How to render the contents of QPrinter to QWidget
    By nifei in forum Qt Programming
    Replies: 0
    Last Post: 6th March 2009, 04:25
  4. QWidget::render with DrawChildren flag
    By Apocalypse in forum Qt Programming
    Replies: 4
    Last Post: 4th January 2009, 22:15
  5. QWidget::render() and sharedPainter
    By faldzip in forum Qt Programming
    Replies: 0
    Last Post: 10th November 2008, 20:04

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.