Results 1 to 5 of 5

Thread: Border around selected cell in qtablewidget...

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

    Default Border around selected cell in qtablewidget...

    Is there anyway that i can change the border around the selected cell in qtablewidget.. Whenever i select i find a dotted line border around the selected cell. I want to make this border to disappear.. Is there a way???

  2. #2
    Join Date
    Jul 2006
    Location
    Catalunya - Spain
    Posts
    117
    Thanks
    16
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Border around selected cell in qtablewidget...

    Try using stylesheets :

    Qt Code:
    1. qApp->setStyleSheet ( qApp->styleSheet() +" QTableWidget::item:focus { background-color:transparent; color:blue; border: 0px }" );
    To copy to clipboard, switch view to plain text mode 

    This will change the aspect of ALL QTableWidget on your appliaction. If you want to change only one, you can set it's stylesheet. ( a method of QWidget ).

  3. #3
    Join Date
    Aug 2010
    Posts
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Border around selected cell in qtablewidget...

    HI,
    I have a tablewidget in my application in which first column contains checkboxes and other contains information.
    Now I want to set the background color of the selected row as transparent and a solid border around the row.

    and when I check the check box in a particular row It will have background color as default and no border around the row.



    Can you please help me?

    Thanks in advance.

    Sanket

  4. #4
    Join Date
    Mar 2012
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Border around selected cell in qtablewidget...

    Hi All,

    I want to select the cell dynamically and change its border color to red. I tried the above method, but it didnt work. am I missing something?

  5. #5
    Join Date
    Jul 2006
    Location
    Catalunya - Spain
    Posts
    117
    Thanks
    16
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Border around selected cell in qtablewidget...

    Quote Originally Posted by vrushalid View Post
    Hi All,

    I want to select the cell dynamically and change its border color to red. I tried the above method, but it didnt work. am I missing something?
    Yes. The above method *ONLY* allows you to set cell's properties, but does not select anything...

    Take a look at selection model API, to select a cell programatically.

Similar Threads

  1. repaint a cell or row in QTableWidget
    By alphaqt in forum Newbie
    Replies: 6
    Last Post: 26th June 2012, 11:21
  2. Replies: 1
    Last Post: 8th December 2009, 12:55
  3. Replies: 1
    Last Post: 7th December 2009, 18:56
  4. Close a QtableWidget cell
    By SailinShoes in forum Qt Programming
    Replies: 2
    Last Post: 7th March 2008, 14:03
  5. Highlighting the border of cell in Table
    By ankurjain in forum Qt Programming
    Replies: 8
    Last Post: 21st March 2006, 08:20

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.