Results 1 to 5 of 5

Thread: View delegate - how to make it always visible?

  1. #1
    Join Date
    Nov 2009
    Location
    US, Midwest
    Posts
    215
    Thanks
    62
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default View delegate - how to make it always visible?

    I am using model-view with QTreeView as a view and a model derived from QAbstractTableModel. One of the columns has custom delegate (spinbox) for editing values.

    Question: I can't find a way to make a delegate view constantly visible. I want spinbox to be always visible in a treeview, not only when treeview cell of the "spinbox" column is in edit mode.

    Any advise or link to the documentation is appreciated. Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: View delegate - how to make it always visible?

    The delegate is never visible. It's just a C++ object. What can be visible is the item editor provided by the delegate. And now that you know how it is called, it should be easier for you to find the proper call in the view's API.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2010
    Posts
    15
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: View delegate - how to make it always visible?

    Can you describe more detailed how implement this possibility? ))
    A lot people will be thanks to you!

  4. #4
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: View delegate - how to make it always visible?

    AFAIK You can't do that, because SpinBox is QWidget and Views can't display normally QWidget.
    Said that You can achieve that overriding paint event on the Delegate and implement painting Yourself. Of course this will only "imitate" actual widget for the view purpose, and You of course need delegate to edit. So basically You use delegate to get access to the data, and override paint to simply display / paint desired QWidget on the view (View is untouched that way).

  5. #5
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    509
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: View delegate - how to make it always visible?

    Hi, a "persistent" editor is what you're looking for.

    Ginsengelf

Similar Threads

  1. Add docks and make them visible
    By devent in forum Newbie
    Replies: 6
    Last Post: 15th January 2012, 02:01
  2. Replies: 1
    Last Post: 22nd October 2007, 02:04
  3. Make the cursor visible in textEdit (Qt3.3.5)
    By vermarajeev in forum Qt Programming
    Replies: 9
    Last Post: 24th January 2007, 22:50
  4. how to make menu visible false?
    By rajesh in forum Qt Programming
    Replies: 2
    Last Post: 18th July 2006, 10:04
  5. Under the delegate the data are visible
    By Mad Max in forum Qt Programming
    Replies: 10
    Last Post: 16th February 2006, 12:28

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.