davethomaspilot
12th June 2012, 00:47
I keep having problems for which the recommended solution seems to be "rerun qmake".
Example, I just created a new exposure_controls.ui using Qt Designer and the only way I know to get a ui_exposure_controls.h is to:
1) create a header file (call it exposure_controls.h") that defines a new class which:
a) includes "ui_exposure_controls.h"
b) defines a class (call it Exposure) which inherits from the class defined in exposure_controls.ui (and other Qt objects)
c) has a Q_OBJECT macro
2) Create an instance of the Exposure class.
3) Run qmake -project;qmake QtApe1.pro; qmake -tp vc QtApe1.pro
seems overly complicated--I suspect I'm missing something.
Also while this is working for me, whenever I do step 3, a property sheet I have added to the Visual Studio 10 for non-QT libraries gets excluded. So, I have to re-add it each time after doing the qmake stuff.
Seems like there should be a better way?
Also--
I have a MainWindow with a few slots and connects to simple methods. It's working, but now I wonder about "Best Practices". For example, I created a widget with sliders and push buttons. I want it to be displayed when one of the menu items is clicked.
Do I just add that widget as a data member of the MainWindow class? Same for any associated methods? I'm worrying that I'll end up with a huge MainWindow class and that there might be a better way.
Thanks,
Dave Thomas
Example, I just created a new exposure_controls.ui using Qt Designer and the only way I know to get a ui_exposure_controls.h is to:
1) create a header file (call it exposure_controls.h") that defines a new class which:
a) includes "ui_exposure_controls.h"
b) defines a class (call it Exposure) which inherits from the class defined in exposure_controls.ui (and other Qt objects)
c) has a Q_OBJECT macro
2) Create an instance of the Exposure class.
3) Run qmake -project;qmake QtApe1.pro; qmake -tp vc QtApe1.pro
seems overly complicated--I suspect I'm missing something.
Also while this is working for me, whenever I do step 3, a property sheet I have added to the Visual Studio 10 for non-QT libraries gets excluded. So, I have to re-add it each time after doing the qmake stuff.
Seems like there should be a better way?
Also--
I have a MainWindow with a few slots and connects to simple methods. It's working, but now I wonder about "Best Practices". For example, I created a widget with sliders and push buttons. I want it to be displayed when one of the menu items is clicked.
Do I just add that widget as a data member of the MainWindow class? Same for any associated methods? I'm worrying that I'll end up with a huge MainWindow class and that there might be a better way.
Thanks,
Dave Thomas