Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
omix committed Jul 25, 2023
1 parent 0fbd3fe commit af50791
Show file tree
Hide file tree
Showing 227 changed files with 20,186 additions and 10,453 deletions.
10 changes: 5 additions & 5 deletions README.md → README
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ to your project:
<version>$VERSION</version>
</dependency>
```
(exchange `$VERSION` either by `5.15.15` or by `6.5.1`).
(exchange `$VERSION` either by `5.15.16` or by `6.5.2`).

Otherwise, download QtJambi JAR file from [Maven Central Repository](https://search.maven.org/artifact/io.qtjambi/qtjambi/).

Expand All @@ -135,7 +135,7 @@ public class Test {
Compile the file:

``` powershell
javac -cp qtjambi-6.5.1.jar Test.java
javac -cp qtjambi-6.5.2.jar Test.java
```

### Execute Example
Expand All @@ -154,19 +154,19 @@ In case your Linux distribution provides Qt (of correct version) as system libra
The example program can be executed this way on Windows:

``` powershell
java -cp qtjambi-6.5.1.jar;. -Djava.library.path=C:\Qt\6.5.1\msvc2019_64\bin Test
java -cp qtjambi-6.5.2.jar;. -Djava.library.path=C:\Qt\6.5.1\msvc2019_64\bin Test
```

On Linux it looks this way:

``` bash
java -cp qtjambi-6.5.1.jar:. -Djava.library.path=<path to>/Qt/6.5.1/gcc_64/lib Test
java -cp qtjambi-6.5.2.jar:. -Djava.library.path=<path to>/Qt/6.5.1/gcc_64/lib Test
```

On macOS you additionally need to use the start parameter -XstartOnFirstThread:

``` bash
java -cp qtjambi-6.5.1.jar:. -Djava.library.path=<path to>/Qt/6.5.1/macos/lib -XstartOnFirstThread Test
java -cp qtjambi-6.5.2.jar:. -Djava.library.path=<path to>/Qt/6.5.1/macos/lib -XstartOnFirstThread Test
```

In general, you can start learning how to use Qt in Java [as it is introduced for C++](https://doc.qt.io/qt-6/gettingstarted.html#create-your-first-applications).
Expand Down
2 changes: 2 additions & 0 deletions antfiles/autotests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<exclude name="io/qt/**/Test*Xmlpatterns.java" unless="${qtjambi.xmlpatterns.any.true}"/>
<exclude name="io/qt/**/Test*XmlPatterns.java" unless="${qtjambi.xmlpatterns.any.true}"/>
<exclude name="io/qt/**/Test*Charts.java" unless="${qtjambi.charts.any.true}"/>
<exclude name="io/qt/**/Test*Graphs.java" unless="${qtjambi.graphs.any.true}"/>
<exclude name="io/qt/**/Test*DataVis.java" unless="${qtjambi.datavisualization.any.true}"/>
<exclude name="io/qt/**/Test*DataVisualization.java" unless="${qtjambi.datavisualization.any.true}"/>
<exclude name="io/qt/**/Test*SpatialAudio.java" unless="${qtjambi.spatialaudio.any.true}"/>
Expand Down Expand Up @@ -132,6 +133,7 @@
<exclude name="io/qt/**/TestVirtualKeyboard*.java" unless="${qtjambi.virtualkeyboard.any.true}"/>
<exclude name="io/qt/**/TestSpatialAudio*.java" unless="${qtjambi.spatialaudio.any.true}"/>
<exclude name="io/qt/**/TestCharts*.java" unless="${qtjambi.charts.any.true}"/>
<exclude name="io/qt/**/TestGraphs*.java" unless="${qtjambi.graphs.any.true}"/>
<exclude name="io/qt/**/TestDataVis*.java" unless="${qtjambi.datavisualization.any.true}"/>
<exclude name="io/qt/**/TestQuick3D*.java" unless="${qtjambi.quick3d.any.true}"/>
<exclude name="io/qt/**/TestQml*.java" unless="${qtjambi.qml.any.true}"/>
Expand Down
18 changes: 18 additions & 0 deletions antfiles/generator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
<target name="tools.generator.run" unless="${skip-generate}">
<mkdir dir="${generator.outputdir}"/>
<!--options="- - debug-level=full"-->
<if>
<istrue value="${qtjambi.graphs.any.true}"/>
<then>
<generator dir="${generator.builddir}/../bin"
importdirectories="${basedir}/src/cpp/QtJambiGenerator"
outputDirectory="${generator.outputdir}"
generatorDirectory="${generator.builddir}/../bin"
nullness="${qtjambi.generate.nullness}"
kotlinpropertydelegates="${qtjambi.generate.kotlin.delegates}"
qtdocdirectory="${qtjambi.qt.docdir}"
qtlibdirectory="${generator.builddir}/../lib${psep}${tools.qt.libdir}"
qtbindirectory="${generator.builddir}/../bin${psep}${tools.qt.bindir}"
includeDirectories="${qtjambi.qt.includedir};${basedir}/src/cpp/QtJambiGenerator/targets;${generator.includepaths};${generator.extra.includes}"
typesystem=":/io/qtjambi/generator/targets/graphs.qml"
header=":/io/qtjambi/generator/targets/graphs.h"
/>
</then>
</if>
<generator dir="${generator.builddir}/../bin"
importdirectories="${basedir}/src/cpp/QtJambiGenerator"
outputDirectory="${generator.outputdir}"
Expand Down
9 changes: 5 additions & 4 deletions antfiles/native.xml
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,10 @@
<target name="create-qtlib-native-bundle">
<if>
<not>
<available file="${deploymentdir}/qt-lib-core-native-${qtjambi.osname}${platformjar.debug.suffix}-${qtjambi.version.bundle}.jar"/>
<available file="${deploymentdir}/native/qt-lib-core-native-${qtjambi.osname}${platformjar.debug.suffix}-${qtjambi.version.bundle}.jar"/>
</not>
<then>
<echo>${deploymentdir}/qt-lib-core-native-${qtjambi.osname}${platformjar.debug.suffix}-${qtjambi.version.bundle}.jar not available.</echo>
<echo>${deploymentdir}/native/qt-lib-core-native-${qtjambi.osname}${platformjar.debug.suffix}-${qtjambi.version.bundle}.jar not available.</echo>
<trycatch>
<try>
<if>
Expand Down Expand Up @@ -350,7 +350,7 @@
<jvmarg value="-Xcheck:jni"/-->
<arg value="qt" />
<arg value="--configuration=${debug.conf}" />
<arg value="--dir=${deploymentdir}" />
<arg value="--dir=${deploymentdir}/native" />
<arg value="--platform=${qtjambi.osname}" />
<arg value="--bins=${qtjambi.qt.bindir}" />
<arg value="--libs=${qtjambi.qt.libdir}" />
Expand All @@ -362,7 +362,8 @@
<arg value="${force}" />
<env key="DYLD_LIBRARY_PATH" value="${librarypath}" />
<classpath>
<fileset dir="${deploymentdir}" includes="qtjambi-${qtjambi.jar.version}.jar,qtjambi-deployer-${qtjambi.jar.version}.jar,qtjambi-deployer-native-*-${qtjambi.jar.version}.jar"/>
<fileset dir="${deploymentdir}" includes="qtjambi-${qtjambi.jar.version}.jar,qtjambi-deployer-${qtjambi.jar.version}.jar"/>
<fileset dir="${deploymentdir}/native" includes="qtjambi-deployer-native-*-${qtjambi.jar.version}.jar"/>
</classpath>
</java>
</try>
Expand Down
5 changes: 3 additions & 2 deletions releases.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
5.15=15
5.15=16
6.0=2
6.1=2
6.2=13
6.3=7
6.4=5
6.5=1
6.5=2
6.6=0
12 changes: 6 additions & 6 deletions src/cpp/QtJambi/cast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,16 @@ void test(JNIEnv *env){
{
InternalToExternalConverter c1;
InternalToExternalConverter c2 = c1;
InternalToExternalConverter c3 = [](JNIEnv*, QtJambiScope*, const void*, jvalue*, bool)->bool{return false;};
InternalToExternalConverter c4([](JNIEnv*, QtJambiScope*, const void*, jvalue*, bool)->bool{return false;});
InternalToExternalConverter c5(InternalToExternalConverter([](JNIEnv*, QtJambiScope*, const void*, jvalue*, bool)->bool{return false;}));
InternalToExternalConverter c3 = [](JNIEnv*, QtJambiScope*, const void*, jvalue&, bool)->bool{return false;};
InternalToExternalConverter c4([](JNIEnv*, QtJambiScope*, const void*, jvalue&, bool)->bool{return false;});
InternalToExternalConverter c5(InternalToExternalConverter([](JNIEnv*, QtJambiScope*, const void*, jvalue&, bool)->bool{return false;}));
}
{
ExternalToInternalConverter c1;
ExternalToInternalConverter c2 = c1;
ExternalToInternalConverter c3 = [](JNIEnv*, QtJambiScope*, const jvalue&, void* &, jValueType)->bool{return false;};
ExternalToInternalConverter c4([](JNIEnv*, QtJambiScope*, const jvalue&, void* &, jValueType)->bool{return false;});
ExternalToInternalConverter c5(ExternalToInternalConverter([](JNIEnv*, QtJambiScope*, const jvalue&, void* &, jValueType)->bool{return false;}));
ExternalToInternalConverter c3 = [](JNIEnv*, QtJambiScope*, jvalue, void* &, jValueType)->bool{return false;};
ExternalToInternalConverter c4([](JNIEnv*, QtJambiScope*, jvalue, void* &, jValueType)->bool{return false;});
ExternalToInternalConverter c5(ExternalToInternalConverter([](JNIEnv*, QtJambiScope*, jvalue, void* &, jValueType)->bool{return false;}));
}
{
QStringList l;
Expand Down
2 changes: 2 additions & 0 deletions src/cpp/QtJambi/configure.pri
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ VER_MAJ = $$section(VERSION, ., 0, 0)
VER_MIN = $$section(VERSION, ., 1, 1)
VER_PAT = $$section(VERSION, ., 2, 2)

DEFINES += QT_DISABLE_DEPRECATED_UP_TO=0x050000

isEmpty(QTJAMBI_PROJECT):{
QTJAMBI_PROJECT = $$TARGET
}
Expand Down
12 changes: 6 additions & 6 deletions src/cpp/QtJambi/containeraccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2334,10 +2334,10 @@ AbstractContainerAccess* createPreparedContainerAccess(JNIEnv* env, SequentialCo
#endif
isPointer,
hashFunction,
[](JNIEnv*, QtJambiScope*, const void*, jvalue*, bool)->bool{
[](JNIEnv*, QtJambiScope*, const void*, jvalue&, bool)->bool{
return false;
},
[](JNIEnv*, QtJambiScope*, const jvalue&, void* &, jValueType) -> bool{
[](JNIEnv*, QtJambiScope*, jvalue, void* &, jValueType) -> bool{
return false;
});
}
Expand Down Expand Up @@ -2391,21 +2391,21 @@ AbstractContainerAccess* createPreparedContainerAccess(JNIEnv* env, AssociativeC
align1, size1,
isPointer1,
hashFunction1,
[](JNIEnv*, QtJambiScope*, const void*, jvalue*, bool)->bool{
[](JNIEnv*, QtJambiScope*, const void*, jvalue&, bool)->bool{
return false;
},
[](JNIEnv*, QtJambiScope*, const jvalue&, void* &, jValueType) -> bool{
[](JNIEnv*, QtJambiScope*, jvalue, void* &, jValueType) -> bool{
return false;
},
isPointer2 && !memberMetaType2.isValid() ? voidPtr : memberMetaType2,
align2,
size2,
isPointer2,
hashFunction2,
[](JNIEnv*, QtJambiScope*, const void*, jvalue*, bool)->bool{
[](JNIEnv*, QtJambiScope*, const void*, jvalue&, bool)->bool{
return false;
},
[](JNIEnv*, QtJambiScope*, const jvalue&, void* &, jValueType) -> bool{
[](JNIEnv*, QtJambiScope*, jvalue, void* &, jValueType) -> bool{
return false;
});
return containerAccess;
Expand Down
6 changes: 3 additions & 3 deletions src/cpp/QtJambi/containeraccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ class SequentialConstIteratorAccess : public AbstractSequentialConstIteratorAcce
jvalue _value;
_value.l = nullptr;
QTJAMBI_ELEMENT_LOCKER
bool success = m_internalToExternalConverter(env, nullptr, &(*(*iter)), &_value, true);
bool success = m_internalToExternalConverter(env, nullptr, &(*(*iter)), _value, true);
if(success){
return _value.l;
}
Expand Down Expand Up @@ -588,7 +588,7 @@ class AssociativeConstIteratorAccess : public AbstractAssociativeConstIteratorAc
jvalue _value;
_value.l = nullptr;
QTJAMBI_KEY_VALUE_LOCKER
bool success = m_valueInternalToExternalConverter(env, nullptr, &(iter->value()), &_value, true);
bool success = m_valueInternalToExternalConverter(env, nullptr, &(iter->value()), _value, true);
if(success){
return _value.l;
}
Expand All @@ -600,7 +600,7 @@ class AssociativeConstIteratorAccess : public AbstractAssociativeConstIteratorAc
jvalue _value;
_value.l = nullptr;
QTJAMBI_KEY_VALUE_LOCKER
bool success = m_keyInternalToExternalConverter(env, nullptr, &(iter->key()), &_value, true);
bool success = m_keyInternalToExternalConverter(env, nullptr, &(iter->key()), _value, true);
if(success){
return _value.l;
}
Expand Down
20 changes: 10 additions & 10 deletions src/cpp/QtJambi/containeraccess_hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ jobject AutoHashAccess::nodeKey(JNIEnv * env, Node* node)
jvalue jv;
jv.l = nullptr;
if(node)
m_keyInternalToExternalConverter(env, nullptr, reinterpret_cast<char*>(node)+m_offset1, &jv, true);
m_keyInternalToExternalConverter(env, nullptr, reinterpret_cast<char*>(node)+m_offset1, jv, true);
return jv.l;
}

Expand All @@ -628,7 +628,7 @@ jobject AutoHashAccess::nodeValue(JNIEnv * env, Node* node)
jvalue jv;
jv.l = nullptr;
if(node)
m_valueInternalToExternalConverter(env, nullptr, reinterpret_cast<char*>(node)+m_offset2, &jv, true);
m_valueInternalToExternalConverter(env, nullptr, reinterpret_cast<char*>(node)+m_offset2, jv, true);
return jv.l;
}

Expand Down Expand Up @@ -1349,7 +1349,7 @@ jobject AutoHashAccess::find(JNIEnv * env, QtJambiNativeID ownerId, void* contai
QtJambiScope scope;
void* akey = nullptr;
if(m_keyExternalToInternalConverter(env, &scope, jv, akey, jValueType::l)){
auto it = d->find(*this, key);
auto it = d->find(*this, akey);
if (it.isUnused())
it = d->end(*this);
return createIterator(env, ownerId, new iterator(it));
Expand Down Expand Up @@ -1383,7 +1383,7 @@ jobject AutoHashAccess::constFind(JNIEnv * env, QtJambiNativeID ownerId, const v
QtJambiScope scope;
void* akey = nullptr;
if(m_keyExternalToInternalConverter(env, &scope, jv, akey, jValueType::l)){
auto it = d->find(*this, key);
auto it = d->find(*this, akey);
if (it.isUnused())
it = d->end(*this);
return createConstIterator(env, ownerId, new iterator(it));
Expand Down Expand Up @@ -1419,7 +1419,7 @@ jobject AutoHashAccess::key(JNIEnv *env, const void* container, jobject value, j
if (m_valueMetaType.equals(i.value(), value)){
jvalue jv;
jv.l = nullptr;
m_keyInternalToExternalConverter(env, nullptr, i.key(), &jv, true);
m_keyInternalToExternalConverter(env, nullptr, i.key(), jv, true);
return jv.l;
}
++i;
Expand Down Expand Up @@ -1449,7 +1449,7 @@ jobject AutoHashAccess::value(JNIEnv *env, const void* container, jobject key, j
if (!iter.isUnused()){
jvalue jv;
jv.l = nullptr;
m_valueInternalToExternalConverter(env, nullptr, iterator(iter).value(), &jv, true);
m_valueInternalToExternalConverter(env, nullptr, iterator(iter).value(), jv, true);
return jv.l;
}
#endif
Expand Down Expand Up @@ -2207,7 +2207,7 @@ jobject AutoHashAccess::keys(JNIEnv *env, const void* container)
while (n != e) {
jvalue jv;
jv.l = nullptr;
m_keyInternalToExternalConverter(env, nullptr, n.key(), &jv, true);
m_keyInternalToExternalConverter(env, nullptr, n.key(), jv, true);
listAccess->insert(env, listContainer, idx++, 1, jv.l);
++n;
}
Expand Down Expand Up @@ -2267,7 +2267,7 @@ jobject AutoHashAccess::keys(JNIEnv *env, const void* container, jobject value)
if(m_valueMetaType.equals(n.value(), _qvaluePtr)){
jvalue jv;
jv.l = nullptr;
m_keyInternalToExternalConverter(env, nullptr, n.key(), &jv, true);
m_keyInternalToExternalConverter(env, nullptr, n.key(), jv, true);
listAccess->insert(env, listContainer, idx++, 1, jv.l);
}
++n;
Expand Down Expand Up @@ -2350,7 +2350,7 @@ jobject AutoHashAccess::take(JNIEnv *env, void* container, jobject key)
if (!it.isUnused()){
jvalue jv;
jv.l = nullptr;
m_valueInternalToExternalConverter(env, nullptr, it.value(), &jv, true);
m_valueInternalToExternalConverter(env, nullptr, it.value(), jv, true);
d->erase(*this, it);
return jv.l;
}
Expand Down Expand Up @@ -2400,7 +2400,7 @@ jobject AutoHashAccess::values(JNIEnv *env, const void* container)
while (n != e) {
jvalue jv;
jv.l = nullptr;
m_valueInternalToExternalConverter(env, nullptr, n.value(), &jv, true);
m_valueInternalToExternalConverter(env, nullptr, n.value(), jv, true);
listAccess->insert(env, listContainer, idx++, 1, jv.l);
++n;
}
Expand Down
6 changes: 3 additions & 3 deletions src/cpp/QtJambi/containeraccess_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ class GenericHashAccess : public AbstractHashAccess{
if(m_valueExternalToInternalConverter(env, nullptr, jv, _qvaluePtr, jValueType::l)){
K _qkey = reinterpret_cast<const QHash<K,T> *>(container)->key(_qvalue, _qdefaultkey);
jv.l = nullptr;
if(m_keyInternalToExternalConverter(env, nullptr, &_qkey, &jv, true)){
if(m_keyInternalToExternalConverter(env, nullptr, &_qkey, jv, true)){
result = jv.l;
}
}
Expand Down Expand Up @@ -470,7 +470,7 @@ class GenericHashAccess : public AbstractHashAccess{
T _qvalue = reinterpret_cast<QHash<K,T> *>(container)->take(_qkey);
jvalue _value;
_value.l = nullptr;
if(m_valueInternalToExternalConverter(env, nullptr, &_qvalue, &_value, true)){
if(m_valueInternalToExternalConverter(env, nullptr, &_qvalue, _value, true)){
result = _value.l;
}
}
Expand All @@ -493,7 +493,7 @@ class GenericHashAccess : public AbstractHashAccess{
if(m_valueExternalToInternalConverter(env, nullptr, jv, _qdefaultValuePtr, jValueType::l)){
T _qvalue = reinterpret_cast<const QHash<K,T> *>(container)->value(_qkey, _qdefaultValue);
jv.l = nullptr;
if(m_valueInternalToExternalConverter(env, nullptr, &_qvalue, &jv, true)){
if(m_valueInternalToExternalConverter(env, nullptr, &_qvalue, jv, true)){
result = jv.l;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/QtJambi/containeraccess_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobject AutoSequentialConstIteratorAccess::value(JNIEnv * env, const void* itera
const void* v = m_value(iterator);
jvalue jval;
jval.l = nullptr;
if(m_internalToExternalConverter(env, nullptr, v, &jval, true))
if(m_internalToExternalConverter(env, nullptr, v, jval, true))
return jval.l;
return nullptr;
}
Expand Down Expand Up @@ -117,7 +117,7 @@ jobject AutoAssociativeConstIteratorAccess::key(JNIEnv * env, const void* iterat
const void* v = m_key(iterator);
jvalue jval;
jval.l = nullptr;
if(m_keyInternalToExternalConverter(env, nullptr, v, &jval, true))
if(m_keyInternalToExternalConverter(env, nullptr, v, jval, true))
return jval.l;
return nullptr;
}
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/QtJambi/containeraccess_linkedlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ jobject AutoLinkedListAccess::first(JNIEnv * env, const void* container)
Q_ASSERT(d->size>0);
jvalue _value;
_value.l = nullptr;
if(m_internalToExternalConverter(env, nullptr, &reinterpret_cast<const Node*>(d)->n->t, &_value, true))
if(m_internalToExternalConverter(env, nullptr, &reinterpret_cast<const Node*>(d)->n->t, _value, true))
return _value.l;
return nullptr;
}
Expand All @@ -514,7 +514,7 @@ jobject AutoLinkedListAccess::last(JNIEnv * env, const void* container)
Q_ASSERT(d->size>0);
jvalue _value;
_value.l = nullptr;
if(m_internalToExternalConverter(env, nullptr, &reinterpret_cast<const Node*>(d)->p->t, &_value, true))
if(m_internalToExternalConverter(env, nullptr, &reinterpret_cast<const Node*>(d)->p->t, _value, true))
return _value.l;
return nullptr;
}
Expand Down
Loading

0 comments on commit af50791

Please sign in to comment.