以下成員源於類 QObject 被棄用。 提供它們是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它們。
(棄用)
|
Q_ENUMS (...) |
(棄用)
|
Q_FLAGS (...) |
[deprecated]
Q_ENUMS
(...)
This macro is deprecated. We strongly advise against using it in new code.
In new code, you should prefer the use of the Q_ENUM () macro, which makes the type available also to the meta type system. For instance, QMetaEnum::fromType () will not work with types declared with Q_ENUMS().
This macro registers one or several enum types to the meta-object system.
If you want to register an enum that is declared in another class, the enum must be fully qualified with the name of the class defining it. In addition, the class defining the enum has to inherit QObject as well as declare the enum using Q_ENUMS().
另請參閱 Qt 的特性係統 .
[deprecated]
Q_FLAGS
(...)
This macro is deprecated. We strongly advise against using it in new code.
This macro registers one or several flags types with the meta-object system. It is typically used in a class definition to declare that values of a given enum can be used as flags and combined using the bitwise OR operator.
注意: This macro takes care of registering individual flag values with the meta-object system, so it is unnecessary to use Q_ENUMS () 除此宏外。
In new code, you should prefer the use of the Q_FLAG () macro, which makes the type available also to the meta type system.
另請參閱 Qt 的特性係統 .