- Assuming we have a well-designed model-view application, is the following code part of a model or a view?
def save_as(self):
filename, _ = qtw.QFileDialog(self)
self.data.save_file(filename)
It's view code, since it creates a GUI element (the file dialog) and seems to call back to what might be a model (self.data).
- Can you name at least two things that a model should never do, and two things that a view should never do?
Examples of things models should never do are create or directly alter GUI elements, format data for presentation, or close the application. Examples of things views should never do are save data to disk, perform transformations on the stored data (such as sorting or arithmetic), or read data from anything other than the model.
- QAbstractTableModel and QAbstractTreeModel both have abstract in the name. What does abstract mean in this...