Skip to content

Commit 91faba9

Browse files
committed
update to Qt 4.6 xml files
1 parent 7d79d0b commit 91faba9

24 files changed

Lines changed: 3520 additions & 2551 deletions

generator/merge.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
xsltproc -o typesystem_core.xml --stringparam source 'typesystem_core-qtscript.xml' merge.xsl typesystem_core-common.xml
4+
xsltproc -o typesystem_gui.xml --stringparam source 'typesystem_gui-qtscript.xml' merge.xsl typesystem_gui-common.xml
5+
xsltproc -o typesystem_opengl.xml --stringparam source 'typesystem_opengl-qtscript.xml' merge.xsl typesystem_opengl-common.xml
6+
xsltproc -o typesystem_network.xml --stringparam source 'typesystem_network-qtscript.xml' merge.xsl typesystem_network-common.xml
7+
xsltproc -o typesystem_xml.xml --stringparam source 'typesystem_xml-qtscript.xml' merge.xsl typesystem_xml-common.xml
8+
xsltproc -o typesystem_webkit.xml --stringparam source 'typesystem_webkit-qtscript.xml' merge.xsl typesystem_webkit-common.xml
9+
xsltproc -o typesystem_sql.xml --stringparam source 'typesystem_sql-qtscript.xml' merge.xsl typesystem_sql-common.xml
10+
xsltproc -o typesystem_svg.xml --stringparam source 'typesystem_svg-qtscript.xml' merge.xsl typesystem_svg-common.xml
11+
xsltproc -o typesystem_xmlpatterns.xml --stringparam source 'typesystem_xmlpatterns-qtscript.xml' merge.xsl typesystem_xmlpatterns-common.xml

generator/parser/rpp/pp-engine-bits.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,14 +383,16 @@ template <typename _InputIterator, typename _OutputIterator>
383383
_InputIterator pp::handle_include (bool __skip_current_path, _InputIterator __first, _InputIterator __last,
384384
_OutputIterator __result)
385385
{
386+
std::cout << env.current_file << std::endl;
386387
if (pp_isalpha (*__first) || *__first == '_')
387388
{
388389
pp_macro_expander expand_include (env);
389390
std::string name;
390391
name.reserve (255);
391392
expand_include (__first, __last, std::back_inserter (name));
392393
std::string::iterator it = skip_blanks (name.begin (), name.end ());
393-
assert (it != name.end () && (*it == '<' || *it == '"'));
394+
printf("%s", name.c_str());
395+
assert((it != name.end () && (*it == '<' || *it == '"')));
394396
handle_include (__skip_current_path, it, name.end (), __result);
395397
return __first;
396398
}
@@ -416,7 +418,7 @@ _InputIterator pp::handle_include (bool __skip_current_path, _InputIterator __fi
416418

417419
std::string filepath;
418420
FILE *fp = find_include_file (filename, &filepath, quote == '>' ? INCLUDE_GLOBAL : INCLUDE_LOCAL, __skip_current_path);
419-
421+
420422
#if defined (PP_HOOK_ON_FILE_INCLUDED)
421423
PP_HOOK_ON_FILE_INCLUDED (env.current_file, fp ? filepath : filename, fp);
422424
#endif

generator/setupgenerator.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void SetupGenerator::generate()
123123
}
124124

125125
// declare individual class creation functions
126-
s << "void PythonQt_init_" << shortPackName << "() {" << endl;
126+
s << "void PythonQt_init_" << shortPackName << "(PyObject* module) {" << endl;
127127

128128
if (shortPackName.endsWith("Builtin")) {
129129
shortPackName = shortPackName.mid(0, shortPackName.length()-strlen("builtin"));
@@ -135,12 +135,14 @@ void SetupGenerator::generate()
135135
QString shellCreator;
136136
if (cls->generateShellClass()) {
137137
shellCreator = ", PythonQtSetInstanceWrapperOnShell<" + ShellGenerator::shellClassName(cls) + ">";
138+
} else {
139+
shellCreator = ", NULL";
138140
}
139141
if (cls->isQObject()) {
140-
s << "PythonQt::self()->registerClass(&" << cls->qualifiedCppName() << "::staticMetaObject, \"" << shortPackName <<"\", PythonQtCreateObject<PythonQtWrapper_" << cls->name() << ">" << shellCreator << ");" << endl;
142+
s << "PythonQt::priv()->registerClass(&" << cls->qualifiedCppName() << "::staticMetaObject, \"" << shortPackName <<"\", PythonQtCreateObject<PythonQtWrapper_" << cls->name() << ">" << shellCreator << ", module);" << endl;
141143
} else {
142144
QString baseName = cls->baseClass()?cls->baseClass()->qualifiedCppName():"";
143-
s << "PythonQt::self()->registerCPPClass(\""<< cls->qualifiedCppName() << "\", \"" << baseName << "\", \"" << shortPackName <<"\", PythonQtCreateObject<PythonQtWrapper_" << cls->name() << ">" << shellCreator << ");" << endl;
145+
s << "PythonQt::priv()->registerCPPClass(\""<< cls->qualifiedCppName() << "\", \"" << baseName << "\", \"" << shortPackName <<"\", PythonQtCreateObject<PythonQtWrapper_" << cls->name() << ">" << shellCreator << ", module);" << endl;
144146
}
145147
foreach(AbstractMetaClass* interface, cls->interfaces()) {
146148
// the interface might be our own class... (e.g. QPaintDevice)

generator/shellgenerator.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ bool ShellGenerator::shouldGenerate(const AbstractMetaClass *meta_class) const
5252
if (meta_class->name().startsWith("Global")) return false;
5353
if (meta_class->name().startsWith("QStyleOptionComplex")) return false;
5454
if (meta_class->name().startsWith("QTextLayout")) return false;
55-
//if (meta_class->name().startsWith("QTextStream")) return false; // because of >> operators
56-
//if (meta_class->name().startsWith("QDataStream")) return false; // "
55+
if (meta_class->name().startsWith("QPersistentModelIndex")) return false;
5756
return ((cg & TypeEntry::GenerateCode) != 0);
5857
}
5958

generator/shellimplgenerator.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "shellimplgenerator.h"
4343
#include "reporthandler.h"
4444
#include "fileout.h"
45+
#include <iostream>
4546

4647
extern void declareFunctionMetaTypes(QTextStream &stream,
4748
const AbstractMetaFunctionList &functions,
@@ -61,12 +62,18 @@ static void writeHelperCode(QTextStream &s, const AbstractMetaClass *)
6162
{
6263
}
6364

65+
66+
6467
void ShellImplGenerator::write(QTextStream &s, const AbstractMetaClass *meta_class)
6568
{
6669
QString builtIn = ShellGenerator::isBuiltIn(meta_class->name())?"_builtin":"";
6770
QString pro_file_name = meta_class->package().replace(".", "_") + builtIn + "/" + meta_class->package().replace(".", "_") + builtIn + ".pri";
6871
priGenerator->addSource(pro_file_name, fileNameForClass(meta_class));
6972

73+
foreach (AbstractMetaField* field, meta_class->fields()) {
74+
std::cout << "Not yet generated fields: " << meta_class->qualifiedCppName().toLatin1().data() << "::" << field->name().toLatin1().data() << std::endl;
75+
}
76+
7077
s << "#include \"PythonQtWrapper_" << meta_class->name() << ".h\"" << endl << endl;
7178

7279
s << "#include <PythonQtSignalReceiver.h>" << endl;

0 commit comments

Comments
 (0)