Hi,
The sample is to render directly through libDRM. Does not work with X11 or Wayland being enabled.
For running QT, there is information in the posts:
PySide2 (Qt for python) installation on Jetson Xavier - #5 by Muscle_Oliver
Jetson Nano and Qt5 - #2 by WayneWWW
FYR. It works in QT_QPA_PLATFORM=eglfs. Not sure whether it works the same with Wayland.