Obsolete Members for QObject

以下成员源于类 QObject 已过时。 提供它们是为使旧源代码能继续工作。强烈建议不要在新代码中使用它们。

公共函数

(obsolete) void dumpObjectInfo ()
(obsolete) void dumpObjectTree ()

静态公共成员

(obsolete) QString trUtf8 (const char * sourceText , const char * disambiguation = Q_OBJECT, int n = Q_OBJECT)

相关非成员

(obsolete) T qFindChild (const QObject * obj , const QString & name = QString())
(obsolete) QList<T> qFindChildren (const QObject * obj , const QString & name = QString())

(obsolete) Q_ENUMS ( ... )
(obsolete) Q_FLAGS ( ... )

成员函数文档编制

void QObject:: dumpObjectInfo ()

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

这是重载函数。

将有关此对象的信号连接等信息转储到调试输出。

另请参阅 dumpObjectTree ().

void QObject:: dumpObjectTree ()

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

这是重载函数。

将子级树转储到调试输出。

另请参阅 dumpObjectInfo ().

[static] QString QObject:: trUtf8 (const char * sourceText , const char * disambiguation = Q_OBJECT, int n = Q_OBJECT)

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

返回翻译版本的 sourceText ,或 QString::fromUtf8 ( sourceText ) if there is no appropriate version. It is otherwise identical to tr( sourceText , disambiguation , n ).

警告: 此方法才可重入若有安装所有翻译器 before 调用此方法。不支持在履行翻译时,安装或移除翻译器。这样做可能会导致崩溃或其它不期望行为。

警告: For portability reasons, we recommend that you use escape sequences for specifying non-ASCII characters in string literals to trUtf8(). For example:

label->setText(tr("F\374r \310lise"));
					

另请参阅 tr (), QCoreApplication::translate (),和 Qt 国际化 .

相关非成员

T qFindChild (const QObject * obj , const QString & name = QString())

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

此函数重载 qFindChildren ().

此函数相当于 obj -> findChild <T>( name ).

注意: 此函数是为不支持成员模板函数的 MSVC 6 提供的解决方案。建议在新代码中使用其它形式。

另请参阅 QObject::findChild ().

QList < T > qFindChildren (const QObject * obj , const QString & name = QString())

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

此函数重载 qFindChildren ().

此函数相当于 obj -> findChildren <T>( name ).

注意: 此函数是为不支持成员模板函数的 MSVC 6 提供的解决方案。建议在新代码中使用其它形式。

另请参阅 QObject::findChildren ().

宏文档编制

Q_ENUMS ( ... )

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

This macro registers one or several enum types to the meta-object system.

例如:

class MyClass : public QObject
{
    Q_OBJECT
public:
    MyClass(QObject *parent = 0);
    ~MyClass();
    enum Priority { High, Low, VeryHigh, VeryLow };
    Q_ENUM(Priority)
    void setPriority(Priority priority);
    Priority priority() const;
};
					

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().

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().

另请参阅 Qt 的特性系统 .

Q_FLAGS ( ... )

此函数已过时。提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

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 的特性系统 .