views:

383

answers:

6

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?

+3  A: 

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 :)

Viet
+8  A: 

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":-).

Alex Martelli
A: 

As per the wiki page, Qt comes in many varieties and flavour.

It is used in the KDE project but in no means depends on it. KDE rather, depends on the Qy libraries.

edited per greg's corrections - thanks greg :

Qt is a framework for development, and a set of libraries for both GUI and not. GTK is also a set of libraries. KDE and GNOME are desktop environments and X is a window server.Generally used for driving the GUI of an Operating System. This is not to say that they are not frameworks as well, but rather to say that the comparison doesn't make a whole lot of sense.

Mimisbrunnr
GTK is a set of libraries, GNOME and KDE are desktop enviroments, X is graphical server. Neither are 'window managers'. KDE uses kwin as default WM, and gnome uses metacity. These terms can be confusing sometimes.
greg
+6  A: 

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.

percent20
Nitpicking... It is Qt ("cute"), not QT (QuickTime™). "written in Qt" doesn't sound right since Qt is not a programming language. Things are written in C, C++, English, French... KDE *uses* or *links to* Qt.
Juliano
Okay made a couple of changes. Namely QT -> Qt
percent20
+4  A: 

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.

fgb
thanks for the info. I'd like to know this stuff in greater detail. Could you provide me with links to any resources on the net?
Evans
You can try:http://www.sbin.org/doc/Xlib/http://www.freedesktop.org/wiki/
fgb
+1  A: 

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.

Amos