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
    4,785
    Thanks
    262
    Thanked 773 Times in 763 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    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, 08:45
  2. Issue with custom delegate in tableview
    By alizadeh91 in forum Qt Programming
    Replies: 4
    Last Post: 13th April 2013, 09:39
  3. Button Delegate Problem in TableView
    By alizadeh91 in forum Qt Programming
    Replies: 3
    Last Post: 17th March 2013, 18:13
  4. TableView Delegate questions
    By No-Nonsense in forum Qt Programming
    Replies: 3
    Last Post: 11th December 2006, 10:39
  5. Q3ListView highlight part of a column
    By sreedhar in forum Qt Programming
    Replies: 1
    Last Post: 5th May 2006, 10: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.