Question

Do all Qt applications require KDE to be installed? Is it enough if the Qt runtime is installed along with GNOME? Can I make a Qt application look exactly like a GTK application under GNOME? Could anyone please point me to some article detailing the relationship between Qt, GTK, KDE, GNOME, X?

Was it helpful?

Solution

When running under X, Qt apps and the Window Manager are both X Clients. They both communicate with a XServer to draw, receive input, or manipulate windows. The XServer knows about the hardware and handles drawing to a specific monitor, receiving mouse input etc.

It is possible to run a Qt application without a desktop environment, and even without a window manager (although you won't be able to move/resize the program). Window managers etc are just normal X programs that are running that provide their own functionality but only indirectly interact with each other. They don't depend on another specific program running.

The state of windows (position, ordering, contents) are managed by the X Server, and can be queried and changed by a program such as the window manager.

The window manager handles the sizing, positioning and decoration of windows. It receives events when a window is created/changed so it can do so. It draws the frame around the outside of a window, and handles clicks on close, maximize, drags of the window etc.

The Qt application draws inside the main window and handles mouse clicks and keypresses inside the window.

Qt can communicate with the window manager by sending XEvents from the window (resize/move), or setting WM Hints (dialog, important, not resizable). These go through the XServer and won't have any effect if no program is listening for them.

OTHER TIPS

I run Qt applications regularly on my Mac, and occasionally on Windows, and I'm entirely certain that neither the Macs nor the Windows PCs have KDE installed (nor Gnome for that matter). So, to your first question, the answer is "definitely no":-).

Qt is just a UI Library, just so happens that KDE is written in/using Qt.

You can write an app using Qt and run it with gnome being installed as long as you have the Qt library installed.

Yes you can make Qt applications look like gnome applications as long as it is using the theme the system is using. (not sure how just know it in general) I use several Qt UI based apps written in python under ubuntu with gnome and they use the theme just fine.

Well, vice versa. Historically KDE (and now) was built on Trolltech Qt C++ framework. Qt C++ is now cross-platform and that makes KDE adventures to many platforms more smoothly. So shortly: KDE depends on Qt :)

When you develop a Qt application one of the choices you have is to include KDE widgets or libraries in the application. If you do this then you would require some KDE packages (on Linux) or libraries to be installed on your target machine as well as the Qt ones. I'm not sure what the availability of these is on Windows or Mac, although there is some sort of attempt to port KDE to Windows, ongoing.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top