WSL start QT error qt.qpa.xcb : could not connect to display :0.0

The error is as follows:

loaded library “/opt/qtcreator-4.8.2/lib/Qt/plugins/platforms/ libqxcb.so “
qt.qpa.xcb : could not connect to display :0.0
qt.qpa.plugin : Could not load the Qt platform plugin “xcb” in “” even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

The reason is: QT needs to display windows, but WSL does not have this function. It is necessary to install mobaxterm on Windows first. Open Ubuntu in mobaxterm, and then open QT in Ubuntu.

Read More: