Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
39d4733
WIP: update generator to generate qt5 js api
Mar 19, 2012
8e3ba6b
WIP: update qtbindings to support qt5
Mar 19, 2012
dbd52ed
WIP: pass references from pointers
Mar 22, 2012
07f4edd
WIP: adjust typesystem for qt5
Mar 22, 2012
3ce7da1
WIP: rework typecasting between cpp and js
Mar 22, 2012
328c13a
revert QStringList changes back, but change type name generation to u…
Mar 24, 2012
c47b6b1
clean up code: remove unused code and comments
Mar 24, 2012
0f2cf79
refactor: move qt5 code inside the original versioning logic
Mar 24, 2012
d97cf2b
remove duplicate typesystem entries
Mar 25, 2012
8e5d965
qt5: add missing enums
Mar 25, 2012
2647321
Merge branch 'master' into 5.0
Oct 7, 2012
f9453e3
QT bindings are now possible to compile with QT5
Oct 9, 2012
2fed225
Generated files are set to be ignored by git
Oct 9, 2012
8bf9d70
Plugins use QT5 export api
Oct 9, 2012
411a41f
QMake finishes without warnings regarding unescaped backslash
Oct 9, 2012
c0506f2
added support for QT5 HEAD version
Oct 14, 2012
654fad5
separate debug and release destdirs
Oct 22, 2012
2c38425
fix typo
Nov 11, 2012
8027192
amend typesystem to be compatible with noaccessibility qt setup
Nov 11, 2012
d0302fb
add fake SSL related Qt classes when Qt is compiled without SSL support
Nov 11, 2012
7dcc62c
do not modify setFont method
Dec 15, 2012
a2317fb
compat with qt5 api changes
Dec 15, 2012
3dcf5fa
include required header
Dec 15, 2012
dcb59cd
* Split QtGui module into QtGui, QtWidgets, QtPrintSupport
Jul 10, 2013
a6777ca
jsx generator for Qt 5.1
Jul 10, 2013
55cf4d4
erase removed classes from network module
Jul 10, 2013
4ef712e
Merge branch '5.0' of https://github.com/shibukawa/qtscriptgenerator …
Jul 10, 2013
a78c877
add ignore types, fix qtsignal include files
Jul 10, 2013
bd75a77
fix some methods not to refer removed type
Jul 10, 2013
d8d4813
Merge branch '5.0' of https://github.com/shibukawa/qtscriptgenerator …
Jul 10, 2013
8c206a2
support 5.2 (create multimedia)
Dec 13, 2013
788bf71
Merge branch 'jsxgen_5.0' of github.com:shibukawa/qtscriptgenerator i…
Dec 13, 2013
1370ff2
add signal method renaming for JSX generator
Dec 13, 2013
f729a1a
Fix abstract function detection
phbaer Feb 27, 2016
3e5aa0f
Make enum detection more robust
phbaer Feb 27, 2016
af3842c
Do not declare some types as Qt meta types
phbaer Feb 27, 2016
1e28471
Add QtMultimdia generator
phbaer Feb 27, 2016
5bfb36d
Remove QNoImplicitBoolCast include
phbaer Feb 27, 2016
8f2facd
Remove QWebPluginFactory::Extension objects
phbaer Feb 27, 2016
ca466f7
Remove QMetaTypeFunctionHelper for some types
phbaer Feb 27, 2016
0841188
Add Qt and compiler version to readme
phbaer Feb 27, 2016
a560873
Fix compiler error C2582 with MSVC
phbaer Feb 27, 2016
658cb85
WebKitWidgets: Add Qt module printsupport
phbaer Feb 27, 2016
a54bb78
Add some debugging symbols configuration switches for Windows (MSVC)
phbaer Feb 27, 2016
966cc1a
Use forward slash for PDB path instead of backslash
phbaer Feb 27, 2016
91a7b65
Assign const char[] to const char* (Windows)
phbaer Apr 20, 2016
09d284d
Workaround for crash if declarator->id is nullptr. Basically as as "s…
phbaer Apr 20, 2016
af0d48f
Prevent loop that might occur when resolving a type
phbaer Apr 20, 2016
d277be0
Ignore new operator in QTextStream: operator<<(const QStringRef&)
phbaer Apr 20, 2016
b7756ea
Update README, change the currently supported compiler version.
phbaer Apr 20, 2016
61fbc88
Initial support for Qt5.7.0.
phbaer Apr 21, 2016
e68cfb3
Remove QtWebKit
phbaer Apr 26, 2016
437ba20
Do not set the PDB path explicitly under Windows.
phbaer Apr 26, 2016
ca33441
Fix compile error with msvc 2013
Nefast Jun 22, 2016
47e4d45
Merge pull request #1 from neFAST/patch-1
phbaer Jun 22, 2016
c689051
No need for `typename` in operator=() definition.
0xd34df00d Jul 24, 2016
d28996f
Merge pull request #2 from 0xd34df00d/typename_compilation_fix
phbaer Jul 27, 2016
3b6ebbb
Compatibility improvements for Qt 5.7.0
phbaer Oct 17, 2016
04af9c4
Fix assignment operator again for non-MSVC compilers
phbaer Oct 17, 2016
8240fa7
Extend compatibility info in README
phbaer Oct 17, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/doc/
/generated_cpp/
/plugins/
/qtbindings/*/debug/
/qtbindings/*/release/
/qtbindings/Makefile
/qtbindings/*/Makefile
/qtbindings/*/Makefile.Debug
/qtbindings/*/Makefile.Release
/generator/.preprocessed.tmp
/qtbindings/qs_eval/qs_eval

*.log
*.o
qtbindings/*/moc_*.cpp

/generator/generator
/generator/Makefile
/generator/Makefile.Debug
/generator/Makefile.Release
/generator/release/
.qmake.stash
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Qt Script Generator labs package, version 0.2


The Qt Script Generator is a tool that generates Qt bindings for Qt Script.
The Qt Script Generator is a tool that generates Qt bindings for Qt Script. This should work
with Qt 5.6.0/5.7.0 (tested with 5.7.0+ICU) and MSVC 2015 Update 3.

---

Expand Down
13 changes: 0 additions & 13 deletions examples/WebKitPlugins.html

This file was deleted.

147 changes: 0 additions & 147 deletions examples/WebKitPlugins.js

This file was deleted.

22 changes: 13 additions & 9 deletions generator/abstractmetabuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,21 +313,21 @@ void AbstractMetaBuilder::traverseStreamOperator(FunctionModelItem item)
}

void AbstractMetaBuilder::fixQObjectForScope(TypeDatabase *types,
NamespaceModelItem scope)
NamespaceModelItem scope)
{
foreach (ClassModelItem item, scope->classes()) {
QString qualified_name = item->qualifiedName().join("::");
TypeEntry *entry = types->findType(qualified_name);
if (entry) {
if (isQObject(qualified_name) && entry->isComplex()) {
if (isQObject(qualified_name) && entry->isComplex()) {
((ComplexTypeEntry *) entry)->setQObject(true);
}
}
}
}
}

foreach (NamespaceModelItem item, scope->namespaceMap().values()) {
if (scope != item)
fixQObjectForScope(types, item);
fixQObjectForScope(types, item);
}
}

Expand Down Expand Up @@ -876,9 +876,13 @@ void AbstractMetaBuilder::figureOutDefaultEnumArguments()
if (classes.front() != 0) {
classes << classes.front()->baseClass();

qDebug() << "Search enum value '" << expr << "' in '" << meta_class->name() << "' and its super classes";

AbstractMetaClassList interfaces = classes.front()->interfaces();
foreach (AbstractMetaClass *interface, interfaces)
classes << interface->primaryInterfaceImplementor();
foreach (AbstractMetaClass *interface, interfaces) {
if(classes.front() != interface->primaryInterfaceImplementor())
classes << interface->primaryInterfaceImplementor();
}

e = classes.front()->findEnumForValue(expr);
}
Expand Down Expand Up @@ -1524,7 +1528,7 @@ AbstractMetaFunction *AbstractMetaBuilder::traverseFunction(FunctionModelItem fu
if (!meta_function->isAbstract())
*meta_function += AbstractMetaAttributes::Native;

if (!function_item->isVirtual())
if (!function_item->isVirtual() && !meta_function->isAbstract())
*meta_function += AbstractMetaAttributes::Final;

if (function_item->isInvokable())
Expand Down Expand Up @@ -1799,7 +1803,7 @@ AbstractMetaType *AbstractMetaBuilder::translateType(const TypeInfo &_typei, boo
return t;

ClassModelItem item = m_dom->findClass(contexts.at(0));
if (item != 0)
if (item)
contexts += item->baseClasses();
contexts.pop_front();

Expand Down
54 changes: 49 additions & 5 deletions generator/abstractmetalang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ AbstractMetaType *AbstractMetaType::copy() const
cpy->setConstant(isConstant());
cpy->setReference(isReference());
cpy->setIndirections(indirections());
cpy->setInstantiations(instantiations());
cpy->setInstantiations(instantiations());
cpy->setArrayElementCount(arrayElementCount());
cpy->setOriginalTypeDescription(originalTypeDescription());
cpy->setOriginalTemplateType(originalTemplateType() ? originalTemplateType()->copy() : 0);
Expand Down Expand Up @@ -439,7 +439,7 @@ bool AbstractMetaFunction::resetObjectAfterUse(int argument_idx) const
QList<ArgumentModification> argumentModifications = modification.argument_mods;
foreach (ArgumentModification argumentModification, argumentModifications) {
if (argumentModification.index == argument_idx && argumentModification.reset_after_use)
return true;
return true;
}
}

Expand Down Expand Up @@ -1169,7 +1169,7 @@ QPropertySpec *AbstractMetaClass::propertySpecForReset(const QString &name) cons
static bool functions_contains(const AbstractMetaFunctionList &l, const AbstractMetaFunction *func)
{
foreach (const AbstractMetaFunction *f, l) {
if ((f->compareTo(func) & AbstractMetaFunction::PrettySimilar) == AbstractMetaFunction::PrettySimilar)
if ((f->compareTo(func) & AbstractMetaFunction::PrettySimilar) == AbstractMetaFunction::PrettySimilar)
return true;
}
return false;
Expand Down Expand Up @@ -1862,19 +1862,63 @@ QString AbstractMetaType::minimalSignature() const
if (isConstant())
minimalSignature += "const ";
minimalSignature += typeEntry()->qualifiedCppName();
if (hasInstantiations()) {
if (hasInstantiationInCpp()) {
QList<AbstractMetaType *> instantiations = this->instantiations();
minimalSignature += "<";
for (int i=0;i<instantiations.size();++i) {
if (i > 0)
minimalSignature += ",";
minimalSignature += instantiations.at(i)->minimalSignature();
}
minimalSignature += ">";
minimalSignature += " >";
}

for (int j=0; j<indirections(); ++j)
minimalSignature += "*";
if (isReference())
minimalSignature += "&";

return minimalSignature;
}

QString AbstractMetaType::minimalRef2PtrSignature() const
{
QString minimalSignature;
// if (isConstant())
// minimalSignature += "const ";
minimalSignature += typeEntry()->qualifiedCppName();
if (hasInstantiationInCpp()) {
QList<AbstractMetaType *> instantiations = this->instantiations();
minimalSignature += "<";
for (int i=0;i<instantiations.size();++i) {
if (i > 0)
minimalSignature += ",";
minimalSignature += instantiations.at(i)->minimalSignature();
}
minimalSignature += " >";
}

for (int j=0; j<actualIndirections(); ++j)
minimalSignature += "*";

return minimalSignature;
}

QString AbstractMetaType::minimalNoRefNoConstSignature() const
{
QString minimalSignature;
minimalSignature += typeEntry()->qualifiedCppName();
if (hasInstantiationInCpp()) {
QList<AbstractMetaType *> instantiations = this->instantiations();
minimalSignature += "<";
for (int i=0;i<instantiations.size();++i) {
if (i > 0)
minimalSignature += ",";
minimalSignature += instantiations.at(i)->minimalSignature();
}
minimalSignature += " >";
}

for (int j=0; j<indirections(); ++j)
minimalSignature += "*";

Expand Down
4 changes: 3 additions & 1 deletion generator/abstractmetalang.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,14 @@ class AbstractMetaType
// true when use pattern is container
bool hasInstantiations() const { return !m_instantiations.isEmpty(); }
void addInstantiation(AbstractMetaType *inst) { m_instantiations << inst; }
void setInstantiations(const QList<AbstractMetaType *> &insts) { m_instantiations = insts; }
void setInstantiations(const QList<AbstractMetaType *> &insts) { m_instantiations = insts; }
QList<AbstractMetaType *> instantiations() const { return m_instantiations; }
void setInstantiationInCpp(bool incpp) { m_cpp_instantiation = incpp; }
bool hasInstantiationInCpp() const { return hasInstantiations() && m_cpp_instantiation; }

QString minimalSignature() const;
QString minimalRef2PtrSignature() const;
QString minimalNoRefNoConstSignature() const;

// true when the type is a QtJambiObject subclass
bool hasNativeId() const;
Expand Down
5 changes: 3 additions & 2 deletions generator/build_all.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<typesystem>
<load-typesystem name="typesystem_core.xml" generate="yes" />
<load-typesystem name="typesystem_gui.xml" generate="yes" />
<load-typesystem name="typesystem_printsupport.xml" generate="yes" />
<load-typesystem name="typesystem_widgets.xml" generate="yes" />
<load-typesystem name="typesystem_multimedia.xml" generate="yes" />
<load-typesystem name="typesystem_sql.xml" generate="yes" />
<load-typesystem name="typesystem_opengl.xml" generate="yes" />
<load-typesystem name="typesystem_svg.xml" generate="yes" />
<load-typesystem name="typesystem_network.xml" generate="yes" />
<load-typesystem name="typesystem_xml.xml" generate="yes" />
<load-typesystem name="typesystem_phonon.xml" generate="yes" />
<load-typesystem name="typesystem_webkit.xml" generate="yes" />
<load-typesystem name="typesystem_xmlpatterns.xml" generate="yes" />
<load-typesystem name="typesystem_uitools.xml" generate="yes" />
</typesystem>
5 changes: 0 additions & 5 deletions generator/build_phonon.txt

This file was deleted.

6 changes: 6 additions & 0 deletions generator/build_printsupport.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<typesystem>
<load-typesystem name="typesystem_core.xml" generate="no" />
<load-typesystem name="typesystem_gui.xml" generate="no" />
<load-typesystem name="typesystem_widgets.xml" generate="no" />
<load-typesystem name="typesystem_printsupport.xml" generate="yes" />
</typesystem>
Loading