Results 1 to 6 of 6

Thread: MVC or not

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 69 Times in 67 Posts

    Default Re: MVC or not

    Hmm. QListWidget is a so called 'convenience class'. It is a QListView with it's model (a QAbstractListModel derivative) built into it. Internally, the QListWidget is definitely Model/View, but the code using it probably isn't. To make your implementation according to MVC, you would need to implement your own QAbstractItemModel derivative and feed it to a view. MVC is really about splitting up responsibilities: wherever you have to worry about displaying (view), do only displaying, wherever you have to worry about the data (model), do only data management. Using QListWidget more or less forces you in the 'wrong' i.e. non-MVC direction.

    Also, using delegates is different from setting item widgets. Moreover, using delegates is probably the better course of action to take.
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  2. The following user says thank you to franz for this useful post:

    Archa4 (7th February 2011)

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.