Skip to content

"bad any cast" with Qt's quint32/64 data type #208

@define-private-public

Description

@define-private-public

I'm toying around with integrating ChaiScript into my Qt applications. When I have a function (in C++) that has Qt's quint64 data type which is just a unsigned long long int, ChaiScript::eval() will throw an error with the message "bad any cast." But if I try to access a method that returns a quint32/64, the result is just fine. e.g.:

void Class::yolo(quint64 i) {
    cout << (i * i) << endl; 
}

quint64 Class::swag() {
    return 14;
}

//...

Class c;
chai.add(var(&c), "c");
> c.yolo(20)
bad any cast
> print(c.swag())
14

Now let's saw I replace the parameter i's type with int, it works just fine and c.yolo(20) would return 400. Even replacing quint64 with unsigned long long int gives me the bad any cast.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions