I found the solution and because I know it is the question of many users I share my solution:
First of all, for working with camera and webcams, use OpenCV library. There are a lot of tutorials for using OpenCV library inside Qt.
It is completely possible to find how many webcams in the system using OpenCV. In this page you can find out how to do this.