[PyQT] Model View Video Tutorial Series (Part 01)

Playlist from Part 01 to 07 :slight_smile:
http://www.youtube.com/view_play_list?p=8B63F2091D787896

Hey people!
I’ve started on a video tutorial series where I will be going through Model View programming Methodology in UI development with PyQt4.



Part 01 : Introduction to Model View Methodology
0: http://www.youtube.com/watch?v=mCHVI8OXDxw
1: http://www.youtube.com/watch?v=2sRoLN337cs
Src: http://www.yasinuludag.com/PyQt/Tutorial01/Tutorial01_ModelViewIntro.py

Part 02 : Creating our own editable 1D / List Model
0: http://www.youtube.com/watch?v=Eq7__6y0jwo
1: http://www.youtube.com/watch?v=azGfJ7-wK_g
2: http://www.youtube.com/watch?v=DVDKDYhFU1o
Src: http://www.yasinuludag.com/PyQT/Tutorial02/Tutorial02_ListModel.py

Part 03 : Inserting, Removing covered, creating our own fully implemented 2D / Table Model
0: http://www.youtube.com/watch?v=EmYby3BB3Kk
1: http://www.youtube.com/watch?v=fxLIGaTZ4pk
2: http://www.youtube.com/watch?v=ZLsRi6gY7y0
Src: http://www.yasinuludag.com/PyQt/Tutorial03/Tutorial03_TableModel.py

Part 04 : Creating our own advanced Hierarchical / Tree Model (Scenegraph alike)
0: http://www.youtube.com/watch?v=pr1M3mP7qfI
1: http://www.youtube.com/watch?v=VcN94yMOkyU
2: http://www.youtube.com/watch?v=GDB2PuJ4_7s
3: http://www.youtube.com/watch?v=1WWp71fTdTQ
Src: http://www.yasinuludag.com/PyQt/Tutorial04/Tutorial04_TreeModel.py , http://www.yasinuludag.com/PyQt/Tutorial04/icons_rc.py

Part 05 : Learning about the QAbstractProxyModel / QSortFilterProxyModel class
0: http://www.youtube.com/watch?v=Dp-BRJer5CQ
1: http://www.youtube.com/watch?v=KWhHwOG0ZO8
UI: http://www.yasinuludag.com/PyQt/Tutorial05/Tutorial05.ui
Src: http://www.yasinuludag.com/PyQt/Tutorial05/Tutorial05_ProxyModel.py , http://www.yasinuludag.com/PyQt/Tutorial05/icons_rc.py

Part 06 : Learning about QDataWidgetMapper to create designer made static editors / property grids
0: http://www.youtube.com/watch?v=76uvvZymyoU
1: http://www.youtube.com/watch?v=x1Emco2SXWY
2: http://www.youtube.com/watch?v=7omei2RCtDI
3: http://www.youtube.com/watch?v=mWn8MBPidmE
4: http://www.youtube.com/watch?v=Gil-dg3ajbA
Src / UI: http://www.yasinuludag.com/PyQt/Tutorial06/Tutorial06_DataWidgetMapper.zip

Part 07 : Refactor our code. Use PyQt4.QtXml package, serialize our model into Xml, create enum properties etc
0: http://www.youtube.com/watch?v=hWB5nddWyCs
1: http://www.youtube.com/watch?v=k102fYZBdh0
2: http://www.youtube.com/watch?v=PTTe6soX0wk
3: http://www.youtube.com/watch?v=IW0Nu_DJ4hw
4: http://www.youtube.com/watch?v=AONvtOcpaws
Src / UI: http://www.yasinuludag.com/PyQt/Tutorial07/Tutorial07_RefactorAndXml.zip


I hope you like the format of these tutorials!
I’ll be posting them on my blog from now on so I have them all in a single place instead of making new thread for each video.

I hope you enjoy it, and please tell me what you think about them on this thread, I would love to improve on what I lack :slight_smile:

Best regards Yaz!


Forecast:
Part 08 : Learning about dragging, dropping items. Understanding mimetypes and serializing, unserializing data to and from draggable format etc.
Part 09 : Learning about Qt Delegates and their roles in Model View. (Painting ITEMS, providing editors etc) using QItemDelegate
Part 10 : Building our own DYNAMIC PROPERTIES GRID with what we have learned so far, using a QTreeView :slight_smile:

note : List might change as I work on the tutorials… and more will be added later

4 Likes

Nice job so far Yasin, you got a follower. Thanks for making it entertaining

1 Like

Looking forward to the rest! Model-view programming is awesome, good to see some good tutorials for it finally :slight_smile:

Good presentation style.

I am definitely forwarding this to all my recent PyQt newbies as a good intro to MVVM.

Cheers

Thanks for the kind words. :slight_smile:

I’ve split Part 2 into 3 videos. Single (LIST), Multi (TABLE) dimensional and Hierarchical data (TREE).
Part 2.1 will be up tomorow talking about how a view and model communicates with each other, we will also create our first model which is initially read only, and then we’re gonna make it editable and in the end you’ll know exactly how to create your own Single dimensional Models.

This is going to be so useful.

Many thanks for these looking forward to watching them.

Part 02 is up :slight_smile: Updated the first post aswell!

Part 02: Creating our own editable 1D / List Model
0: http://www.youtube.com/watch?v=Eq7__6y0jwo
1: http://www.youtube.com/watch?v=azGfJ7-wK_g
2: http://www.youtube.com/watch?v=DVDKDYhFU1o

I hope you like it :slight_smile:

Very awesome sir. Thank you kindly.

Good stuff.

Glad you guys like them :slight_smile: Motivates me to do them!

Great thank you, there is a good deal of effort involved in this type of thing it is much appreciated.

If you are keeping the source it could be good to convert for popular smart phones.
I find having the Python Osmosis series a handy thing to have on my iphone for quick refreshers in certain topics as I’m still learning and advancing into python.

That’s actually a great idea and I can even host it! =} I’ll see if I can convert the source files to a mobile format. :slight_smile:

“handbrake” might get you there pretty quickly and with decent results, if that helps at all?

very nice! had a lookthru last evening. very interesting indeed!

I’m working on Part 3 as we speak… I didn’t have time a few days ago but it will be up tomorow or the day after!

Peace!

Sweet vids, eager to know more, as I’m just getting into pyqt.

I know I’m late, and I’m sorry for that! But I was very busy. Better late than never :slight_smile:
That’s also the reason why I haven’t uploaded the mobile versions. I’ll see if I can convert them all tomorow :slight_smile:

Part 03 : Inserting, Removing covered, creating our own fully implemented 2D / Table Model
0: http://www.youtube.com/watch?v=EmYby3BB3Kk
1: http://www.youtube.com/watch?v=fxLIGaTZ4pk
2: http://www.youtube.com/watch?v=ZLsRi6gY7y0

If you wonder what happened to my voice at the end, it’s because I got too tired by the end of the process :smiley:

Updated the first post aswell!

Enjoy :slight_smile:

In video 02_1, when you add the def data to the model and return the string “Hardcoded”, it wouldn’t display that string for me. I had to wrap the string in QtCore.QVariant(“HardCoded”), to get it to work. Just curious why that is and what a QVariant is? Thanks!

Hey! QVariant is a value container. It allows you to store a single value, and the type of that value is described by the type() method. This is needed for Qt properties and also databases etc. It’s basicaly a wrapper for your data, and has alot of common methods such as convert and used by Qt everywhere almost…

The reason you had to supply a QVariant(“Hardcoded”) is probably because your PyQT version doens’t match mine.

I believe I saw somewhere in the update log that QVariants where automated. So instead of having to write QtCore.QString(“Hardcoded”) I could write “Hardcoded” and it would know that the python string should be a QtCore.QString object :slight_smile:

Oh ok, that makes sense. Thanks!