9

There's nothing perfect under the sun. Qt is no exception, and it does have limitations: we can't use pixmaps in a thread other than GUI, we can't use QImage with 16-bit-per-channel image format, etc..

Which situations have forced you to spoil the design because of Qt's limitations?
What are the most hated quirks?
Which design decisions should one avoid while using Qt in his projects?

Doc Brown
  • 218,378
vines
  • 1,186

4 Answers4

12

Ironically, I'd say Qt's power is also one of the drawbacks. There are so many powerful constructions and extensions, code you write in Qt easily becomes highly entrenched in the "Qt way". Trying to extract functionality into another language not only means a re-write, you need to know a lot of Qt-specific technology.

Qt's breadth means that hiring programmers means either committing to someone with Qt experience, or training for that expertise. Getting a contractor in and up to speed is harder than vanilla C++.

When Qt changed from 3.x to 4.x, our team required almost 9 months to do the port, during which time little new functionality was added. You hope to make up that major upgrade cost in increased development efficiency the rest of the time. (Note, I've omitted the advantages of Qt, of which there are also many)

James C
  • 306
  • 2
  • 5
10

Qt does not use the standard C++ library, but has its own QString, QVector, QMap, ...

This means you have to make an important design decision: what parts of the application will use QString and which parts will use std::string?

Using std::string in some parts and QString in other parts, means you'll have to convert between QString and std::string on the bounderies.

To avoid that overhead, one could decide to use QString all over your application. But that makes it much harder to use 3rd party libraries that are not based on Qt, e.g. boost.

(Note that the same applies to std::map vs QMap, std::vector vs QVector, and so on)

Deciding which parts use Qt's types and which parts use the STL is a major design decision, with major implications. And only because Qt refuses to use the standard C++ libary.

IMHO, that decision could go either way, depending on the project. So I cannot answer your question which one to avoid.

Sjoerd
  • 2,966
3

This doesn't directly answer the question, but I think it's worth mentioning: perhaps the most 'dangerous' aspect of Qt is that Nokia has gotten into bed with MSoft...

Vector
  • 3,241
2

Recently I found out that a QChar, despite its name, does not actually correspond to one character but to a UTF-16 code unit. Thus, when you want to scan an arbitrary Unicode text character by character, you have to add algorithms for dealing with high and low surrogates, combining characters and the like.