What's the C++ GUI building option with the easiest learning curve - VS/Qt/wxWidgets/etc.?

前端 未结 11 1477
南旧
南旧 2021-02-07 20:38

I\'m looking to be able to build GUI applications quickly and painlessly as possible. I\'m competent (though not expert, and have no formal training) in C++, but have never used

相关标签:
11条回答
  • 2021-02-07 21:15

    First and foremost, start simple. There's a lot to the subject. If you are finding it hard, don't try and take it in all at once.

    Most of the good GUI packages have tutorials. The best advice I can give is that you try each of them, or at least a couple of them. They are the best short introduction you can have to the library you choose and if they are any good they narrow down what you need to absorb at first. That will give you some basis for comparison, because they are each trying to do very similar things (and you will see some of them before you are done), but they have different feels. You will likely find you have a preference for one and that's the one to get serious with. It will also give you a sense of what's hard about GUI programming as separate from the particulars of one package, which, if you have only used one, you won't have seen. Personally I find this sort of knowledge very helpful, because it makes me less intimidated by particulars.

    Here's a list of tutorials in one place, though you have likely seen them already:

    • Qt's tutorial
    • WxWidgets' tutorial
    • Gtkmm book. Not quite a tutorial, though there are lots of examples.
    • .NET tutorials, either for WinForms or for WPF.

    Second, it sounds to me that you need to get some in depth understanding of the concepts of GUI programming, not just a particular library. Here there is no substitute for a book. I don't know all of them by a long shot, but the best of the bunch will not just teach you the details of a toolkit, they will teach you general concepts and how to use them. Here are some lists to start with though (and once you have titles, Amazon and Stack Overflow will help to pick one):

    • List of Qt books
    • WxWidgets book (PDF version)
    • There are tons of WPF and WinForms books. I can't make a good recommendation here unfortunately.

    Third, take advantage of the design tools (Qt Creator, VS's form building and so on). Don't start by trying to read through all the code they generate: get your own small programs running first. Otherwise it's too hard to know what matters for a basic program and what doesn't. The details get lost. Once you've got the basics down though, Do use them as references to learn how to do specific effects. If you can get something to work in the design tools, then you can look at particular code they generate to be able to try on your own hand-written programs. They are very useful for intermediate learning.

    I'm not overly keen on learning a bunch of stuff that's only applicable to the Qt platform itself rather than more generally.

    I second the comment of GRB here: Don't worry about this. You are going to need to learn a lot specific to the toolkit no matter which toolkit you use. But you will also learn a lot that's general to GUI programming with any of the decent toolkits, because they are going to have to cover a lot of the same ground. Layouts, events, interaction between widgets/controls, understanding timers -- these will come up in any GUI toolkit you use.

    However do be aware that any serious GUI package is an investment of time. You will have a much easier time learning a second package if you decide to pick one up, but every large library has its personality and much of your time will be spent learning its quirks. That is, I think, a given in dealing with any complex subject.

    I suppose I could avoid using the Qt classes except for the GUI stuff where I have to use them, but I have no idea how wise or unwise that would be.

    You do not need most of the non-GUI classes of Qt to use Qt's GUI properly. There are a handful of exceptions (like QVariant) which you'll need just because the GUI classes use them. I found you can learn those on a case-by-case basis.

    0 讨论(0)
  • 2021-02-07 21:17

    I can't intelligently comment on the learning curve aspect, but a quick survey of StackOverflow questions shows about twice as many Visual C++ questions as Qt questions. Probably means that there is a larger support group in place for Visual C++. Might make learning it a little easier if there are more folks to help out.

    0 讨论(0)
  • 2021-02-07 21:22

    If cross-platforming is not necessary, try .net + msvs or delphi. easy, all-in-one, no pain.

    0 讨论(0)
  • 2021-02-07 21:22

    Since nobody has mentioned it yet, for the sake of completeness, have a plug for the Fox toolkit. This is the one I used last time I did any C++ UI work of my own volition. There are also binding for this to Ruby and Python (the latter being many years out of date, though).

    In general, the choice of a toolkit for self-directed work comes down to personal preferences for

    1. the layout manager style
    2. the event handler registration style
    3. How native the widget set looks/can be made to look
    0 讨论(0)
  • 2021-02-07 21:24

    Qt is the best option for you. It's the easiest to learn, the most elegant and powerful and it is completely free.

    • Visual C++: This is an IDE, but it comes with its own GUI library called MFC. MFC is an old library with many quirks and it is difficult to learn and use. Many C++ programmers use it on Windows because it comes from MS, it's fast and it's free if you buy Visual C++. Since VC++ is an IDE, you can also use wxWidgets and Qt with it, although in your particular case I would recommend Qt Creator instead.

    You seem to have experimented with Managed C++. Don't use that, even MS recommends that you only use Managed C++ as glue between C++ and C#.

    • wxWidgets: This one was a strong contender up to the day when Qt became free for commercial projects. It was always in the shadow of Qt and it is known that the documentation is not very good and the API is not as easy to learn as Qt's. Cross-platform MFC would be a good way to describe it.

    • C++ Builder: Borland made too many mistakes with C++ Builder and ended up getting out of the dev tools business altogether. It was a good product and I originally learned Windows GUI programming in one of the first versions, but I won't use it any more. There are better options and it is too expensive.

    0 讨论(0)
提交回复
热议问题