Unsolved Qdial stylesheet doesn't work
-
Hello, I just recently started to learn using Qt and I stumble on some difficulties using the Stylesheet on Qdial. I plan to use the Qdial as color dial picker, something like this
I found something similar on Qdial's gradient style section with the name of rainbow. I already choose it and there are no error with it but there are no change at all to the Qdial's color. I already try to check the autofillbackground but nothing happen too. Maybe someone can point where I do it wrongly for this. Thank you
-
@Ludicrous-Gray You will need to show your code where you're setting the style-sheet
-
@jsulm Hi, I still haven't gone to the code yet, I only try to place it all together using Qtdesigner. Do I need to change it via code to work?
-
@Ludicrous-Gray But you can at least show the style-sheet you're setting in designer?
-
@jsulm is this what you mean ?
-
@Ludicrous-Gray Yes. Take a look at https://stackoverrun.com/de/q/5722750 - it is in German, but there is style sheet which is doing something similar. Compare it with yours.
-
@jsulm Hi, I have read the link that you gave to me and I understand a little bit how the code should work so I tried to experiment creating a simple gradient from light to dark and to light again using this code
color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #fafafa, stop:0.5 #2e2e2e);
but same as before it doesn't change anything, even on preview mode. It feels like the code isn't executed at all
-
@Ludicrous-Gray Hint: style-sheets are case sensitive as far as I know
Also, what you have is different to what is in that link. -
@jsulm The link that you gave said that he can only change the color of the background only, every other choice is not working. So I did a simple test for background-color and it is working but what I want is the color of the circle not the background. The bug report on that post also show that the problem is closed and probably fixed on future update. So does this mean this is still not yet fixed?
-
@Ludicrous-Gray According to the bug ticket it is not fixed and will not be fixed.
Just a suggestion: if you need such amount of customisation you should take a look at QML, it provides way more possibilities than old style widgets. -
@jsulm So does this QML has a designer like interface or I can only do it via code?
-
@Ludicrous-Gray Well, the bug report says that QDial does not support style sheets at all, so doesn't matter where you set it it will not work...