clang-tidy: Avoid potential memory leak in QtUi