Obsolete Members for QMetaMethod

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

公共函数

(弃用) bool invoke (QObject * object , Qt::ConnectionType connectionType , QGenericReturnArgument returnValue , 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()) const
(弃用) bool invoke (QObject * object , QGenericReturnArgument returnValue , 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()) const
(弃用) bool invoke (QObject * object , Qt::ConnectionType connectionType , 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()) const
(弃用) bool invoke (QObject * object , 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()) const
(弃用) bool invokeOnGadget (void * gadget , QGenericReturnArgument returnValue , 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()) const
(弃用) bool invokeOnGadget (void * gadget , 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()) const

成员函数文档编制

bool QMetaMethod:: invoke ( QObject * object , Qt::ConnectionType connectionType , QGenericReturnArgument returnValue , 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()) const

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

Please use the variadic overload of this function

Invokes this method on the object object 。返回 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 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

QMetaMethod::invoke: Unable to handle unregistered datatype 'MyType'
					

call qRegisterMetaType () to register the data type before you call QMetaMethod::invoke().

警告: In addition to the limitations of the variadic invoke() overload, the arguments must have the same type as the ones expected by the method, else, the behavior is undefined.

另请参阅 Q_ARG (), Q_RETURN_ARG (), qRegisterMetaType (),和 QMetaObject::invokeMethod ().

bool QMetaMethod:: invoke ( QObject * object , QGenericReturnArgument returnValue , 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()) const

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

Please use the variadic overload of this function

This function overloads invoke().

This overload always invokes this method using the connection type Qt::AutoConnection .

bool QMetaMethod:: invoke ( QObject * object , Qt::ConnectionType connectionType , 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()) const

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

Please use the variadic overload of this function

This function overloads invoke().

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

bool QMetaMethod:: invoke ( QObject * object , 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()) const

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

Please use the variadic overload of this function

This function overloads invoke().

This overload invokes this method using the connection type Qt::AutoConnection 并忽略返回值。

bool QMetaMethod:: invokeOnGadget ( void * gadget , QGenericReturnArgument returnValue , 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()) const

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

Please use the variadic overload of this function

Invokes this method on a Q_GADGET 。返回 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.

警告: In addition to the limitations of the variadic invoke () overload, the arguments must have the same type as the ones expected by the method, else, the behavior is undefined.

另请参阅 Q_ARG (), Q_RETURN_ARG (), qRegisterMetaType (),和 QMetaObject::invokeMethod ().

bool QMetaMethod:: invokeOnGadget ( void * gadget , 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()) const

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

这是重载函数。

Please use the variadic overload of this function

这重载援引此方法为 gadget 并忽略返回值。