[SOLVED] Unable to add a QWebView to a ui file
-
I use the latest Qt SDK for Mac OS X. I have a Mac mini (late 2009) with Mac OS X 10.6.5 and I use Qt Creator 2.0.1 and Qt 4.7.0 (64bit), installed from the binary installer for Qt SDK 2010.05 for Mac from qt.nokia.com.
The following is about creating Qt GUI Applications (File, New File or Project, Qt C++ Project, Qt Gui Application).
Two problems:
First, a general problem. Every time I run a app from Qt Creator, I get these two warnings:
:: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -L not found
:: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -F not foundAnd a more specific problem: If I add a QWebView to the mainwindow.ui user interface (graphically, with drag-n-drop of a QWebView display widget in the Design mode of Qt Creator), I get (additionally to the two previous mentioned warnings) the following linker errors with no additional information:
:: error: symbol(s) not found
:: error: collect2: ld returned 1 exit status -
I'm answering only for WebView issue, the other one seems some missing library you need to install (maybe some bug related to mac SDK).
So, if you want to use webview you need to link your app with WebKit, you do that by adding this line in your .pro file:
@QT += webkit@
By default Qt add only QT += core gui if you don't check others in the wizard that creates the project.LE: you need to Rebuild , or Clean All then Rebuild after you make changes to .pro file
-
[quote author="Zlatomir" date="1293986927"]I'm answering only for WebView issue, the other one seems some missing library you need to install (maybe some bug related to mac SDK).
So, if you want to use webview you need to link your app with WebKit, you do that by adding this line in your .pro file:
@QT += webkit@
By default Qt add only QT += core gui if you don't check others in the wizard that creates the project.LE: you need to Rebuild , or Clean All then Rebuild after you make changes to .pro file[/quote]
Thanks for the solution to my second question! How did I forget this? :) Actually, the window for checking which Qt-modules you want is not there in this version of Qt Creator!
-
The webkit problem is solved with Zlatomir's answer.
For the lib problem, this "older thread":http://developer.qt.nokia.com/forums/viewthread/1103 might help, especially bug report "QTBUG-13462":http://bugreports.qt.nokia.com/browse/QTBUG-13462
-
[quote author="Volker" date="1293989308"]The webkit problem is solved with Zlatomir's answer.
For the lib problem, this "older thread":http://developer.qt.nokia.com/forums/viewthread/1103 might help, especially bug report "QTBUG-13462":http://bugreports.qt.nokia.com/browse/QTBUG-13462[/quote]
Ok then! "Good" to know that it is not a problem with something with my installation!
Thanks for the answer. :)