Results 1 to 7 of 7

Thread: Regarding qlineargradient

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default 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().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default 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".

  3. The following user says thank you to Lykurg for this useful post:

    jjbabu (15th April 2009)

  4. #3
    Join Date
    Sep 2007
    Posts
    83
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6
    Thanked 3 Times in 3 Posts

    Default Re: Regarding qlineargradient

    I did it man!!!!!!!!!!thank u.
    wysota,that button coloring also solved
    inspite of putting below code
    Qt Code:
    1. background-color: qlineargradient(x1:0, y1:0, x2:[B]0[/B], y2:1,
    2. stop:0 white, stop: 0.5 #daf4f0, stop:1 #daf4f0);
    To copy to clipboard, switch view to plain text mode 
    I modified like this
    Qt Code:
    1. background-color: qlineargradient(x1:0, y1:0, x2:[B]1[/B], y2:1,
    2. stop:0 white, stop: 0.5 #daf4f0, stop:1 #daf4f0);
    To copy to clipboard, switch view to plain text mode 
    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....

Similar Threads

  1. Replies: 2
    Last Post: 23rd June 2008, 01:26
  2. Related QLinearGradient
    By ashishsaryar in forum Qt Programming
    Replies: 5
    Last Post: 26th May 2008, 10:09
  3. QLinearGradient question
    By ^NyAw^ in forum Qt Programming
    Replies: 3
    Last Post: 7th March 2008, 16:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.