Qt Jambi vs SWT用于跨平台GUI开发

时间:2022-10-31 12:28:07

I'm currently involved in a project developing applications primarily for Linux (Fedora 10). However, it might be the case later on that we will have to port these applications to Mac OS X and Windows and we don't want to be caught out by choosing the wrong GUI toolkit.*

我目前正在参与一个主要为Linux开发应用程序的项目(Fedora 10)。然而,稍后我们将不得不将这些应用程序移植到Mac OS X和Windows上,我们不想被错误的GUI工具包所捕获。

For a variety of legacy reasons we are locked into using Java. We are in the process of deciding between using Qt Jambi and SWT for the GUI. I haven't much experience in using either of them so I'm doing some small prototypes to try and get a feel for them. So far (just developing on Linux) there isn't much difference between them. However, there's a limit to the depth I can go in a short time. This is why I'm asking for help.

由于各种遗留原因,我们被限制在使用Java。我们正在决定在GUI中使用Qt Jambi和SWT。我没有使用它们中的任何一个的经验,所以我正在做一些小的原型来尝试和感受它们。到目前为止(仅仅是在Linux上开发)它们之间并没有太大的差别。然而,我能在短时间内到达的深度是有限的。这就是我寻求帮助的原因。

The particular features of interest to us are:

我们感兴趣的特点是:

  • Frameless windows

    无框架窗口

  • custom shaped windows (i.e. not rectangular)

    自定义形状的窗户(即不是矩形的)

  • aesthetically pleasing

    美观

Does anyone have any experiences and/or insights into these two libraries that might trip us up later?

有人对这两个库有什么经验和/或见解吗?

  • Agile programming people will no doubt jump on the phrase "might be ... later on" and say we shouldn't worry about it. However, in the absence of other deciding factors between the toolkits, future extensibility options will do. I promise not to write any cross-platform specific code until I have to :)
  • 敏捷编程人员无疑会说“也许……”然后说我们不应该担心这个。但是,在工具包之间没有其他决定因素的情况下,未来的可扩展性选项就可以了。我保证在必须写之前不会写任何跨平台的特定代码:)

Update 11 Feb: Thanks for the great answers. For those that are curious, we will probably go with Jambi. It was mostly the style sheet functionality that won me over as they make easy a lot of the custom widget shape stuff we need to do. The Qt suite of examples showed that frameless, custom-shaped windows do indeed work on different platforms, so we shouldn't be caught short down the track. The LGPL release was why we were considering Jambi at all :)

2月11日更新:谢谢你的回答。对于那些好奇的人,我们可能会选择Jambi。主要是样式表的功能让我信服,因为它们简化了我们需要做的许多定制小部件形状的工作。Qt系列的示例表明,无框架的、定制的窗口确实可以在不同的平台上工作,所以我们不应该在这个过程中受到影响。LGPL版本是我们考虑Jambi的原因:)

6 个解决方案

#1


8  

I agree with Vinegar: Don't rule out Swing. I've developed both with Swing and with SWT, but not with Qt. With Swing, your code will be automatically cross-platform. With SWT, your code is cross-platform with a little effort, although not that much effort. Are you going to implement a local application, an Applet, or a Web Start application?

我同意醋的说法:不要排除摇摆。我用Swing和SWT都开发过,但没有用Qt。使用Swing,您的代码将自动跨平台。使用SWT,您的代码是跨平台的,虽然没有那么多的努力,但需要付出一点努力。您打算实现本地应用程序、Applet或Web Start应用程序吗?

The advantage of SWT is that it uses all native widgets. (familiar Look-and-feel.) The disadvantage of SWT is that it uses all native widgets. (not as many widgets as Swing has) Whether this is more an advantage or a disadvantage depends on what you are doing and what your goals are. This means that Swing has a greater breadth of widgets. However, there are a few things that SWT does that Swing doesn't do as well (or at all) -- such as launch the system's native browser and execute JavaScript scripts in this browser.

SWT的优点是它使用了所有本机小部件。(熟悉的外观)。SWT的缺点是它使用所有的本地小部件。(不像Swing有那么多小部件)这是优势还是劣势,取决于您正在做什么和您的目标是什么。这意味着Swing有更广泛的小部件。但是,SWT做的一些事情(或者根本没有)不如Swing做的好——比如启动系统的本机浏览器并在此浏览器中执行JavaScript脚本。

If you consider SWT, consider it carefully. If you have certain needs (such as executing JavaScript in a browser window that was launched by your application), then it may be your best choice. However, if Swing can entirely meet your needs, it may be a better choice.

如果考虑SWT,请仔细考虑。如果您有某些需求(例如在应用程序启动的浏览器窗口中执行JavaScript),那么它可能是您的最佳选择。但是,如果Swing可以完全满足您的需求,那么它可能是更好的选择。

Hopefully someone else can provide information about Qt Jambi.

希望其他人能提供Qt Jambi的信息。

Note that support should be a consideration in your decision. With SWT, there is a smaller community supporting it. With Swing, a larger community, but this does not mean that fixes will get more quickly into a development release. With Qt Jambi and with SWT, if a bug is fixed, you just distribute updated libraries with your application. With Swing, you have to wait for an updated JRE. Neither is necessarily a dealbreaker, but it has to be considered.

注意,在你的决定中应该考虑支持。有了SWT,有一个较小的社区支持它。使用Swing,一个更大的社区,但这并不意味着修复工作将更快地进入到开发版本中。使用Qt Jambi和SWT,如果一个bug得到修复,您只需使用应用程序分发更新的库。使用Swing,您必须等待更新的JRE。这两件事都不一定会破坏交易,但必须加以考虑。

Licensing fees may or may not be a consideration. SWT and Swing, of course, do not have licensing fees Jambi I don't know about either way, but it may depend on your intended use -- for example, are you distributing a GPL application, or a commercially licensed one.

许可费用可能是也可能不是考虑因素。SWT和Swing当然都没有授权费,我不知道这两种方式,但这可能取决于您的预期用途——例如,您是发布GPL应用程序,还是发布商业许可的应用程序。

Good luck.

祝你好运。

#2


4  

I have no experience with SWT, yet I was working with Jambi/Qt, Swing and GTK as well. The only problem with Qt/Jambi is licensing in my opinion (you must either publish your soft under GPL or buy commercial license). You can't start writing software for free and then "see what happens". You must be sure that your software will be success, because you have to buy licenses. This in many times is not a case.

我没有SWT的经验,但是我也在使用Jambi/Qt, Swing和GTK。Qt/Jambi的唯一问题是我的观点(你必须在GPL下发布你的软件或者购买商业许可证)。你不能开始免费编写软件,然后“看看会发生什么”。您必须确保您的软件将获得成功,因为您必须购买许可证。这在很多时候都不是事实。

Regards.

的问候。

Ooops, I overlook those comments, thanks for the reply. This is great news! Good move from Nokia.

哦,我忽略了那些评论,谢谢你的回复。这是好消息!从诺基亚好。

@cursa that wasn't said, so also note that Qt/Jambi is more than widget toolkit. You have classes for networking, strings manipulation (along with regexp engine), mutexes, 2d vector & raster graphics, openGL and many more. This gives real boost to application development.

@cursa,这还没说,所以请注意Qt/Jambi不仅仅是小部件工具包。您有用于网络、字符串操作(以及regexp引擎)、互斥体、二维向量和栅格图形、openGL等的类。这对应用程序开发有真正的推动作用。

I also recommend downloading Qt package to Jambi noobies, because of very nice help browser called Assistant which Jambi is lacking. All the API of Qt and Jambi is the same (except slots and signals), even documentation is unchanged so you can use it interchangeably.

我也推荐下载Qt包给Jambi noobies,因为Jambi缺少一个叫做Assistant的很好的帮助浏览器。Qt和Jambi的所有API都是相同的(除了插槽和信号),即使是文档也没有改变,所以您可以交换使用它。

#3


4  

You know Qt Jambi is discontinued following the 4.5 release this month? That doesn't make it a bad choice. Qt has other community-maintained language bindings that live outside Trolltech's control.

你知道Qt Jambi在这个月的4.5版之后就停止了吗?这并不是一个坏的选择。Qt还有其他社区维护的语言绑定,这些绑定不受Trolltech的控制。

http://www.qtsoftware.com/about/news/preview-of-final-qt-jambi-release-available

http://www.qtsoftware.com/about/news/preview-of-final-qt-jambi-release-available

#4


0  

I wouldn't rule out SWT as it is a great success in the eclipse world. I've been using it happily for about 6 years and never had to resort to swing.

我不排除SWT,因为它在eclipse世界中非常成功。我已经快乐地使用它6年了,从来没有使用过秋千。

#5


-1  

I would not recommend SWT. SWT is a bad designed library with a lot of hacks and bugs. You will be looking the whole time for workaround for the simple UI-tasks

我不推荐SWT。SWT是一个设计糟糕的库,有很多的技巧和错误。您将一直寻找解决简单ui任务的方法

#6


-1  

After Many years ,that is surprised me ,that java developers still searching gui programming tools,In my case swing is relay slow ,it is not good for big projects.As we can see many project such openoffice started from sun ,using c++ widgets to gui programming,I used to swing in some project but costumers asking me about performance change many times. Qt also not active programmers and support,I used to test javafx but still see performance issues ,you can download sample javafx from oracle site ,changing gui pages taking long time compared to native c++ gui's.

多年后,让我感到惊讶的是,java开发人员仍然在搜索gui编程工具,在我的例子中,swing的中继速度很慢,这对大型项目不利。我们可以看到许多这样的openoffice项目都是从sun开始的,使用c++小部件到gui编程,我曾经在一些项目中使用swing,但是客户多次问我关于性能更改的问题。Qt也不支持活动的程序员和支持,我曾经测试过javafx,但仍然看到性能问题,您可以从oracle站点下载示例javafx,与本地c++ gui相比,修改gui页面要花很长时间。

#1


8  

I agree with Vinegar: Don't rule out Swing. I've developed both with Swing and with SWT, but not with Qt. With Swing, your code will be automatically cross-platform. With SWT, your code is cross-platform with a little effort, although not that much effort. Are you going to implement a local application, an Applet, or a Web Start application?

我同意醋的说法:不要排除摇摆。我用Swing和SWT都开发过,但没有用Qt。使用Swing,您的代码将自动跨平台。使用SWT,您的代码是跨平台的,虽然没有那么多的努力,但需要付出一点努力。您打算实现本地应用程序、Applet或Web Start应用程序吗?

The advantage of SWT is that it uses all native widgets. (familiar Look-and-feel.) The disadvantage of SWT is that it uses all native widgets. (not as many widgets as Swing has) Whether this is more an advantage or a disadvantage depends on what you are doing and what your goals are. This means that Swing has a greater breadth of widgets. However, there are a few things that SWT does that Swing doesn't do as well (or at all) -- such as launch the system's native browser and execute JavaScript scripts in this browser.

SWT的优点是它使用了所有本机小部件。(熟悉的外观)。SWT的缺点是它使用所有的本地小部件。(不像Swing有那么多小部件)这是优势还是劣势,取决于您正在做什么和您的目标是什么。这意味着Swing有更广泛的小部件。但是,SWT做的一些事情(或者根本没有)不如Swing做的好——比如启动系统的本机浏览器并在此浏览器中执行JavaScript脚本。

If you consider SWT, consider it carefully. If you have certain needs (such as executing JavaScript in a browser window that was launched by your application), then it may be your best choice. However, if Swing can entirely meet your needs, it may be a better choice.

如果考虑SWT,请仔细考虑。如果您有某些需求(例如在应用程序启动的浏览器窗口中执行JavaScript),那么它可能是您的最佳选择。但是,如果Swing可以完全满足您的需求,那么它可能是更好的选择。

Hopefully someone else can provide information about Qt Jambi.

希望其他人能提供Qt Jambi的信息。

Note that support should be a consideration in your decision. With SWT, there is a smaller community supporting it. With Swing, a larger community, but this does not mean that fixes will get more quickly into a development release. With Qt Jambi and with SWT, if a bug is fixed, you just distribute updated libraries with your application. With Swing, you have to wait for an updated JRE. Neither is necessarily a dealbreaker, but it has to be considered.

注意,在你的决定中应该考虑支持。有了SWT,有一个较小的社区支持它。使用Swing,一个更大的社区,但这并不意味着修复工作将更快地进入到开发版本中。使用Qt Jambi和SWT,如果一个bug得到修复,您只需使用应用程序分发更新的库。使用Swing,您必须等待更新的JRE。这两件事都不一定会破坏交易,但必须加以考虑。

Licensing fees may or may not be a consideration. SWT and Swing, of course, do not have licensing fees Jambi I don't know about either way, but it may depend on your intended use -- for example, are you distributing a GPL application, or a commercially licensed one.

许可费用可能是也可能不是考虑因素。SWT和Swing当然都没有授权费,我不知道这两种方式,但这可能取决于您的预期用途——例如,您是发布GPL应用程序,还是发布商业许可的应用程序。

Good luck.

祝你好运。

#2


4  

I have no experience with SWT, yet I was working with Jambi/Qt, Swing and GTK as well. The only problem with Qt/Jambi is licensing in my opinion (you must either publish your soft under GPL or buy commercial license). You can't start writing software for free and then "see what happens". You must be sure that your software will be success, because you have to buy licenses. This in many times is not a case.

我没有SWT的经验,但是我也在使用Jambi/Qt, Swing和GTK。Qt/Jambi的唯一问题是我的观点(你必须在GPL下发布你的软件或者购买商业许可证)。你不能开始免费编写软件,然后“看看会发生什么”。您必须确保您的软件将获得成功,因为您必须购买许可证。这在很多时候都不是事实。

Regards.

的问候。

Ooops, I overlook those comments, thanks for the reply. This is great news! Good move from Nokia.

哦,我忽略了那些评论,谢谢你的回复。这是好消息!从诺基亚好。

@cursa that wasn't said, so also note that Qt/Jambi is more than widget toolkit. You have classes for networking, strings manipulation (along with regexp engine), mutexes, 2d vector & raster graphics, openGL and many more. This gives real boost to application development.

@cursa,这还没说,所以请注意Qt/Jambi不仅仅是小部件工具包。您有用于网络、字符串操作(以及regexp引擎)、互斥体、二维向量和栅格图形、openGL等的类。这对应用程序开发有真正的推动作用。

I also recommend downloading Qt package to Jambi noobies, because of very nice help browser called Assistant which Jambi is lacking. All the API of Qt and Jambi is the same (except slots and signals), even documentation is unchanged so you can use it interchangeably.

我也推荐下载Qt包给Jambi noobies,因为Jambi缺少一个叫做Assistant的很好的帮助浏览器。Qt和Jambi的所有API都是相同的(除了插槽和信号),即使是文档也没有改变,所以您可以交换使用它。

#3


4  

You know Qt Jambi is discontinued following the 4.5 release this month? That doesn't make it a bad choice. Qt has other community-maintained language bindings that live outside Trolltech's control.

你知道Qt Jambi在这个月的4.5版之后就停止了吗?这并不是一个坏的选择。Qt还有其他社区维护的语言绑定,这些绑定不受Trolltech的控制。

http://www.qtsoftware.com/about/news/preview-of-final-qt-jambi-release-available

http://www.qtsoftware.com/about/news/preview-of-final-qt-jambi-release-available

#4


0  

I wouldn't rule out SWT as it is a great success in the eclipse world. I've been using it happily for about 6 years and never had to resort to swing.

我不排除SWT,因为它在eclipse世界中非常成功。我已经快乐地使用它6年了,从来没有使用过秋千。

#5


-1  

I would not recommend SWT. SWT is a bad designed library with a lot of hacks and bugs. You will be looking the whole time for workaround for the simple UI-tasks

我不推荐SWT。SWT是一个设计糟糕的库,有很多的技巧和错误。您将一直寻找解决简单ui任务的方法

#6


-1  

After Many years ,that is surprised me ,that java developers still searching gui programming tools,In my case swing is relay slow ,it is not good for big projects.As we can see many project such openoffice started from sun ,using c++ widgets to gui programming,I used to swing in some project but costumers asking me about performance change many times. Qt also not active programmers and support,I used to test javafx but still see performance issues ,you can download sample javafx from oracle site ,changing gui pages taking long time compared to native c++ gui's.

多年后,让我感到惊讶的是,java开发人员仍然在搜索gui编程工具,在我的例子中,swing的中继速度很慢,这对大型项目不利。我们可以看到许多这样的openoffice项目都是从sun开始的,使用c++小部件到gui编程,我曾经在一些项目中使用swing,但是客户多次问我关于性能更改的问题。Qt也不支持活动的程序员和支持,我曾经测试过javafx,但仍然看到性能问题,您可以从oracle站点下载示例javafx,与本地c++ gui相比,修改gui页面要花很长时间。