Results 1 to 3 of 3

Thread: Event handlers for QTableView model / selection model.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Event handlers for QTableView model / selection model.

    Quote Originally Posted by Santosh Reddy View Post
    Do you use QTableView or a custom QTableView, I assume it is custom class based of QTableView. Just in case try setting the selection mode to QAbstractItemView::ExtendedSelection
    You assumed wrong i'm using a plain vanilla QTableView, and i'm really connecting to it's selection model via signals / slots.
    i have tried setting the selection model to Extended already... My slot connected to the selection model (to selectionChanged) is called when i click a record... But when i hit Ctrl + A, it's not called. Also, if i select a record and then click elsewhere in the table, the record gets de-selected, but the slot never called neither.

    Bump, help please? Bellow is a snippet on how i connect to the selection model... i really think there is a bug here.
    Thanks,
    Pierre.

    Qt Code:
    1. connect(ui.tblVwDocumentTypes->selectionModel(), SIGNAL(selectionChanged(QItemSelection const&, QItemSelection const &)), this, SLOT(documentTypesModel_selectionChanged(QItemSelection const&, QItemSelection const&)));
    To copy to clipboard, switch view to plain text mode 
    - ui.tblVwDocumentTypes being my table view,
    - documentTypesModel_selectionChanged being my slot.


    Added after 5 minutes:


    Oh boy... i have cleaned the solution and re-built.... The slots get called now. i had a very similar problem a while ago after i compiled another version of Qt on another project... i believe VS2008 objects cache time-stamping has some issues, never had the problem with linux / mac.

    For you all... VS2008 users: Solution -> Clean and rebuild!

    Thanks anyways,
    Pierre.
    Last edited by hickscorp; 8th July 2011 at 17:57.

Similar Threads

  1. Replies: 1
    Last Post: 24th February 2011, 05:54
  2. Replies: 1
    Last Post: 18th November 2009, 23:21
  3. Catch a row selection event in QTableView
    By Windsoarer in forum Qt Programming
    Replies: 1
    Last Post: 2nd March 2009, 22:44
  4. Model sorting vs. selection
    By VlJE in forum Qt Programming
    Replies: 2
    Last Post: 25th October 2006, 16:46
  5. Replies: 2
    Last Post: 16th February 2006, 19:09

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
  •  
Qt is a trademark of The Qt Company.