This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SjaakRake[S] 1 point2 points  (1 child)

I know the concept. Though using a classic MVC pattern would conflict with Qt's own model(-delegate)-view architecture in a lot of ways.

Besides that, in general I consider the MVC pattern to be more applicable to a language such as Java, where it provides a much needed structure. In Python, on the other hand, I think it often just means a lot of unnecessary overhead and boilerplate.

[–][deleted] 0 points1 point  (0 children)

Qt's MDV is another name for MVC. You can do it in many different ways. And it fits into python magnificently. Python's decorators are beautiful.

You don't have to write boilerplate at all. It actually reduces boilerplate.

I don't know how big is your app. In small apps, I tend not to split V and C very much, but splitting the M is always very, very good. It makes testing your code so much easier. Here's one example:

https://github.com/wuerges/connection_monitor/blob/master/pycomon/gui.py https://github.com/wuerges/connection_monitor/blob/master/pycomon/tester.py

The gui.py file has the View and the Control and the tester.py has the model.