[Qt-interest] QMainWindow and QGL.

Freak . mentalcodes at gmail.com
Tue May 12 23:59:59 CEST 2009


Hi, I'm new to C++ and Qt development. (long time listener, first time
poster)
I'm using the LGPL license attempting some personal development, using
MSVC2008 under x64. I have compiled the libs for x64 and I can compile
examples without any issues.

A very simple Noob question: I'm trying just to make an OGL example with a
single QMainWindow and the Central Widget set to QGLWidget. I'm trying to
workout how to place the QGL Widget as the Central Widget? I have looked
through the documentation and examples, (which are great BTW) but am unable
to see how i set it.

I have read about these below and i assume I'm on the right path but am
unable to work out where or how or where i implement this for my GLWidget
class.

QWidget <qwidget.html> * QMainWindow::centralWidget () const

void QMainWindow::setCentralWidget ( QWidget <qwidget.html> * *widget* )

setCentralWidget(

So i guess the above commands are what i want, but implementing it seems to
make me run around in circles.... Am i on the right path? Individually i
have a main.cpp, mainwindow.cpp and GLWidget.cpp  with appropriate headers,
I can compile the application so either window works, but i cannot get Main
to display GLWidget.

Any help on the matter would be good, meanwhile i have many books, example
and docs to try and read...

Cheers,
Scott.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090513/e647b5d3/attachment.html 


More information about the Qt-interest-old mailing list