Results 1 to 6 of 6

Thread: QGLWidget with frame around it

  1. #1
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default QGLWidget with frame around it

    I think the title says it all! I 've done some experiments by myself, but i always get weird results. So whats the best approach in drawing a widget (and a qglwidget in particular, but it shouldn't make a difference) with a frame (with the color and a width of your choice).

    Thanks in advance

  2. #2
    Join Date
    Aug 2008
    Location
    Algarve, Portugal
    Posts
    288
    Thanks
    23
    Thanked 32 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QGLWidget with frame around it

    Just draw four lines in the extreme coordinates sides of the qlwidget
    __________________________________________________
    My projects: calculator MathGraphica ; SuperEpicMegaHero game ; GooglePlay ; bitbucket ; github
    Like my projects ? Buy me a kofi

  3. #3
    Join Date
    Feb 2010
    Posts
    20
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGLWidget with frame around it

    i'm sorry but i can't quite follow you. Can you elaborate pls?

  4. #4
    Join Date
    Aug 2008
    Location
    Algarve, Portugal
    Posts
    288
    Thanks
    23
    Thanked 32 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QGLWidget with frame around it

    check this link
    You'll have to use width() and height() to get the qglwidget client area coordinates. than just draw 4 lines, like a frame in the client area perimeter.
    Note that qglwidgt requires you to define a viewport, so you'll have to do proper math conversion's between opengl and widget
    coordinates. Any doubt let me know.
    __________________________________________________
    My projects: calculator MathGraphica ; SuperEpicMegaHero game ; GooglePlay ; bitbucket ; github
    Like my projects ? Buy me a kofi

  5. #5
    Join Date
    Oct 2009
    Posts
    151
    Thanks
    6
    Thanked 13 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGLWidget with frame around it

    Or you could insert your widget into a QSplitter and use one of its setFrame... member functions.

  6. #6
    Join Date
    Aug 2008
    Location
    Algarve, Portugal
    Posts
    288
    Thanks
    23
    Thanked 32 Times in 28 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QGLWidget with frame around it

    You're right, that sound's much more simple
    __________________________________________________
    My projects: calculator MathGraphica ; SuperEpicMegaHero game ; GooglePlay ; bitbucket ; github
    Like my projects ? Buy me a kofi

Similar Threads

  1. Video Parsing - Frame by Frame
    By ctote in forum Qt Programming
    Replies: 3
    Last Post: 15th February 2010, 18:30
  2. PNG that contains more than one frame
    By sophister in forum Qt Programming
    Replies: 2
    Last Post: 8th December 2009, 15:33
  3. Replies: 24
    Last Post: 13th August 2009, 10:13
  4. Previous frame inner to this frame(corrupt stack?)
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 28th May 2007, 01:35
  5. Previous frame inner to this frame(corrupt stack?)
    By coralbird in forum Qt Programming
    Replies: 17
    Last Post: 29th April 2006, 01:42

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.