Results 1 to 11 of 11

Thread: QItemDelegate

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Posts
    849
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    6
    Thanked 163 Times in 151 Posts

    Default Re: QItemDelegate

    no, not that way:
    Qt Code:
    1. QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem& option, const QModelIndex& index) const
    To copy to clipboard, switch view to plain text mode 

    "const" methods are methods that must not change any members of a class
    (unless they are mutable). Consult your C++ book for details.

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    6
    Thanked 163 Times in 151 Posts

    Default Re: QItemDelegate

    multilines: with a QLineEdit (the default editor) it does not work.
    You have to modify the delegate to return a suitable editor, e.g. a QTextEdit.
    You also have to take care because the (default) eventFilter will catch the "return" key and close the editor which you do not want here.

  3. #3
    Join Date
    Jan 2008
    Posts
    58
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    3

    Default Re: QItemDelegate

    I'll go for the popup widget, that seems to be a logical step and it will save me allot of work too.
    But nobody knows why my delegate isn't working as it suppose to be?

  4. #4
    Join Date
    Dec 2006
    Posts
    849
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    6
    Thanked 163 Times in 151 Posts

    Default Re: QItemDelegate

    didn't the posting sent at 13:39 help?
    (put the const behind the signature, not in front the QWidget*)

  5. #5
    Join Date
    Jan 2008
    Posts
    58
    Qt products
    Qt4
    Platforms
    MacOS X
    Thanks
    3

    Default Re: QItemDelegate

    It works thank you so much, and I'm sorry that I put the const before the method, I'm not that well know with the c++ syntax. I'm still busy with finish the book about c++ syntax. But thank you anyway!!

Similar Threads

  1. QItemDelegate Editor Crash
    By mclark in forum Qt Programming
    Replies: 13
    Last Post: 22nd March 2018, 04:06
  2. QItemDelegate, QTreeView and scrollbars
    By SiLiZiUMM in forum Qt Programming
    Replies: 11
    Last Post: 6th May 2008, 17:23
  3. Completer on QItemDelegate
    By gemidjy in forum Qt Programming
    Replies: 6
    Last Post: 31st March 2008, 10:29
  4. Return a pointer from a QItemdelegate
    By SailinShoes in forum Qt Programming
    Replies: 5
    Last Post: 12th March 2008, 20:07
  5. premature call to setmodeldata with QItemDelegate
    By placebo in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2007, 17:39

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.