Obsolete Members for QMetaObject

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

公共函数

(弃用) QObject * newInstance (QGenericArgument val0 , QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument()) const

静态公共成员

(弃用) bool invokeMethod (QObject * obj , const char * member , Qt::ConnectionType type , QGenericReturnArgument ret , QGenericArgument val0 = QGenericArgument(nullptr), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument())
(弃用) bool invokeMethod (QObject * obj , const char * member , QGenericReturnArgument ret , QGenericArgument val0 = QGenericArgument(0), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument())
(弃用) bool invokeMethod (QObject * obj , const char * member , Qt::ConnectionType type , QGenericArgument val0 = QGenericArgument(0), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument())
(弃用) bool invokeMethod (QObject * obj , const char * member , QGenericArgument val0 = QGenericArgument(0), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument())

成员函数文档编制

[static, deprecated] bool QMetaObject:: invokeMethod ( QObject * obj , const char * member , Qt::ConnectionType type , QGenericReturnArgument ret , QGenericArgument val0 = QGenericArgument(nullptr), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument())

This function is deprecated. We strongly advise against using it in new code.

这是重载函数。

Please use the variadic overload of this function

援引 member (信号或槽名称) 在对象 obj 。返回 true 若成员可以被援引。返回 false 若没有这样的成员或参数不匹配。

See the variadic invokeMethod() function for more information. This function should behave the same way as that one, with the following limitations:

  • The number of parameters is limited to 10.
  • Parameter names may need to be an exact string match.
  • Meta types are not automatically registered.

With asynchronous method invocations, the parameters must be of types that are already known to Qt's meta-object system, because Qt needs to copy the arguments to store them in an event behind the scenes. If you try to use a queued connection and get the error message

QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
					

call qRegisterMetaType () 以在调用 invokeMethod() 之前注册数据类型。

注意: 此函数是 thread-safe .

另请参阅 Q_ARG (), Q_RETURN_ARG (), qRegisterMetaType (),和 QMetaMethod::invoke ().

[static, deprecated] bool QMetaObject:: invokeMethod ( QObject * obj , const char * member , QGenericReturnArgument ret , QGenericArgument val0 = QGenericArgument(0), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument())

This function is deprecated. We strongly advise against using it in new code.

Please use the variadic overload of this function.

此函数重载 invokeMethod()。

此重载总是援引成员使用连接类型 Qt::AutoConnection .

注意: 此函数是 thread-safe .

[static, deprecated] bool QMetaObject:: invokeMethod ( QObject * obj , const char * member , Qt::ConnectionType type , QGenericArgument val0 = QGenericArgument(0), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument())

This function is deprecated. We strongly advise against using it in new code.

Please use the variadic overload of this function.

此函数重载 invokeMethod()。

此重载可以被使用,若对成员的返回值不感兴趣。

注意: 此函数是 thread-safe .

[static, deprecated] bool QMetaObject:: invokeMethod ( QObject * obj , const char * member , QGenericArgument val0 = QGenericArgument(0), QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument())

This function is deprecated. We strongly advise against using it in new code.

Please use the variadic overload of this function.

此函数重载 invokeMethod()。

此重载援引成员使用连接类型 Qt::AutoConnection 并忽略返回值。

注意: 此函数是 thread-safe .

[deprecated] QObject *QMetaObject:: newInstance ( QGenericArgument val0 , QGenericArgument val1 = QGenericArgument(), QGenericArgument val2 = QGenericArgument(), QGenericArgument val3 = QGenericArgument(), QGenericArgument val4 = QGenericArgument(), QGenericArgument val5 = QGenericArgument(), QGenericArgument val6 = QGenericArgument(), QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument()) const

This function is deprecated. We strongly advise against using it in new code.

Please use the variadic overload of this function

Constructs a new instance of this class. You can pass up to ten arguments ( val0 , val1 , val2 , val3 , val4 , val5 , val6 , val7 , val8 ,和 val9 ) to the constructor. Returns the new object, or nullptr if no suitable constructor is available.

Note that only constructors that are declared with the Q_INVOKABLE modifier are made available through the meta-object system.

另请参阅 Q_ARG () 和 constructor ().