filcuc / dqml Goto Github PK
View Code? Open in Web Editor NEWQt Qml bindings for the D programming language
License: GNU Lesser General Public License v3.0
Qt Qml bindings for the D programming language
License: GNU Lesser General Public License v3.0
Native QML does not provide support for system tray icons, instead one needs to leverage QT and bind to QML as shown here or here. Would it be possible to get support for this into dqml?
Specifically, the functionality I am after is this:
One tray icon with two actions "Show" and "Quit", the former of which shows a specific window (maybe by its QML id?) if it is not yet shown (and focuses it), while the latter quits the QML application. It would also be nice if tray's icon could be loaded from QT's Resource system.
Looking at the examples I figured out how to send signals to QML, but not the other way around. If it not implemented, I would like to request it. My use-case:
logic
(D class inheriting QObject) and expose it via engine.rootContext.setContextProperty
chatWindow
, fetch a specialised controller chat
(D class inheriting QObject) from logic
and pass it to chatWindow
as one of its initial propertieschatWindow
registers itself with chat
via one of the latter's methodschat
binds to chatWindow
's destroyed
signal a callback that destroys chat
itselfThe result: When chatWindow
gets destroyed the corresponding chat
gets destroyed automatically.
Sadly, Component.onDestruction
cannot be used in this context, as that would result in chat
being destroyed while the destructor for chatWindow
is still running, causing a bunch of QML null
type errors, one for each reference to chat
in chatWindow
.
Now the first two steps are easy to do with what dqml
currently has. However, I'm at a loss on how to accomplish the last two steps without modifying Dotherside/dqml.
Hi,
it seems that wrapping a QObject inside a QVariant does not work properly. The void* inside the QVariant for me points to a wrong address.
The following code prints e.g.: '55AF7A0C72E0 7FD2A2F15680', which are not the same addresses.
SomeQObject q = new SomeQObject();
QVariant qv = new QVariant(q);
writeln(qv.voidPointer, " ", cast(void*)q);
Similiarly when I have a QSlot() that accepts a QVariant and call the Slot from qml with a QObject I receive 'null' in the slot.
Any ideas?
TextBin Error:
https://pastebin.pl/view/058bb330
I have installed all modules and libraries of Qt 6 on my system
DMD Version:
DMD64 D Compiler v2.100.2
LDC version:
based on DMD v2.100.1 and LLVM 14.0.3
What is analog this in dqml?
connect(this, SIGNAL(windowChanged(QQuickWindow*)), this, SLOT(handleWindowChanged(QQuickWindow*)));
context is here
I tried
connect(this, "windowChanged", this, "handleWindowChanged");
but got
QObject::connect: Use the SIGNAL macro to bind DQmlOpenGL::windowChanged
Example receivesignals
provides example for more simple calling.
Can you add support for arrays/lists before breaking changes please?
We should support a static connect syntax that doesn't use strings.
Basically like Qt5 new connect signals
connect(sender, pointertofunction, receiver, pointertofunction) in order to have compile time checking.
Try to move some connect details to the C++ DOtherSide library in order to share some code with other bindings
Which data types are available? Is there something like a QList which i can use to convert my data?
Hi Filippo,
I have tried to compile helloworld
$ cd dqml/examples/helloworld/
$ dub build --verbose
/home/dao/.dub/packages/dqml-0.6.1/dqml/source/dqml/qobject.d(109,13): Deprecation: foreach: loop index implicitly converted from size_t to int
....
Linking...
/usr/bin/dmd -of.dub/build/application-debug-linux.posix-x86_64-dmd_2085-62B3124FD7CA697A98D4DCCFD778CEA8/helloworld .dub/build/application-debug-linux.posix-x86_64-dmd_2085-62B3124FD7CA697A98D4DCCFD778CEA8/helloworld.o -L--no-as-needed -L-lDOtherSide -g
/home/dao/.dub/packages/dqml-0.6.1/dqml/source/dqml/qabstracttablemodel.d:58: error: undefined reference to 'dos_qabstracttablemodel_create'
....
collect2: error: ld returned 1 exit status
Error: linker exited with status 1
/usr/bin/dmd failed with exit code 1.
I downloaded DOtherSide from here then:
# pacman -U DOtherSide-0.5.2-1-x86_64.pkg.tar.xz
then:
$ sudo ldconfig
My environment
$ uname --all
Linux abe 5.0.2-arch1-1-ARCH #1 SMP PREEMPT Thu Mar 14 18:47:49 UTC 2019 x86_64 GNU/Linux
$ dmd --version
DMD64 D Compiler v2.085.0
$ dub --version
DUB version 1.14.0, built on Mar 17 2019
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.