To convert the C++ examples to Python/PyQt4, it would help to
first be familiar with the general structure of a PyQt4 app, and the usual syntax for constructing PyQt4 widgets and calling their methods.
Below I've listed resources to help you get started learning PyQt4 (without C++). Once you have a basic familiarity with PyQt4, you should be able to convert C++ code like this (taken from the tutorial you referenced):
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QSplitter *splitter = new QSplitter;
QFileSystemModel *model = new QFileSystemModel;
model->setRootPath(QDir::currentPath());
to the equivalent PyQt4 code:
import sys
import PyQt4.QtCore as QtCore
import PyQt4.QtGui as QtGui
def main():
app = QtGui.QApplication(sys.argv)
splitter = QtGui.QSplitter()
model = QtGui.QFileSystemModel()
model.setRootPath(QtCore.QDir.currentPath())
Googling "QSplitter" and "QFileSystemModel" and "QDir" will lead you to the relevant PyQt4 documentation. It will tell you for instance, that the QApplication
class is defined in the QtGui
module. This will help you form associations between the C++ code and the equivalent PyQt4 code.
Of course, it also helps to know at least a little C++ syntax!
If you want to learn PyQt4 without knowing C++, I think it would be easiest to go through some of the tutorials listed here first.
Depending on your OS, your installation of pyqt4 may also come with a plethora of example code. For example, on Ubuntu, the
python-qt4-doc package includes tutorials and a demo launcher (qtdemo) with numerous examples.
python /usr/share/doc/python-qt4-doc/examples/demos/qtdemo/qtdemo.py

Other useful links: