[merged] qglwidget and layouts problem?
hello i have my QGLWidget setup and showing inside my mainlayout but i cant seem to get it showing a black box or anything like for instance when i dont put QGLWidget inside a layout and just show it, it shows a Black Box like it should but how do i get that within the layout and if i could do this i would be able to use it as a form of eye candy :) thanks in advance
Get an svn checkout of a few simple OpenGL examples that uses QGLWidget from my repository:
- svn co https://svn.theharmers.co.uk/svn/codes/public/opengl/trunk opengl-examples
- cd opengl-examples/06-solar-system
Basically follow the QGLWidget documentation and override paintGL(), resizeGL(), and initializeGL(). Then override any event handler functions that you need e.g. keyPressEvent( QKeyEvent* e ).
these are great for someone who is using C++ as the core code but i much prefer QML way of doing things so how would one do that with QML? :) i just love that hole idea that a gui is run by a unique part and 3D graphics done by another and plus its alot nicer to work with once im very good with QML i will defently look into C++ focused QT for more control if needed for more freedom as i love C++ :) its very nice
okay so i really didn’t want to post again but im very confused :(
iv got a QML written Application all done by me but i dont understand how to put opengl code into it i have my QGLWidget showing but i dont know where to put the code i know the docuementation is great but only for C++ focused coding and not QML :( so where would one go for QML i like QML but i also like the C++ way of doing it just makes things alot more funner for me using QML any ideas? :) thank you if iv miss read something or iv done something wrong please tell me so its possible that i can learn from it also please tell me how you figure this stuff out because im out of options when it comes to thinking of ways of making things work in QT
Please don’t double post. You’ve already asked this question in your original thread [developer.qt.nokia.com] less than two hours ago. Be patient, and someone will reply there if they have an answer for you.
Take a look at this, but this isn’t the code I found earlier.
But still might be helpful: Click here [talk.maemo.org]
Thats how you do it with C++ :) i want to do it in QML mostly unless that the only way, if i do then ill otherwise have to rewrite all my QML into C++ / QT way of doing code which is very tedious and i would rather do that in a later update of my application for now i just want things to work and the tutorials to actually work logically :D this is really annoying :((( not at you tho dude just in general finding a decent gui toolkit that has documentation that makes sense is very hard to come by some of the books are nice but they dont explain Opengl with QT in total detail which is very very /inraging :(
Ok… maybe we’ll discuss it here. :-)
Outside of some nifty stuff which is still forthcoming, there is no direct OpenGL access available from inside of QML. It all has to be done from the C++ side of things as far as I know. QGLWidget is, by definition, a C++ thing.
The info that xcoder posted is all about making the QGLWidget coexist with your QDeclarative (QML) display area. That’s probably as close as you’re going to get at the moment. I don’t see where that necessarily requires you to rewrite all of your QML into C++.
okay :D then ill do it np :) i just need to know where to place the code and is there any tutorials that explains in good detail i tried using the Orginal QT documentation but its not very detailed with the idea of placement of code inside someone elses abstract code and problems of that nature :)
wheres the common place to put this code? :) for most people and why? and how do you figure that out and know the reasons?
please go into detail when answering :]
if you need my code just ask :)