轻量级 C++ Gui 库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1283202/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 19:26:33  来源:igfitidea点击:

Lightweight C++ Gui Library

c++user-interfaceframeworks

提问by QAH

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.

我想在 Windows 上用 C++ 创建 GUI 应用程序。我已经下载了 Qt,它运行良好,但它有太多的东西和太多我真的不使用的头文件。这是一个不错的框架,但它不仅仅是 GUI。

Are there any lighter GUI libraries out there for Windows C++ that is "just GUI"?

Windows C++ 有没有更轻量级的 GUI 库,“只是 GUI”?

采纳答案by Shaun

FLTK, if you are serious about lightweight.

FLTK,如果你对轻量级很认真的话。

http://www.fltk.org/

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.

FLTK 被设计为足够小且模块化以进行静态链接,但作为共享库工作正常。FLTK 还包括一个名为 FLUID 的优秀 UI 构建器,可用于在几分钟内创建应用程序。

I'll add that its matureand stable, too.

我还要补充一点,它也很成熟稳定

回答by DirkMausF

Even if wxWidgets is named here already:

即使 wxWidgets 已经在这里命名:

wxWidgets!

wxWidgets!

Its a great and valuable Framwork (API, Class Library, whatever you may call it).

它是一个伟大而有价值的框架(API、类库,不管你怎么称呼它)。

BUT: You can divide the functionality of this library into many small parts (base, core, gui, internet, xml) and use them, when necessary.

但是:您可以将这个库的功能分成许多小部分(基础、核心、gui、internet、xml)并在必要时使用它们。

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...

如果你真的想制作好的 GUI 应用程序,你必须使用一个好的 API。wxWidgets 是绝对免费的(QT 不是),只需要很小的二进制形式的开销,链接为 dll 或 o 文件,大约 2Megs,但必须提供编写出色应用程序所需的一切......

And wxWidgets is much more lighter than QT... and even better... :)

而且 wxWidgets 比 QT 轻得多......甚至更好...... :)

Try it...

尝试一下...

回答by Roland Rabien

JUCEis 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.

JUCE相当轻巧,它可以像一个 .cpp 和一个 .h 文件一样简单。(看看合并的 JUCE)但是它看起来不像标准的 Windows 应用程序。另一方面,它是跨平台的。

回答by Ident

CEGUIis 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.

CEGUI是一个强大的 GUI 库,但我不确定(因为你没有澄清)你所说的轻量级是什么意思。它也包含很多标题,但它们都与 GUI 或它的呈现有关。在我的电脑上,当前在默认 VS2010 Release 模式中构建的 Release 总共需要大约 3 MB 的 dll。当然也有占用空间的资产,但显然这些资产可能会根据您的需求而有所不同。它在资产中使用 XML 和图像文件,图像占用的空间最多。它需要一堆 dll,具体取决于您的要求(png、jpeg、xml 解析 dll),但它们在 Release 中都非常小。因此,除非您对使用过多 DLL 抱有不合理的学究气,否则这应该没有问题。

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.

它是用 C++ 编写的(0.7-1.0 将基于 C99 标准,2.0+ 将基于 C++11 标准)并支持动态和静态链接。动态链接是 Windows 上支持的类型。CEGUI 不建议在 Windows 上使用静态链接。

Here a short summary of features:

以下是功能的简短摘要:

  • Modern(uses STL, XMLfor 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 widgetsout-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 editorwritten 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-platformuse. It officially supports Windows, Linux, Mac OS. It has also been used on iOS and Android. Android is supported in the development branch.

  • 现代(使用STLXML作为其资产文件,并在内部支持 C99 标准以获得最大兼容性,在 1.0 版本之后它将在开发分支中使用 C++11)。它还支持 unicode 字符和所有类型的语言(如示例中所示)。

  • 提供以下开箱即用的小部件:文本字段(可滚动)、编辑框、多行编辑框、微调器、复选框、按钮、单选按钮、选项卡式窗口、进度条、可滚动窗格、滑块、下拉菜单(组合框) 、菜单栏、布局容器(垂直/水平)等

  • 开源 MIT 许可证下发布,这是为您提供最大自由的许可证之一,您只需要随应用程序分发许可证文件即可

  • 使用Python 编写的WYSIWYG 编辑器可以轻松创建和编辑布局。它被称为 CEED,也是免费提供的。它经过了大量的测试,适合用于生产。已经发布了一个稳定的版本,并且正在开发未来的新功能。同一应用程序中还提供了图像集编辑器。

  • 如前所述,这是免费用于商业用途。您唯一的义务是分发许可证文件。

  • CEGUI 适合跨平台使用。它正式支持Windows、Linux、Mac OS。它也已在 iOS 和 Android 上使用。开发分支支持 Android。

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.

它最初被设计为游戏的 GUI 库,但它也非常适合用于科学应用程序、渲染应用程序、可视化。桌面应用程序也可以完成。默认资产中有一个简单的类似 Windows 的皮肤。

It has been around for over 10 years, has an active community and is a robust, feature-rich and extensible library.

它已经存在 10 多年,拥有活跃的社区,是一个强大、功能丰富且可扩展的库。

回答by Stefano Borini

回答by mrmoje

Microsoft Foundation Class Library (MFC)

Microsoft 基础类库 (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.

考虑到您正在寻找WINDOWS ONLY SOLUTION,(并且 wxWidgets 已在此线程上投票)您可能想要权衡一些轻量级和结帐 MFC。
Windows 而言,MFC 和 wxWidgets 似乎并驾齐驱,但总体而言,前者比后者轻。

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.
  • MSVC MFC RAD 支持。Visual Studio 可以说提供了最好的“RAD 工具和 GUI 库”组合。唯一接近的其他“动态二人组”是 QtCreator 和 QT。wxSmith 并不完全支持所有
  • wxWidgets 组件,但它一直在改进。非常丰富的商业 GUI 组件集。
  • 免费(但专有)。
  • 非常适合数据绑定控件。

Some CONS:-

一些缺点:-

Anyways, appart from MFC, I think the FOX-Toolkitalso 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

无论如何,从 MFC 来看,我认为FOX-Toolkit也值得一提,但就像 FLTK 一样,与 QT 或 wxWidgets 相比,主要缺点是缺乏像样的 IDE 和 RAD 工具

回答by Bulat

IUP is the smallest one i know, both in terms of learning curve, DLL size and features

IUP 是我所知道的最小的,无论是在学习曲线、DLL 大小还是功能方面

回答by Bulat

try GTK with Glade3.

用 Glade3 试试 GTK。

回答by Josh Kelley

Try eGui (see hereor here) or WTL.

尝试 eGui(请参阅此处此处)或WTL