Which parts of Windows does Qt rely on? - qt

I believe Qt uses GDI(+) and you start with a QObject. Does it call ActiveX components, COM etc?
For example, putting WebKit in a form is there anything happening there that uses the Windows bits and pieces for painting?
I'm just a beginner trying to work out how much of WINAPI, COM, and ActiveX is used/wrapped by Qt.

In general Qt only implements a feature if there is a sensible(/compatible) metaphor for that feature on all* supported platforms. It makes use of a lot of different Microsoft and non-Microsoft components on Windows, not just the one's you have mentioned.
I've not found a document which summarises what you're asking before because it's not something I've ever needed or found useful as the document would be immense. The way I tend to work with Qt is read the excellent documentation and believe it until I find something which does what I didn't expect it to. Then delve into what it does under the bonnet(/hood) for that specific platform. Remember, the source code is freely available.
* Note: there are some features which are platform specific in the framework but these are usually clearly identified as such.

Related

What is the difference between a cross-platform and platform-independant framework? Particular case of the Qt application framework

I am a novice runner in Qt. Reading what Qt it is, I get confused in the meaning of some terms in web sites. Indeed I meet the term cross-platform framework, often platform-independant framework. I'd really like to understand the difference between these two group of words.
In the specific case of Qt, it is said that it is a cross-platform application framework
Please, Let me give you my thinking. I'd like to confirm that by someone else.
By Qt is a cross-platform framework, I myself understand the Qt source code is the same for each OS (Windows, Linux, Mac OS ...), but compilers used to build the source code which are different depending on OS. Is that true?
Contrary to a framework like java, that is an independant-platform since compiler is the same on any platform or OS.
Please tell me if my understanding is right/wrong about Qt and the meaning both a cross-platform and an independant-platform framework.
Whether I'm correct or not, I tend to think of it like this:
multi-platform: Different versions (possibly with different codebases) exist for more than one platform.
platform-independent: One codebase exists that tends not to rely on any platform-specific features or libraries, so should work on many different platforms without (source code) changes. The code might rely only on the language features and standard library, for example, so is very generic.
cross-platform: One codebase exists for more than one platform, but it may sometimes use different sections of platform-specific code for different platforms where needed.
I don't think people rigidly follow any specific definitions for these terms, though, and often see them used interchangeably.

Does Qt have general-purpose classes besides GUI-related classes?

I have recently regained some interest in learning Qt, but have the following doubt:
Does Qt have enough classes that are not GUI-related?
For example, Python is "batteries-included", .NET is definitely "batteries-included", and as far as I have seen, Android API also has a lot of classes to design and implement application/domain logic, not directly related to visual presentation.
The main reason I am asking is because I don't know C++ and don't plan to learn it deeply (too much time needed), so if I had to take third party C++ libraries all the time and struggle to use them inside Qt projects that would be a strong point against going ahead.
The intended use is mostly to create small desktop apps for personal use while gaining insight on software design good practices - a profession I am slowly migrating to.
I have already used some Python/Pygtk (without IDE) and WPF (in VStudio/ExpressionBlend). In both platforms, most of my work is related to scientific computations, image processing and interactive scientific visualization, and there are good libraries for that either in Python (Numpy, Scipy, Matplotlib, Pandas, PIL, cairo) and .NET(AForge, alglib, System.Media.Media3D). I wonder if the Qt ecosystem is so complete in that regard.
Qt isn't a language in itself, so you can't compare it to Python or .NET. With that being said, Qt does provide general-purpose classes like containers, a Unicode string class, character set encoders/decoders, multimedia, device and file I/O, etc. All these modules are fully documented.
There are also some external modules available for Qt, like Qwt which provides widgets for technical applications.
For other functionality where something Qt-specific isn't available, you can obviously use another appropriate library. Like OpenCV.
Oh, and you can use Qt in Python too, through PyQt.
As far as I know, Qt doesn't have image processing libraries. For that, you'll need to use something like OpenCV. Qt does have libraries for loading most common image types.
However, Qt does extend beyond just GUI classes.
There is a database module that's quite convenient. The concurrency/threading classes are nice. I've enjoyed making use of the Qt Networking classes. The FileIO classes are alright.
These classes/modules are all useful for making platform-independent code. Things like image processing are mostly algorithmic and tend to be platform-independent by nature. So I think they fall out of the scope of the Qt framework. It shouldn't be too difficult, however, to simply find a library that does what you need and link that in to your project.
A lot of the Qt Core services that heltonbiker and Nikos C. mentioned, can be thought of as extensions to C++, a little like std. Although I often prefer the Qt implementations myself. But Qt has gone much further with their libraries, with the I/O, and web services etc...
The QtXML library provides reading and writing of XML files. Traditionally we had always used xerces, but the Qt XML library is almost as simple as .NETs.
The QtNetwork library offers TCP/IP and other networks services
The QtMultimedia library performs playback and recording of audio
and video content to the use of available devices like cameras and
radios.
The QtSQL library interfaces with SQL databases.
And there is much more than that. Although these are probably services that are used to most. The other benefit is that for the most part the implementations are cross platform. So for example using the I/O services does not require you to write separate code for Linux and Windows. That is a general rule, and there are exceptions. But I am sure most people would agree that any of the services they offer are easy to use, and well documented.
Happy coding.
Qt provides ample abstraction besides UI - it comes with a set of functionality enhancing features that come with certain usage paradigms.
Container classes - shallow copy by value, copy on write
Implicit sharing for containers and certain data types
Event driven, signals and slots
A powerful and usable metasystem
Properties
Platform abstraction for a lot of functionality, from file access to network and multithreading
Cross platform atomics (not that important since C++11 atomics)
Settings API
Undo API
OpenGL abstraction (not necessarily UI, custom graphics)
Basic image formats and basic image manipulations
Qt Declarative, a.k.a QtQuick and QML markup (usable for all kind of structure markup BTW)
Dynamic plugin API
Platform abstraction and portability - same code, multiple platforms
High and low level multimedia - audio, video
Sensors and serial port
Unit test
XML, JSON, SQL
An outdated and hopefully soon updated OpenCL abstraction
Last but not least, a lot of 3rd party modules built around Qt fitting a wide range of applications
Honestly, all its missing is support for some more popular formats for file, media encoding/decoding and containers, some parallel and vector abstraction, USB, WIFI/NFC (in the works in an addon module) and it will be 100% versatile.
Note that you can also use Python with Qt, although I have no experience with that, Qt is a very versatile tool that allows for quick and easy application development - and since 5.1 supports pretty much the entire market, with the addition of Android and iOS to the list of supported platforms. It is very useful for creating custom use applications for creative or research purposes.
Although not perfect for every task, Qt is easily the "best of the bunch" of tools you can use in this regard. Unbeatable in terms of portability and very thorough, if not a little bloated for the set of functionality it provides. And finally, it is free, you can even develop commercial applications under LGPL as long as you link dynamically. All in all, it is well worth the investment to learn, the only downside is it lacks uniformity between the old C++ native APIs and the QML runtime, which is actively worked on and is based on JS, so the APIs are a bit different and some glue APIs are required to fuse C++ with JS and QML.
(just for the record, from the official site):
The Foundation: Qt Core Module
The Qt Core module forms the foundation of all Qt-based applications
with core non-graphical classes used by other modules.
Key Functions
File IO, event and object handling
Multi-threading and concurrency
Plugins, setting management
Signals and Slots inter-object communications mechanism
Benefits
Reduce development time and cost by leveraging a complete set of application building blocks
Develop portable code from the ground up with cross-platform functionality

Is there for QT an equivalent to Microsoft Blend or Adobe tools?

After working extensively with Microsoft development tools, I migrated to ubuntu and QT for research purposes.
QT is a great framework, up to now there's nothing I needed and it's not there.
However the tools-ecosystem around QT is a bit behind microsoft's ecosystem (V.Studio, Expression Suite)
More specifically, QT Creator is quite nice, but the lack of a 'standard' tool like MS-Blend (which I think is a must, complementary to V.Studio) or the various Adobe tools is pretty apparent, in the case of developing fancy interfaces, animations etc. And Animations (e.g. menu's apperaing/disapperaing from the side) are a bit painful to hardcode without a 'graphical'-tool.
Do you have any tool to propose for this reason, that I'm not aware of?
PS - Just to avoid misunderstandings, I know about qml/Qt_Quick/qdesigner/qt_Animation - http://doc.qt.digia.com/qt/animation-overview.html. I'm referring to accombining software that make's life easier and reduces time needed for hardcoding stuff
Direct answer:
No there is no tool available in Qt arena that matches the capabilities of Microsoft Blend.
There is this question, which discusses a similar situation; a comparison between .NET and Qt in terms of UI designing.

What's easier and cleaner? GTK or QT? [duplicate]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Can someone suggest what's the best uses for those libraries today? Is it just GUI, or do they have database, XML, networking, threading, etc support too?
I was reading about them, and considered starting to learning/using one of them.
What is the most common one? What's the difference between them? Why would you choose one over the other?
As you seem to primarily target Linux, then the choice mostly depends on the programming language you want to use.
If you code in C, then obviously go for GTK+
If you code in C++, go for Qt, otherwise you will need Gtkmm (a C++ wrapper over GTK+)
If you code in Python, both GTK+ and Qt have bindings for the language: see PyGtk, PyQt and PySide (the one launched by Nokia themselves).
If you code in Java, Qt is no more a viable option imho as Nokia discontinued Qt Jambi (the Java bindings for Qt).
Also, Qt is more top-notch regarding its scenegraph QGraphicsScene API, its scripting engine built over Javascript Core (the engine powering WebKit), its state machine and animations framework, and the declarative UI.
GTK+ doesn't offer that much although you can use Clutter alongside with it.
If you're specifically looking into DB, XML (GTK+ has a parser for a subset of XML) and threading (GTK+ has GLib) features then Qt will offer all that in QtSql, QtXml and QtConcurrent.
All in all, I would say Qt is a sure choice. But GTK+ is very capable as well.
I'm not sure you will get a crystal clear answer for your question, which explains why some people keep preferring Gnome over KDE or vice-versa. Choose what works best for you.
PS: I you plan to also target Symbian, then go for Qt.
EDIT: Something that is also great with Qt is QtWebView: it brings Chromium into your Qt application to display web content. Others are embedding web content into their application using for instance Awesomium or Berkelium.
I've used GTK+, QT and wxWidgets before. Here's a brief summary:
For my first cross platform UI project I decided to go for wxWidgets mainly because at the time the license wasn't as restrictive as QT's (QT was GPL and only for Linux) and it had platform specific UI (unlike GTK). The project worked out well but there were quite a few glitches getting it to compile and run properly in other platforms - sometimes some events were fired up differently and such. Also GDI in wxWidgets was pretty slow.
Next I used GTK for a different project in python. For this I used the python bindings and everything worked out more or less smoothly. I didn't quite like the fact that the UI didn't look native on Windows and Mac and also when you launch a GTK+ app it always debug outputs loads of CRITICAL warnings which seem fine to ignore. :S
Finally, I did a very simple QT project now that Nokia has acquired it and was brilliant. The best of the three. First off, if you're not an old schooler who prefers VI or Emacs, QtCreator is brilliant. I really love VI and used it for years but I much prefer QtCreator for C++ QT projects. Regarding the library I also liked a lot the documentation and the APIs provided. QT has a concept of slots and signals which introduce new C++ keywords and a preprocessor. Basically, after reading a tutorial you'll get it easily and will start to love it. I'm now doing iPhone dev and it does feel a bit like Cocoa's/Interface Builder's UI paradigm.
Summary: I'd go for QT hands down. The license is pretty good and the SDK and documentation really nice.
I have never used GTK, but from my personal experience using Qt:
It is much more than a simple GUI. It's a whole application framework. I used to think of it as the Java libraries for C++. It provides all you mention -- database, XML, networking and threading, and more. It also provides things such as containers and iterators, and counterparts to a number of boost libraries.
The thing that impressed me most when starting to use Qt was the extremely extensive documentation. You get a program called Qt Assistant, which provides fully indexed and searchable API documentation on your desktop, as well as numerous code examples and tutorials. I found it made a big difference in searching the web each time for API info. Very quick access when you need to remember a method signature.
I am not sure which is most common; that's probably hard to measure accurately. They're certainly both popular. As Gnome is the default desktop of Ubuntu, and Gnome sits on top of GTK, it obviously has widespread usage. Of course, KDE is very popular as well. Nokia is heavily pushing Qt in the mobile space -- their Maemo OS, used on the new N900 for example, is soon to switch to Qt as the default toolkit (currently it is GTK.) I believe Qt will also soon become the default toolkit for Symbian OS.
I have not used Qt Creator, but I have heard many good things about it. It is a C++ IDE with obvious heavy integration with Qt. It also has fake vim emulation which is always nice if you like that kind of thing!
Qt uses qmake for build configuration. I found this much nicer than having to write your own makefiles. I do not know what GTK uses for building.
A couple of things I found a bit offputting with Qt at first was its big uses of preprocessor macros. The signal/slots system provides a nice mechanism for event/message passing in your application, but it does feel a bit like magic that may not be easily portable to another toolkit if you ever want to. Also, the moc (meta-object compiler), while I'm not entirely sure what it does, also feels a bit too much like magic going on behind the scenes.
All in all, though, I would recommend Qt, particularly if you are learning. It has really amazing documentation and a nice IDE, and busy forums. You'll be able to build C++ apps very rapidly with it, particularly with the QML coming in 4.7.
It probably depends on what you want to do. I would recommend Qt, because it's more than GUI, it has nice Python bindings (so does Gtk), and GUI libraries themselves are (subjectively speaking) more pleasant then Gtk.
Gtk is on the other hand more common in linux world, so you can probably get more help on the web. Reason for widespread of Gtk probably has more to do with Gnome and Ubuntu, rather then technical merits, but if you want you software to blend nicely with those two, you'll achieve that more easily with Gtk.
Qt for one sure has solid DB, network, threading support etc... It does a lot more then just cross-platform GUI (and it does most of it quite well).
I'd recommend it over GTK+.
Qt. It's not only object oriented, is "good" object oriented.
It's based on a "subset" of C++ that doesn't rely on the obscurity of C++ (but you are allowed to stick with them, if you fancy masochism ;) ).
It has a strong momentum now that Nokia bought it (actually Nokia did ~2/3 years ago). It's going to be in all Nokia AND Intel mobile devices (smartphones, netbooks, tablets).
It's the backbone of KDE, so it's very mature, but it's designed in a very flexible way, that makes it possible to support TODAY all the latest "cool stuff" that a more-then-just-GUI framework should have.
Go for it.
Just adding QT advantages to other answers.. QT has great documentation, its own IDE & GUI creator and enhances C++ with some new concepts like slots/signals (basically events).
I am not a GTK developer, so I can't compare those to the GTK world :(
It also looks like Nokia is about to use Qt everywhere, like on Maemo
If you want your app to run on iOS, Android, Blackberry, other mobile platforms, Windows, Mac OSX, and Linux, use Qt.
qt-project.org

Gtk+ vs Qt language bindings

Put shortly: For those familiar with language bindings in Qt and Gtk+. E.g. python and ruby. Are there any quality or capability difference?
More background: I know C++ and Qt very well. Minimal experience with Gtk+. I know C++ is not ideal for language bindings due to the lack of a well defined ABI (application binary interface). I also read that Gtk+ was designed to be bound to other languages. So I wonder how this manifets itself in practice. Are the Gtk+ bindings better maintained or work better in some way than their Qt counterparts?
I am presently quite interested in the Go language, and they have started developing Gtk+ bindings. However C++ bindings is far away. It makes me wonder whether learning Gtk+ is worth it.
I've used GTK and Qt in C++ and also PyGTK and PyQt in Python quite extensively.
Qt beats GTK hands down - its a much more flexible, modern and clean API. GTK is also lacking some features that are important to me. From a framework point of view, I'd recommend Qt.
As for langauge bindings (I can only speak about Python, since I've never used the Ruby equivalents), I think PyGTK (using Glade and a wrapper like Padraig Bradys libglade) make GUI programming insanely easy and fun. However, if you can GPL your software (or pay the license fee), then PyQt is also a good option, and while not quite as friendly as PyGTK + Glade (in that with GTK you can define your UI in Glade as a separate XML file, so you can tweak the UI without touching code; in Qt if you want to use QtDesigner, you have to generate code using uic, if I remember correctly) the API itself is really really nice to use and mirrors the Qt frameworks clean design very closely.
Over all, I'd probably recommend using PyQt over PyGTK, but I may be biased since I much prefer Qt over GTK nowadays, though you could try both out and see which you prefer - they are both almost trivial to get working.
If you are looking for a great book on PyQt, I'd recomment Rapid GUI Programming qith Python and Qt.
To summarize: IMHO Qt beats GTK in both quality and capability. Both PyGTK and PyQt are of excellent quality and capability mirrors the underlying framework, though PyGTK can load Glade xml files.
I think that GTK bindings are older than Qt ones (and so a bit more mature) but they are both usable and your previous knowledge of Qt should be the main factor in your choice.
I developed small GUIs using both Qt and GTK with their python bindings and found the two equivalent. Some regrets though on the PyQt bindings with Qt container (QVector, ...) that are not translated into regular python data structure and thus add a bit of complexity to the code. I didn't recall the same issues using PyGTK.
I have worked with both PyQt and PyGTK and I would say they're both regularly mantained and synched with their parent frameworks. However, and this is completely subjective, I found more rewarding working with PyGTK than with PyQt, even if I hadn't previously written any code using GTK. If you know well Qt, go with Qt though.
I have been trying a few combinations around Qt : RubyQt, JRuby + Jambi, PyQt. The first one quickly ends up in various segmentation-faults. My Qt skills may be the problem but all in all the seg faults are not quite readable. The forum for RubyQt is nearly dead so don't expect to find much information there.
So I moved to JRuby + Jambi. This worked until well, I reached some missing functions here and there. Plus I had to implement a proper signal/connect for JRuby. So, more or less a hack. Not convincing.
Finally I moved to Python (wich I don't like very much). But woooh, what a difference. Bindings are up to date, I have still to ecnounter a segmetatio fault, error messages are most of the time very explanatory. So as far as I'm concerned Python+Qt is a clear winner.
Please note that I was trying these combinations in order to find a proper language/qt binding so that I can create a production ready with my commutation hours (roughly 2 hours a day). So my tolerance to small-but-annoying problems such as segmentation faults is 0. I also have to develop on Windows and Linux. So Windows installation is necessary (and once again, Python is a clear winner here).
there are C++ gtk+ bindings. Google for gtkmm.

Resources