Hi, I'm a beginner at C++ and I was wondering if I could get some help with making a gui using QT. Well not really help on making a gui more like help on seeing if I installed QT properly onto my computer. I downloaded the Qt sdk and ran it like normal and let it do all the work. What I'm wondering is do I have to add a path and how can I tell I did everything properly? Should the Qt sdk just do everything on its own or do I have to do additional stuff? Also could somebody show me a guide to using Qt?
Also can you program on Microsoft Visual C++ 2010 with the added library? I'm assuming yes because it is a library and all you have to do is include the stuff, but I could be wrong be cause Qt also gave you a IDE or compiler (just checking to be sure).
Thank you for your reply.
Just to be sure, does this mean that Qt does not work with Microsoft Visual C++ 2010? And if so could I use the compiler that came with the Qt SDK (Qt Creator)?
To use Qt with VC++ you have to compile the library from source. The only binaries available on the Qt site are for MinGW. You may be able to find unofficial builds.
Compiling will take around 2-3 hours and 10 GiB. After compiling, much of it can be compressed or deleted so that the entire thing takes less than 1 GiB.
Oh...so would you suggest just switching to something else to make a GUI, get MinGW, or find an unofficial build? And thank you that really answered some questions. Or could I just use the Qt Creator they provided? (Although I can't really seem to get that working)
Although I kind of want to do it more of like coding it straight in c++, and correct me if I'm wrong it seems to me that Qt Designer is less based on C++ but like features provided by the program. I'm not really sure but correct me if I'm wrong.
Well, Qt adds a few minor things to the language related to its object system, which requires you to run an additional compiler (MOC) to generate C++ code for these constructs.
The thing is, you'll have to do that anyway if you're going to use Qt and the advantage is that Qt Creator does it automatically for you.
Oh, then I guess I'll stick with Qt Creator and thank you for the info. Also does anyone know a good tutorial on installing Qt because I'm not so sure I did everything correctly.
Of course, you can use Qt Designer even if you don't use Qt Creator, and VC++ can be made to automatically moc the sources with the add-in.
Personally, I prefer writing in VC++ for a variety of reasons. Perhaps your best course of action is to first try out the official builds for MinGW+Qt Creator. If you don't like it, try compiling for VC++.
Actually there is one thing I'm wondering... does the qt sdk do everything for you? Because while googling how to do this some of the websites talked about configuring and using qmake or something along those lines before actually using qt.
That's for building. In case you're not aware of it, to "configure" in this context means to generate files -- often Makefiles, sometimes project files -- for an architecture-OS-compiler combination so that an automated tool can build the application.
In this case, you first have to run a command that will build the tool that does the configuring, then run the tool to generate the project files, then build the project.
I've used Qt for 3 projects so far, and have not yet touched Designer yet. I'm afraid of losing total control otherwise...
And the boilerplate code REALLY isn't that bad, I kinda enjoy it actually!
I would start out with some widgets and dialogs and then move on to Main Windows etc.
You can PM me if you need any help ;)
Hi, thanks for all the help guys, but I have another question can someone help me with this tutorial that I found here: http://www.dazzle.plus.com/linux/QtCreator/part04.htm for some reason the code won't compile even though I ended up copying and pasting the code they provided. Errors keep coming up like "undefined reference to `vtable for MainWindow'" Sorry if this is a stupid question.
I suppose you didn't see this at the end of that page?
Compile and run
If we were to compile our updated code now, we would see compilation errors such as "undefined reference to `vtable for MainWindow'" because to use the Qt meta-object features such as signals and slots, QtCreator needs also to use the Qt meta-object compiler (moc). To tell QtCreator to check where the moc is needed we need to re-run qmake. The easiest way to do this is to select the "Run qmake" option in the QtCreator "Build" menu.
The new code will now successfully compile when we attempt to run the project. Run the application and click on the white central area to see the statusbar update.