Qt 应用程序需要 KDE 吗?

发布于 2024-08-25 01:28:32 字数 137 浏览 12 评论 0原文

所有 Qt 应用程序都需要安装 KDE 吗?如果 Qt 运行时与 GNOME 一起安装就足够了吗?我可以使 Qt 应用程序看起来与 GNOME 下的 GTK 应用程序一模一样吗?谁能给我指点一些详细介绍 Qt、GTK、KDE、GNOME、X 之间关系的文章吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

只有一腔孤勇 2024-09-01 01:28:32

当在 X 下运行时,Qt 应用程序和窗口管理器都是 X 客户端。它们都与 XServer 通信以绘制、接收输入或操作窗口。 XServer 了解硬件并处理绘制到特定监视器、接收鼠标输入等。

无需桌面环境,甚至无需窗口管理器也可以运行 Qt 应用程序(尽管您无法移动/调整大小)程序)。窗口管理器等只是正在运行的普通 X 程序,它们提供自己的功能,但只是间接地相互交互。它们不依赖于另一个特定程序的运行。

窗口的状态(位置、顺序、内容)由 X Server 管理,并且可以通过窗口管理器等程序查询和更改。

窗口管理器处理窗口的大小、定位和装饰。当窗口被创建/更改时它会接收事件,因此它可以这样做。它在窗口外部绘制框架,并处理窗口的关闭、最大化、拖动等单击。Qt

应用程序在主窗口内部绘制,并在窗口内部处理鼠标单击和按键。

Qt 可以通过从窗口发送 XEvent(调整大小/移动)或设置 WM 提示(对话框,重要,不可调整大小)来与窗口管理器通信。它们通过 XServer,如果没有程序正在侦听它们,则不会产生任何影响。

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.

一念一轮回 2024-09-01 01:28:32

我经常在 Mac 上运行 Qt 应用程序,偶尔在 Windows 上运行,并且我完全确定 Mac 和 Windows PC 都没有安装 KDE(也没有安装 Gnome)。所以,对于你的第一个问题,答案是“绝对不是”:-)。

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

沩ん囻菔务 2024-09-01 01:28:32

Qt 只是一个 UI 库,恰好 KDE 是用 Qt 编写的。

只要安装了 Qt 库,您就可以使用 Qt 编写应用程序并在安装了 gnome 的情况下运行它。

是的,您可以使 Qt 应用程序看起来像 gnome 应用程序,只要它使用系统正在使用的主题即可。 (不知道一般如何知道它)我使用几个基于 Qt UI 的应用程序,在 ubuntu 和 gnome 下用 python 编写,它们使用主题很好。

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.

明媚殇 2024-09-01 01:28:32

嗯,反之亦然。历史上 KDE(以及现在)是基于 Trolltech Qt C++ 框架构建的。 Qt C++ 现在是跨平台的,这使得 KDE 在许多平台上的冒险更加顺利。这么说吧:KDE 依赖于 Qt :)

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

顾忌 2024-09-01 01:28:32

当您开发 Qt 应用程序时,您的选择之一是在应用程序中包含 KDE 小部件或库。如果您这样做,那么您将需要在目标计算机以及 Qt 计算机上安装一些 KDE 软件包(在 Linux 上)或库。我不确定这些在 Windows 或 Mac 上的可用性如何,尽管正在进行某种将 KDE 移植到 Windows 的尝试。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文