Tuesday 22 March 2011

Using Qt GUI components and NGL

This blog post is going to be my first Video blog post, it show how to start from scratch and create a gui program using Qt and NGL, the videos have been posted to youtube as the quality is much better than on blogspot, and you can grab the code using bzr from here

bzr branch http://nccastaff.bmth.ac.uk/jmacey/Code/QtNGL

For my students I've also copied the original movie files onto the public directory here /public/mapublic/jmacey/QtNGL/

Part 1 Setup

This video show how to setup the initial project and directories, it uses the ncca coding standard for project setup



Part 2 Adding source files to the project

This video shows how to add our source files as well as an initial QMainWindow class and a main.cpp file



Part 3 Setting up the .pro project file

This move shows how to setup the .pro file for qmake and we write a simple QApplication within the main.cpp file



Part 4 Creating a GUI using the Designer

In this Video I create the inital part of the GUI using the QDesigner module of QT Creator, I also go into quite a lot of detail about using the QGridLayout and the use of Layouts in general




Part 5 Adding the rest of the GUI components

In this video I add the rest of the UI components and finish off the rest of the GUI.



Part 6 Creating the OpenGL Window

In this video we extend the QGLWidget class to build our own GLWindow which we will put in the NGL classes to draw a teapot / sphere and cube and adjust the properties of the ngl::Transform Class.  In this initial part of this video we add the GLWindow to the grid layout. I've added an empty GLWindow.cpp/h file here



Part 7 Adding NGL to the .pro file

Next we add lots of flags to the .pro qmake file to configure the paths used for the ngl library.



Part 8 Adding a Camera

Now we add an ngl::Camera class and a simple ngl::Primitive drawing routine



Part 9 Adding glsl Shaders

Using the ngl::ShaderManager class we load the vertex and fragment shaders and give them a quick test



Part 10 Adding Signals and Slots 

We now use the Qt Signals and Slots mechanism to wire up the GUI components to our GLWindow class



Part 11 connecting the rest of the GUI components

Using the signals and slots mechanism I wire up the rest of the components





Part 12 Connecting the combo box


Using signals and slots I connect the QComboBox to select the different drawing modes



Part 13 Lights and Colour

In the final instalment I add an ngl::Light and Material to the program to light and set the initial material values, next I use the QColorDialog to select the colour I wish to use for the object

No comments:

Post a Comment