Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy Qt is misusing model/view terminology?
    text
    copied!<p>I think that the terminology used in Qt with model/view controls is flawed. On <a href="https://doc.qt.io/qt-5.7/model-view-programming.html" rel="noreferrer">their explanation page</a> they state, that they simplified the MVC to MV by merging View and Controller and they are giving the following picture:</p> <p><img src="https://i.stack.imgur.com/z7v18.png" alt="picture explaining Qt MVC"></p> <p>However I think, they misnamed the roles of objects and I think that, </p> <ol> <li>What they call View with merged Controller is in fact a View only.</li> <li>What they call Model is in fact Controller only.</li> <li>If you really want to have a model it would be somewhere where their "Data" is.</li> </ol> <p>I am speaking about usual and sane way you would use Qt model/view component in your app. Here are the reasons:</p> <ol> <li>This is typically Qt component which is used as is, without adding any Controller logic specific to your objects)</li> <li>This is hardly a Model, just because you should implement several Qt methods like rowCount, columnCount, data etc. which have nothing to do with your model. In fact there are typical model methods found in Controllers. Of course, you can implement both Controller <strong>and</strong> Model logic here, but first it would be quite bad code design and secondly you would merge Controller and Model not Controller and View as they state.</li> <li>As said in reason 2. if you want to separate Model logic that it is surely not the blue box on the picture, but rather the dashed "Data" box (communicating to real Data of course).</li> </ol> <p>Is Qt wrong in their terminology, or it is just me who does not understand? (BTW: The reason why it is not academic question is that I have started to code my project following their naming and I have soon found out, that the code clearly is not right. It was only after that when I realized, that I should not try put Model logic in what they call Model)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload