ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
We are planning to port a windows application (written in C++ with MFC) to Linux. We are trying to keep portability as our top priority. Which Linux GUI-toolkit would you recommend for development in this particular project?
Xt is the toolkit for X, it comes as a standard x lib these days ... tho its not really pretty
motif is toolkit i know id never use (and avoid any program written in it ... tho if it was a needed program (or good one i liked) id install it)
qt is for KDE
gtk is for pretty much anything but kde ( gnome uses it as its main toolkit, tho people that don't use gnome also have gtk as the gimp, and most popular programs (that arnt kde) use it (well, not most.... but a lot, and its a good toolkit, tho i never used qt)
tk (from tcl) is rather one that is seen on both kde or gnome (tho its rather ugly, its used to give tcl programs a GUI, and really most people only use it as needed)
Xt is the toolkit for X, it comes as a standard x lib these days ... tho its not really pretty
motif is toolkit i know id never use (and avoid any program written in it ... tho if it was a needed program (or good one i liked) id install it)
qt is for KDE
gtk is for pretty much anything but kde ( gnome uses it as its main toolkit, tho people that don't use gnome also have gtk as the gimp, and most popular programs (that arnt kde) use it (well, not most.... but a lot, and its a good toolkit, tho i never used qt)
tk (from tcl) is rather one that is seen on both kde or gnome (tho its rather ugly, its used to give tcl programs a GUI, and really most people only use it as needed)
i believe theres others but i forget them
unless you want to just use xlibs directly
Qt is NOTfor KDE. It happens to be the library that KDE is written in and it's entirely possible (not to mention common) to have the Qt libraries installed with not a hint of KDE anywhere.
That said, I have programmed in it and I loathed it. Anything using signals and slots (or whatever they call them) needs pre-compilling using their meta-object compiler. It's a pain in the @ss.
Gtk was designed originally to make the Gimp (it's short for Gimp ToolKit) and is fairly common, though in its basic form unsuitable for what you want as it's written in C, not C++. However there is a C++ wrapper called GTKMM which I have programmed in and found to be very usable and simple to pick up. It also has the advantage that the user can theme any programs created with it by changing their GTK theme.
There are others, but they aren't that common. In your boat I would try GTKMM, the online documentation is very good.
Since you're coming from MFC, it's possible that the easiest path for you to follow is to use wxWidgets. I tried it once, and it seemed somewhat similar to MFC. YMMV.
Originally posted by gizmo_thunder I suggest you use Qt coz it proviedes the best portability.
it works on a broad range of platforms like mac, solaris, linux, windows etc
If you want portability.. and ease of programming Qt is the way to go
From the gtkmm homepage:
Quote:
gtkmm should run under any UNIX-type system with the proper compilers and libraries installed. The GNU C++ compiler (g++, part of gcc) together with the GNU toolset (such as found on Linux and *BSD systems) comprise its default build environment.
gtkmm can also be be built and used with:
1. Sun's Forte C++, on Solaris.
2. Windows, with the mingw build tools.
Having used both Qt and Gtkmm I would say Gtkmm is by far the easier and is no less portable than Qt. It's certainly less hassle as it's genuine C++ without the need for hideous meta-object compilation.
If your opinion could still be swayed, I'd also like to throw in my vote for wxWidgets (formerly wxWindows). Admittedly, I do not have much experience with cross-platform programming, but it's supposed to be highly portable, and it's fairly easy to use.
Impressive history of the wxWidget project and nice looking screenshots say a lot. Another is the afore-mentioned MFC similarity. We are definitely going to try it out. It's downsides though, are that it's not as popular as GTK and QT and that it's a wrapper for other GUI APIs (if I understand it well), which means that the user still needs GTK or Motif under Linux.
If you develop propriatary software and have a lot of money.... qt is the way to go.
If you develop proprietary software and don't have a lot of money.... gtkmm and wxwidget are the way to go. Gtkmm is more c++. Wxwidgets has bigger community.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.