3

I recently started on a new project where we will be using Qt to create the GUI. Without getting into details, it has been mandated by management that we use Qt 4.7. There are no valid reasons for this decision. We are not porting any existing code to Qt 5, this is all new implementation. I am the UI lead for the project and I need to make a case for using Qt 5.1.

I am going to explain why the concerns held by some of the engineers about moving to 5.1 are not legitimate, but I would also like to strengthen my case by giving specific reasons that we should use Qt 5.1 over 4.7. My main reason behind wanting to use 5.1 is just that it's the latest version with many improvements over 4.7. While this reason is valid, I would appreciate it if anybody who is familiar with the differences between Qt 4.7+ compared to 5.0+ would help me come up with some specific reasons. I have not used Qt 5 yet myself. We will be using widgets either way, not QtQuick/QML, so please only consider differences pertaining to Qt widgets.

4

1 回答 1

2

Qt 5.1 比 Qt 4.7 或 4.8 有几个新特性。我猜其中一个重要的就是信号和槽的新语法,它将提供:

  1. 编译时检查信号和槽的存在、类型或 Q_OBJECT 是否丢失,这意味着如果您拼错了信号或槽名称,或者槽的参数与那些不匹配,您将收到编译器错误从信号。这可能会在您进行重构和更改信号或插槽的名称或参数时为您节省一些时间。
  2. 可以连接到 QObject 的任何成员函数,而不仅仅是插槽。
  3. 新语法甚至可以连接到函数,而不仅仅是 QObjects。

它还为 C++11 提供了一些新的支持

更多检查这些:

http://woboq.com/blog/new-signals-slots-syntax-in-qt5.html

http://woboq.com/blog/cpp11-in-qt5.html

于 2013-08-23T00:10:54.400 回答