Results 1 to 2 of 2

Thread: Emit clicked( QModelIndex &) from a QTreeView?

  1. #1
    Join Date
    Jan 2008
    Posts
    14
    Thanks
    5

    Question Emit clicked( QModelIndex &) from a QTreeView?

    I am editing a widget with a QTreeView connected with a QDirModel. I want to enable a `rename' function in the context menu. However, I could not find a way to emit a clicked() signal from the code to make the item selected into editing mode.

    I used
    QModelIndex index = this->ui_.tv_current_directory->currentIndex();
    emit this->ui_.tv_current_directory->clicked( index );
    where tv_current_directory is the QTreeView object. Obviously, VS2005 complains that I am trying to access the protected member of QAbstractItemView.

    What should I do then? Thanks.
    Last edited by Ran; 15th December 2008 at 04:23.

  2. #2
    Join Date
    Jan 2008
    Posts
    14
    Thanks
    5

    Default Re: Emit clicked( QModelIndex &) from a QTreeView?

    Solved. Using QTreeView edit() slot.

Similar Threads

  1. QAbstractProxyModel to do a Tree
    By xgoan in forum Qt Programming
    Replies: 3
    Last Post: 18th November 2008, 17:31
  2. QSql*Model + QTreeView : make a tree
    By punkypogo in forum Qt Programming
    Replies: 18
    Last Post: 24th October 2008, 18:14
  3. Replies: 6
    Last Post: 5th December 2007, 22:41
  4. Replies: 6
    Last Post: 21st September 2007, 13:51
  5. [QT4 & XP] QTreeView issue with Designer form
    By incapacitant in forum Newbie
    Replies: 3
    Last Post: 2nd March 2006, 17:42

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.