Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt6 #3

Open
Gohopping opened this issue Jun 28, 2024 · 5 comments
Open

Qt6 #3

Gohopping opened this issue Jun 28, 2024 · 5 comments
Assignees

Comments

@Gohopping
Copy link

使用新版本Qt6,运行那个example会出现报错,说不支持palette写法

@0smr
Copy link
Owner

0smr commented Jun 28, 2024

@Gohopping Hi, thanks for your comment.
I had a pull request recently and it seems the problem is coming from there 🤔 . At the moment, I didn't have enough time to check it, but I will do so as soon as I can.

And as a side note, I don't read Chinese, so I would appreciate it if you could write your comment in English next time 🙂

@alexfanqi
Copy link
Contributor

alexfanqi commented Jun 29, 2024

yeah, example 1 has issues because Qt6 quickcontrol did some changes that inline assignment of palette properties like ColorBtn { palette{highlight: '#a3d4d6';buttonText: '#515253'}} is not valid. I tried to have a crack on it for the pr, but I couldn't get the same behavior. I will try again harder when I have time. btw. example 2 should still work.

@0smr 0smr self-assigned this Jun 29, 2024
@0smr
Copy link
Owner

0smr commented Jun 29, 2024

@alexfanqi Thanks for your comment. Currently, I'm working on fixing this issue while also dropping Qt 5 support, so I assigned this to myself.

@nuttyartist
Copy link

Would love to see Qt 6 support 👍

@banned104
Copy link

Fixed! 😃
Change Main.qml like this ↓

    component ColorBtn: Button {
        width: 30; height: width; text: '-'
        // property var palette: {"highlight": "black", "buttonText": "black"}
        property var highlight: "black";
        property var buttonText: "black";
        highlighted: true
        onClicked: {
            window.palette.base = highlight
            window.palette.button = highlight
            window.palette.window = highlight

            window.palette.text = buttonText
            window.palette.buttonText = buttonText
            window.palette.windowText = buttonText
        }
    }

the otherside :

    Control {
        x: 5; y: window.height - height - 5; z: 3
        padding: 5
        contentItem: Row {
            ColorBtn { highlight: '#a3d4d6'; buttonText: '#515253' }
            ColorBtn { highlight: '#b0d0e9'; buttonText: '#515253' }
            ColorBtn { highlight: '#06d6a0'; buttonText: '#515253' }
            ColorBtn { highlight: '#d5b9ff'; buttonText: '#515253' }
            ColorBtn { highlight: '#515255'; buttonText: '#a4a5a6' }
            ColorBtn { highlight: '#edc9aa'; buttonText: '#515253' }
            ColorBtn { highlight: '#d1d2d3'; buttonText: '#545556' }
            ColorBtn { highlight: '#313233'; buttonText: '#a4a5a6' }
        }
    }

Image

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

No branches or pull requests

5 participants