What’s difference between these defining;
#include "QWebView" class QWebView;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
class QWebView;is a so called forward declaration. That means, you can’t access details of the class (like methods/public variables) until the type is completely declared. The forward declaration, only tells the compiler that this particular type exists, whereas the full include tells the compiler, what methods etc. that class provides.If you just wan’t to use the type in a declaration, it’s fine. But as soon, as you call a method on a variable of type
QWebView, you will get an error, if you don’t include the full declaration.