Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QMetaClassInfo Class Reference

\inmodule QtCore More...

#include <qmetaobject.h>

+ Collaboration diagram for QMetaClassInfo:

Public Member Functions

constexpr QMetaClassInfo ()
 
const char * name () const
 Returns the name of this item.
 
const char * value () const
 Returns the value of this item.
 
const QMetaObjectenclosingMetaObject () const
 

Friends

struct QMetaObject
 

Detailed Description

\inmodule QtCore

The QMetaClassInfo class provides additional information about a class.

Class information items are simple {name}–{value} pairs that are specified using Q_CLASSINFO() in the source code. The information can be retrieved using name() and value(). For example:

class MyClass
{
Q_CLASSINFO("author", "Sabrina Schweinsteiger")
Q_CLASSINFO("url", "http://doc.moosesoft.co.uk/1.0/")
public:
...
};
#define Q_OBJECT
#define Q_CLASSINFO(name, value)
QUrl url("example.com")
[constructor-url-reference]

This mechanism is free for you to use in your Qt applications. Qt doesn't use it for any of its classes.

See also
QMetaObject

Definition at line 411 of file qmetaobject.h.

Constructor & Destructor Documentation

◆ QMetaClassInfo()

QMetaClassInfo::QMetaClassInfo ( )
inlineconstexpr

Definition at line 414 of file qmetaobject.h.

Member Function Documentation

◆ enclosingMetaObject()

const QMetaObject * QMetaClassInfo::enclosingMetaObject ( ) const
inline

Definition at line 417 of file qmetaobject.h.

◆ name()

const char * QMetaClassInfo::name ( ) const

Returns the name of this item.

See also
value()

Definition at line 4082 of file qmetaobject.cpp.

References rawStringData().

Referenced by QMetaObjectBuilder::addMetaObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ value()

const char * QMetaClassInfo::value ( ) const

Returns the value of this item.

See also
name()

Definition at line 4094 of file qmetaobject.cpp.

References rawStringData().

Referenced by QDBusAdaptorConnector::addAdaptor(), and QMetaObjectBuilder::addMetaObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ QMetaObject

friend struct QMetaObject
friend

Definition at line 431 of file qmetaobject.h.


The documentation for this class was generated from the following files: