why having this problem.
Because your cpp file probably hasn't #include-d the header file that defines the QWebFrame class.

how to solve this problem.
Add the proper #include statement to your cpp file.