使用 Qt 创建 Linux 软件:发行版、桌面环境和其他决策
我想开始一个个人项目,并且希望使其跨平台。我所有的 Linux 工作都是为商业客户完成的,所以目标发行版是提前指定的,但这是不同的。
该项目将是开源的并使用 Qt。这就是我想知道的:
如果我在一个发行版上进行开发+测试就足够了,还是应该在多个发行版上进行测试?根据我的经验,如果没有经过测试,它就不起作用, 但另一方面,我负担不起建造和建造的费用。对每个发行版进行测试,特别是因为它将是一个业余爱好项目。
假设我选择使用 KDE 的发行版 X。您认为使用带有 Gnome 的发行版 Y 的人使用我的程序有多困难?
使用 Gnome 的人会使用我的 Qt 程序,还是会因为它是用 Qt 编写的而感到厌烦?让我们假设他们发现它有用。 Qt-Gnome 集成有多好?
我也必须发送二进制文件吗?现在的趋势是什么:源代码还是源代码+ bin?
我希望了解有关在 Linux 上使用 Qt 开源项目的个人例子。 谢谢。
I want to start working on a personal project and I want to make it cross-platform. All of my Linux work was done for business customers, so the target distro was specified in advance, but this is different.
The project will be open source and use Qt. Here's what I'm wondering:
Is it enough if I do my dev + testing on one distro or should I test on multiple ones? In my experience, if it's not tested it doesn't work,
but on the other hand I can't afford to build & test for every distro out there, especially since it will be a hobby project.Let's say that I pick distro X that uses KDE. How difficult would you say it is for someone that uses distro Y with Gnome to use my program?
Will people that use Gnome use my Qt program or be put off by the fact that it's written with Qt? Let's assume that they find it useful. How good is the Qt-Gnome integration?
Do I have to ship the binaries too? What is the current trend nowadays: source or source + bin?
I would appreciate personal examples about working with Qt open source projects on Linux.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会使用不同的包装系统(apt、rpm 等)在几个不同的发行版上进行测试。其他任何事情都应该根据具体情况进行。
Qt 应用程序的一个示例是 umbrello UML 建模工具。 ubuntu 用户所需要做的就是
sudo apt-get install umbrello
。即使您没有准备好软件包,也可以使用类似的命令来设置 Qt,以便执行您的二进制文件。我的印象是,人们倾向于坚持使用一个小部件工具包(GTK 用于 gnome,Qt 用于 KDE),但另一方面,我会惊讶地发现有人没有使用他/她需要的优秀应用程序只是因为工具包。
源代码和二进制文件的单独包。二进制文件与用户文档一起使用,源代码与开发文档一起使用。
I would test on a a few different distributions using different packaging systems (apt, rpm etc.) Anything else should be on a case-by-case basis.
An example of a Qt application is the umbrello UML modeling tool. All a ubuntu user has to do is
sudo apt-get install umbrello
. Even if you don't have a package ready, a similar command could set up Qt so that your binary can be executed.My impression is that people tend to stick to one widget toolkit (GTK for gnome and Qt for KDE), but on the other hand, I would be surprised to see that someone isn't using a good application he/she needs just because of the toolkit.
Separate packages for source and binaries. Binaries go with user docs, source with dev docs.
我认为你应该在不同的发行版上测试它。可能会坚持使用最流行的:Ubuntu、Fedora、OpenSuse、Slackware、CentOS/RHE。您可以使用 VirtualBox 或 VMWare 播放器以及免费可用的虚拟机来测试其他发行版(而不是使用 5 个以上的独立分区)。另一种选择是仅提供您正在开发的发行版的二进制文件以及其他发行版的源代码+说明(如何构建)。
如果您使用某些软件包管理器(RPM、APT-GET)来分发二进制文件,如果尚未安装,它将安装缺少的软件包(例如:默认情况下使用 Gnome 的发行版上的 Qt4)。看看 CheckInstall ,它可以轻松地为 Debian、RedHat 和 Slackware 生成软件包.
我不认为这是一个阻碍。如果您的应用程序功能强大、设计良好且有用,那么桌面外观集成应该不是问题...您还可以使用 QtGtKStyle 确保您的应用程序在 Gnome 上看起来正确。
大多数开源项目为最流行的发行版提供二进制文件,也为其他发行版提供源代码(以便他们可以手动构建应用程序)。
大多数开源项目
I think you should test it on different distro. May be stick with the most popular : Ubuntu, Fedora, OpenSuse, Slackware, CentOS/RHE. You can use VirtualBox or VMWare player and freely available virtual machines to test other distros (instead of having 5+ separate partitions). Another alternative, is to provide only the binaries for the distro you are developping on and source code + instructions (how-to build) for the other distros.
If you use some package manager (RPM, APT-GET) to distribute your binaries, it will install missing packages if they are not already installed (ex: Qt4 on a distro using Gnome by default). Have a look at CheckInstall which can be used to produce packages for Debian, RedHat and Slackware with little effort.
I don't think it is a show stopper. If your application is robust, well designed and useful, desktop look-and-feel integration should not be a problem... You could also use QtGtKStyle to make sure your application look right on Gnome.
Most Open Source project offer binaries for the most popular distros and also the source code for the other distros (so they can build the application by hand).