Fix template editor for Qt5