Good C++ GUI library for Windows

I'm looking for a good windows GUI library for C++. The ideal characteristics in my opinion should be:

  • Modern. MFC, wxWidgets, Qt were started a long time ago and they don't use modern C++ features and standard library.
  • Have a rich set of controls with decent features. The ability to drop HTML almost everywhere is a happiness for which I love wxWidgets when I don't hate it.
  • Open source. It's the must. If sources are available after purchase then it's considered ok.
  • Have a form designer in some way. Yeah, it would be great. After years of working with Delphi, I cry every time I have to specify control sizes by hand.
  • Free for commercial use. But if some library is REALLY good, then I will consider buying it.
  • Cross platform. This specification is just a tie-breaker ☺. I can live without this.
  • Please suggest your ideas for candidates. One library per answer please.


    I think you're writing Qt off too quickly; it doesn't use the standard library much, but that has less to do with being obsolete than with having different priorities. The QT containers use iterators, template algorithms, etc, but have a different iterator model; Qt iterators point between elements instead of at them. This makes forward and reverse traversal symmetric, and cleans up some edge cases for inserting and removing elements while traversing, though it's a little less efficient. And they do provide STL-style iterators too. It's a valid choice for a GUI library IMO; performance of the containers is unlikely to be the critical factor.

    As for the preprocessor (moc), think of it more as an IDL compiler that knows how to read C++ headers instead of needing its own language. It doesn't preprocess your code, which is compiled directly. It just generates an additional cpp file containing the marshaling for signal/slot callbacks, which can get rather messy when they cross thread boundaries and need synchronization.

    Qt is free if you can release your sources (even for commercial use; how many in-house tools really need to be proprietary), and not unreasonably priced if you can't (no per-unit royalties or anything particularly annoying)


    If you are looking for a modern C++ GUI library, then Adam & Eve from the Adobe Source Library (ASL) is the right thing (it relies heavily on the Boost libraries).

    What I really like about it, is that the design of the layout is completely decoupled from the code. The layout definition can be in an external file, so that the user can change the layout without recompiling the program.

    A example from the site:

    layout clipping_path
    {
        view dialog(name: "Clipping Path")
        {
            column(child_horizontal: align_fill)
            {
                popup(name: "Path:", bind: @path, items:
                [
                    { name: "None", value: empty },
                    { name: "Path 1", value: 1 },
                    { name: "Path 2", value: 2 }
                ]);
                edit_number(name: "Flatness:", digits: 9, bind: @flatness);
            }
            button(name: "OK", default: true, bind: @result);
        }
    }
    

    Which will produce:

    Beside of this the ASL also has some other helpful utilities classes.

    Edit: but it (yet) haven't got a form designer.


    WTL is a modern GUI framework created by Nenad Stefanovic from the ATL team. It is light-weight but still supports all the modern features of the OS.

    Windows Template Library

    Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components. It extends ATL (Active Template Library) and provides a set of classes for controls, dialogs, frame windows, GDI objects, and more.

    The unofficial documentation lives at the Code Project.

    链接地址: http://www.djcxy.com/p/23310.html

    上一篇: C ++中线程的简单示例

    下一篇: 适用于Windows的良好C ++ GUI库