Mastering MVC

Now that our solution structure is in place, we’ll get started on the MVC implementation. As you’ll see, it is very minimal and incredibly easy to set up.

First, expand cm-ui > Resources > views.qrc > / > views, right-click on main.qml, select Rename, and rename the file as MasterView.qml. If you get a message about project editing, just select Yes to continue anyway:

If you do get the error message, the file will still appear as main.qml in the Projects pane, but the file will have been renamed in the filesystem.

Next, edit views.qrc (right-click on it and select Open With > Plain Text Editor). Replace the content as follows: ...

Get End to End GUI Development with Qt5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.