Results 1 to 2 of 2

Thread: little problem with QStyledItemDelegate

  1. #1
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default little problem with QStyledItemDelegate

    Hi guys,
    I subclassed QTreeView, QAbstractItemModel and QStyledItemDelegate. I have different editors for different datatypes and set AllEditTriggers. Now there are two problems.

    • If I navigate through the Indexes, there is opened just every second editor, although the method createEditor is called and an editor is returned...: (
    • The second problem is that there is for example a QTextEdit- editor. When the editor is opened there should be the textcursor in the QTextEdit. I tried lots of different variants (focusPolicy, setFocus, movePosition of cursor, etc. ...), nothing solves the problem.



    Maybe someone can help me...

    thanks

  2. #2
    Join Date
    Apr 2011
    Posts
    195
    Thanks
    49
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: little problem with QStyledItemDelegate

    I solved the problems now...

    The big clue was the focus settings of the widgets. setFocusPolicy, setFocusProxy and setFocus in constructor or setEditorData method solve the problems...
    Last edited by Qiieha; 26th November 2012 at 10:09.

Similar Threads

  1. Replies: 1
    Last Post: 19th June 2012, 20:20
  2. QTreeView & QStyledItemDelegate
    By mentalmushroom in forum Qt Programming
    Replies: 0
    Last Post: 29th September 2011, 07:57
  3. QTableView and QStyledItemDelegate ownership
    By lxman in forum Qt Programming
    Replies: 2
    Last Post: 7th July 2011, 05:19
  4. Custom QStyledItemDelegate
    By Berryblue031 in forum Qt Programming
    Replies: 0
    Last Post: 2nd March 2011, 10:32
  5. Question about subclassing QStyledItemDelegate
    By dpimka in forum Qt Programming
    Replies: 4
    Last Post: 10th July 2009, 17:09

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.