Results 1 to 3 of 3

Thread: [QT4 & XP] doubleClick on QtreeView

  1. #1
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default [QT4 & XP] doubleClick on QtreeView

    Hi, (again)


    How do I implement doubleClick event without having my QTreeView go into edit mode ?

    Single click signal works fine.
    When I use doubleClick signal it does two things :
    - first executes my slot (which is nice)
    - second it goes into edit mode on that column and row.

    I tried setEnabled(false) but then the slot is not activated (I guess this is normal).


    Cannot find a member that disables the edit mode.
    Is it possible ?

    code:
    Qt Code:
    1. connect( table, SIGNAL( doubleClicked(const QModelIndex&) ),
    2. this, SLOT( selection(const QModelIndex&) ) );
    To copy to clipboard, switch view to plain text mode 

  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: [QT4 & XP] doubleClick on QtreeView

    I'm not 100% sure about this, but try to change view's edit triggers.

    QAbstractItemView::editTriggers

    So removing QAbstractItemView:oubleClicked ("Editing starts when an item is double clicked.") should do the trick for you.

  3. The following user says thank you to jpn for this useful post:

    incapacitant (2nd March 2006)

  4. #3
    Join Date
    Jan 2006
    Location
    Grenoble, France
    Posts
    165
    Thanks
    106
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: [QT4 & XP] doubleClick on QtreeView

    fyi

    code works with :
    Qt Code:
    1. table->setEditTriggers(QAbstractItemView::NoEditTriggers);
    To copy to clipboard, switch view to plain text mode 


    table is the QTreeView

Similar Threads

  1. [QT4 & XP] QTreeView issue with Designer form
    By incapacitant in forum Newbie
    Replies: 3
    Last Post: 2nd March 2006, 18:42
  2. [QT4 & XP] connect on QtreeView
    By incapacitant in forum Newbie
    Replies: 1
    Last Post: 2nd March 2006, 12:08

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.