47 #include <QtCore/qobjectdefs.h> 48 #include <QtCore/qstring.h> 49 #include <QtCore/qbytearray.h> 50 #include <QtCore/qlist.h> 51 #ifdef QT_INCLUDE_COMPAT 52 #include <QtCore/qcoreevent.h> 54 #include <QtCore/qscopedpointer.h> 74 #ifndef QT_NO_USERDATA 85 #if defined(__INTEL_COMPILER) && defined(Q_OS_WIN) 125 static QString tr(
const char *sourceText,
const char *comment = 0,
int n = -1);
126 static QString trUtf8(
const char *sourceText,
const char *comment = 0,
int n = -1);
130 #ifdef QT_NO_TRANSLATION 131 static QString tr(
const char *sourceText,
const char *,
int)
133 static QString tr(
const char *sourceText,
const char * = 0)
135 #ifndef QT_NO_TEXTCODEC 136 static QString trUtf8(
const char *sourceText,
const char *,
int)
138 static QString trUtf8(
const char *sourceText,
const char * = 0)
141 #endif //QT_NO_TRANSLATION 149 bool blockSignals(
bool b);
152 void moveToThread(
QThread *thread);
154 int startTimer(
int interval);
155 void killTimer(
int id);
159 {
return static_cast<T
>(
qt_qFindChild_helper(
this, aName, reinterpret_cast<T>(0)->staticMetaObject)); }
190 QT3_SUPPORT
QObject *child(
const char *objName,
const char *inheritsClass = 0,
191 bool recursiveSearch =
true)
const;
192 QT3_SUPPORT
QObjectList queryList(
const char *inheritsClass = 0,
193 const char *objName = 0,
194 bool regexpMatch =
true,
195 bool recursiveSearch =
true)
const;
200 void installEventFilter(
QObject *);
201 void removeEventFilter(
QObject *);
204 static bool connect(
const QObject *sender,
const char *signal,
231 inline bool connect(
const QObject *sender,
const char *signal,
244 static bool disconnect(
const QObject *sender,
const char *signal,
245 const QObject *receiver,
const char *member);
249 const QObject *receiver = 0,
const char *member = 0)
250 {
return disconnect(
this, signal, receiver, member); }
252 {
return disconnect(
this, 0, receiver, member); }
254 void dumpObjectTree();
255 void dumpObjectInfo();
257 #ifndef QT_NO_PROPERTIES 258 bool setProperty(
const char *name,
const QVariant &value);
261 #endif // QT_NO_PROPERTIES 263 #ifndef QT_NO_USERDATA 264 static uint registerUserData();
267 #endif // QT_NO_USERDATA 276 {
return const_cast<QObject *
>(
this)->qt_metacast(classname) != 0; }
283 int senderSignalIndex()
const;
284 int receivers(
const char* signal)
const;
288 virtual void customEvent(
QEvent *);
290 virtual void connectNotify(
const char *signal);
291 virtual void disconnectNotify(
const char *signal);
295 QT3_SUPPORT_CONSTRUCTOR
QObject(
QObject *parent,
const char *name);
296 inline QT3_SUPPORT
void insertChild(QObject *o)
298 inline QT3_SUPPORT
void removeChild(QObject *o)
300 inline QT3_SUPPORT
bool isA(
const char *classname)
const 302 inline QT3_SUPPORT
const char *
className()
const {
return metaObject()->className(); }
303 inline QT3_SUPPORT
const char *
name()
const {
return objectName().latin1_helper(); }
304 inline QT3_SUPPORT
const char *
name(
const char *defaultName)
const 305 {
QString s = objectName();
return s.
isEmpty()?defaultName:s.latin1_helper(); }
306 inline QT3_SUPPORT
void setName(
const char *aName) { setObjectName(
QLatin1String(aName)); }
308 inline QT3_SUPPORT
bool checkConnectArgs(
const char *signal,
312 static inline QT3_SUPPORT
QByteArray normalizeSignalSlot(
const char *signalSlot)
339 {
return connect(asender, asignal,
this, amember, atype); }
341 #ifndef QT_NO_USERDATA 372 #endif //QT_DEPRECATED 377 #if !defined(QT_NO_QOBJECT_CHECK) 378 reinterpret_cast<T
>(object)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(
object));
380 return static_cast<T
>(
reinterpret_cast<T
>(object)->staticMetaObject.
cast(
object));
386 #if !defined(QT_NO_QOBJECT_CHECK) 387 reinterpret_cast<T
>(object)->qt_check_for_QOBJECT_macro(*reinterpret_cast<T>(const_cast<QObject *>(
object)));
389 return static_cast<T
>(
reinterpret_cast<T
>(object)->staticMetaObject.
cast(
object));
397 # define Q_DECLARE_INTERFACE(IFace, IId) \ 398 template <> inline const char *qobject_interface_iid<IFace *>() \ 400 template <> inline IFace *qobject_cast<IFace *>(QObject *object) \ 401 { return reinterpret_cast<IFace *>((object ? object->qt_metacast(IId) : 0)); } \ 402 template <> inline IFace *qobject_cast<IFace *>(const QObject *object) \ 403 { return reinterpret_cast<IFace *>((object ? const_cast<QObject *>(object)->qt_metacast(IId) : 0)); } 406 #ifndef QT_NO_DEBUG_STREAM The QVariant class acts like a union for the most common Qt data types.
T qobject_cast(QObject *object)
The QDebug class provides an output stream for debugging information.
The QApplication class manages the GUI application's control flow and main settings.
#define QT_END_NAMESPACE
This macro expands to.
The QRegExp class provides pattern matching using regular expressions.
QString objectName
the name of this object
The QByteArray class provides an array of bytes.
QList< T > findChildren(const QRegExp &re) const
static const QMetaObject staticMetaObject
This variable stores the meta-object for the class.
Q_CORE_EXPORT QDebug operator<<(QDebug, const QObject *)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
bool disconnect(const QObject *receiver, const char *member=0)
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
void setParent(QObject *)
Makes the object a child of parent.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, const QString &name, const QRegExp *re, const QMetaObject &mo, QList< void *> *list)
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
static const char * data(const QByteArray &arr)
T findChild(const QString &aName=QString()) const
Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object.
QList< T > qFindChildren(const QObject *oobj, const QString &name=QString())
Q_CORE_EXPORT QObject * qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo)
bool inherits(const char *classname) const
Returns true if this object is an instance of a class that inherits className or a QObject subclass t...
The QChildEvent class contains event parameters for child object events.
The QCoreApplication class provides an event loop for console Qt applications.
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
The QTimerEvent class contains parameters that describe a timer event.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
QObject * parent() const
Returns a pointer to the parent object.
const QObjectList & children() const
Returns a list of child objects.
static const QMetaObject staticQtMetaObject
QScopedPointer< QObjectData > d_ptr
bool disconnect(const char *signal=0, const QObject *receiver=0, const char *member=0)
#define Q_DECLARE_PRIVATE(Class)
int qstrcmp(const QByteArray &str1, const char *str2)
bool signalsBlocked() const
Returns true if signals are blocked; otherwise returns false.
The QEvent class is the base class of all event classes.
The QThread class provides a platform-independent way to manage threads.
const char * qobject_interface_iid()
QList< T > findChildren(const QString &aName=QString()) const
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
T qFindChild(const QObject *o, const QString &name=QString())
The QList class is a template class that provides lists.