1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QMetaObject Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QMetaObject Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QMetaObject class contains meta-information about Qt objects. <a href="#details">More...</a></p>
<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qmetaobject.html#QMetaObject">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmetaobject.html#QMetaObject-2">__init__</a></b> (<i>self</i>, QMetaObject)</li><li><div class="fn" />QMetaClassInfo <b><a href="qmetaobject.html#classInfo">classInfo</a></b> (<i>self</i>, int <i>index</i>)</li><li><div class="fn" />int <b><a href="qmetaobject.html#classInfoCount">classInfoCount</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qmetaobject.html#classInfoOffset">classInfoOffset</a></b> (<i>self</i>)</li><li><div class="fn" />str <b><a href="qmetaobject.html#className">className</a></b> (<i>self</i>)</li><li><div class="fn" />QMetaEnum <b><a href="qmetaobject.html#enumerator">enumerator</a></b> (<i>self</i>, int <i>index</i>)</li><li><div class="fn" />int <b><a href="qmetaobject.html#enumeratorCount">enumeratorCount</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qmetaobject.html#enumeratorOffset">enumeratorOffset</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qmetaobject.html#indexOfClassInfo">indexOfClassInfo</a></b> (<i>self</i>, str <i>name</i>)</li><li><div class="fn" />int <b><a href="qmetaobject.html#indexOfEnumerator">indexOfEnumerator</a></b> (<i>self</i>, str <i>name</i>)</li><li><div class="fn" />int <b><a href="qmetaobject.html#indexOfMethod">indexOfMethod</a></b> (<i>self</i>, str <i>method</i>)</li><li><div class="fn" />int <b><a href="qmetaobject.html#indexOfProperty">indexOfProperty</a></b> (<i>self</i>, str <i>name</i>)</li><li><div class="fn" />int <b><a href="qmetaobject.html#indexOfSignal">indexOfSignal</a></b> (<i>self</i>, str <i>signal</i>)</li><li><div class="fn" />int <b><a href="qmetaobject.html#indexOfSlot">indexOfSlot</a></b> (<i>self</i>, str <i>slot</i>)</li><li><div class="fn" />QMetaMethod <b><a href="qmetaobject.html#method">method</a></b> (<i>self</i>, int <i>index</i>)</li><li><div class="fn" />int <b><a href="qmetaobject.html#methodCount">methodCount</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qmetaobject.html#methodOffset">methodOffset</a></b> (<i>self</i>)</li><li><div class="fn" />QMetaProperty <b><a href="qmetaobject.html#property">property</a></b> (<i>self</i>, int <i>index</i>)</li><li><div class="fn" />int <b><a href="qmetaobject.html#propertyCount">propertyCount</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qmetaobject.html#propertyOffset">propertyOffset</a></b> (<i>self</i>)</li><li><div class="fn" />QMetaObject <b><a href="qmetaobject.html#superClass">superClass</a></b> (<i>self</i>)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />bool <b><a href="qmetaobject.html#checkConnectArgs">checkConnectArgs</a></b> (str <i>signal</i>, str <i>method</i>)</li><li><div class="fn" /><b><a href="qmetaobject.html#connectSlotsByName">connectSlotsByName</a></b> (QObject <i>o</i>)</li><li><div class="fn" />QByteArray <b><a href="qmetaobject.html#normalizedSignature">normalizedSignature</a></b> (str <i>method</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QMetaObject class contains meta-information about Qt objects.</p>
<p>The Qt <a href="metaobjects.html">Meta-Object System</a> in Qt is responsible for the signals and slots inter-object communication mechanism, runtime type information, and the Qt property system. A single QMetaObject instance is created for each <a href="qobject.html">QObject</a> subclass that is used in an application, and this instance stores all the meta-information for the <a href="qobject.html">QObject</a> subclass. This object is available as <a href="qobject.html#metaObject">QObject.metaObject</a>().</p>
<p>This class is not normally required for application programming, but it is useful if you write meta-applications, such as scripting engines or GUI builders.</p>
<p>The functions you are most likely to find useful are these:</p>
<ul>
<li><a href="qmetaobject.html#className">className</a>() returns the name of a class.</li>
<li><a href="qmetaobject.html#superClass">superClass</a>() returns the superclass's meta-object.</li>
<li><a href="qmetaobject.html#method">method</a>() and <a href="qmetaobject.html#methodCount">methodCount</a>() provide information about a class's meta-methods (signals, slots and other member functions).</li>
<li><a href="qmetaobject.html#enumerator">enumerator</a>() and <a href="qmetaobject.html#enumeratorCount">enumeratorCount</a>() and provide information about a class's enumerators.</li>
<li><a href="qmetaobject.html#propertyCount">propertyCount</a>() and <a href="qmetaobject.html#property">property</a>() provide information about a class's properties.</li>
</ul>
<p>The index functions <a href="qmetaobject.html#indexOfMethod">indexOfMethod</a>(), <a href="qmetaobject.html#indexOfEnumerator">indexOfEnumerator</a>(), and <a href="qmetaobject.html#indexOfProperty">indexOfProperty</a>() map names of member functions, enumerators, or properties to indexes in the meta-object. For example, Qt uses <a href="qmetaobject.html#indexOfMethod">indexOfMethod</a>() internally when you connect a signal to a slot.</p>
<p>Classes can also have a list of <i>name</i>--<i>value</i> pairs of additional class information, stored in <a href="qmetaclassinfo.html">QMetaClassInfo</a> objects. The number of pairs is returned by <a href="qmetaobject.html#classInfoCount">classInfoCount</a>(), single pairs are returned by <a href="qmetaobject.html#classInfo">classInfo</a>(), and you can search for pairs with <a href="qmetaobject.html#indexOfClassInfo">indexOfClassInfo</a>().</p>
<p>See also <a href="qmetaclassinfo.html">QMetaClassInfo</a>, <a href="qmetaenum.html">QMetaEnum</a>, <a href="qmetamethod.html">QMetaMethod</a>, <a href="qmetaproperty.html">QMetaProperty</a>, <a href="qmetatype.html">QMetaType</a>, and <a href="metaobjects.html">Meta-Object System</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QMetaObject" />QMetaObject.__init__ (<i>self</i>)</h3><h3 class="fn"><a name="QMetaObject-2" />QMetaObject.__init__ (<i>self</i>, <a href="qmetaobject.html">QMetaObject</a>)</h3><h3 class="fn"><a name="checkConnectArgs" />bool QMetaObject.checkConnectArgs (str <i>signal</i>, str <i>method</i>)</h3><p>Returns true if the <i>signal</i> and <i>method</i> arguments are compatible; otherwise returns false.</p>
<p>Both <i>signal</i> and <i>method</i> are expected to be normalized.</p>
<p>See also <a href="qmetaobject.html#normalizedSignature">normalizedSignature</a>().</p>
<h3 class="fn"><a name="classInfo" /><a href="qmetaclassinfo.html">QMetaClassInfo</a> QMetaObject.classInfo (<i>self</i>, int <i>index</i>)</h3><p>Returns the meta-data for the item of class information with the given <i>index</i>.</p>
<p>Example:</p>
<pre>
class MyClass
{
Q_OBJECT
Q_CLASSINFO("author", "Sabrina Schweinsteiger")
Q_CLASSINFO("url", "http://doc.moosesoft.co.uk/1.0/")
public:
...
};
</pre>
<p>See also <a href="qmetaobject.html#classInfoCount">classInfoCount</a>(), <a href="qmetaobject.html#classInfoOffset">classInfoOffset</a>(), and <a href="qmetaobject.html#indexOfClassInfo">indexOfClassInfo</a>().</p>
<h3 class="fn"><a name="classInfoCount" />int QMetaObject.classInfoCount (<i>self</i>)</h3><p>Returns the number of items of class information in this class.</p>
<p>See also <a href="qmetaobject.html#classInfo">classInfo</a>(), <a href="qmetaobject.html#classInfoOffset">classInfoOffset</a>(), and <a href="qmetaobject.html#indexOfClassInfo">indexOfClassInfo</a>().</p>
<h3 class="fn"><a name="classInfoOffset" />int QMetaObject.classInfoOffset (<i>self</i>)</h3><p>Returns the class information offset for this class; i.e. the index position of this class's first class information item.</p>
<p>If the class has no superclasses with class information, the offset is 0; otherwise the offset is the sum of all the class information items in the class's superclasses.</p>
<p>See also <a href="qmetaobject.html#classInfo">classInfo</a>(), <a href="qmetaobject.html#classInfoCount">classInfoCount</a>(), and <a href="qmetaobject.html#indexOfClassInfo">indexOfClassInfo</a>().</p>
<h3 class="fn"><a name="className" />str QMetaObject.className (<i>self</i>)</h3><p>Returns the class name.</p>
<p>See also <a href="qmetaobject.html#superClass">superClass</a>().</p>
<h3 class="fn"><a name="connectSlotsByName" />QMetaObject.connectSlotsByName (<a href="qobject.html">QObject</a> <i>o</i>)</h3><p>Searches recursively for all child objects of <i>o</i> and connects matching signals to slots of <i>o</i> that follow the following form:</p>
<pre>
void on_<widget name>_<signal name>(<signal parameters>);
</pre>
<p>Let's assume our object has a child object of type <a href="qpushbutton.html">QPushButton</a> with the object name <tt>button1</tt>. The slot to catch the button's <tt>clicked()</tt> signal would be:</p>
<pre>
void on_button1_clicked();
</pre>
<p>See also <a href="qobject.html#objectName-prop">QObject.setObjectName</a>().</p>
<h3 class="fn"><a name="enumerator" /><a href="qmetaenum.html">QMetaEnum</a> QMetaObject.enumerator (<i>self</i>, int <i>index</i>)</h3><p>Returns the meta-data for the enumerator with the given <i>index</i>.</p>
<p>See also <a href="qmetaobject.html#enumeratorCount">enumeratorCount</a>(), <a href="qmetaobject.html#enumeratorOffset">enumeratorOffset</a>(), and <a href="qmetaobject.html#indexOfEnumerator">indexOfEnumerator</a>().</p>
<h3 class="fn"><a name="enumeratorCount" />int QMetaObject.enumeratorCount (<i>self</i>)</h3><p>Returns the number of enumerators in this class.</p>
<p>See also <a href="qmetaobject.html#enumerator">enumerator</a>(), <a href="qmetaobject.html#enumeratorOffset">enumeratorOffset</a>(), and <a href="qmetaobject.html#indexOfEnumerator">indexOfEnumerator</a>().</p>
<h3 class="fn"><a name="enumeratorOffset" />int QMetaObject.enumeratorOffset (<i>self</i>)</h3><p>Returns the enumerator offset for this class; i.e. the index position of this class's first enumerator.</p>
<p>If the class has no superclasses with enumerators, the offset is 0; otherwise the offset is the sum of all the enumerators in the class's superclasses.</p>
<p>See also <a href="qmetaobject.html#enumerator">enumerator</a>(), <a href="qmetaobject.html#enumeratorCount">enumeratorCount</a>(), and <a href="qmetaobject.html#indexOfEnumerator">indexOfEnumerator</a>().</p>
<h3 class="fn"><a name="indexOfClassInfo" />int QMetaObject.indexOfClassInfo (<i>self</i>, str <i>name</i>)</h3><p>Finds class information item <i>name</i> and returns its index; otherwise returns -1.</p>
<p>See also <a href="qmetaobject.html#classInfo">classInfo</a>(), <a href="qmetaobject.html#classInfoCount">classInfoCount</a>(), and <a href="qmetaobject.html#classInfoOffset">classInfoOffset</a>().</p>
<h3 class="fn"><a name="indexOfEnumerator" />int QMetaObject.indexOfEnumerator (<i>self</i>, str <i>name</i>)</h3><p>Finds enumerator <i>name</i> and returns its index; otherwise returns -1.</p>
<p>See also <a href="qmetaobject.html#enumerator">enumerator</a>(), <a href="qmetaobject.html#enumeratorCount">enumeratorCount</a>(), and <a href="qmetaobject.html#enumeratorOffset">enumeratorOffset</a>().</p>
<h3 class="fn"><a name="indexOfMethod" />int QMetaObject.indexOfMethod (<i>self</i>, str <i>method</i>)</h3><p>Finds <i>method</i> and returns its index; otherwise returns -1.</p>
<p>Note that the <i>method</i> has to be in normalized form, as returned by <a href="qmetaobject.html#normalizedSignature">normalizedSignature</a>().</p>
<p>See also <a href="qmetaobject.html#method">method</a>(), <a href="qmetaobject.html#methodCount">methodCount</a>(), <a href="qmetaobject.html#methodOffset">methodOffset</a>(), and <a href="qmetaobject.html#normalizedSignature">normalizedSignature</a>().</p>
<h3 class="fn"><a name="indexOfProperty" />int QMetaObject.indexOfProperty (<i>self</i>, str <i>name</i>)</h3><p>Finds property <i>name</i> and returns its index; otherwise returns -1.</p>
<p>See also <a href="qmetaobject.html#property">property</a>(), <a href="qmetaobject.html#propertyCount">propertyCount</a>(), and <a href="qmetaobject.html#propertyOffset">propertyOffset</a>().</p>
<h3 class="fn"><a name="indexOfSignal" />int QMetaObject.indexOfSignal (<i>self</i>, str <i>signal</i>)</h3><p>Finds <i>signal</i> and returns its index; otherwise returns -1.</p>
<p>This is the same as <a href="qmetaobject.html#indexOfMethod">indexOfMethod</a>(), except that it will return -1 if the method exists but isn't a signal.</p>
<p>Note that the <i>signal</i> has to be in normalized form, as returned by <a href="qmetaobject.html#normalizedSignature">normalizedSignature</a>().</p>
<p>See also <a href="qmetaobject.html#indexOfMethod">indexOfMethod</a>(), <a href="qmetaobject.html#normalizedSignature">normalizedSignature</a>(), <a href="qmetaobject.html#method">method</a>(), <a href="qmetaobject.html#methodCount">methodCount</a>(), and <a href="qmetaobject.html#methodOffset">methodOffset</a>().</p>
<h3 class="fn"><a name="indexOfSlot" />int QMetaObject.indexOfSlot (<i>self</i>, str <i>slot</i>)</h3><p>Finds <i>slot</i> and returns its index; otherwise returns -1.</p>
<p>This is the same as <a href="qmetaobject.html#indexOfMethod">indexOfMethod</a>(), except that it will return -1 if the method exists but isn't a slot.</p>
<p>See also <a href="qmetaobject.html#indexOfMethod">indexOfMethod</a>(), <a href="qmetaobject.html#method">method</a>(), <a href="qmetaobject.html#methodCount">methodCount</a>(), and <a href="qmetaobject.html#methodOffset">methodOffset</a>().</p>
<h3 class="fn"><a name="method" /><a href="qmetamethod.html">QMetaMethod</a> QMetaObject.method (<i>self</i>, int <i>index</i>)</h3><p>Returns the meta-data for the method with the given <i>index</i>.</p>
<p>See also <a href="qmetaobject.html#methodCount">methodCount</a>(), <a href="qmetaobject.html#methodOffset">methodOffset</a>(), and <a href="qmetaobject.html#indexOfMethod">indexOfMethod</a>().</p>
<h3 class="fn"><a name="methodCount" />int QMetaObject.methodCount (<i>self</i>)</h3><p>Returns the number of methods in this class. These include ordinary methods, signals, and slots.</p>
<p>See also <a href="qmetaobject.html#method">method</a>(), <a href="qmetaobject.html#methodOffset">methodOffset</a>(), and <a href="qmetaobject.html#indexOfMethod">indexOfMethod</a>().</p>
<h3 class="fn"><a name="methodOffset" />int QMetaObject.methodOffset (<i>self</i>)</h3><p>Returns the method offset for this class; i.e. the index position of this class's first member function.</p>
<p>The offset is the sum of all the methods in the class's superclasses (which is always positive since <a href="qobject.html">QObject</a> has the deleteLater() slot and a destroyed() signal).</p>
<p>See also <a href="qmetaobject.html#method">method</a>(), <a href="qmetaobject.html#methodCount">methodCount</a>(), and <a href="qmetaobject.html#indexOfMethod">indexOfMethod</a>().</p>
<h3 class="fn"><a name="normalizedSignature" /><a href="qbytearray.html">QByteArray</a> QMetaObject.normalizedSignature (str <i>method</i>)</h3><p>Normalizes the signature of the given <i>method</i>.</p>
<p>Qt uses normalized signatures to decide whether two given signals and slots are compatible. Normalization reduces whitespace to a minimum, moves 'const' to the front where appropriate, removes 'const' from value types and replaces const references with values.</p>
<p>See also <a href="qmetaobject.html#checkConnectArgs">checkConnectArgs</a>().</p>
<h3 class="fn"><a name="property" /><a href="qmetaproperty.html">QMetaProperty</a> QMetaObject.property (<i>self</i>, int <i>index</i>)</h3><p>Returns the meta-data for the property with the given <i>index</i>.</p>
<p>See also <a href="qmetaobject.html#propertyCount">propertyCount</a>(), <a href="qmetaobject.html#propertyOffset">propertyOffset</a>(), and <a href="qmetaobject.html#indexOfProperty">indexOfProperty</a>().</p>
<h3 class="fn"><a name="propertyCount" />int QMetaObject.propertyCount (<i>self</i>)</h3><p>Returns the number of properties in this class.</p>
<p>See also <a href="qmetaobject.html#property">property</a>(), <a href="qmetaobject.html#propertyOffset">propertyOffset</a>(), and <a href="qmetaobject.html#indexOfProperty">indexOfProperty</a>().</p>
<h3 class="fn"><a name="propertyOffset" />int QMetaObject.propertyOffset (<i>self</i>)</h3><p>Returns the property offset for this class; i.e. the index position of this class's first property.</p>
<p>The offset is the sum of all the properties in the class's superclasses (which is always positive since <a href="qobject.html">QObject</a> has the name() property).</p>
<p>See also <a href="qmetaobject.html#property">property</a>(), <a href="qmetaobject.html#propertyCount">propertyCount</a>(), and <a href="qmetaobject.html#indexOfProperty">indexOfProperty</a>().</p>
<h3 class="fn"><a name="superClass" /><a href="qmetaobject.html">QMetaObject</a> QMetaObject.superClass (<i>self</i>)</h3><p>Returns the meta-object of the superclass, or 0 if there is no such object.</p>
<p>See also <a href="qmetaobject.html#className">className</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td width="25%">PyQt 4.0.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.trolltech.com">Trolltech AS</a> 2006</td><td align="right" width="25%">Qt 4.1.4</td></tr></table></div></address></body></html>
|