Results 1 to 2 of 2

Thread: Row highlight in Tableview with delegate in first column

  1. #1
    Join Date
    Oct 2015
    Posts
    45
    Thanks
    8
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Row highlight in Tableview with delegate in first column

    I have a Qtableview with setSelectionBehavior(QtableView.SelectRows) set.

    The tableview has a button delegate in the first column.

    When I click in a row of the table (some cell other than first column) the clicked event shows the correct row and column being passed.
    When I click the button, it launches the editor with the correct data.

    But the row never highlights.

    I have a different example that does highlight the clicked row, but it does not have a delegate column.

    When a delegate is used, how do I high light the selected row?

    (For that matter how do I highlight the first row at startup?)

    Regards,
    Mac

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Row highlight in Tableview with delegate in first column

    Have you called QAbstractItemView::setSelectionBehavior() with the argument QAbstractItemView::SelectRows?

    QAbstractItemView::setCurrentIndex() will select the row at the "index" argument.

Similar Threads

  1. Tableview dialog as delegate
    By drmacro in forum Qt Programming
    Replies: 5
    Last Post: 28th October 2015, 07:45
  2. Issue with custom delegate in tableview
    By alizadeh91 in forum Qt Programming
    Replies: 4
    Last Post: 13th April 2013, 08:39
  3. Button Delegate Problem in TableView
    By alizadeh91 in forum Qt Programming
    Replies: 3
    Last Post: 17th March 2013, 17:13
  4. TableView Delegate questions
    By No-Nonsense in forum Qt Programming
    Replies: 3
    Last Post: 11th December 2006, 09:39
  5. Q3ListView highlight part of a column
    By sreedhar in forum Qt Programming
    Replies: 1
    Last Post: 5th May 2006, 09:26

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