Regarding qlineargradient
Hi,
Code:
background: qlineargradient(x1:0, y1:0, x2:1, y2:1,
stop:0 white, stop: 0.4 gray, stop:1 green)
Using the above syntax i can able to change the my widget(push button) background color from top-left corner to bottom-right corner.
But my requirement is i have to fix push button top layer(i.e x1:0, y1:0, x2:0, y2:1) with one color and bottom layer( i.e x1:1, y1:0, x2:1, y2:1)with different color.How can i achieve this? Is it possible or not?
thank you.
Re: Regarding qlineargradient
Could you provide an image of what you want?
4 Attachment(s)
Re: Regarding qlineargradient
Hi wysota,
For look and feel customization i am using style sheet concept in QT.my requirement is as i mentioned in my previous post,as per your requirement i attached image of my requirement in with file name "Button.png".Attachment 3142
few more questions i need to ask u.How i can change the normal push button shape.me requirement shapes are attached with the file names of "Le1.png" & "Le2.png".
Attachment 3143
Attachment 3144
I have to add search icon to the combo box in the right corner besides the drop down icon.when i was using below code in "change style sheet" my search icon is overlapping with drop down icon.i am not able to align icon properly.actual my requirement image is attached with the file name"search_line.png"
Attachment 3145
Code:
background: url(F:/QT/4.4.3/1239617088_bullet_arrow_up.png);
background-position: bottom right;
background-repeat: no-repeat;
NOTE:
1)please open .png files using "Microsoft office picture manager" for better look and feel appearance.
2)for all above look and feel consideration purpose i used QT designer's widget "change style sheet" property in my project.
thanks in advance.
1 Attachment(s)
Re: Regarding qlineargradient
Please consider this attachment for above post
"search line.png"
thank u.
Re: Regarding qlineargradient
I still don't understand the problem with the button :) You mean you want a button with a sharp border between two colours (which doesn't look like the one you posted) or a smooth transition between two gradients going in different directions throughout the whole button? If the latter, then this is not a linear gradient anymore. You can either try a conical gradient or just subsitute the gradient with an image which is also the answer to your second question. Transparent parts of the button have to be transparent in the image and/or you need to provide a mask for the button using QWidget::setMask().
Re: Regarding qlineargradient
Another option might be you design your buttons in a graphical application and then set it to your buttons. See "QPushButton and images" in the "Qt Style Sheets Examples".
Re: Regarding qlineargradient
I did it man!!!!!!!!!!thank u.
wysota,that button coloring also solved
inspite of putting below code
Code:
background-color: qlineargradient(x1:0, y1:0, x2:[B]0[/B], y2:1,
stop:0 white, stop: 0.5 #daf4f0, stop:1 #daf4f0);
I modified like this
Code:
background-color: qlineargradient(x1:0, y1:0, x2:[B]1[/B], y2:1,
stop:0 white, stop: 0.5 #daf4f0, stop:1 #daf4f0);
using this linearly 50%top layer one color and remaining 50% different color.
what about that combo box search icon alignment.please provide solution for that?
thanks a lot....