Results 1 to 2 of 2

Thread: Add OpenGl window to the grid layout of the child qwidget.

  1. #1
    Join Date
    Jul 2010
    Posts
    38
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Add OpenGl window to the grid layout of the child qwidget.

    Hi Friends,

    I am facing some problem while adding the opengl window to the child qwidget. I have:

    - Parent qwidget.
    - 1 grid layout
    - 1 opengl window
    - 1 child qwidget (of parent qwidget).

    1'st I am adding the opengl window to the gridlayout then I am adding the gridlayout to the child qwidget. But I did not get any view (also paintGl is not calling, if by how I call paintGl then also I am not getting the view)

    Note: If I directly set the layout to the parent qwidget then I got the open gl window.

    What I am missing here??? I have attached my example along with this post.

    Thank you very much...OpenGlTest.zip

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Add OpenGl window to the grid layout of the child qwidget.

    Create a layout and add the dummy frame to it as well. Your dummy frame probably has a QSize(0,0).
    Qt Code:
    1. IntegrateDraw::IntegrateDraw(QWidget *parent): QWidget(parent)
    2. {
    3. //OpenGL object
    4. oGlDraw = new OpenGlDraw();
    5.  
    6. //QWidget
    7. dummyFrame = new QWidget(this);
    8. //dummyFrame->setWindowFlags( Qt::Dialog); //Point 3
    9.  
    10. //Grid layout
    11. gLayout = new QGridLayout();
    12. gLayout->addWidget(oGlDraw);
    13.  
    14. //setLayout(gLayout);
    15. dummyFrame->setLayout(gLayout);
    16.  
    17. // this does it:
    18. l->addWidget(dummyFrame);
    19. setLayout(l);
    20. };
    To copy to clipboard, switch view to plain text mode 
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

Similar Threads

  1. Create a QWidget as child of a Win32 window
    By BenPa in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 29th March 2011, 15:35
  2. Replies: 1
    Last Post: 16th September 2010, 16:57
  3. Replies: 5
    Last Post: 7th November 2006, 16:01
  4. How do I layout in a Grid?
    By DPinLV in forum Qt Tools
    Replies: 7
    Last Post: 10th August 2006, 02:37
  5. Grid layout
    By nupul in forum Qt Programming
    Replies: 7
    Last Post: 21st April 2006, 22:15

Tags for this Thread

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.