I'm learning c++ and QT and would like to be able to launch windows from a console application. Is this even possible?
A:
If you are using MSVC you can try setting Subsystem->Console in Project Settings->Linker->System.
But why do you need such behaviour?
Paul
2009-03-12 22:04:41
I'm using the new QTCreator IDE to build a console app. It has an option when you start a new application to choose gui or console. So i've chosen console. I just want simple textual interface where results can be displayed in QT-gui windows. Should I just choose another approach?
2009-03-13 15:02:00
I do not have access to QtCreator now, but as far as I remember this choice only affect whether QCoreApplication or QApplication is created in your main() function.
Paul
2009-03-13 16:53:08
The question is: what do you need console application for?If you want to be able to run application without GUI running, you should use QCoreApplication, but I am not sure you will be able to create QWidgets in this case.
Paul
2009-03-13 16:55:23
Maybe it is OK in your case to create console-like window and use QApplication.
Paul
2009-03-13 16:59:56
A:
Yes, it's possible. We can't help you unless you describe what you've tried and what exactly isn't working.
Joe Gauterin
2009-03-13 12:22:24
I'm using the new QTCreator IDE to build a console app. It has an option when you start a new application to choose gui or console. So i've chosen console. I just want simple textual interface where results can be displayed in QT-gui windows. Should I just choose another approach?
2009-03-13 15:03:14
+1
A:
This is possible, but I think you might be better served by separating the GUI and console portions into separate programs, and running the GUI parts from the console program. Otherwise, you will probably have to mangle one of the paradigms involved: console apps generally don't use event loops, but your GUI windows will not respond to anything unless you let Qt take over and run with its own event loop.
Caleb Huitt - cjhuitt
2009-03-13 17:31:21