Answering this is best answered by explaining what QT is.
Q T is a professional graphical toolkit. Most every program that has a gui to it is based upon some kind of gtk. Whether it is the windows api's, Java swing/awt, GDK, QT, or raw X11. They all have a lot in common, in terms of classes provided and functionality. Some are easier then others, and some are prettier then others, but once you have learned one going to another is trivial.. In contrest glut is not a professional gtk, it is meant to provide a cross platform skeletal framework around a GL rendering context. Which it does, but its usefuless is limited to small gl projects, like pong.
90% of learning qt is just learning a general idea of what classes do what and how to look them up in the documentation to use them.
The other 10% is compiling.
Since this is for a relatively limited set of projects I'll keep things related to them
In glut you create a window, intialize the gl and then delagate the running of things to either an idle function or preferably a pair of timer driven functions (a draw and update world function).
In QT you will do something similar. Just that instead of making an blank window to put your gl stuff in you will make a much more powerful window class you can attach things too. This class should hold the vast majority of the qt code you have to do. Which pretty much boils down to initializing widgets and connecting them to functions in the glwindow to call.
Inside the major window you will want a window for the GL stuff to be displayed in, this requires initializing a bunch of buffers, linking things up, etc etc. But its all nicely handled for you, just superclass from QGLWidget and override 3 functions.
I have written some code for you to get started with, I would highly recommend it. Not just to look at and write your own on the side, but as a place to start. It has a good architecture to build upon, some examples of useful stuff which you can easily remove, and a very powerful makefile.
I am going to do a quick overview of the concepts and classes below and then get right into code. Most everything below has an example in the code so it would be best to start there. This is an excellent place to look through if you are trying to get something in particular to work.
these are beautiful for reducing linkage. A slot is a function..its just got the extra public slot: under its typing. A signal is something a class can emit, for example a push button emits clicked when it is pressed. You can use connect to like the signal to a slot, so whenever that signal is emitted, a cooresponding function is called. So when the button is pushed, some function is called. Its easy and powerful.
The syntax is: connect( button, SIGNAL( clicked()), this, SLOT( buttonClicked()))
button is a pointer to the object emitting the signal
clicked() is the type of the signal (some signals emit things with values so
it could be clicked(int))
this is a pointer to the object
SLOT( buttonClicked()) is the function to call.
QT stuff to know. There are about a dozen classes you really need to know to use qt. I'll explain what they do and which functions to know as well as a good constructor to use(there are usually several complicated constructors with tons of default parameters)
This is the base class for anything you want to have its own viewport. From your main your main window down to the smallest icons. This has a zillion functions, but you wont need the huge majority of them.
Similar to a qwidget, only that it allows for GL functioncalls. There are 3 functions you need to implement for it to work, as well as some convenient ones for you to use.
A Qlabel is just an image or text somewhere that has no interaction associated with it.
Just a simple button with text or an icon. Emits clicked() when clicked.
QMenu bar is the actual bar across the top, it holds a bunch of popup menus.
QPopupMenu is a menu that pops up somewhere (only going to cover there use in
menus.
QMenubar* menubar = new QMenubar
QPopupMenu* fileMenu = new QPopupMenu
fileMenu->insertItem("&Save", this, SLOT(save()), CTRL + Key_N
); //adds a new button to the file menu
menubar->insertItem( fileMenu ) //adds the popupmenu to the menubar
layout->setMenuBar( menubar ) // neccessary to keep it from overlaping with
things
Your window class will need a layout of some kind. The box layouts represent vertical and horizontal orderings of them. Used iteratively they are very effective. So if you want a main window, with a panel of buttons on the side you create a Horizontal box that holds the main window and another layout, the second layout being a vertical sorting of buttons.
QHBoxLayout( this ) -> to create your main layout
QVBoxLayout( hboxlayout ) -> to put this layout inside the other one.
addWidget( Widget* w ) -> adds w to this layout.
addStretch( int position, int stretchiness ) -> inserts some empty space
in teh position, stretchiness determines its willingness to stretch (use 1).
addStretch( -1, 1 ) -> Will keep all your empty space at the end of the layout.
Compareable to a Java gridbag layout, it holds widgets in a grid of rows and columns. This is the most powerful layout, but it can be tricky.
addWidget( Widget* w, int row, int column )
addMultiCellWidget( w, int fromRow, int toRow, int fromColumn, int toColumn
) Adds a widget that takes up multiple rows and columns, instead of doing the
two box layouts you can use one grid layout, and put the buttons in different
cells on the side, and then have the main widget occupy all the cells to the
side of them.
addItem / addMultiCellItem similar to the widget adds only they add layouts.
QRadioButton / Button Group -> Almost identical to QPushButton, just you put the button's in a button group and only one can be selected at a time.
QColorDialog -> Its a big dialog for choosing colors, its new though so ive never used it.
QString -> its a string, comparable to Java::string. Only some of the nice language supported features(toString). Replace all your char*'s with it.
QStrList -> An extension of QValueList<String>
Q[Value/Ptr][List/Queue/Stack/Dict/Vector] all the data types you could want. Personally I use the two vectors for most everything. Dictionaries are very nice if you have use for them though (hash map).
QPtr stuff specifically keeps a pointer to the data, and can be set to autodelete it for you. This is very nice, as it allows you to keep other pointers synchonized to list elements, without having to keep track of when to delete things. I generally don't use them though.
qFatal( char* s)// kills the program and outputs s, s is essentailly a printf call
qWarning( char* s )//similar only it doesn't kill the program
Q_CHECKPTR( void* v ) //outputs a nice debugging message if v is null (use htis whenever you allocate memory ).