Results 1 to 3 of 3

Thread: Changing the color of the link on hover using stylesheets..

  1. #1
    Join Date
    Dec 2009
    Posts
    20
    Thanks
    1
    Qt products
    Platforms
    Unix/X11

    Default Changing the color of the link on hover using stylesheets..

    Hai all,

    I don't know why the following lines of code isn't working. My aim is to change color of the text when the link is hovered..

    Qt Code:
    1. self.syncFolderSelection_addFileTypesTextBrowserInTable.setStyleSheet("QTextBrowser:hover{color:#00ff00;background-color:#ff0000;}")
    To copy to clipboard, switch view to plain text mode 

    The BG color chages without any error but the foreground color is not. Can anybody correct me..

  2. #2
    Join Date
    Dec 2009
    Posts
    29
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Default Re: Changing the color of the link on hover using stylesheets..

    if you specify a color when its not being hovered then that attribute overwrites the ones you put here. if you actually have more stylre in there and you remove all the others it should fix it.

  3. #3
    Join Date
    Dec 2009
    Posts
    20
    Thanks
    1
    Qt products
    Platforms
    Unix/X11

    Default Re: Changing the color of the link on hover using stylesheets..

    Quote Originally Posted by yodasoda View Post
    if you specify a color when its not being hovered then that attribute overwrites the ones you put here. if you actually have more stylre in there and you remove all the others it should fix it.
    Thanks yodasoda.. But can u provide me some sample code by taking off ur precious time.. I think it won't take more than three lines..

Similar Threads

  1. changing color of QTable
    By aj2903 in forum Qt Programming
    Replies: 7
    Last Post: 30th October 2009, 12:52
  2. Replies: 1
    Last Post: 18th September 2009, 10:32
  3. Html link color
    By sreedhar in forum Qt Programming
    Replies: 9
    Last Post: 5th September 2008, 14:36
  4. changing color of push button
    By babu198649 in forum Newbie
    Replies: 1
    Last Post: 2nd March 2008, 12:55
  5. QLabel link color
    By dragon in forum Qt Programming
    Replies: 1
    Last Post: 17th October 2007, 07:09

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.