Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

For C++ (Win) devs, what is your case for preferring Qt vs. MFC (or vice versa) for UI development on Windows?

share|improve this question
1  
QT is better OO. – Gulshan Nov 7 '10 at 18:29
MFC'd btter be more OO – mlvljr Nov 7 '10 at 18:49
2  
Have you looked at WTL? If you don't go with Qt, you may prefer it to MFC: wtl.sourceforge.net – JBRWilkinson Nov 8 '10 at 13:58
2  
@Jas: It seems to be in the nature of these sites that "A or B ?" questions invite a lot of "no, you should use C!" answers. Sometimes these are useful, but sometimes it's a good idea to preemptively add an explicit "yes I know about C and it's not an option" to the question to keep it focussed. I'm kind of curious about the backstory to this question: I'm actually finding it pretty hard to imagine a situation where I'd ever have to choose between MFC and Qt myself. Qt vs wxWidgets vs .NET/WPF vs webapp seems far more likely to be the decision these days. – timday Nov 10 '10 at 13:49
1  
@mlvljr - only in the sense of OOOOO-no not MFC! – Martin Beckett Mar 31 '11 at 4:53
show 7 more comments

closed as not constructive by Mark Trapp Jan 26 '12 at 23:47

As it currently stands, this question is not a good fit for our Q&A; format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.

5 Answers

up vote 17 down vote accepted

Simple: Qt is a fantastic comprensive and elegant framework for coding GUI apps (on any platform). MFC is a hideous and obsolete pile of junk which no-one developing new code should contemplate using at all.

Qt's LGPL might be an obstacle for some commercial users, but they can always pay for a full commercial license.

share|improve this answer
1  
Precise + concise. +1. – Jas Nov 7 '10 at 19:44
+1. Over in 1. :) – Bobby Tables Nov 7 '10 at 21:26
3  
MFC is a very thin layer on top of Win32 so you have to learn Win32 anyhow, which makes you wonder what value it brings. – JBRWilkinson Nov 8 '10 at 13:57
@JBRWilkinson: This was my experience of MFC too (around a decade ago). Used it when I first came to windows GUI programming, then about a year later found I was preferring just to do everything using the Win32 APIs direct. – timday Nov 9 '10 at 19:09
2  
lots of opinion, pretty much no facts. I wonder why this answer was accepted. I respect your opinion but you should try saying why Qt is so great and why MFC is so bad maybe? I know both of them and it is not that obvious to me. – n1ckp Nov 27 '10 at 20:04
show 2 more comments

Qt is better than MFC for a number of reasons including:

  • It is open source
  • It is cross platform. It works on Linux, some mobile devices and Mac OSX. This makes it easier to port programs to other platforms.
  • Qt is much easier to use and learn that MFC.
  • Qt is well documented.
share|improve this answer
1  
MFC is open source also. There is no difference in ease of learning. I use both every day. Both are well documented. MFC/ATL has better COM support. – Jim In Texas Feb 11 '12 at 22:11

MFC is old and creaky and is in maintenance mode for some years. There are some small updates but mostly to keep the wolves from the door. I think for new development there are a lot better options.

share|improve this answer

I started a new project and decided to go MFC instead of QT.

The reason is pretty simple. It is obvious that only MFC (or WxWidget) apps will look really native. QT is an alien and will always be. You see it for example with the buttons and the animated fade in when you hover the mouse over it, this and thousands other things the QT people can't get right because it's not in the theming API and getting up with Windows7, Windows8 or Windows9 seems just impossible, especially now where Nokia dropped QT and the roadmap turns it away from Desktop to a mobile Toolkit.

And being native has another advantage, some day the AppStore might just reject applications that don't look native. Apple AppStore is already doing it.

And finally, no C++ and therefore MFC is not a dead technology - it's just very conservative, like developing Apps in Fortran or C.

The widgets are still improving slowly but and new features like the Ribbons and the docking library in MFC Feature Pack are very good.

share|improve this answer
2  
C++ is not a dead technology so therefore MFC isn't? Did you actually just use that line of reasoning? Also, "Qt apps don't look native!" is FUD. Qt apps look as native as WinForms and MFC apps (but not WPF apps) do. – user16764 Jan 11 '12 at 8:12
C++ in the context of this question as a Desktop development language. This has to be pointed out because of the former microsoft plan to replace it all with C#. I expect readers to understand the implicit context of answers. – Lothar Jan 22 '12 at 22:52
"Qt apps look as native as WinForms and MFC apps" no they don't if you think this you haven't ever looked into the details of native windows widgets on Vista and Windows7. – Lothar Mar 21 '12 at 12:29

You should be comparing .NET instead of MFC. I have not used Qt but .NET is pretty simple to use compared to MFC and you get the native look and feel.

share|improve this answer
1  
@jas, I do agree with your comment as it was structured to compare Qt and MFC, marking it down is sufficient. However, I think you should hold your opinion about other members especially the "if you have nothing smart or interesting to say, then it's better to remain silent" it's rude, unnecessary and unprofessional. – GrumpyMonkey Nov 7 '10 at 20:09
@grumpy, I can see your point here, maybe I did overreact..better now? – Jas Nov 7 '10 at 20:21
3  
having programmed in C# on .NET framework since 2003 ( version 1.0 ), I am pretty aware of the speed and ease of development with it. However, my question was not about what I should ask, it was about comparison of MFC against Qt. -1 for this no-answer. – Jas Nov 7 '10 at 20:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.