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

Labels in QLinearGradient value #74

Open
leusch opened this issue Apr 6, 2023 · 3 comments
Open

Labels in QLinearGradient value #74

leusch opened this issue Apr 6, 2023 · 3 comments

Comments

@leusch
Copy link

leusch commented Apr 6, 2023

I know to use a QLinearGradient, I need to use the special syntax.
This is compiling like explained in the readme.
But when I start my Qt Application this style is not working.
When I'm adding the labels (x1, y1, ...) manually in the qss file, it works as expected in the application.

Is there a possibility to add these labels automatically in the code?

@dalthviz
Copy link
Member

dalthviz commented Apr 6, 2023

Hi @MarcelSoftware thank you for the feedback! Could it be possible for you to share a more in detail example of what you are doing so we can reproduce the issue locally? Let us know!

@leusch
Copy link
Author

leusch commented Apr 7, 2023

Sure, if I write this code in my source file:
qlineargradient(0, 0, 0, 1, (0.1 blue, 0.8 green))

After running qtsass I get:
qlineargradient(0, 0, 0, 1, 0.1 blue, 0.8 green)
and that does not show the expected result when I run the program.

When I add x1, y1, x2, y2 and stop to the generated qss file, it works.
Like this:
qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0.1 blue, stop: 0.8 green)

FYI: I'm using Qt 5.12

@dalthviz
Copy link
Member

Hi and sorry for the late response! I Checked this using as test.scss file the following:

QWidget{
    background-color: qlineargradient(0, 0, 0, 1, (0.1 blue, 0.8 green));
}

And then running qtsass test.scss -o test.css generates the test.css file with the following:

QWidget {
  background-color: qlineargradient(x1: 0.0, y1: 0.0, x2: 0.0, y2: 1.0, stop: 0.1 rgba(0, 0, 255, 100%), stop: 0.8 rgba(0, 128, 0, 100%)); }

Checking the output I think is correct since:

  • rgba(0, 0, 255, 100%) -> blue
  • rgba(0, 128, 0, 100%) -> green

Env details:

bzip2                     1.0.8                h8ffe710_4    conda-forge
ca-certificates           2023.7.22            h56e8100_0    conda-forge
libffi                    3.4.2                h8ffe710_5    conda-forge
libsass                   0.22.0           py39h99910a6_0    conda-forge
libsqlite                 3.43.0               hcfcfb64_0    conda-forge
libzlib                   1.2.13               hcfcfb64_5    conda-forge
openssl                   3.1.2                hcfcfb64_0    conda-forge
pip                       23.2.1             pyhd8ed1ab_0    conda-forge
python                    3.9.18          h4de0772_0_cpython    conda-forge
python_abi                3.9                      3_cp39    conda-forge
pyyaml                    6.0.1            py39ha55989b_0    conda-forge
qtsass                    0.4.0              pyhd8ed1ab_0    conda-forge
setuptools                68.2.2             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
tk                        8.6.12               h8ffe710_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
ucrt                      10.0.22621.0         h57928b3_0    conda-forge
vc                        14.3                h64f974e_17    conda-forge
vc14_runtime              14.36.32532         hdcecf7f_17    conda-forge
vs2015_runtime            14.36.32532         h05e6639_17    conda-forge
watchdog                  3.0.0            py39hcbf5309_0    conda-forge
wheel                     0.41.2             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h8d14728_0    conda-forge
yaml                      0.2.5                h8ffe710_2    conda-forge

So not totally sure what could be happening here 🤔 If you have any other info in order to better understand/replicate this let us know!

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

No branches or pull requests

2 participants