QMetaObject Struct

QMetaObject 클래스는 Qt 객체에 대한 메타 정보를 포함합니다. 더 보기...

Header: #include <QMetaObject>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core

공용 타입

class Connection

공용 함수

QMetaClassInfo classInfo(int index) const
int classInfoCount() const
int classInfoOffset() const
const char *className() const
QMetaMethod constructor(int index) const
int constructorCount() const
QMetaEnum enumerator(int index) const
int enumeratorCount() const
int enumeratorOffset() const
int indexOfClassInfo(const char *name) const
int indexOfConstructor(const char *constructor) const
int indexOfEnumerator(const char *name) const
int indexOfMethod(const char *method) const
int indexOfProperty(const char *name) const
int indexOfSignal(const char *signal) const
int indexOfSlot(const char *slot) const
bool inherits(const QMetaObject *metaObject) const
(since 6.2) QMetaType metaType() const
QMetaMethod method(int index) const
int methodCount() const
int methodOffset() const
(since 6.5) QObject *newInstance(Args &&... arguments) const
QMetaProperty property(int index) const
int propertyCount() const
int propertyOffset() const
const QMetaObject *superClass() const
QMetaProperty userProperty() const

정적 공용 멤버

bool checkConnectArgs(const char *signal, const char *method)
bool checkConnectArgs(const QMetaMethod &signal, const QMetaMethod &method)
void connectSlotsByName(QObject *object)
(since 6.7) bool invokeMethod(QObject *context, Functor &&function, Args &&... arguments)
bool invokeMethod(QObject *context, Functor &&function, FunctorReturnType *ret)
(since 6.5) bool invokeMethod(QObject *obj, const char *member, Args &&... args)
(since 6.7) bool invokeMethod(QObject *context, Functor &&function, QTemplatedMetaMethodReturnArgument<FunctorReturnType> ret, Args &&... arguments)
(since 6.7) bool invokeMethod(QObject *context, Functor &&function, Qt::ConnectionType type, Args &&... arguments)
bool invokeMethod(QObject *context, Functor &&function, Qt::ConnectionType type = Qt::AutoConnection, FunctorReturnType *ret = nullptr)
(since 6.5) bool invokeMethod(QObject *obj, const char *member, QTemplatedMetaMethodReturnArgument<ReturnArg> ret, Args &&... args)
(since 6.5) bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, Args &&... args)
(since 6.7) bool invokeMethod(QObject *context, Functor &&function, Qt::ConnectionType type, QTemplatedMetaMethodReturnArgument<FunctorReturnType> ret, Args &&... arguments)
(since 6.5) bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QTemplatedMetaMethodReturnArgument<ReturnArg> ret, Args &&... args)
QByteArray normalizedSignature(const char *method)
QByteArray normalizedType(const char *type)

매크로

QMetaMethodArgument Q_ARG(Type, const Type &value)
QMetaMethodReturnArgument Q_RETURN_ARG(Type, Type &value)

상세 설명

Qt의 메타 객체 시스템은 시그널과 슬롯의 객체간 통신 메커니즘, 런타임 타입 정보, Qt 프로퍼티 시스템을 담당합니다. 응용 프로그램에서 사용되는 각 QObject 서브클래스마다 하나의 QMetaObject 인스턴스가 생성되며, 이 인스턴스는 QObject 서브클래스에 대한 모든 메타 정보를 저장합니다. 이 객체는 QObject::metaObject()로 사용할 수 있습니다.

이 클래스는 일반적으로 애플리케이션 프로그래밍에 필요하지 않지만 스크립팅 엔진이나 GUI 빌더와 같은 메타 애플리케이션을 작성하는 경우 유용합니다.

가장 유용하게 사용할 수 있는 함수는 다음과 같습니다:

인덱스 함수 indexOfConstructor(), indexOfMethod(), indexOfEnumerator() 및 indexOfProperty()는 생성자, 멤버 함수, 열거자 또는 프로퍼티의 이름을 메타 객체의 인덱스에 매핑합니다. 예를 들어, Qt XML은 신호를 슬롯에 연결할 때 내부적으로 indexOfMethod()를 사용합니다.

클래스는 QMetaClassInfo 객체에 저장된 추가 클래스 정보의 이름-값 쌍 목록을 가질 수도 있습니다. 쌍의 수는 classInfoCount(), 단일 쌍은 classInfo()로 반환되며, indexOfClassInfo()로 쌍을 검색할 수 있습니다.

참고: 메타 객체 시스템은 일반적으로 컴파일 시 생성되는 정적 읽기 전용 인스턴스이므로 메타 객체 시스템을 사용하는 작업은 일반적으로 스레드에 안전합니다. 그러나 메타 객체가 애플리케이션에 의해 동적으로 수정되는 경우(예: QQmlPropertyMap)에는 애플리케이션이 해당 메타 객체에 대한 액세스를 명시적으로 동기화해야 합니다.

QMetaClassInfo, QMetaEnum, QMetaMethod, QMetaProperty, QMetaType, 및 메타 객체 시스템을참조하세요 .

멤버 함수 문서

[static, since 6.5] template <typename... Args> bool QMetaObject::invokeMethod(QObject *obj, const char *member, Args &&... args)

[static, since 6.5] template <typename ReturnArg, typename... Args> bool QMetaObject::invokeMethod(QObject *obj, const char *member, QTemplatedMetaMethodReturnArgument<ReturnArg> ret, Args &&... args)

[static, since 6.5] template <typename... Args> bool QMetaObject::invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, Args &&... args)

[static, since 6.5] template <typename ReturnArg, typename... Args> bool QMetaObject::invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QTemplatedMetaMethodReturnArgument<ReturnArg> ret, Args &&... args)

객체 obj 에서 member (신호 또는 슬롯 이름)을 호출합니다. 멤버를 호출할 수 있으면 true 을 반환합니다. 해당 멤버가 없거나 매개변수가 일치하지 않으면 false 을 반환합니다.

QTemplatedMetaMethodReturnArgument 매개변수가 있는 오버로드의 경우 member 함수 호출의 반환 값은 ret 에 배치됩니다. 이러한 멤버가 없는 오버로드의 경우 호출된 함수의 반환값(있는 경우)이 버려집니다. QTemplatedMetaMethodReturnArgument는 직접 사용해서는 안 되는 내부 유형입니다. 대신 qReturnArg() 함수를 사용하세요.

Qt::ConnectionType type 매개변수가 있는 오버로드를 사용하면 호출이 동기식인지 아닌지를 명시적으로 선택할 수 있습니다:

  • typeQt::DirectConnection 인 경우 현재 스레드에서 멤버가 즉시 호출됩니다.
  • typeQt::QueuedConnection 인 경우 QEvent 가 전송되고 애플리케이션이 obj 이 생성되었거나 이동된 스레드의 이벤트 루프에 진입하자마자 멤버가 호출됩니다.
  • typeQt::BlockingQueuedConnection 인 경우 메서드는 Qt::QueuedConnection 와 동일한 방식으로 호출되지만 이벤트가 전달될 때까지 현재 스레드가 차단된다는 점을 제외하면 호출됩니다. 이 연결 유형을 사용하여 동일한 스레드에 있는 객체 간에 통신하면 교착 상태가 발생할 수 있습니다.
  • typeQt::AutoConnection 인 경우 obj 가 호출자와 같은 스레드에 있으면 멤버가 동기적으로 호출되고, 그렇지 않으면 비동기적으로 호출됩니다. 이것이 type 매개 변수가 없는 오버로드의 동작입니다.

이 함수에는 전체 서명이 아니라 신호 또는 슬롯의 이름만 전달하면 됩니다. 예를 들어 QThread 에서 quit() 슬롯을 비동기적으로 호출하려면 다음 코드를 사용합니다:

QMetaObject::invokeMethod(thread, "quit",
                          Qt::QueuedConnection);

비동기 메서드 호출의 경우, 매개변수는 복사 가능한 유형이어야 합니다. 왜냐하면 Qt는 인수를 복사하여 백그라운드에서 이벤트에 저장해야 하기 때문입니다. Qt 6.5부터 이 함수는 사용 중인 형을 자동으로 등록하지만, 부작용으로 포워드 선언만 된 형을 사용하여 호출할 수 없습니다. 또한 정규화되지 않은 유형에 대한 참조를 매개변수로 사용하는 비동기 호출도 불가능합니다.

임의의 객체 obj 에서 compute(QString, int, double) 슬롯을 동기적으로 호출하려면 반환값을 검색하세요:

QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
                         qReturnArg(retVal),
                         QString("sqrt"), 42, 9.7);

"계산" 슬롯이 지정된 순서대로 QString, int, double 를 정확히 하나씩 받지 않으면 호출이 실패합니다. 문자 리터럴이 정확히 일치하는 유형이 아니므로 QString 의 유형을 명시해야 한다는 점에 유의하세요. 대신 메서드가 QStringView, qsizetype, float 를 받는다면 호출은 다음과 같이 작성해야 합니다:

QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
                         qReturnArg(retVal),
                         QStringView("sqrt"), qsizetype(42), 9.7f);

다음과 같이 Q_ARG() 및 Q_RETURN_ARG() 매크로를 사용하여 동일한 호출을 실행할 수 있습니다:

QString retVal;
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
                          Q_RETURN_ARG(QString, retVal),
                          Q_ARG(QString, "sqrt"),
                          Q_ARG(int, 42),
                          Q_ARG(double, 9.7));

매크로는 Qt 6.4 및 이전 버전과의 호환성을 위해 유지되며, 매크로를 사용하지 않는 매개변수와 자유롭게 혼합할 수 있습니다. 매크로는 매개변수나 반환 유형으로 typedef에서 포워드 선언된 유형을 사용하는 메서드를 호출할 때 드물게 필요할 수 있습니다.

참고: 이 함수는 스레드 안전합니다.

이 함수는 Qt 6.5에 도입되었습니다.

Q_ARG(), Q_RETURN_ARG() 및 QMetaMethod::invoke()도 참조하십시오 .

[static] template <typename Functor, typename FunctorReturnType> bool QMetaObject::invokeMethod(QObject *context, Functor &&function, FunctorReturnType *ret)

[static] template <typename Functor, typename FunctorReturnType> bool QMetaObject::invokeMethod(QObject *context, Functor &&function, Qt::ConnectionType type = Qt::AutoConnection, FunctorReturnType *ret = nullptr)

context 의 이벤트 루프에서 function 를 호출합니다. function 는 함수이거나 멤버 함수에 대한 포인터일 수 있습니다. 함수를 호출할 수 있으면 true 을 반환합니다. 해당 함수가 없거나 매개 변수가 일치하지 않으면 false 을 반환합니다. 함수 호출의 반환 값은 ret 에 배치됩니다.

type 이 설정되어 있으면 해당 연결 유형을 사용하여 함수가 호출됩니다. 그렇지 않으면 Qt::AutoConnection 이 사용됩니다.

참고: 이 함수는 스레드에 안전합니다.

[static, since 6.7] template <typename Functor, typename... Args> bool QMetaObject::invokeMethod(QObject *context, Functor &&function, Args &&... arguments)

[static, since 6.7] template <typename Functor, typename FunctorReturnType, typename... Args> bool QMetaObject::invokeMethod(QObject *context, Functor &&function, QTemplatedMetaMethodReturnArgument<FunctorReturnType> ret, Args &&... arguments)

[static, since 6.7] template <typename Functor, typename... Args> bool QMetaObject::invokeMethod(QObject *context, Functor &&function, Qt::ConnectionType type, Args &&... arguments)

[static, since 6.7] template <typename Functor, typename FunctorReturnType, typename... Args> bool QMetaObject::invokeMethod(QObject *context, Functor &&function, Qt::ConnectionType type, QTemplatedMetaMethodReturnArgument<FunctorReturnType> ret, Args &&... arguments)

context 의 이벤트 루프에서 arguments 을 사용하여 function 을 호출합니다. function 은 함수이거나 멤버 함수에 대한 포인터일 수 있습니다. 함수를 호출할 수 있는 경우 true 을 반환합니다. 함수 호출의 반환 값은 ret 에 배치됩니다. ret 인수에 사용되는 객체는 qReturnArg()에 객체를 전달하여 가져와야 합니다. 예를 들어

MyClass *obj = ...;
int result = 0;
QMetaObject::invokeMethod(obj, &MyClass::myMethod, qReturnArg(result), parameter);

type 이 설정되어 있으면 해당 연결 유형을 사용하여 함수가 호출됩니다. 그렇지 않으면 Qt::AutoConnection 이 사용됩니다.

참고: 이 함수는 스레드 안전합니다.

이 함수는 Qt 6.7에 도입되었습니다.

[static] bool QMetaObject::checkConnectArgs(const char *signal, const char *method)

signalmethod 인수가 호환되면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

signalmethod 모두 정규화될 것으로 예상됩니다.

normalizedSignature()도 참조하세요 .

[static] bool QMetaObject::checkConnectArgs(const QMetaMethod &signal, const QMetaMethod &method)

이 함수는 오버로드된 함수입니다.

signalmethod 인수가 호환되면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

QMetaClassInfo QMetaObject::classInfo(int index) const

주어진 index 으로 클래스 정보 항목의 메타데이터를 반환합니다.

예시:

class MyClass : public QObject
{
    Q_OBJECT
    Q_CLASSINFO("author", "Sabrina Schweinsteiger")
    Q_CLASSINFO("url", "http://doc.moosesoft.co.uk/1.0/")

public:
    ...
};

classInfoCount(), classInfoOffset(), indexOfClassInfo()도 참조하세요 .

int QMetaObject::classInfoCount() const

이 클래스에 있는 클래스 정보의 항목 수를 반환합니다.

classInfo(), classInfoOffset() 및 indexOfClassInfo()도 참조하세요 .

int QMetaObject::classInfoOffset() const

이 클래스에 대한 클래스 정보 오프셋, 즉 이 클래스의 첫 번째 클래스 정보 항목의 인덱스 위치를 반환합니다.

클래스에 클래스 정보가 있는 수퍼클래스가 없으면 오프셋은 0이고, 그렇지 않으면 오프셋은 클래스의 수퍼클래스에 있는 모든 클래스 정보 항목의 합계입니다.

classInfo(), classInfoCount() 및 indexOfClassInfo()도 참조하세요 .

const char *QMetaObject::className() const

클래스 이름을 반환합니다.

superClass()도 참조하세요 .

[static] void QMetaObject::connectSlotsByName(QObject *object)

주어진 object 의 모든 하위 객체를 재귀적으로 검색하여 일치하는 신호를 다음 형식을 따르는 object 의 슬롯에 연결합니다:

void on_<object name>_<signal name>(<signal parameters>);

우리 객체에 object name button1 형의 QPushButton 자식 객체가 있다고 가정해 봅시다. 버튼의 clicked() 신호를 수신하는 슬롯은 다음과 같습니다:

void on_button1_clicked();

object 자체에 올바르게 설정된 객체 이름이 있는 경우 자체 신호도 해당 슬롯에 연결됩니다.

QObject::setObjectName()도 참조하세요 .

QMetaMethod QMetaObject::constructor(int index) const

주어진 index 으로 생성자의 메타데이터를 반환합니다.

constructorCount() 및 newInstance()도 참조하세요 .

int QMetaObject::constructorCount() const

이 클래스의 생성자 수를 반환합니다.

constructor() 및 indexOfConstructor()도 참조하세요 .

QMetaEnum QMetaObject::enumerator(int index) const

주어진 index 으로 열거자에 대한 메타데이터를 반환합니다.

enumeratorCount(), enumeratorOffset(), indexOfEnumerator()도 참조하세요 .

int QMetaObject::enumeratorCount() const

이 클래스의 열거자 수를 반환합니다.

enumerator(), enumeratorOffset() 및 indexOfEnumerator()도 참조하세요 .

int QMetaObject::enumeratorOffset() const

이 클래스의 열거자 오프셋, 즉 이 클래스의 첫 번째 열거자의 인덱스 위치를 반환합니다.

클래스에 열거자를 가진 수퍼클래스가 없으면 오프셋은 0이고, 그렇지 않으면 오프셋은 클래스의 수퍼클래스에 있는 모든 열거자의 합입니다.

enumerator(), enumeratorCount() 및 indexOfEnumerator()도 참조하세요 .

int QMetaObject::indexOfClassInfo(const char *name) const

클래스 정보 항목 name 을 찾아서 그 인덱스를 반환하고, 그렇지 않으면 -1을 반환합니다.

classInfo(), classInfoCount() 및 classInfoOffset()도 참조하세요 .

int QMetaObject::indexOfConstructor(const char *constructor) const

constructor 을 찾아서 그 인덱스를 반환하고, 그렇지 않으면 -1을 반환합니다.

normalizedSignature()에서 반환하는 것처럼 constructor 는 정규화된 형식이어야 합니다.

constructor(), constructorCount() 및 normalizedSignature()도 참조하세요 .

int QMetaObject::indexOfEnumerator(const char *name) const

열거자 name 를 찾아 그 인덱스를 반환하고, 그렇지 않으면 -1을 반환합니다.

enumerator(), enumeratorCount() 및 enumeratorOffset()도 참조하세요 .

int QMetaObject::indexOfMethod(const char *method) const

method 을 찾아서 그 인덱스를 반환하고, 그렇지 않으면 -1을 반환합니다.

methodnormalizedSignature()에서 반환하는 정규화된 형식이어야 합니다.

method(), methodCount(), methodOffset() 및 normalizedSignature()도 참조하세요 .

int QMetaObject::indexOfProperty(const char *name) const

name 속성을 찾아 해당 인덱스를 반환하고, 그렇지 않으면 -1을 반환합니다.

property(), propertyCount() 및 propertyOffset()도 참조하세요 .

int QMetaObject::indexOfSignal(const char *signal) const

signal 을 찾아서 그 인덱스를 반환하고, 그렇지 않으면 -1을 반환합니다.

메서드가 존재하지만 신호가 아닌 경우 -1을 반환한다는 점을 제외하면 indexOfMethod()와 동일합니다.

signalnormalizedSignature()에서 반환하는 정규화된 형식이어야 합니다.

indexOfMethod(), normalizedSignature(), method(), methodCount() 및 methodOffset()도 참조하세요 .

int QMetaObject::indexOfSlot(const char *slot) const

slot 을 찾아서 그 인덱스를 반환하고, 그렇지 않으면 -1을 반환합니다.

메서드가 존재하지만 슬롯이 아닌 경우 -1을 반환한다는 점을 제외하면 indexOfMethod()와 동일합니다.

indexOfMethod(), method(), methodCount() 및 methodOffset()도 참조하세요 .

[noexcept] bool QMetaObject::inherits(const QMetaObject *metaObject) const

QMetaObject 에 설명된 클래스가 metaObject 에 설명된 유형을 상속하면 true 을 반환하고, 그렇지 않으면 false 를 반환합니다.

타입은 그 자체를 상속하는 것으로 간주됩니다.

[since 6.2] QMetaType QMetaObject::metaType() const

이 메타객체에 해당하는 메타타입을 반환합니다. 메타 객체가 네임스페이스에서 유래한 경우 잘못된 메타 형이 반환됩니다.

이 함수는 Qt 6.2에 도입되었습니다.

QMetaMethod QMetaObject::method(int index) const

주어진 index 으로 메서드의 메타데이터를 반환합니다.

methodCount(), methodOffset(), indexOfMethod()도 참조하세요 .

int QMetaObject::methodCount() const

각 베이스 클래스에서 제공하는 메서드 수를 포함하여 이 클래스의 메서드 수를 반환합니다. 여기에는 일반 멤버 함수뿐만 아니라 시그널과 슬롯도 포함됩니다.

특정 클래스의 메서드가 포함된 QStringList 를 얻으려면 다음과 같은 코드를 사용합니다:

const QMetaObject* metaObject = obj->metaObject();
QStringList methods;
for(int i = metaObject->methodOffset(); i < metaObject->methodCount(); ++i)
    methods << QString::fromLatin1(metaObject->method(i).methodSignature());

method(), methodOffset() 및 indexOfMethod()도 참조하세요 .

int QMetaObject::methodOffset() const

이 클래스의 메서드 오프셋, 즉 이 클래스의 첫 번째 멤버 함수의 인덱스 위치를 반환합니다.

오프셋은 클래스의 수퍼클래스에 있는 모든 메서드의 합입니다( QObject 에는 deleteLater() 슬롯과 destroyed() 신호가 있으므로 항상 양수입니다).

method(), methodCount() 및 indexOfMethod()도 참조하세요 .

[since 6.5] template <typename... Args> QObject *QMetaObject::newInstance(Args &&... arguments) const

이 클래스의 새 인스턴스를 생성하고 새 객체를 반환하거나, 적합한 생성자가 없는 경우 nullptr 을 반환합니다. 인자 arguments 의 유형은 일치하는 생성자를 찾는 데 사용되며, 신호 슬롯 연결과 동일한 방식으로 해당 생성자에게 전달됩니다.

Q_INVOKABLE 수정자로 선언된 생성자만 메타 객체 시스템을 통해 사용할 수 있다는 점에 유의하세요.

이 함수는 Qt 6.5에 도입되었습니다.

constructor()도 참조하십시오 .

[static] QByteArray QMetaObject::normalizedSignature(const char *method)

주어진 method 의 서명을 정규화합니다.

Qt는 정규화된 서명을 사용하여 주어진 두 신호와 슬롯이 호환되는지 여부를 결정합니다. 정규화는 공백을 최소한으로 줄이고, 적절한 경우 'const'를 앞쪽으로 이동시키고, 값 유형에서 'const'를 제거하고, const 참조를 값으로 대체합니다.

checkConnectArgs() 및 normalizedType()도 참조하세요 .

[static] QByteArray QMetaObject::normalizedType(const char *type)

type 을 정규화합니다.

Qt XML 정규화 방법에 대한 설명은 QMetaObject::normalizedSignature()를 참조하십시오.

예제:

QByteArray normType = QMetaObject::normalizedType(" int    const  *");
// normType is now "const int*"

normalizedSignature()도 참조하십시오 .

QMetaProperty QMetaObject::property(int index) const

주어진 index 으로 속성의 메타데이터를 반환합니다. 해당 속성이 존재하지 않으면 null QMetaProperty 이 반환됩니다.

propertyCount(), propertyOffset() 및 indexOfProperty()도 참조하세요 .

int QMetaObject::propertyCount() const

각 기본 클래스에서 제공하는 프로퍼티 수를 포함하여 이 클래스의 프로퍼티 수를 반환합니다.

다음과 같은 코드를 사용하여 지정된 클래스의 특정 속성이 포함된 QStringList 를 가져옵니다:

const QMetaObject* metaObject = obj->metaObject();
QStringList properties;
for(int i = metaObject->propertyOffset(); i < metaObject->propertyCount(); ++i)
    properties << QString::fromLatin1(metaObject->property(i).name());

property(), propertyOffset() 및 indexOfProperty()도 참조하세요 .

int QMetaObject::propertyOffset() const

이 클래스의 프로퍼티 오프셋, 즉 이 클래스의 첫 번째 프로퍼티의 인덱스 위치를 반환합니다.

오프셋은 클래스의 수퍼클래스에 있는 모든 프로퍼티의 합입니다( QObject 에는 name() 프로퍼티가 있으므로 항상 양수입니다).

property(), propertyCount() 및 indexOfProperty()도 참조하세요 .

const QMetaObject *QMetaObject::superClass() const

슈퍼클래스의 메타 객체를 반환하거나, 해당 객체가 없는 경우 nullptr 을 반환합니다.

className()도 참조하세요 .

QMetaProperty QMetaObject::userProperty() const

USER 플래그가 true로 설정된 속성을 반환합니다.

QMetaProperty::isUser()도 참조하세요 .

매크로 문서

QMetaMethodArgument Q_ARG(Type, const Type &value)

이 매크로는 해당 유형의 Typevalue 을 받아 QMetaMethodArgument를 반환하며, 이는 Args &&... 인수를 사용하여 QMetaObject::invokeMethod() 템플릿에 전달할 수 있습니다.

Q_RETURN_ARG()도 참조하세요 .

QMetaMethodReturnArgument Q_RETURN_ARG(Type, Type &value)

이 매크로는 Type 및 해당 유형의 value 에 대한 참조가 아닌 참조를 가져와 QMetaMethodReturnArgument를 반환하며, 이는 Args &&... 인수를 사용하여 QMetaObject::invokeMethod() 템플릿에 전달할 수 있습니다.

Q_ARG()도 참조하세요 .

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.