Results 1 to 6 of 6

Thread: QTreeView::doubleClicked(const QModelIndex&) signal

  1. #1
    Join Date
    Jan 2007
    Posts
    45
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default QTreeView::doubleClicked(const QModelIndex&) signal

    Hello All !

    For some strange reason when I'm setting
    qtreeView->setEditTriggers(QAbstractItemView::CurrentChanged )
    the doubleClicked signal is no longer emited. Is it normal (but undocumented) behavior or a bug ?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTreeView::doubleClicked(const QModelIndex&) signal

    I guess the view doesn't even receive a double click event because the first press causes an editor to be opened in front of the view.
    J-P Nurmi

  3. #3
    Join Date
    Jan 2007
    Posts
    45
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QTreeView::doubleClicked(const QModelIndex&) signal

    In my case editor opens in another column (just like in Designer properties editor) and not under mouse. I've tried to install eventFilter for treeView but it does not receives any events at all (mouseTracking is enabled).

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QTreeView::doubleClicked(const QModelIndex&) signal

    Remember that it's the viewport that receives events, not the view itself.

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QTreeView::doubleClicked(const QModelIndex&) signal

    Most likely the view also loses focus by the time an editor is opened.
    J-P Nurmi

  6. #6
    Join Date
    Jan 2007
    Posts
    45
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QTreeView::doubleClicked(const QModelIndex&) signal

    Quote Originally Posted by wysota View Post
    Remember that it's the viewport that receives events, not the view itself.
    Yes, I've not thought about it ! I've installed eventFilter for viewport and now this approach works.

Similar Threads

  1. Replies: 3
    Last Post: 15th April 2007, 19:16
  2. Signal and slots
    By villy in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2007, 10:10
  3. Replies: 2
    Last Post: 17th May 2006, 21:01
  4. no such signal QListBox::currentChanged()
    By jopie bakker in forum Newbie
    Replies: 2
    Last Post: 2nd March 2006, 15:17
  5. send signal from QCombobox
    By raphaelf in forum Qt Programming
    Replies: 22
    Last Post: 28th February 2006, 14:18

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.