Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Been brushing up on my C++ lately, on Ubuntu QQ. I love the Qt framework for eve

ID: 654345 • Letter: B

Question

Been brushing up on my C++ lately, on Ubuntu QQ. I love the Qt framework for everything, especially building GUI's. I became quite familiar with it when using PyQt over the last few years.

When using PyQt, I had some issues that are now more pronounced when using C++ with Qt: Qt has many extensions to C++ that are Qt specific - QString being just one common example, not to mention automated garbage collection. It is possible to write Qt applications using C++ without knowing much at all about C++ and the STL.

I may have to hit the job market again soon and I'd like to be able to consider C++ positions - but I'm afraid binding myself too much to Qt will limit my abilities to work with generic C++, which were once quite formidable but are now long dormant and rusty.

Should I avoid Qt? Would I be better off using WxWidgets or GTK++ for building GUI's?

What's the best GUI framework to use that allows/requires the most use of generic C++ and the STL? How do I make myself most marketable as a C++ programmer when it comes to GUI frameworks, etc?

Explanation / Answer

I wouldn't refrain from using Qt just for those reasons. You are not required to use all of Qt's utility classes; for the ones that replace the STL, you'll at most be forced to use QString and, possibly, QStringList. Also, there's usually much more to a program than the GUI. You can always use exclusively generic C++ for the rest of your program, and use Qt just for the GUI.

In my opinion, working with STL is more about understanding what underlying data structures are used and their complexities, and consequently at which times you should use each container. And when it comes to C++ programming, it's especially about knowing how to use the very essential < algorithm > header, which should also work on Qt's containers, since they're STL-compatible.

I don't see much harm in using all those extensions Qt provides, as long as you know (or ate least have a general idea of) how they are internally implemented. Make sure you know that things like Q_OBJECT, SIGNAL(), SLOT(), foreach(), aren't magic, but macros that expand to valid C++ statements. For instance, it's not all that complicated to understand how the implicitly shared classes and parent-child relationships that make Qt feel more Java-like are implemented. You can always try to recreate some functionality in a separate project just to see if you could do it with generic C++, and then not feel bad for using them in Qt.

Also, take a look at the Boost libraries. They provide extra utilities that the standard C++ library doesn't, and are a really good way to get a little closer to generic C++, since they essentially follow the same conventions as generic C++. Some of the libraries have fairly complex templated classes, and simply trying to understand how they work is, in itself, a good study in C++. Boost has many utilities that cannot be found in Qt, and others that implement the same or similar concepts as some of Qt's classes and can be used in their stead.

If you do hit the job market working with C++, chances are you're going to be working with Qt or another framework that, similarly to it, will have it's own utility classes that try to make C++ simpler.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote