Results 1 to 3 of 3

Thread: QGLWidget questions.

  1. #1
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1

    Unhappy QGLWidget questions.

    I wrote a simple opengl program using QGLWidget. It looks like this


    As you can see glwidget takes all the space of the window. How can I resize it?
    glViewport() does not help.


    I want to make it smaller and add some buttons on the right.
    I use this code to add glwidget on the window:
    Qt Code:
    1. Window::Window() // constructor
    2. {
    3. glWidget = new MyGLWidget;
    4. QHBoxLayout *mainLayout = new QHBoxLayout;
    5. mainLayout->addWidget(glWidget);
    6. setLayout(mainLayout);
    7. setWindowTitle(tr("Hello GL"));
    8. }
    To copy to clipboard, switch view to plain text mode 

    P.S. Sorry for my English.

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 268 Times in 268 Posts
    Wiki edits
    20

    Default Re: QGLWidget questions.

    Use layouts.
    You already use one.

  3. The following user says thank you to tbscope for this useful post:

    Rebekka (28th September 2010)

  4. #3
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1

    Default Re: QGLWidget questions.

    Quote Originally Posted by tbscope View Post
    Use layouts.
    You already use one.
    Thanks for the right direction to search


Similar Threads

  1. QGLWidget and VBO
    By kaszewczyk in forum Newbie
    Replies: 1
    Last Post: 6th May 2010, 11:04
  2. QGLWidget
    By manmohan in forum Newbie
    Replies: 2
    Last Post: 5th June 2009, 13:54
  3. Can not use QGLWidget.
    By Teuniz in forum Installation and Deployment
    Replies: 3
    Last Post: 25th September 2007, 01:27
  4. QGLWidget bug
    By Wizard in forum Qt Programming
    Replies: 11
    Last Post: 31st August 2007, 12:23
  5. qGLWidget
    By mickey in forum Newbie
    Replies: 8
    Last Post: 24th February 2006, 01:30

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
  •  
Qt is a trademark of The Qt Company.