Skip to content

How should I use the types and constants in the Qt Namespace? #890

Answered by ahayzen-kdab
ksnnkr asked this question in Q&A
Discussion options

You must be logged in to vote

You'll need the enum to match the size in Qt, eg if it's a std::int32_t in C++ then you need to add #[repr(i32)] as an attribute about the enum.

So the following might work if it's a std::int32_t

    #[namespace = "Qt"]
    #[repr(i32)]
    enum Orientation {
        Horizontal = 0x1,
        Vertical = 0x2,
    }

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@ksnnkr
Comment options

@LeonMatthesKDAB
Comment options

@ksnnkr
Comment options

@ahayzen-kdab
Comment options

Answer selected by ksnnkr
@ksnnkr
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants