GTK+ or Qt under Windows [closed]

2019-02-01 21:01发布

I was wondering which one should I consider if I need the software to be used on both platforms, WIN and Linux and why?

标签: qt gtk
10条回答
放荡不羁爱自由
2楼-- · 2019-02-01 21:38

You might also consider wxWidgets. I have never used any of them but when I was looking over the cross-platform toolkits it was the one I had decided to try.

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-02-01 21:40

Three additional points in favor of Qt:

  1. Your project does not have to be GPL; there are many other open-source licenses available in the Qt GPL Exception, including BSD and LGPL.
  2. Qt's default theme on Windows does a much better job of blending in than GTK's Wimp theme.
  3. If you want to support Macs later, you'll have a much easier time with Qt.
查看更多
趁早两清
4楼-- · 2019-02-01 21:41

my $0.02:

I've used Qt off and on for the last 4 years, and it's hands-down my favorite toolkit of anything I've tried (Win32, MFC, Borland, Java, GTK). I used GTK for a few weeks to try it out, and didn't like it. Mostly that was because I think it's awkward to use C instead of C++ for GUI apps on a PC... I do embedded work too, and I'd never use C++ on an 8051, but for a big GUI app I much prefer it. If you're going to try GTK, I'd suggest looking in to GTKmm, although I've never used it myself.

查看更多
成全新的幸福
5楼-- · 2019-02-01 21:42

Both are good toolkits that have their advantages and disadvantages.

One difference is the implementation language. Qt is in C++, and GTK+ is in C. However GTK+ has bindings for many, many other languages (perl, python, C++, .NET, etc) so it's not a huge issue.

An Advantage of Qt is that it offers a bit broader range of functionality built in (xml, database access, network programming, openGL, etc). GTK+ has basically all of these things within its orbit (e.g. libxml2, librsvg, libsoup, libgda, etc), but they're not as much of a single coherent package as Qt is.

My personal recommendation is to use gtkmm, the C++ bindings for GTK+. It offers a more comfortable object-oriented language to program in, and it provides nearly the same native performance as using GTK+ from C. (Disclaimer: I contribute to gtkmm).

查看更多
祖国的老花朵
6楼-- · 2019-02-01 21:43

I would prefer Qt. As today, Qt is Open-source and free under more permissive, LGPL license. Qt is better ported for Windows and looks more native than GTK. Gimp on windows, for example, looks very strange, because most of its dialogs are not Windows dialogs. Qt can use native Window dialogs like Open/Save which makes it feel better as a framework. And yes, Qt is a framework, not only a GUI Widget. No, I am not advertising Qt here, as Qt have some strangeness for a windows user from development point of view, for example, Qt is Layout based while MFC / .NET are anchor based and Qt's Layout managers are sometimes strange. But if I have to choose between both GTK and Qt, I will select Qt. Also, now, Qt comes with very good IDE, Qt Creator, which is my default C/C++ IDE for all types of projects now (as Qt Creator can be used as such).

查看更多
手持菜刀,她持情操
7楼-- · 2019-02-01 21:46

Packaging GTK and its dependencies on Windows is a full-time project in itself. Qt is much more easily distributed since it has no dependencies that do not come with Windows.

Qt has been cross platform from the start. GTK has not always been cross platform. Such fundamental decisions shape the overall design, and should be made before any code is written in my opinion.

I would comment more, but I'd be drifting into speculation, the above two things I know for certain.

查看更多
登录 后发表回答