Results 1 to 8 of 8

Thread: change color/focus in qtablewidget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 334 Times in 317 Posts

    Default Re: change color/focus in qtablewidget


  2. #2
    Join Date
    Mar 2008
    Location
    France
    Posts
    149
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2
    Thanked 21 Times in 21 Posts

    Default Re: change color/focus in qtablewidget

    Or even use a style sheet.
    Qt Code:
    1. tableview.setStyleSheet("background-color: wathevercolor")
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Mar 2008
    Location
    France
    Posts
    149
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2
    Thanked 21 Times in 21 Posts

    Default Re: change color/focus in qtablewidget

    To set the background color of selected text or item:
    Qt Code:
    1. mytableWidget.setStyleSheet(selection-background-color : acolor")
    To copy to clipboard, switch view to plain text mode 

  4. The following user says thank you to toutarrive for this useful post:

    pavanbarot (11th August 2010)

  5. #4
    Join Date
    Jun 2013
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: change color/focus in qtablewidget

    Quote Originally Posted by toutarrive View Post
    To set the background color of selected text or item:
    Qt Code:
    1. mytableWidget.setStyleSheet(selection-background-color : acolor")
    To copy to clipboard, switch view to plain text mode 
    if i want to change the row's background which i selected with a image? how should i do?

Similar Threads

  1. Replies: 2
    Last Post: 17th July 2010, 21:07
  2. Replies: 3
    Last Post: 22nd January 2010, 16:46
  3. Change Color of Focus Frame
    By crybaby in forum Newbie
    Replies: 3
    Last Post: 30th October 2009, 07:02
  4. how to change backgroup color, button color and shape?
    By lzha022 in forum Qt Programming
    Replies: 10
    Last Post: 16th June 2008, 22:25
  5. Menu bar background color focus
    By user_mail07 in forum Qt Tools
    Replies: 0
    Last Post: 18th May 2007, 01:25

Tags for this Thread

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.