About windows in hmg3, 4 and qt
Posted: Wed Jul 27, 2011 9:04 am
I'm trying to understand which kind of windows can be defined in hmg3 and how we can map them in hmg4/qt.
I see in the hmg3 source files that we may have WINDOWTYPE
MAIN (there must be ONLY ONE such window type), CHILD, MODAL, STANDARD, SPLITCHILD. Some checks are done to be sure that we respect some limits.
In the only source code of a real application (thanks Mol) developed in hmg3 I see a lot of MODAL windows and just one CHILD... anyway, other programmers may have different needs.
Now I ask to the other developers using hmg3: do you actually use all these windows types ? can you please show me samples ?
Now to Qt.
In Qt there is no concept of "main window"... actually we may have any widget as the "main window"... or can be a QDialog...
There is a QMainWindow that can serve as the "main" window. A QMainWindow may have a relocatable toolbar, statusbar, menu, relocatable docks (panels) but in order to work without problems IT NEEDS/WANTS a central widget defined, so that moving toolbars, resizing window, etc Qt can do correctly its job.
As I said, QMainWindow is perfect for hmg4 WINDOWTYPE MAIN (except for the central widget that we now have to specify manually while we should do automatically in hmg4 code). Check at http://doc.qt.nokia.com/latest/qmainwindow.html
It's also good for WINDOWTYPE MODAL and also in this case we should set the centralwidget.
What about CHILD, SPLITCHILD and STANDARD windows ? I'm trying to understand how they work, they are used in some hmg3 samples... but are they really used in "real" code ?
So, according to HMG3 docs and code, we must check that the first defined window is of MAIN type and exit the program otherwise. We should also add a qWidget to be used as the central widget of the windows.
Francesco
I see in the hmg3 source files that we may have WINDOWTYPE
MAIN (there must be ONLY ONE such window type), CHILD, MODAL, STANDARD, SPLITCHILD. Some checks are done to be sure that we respect some limits.
In the only source code of a real application (thanks Mol) developed in hmg3 I see a lot of MODAL windows and just one CHILD... anyway, other programmers may have different needs.
Now I ask to the other developers using hmg3: do you actually use all these windows types ? can you please show me samples ?
Now to Qt.
In Qt there is no concept of "main window"... actually we may have any widget as the "main window"... or can be a QDialog...
There is a QMainWindow that can serve as the "main" window. A QMainWindow may have a relocatable toolbar, statusbar, menu, relocatable docks (panels) but in order to work without problems IT NEEDS/WANTS a central widget defined, so that moving toolbars, resizing window, etc Qt can do correctly its job.
As I said, QMainWindow is perfect for hmg4 WINDOWTYPE MAIN (except for the central widget that we now have to specify manually while we should do automatically in hmg4 code). Check at http://doc.qt.nokia.com/latest/qmainwindow.html
It's also good for WINDOWTYPE MODAL and also in this case we should set the centralwidget.
What about CHILD, SPLITCHILD and STANDARD windows ? I'm trying to understand how they work, they are used in some hmg3 samples... but are they really used in "real" code ?
So, according to HMG3 docs and code, we must check that the first defined window is of MAIN type and exit the program otherwise. We should also add a qWidget to be used as the central widget of the windows.
Francesco