Results 1 to 20 of 21

Thread: Repainting QTableWidget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2014
    Location
    Germany
    Posts
    69
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Repainting QTableWidget

    Hi,

    I've got a QTableWidget with a custom item delegate and I'd like to repaint it when the user selects an item in a QComboBox.
    I tried both, QTableWidget::update() and, directly, QTableWidget::repaint(), but it didn't work. I think, the problem is that QTableWidget doesn't have focus but QComboBox does after selecting an item. If I replace QTableWidget::update() with QTableWidget::setFocus(), it works great and it does the repainting automatically.

    Hence, I could do it with QTableWidget::setFocus(), but I think it is not the usual way and I'd like to do it the smart way... Does anyone know how I can update the QTableWidget without setting the focus to it?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Repainting QTableWidget

    Is that combobox a separate widget or do you use it as an editor in the delegate?

    Cheers,
    _

  3. #3
    Join Date
    Nov 2014
    Location
    Germany
    Posts
    69
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default Re: Repainting QTableWidget

    It's a seperate widget...

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Repainting QTableWidget

    So you have a slot connected to one of the combobox's signals?
    And in that slot you update data in the tableview but it does not show that new data?

    Cheers,
    _

Similar Threads

  1. how to bypass repainting a containing widget?
    By RolandHughes in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2014, 10:42
  2. [qt5] repainting qwidget
    By zodiac in forum Qt Programming
    Replies: 11
    Last Post: 25th July 2012, 15:10
  3. Repainting a QGraphicsView
    By Luc4 in forum Qt Programming
    Replies: 8
    Last Post: 29th April 2010, 14:09
  4. QGraphicsItem not repainting
    By eijnuhs in forum Qt Programming
    Replies: 3
    Last Post: 20th September 2008, 08:54
  5. Repainting widget
    By fear in forum Qt Programming
    Replies: 3
    Last Post: 26th March 2008, 08:37

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.