tags:

views:

9748

answers:

22
+44  Q: 

Qt versus WPF/.NET

My company is trying to make the decision between using Qt/C++ for our GUI framework or migrating to .NET and using WPF. We have up to this point been using MFC. It seems that .NET/WPF is technically the most advanced and feature-rich platform. I do, however, have several concerns. These include:

  • Platform support
  • Framework longevity (i.e. future-proofing)
  • Performance and overhead

For this application we are willing to sacrifice support for Windows 2000, Macs, and Linux. But, the issue is more related to Microsoft's commitment to the framework and their existing platforms. It seems like Microsoft has a bad habit of coming up with something new, hyping it for a few years, and then relegating it to the waste-bin essentially abandoning the developers who chose it. First it was MFC and VB6, then Windows Forms, and now there's WPF. Also with .NET, versions of Windows were progressively nicked off the support list. It looks like WPF could be here to stay for a while, but since it's not open source it's really in Microsoft's hands. I'm also concerned about the overhead and performance of WPF since some of our applications involve processing large amounts of information and doing real-time data capture. Qt seems like a really good option, but it doesn't have all the features of WPF/.NET.

Basically, what does the community think about Microsoft's commitment to WPF compared with previous frameworks? Are the performance considerations significant enough to avoid using it for a realtime application? And, how significant are the benefits of WPF/.NET in terms of productivity and features compared to Qt?

+4  A: 

Windows Forms has not been abandoned. Far from it, actually. WPF is simply an alternative framework for easily building visually compelling applications. I also don't see WPF disappearing any time soon.

As for Qt, I haven't messed with it, so I can't really give you an opinion.

David Brown
Is Microsoft planning on actually improving Windows Forms? It seems like most new development will go to WPF.
aaronc
Windows Forms will not have any new features from Microsoft from here out. At this time, they are not planning to retire it, but they are encouraging new GUI development to occur on the WPF platform.
MedicineMan
There are plenty of 3rd party developers still in the game. Why do any enhancements to WinForms have to come from Microsoft?
Robert Kozak
There is nothing to improve in Windows Forms. It was good 10 years ago and will work at least 5 more. Bug fixes always appearing and will for some time. WPF is new concept with the idea of markup, cascase styles and DirectX use inside. Just understand that right now Win Forms is mainstream on Win platform and WPF is Next Architecture GUI Framework.
Mash
That being said, what justifies doing new development in Win Forms if the next gen tool is already out? I don't see Windows 2000 support as a good enough reason.
aaronc
Win Forms still mainstream and WPF still in childhood. Anyway - test it yourself to have proper decision.
Mash
What is there to "improve" for WindowsForms? I asked a similar question and after a lot of thought, I realized that it's already very mature.
Rhubarb
WPF is still in childhood but might not make it to adulthood. If the web and mobile is the future then Silverlight might get more of the MS focus.
Martin Beckett
@Mash "There is nothing to improve in Windows Forms" - with that I cannot agree; I believe there is plenty of room for improvements in WinForms, and having a large code base utilizing it I am rather disappointed by its abandonment by MS.
Eyvind
+5  A: 

If your application is only going be for Windows, then using WPF or Windows Forms is fine. There are a lot of 3rd party applications for Windows Forms to enhance them a bit if they aren't flexible enough.

Windows Forms hasn't been abandoned by any means -- so using that or WPF, even for a long term release of software should be OK. I would use WPF though, just in case a new feature comes out for it that you would like to use in your application. With Windows Forms, I don't think any new features are planned, so if you go that route, you're stuck there.

I've also messed with Qt and wxWidgets a bit. I like both, but the key feature you would get with both of these is that they are compatible on more than just Windows. The license agreements for both make them attractive for commercial applications too now that Qt has adopted the LGPL license. The communities for both seem good and I don't see development on either platform slowing down at all; in fact, they both seem to be getting stronger.

landyman
So what about the feature set of Qt compared to WinForms/WPF? Performance issues?
aaronc
Qt adopted an LGPL license, not BSD
Chris Cameron
Corrected that one.
Mihai Limbășan
my bad on the license -- too many to remember which company adopts which. thanks for the edit.
landyman
@aaronc - I can't speak to the full feature set, but I've found Qt, wxWidgets and WPF to have everything I've needed for my projects. which, admittedly, have been fairly straight forward. I haven't noticed any performance issues when using Qt. Qt is used in Google Earth and Skype, as an example.
landyman
@landyman - and what about performance of WPF/WinForms as opposed to Qt since you've used them both? My concern with WPF is that it needing to tune it for performance will take away from its so-called productivity benefits.
aaronc
@aaronc - I haven't written an application in Qt and the same application in WPF, so I don't have a direct comparison. But, for my projects, it seems like I spend a little less time playing with Qt than I do trying to get WPF/WinForms the way I want.
landyman
+29  A: 

There are Qt bindings for Python, C#, Ruby, Java, Ada, Pascal, Perl, PHP, and Haskell, however, they aren't supported by Trolltech (or now Nokia), and I've no idea if they work well at all.

Even so, I'd rather use C++ with Qt, than whatever microsoft is pushing right now. You can run Qt on every popular desktop OS, and with the licensing terms, even if Nokia goes bankrupt or sells Qt off, you've got all the source code. You can maintain it yourself if you need to, and modify it however you like, you just need to make your source code modifications to the Qt libraries available to anyone you give binaries to.

KeyserSoze
As far as I know, the Qt binding for Java ,called Jambi, is supported by Nokia.
Lucas
The Python bindings are very good, and they're commercially supported by a third-party company, but they're GPL (with commercial licensing available) rather than LGPL.
Josh Kelley
Jambi has been discontinued - see http://qt.nokia.com/products/programming-language-support
Pavel Minaev
There's a new set of Python bindings, PySide, that are LGPL.
KeyserSoze
True, Jambi won't be maintained after May 2010. However, as your link indicates, the code is LGPL so you can maintain it yourself, and it is still available for download from Nokia. That's a much better situation than if a closed-source toolkit you depend is discontinued.
KeyserSoze
-1. Most of those "bindings" are toys with no serious users. The idea that being able to maintain Qt yourself is an advantage is absurd.
Jon Harrop
The pyside bindings are supported by nokia.
Roman A. Taycher
+4  A: 

Future of WPF

WPF's Direct3D architecture lets the graphics card do what it is good in: do graphics. The architecture for sure has a future. I wouldn't be suprised if the next Windows versions would make WPF enabled application GUI's run much faster, without any code change. Windows Vista and upwards already runs in a Direct3D mode, and "draws" Windows Forms GUI's in a backward-compatible way.

In my opinion, whether WPF as a platform (not only the 3D architecture) will make a breakthrough, heavily depends on the availability of good tools to support the development process. Microsoft Expression Blend is still limited, Visual Studio WPF designer is even more limited. Also, I think Microsoft should also invest more in how to get visual designers to use tools which produce WPF UI's.

Comparing Qt/C++ with C# UI (whether WPF or Windows Forms):

  • C# definitely is more productive in UI design. There is a good visual designer for Windows Forms in Visual Studio. Further, for WPF, there is Microsoft Expression Blend for visual designers.
  • C# in UI development has a larger user-base. Therefore, more examples and more community support are available.
  • C# as a language has made a huge improvement in .NET 3.5 to cover areas which were harder to realize (LINQ, Parallel-LINQ, WCF, WF, different ORM products) and are still harder to realize in many other languages.
taoufik
I'd like to add to your list: Qt has better documentation. WPF does have documentation but it's not well organised and the documentation text itself is harder to understand. Qt documentation has a short explanation on the most used features of an API and then a full reference. MSDN only gives you a complete explanation of everything and this makes it hard to use.
Jules
Second on the Qt documentation!
Dr. Watson
Your response is horrible because your response is entirely one sided and has absolutely no mention of the opposing side. When you are promoting one item as being "better" than another you MUST show HOW the one item is better than the other.
Trevor Boyd Smith
When someone asks "why should I pick A and not B?" and the response is "item A has x,y,z and therefore is better than B" is not a valid comparison. Saying "item A has x,y,z" answers an entirely different question "what features does A have?" and doesn't help anyone understand which is better.
Trevor Boyd Smith
Please note as of 08SEP2009: the accepted answer here has +7. Where as the answer by Alan has +19.
Trevor Boyd Smith
so you're effectively saying that QT is the one to go for - the QTCreator app is great and well supported.
gbjbaanb
So let me get this straight. The argument of the downvoters is "wahhhhh, WPF is too haaard! I don't read good!!!"
Pierreten
@trevor you got me, I do favour C# GUI over QT. That's why I gave my opinion in the first place. I hope nothing is wrong with that. Further, if you really did read my posting, you could have seen that I used the words 'better', 'larger' and 'harder'... all these words imply a comparison between the two different products.
taoufik
@Pierreten, the argument is the one told by Trevor Boyd Smith.
iconiK
I suspect WPF user-base is smaller than QT's
EFraim
@EFraim: correct. However, when you're programming a WPF application, you're working 75% with .NET as a platform (ex WPF technology). The platform itself has more users that "NON-UI-QT plus CPP plus CustomLibraries" as platform.
taoufik
Simply because C# and WPF are not cross platform...
SleepyCod
@SleepyCod True all the way. I just wonder how many people really want to run their business application outside of Windows. In addition, QT is just the UI. Other parts of your application might require libraries which are not that portable.
taoufik
@taoufik, QT is much more than UI but a real cross platform application framework allowing you to manipulate data structures much more easily than native C++, doing network programming, animation and so on...
SleepyCod
GPU-accelerated or not, most WPF apps are sluggish as hell. I think it's a bit misleading to simply say "WPF is hardware-accelerated, therefore it is awesome" when the #1 advantage to hardware acceleration just doesn't usually show.
jalf
@Trevor as of 2010-09-30 the accepted answer has +9 and the answer by Alan has +53, by user14116 has +25, by Kensai has + 18, mine has + 14, and so on. A lot of people agreed and even more agree today that Qt would have been a better choice.
iconiK
@jalf works on my machine. Also, Visual Studio 2010.
Will
@Will: VS2010 isn't exactly what I'd call speedy. Also note I said "most" and "usually". And, of course, that performance was a *huge* problem during the development of VS2010, as documented on various MSDN blogs. The current performance level (which really isn't impressive) wasn't easily achieved, and most WPF apps I've seen are far, far worse. My point was just that one API being GPU-accelerated isn't a good thing, unless that API also results in faster apps. In my experience, WPF *at best* achieves parity with apps using non-GPU-accelerated apis.
jalf
@jalf vs2010 runs as fast if not faster than 2008 on all my dev boxes (core 2 duo, core 4 duo and i7--damn, my neckbeard is strong). Yep, MS definitely did put off optimization towards the end of 2010 (that's why it was delayed, IIRC). Of course, that's usually considered a good thing. The main issue I have with your statement is that you compare your perception of different applications of unknown quality written by different people. That's a lot of who knows all wrapped up in there. (cont)
Will
I've got a stupid little POS WPF app that has pretty damned complex UI designed for a touchscreen that runs on a relatively ancient vanilla Dell p4 with a gig of memory and XP. And it manages to keep up the pace in a busy bar down where all the students drink their scholarship money away. In my experience, not only does WPF achieve parity BUT ALSO it is TREMENDOUSLY easier to code and maintain. Don't hate, appreciate.
Will
@Will: So your problem with my statement is that I try to keep it relevant to the question? My statement was simply "screw hardware acceleration, what matters is perceived performance". I never said anything about whether it was easy to code and maintain, I never said "WPF is evil, and must be burned at the stake". I never said that I hated it, or that I don't appreciate it. But someone above suggested that WPF is better *because it is hardware-accelerated*, and I wanted to shoot that down because it is utterly irrelevant if it doesn't make the apps actually *feel* faster.
jalf
I don't know if I can express it much clearer. You come across like a rabid fanboy though, which isn't making it eaiser. Rather than blindly defending WPF against (non-existent) criticism, read what I wrote. I never said WPF sucked. Just that the fact that it is hardware accelerated doesn't seem to actually make it noticeably faster than other technologies, and so that isn't in itself much of an advantage.
jalf
Also, MS did *not* put off optimization until the end. It was an ongoing priority, they just failed at it until near the end, and it's hardly a good thing when it forces the product to be delayed. Again, they documented pretty thoroughly on blogs and elsewhere that they focused on performance from day 1, and they *thought* they were on track until the first beta was released. Turns out speeding up their WPF code was harder than they anticipated.
jalf
@jalf Not a rabid fanboi, just tired of fud. Responding to your comparison of dissimilar things resulting in your opinion that "WPF *at best* achieves parity" and that the current performance level of 2010 isn't "impressive." I base my statements on when performance was concentrated on comes from scottgu; I leave it to anyone who gives a damn about this to [read it for themselves](http://weblogs.asp.net/scottgu/archive/2010/02/08/vs-2010-net-4-release-candidate.aspx). As I stated, they pushed to concentrate on performance improvements; "did put off" "until the end" was too strong.
Will
@jalf I think we do agree that hardware acceleration doesn't mean much for your standard desktop app. Its only when you start doing more impressive things like using shaders or animation or HD video that video acceleration makes a difference.
Will
+62  A: 

If future proofing your system is a major concern then I would seriously consider developing using the Qt framework.

It uses a modern approach to C++ interface development (compared to the MFC) and has the additional wow factor of being cross-platform (Apple/Linux popularity is continuing to grow).

With Nokia's backing, you can also expect good support for hand held devices - again, an industry that's growing rapidly.

I don't think C#/.Net will be going away any time soon, however a lot of people have been predicting C++'s demise for years now and it's still going strong.

Alan
+1 to the handlhelds, that's THE major growth area for the moment, and should become ever more important in the future.
gbjbaanb
-1. C++ is not "still going strong". The number of C++ programming jobs has halved in recent years whereas C# has tripled: http://www.itjobswatch.co.uk/jobs/uk/c++.do http://www.itjobswatch.co.uk/jobs/uk/csharp.do
Jon Harrop
And the number of Haskell jobs has gone up 2000%, from 1 to 20.All the crappy entry level Java jobs have now become crappy entry level C# jobs - yay for them
Martin Beckett
Also with regards to future proofing; Qt is available under the LGPL, so if Nokia should decide to discontinue the project some time in the future, the source code is still available and a community will be able to keep it alive and/or help with transitioning away from it.
Magnus Hoff
1. WPF is also cross-platform: Silverlight runs on Windows/MacOS/Linux, several handheld OSes, and is being ported to more as we speak. 2. C++ developer productivity is significantly lower than with C# because C++ lacks many advanced features such as LINQ, properties, events, and garbage collection. 3. Microsoft's commitment to backward compatibility is legendary. Windows 7 runs DOS programs written almost 30 years ago. There are DOS, Windows 1.x, 2.x, 3.x, etc, emulators for every major OS. If you stay within the API, your C#/WPF app will probably run perfectly well in the year 2100.
Ray Burns
MS has stopped doing backwards compatibility recently - when the new C# APIs arrives, backwards-compat became less of an issue. As for C++ jobs.. there's less VB jobs too but you might have noticed C++ jobs pay more than C#, get your priorities right :)
gbjbaanb
Qt has properties, events, foreach loops and plenty of other features added on top of vanilla C++ too. Qt's QObject system also makes a lot of memory management of Qt objects automatic. Basically, C# may have better productivity than C++, but productivity of Qt C++ is greater than plain old C++ too (not quite as much as C#, but still a mentionable amount)
Dan
+8  A: 

Declarative UI is Qt answer to WPF. Looks very promising.

Piotr Dobrogost
+22  A: 

Reading your concerns in your initial post, aaronc, I have to say that you almost answer the question for yourself. The right way to go is definitely Qt.

This past year has been a real revolution for Qt. First the Nokia acquisition of Trolltech (securing development funds for years to come...), then the new license (LGPL), and last but not least the complete opening of the source code and the friendly approach to a democratic roadmap.

I don't want to imply they are saints, Qt Software is a for-profit company as well. Neverthess they invest heavily into new easy tools that are code-proof for future cross-platform porting. Have you seen the new Qt Creator? Simply amazing.

The Qt toolkit is very strong and they enrich it continuously. Check out the new Embedded Widget Demos and the Declarative UI. This way you are even covered for WPF-like stuff.

So my advice is Qt all the way...

Good luck!

Kensai
-1. No mention of Qts recent troubles (e.g. Nokia dropping Jambi) or any of WPF's major advantages of Qt. Indeed, no technical information about WPF at all.
Jon Harrop
@Jon Harrop, why does every answer have to discuss both? Each poster can only write about what they know. It's up to aaronc to review posts discussing both sides, and decide.
Yawar
+4  A: 

There are a few points worth considering before making any decision

  • Qt is much faster than WPF. I don't think WPF can match its speed.
  • Qt style is the same as CSS, so you don't have to learn new things. In case of WPF, it is quite complicated.
  • Qt has an animation framework (currently as a separate project), WPF has DirectX.
  • Qt is cross platform, WPF is Windows-only, there is no WPF implementation open source (Mono).

You can use Qt with C#, either Qyoto or QT4dotnet.

There are a lot of things in Qt roadmap which look very promising, have a look at them, before you decide.

Sharique
-1. "Qt is faster" at what? citations? "Qt is easier": not IME. "WPF has DirectX" is just nonsense. WPF provides its own integrated 2D and 3D vector graphics with effects.
Jon Harrop
WPF is also cross-platform: You're forgetting Silverlight, a cross-platform implementation of a WPF subset that runs on Windows, Linux, MacOS, and some mobile devices. Silverlight currently has more capabilities than Qt even though it is much younger. And the gap is widening.
Ray Burns
@Ray: which capabilities are these? Be specific please, otherwise your comment doesn't really contribute much. What capabilities does WPF have that Qt doesn't? And if, as you say, Silverlight is a **subset** of WPF, then WPF itself is not cross-platform.
jalf
Ray Burns
A: 

Everything I can say is covered by the above posts already. However, I'm not sure if Qt is faster than WPF (as mentioned above also). It'll depend on what kind of GUI you are designing.

I do lean towards QT4 for your original question though.

+1  A: 

Warren Buffett's strategy/wisdom to pick stocks fits very well to choose WPF vs Qt.

One of his favorite picks is Coke Cola. Why? Coke Cola NEVER changes, need no new investment to innovate the product to make money.

Windows changes too much and too quick. You really need a very stable programming language to make a really good product in long term. C#/WPF is definitely not the long term stable programming language, while Qt has proven itself for longevity since 1991.

not really... the current release it QT4... the "4" in the name should say womething:)
Quamis
GDI/GDI+/MFC/Winforms/WPF/Silverlight/DirectShow/DirectDraw/Direct3d/XNA and now Direct2d. Qt may have 4 revisions to a single API, but that hardly counts as unstable.
gbjbaanb
I wouldn't agree with you comparing coca cola to software development. Coca cola is a product with some secret ingredients, protected by patents and has a big marketing campaign behind it, with some loyal consumers... therefore, a very inelastic product.
taoufik
The software market has much faster moving cycles, open for innovations and highly competitive. Therefore, if you'd stick with 'proven technology' from 20 years ago and not respond to the trends, there is a high chance you're going to loose market share on the long term. The software market is much more elastic, with minimal/no loyal consumers. To make it worse, consumers get bored easily with software, and we as developers should expect them to embrace new concepts.
taoufik
@gbjbaanb: DirectShow, DirectDraw, Direct3D, Direct2D and XNA complement each other and are not in any respect high level GUI frameworks like Qt or WPF. GDI+ is just an updated GDI; both MFC and Winforms use GDI for low-level drawing. And Silverlight is simply a slimmed down .NET-framework + parts of WPF. There have been a lot less transitions than you try to suggest with your list, it's essentially MFC -> WinForms -> WPF over the last ~ 18 years. The indermediary WinForms was probably unnecessary, true, but the switch from MFC to a managed high-level GUI framework (WPF) seems sensible to me.
Novox
@Novox: MFC was just a wrapper over win32 GUI, so perhaps we should discount that too? If you only want a editbox and a button, you're good - but that isn't the whole of GUI development. WPF after all, tries to deliver many non-form elements that would be addressed by lower level older APIs.
gbjbaanb
Win16/32 is what is called a "personality" of NT (and the native API of older versions of Windows), but not a GUI framework. Of course MFC had to built ontop of Win32. Still I don't see the point you're trying to make.
Novox
+4  A: 

I haven't used QT, but I don't like WPF very much. Yes, it results in a very beautiful end product, but at the expense of a fairly agonizing development process.

The Visual Studio WPF designer ("Cider") seems to have been intentionally lobotomized to steer buyers toward "Expression Blend." For example, it doesn't support preview of anything in a Viewbox, but a simple hack (creating one's own user control to wrap the Viewbox) allows the designer to work correctly! The only "problem" here is that Microsoft doesn't want their designer to be too useful and they intentionally removed functionality from it.

This is pure bait-and-switch, the kind of thing you'd expect from a low-life stereo salesman. You can argue technical merits all day (and WPF fails in this regard as well) but the way its marketed is well nigh unethical.

Another thing that I dislike about WPF is this claim that its got some monopoly on hardware acceleration. Anyone old enough to remember the "Windows accelerator" cards of the 1990s should see right through this... the express purpose of these accelerators (now present on any PC) was to offload Windows rendering to hardware. In particular, these efforts were directed at speeding up GDI32.DLL and the GUI portions of USER32.DLL. You can quibble over the nature of the interface, but to claim that the GUI pre-WPF was somehow "rendered in software" is just incorrect.

I don't know if Microsoft ever made this claim, but during the hype period before WPF was actually released (or escaped ;), I heard people claim that in Windows Vista, GDI, DirectX, etc. would simply be wrappers for (the now native) WPF. In actual fact, WPF calls have to traverse a CPU-melting series of wrapper functions (many of which have names reminiscent of ASP.NET) to get anywhere near the hardware.

I take issue as well with the way Microsoft is attempting to redefine the software engineering process via WPF. They are putting forward a vision where graphic artists lay out the UI in Expression Blend before coding begins. I think they're dead wrong about how WPF affects the role of a designer. In my experience, the capabilities of WPF liberate me from the need to consult a designer. WPF has built-in support for all sorts of things (gradients, alpha) that previously would have sent me scrambling for help from someone with a copy of PhotoShop.

Finally, I just don't find WPF pleasant to use. It feels like a step backward from, say, WinForms in almost every way: performance, price (remember, you're supposed to buy Blend and hire an artist), time-to-market, compatibility, etc. The only area I've found it superior is in producing a superficially more beautiful GUI.

Troy Bergstro
+18  A: 

Two years ago I was migrating a Visual Basic 6 application and had to decide between Qt and WPF. If I had chosen Qt, it would have been working with Python and the PyQt bindings. After working with both for a month, I ended up choosing WPF because of licensing costs. At the time, Qt only offered GPL or a paid commercial license (which was fairly expensive) and the PyQt license was an additional cost. With an LGPL option for the Qt license, the decision would have been different.

In terms of speed, I have found both Qt and WPF fast enough and from an end-user perspective there was no perceptible reason to favor one over the other.

Qt with PyQt was a very productive and fun way to build applications. The Qt libraries are very well thought out and have the feel of code that has been polished over a long time of real-world use, which makes sense given its history. The documentation is good, though tool support wasn't nearly as nice as Visual Studio (when using PyQt, I can't speak for C++), but having well thought-out libraries and a concise language eliminates a lot of the need for fancier tools.

Unlike some of the other comments, I found WPF to be fun to use as well. The declarative binding between your business logic and presentation templates reduces a lot of boilerplate code and allows for clean separation between model and view. It has some nifty features like thread-safe binding and a simple-to-use 3D library. On the other hand, Qt can match these features and it is cross-platform. Furthermore, WPF does have some rough edges and the documentation can be sparse, a lot of answers to quirks can only be found in the sea of blog posts and forum comments.

Given the change in licensing terms, if I had to make the same choice today, I would move forward with Qt (and Python for me because I'm not enough of a hero to write in C++). But, WPF is treating us well and still a pleasure to work with, so I can't say it's a bad choice.

gbc
You may think of using IronPython with WPF now.
Gulshan
+1. It would be great if more people speak from real world experience like you instead of speculations.
kizzx2
+7  A: 

Another thing you might want to consider is the availability of third-party controls (widgets) for the frameworks you are choosing between.

For WPF you already have many custom controls available (commercial and not) to extend your applications. Even if WPF is a relatively new technology compared to Windows Forms.

Oh, and the same applies to custom styles/themes.

I'm not very knowledgeable about Qt, but when I was evaluating it a few months ago I couldn't find much in either department.

wpf.cc
+3  A: 

Since you mentioned real-time data capture, you have to be very careful with .NET, which is running on top of garbage collected runtime. I don't think there is a guarantee of upper latency limit, if you develop in managed code. You will have to cross to native code or use 3rd party products to guarantee capture of all your real-time events.

Paul Jurczak
The .NET GC is concurrent so you just need to make sure any soft-realtime threads do not allocate heavily and they will never be stalled for a significant amount of time.
Jon Harrop
In real-time data capture scenario, "never be stalled for a significant amount of time" may not be good enough. You may need strict guarantees of maximum latency, say 10us. I'm a little bit skeptical whether .NET GC can provide them.
Paul Jurczak
If you need strict guarantees of maximum latency measured in microseconds, you need to consider very carefully whether a general-purpose computer system can provide them no matter what language you use, or whether you need a real-time operating system. It's been a long time since you had full control of the hardware on a standard PC even programming in assembler.
rwallace
+23  A: 

The GNU LGPL does not force you to share any code, not even when static linking. It is a common belief - you just have to provide a way for the user to link their own copy of Qt with your application and debug it; DLLs already provide this, with static linking you can provide object files.

Qt provides EXTENSIVE features for all supported platforms. The biggest that come to my mind are Qt Concurrent and threading APIs, WebKit, Qt Script and of course, Qt GUI. The fact that C++ is dying is because most people think of C++ as the crap code floating around written using only native low-level APIs, MFC or similar libraries/tools. Qt is a modern and stable development framework that's been around for a really long time. Nokia did not acquire it just for their devices, since their devices are just NOT POWERFUL enough to handle the advanced Qt features, notably Qt WebKit - WebKit itself is really a hog and is not targeted towards embedded development.

Qt is consistently getting more features. For example 4.5 brought a Cocoa port, XSLT, ODF. It also brought a new raster engine that is, get this, STUPIDLY FAST, as well as an OpenGL (ES) 2.0 engine for hardware accelerated graphics. 4.6 has brought an animation framework, a state machine, and an EXTREMELY fast JavaScript engine inherited from WebKit, for WebKit itself and Qt Script - SquirrelFish Extreme is currently the fasted JavaScript engine, beating Chrome's V8; 4.7 brings Qt's version of WPF, called Qt Quick, with a declarative language (QML, based on JavaScript), QtDeclarative module (which integrates with the Graphics View framework and has APIs to bind custom C++ objects to QML), extended networking APIs and improvements to the WebKit module (and updated WebKit code).

What does WPF provide as a browser widget? Trident. Thank you very much, right now Trident is one of the slowest engines in all aspects, though I hear that work is in progress to dramatically improve performance. All a good choice to shoot yourself in the foot when you want to port your software to another program, especially the rapidly growing market of embedded devices - you are basically locked to Windows CE/Mobile, whereas Qt has been ported to Windows CE/Mobile, Embedded Linux, Symbian S60 and Maemo is coming soon. Qt has the most extensive platform support I've seen - see the list in the Qt documentation.

Even though Qt provides some very high-level APIs, it is VERY fast, and when speed is critical, it allows you to go as low-level as you want, potentially even assembly. Alien widgets provide flicker-less fast rendering, however, you are free to request a native widget - just set a flag. For concurrent programming you have threading primitives like mutex, read-write lock, wait conditions, semaphores, as well gradually higher-level APIS - thread pools for example, ending with Qt Concurrent. Signals and slots are an invaluable way to pass data between objects in a thread-safe manner without any locking, relying on the event loop to safely deliver all events and signals.

Qt is extensible as hell. You can subclass practically all classes, and if that way you are unable to perform an operation, you are provided with full source code for all platforms and rights to modify it to your needs on all licensing options. Furthermore, Qt guarantees backwards binary compatibility across minor versions and forwards AND backwards binary compatibility across patch versions (of course, code depending on a fixed bug will not work on versions with the bug; X.Y.Z --> X = major; Y = minor; Z = patch). Tools are also provided to gracefully move to major revisions at your own pace: Qt 4 includes a tool to migrate Qt 3 code to Qt 4 code AND a Qt 3 support module, implementing the whole Qt 3 API (unless the Qt 4 version of the class is fully compatible with the old one), thus your old code is always safe.

I argue that Qt is an application development framework, unlike WPF which is just a GUI part of .NET. Qt includes many non-GUI modules: Core, Network, SQL, XML, Script, and more. All provide both low-level APIs (QIODevice, QTcpSocket) and high-level APIs (QTextStream, QNetworkAccessManager). The documentation is a subjective part, but in my opinion I believe that it is very good and extensive, and when the documentation is not enough, the community is always there to help, as well as Nokia's support contracts.

P.S.: I do not have any .NET experience, I have just stated why I believe Qt is often a much better choice over .NET. There are exceptions to everything and .NET excels in many areas as well; nothing is perfect, you have to pick the right tool for the job. I have tried to list all the advantages of Qt I can think of and why it is a great toolkit. Please consult the Qt documentation at http://qt.nokia.com/doc/4.6/index.html for all the details and remember than Qt is a toolkit, it includes several tools: Qt Creator (IDE), Qt Designer (GUI designer), qmake (build system), Qt Linguist (translator) to name a few.

iconiK
+1 for pointing out that Qt is actually an application framework, not only a GUI framework
Novox
@Novos and now with 4.7 it has an equivalent of WPF in the form of Qt Quick.
iconiK
WPF is just a part of .NET. And you would argue that .NET is not an application framework ? Network, SQL, XML...everything is also in .NET, so what is the difference ?
Aurélien Ribon
@Aurélien, I know that, but aaronc thought Qt was just a GUI library, so I had to clarify that Qt is an application framework as well.
iconiK
+1  A: 

I believe that the only reason you should consider is the number of components available for your framework, if you do not want to cross platform (in that case you have to choose Qt). Windows Forms and WPF have several third party components, eventually for everything you need. Qt framework is probably the best in terms of design and surely can give you better visual experience, but it still lacks professional addons (try to realize a component to access your USB device for example, or try to realize professional charts, such as the Dundas ones, etc.).

brasi
A: 

I agree with Mihai that adding 3rd party plugins can make the application i.e next window version a lot more flexible.I have used open source search platforms like Solr (http://www.lucidimagination.com/Downloads/LucidWorks-for-Solr/Reference-Guide ) which enable addition of 3rd party plugins. This feature is definitely an asset for an application and worth a consideration.

Adam
+4  A: 

Qt is really fast. So if you want the best performance and are willing to live without garbage collection and a larger class library, go with Qt.

Qt has a nice way of hooking up events using Ports, but there is a preprocessor called the Meta Object Compiler that gets run on your source code. It's so fast that you won't notice a delay in compilation, but you should be aware that it does require this extra level of complexity, in that the auto-generated makefiles build "moc_"... files for each of your classes that derive from QObject, and the debugger traces through them when messages are being sent. It's an elegant system, though, if you want maximum execution speed with your flexibility, since this is compiled C++, not interpreted C# (through the CLR).

On the other hand, WPF can be more productive, once you put in the effort to learn its way of doing things. And yes, it's plenty fast enough for most applications. For a true "real-time" system, C++ will give you better predictability, but you'll want to consider the OS you're running on, not just the language you're using to implement the app.

C# code (and any other CIL assembly) is not interpreted if run on the CLR (and on Mono), but JIT compiled to machine code.
Novox
A: 

I don't see how QT will become more popular than MFC. There is another framework called WTL that did not gain much traction. I see MFC losing ground to Forms and WPF despite some performance issues of the latter two. Check: http://www.codeproject.com/KB/dotnet/RuntimePerformance.aspx

dmihailescu
+2  A: 

I think MS's commitment to WPF was shown by rewriting much of VS2010 in it. You can't get much more than an endorsement. My experience with WPF is very good as well, it's pretty well thought out.

kenny
Unfortunately, VS2010 is hardly a shining beacon of WPF's superiority. It is sloooow and sluggish, even more so than VS2k8.
jalf
I agree about 10 being a pig, certainly rushed out.
kenny
I recall it mostly be because it's not at all rewritten, just parts of it, and the interop calls takes away all the possibility of a performance increase for now?
Oskar Duveborn
SLow, slow... Launching Netbeans or Eclipse will tell you what is a slow start for an IDE.
Aurélien Ribon
+1  A: 

As a company manager I would choose QT, though I have no experience in it, but I have too many negative .NET development experience in past 3 years.

As a professional programmer I would definitely choose WPF, much more jobs available, very easy to find a job.

As a hobbyist programmer (the one who code for fun\self) I would go QT, less bugs, faster execution, potentially better application.

In short: If the goal is application quality - go QT if the goal is make money for living - go WPF

Broken Pipe
+1  A: 

Qt will definitely become the de facto framwork to use on any linux bases OSes. Mono simply does not provide enough compatitiblity to .NET and also WPF cannot be directly ported over to linux because it uses DirectX as it rendering API.There is nothing wrong in staying with C++/Qt if cross platform compatibility is needed. But if you only intend to target Windows and your application is not graphically intensive (like 3D rendering or Games) WPF/C# is the way to go.

Potato