Failed to find Qt component “Widgets“ [How to Solve]

In the project, QT6 is used 2.1 after installing QT, this error is reported when QtCreator is used:

but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
  FOUND.  Reason given by package:

  Failed to find Qt component "Widgets" config file at ""

The reason is that although QT has been installed, some other libraries QT depends on have not been installed:

I use Ubuntu system: use the following command to install (OpenGL installation)

sudo apt-get install build-essential libgl1-mesa-dev

Read More: