mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-06 02:30:38 -08:00
support both Qt5 and Qt6
This commit is contained in:
parent
07f5fd05a0
commit
4440c06e70
6 changed files with 21 additions and 11 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Lisp
|
||||
import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import Lisp 1.0
|
||||
|
||||
Rectangle {
|
||||
width: 220
|
||||
|
|
|
|||
10
readme.md
10
readme.md
|
|
@ -2,29 +2,29 @@
|
|||
WIP
|
||||
---
|
||||
|
||||
Currently Linux/macOS/desktop only, will be extended to all platforms
|
||||
(including mobile); not so sure about Windows though...
|
||||
Currently Linux/macOS/desktop only, will be extended to mobile; not sure about
|
||||
Windows though.
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
A lightweight ECL based QML-only binding to Qt6.
|
||||
A lightweight ECL based QML-only binding to Qt5/Qt6.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Both ECL and Qt6 are LGPL.
|
||||
ECL and Qt5/Qt6 are LGPL.
|
||||
LQML can be considered public domain.
|
||||
|
||||
|
||||
TODO
|
||||
----
|
||||
|
||||
* port to CMake
|
||||
* make example work on android
|
||||
* make example work on iOS
|
||||
* add item model example
|
||||
* add sokoban example
|
||||
* port to CMake
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,11 @@ cl_object qset2(cl_object l_obj, cl_object l_args) {
|
|||
var = toInt(l_val);
|
||||
}
|
||||
else {
|
||||
#if QT_VERSION < 0x060000
|
||||
var = toQVariant(l_val, mp.type());
|
||||
#else
|
||||
var = toQVariant(l_val, mp.typeId());
|
||||
#endif
|
||||
}
|
||||
if (!mp.write(qobject, var)) {
|
||||
goto fail;
|
||||
|
|
|
|||
|
|
@ -80,7 +80,11 @@ int main(int argc, char* argv[]) {
|
|||
|
||||
bool slime = false;
|
||||
if (arguments.contains("-slime")
|
||||
#if QT_VERSION < 0x060000
|
||||
|| (arguments.indexOf(QRegularExpression::wildcardToRegularExpression("*start-swank*.lisp")) != -1)) {
|
||||
#else
|
||||
|| (arguments.indexOf(QRegularExpression::fromWildcard(QString("*start-swank*.lisp"))) != -1)) {
|
||||
#endif
|
||||
arguments.removeAll("-slime");
|
||||
slime = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -225,7 +225,11 @@ TO_CL_FLOAT_4 (QRectF, qrectf, x, y, width, height)
|
|||
|
||||
cl_object from_qvariant(const QVariant& var) {
|
||||
cl_object l_obj = ECL_NIL;
|
||||
#if QT_VERSION < 0x060000
|
||||
const int type = var.type();
|
||||
#else
|
||||
const int type = var.typeId();
|
||||
#endif
|
||||
switch (type) {
|
||||
case QMetaType::Bool: l_obj = var.toBool() ? ECL_T : ECL_NIL; break;
|
||||
case QMetaType::Double: l_obj = ecl_make_doublefloat(var.toDouble()); break;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,5 @@ SOURCES += \
|
|||
cpp/qt_ecl.cpp \
|
||||
cpp/main.cpp
|
||||
|
||||
clang {
|
||||
QMAKE_CXXFLAGS += -std=c++17
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue