##// END OF EJS Templates
enabled shell injection and added data() for bytearray and addAction for QMenu/Bar and QToolBar, moved QByteArray to builtin classes...
florianlink -
r124:72837eb4c23c
parent child
Show More
@@ -345,6 +345,7 bool ShellGenerator::isBuiltIn(const QString& name) {
345 builtIn.insert("QPixmap");
345 builtIn.insert("QPixmap");
346 builtIn.insert("QBrush");
346 builtIn.insert("QBrush");
347 builtIn.insert("QBitArray");
347 builtIn.insert("QBitArray");
348 builtIn.insert("QByteArray");
348 builtIn.insert("QPalette");
349 builtIn.insert("QPalette");
349 builtIn.insert("QPen");
350 builtIn.insert("QPen");
350 builtIn.insert("QIcon");
351 builtIn.insert("QIcon");
@@ -293,10 +293,9 void ShellHeaderGenerator::write(QTextStream &s, const AbstractMetaClass *meta_c
293 }
293 }
294 }
294 }
295
295
296 // writeInjectedCode(s, meta_class);
296 writeInjectedCode(s, meta_class);
297
298 // s << endl << " QScriptValue __qtscript_self;" << endl;
299
297
298
300 s << "};" << endl << endl
299 s << "};" << endl << endl
301 << "#endif // " << include_block << endl;
300 << "#endif // " << include_block << endl;
302
301
@@ -306,7 +305,7 void ShellHeaderGenerator::writeInjectedCode(QTextStream &s, const AbstractMetaC
306 {
305 {
307 CodeSnipList code_snips = meta_class->typeEntry()->codeSnips();
306 CodeSnipList code_snips = meta_class->typeEntry()->codeSnips();
308 foreach (const CodeSnip &cs, code_snips) {
307 foreach (const CodeSnip &cs, code_snips) {
309 if (cs.language == TypeSystem::ShellDeclaration) {
308 if (cs.language == TypeSystem::PyWrapperDeclaration) {
310 s << cs.code() << endl;
309 s << cs.code() << endl;
311 }
310 }
312 }
311 }
@@ -300,14 +300,16 void ShellImplGenerator::write(QTextStream &s, const AbstractMetaClass *meta_cla
300 s << " return result;" << endl;
300 s << " return result;" << endl;
301 s << "}" << endl << endl;
301 s << "}" << endl << endl;
302 }
302 }
303
303
304 writeInjectedCode(s, meta_class);
305
304 }
306 }
305
307
306 void ShellImplGenerator::writeInjectedCode(QTextStream &s, const AbstractMetaClass *meta_class)
308 void ShellImplGenerator::writeInjectedCode(QTextStream &s, const AbstractMetaClass *meta_class)
307 {
309 {
308 CodeSnipList code_snips = meta_class->typeEntry()->codeSnips();
310 CodeSnipList code_snips = meta_class->typeEntry()->codeSnips();
309 foreach (const CodeSnip &cs, code_snips) {
311 foreach (const CodeSnip &cs, code_snips) {
310 if (cs.language == TypeSystem::ShellCode) {
312 if (cs.language == TypeSystem::PyWrapperCode) {
311 s << cs.code() << endl;
313 s << cs.code() << endl;
312 }
314 }
313 }
315 }
@@ -1278,6 +1278,8 bool Handler::startElement(const QString &, const QString &n,
1278 languageNames["destructor-function"] = TypeSystem::DestructorFunction;
1278 languageNames["destructor-function"] = TypeSystem::DestructorFunction;
1279 languageNames["constructors"] = TypeSystem::Constructors;
1279 languageNames["constructors"] = TypeSystem::Constructors;
1280 languageNames["interface"] = TypeSystem::Interface;
1280 languageNames["interface"] = TypeSystem::Interface;
1281 languageNames["pywrap-cpp"] = TypeSystem::PyWrapperCode;
1282 languageNames["pywrap-h"] = TypeSystem::PyWrapperDeclaration;
1281 }
1283 }
1282
1284
1283 QString className = attributes["class"].toLower();
1285 QString className = attributes["class"].toLower();
@@ -101,6 +101,8 namespace TypeSystem {
101 DestructorFunction = 0x0020,
101 DestructorFunction = 0x0020,
102 Constructors = 0x0040,
102 Constructors = 0x0040,
103 Interface = 0x0080,
103 Interface = 0x0080,
104 PyWrapperCode = 0x0100,
105 PyWrapperDeclaration = 0x0200,
104
106
105 // masks
107 // masks
106 All = TargetLangCode
108 All = TargetLangCode
@@ -31,6 +31,8
31 <rejection class="" enum-name="QtValidLicenseForScriptToolsModule" />
31 <rejection class="" enum-name="QtValidLicenseForScriptToolsModule" />
32 <rejection class="" enum-name="QtValidLicenseForMultimediaModule" />
32 <rejection class="" enum-name="QtValidLicenseForMultimediaModule" />
33 <rejection class="" enum-name="QtValidLicenseForOpenVGModule" />
33 <rejection class="" enum-name="QtValidLicenseForOpenVGModule" />
34 <rejection class="" enum-name="QtValidLicenseForDeclarativeModule" />
35
34
36
35 <rejection class="QtConcurrent" enum-name="enum_1" />
37 <rejection class="QtConcurrent" enum-name="enum_1" />
36 <rejection class="QtConcurrent" function-name="operator|" />
38 <rejection class="QtConcurrent" function-name="operator|" />
@@ -898,10 +900,8
898 <modify-function signature="operator[](uint)" remove="all"/>
900 <modify-function signature="operator[](uint)" remove="all"/>
899 <modify-function signature="operator[](uint)const" remove="all"/>
901 <modify-function signature="operator[](uint)const" remove="all"/>
900 <modify-function signature="push_back(char)" remove="all"/>
902 <modify-function signature="push_back(char)" remove="all"/>
901 <modify-function signature="push_back(const QByteArray&amp;)" remove="all"/>
902 <modify-function signature="push_back(const char*)" remove="all"/>
903 <modify-function signature="push_back(const char*)" remove="all"/>
903 <modify-function signature="push_front(char)" remove="all"/>
904 <modify-function signature="push_front(char)" remove="all"/>
904 <modify-function signature="push_front(const QByteArray&amp;)" remove="all"/>
905 <modify-function signature="push_front(const char*)" remove="all"/>
905 <modify-function signature="push_front(const char*)" remove="all"/>
906 <modify-function signature="setNum(uint,int)" remove="all"/>
906 <modify-function signature="setNum(uint,int)" remove="all"/>
907 <modify-function signature="setNum(unsigned long long,int)" remove="all"/>
907 <modify-function signature="setNum(unsigned long long,int)" remove="all"/>
@@ -915,7 +915,6
915
915
916 <!-- functions made private... -->
916 <!-- functions made private... -->
917 <modify-function signature="operator=(QByteArray)" access="private"/>
917 <modify-function signature="operator=(QByteArray)" access="private"/>
918 <modify-function signature="operator+=(QByteArray)" remove="all"/>
919 <modify-function signature="operator+=(QString)" remove="all"/>
918 <modify-function signature="operator+=(QString)" remove="all"/>
920 <modify-function signature="operator+=(char)" remove="all"/>
919 <modify-function signature="operator+=(char)" remove="all"/>
921 </value-type>
920 </value-type>
@@ -350,21 +350,23
350 </object-type>
350 </object-type>
351
351
352 <value-type name="QByteArray">
352 <value-type name="QByteArray">
353
353 <inject-code class="pywrap-h">
354 PyObject* data(QByteArray* b) {
355 if (b->data()) {
356 return PyString_FromStringAndSize(b->data(), b->size());
357 } else {
358 Py_INCREF(Py_None);
359 return Py_None;
360 }
361 }
362 </inject-code>
363
354 <inject-code class="native" position="beginning">
364 <inject-code class="native" position="beginning">
355 Q_DECLARE_METATYPE(QScriptValue)
365 Q_DECLARE_METATYPE(QScriptValue)
356 </inject-code>
366 </inject-code>
357
367
358 <modify-function signature="QByteArray(const char*)">
359 <modify-argument index="1">
360 <replace-type modified-type="QString"/>
361 <conversion-rule class="native">
362 <insert-template name="core.convert_string_arg_to_char*"/>
363 </conversion-rule>
364 </modify-argument>
365 </modify-function>
366
367 <modify-function signature="QByteArray(const char*,int)" remove="all"/>
368 <modify-function signature="QByteArray(const char*,int)" remove="all"/>
369 <modify-function signature="QByteArray(const char*)" remove="all"/>
368
370
369 <modify-function signature="at(int)const">
371 <modify-function signature="at(int)const">
370 <modify-argument index="1">
372 <modify-argument index="1">
@@ -63,6 +63,8
63 <rejection class="" enum-name="QtValidLicenseForScriptToolsModule"/>
63 <rejection class="" enum-name="QtValidLicenseForScriptToolsModule"/>
64 <rejection class="" enum-name="QtValidLicenseForMultimediaModule"/>
64 <rejection class="" enum-name="QtValidLicenseForMultimediaModule"/>
65 <rejection class="" enum-name="QtValidLicenseForOpenVGModule"/>
65 <rejection class="" enum-name="QtValidLicenseForOpenVGModule"/>
66 <rejection class="" enum-name="QtValidLicenseForDeclarativeModule"/>
67
66
68
67 <rejection class="QtConcurrent" enum-name="enum_1"/>
69 <rejection class="QtConcurrent" enum-name="enum_1"/>
68 <rejection class="QtConcurrent" function-name="operator|"/>
70 <rejection class="QtConcurrent" function-name="operator|"/>
@@ -1138,10 +1140,8
1138 <modify-function signature="operator[](uint)" remove="all"/>
1140 <modify-function signature="operator[](uint)" remove="all"/>
1139 <modify-function signature="operator[](uint)const" remove="all"/>
1141 <modify-function signature="operator[](uint)const" remove="all"/>
1140 <modify-function signature="push_back(char)" remove="all"/>
1142 <modify-function signature="push_back(char)" remove="all"/>
1141 <modify-function signature="push_back(const QByteArray&amp;)" remove="all"/>
1142 <modify-function signature="push_back(const char*)" remove="all"/>
1143 <modify-function signature="push_back(const char*)" remove="all"/>
1143 <modify-function signature="push_front(char)" remove="all"/>
1144 <modify-function signature="push_front(char)" remove="all"/>
1144 <modify-function signature="push_front(const QByteArray&amp;)" remove="all"/>
1145 <modify-function signature="push_front(const char*)" remove="all"/>
1145 <modify-function signature="push_front(const char*)" remove="all"/>
1146 <modify-function signature="setNum(uint,int)" remove="all"/>
1146 <modify-function signature="setNum(uint,int)" remove="all"/>
1147 <modify-function signature="setNum(unsigned long long,int)" remove="all"/>
1147 <modify-function signature="setNum(unsigned long long,int)" remove="all"/>
@@ -1155,25 +1155,26
1155
1155
1156 <!-- functions made private... -->
1156 <!-- functions made private... -->
1157 <modify-function signature="operator=(QByteArray)" access="private"/>
1157 <modify-function signature="operator=(QByteArray)" access="private"/>
1158 <modify-function signature="operator+=(QByteArray)" remove="all"/>
1159 <modify-function signature="operator+=(QString)" remove="all"/>
1158 <modify-function signature="operator+=(QString)" remove="all"/>
1160 <modify-function signature="operator+=(char)" remove="all"/>
1159 <modify-function signature="operator+=(char)" remove="all"/>
1161
1160
1162
1161 <inject-code class="pywrap-h">
1162 PyObject* data(QByteArray* b) {
1163 if (b-&gt;data()) {
1164 return PyString_FromStringAndSize(b-&gt;data(), b-&gt;size());
1165 } else {
1166 Py_INCREF(Py_None);
1167 return Py_None;
1168 }
1169 }
1170 </inject-code>
1171
1163 <inject-code class="native" position="beginning">
1172 <inject-code class="native" position="beginning">
1164 Q_DECLARE_METATYPE(QScriptValue)
1173 Q_DECLARE_METATYPE(QScriptValue)
1165 </inject-code>
1174 </inject-code>
1166
1175
1167 <modify-function signature="QByteArray(const char*)">
1168 <modify-argument index="1">
1169 <replace-type modified-type="QString"/>
1170 <conversion-rule class="native">
1171 <insert-template name="core.convert_string_arg_to_char*"/>
1172 </conversion-rule>
1173 </modify-argument>
1174 </modify-function>
1175
1176 <modify-function signature="QByteArray(const char*,int)" remove="all"/>
1176 <modify-function signature="QByteArray(const char*,int)" remove="all"/>
1177 <modify-function signature="QByteArray(const char*)" remove="all"/>
1177
1178
1178 <modify-function signature="at(int)const">
1179 <modify-function signature="at(int)const">
1179 <modify-argument index="1">
1180 <modify-argument index="1">
@@ -1829,17 +1829,6
1829 </modify-function>
1829 </modify-function>
1830 </object-type>
1830 </object-type>
1831 <object-type name="QMenu">
1831 <object-type name="QMenu">
1832 <modify-function signature="addAction(QAction *)" remove="all"/>
1833 <modify-function signature="addMenu(QMenu*)">
1834 <modify-argument index="1">
1835 <reference-count action="add" variable-name="__rcMenus"/>
1836 </modify-argument>
1837 </modify-function>
1838 <modify-function signature="insertMenu(QAction*,QMenu*)">
1839 <modify-argument index="2">
1840 <reference-count action="add" variable-name="__rcMenus"/>
1841 </modify-argument>
1842 </modify-function>
1843 <modify-function signature="insertSeparator(QAction*)">
1832 <modify-function signature="insertSeparator(QAction*)">
1844 <modify-argument index="1">
1833 <modify-argument index="1">
1845 <reference-count action="ignore"/>
1834 <reference-count action="ignore"/>
@@ -1858,47 +1847,10
1858 <modify-function signature="setNoReplayFor(QWidget*)">
1847 <modify-function signature="setNoReplayFor(QWidget*)">
1859 <remove/>
1848 <remove/>
1860 </modify-function>
1849 </modify-function>
1861 <modify-function signature="initStyleOption(QStyleOptionMenuItem*,const QAction*)const">
1862 <access modifier="private"/>
1863 </modify-function>
1864
1865 <modify-function signature="addAction(QString,const QObject*,const char*,QKeySequence)">
1866 <remove/>
1867 </modify-function>
1868
1869 <modify-function signature="addAction(QIcon,QString,const QObject*,const char*,QKeySequence)">
1870 <remove/>
1871 </modify-function>
1872 </object-type>
1850 </object-type>
1873
1851
1874 <object-type name="QMenuBar">
1852 <object-type name="QMenuBar">
1875 <modify-function signature="addAction(QAction *)" remove="all"/>
1876 <modify-function signature="addAction(QString,const QObject*,const char*)">
1877 <remove/>
1878 </modify-function>
1879
1853
1880 <modify-function signature="initStyleOption(QStyleOptionMenuItem*,const QAction*)const">
1881 <access modifier="private"/>
1882 </modify-function>
1883
1884 <modify-function signature="addMenu(QMenu*)">
1885 <modify-argument index="1">
1886 <reference-count action="add" variable-name="__rcMenus"/>
1887 </modify-argument>
1888 </modify-function>
1889 <modify-function signature="insertMenu(QAction*,QMenu*)">
1890 <modify-argument index="1">
1891 <reference-count action="ignore"/>
1892 </modify-argument>
1893 <modify-argument index="2">
1894 <reference-count action="add" variable-name="__rcMenus"/>
1895 </modify-argument>
1896 </modify-function>
1897 <modify-function signature="insertSeparator(QAction*)">
1898 <modify-argument index="1">
1899 <reference-count action="ignore"/>
1900 </modify-argument>
1901 </modify-function>
1902 <modify-function signature="setActiveAction(QAction*)">
1854 <modify-function signature="setActiveAction(QAction*)">
1903 <modify-argument index="1">
1855 <modify-argument index="1">
1904 <reference-count action="ignore"/>
1856 <reference-count action="ignore"/>
@@ -4458,16 +4410,6
4458 </object-type>
4410 </object-type>
4459
4411
4460 <object-type name="QToolBar">
4412 <object-type name="QToolBar">
4461 <modify-function signature="addAction(QAction *)" remove="all"/>
4462 <modify-function signature="initStyleOption(QStyleOptionToolBar*)const">
4463 <access modifier="private"/>
4464 </modify-function>
4465 <modify-function signature="addAction(QIcon,QString,const QObject*,const char*)">
4466 <remove/>
4467 </modify-function>
4468 <modify-function signature="addAction(QString,const QObject*,const char*)">
4469 <remove/>
4470 </modify-function>
4471 <modify-function signature="addWidget(QWidget*)">
4413 <modify-function signature="addWidget(QWidget*)">
4472 <modify-argument index="1">
4414 <modify-argument index="1">
4473 <define-ownership class="java" owner="c++"/>
4415 <define-ownership class="java" owner="c++"/>
@@ -553,6 +553,56
553 </modify-function>
553 </modify-function>
554 </value-type>
554 </value-type>
555
555
556 <object-type name="QMenu">
557 <inject-code class="pywrap-h">
558 QAction* addAction (QMenu* menu, const QString &amp; text, PyObject* callable, const QKeySequence &amp; shortcut = 0) {
559 QAction* a = menu->addAction(text);
560 a->setShortcut(shortcut);
561 PythonQt::self()->addSignalHandler(a, SIGNAL(triggered(bool)), callable);
562 return a;
563 }
564
565 QAction* addAction (QMenu* menu, const QIcon&amp; icon, const QString&amp; text, PyObject* callable, const QKeySequence&amp; shortcut = 0)
566 {
567 QAction* a = menu->addAction(text);
568 a->setIcon(icon);
569 a->setShortcut(shortcut);
570 PythonQt::self()->addSignalHandler(a, SIGNAL(triggered(bool)), callable);
571 return a;
572 }
573 </inject-code>
574 </object-type>
575
576 <object-type name="QMenuBar">
577 <inject-code class="pywrap-h">
578 QAction* addAction (QMenuBar* menu, const QString &amp; text, PyObject* callable)
579 {
580 QAction* a = menu->addAction(text);
581 PythonQt::self()->addSignalHandler(a, SIGNAL(triggered(bool)), callable);
582 return a;
583 }
584 </inject-code>
585 </object-type>
586
587 <object-type name="QToolBar">
588 <inject-code class="pywrap-h">
589 QAction* addAction (QToolBar* menu, const QString &amp; text, PyObject* callable)
590 {
591 QAction* a = menu->addAction(text);
592 PythonQt::self()->addSignalHandler(a, SIGNAL(triggered(bool)), callable);
593 return a;
594 }
595
596 QAction* addAction (QToolBar* menu, const QIcon&amp; icon, const QString&amp; text, PyObject* callable)
597 {
598 QAction* a = menu->addAction(text);
599 a->setIcon(icon);
600 PythonQt::self()->addSignalHandler(a, SIGNAL(triggered(bool)), callable);
601 return a;
602 }
603 </inject-code>
604 </object-type>
605
556 <suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QPalette::NColorRoles" />
606 <suppress-warning text="WARNING(MetaJavaBuilder) :: Rejected enum has no alternative...: QPalette::NColorRoles" />
557 <suppress-warning text="WARNING(MetaJavaBuilder) :: Cannot find enum constant for value 'DragMove' in 'QDragMoveEvent' or any of its super classes" />
607 <suppress-warning text="WARNING(MetaJavaBuilder) :: Cannot find enum constant for value 'DragMove' in 'QDragMoveEvent' or any of its super classes" />
558
608
@@ -2110,17 +2110,6
2110 </modify-function>
2110 </modify-function>
2111 </object-type>
2111 </object-type>
2112 <object-type name="QMenu">
2112 <object-type name="QMenu">
2113 <modify-function signature="addAction(QAction *)" remove="all"/>
2114 <modify-function signature="addMenu(QMenu*)">
2115 <modify-argument index="1">
2116 <reference-count action="add" variable-name="__rcMenus"/>
2117 </modify-argument>
2118 </modify-function>
2119 <modify-function signature="insertMenu(QAction*,QMenu*)">
2120 <modify-argument index="2">
2121 <reference-count action="add" variable-name="__rcMenus"/>
2122 </modify-argument>
2123 </modify-function>
2124 <modify-function signature="insertSeparator(QAction*)">
2113 <modify-function signature="insertSeparator(QAction*)">
2125 <modify-argument index="1">
2114 <modify-argument index="1">
2126 <reference-count action="ignore"/>
2115 <reference-count action="ignore"/>
@@ -2139,47 +2128,28
2139 <modify-function signature="setNoReplayFor(QWidget*)">
2128 <modify-function signature="setNoReplayFor(QWidget*)">
2140 <remove/>
2129 <remove/>
2141 </modify-function>
2130 </modify-function>
2142 <modify-function signature="initStyleOption(QStyleOptionMenuItem*,const QAction*)const">
2131
2143 <access modifier="private"/>
2132 <inject-code class="pywrap-h">
2144 </modify-function>
2133 QAction* addAction (QMenu* menu, const QString &amp; text, PyObject* callable, const QKeySequence &amp; shortcut = 0) {
2145
2134 QAction* a = menu-&gt;addAction(text);
2146 <modify-function signature="addAction(QString,const QObject*,const char*,QKeySequence)">
2135 a-&gt;setShortcut(shortcut);
2147 <remove/>
2136 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2148 </modify-function>
2137 return a;
2149
2138 }
2150 <modify-function signature="addAction(QIcon,QString,const QObject*,const char*,QKeySequence)">
2139
2151 <remove/>
2140 QAction* addAction (QMenu* menu, const QIcon&amp; icon, const QString&amp; text, PyObject* callable, const QKeySequence&amp; shortcut = 0)
2152 </modify-function>
2141 {
2142 QAction* a = menu-&gt;addAction(text);
2143 a-&gt;setIcon(icon);
2144 a-&gt;setShortcut(shortcut);
2145 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2146 return a;
2147 }
2148 </inject-code>
2153 </object-type>
2149 </object-type>
2154
2150
2155 <object-type name="QMenuBar">
2151 <object-type name="QMenuBar">
2156 <modify-function signature="addAction(QAction *)" remove="all"/>
2157 <modify-function signature="addAction(QString,const QObject*,const char*)">
2158 <remove/>
2159 </modify-function>
2160
2152
2161 <modify-function signature="initStyleOption(QStyleOptionMenuItem*,const QAction*)const">
2162 <access modifier="private"/>
2163 </modify-function>
2164
2165 <modify-function signature="addMenu(QMenu*)">
2166 <modify-argument index="1">
2167 <reference-count action="add" variable-name="__rcMenus"/>
2168 </modify-argument>
2169 </modify-function>
2170 <modify-function signature="insertMenu(QAction*,QMenu*)">
2171 <modify-argument index="1">
2172 <reference-count action="ignore"/>
2173 </modify-argument>
2174 <modify-argument index="2">
2175 <reference-count action="add" variable-name="__rcMenus"/>
2176 </modify-argument>
2177 </modify-function>
2178 <modify-function signature="insertSeparator(QAction*)">
2179 <modify-argument index="1">
2180 <reference-count action="ignore"/>
2181 </modify-argument>
2182 </modify-function>
2183 <modify-function signature="setActiveAction(QAction*)">
2153 <modify-function signature="setActiveAction(QAction*)">
2184 <modify-argument index="1">
2154 <modify-argument index="1">
2185 <reference-count action="ignore"/>
2155 <reference-count action="ignore"/>
@@ -2190,6 +2160,15
2190 <reference-count action="ignore"/>
2160 <reference-count action="ignore"/>
2191 </modify-argument>
2161 </modify-argument>
2192 </modify-function>
2162 </modify-function>
2163
2164 <inject-code class="pywrap-h">
2165 QAction* addAction (QMenuBar* menu, const QString &amp; text, PyObject* callable)
2166 {
2167 QAction* a = menu-&gt;addAction(text);
2168 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
2169 return a;
2170 }
2171 </inject-code>
2193 </object-type>
2172 </object-type>
2194 <object-type name="QMotifStyle">
2173 <object-type name="QMotifStyle">
2195 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
2174 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
@@ -4874,16 +4853,6
4874 </object-type>
4853 </object-type>
4875
4854
4876 <object-type name="QToolBar">
4855 <object-type name="QToolBar">
4877 <modify-function signature="addAction(QAction *)" remove="all"/>
4878 <modify-function signature="initStyleOption(QStyleOptionToolBar*)const">
4879 <access modifier="private"/>
4880 </modify-function>
4881 <modify-function signature="addAction(QIcon,QString,const QObject*,const char*)">
4882 <remove/>
4883 </modify-function>
4884 <modify-function signature="addAction(QString,const QObject*,const char*)">
4885 <remove/>
4886 </modify-function>
4887 <modify-function signature="addWidget(QWidget*)">
4856 <modify-function signature="addWidget(QWidget*)">
4888 <modify-argument index="1">
4857 <modify-argument index="1">
4889 <define-ownership class="java" owner="c++"/>
4858 <define-ownership class="java" owner="c++"/>
@@ -4902,6 +4871,23
4902 <reference-count action="ignore"/>
4871 <reference-count action="ignore"/>
4903 </modify-argument>
4872 </modify-argument>
4904 </modify-function>
4873 </modify-function>
4874
4875 <inject-code class="pywrap-h">
4876 QAction* addAction (QToolBar* menu, const QString &amp; text, PyObject* callable)
4877 {
4878 QAction* a = menu-&gt;addAction(text);
4879 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
4880 return a;
4881 }
4882
4883 QAction* addAction (QToolBar* menu, const QIcon&amp; icon, const QString&amp; text, PyObject* callable)
4884 {
4885 QAction* a = menu-&gt;addAction(text);
4886 a-&gt;setIcon(icon);
4887 PythonQt::self()-&gt;addSignalHandler(a, SIGNAL(triggered(bool)), callable);
4888 return a;
4889 }
4890 </inject-code>
4905 </object-type>
4891 </object-type>
4906
4892
4907 <object-type name="QPaintEngine">
4893 <object-type name="QPaintEngine">
General Comments 0
You need to be logged in to leave comments. Login now