I am new to PyQt5 and I tried to translate some code written in C++ with Qt to PyQt5: It is a drawing app as seen here: http://www.newthinktank.com/2018/07/qt-tutorial-5-pai