Question:
how much C++ should I know to effectively learn GUI environments like Qt, GTK+, Visual Studio, ect.?
charchar88
2009-03-12 08:52:24 UTC
I know the basics of C++ classes and stuff but how much further do I need to know? I know nothing about network programming functions or OS specific functions, just basics that would come in an introduction book on C++. What else should I learn to effectively create GUI programs? Also any recommendations as to what I should learn? I was thinking Qt and Visual Studio.
Three answers:
myak
2009-03-12 12:04:21 UTC
Qt is quite complex in its design and uses a lot of very complex C++ macros to make code work. It also makes use of an external use to create moc files which is also very complex.



But! To use all of those features you don't need to know how are they programmed inside the Qt framework. As to the C++ knowledge that is absolutely required to make use of Qt:



1. Polymorphism - Qt uses inheritance very extensively and you need to know what it is and how to use it. You will be subclassing a lot of Qt basic classes to make your own widgets or even the application skeleton.



2. Abstract classes - classes with abstract methods (virtual declared as empty, for example virtual void doSomething(void) = 0;) You need to know how overriding those in a subclass works and how to declare and implement one.



3. Templates - all the lists in Qt make use of templates (QList, QQueue, etc.). You don't need to know how to implement a template class but you need to know how to use one. (Using is far easier than implementing, it's not that bad).



4. Method overloading - a lot of methods are overloaded either in a base class or in a subclass. You need to know what overloading is and how it works (which method gets called when; it's easy - depending on the type and/or number of parameters used in most cases).



5. Operator overloading - a lot of classes in Qt overload some operators. You don't need to know how to overload an operator but you need to know what that even is so you don't get confused by some weird syntax.



Some programming patterns like signletons, iterators, etc. knowledge is also a very nice thing to have. You should know the basics if you've used some of the std classes like std::vector.



Aside from C++ knowledge, you need to get familiar with some design principals like UI design (widgets, containers, layouts). Qt uses a slot-signal scheme for event handling - it is very convenient to use but hard to understand at the beginning, especially when implementing your own signals and slots which you will have to do. These are very well documented in the Qt manual, you should be fine if you read it carefully.



What you don't need to know is OS specific functions. Qt is a cross-platform framework and therefore handles all the OS stuff for you. Also, unless you plan to program a network application, you don't need to know anything about networking, sockets and protocols. If you intend to do some basic networking stuff (downloading a file via HTTP or FTP), Qt provides you with an excellent networking API. If you want to implement a low-level network communication, you obviously need to know about sockets and protocols, the difference between TCP and UDP and so on. Still, Qt's networking API makes life a lot easier by handling OS specific stuff.



Visual Studio (2005 or higher) is a very good choice when deciding on IDE to use. Qt has a plugin that integrates very well into Visual Studio (not the Express edition though). But the IntelliSense (code completion) will work very good with most of the Qt features. You may also check out IDE developed by Trolltech that is dedicated to Qt development - Qt Creator, it was released with Qt 4.5 on March 3rd 2009. Haven't tried it out myself yet but it seems a very good tool.



Also, one advice - when writing your first application, start small and don't use Qt Designer - code everything within your C++ files. It will let you understand Qt's architecture a lot better than using the Designer.
abhsag24
2009-03-12 08:57:39 UTC
Visual studi is quite different from C++ or network proramming like Java it is quite but not all different but still i'd say that just the basic knowledge of these programming languages are enough

infact you can even do without them
2016-04-04 04:23:55 UTC
You would be better off to learn C++ or something like Perl. Visual Basic is great for Windows, but only for Windows. But something like C++ is going to be more cross-platform.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...