PDA

View Full Version : In short What are the things that make QT4 BETTER than QT3?



locus
8th March 2007, 07:13
I am trying to take the mystery (to me) out of why QT4 is better than qt3.

I spent hours porting an application to QT4 but i'm still a bit ignorant as to why i did it.

I would like to write something about the powers of QT4 in the report on my project.

So could someone tell me, or direct me to articles that clearly list and explain why qt4 is better

example:

Does the qt4 API give better performance in terms of speed,and how does one take advantage of that?

what exactly does this statement on the model/view architecture mean? and why is it such an improvement? (from qt assistant: What's new in QT 4)


Since the model takes responsibility for supplying items of data, and the view takes care of their presentation to the user, we do not require item classes to represent individual items. Delegates handle the painting and editing of data obtained from the model.

How exactly does


a modern action-based mainwindow, toolbar, menu, and docking architecture.

provide


a more consistent and efficient framework for main window management.

what were the problems with how the mainwindow code was written in qt3?

Is the new API faster in anyway?

If so, in what way, what aspects of it makes it faster?

Please feel free to be as generous as possible with your response.

Thanks in advance for your attention and time.

Teuniz
8th March 2007, 09:01
Excelent question, I want to know this as well. I spent a lot of time in porting my old Qt3
code to Qt4 because in Qt4 it's not possible anymore to paint on a widget outside a
paintevent. The reason I moved to Qt4 is that the GPL-version of Qt3 is not available for
Windows.

Regards.

wysota
8th March 2007, 12:05
I spent hours porting an application to QT4 but i'm still a bit ignorant as to why i did it.
So what motivated you to do it?


Does the qt4 API give better performance in terms of speed,and how does one take advantage of that?
Yes, is many situations Qt4 is faster than Qt3. You don't have to do anything to take advantage of that - it's all under the hood.


what exactly does this statement on the model/view architecture mean? and why is it such an improvement? (from qt assistant: What's new in QT 4)
Most applications nowadays are data driven, which means that the application focuses on processing some data. MVC gives you an ability to access and manipulate data in a consistent way and display/manipulate the data through the use of standard or custom views, which you don't have to rewrite from scratch every time you need to obtain a different behaviour or are using different data model. In short, it makes data manipulation more flexible, less error prone and time consuming.


How exactly does
a modern action-based mainwindow, toolbar, menu, and docking architecture provide
a more consistent and efficient framework for main window management.
In Qt3 the main window architecture was a bit messed up. The functionality that should have been in the main window itself was handled by different classes and vice versa. In Qt4 it's more intuitive and more loosely coupled.


what were the problems with how the mainwindow code was written in qt3?
Oh, I think I already answered that :)


Is the new API faster in anyway?
First of all it has much more capabilities. The faster/slower aspect is not so important as Qt is quite fast itself.

The difference in major number suggests that the changes were (are) really big, therefore try to spot the whole image instead of looking at small pieces and comparing changes. For instance look at the differences in internals of the whole drawing framework (QPainter based) - Qt4 gave us many new possibilities thanks to changes in how it is implemeneted internally.

yop
9th March 2007, 08:25
foreach() and QCoreApplication alone would make me switch in no time (and I did)

Brandybuck
10th March 2007, 04:28
Thereare a lot of changes between Qt3 and Qt4. The main change, however, is a complete refactoring of the libraries. Painting is more efficient, collections are more efficient, views are more efficient, etc. Even the API is easier to use and understand.

But you can't sell the customer on refactoring alone. You need new bells and whistles to entice the purchasing managers. So...


Model/View classes. Handle large amounts of data, multiple views on a model, delegates, etc.

Arthur painting engine. Transparency, double buffering, anti-aliasing, etc.

Revamped rich text engine. Cursor based editing, structured documents, etc.

QGraphicsView. This is QCanvas++

Java style iterators, plus full STL compatibility.

Signal/slots across threads, and other improvements to multithreading.

The library is split into multiple modules (core, gui, network, xml, etc).

Easier drag and drop, improved UI use, QDoubleSlider, etc., etc.