Results 1 to 2 of 2

Thread: Set Focus on created QStandardItem and edit Text

  1. #1
    Join Date
    Jan 2012
    Posts
    6
    Thanks
    2

    Default Set Focus on created QStandardItem and edit Text

    Hi all,

    I have an application similar to a file browser, which works with a QTreeView. At some point I need to add new items into the model (QstandardItemModel), where the name is to be set by the user. As interaction I would like to have it similar to creating a folder in windows. The action is triggered and the Item is created, but the name field is selected and the cursor enabled to set the name.

    Is this possible using Qt? Where can I set the QStandardItem to be edited?

    Thanks for your help,
    bbg

  2. #2
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: Set Focus on created QStandardItem and edit Text

    take a look at void QAbstractItemView::edit ( const QModelIndex & index )

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

    blackbubblegum (29th February 2012)

Similar Threads

  1. QTableView line edit clears the text on edit
    By PlasticJesus in forum Qt Programming
    Replies: 5
    Last Post: 14th March 2015, 19:06
  2. Replies: 3
    Last Post: 26th August 2010, 08:57
  3. QTableView Edit Focus
    By waynew in forum Qt Programming
    Replies: 2
    Last Post: 16th August 2010, 12:24
  4. line edit focus
    By addu in forum Qt Programming
    Replies: 3
    Last Post: 16th July 2009, 15:39
  5. Character encoding in text edit and llne edit
    By greenvirag in forum Qt Programming
    Replies: 3
    Last Post: 20th January 2009, 08:45

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.