我应该选择什么:GTK +或Qt? [英] What should I choose: GTK+ or Qt?

查看:718
本文介绍了我应该选择什么:GTK +或Qt?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以建议今天这些图书馆的最佳用途是什么?它只是图形用户界面,还是他们有数据库,XML,网络,线程等支持呢?



我正在阅读关于它们,并认为开始学习/使用一个他们。



最常见的是什么?他们之间有什么区别?为什么你会选择其中之一?

解决方案

语言你想使用。

如果你在C代码,那么显然去GTK +



如果你的代码在C ++中,去Qt,否则你需要 Gtkmm (一个C ++包装器,通过GTK +)



如果使用Python进行编码,则GTK +和Qt都具有该语言的绑定:请参阅 PyGtk PyQt (由诺基亚自己发布的)。



如果你使用Java编码,Qt不是更多可行的选项,如诺基亚已经停止了Qt Jambi (对于Qt的Java绑定)。

另外,Qt对于它的场景图更为出类拔萃。 QGraphicsScene API,其基于Javascript核心(引擎为WebKit供电)的脚本引擎,其状态机和动画框架和声明式用户界面



虽然您可以使用 Clutter ,但GTK +如果你专门研究DB,XML(GTK +有一个解析器用于XML的子集)和线程化(GTK +具有 GLib )功能,那么Qt将提供 QtSql QtXml QtConcurrent



总而言之,我会说Qt是一个肯定的选择。但是GTK +的功能也非常强大。

我不确定你会为你的问题得到一个明确的答案,这就解释了为什么有些人更喜欢Gnome而不是KDE或者反之亦然。 选择最适合你的方式。



PS:我打算也瞄准Symbian,然后去Qt。
$ b

编辑:与Qt同样伟大的东西是QtWebKit:它将WebKit带入您的Qt应用程序中。其他人则使用Awesomium或Berkelium将WebKit嵌入到他们的应用程序中。


Can someone suggest what's the best uses for those libraries today? Is it just GUI, or do they have database, XML, networking, threading, etc support too?

I was reading about them, and considered starting to learning/using one of them.

What is the most common one? What's the difference between them? Why would you choose one over the other?

解决方案

As you seem to primarily target Linux, then the choice mostly depends on the programming language you want to use.

If you code in C, then obviously go for GTK+

If you code in C++, go for Qt, otherwise you will need Gtkmm (a C++ wrapper over GTK+)

If you code in Python, both GTK+ and Qt have bindings for the language: see PyGtk, PyQt and PySide (the one launched by Nokia themselves).

If you code in Java, Qt is no more a viable option imho as Nokia discontinued Qt Jambi (the Java bindings for Qt).

Also, Qt is more top-notch regarding its scenegraph QGraphicsScene API, its scripting engine built over Javascript Core (the engine powering WebKit), its state machine and animations framework, and the declarative UI.

GTK+ doesn't offer that much although you can use Clutter alongside with it.

If you're specifically looking into DB, XML (GTK+ has a parser for a subset of XML) and threading (GTK+ has GLib) features then Qt will offer all that in QtSql, QtXml and QtConcurrent.

All in all, I would say Qt is a sure choice. But GTK+ is very capable as well.

I'm not sure you will get a crystal clear answer for your question, which explains why some people keep preferring Gnome over KDE or vice-versa. Choose what works best for you.

PS: I you plan to also target Symbian, then go for Qt.

EDIT: Something that is also great with Qt is QtWebKit: it brings WebKit into your Qt application. Others are embedding WebKit into their application using for instance Awesomium or Berkelium.

这篇关于我应该选择什么:GTK +或Qt?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆