Roman
Roman

Reputation: 10403

Is c++ in Qt different from the ANSI c++?

I'm learning c++ and at the moment though using Qt creator. I have heard here and there that the Qt framework is different or C++ Qt isn't the same as the standard ANSI C++. Can someone tell me a little about the difference? Am I missing out on some fundamental c++ learning curves that Qt Creator/Qt framework hides?

Upvotes: 3

Views: 1311

Answers (1)

Will Bickford
Will Bickford

Reputation: 5386

Qt Framework

Qt is a C++-based framework that extends the capabilities of C++ through custom compilation steps. Qt-based classes derive from QObject and can take advantage of additional functionality not present in the standard C++ language.

The key advantages of the framework are that it supports a more advanced type of callback function (signals and slots) and it has multi-platform support.

Signals and Slots

Source: http://doc.qt.nokia.com/4.7/signalsandslots.html:

Signals and slots are used for communication between objects. The signals and slots mechanism is a central feature of Qt and probably the part that differs most from the features provided by other frameworks.

Cross-Platform Compatibility Layer

The Qt toolchain allows you to utilize the same tools to build applications that run on multiple platforms - such as Windows, Linux, and OS X. Qt abstracts platform-dependent differences so that you can compile the same program for multiple platforms. You can think of it like inverse Java - instead of writing one application to run on a virtual machine that can run on any platform you write one application that is compiled to native code for the platform(s) you need to support.

The advantage to Qt's approach is primarily performance - it should require less memory at run-time because there's no virtual machine between your application and the OS like there would be with Java or an interpreted language.

The downside is that you have to maintain builds for each platform and there are always grey areas that aren't supported. So inevitably you'll wind up writing some amount of platform-specific code in any decently-complex application.

C++11 Standard

If you want to study standard C++, take a look at C++11:

Upvotes: 5

Related Questions