Results 1 to 6 of 6

Thread: QItemSelectionModel::currentChanged and revert change

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QItemSelectionModel::currentChanged and revert change

    It's amazing how fast this board is! I was just out for spot, came back, got an answer, tried it, works fine, thanks!

    The problem is also that qt needs time to revers the selection because without Qt::QueuedConnection it will fail. And it's curios that it doesn't respect the QAbstractItemView::SingleSelection. Is this a thing one could not change or maybe the trolls could? Should we inform them? I don't know, I don't understand all of the issue exact.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QItemSelectionModel::currentChanged and revert change

    Ok, the "real" problem was the signal-slot binding. If i directly use
    Qt Code:
    1. connect(v->selectionModel(), SIGNAL(currentChanged(const QModelIndex& , const QModelIndex&)), this, SLOT(changed(const QModelIndex& , const QModelIndex&)), Qt::QueuedConnection);
    To copy to clipboard, switch view to plain text mode 
    all works as expected without the additional signal.

  3. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QItemSelectionModel::currentChanged and revert change

    nice, I've just posted a solution without investigation.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. Replies: 1
    Last Post: 6th January 2009, 14:21

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.