Results 1 to 10 of 10

Thread: Use of same widget for display and edit in model-view

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,349
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: Use of same widget for display and edit in model-view

    Quote Originally Posted by wysota View Post
    It's quite the opposite. It is the delegate that draws the box. There is no real checkbox widget there.
    But you (the application writer) do not need to create an explicit checkbox delegate in order to have an editable checkbox appear in a table, isn't that correct? It is something the framework takes care of for you when you set the appropriate flags. That's what I was getting at.

    You don't need to cache anything. There is an API for this.
    Through QStyle? Or through QStyledItemDelegate or a subclass? Can you point to an example?

    Thanks.

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

    Default Re: Use of same widget for display and edit in model-view

    Quote Originally Posted by d_stranz View Post
    But you (the application writer) do not need to create an explicit checkbox delegate in order to have an editable checkbox appear in a table, isn't that correct?
    There is already a delegate setup for you when you create a view.


    Through QStyle? Or through QStyledItemDelegate or a subclass? Can you point to an example?
    Qt Code:
    1. style()->drawControl(...); // or similar
    To copy to clipboard, switch view to plain text mode 
    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.


Similar Threads

  1. Replies: 8
    Last Post: 6th May 2010, 11:17
  2. QTableView - model / view pattern - layout, edit
    By vlastagf in forum Qt Programming
    Replies: 4
    Last Post: 1st August 2009, 22:42
  3. Problems to display a QFont in a View/Model correctly
    By NoRulez in forum Qt Programming
    Replies: 0
    Last Post: 8th July 2009, 12:26
  4. Replies: 1
    Last Post: 16th January 2008, 11:48
  5. Model-view: Display items in different ways
    By taboom in forum Qt Programming
    Replies: 3
    Last Post: 13th August 2007, 19:05

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.