It's handy to have GUIs for your ROS applications, but QT applications run a bit differently with ROS. They must be run in a multithreaded execution to work properly.
The following example shows my workflow for using a QT gui (with an external ui
file) in a ROS node:
# An example interface node for the gui
import rclpy
from rclpy.node import Node