PDA

View Full Version : How to Automatically Compile QWebView



starkid
20th October 2012, 23:29
I had added
QT += webkit to my .pro file, as well as
#include <QWebView> to my header file, and my project was compiling. I ran qmake -project to get rid of a vtable error, and now QtCreator is complaining about

QWebView: No such file or directory.. I opened the .pro file, and
QT += webkit is gone.

Is there something I can do to automate this, or will I always have to manually edit my .pro files?

ChrisW67
21st October 2012, 02:43
You ran "qmake -project" which generates a template PRO file listing all the headers and sources in the directory. That is, you asked qmake to overwrite the existing pro file with a template. You never need to run this more than once when first setting up your project (it's not essential then either).

If you modify Q_OBJECT macros in your headers, or add/remove sources etc. then you should run "qmake". This rewrites the Makefile based on the rules in the PRO file: it does not modify the PRO file.