可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 4 years ago.
I want to create GUI applications with C++ on Windows. I have downloaded Qt, and it works well, but it has so much stuff in it and so many header files that I really don't use. It is a nice framework, but it has more than just GUI.
Are there any lighter GUI libraries out there for Windows C++ that is "just GUI"?
回答1:
FLTK, if you are serious about lightweight.
http://www.fltk.org/
edit:
Blurb from the website:
FLTK is designed to be small and modular enough to be statically linked, but works fine as a shared library. FLTK also includes an excellent UI builder called FLUID that can be used to create applications in minutes.
I'll add that its mature and stable, too.
回答2:
Even if wxWidgets is named here already:
wxWidgets!
Its a great and valuable Framwork (API, Class Library, whatever you may call it).
BUT: You can divide the functionality of this library into many small parts (base, core, gui, internet, xml) and use them, when necessary.
If you really want to make GOOD GUI applications, you have to use a GOOD API. wxWidgets is absolutly free (QT is not), only needs a small overhead in binary form, linked as dll or o-file is it about 2Megs, but has to offer all that you ever need to program great applications...
And wxWidgets is much more lighter than QT... and even better... :)
Try it...
回答3:
JUCE is fairly light weight, it can be as simple as one .cpp & one .h file. (Look at amalgamated JUCE) It doesn't look like a standard windows app however. On the other hand, it is cross platform.
回答4:
CEGUI is a powerful GUI library but I am not sure (since you did not clarify) what you mean by lightweight. It contains a lot of headers, too, but they are all related to the GUI or the rendering of it. On my computer, the current Release built in default VS2010 Release mode takes about 3 MB in total for the dlls. There are of course assets that take space too, but clearly these may vary depending on your needs. It uses XML and image files in the assets, the images take the most space. It requires a bunch of dlls depending on your requirements (png, jpeg, xml parsing dlls) but they are all quite small in Release. So unless you are irrationally pedantic about having too many DLLs in use, this should be no issue.
It is written in C++ (0.7-1.0 will be based on C99 standard, 2.0+ will be in C++11 standard) and supports dynamic and static linking. Dynamic linking is the supported type on Windows. Static linking on Windows is not recommended for CEGUI.
Here a short summary of features:
Modern (uses STL, XML for its asset files, and internally supports C99 standard for maximum compatibility, after the 1.0 Release it will be using C++11 in the development branch). It also has support for unicode characters and all sort of languages (as can be seen in the samples).
Offers the following widgets out-of-the-box: text fields (scrollable), editboxes, multiline editboxes, spinners, checkboxes, buttons, radio-buttons, tabbed windows, progress bars, scrollable panes, sliders, dropdown-menus (comboboxes), menu bars, layout containers (vertical/horizontal) and more
Published under the Open Source MIT license, one of the licenses offering you the most freedom, you will only need to distribute the license file with the application and that's it
Layouts can easily be created and edited using a WYSIWYG editor written in Python. It is called CEED and is also freely available. It has gone through a lot of testing and is suitable to be used for production. A stable Release has been published and new features are in development for the future. An imageset editor is also available in the same application.
As stated, this is free for commercial use. The only obligation you have is to distribute the license file.
CEGUI is fit for cross-platform use. It officially supports Windows, Linux, Mac OS. It has also been used on iOS and Android. Android is supported in the development branch.
It was originally designed as a GUI library for games but it is also perfect for usage in scientific applications, rendering applications, visualisation. Desktop applications can be done as well. A simple Windows-like skin is available in the default assets.
It has been around for over 10 years, has an active community and is a robust, feature-rich and extensible library.
回答5:
回答6:
Microsoft Foundation Class Library (MFC)
Considering you are looking for a WINDOWS ONLY SOLUTION, (and that wxWidgets has been voted up on this thread) you may want to trade off some lightweight-ness and checkout MFC.
As far as Windows is concerned, MFC and wxWidgets seem to compete neck & neck, but overall, the former is lighter than the latter.
Some PROS:-
- MSVC MFC RAD support. Visual Studio arguably provides the best "RAD
tool & GUI lib" combo. The only other "dynamic duo" that comes close
is that of QtCreator & QT. wxSmith doesn't fully support all
- wxWidgets components, but it keeps improving. Very Very Rich set of
commercial GUI components.
- Free (but proprietary).
- Very nice when it comes to databound controls.
Some CONS:-
- The day you decide to port to other platforms, you will wish you had gone with a cross platform lib.
- Proprietary nature of MFC means you will have to navigate licencing very very carefully. But AFAIK, MFC is free to redistribute in binary form.
Here's a nice article touching on the "oil and water" that is "MFC and FLOSS applications". Apparently, they just might mix.
Anyways, appart from MFC, I think the FOX-Toolkit also deserves a mention, but just like FLTK, the major downside is lack of decent IDEs and RAD tools as compared to, say, QT or wxWidgets
回答7:
IUP is the smallest one i know, both in terms of learning curve, DLL size and features
回答8:
Try eGui (see here or here) or WTL.
回答9: