Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Array as parameter of signal #11

Closed
vchekan opened this issue Sep 30, 2016 · 3 comments
Closed

Array as parameter of signal #11

vchekan opened this issue Sep 30, 2016 · 3 comments
Labels

Comments

@vchekan
Copy link

vchekan commented Sep 30, 2016

Is it possible to have an array as parameter of a signal? I want to pass Vec but this declaration fails:

Q_OBJECT! {
    pub Logic as QLogic {
    signals:
        fn gains(gainList: QVariant);

with error:

src/main.rs:45:36: 76:54 error: no associated item named `metatype` found for type `qml::qvariant::QVariant` in the current scope
(internal compiler error: unprintable span)
src/main.rs:41:1: 50:2 note: in this expansion of Q_OBJECT! (defined in <qml macros>)

Which types can be signal parameters?

@rustonaut
Copy link
Contributor

For some reasons it is only implemented for:

i32, f32, f64, i32, String

I have no idea why it is not implemented for:

i64, bool

And I don't know jet enough about the inner workings of Qt to say anything about "generall" QVariant, QObject and Lists of above's type.

@White-Oak
Copy link
Owner

Yes, it should be also implement for other types as well. Sorry for this and the delay

@White-Oak
Copy link
Owner

@vchekan thanks for the issue, and sorry for quite the delay!
It is now possible to use arrays as QObject properties, as you can see in this example.

More information is available in docs: QVariantList, qvarlist! (see qvarlists example). If there is something left unclear, please ask!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants