Results 1 to 3 of 3

Thread: QTableWidget, selection problem

  1. #1
    Join Date
    Jul 2008
    Location
    Munich
    Posts
    73
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Exclamation QTableWidget, selection problem

    Hello,

    I have a QTableWidget which I can edit. After I add a new row in any location of the table, I would like this row be visible immediately and also be selected.

    Now my selection mode is row selection, and singleSelection.

    I tried to use clearSelection() to clear the previous selection and go to the right position. But it looks like, only the previous selection cell is cleared, the rest of the previous row is still in gray. And so on...

    Anyone has an idea how to implement this? Thanks in advance.

  2. #2
    Join Date
    Jul 2008
    Location
    Munich
    Posts
    73
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTableWidget, selection problem

    I think the problem is caused by repaint(). But since I do the edition in another thread, I can not call repaint() in the edit function. update() is not working...

  3. #3
    Join Date
    Jul 2008
    Location
    Munich
    Posts
    73
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTableWidget, selection problem

    OK, the problem was solved.

    After changing the table, selection mode and behavior have to be set again. Then it works.

Similar Threads

  1. [SOLVED] QTreeView drawing selection with icons
    By Timewarp in forum Qt Programming
    Replies: 7
    Last Post: 7th February 2013, 08:52
  2. Replies: 1
    Last Post: 19th November 2009, 00:21
  3. QTableWidget view problem
    By zgulser in forum Qt Tools
    Replies: 6
    Last Post: 5th March 2009, 07:50
  4. QTableWidget problem
    By MarkoSan in forum Qt Programming
    Replies: 53
    Last Post: 7th May 2008, 12:15
  5. Replies: 16
    Last Post: 7th March 2006, 16:57

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.