filcuc / dqml

Qt Qml bindings for the D programming language
GNU Lesser General Public License v3.0
42 stars 14 forks source link

QVariant: Arrays or list #5

Closed 9il closed 9 years ago

9il commented 9 years ago

Can you add support for arrays/lists before breaking changes please?

filcuc commented 9 years ago

do you mean QAbstractListModels? currently is still possible even without them

2015-03-02 21:09 GMT+01:00 Ilya Yaroshenko notifications@github.com:

Can you add support for arrays/lists before breaking changes please?

— Reply to this email directly or view it on GitHub https://github.com/filcuc/dqml/issues/5.

Filippo Cucchetto

9il commented 9 years ago

Yes

filcuc commented 9 years ago

Take a look at the left side of this diff https://github.com/filcuc/DOtherSide/commit/de533129d21478912c67761260e87dd78bf5c16f?diff=split

Basically you create a QObject with:

2015-03-02 21:29 GMT+01:00 Ilya Yaroshenko notifications@github.com:

Yes

— Reply to this email directly or view it on GitHub https://github.com/filcuc/dqml/issues/5#issuecomment-76811069.

Filippo Cucchetto

filcuc commented 9 years ago

sorry i think that the D implementation lacks of QObject support in slots and signals. I'll push a fix as soon as possible with a working example

9il commented 9 years ago

Breaking changes is not a problem. I need something to draw charts/plots with hardware acceleration. I hope it can be dqml. But without arrays/lists it is impossible now.

filcuc commented 9 years ago

yep i understand it

filcuc commented 9 years ago

This evening i didn't had the time to get completely with dub. In these days i plan to delete the D code from the DOtherSide and continue the development here.

However on the develop branch of the DOtherSide repo you should find an implementation that support the QObject and an example with a list of items.

2015-03-02 21:40 GMT+01:00 Ilya Yaroshenko notifications@github.com:

Breaking changes is not problem. I need something to draw charts/plots with hardware acceleration. I hope it can be dqml. But without arrays/lists it is impossible now.

— Reply to this email directly or view it on GitHub https://github.com/filcuc/dqml/issues/5#issuecomment-76815075.

Filippo Cucchetto

filcuc commented 9 years ago

@9il have you tried my changes?

9il commented 9 years ago

Hi! I am a little bit miss-oriented. Is QML list implemented like D range of QObjects?

filcuc commented 9 years ago

No, you just expose to QML a QObject with a count property and a get slot. Than QML invoke th get slot that returns a simple type (a double/int/ etc)

2015-03-05 14:01 GMT+01:00 Ilya Yaroshenko notifications@github.com:

Hi! I am a little bit miss-oriented. Is QML list implemented like D range of QObjects?

— Reply to this email directly or view it on GitHub https://github.com/filcuc/dqml/issues/5#issuecomment-77359712.

Filippo Cucchetto

filcuc commented 9 years ago

Basically the QObject is a Model/Container

2015-03-05 14:09 GMT+01:00 Filippo Cucchetto filippocucchetto@gmail.com:

No, you just expose to QML a QObject with a count property and a get slot. Than QML invoke th get slot that returns a simple type (a double/int/ etc)

2015-03-05 14:01 GMT+01:00 Ilya Yaroshenko notifications@github.com:

Hi! I am a little bit miss-oriented. Is QML list implemented like D range of QObjects?

— Reply to this email directly or view it on GitHub https://github.com/filcuc/dqml/issues/5#issuecomment-77359712.

Filippo Cucchetto

Filippo Cucchetto