10

I installed Qt for mac via .dmg installer. I added this to my .pro file:

QT       += webkitwidgets

and then i got this error:

Project ERROR: Unknown module(s) in QT: webkitwidgets

On Ubuntu, this solution works fine:

sudo apt-get install libqt5webkit5-dev

Also, if I run whereis qmake nothing shows up.

Does anybody know how to fix this on Mac OS?

Community
  • 1
  • 1
Luca Boieru
  • 2,260
  • 4
  • 17
  • 15
  • Are you using QtCreator, qmake from command line, or some other IDE to get qmake run? – László Papp Dec 29 '14 at 14:21
  • Can you check on the Projects page whether it is using qmake from the .dmg installation? In addition, can you check if the webkitwidgets module is installed propely along with the rest? – László Papp Dec 29 '14 at 14:28
  • `whereis` is kind of funny in os x. I don't know exactly why, but I think whereis only searches in some hardcoded paths (like /usr/bin , /usr/sbin, /sbin, /bin) and you can't pass flags to it (like you can in linux). I suggest you to use `which`. Is more powerful. Also after you installed qt from dmg the path to qmake should be `yourInstallPath/qt5/5.4.0/bin/qmake`. If you still can't find it, I suggest you to use [homebrew](http://brew.sh/) to install qt and to symlink everything. In homebrew you can find `qt` (4) and `qt5`. – radubogdan Dec 30 '14 at 09:03
  • I'm having the same, no solutions? – Don Giulio Apr 07 '16 at 08:18
  • Which version are you running? How did you install what does `which qmake` returns? – bibi Nov 09 '16 at 15:06

3 Answers3

3

you can reinstall qt with homebrew, then make sure to add the flag --with-qtwebkit so in total:

    brew install qt --with-qtwebkit
Matthias Michael Engh
  • 1,159
  • 2
  • 10
  • 25
  • 9
    Brew responds with: `Warning: qt: this formula has no --with-qtwebkit option so it will be ignored!` – SimpleJ Dec 20 '17 at 22:15
  • 2
    @Matthias .. I get an error `Error: invalid option: --with-qtwebkit` – Eyshika Sep 25 '19 at 17:39
  • 3
    This still fails on macOS Mojave. ```brew install qt@5.7 --with-qtwebkit``` gives ```Error: invalid option: --with-qtwebkit``` – Prof Huster Jan 17 '20 at 14:28
  • There's also [this doc](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit#macOS-catalina-1015) on dealing with this issue, except that they tell you to follow the guide for sierra. Except that when trying to do that, the install fails because catalina is not supported for something in that process. – BJ McDuck Sep 29 '20 at 03:47
2

It seems that qtwebkit is deprecated as of version upper than 5.7

Instead of brew install qt --with-qtwebkit
Try brew install qt@5.7 --with-qtwebkit

It seems that this is last formula version with --with-qtwebkit option

https://github.com/Homebrew/homebrew-core/blob/master/Formula/qt@5.7.rb

iamandrewluca
  • 3,411
  • 1
  • 31
  • 38
1

In the installer there is a separate point "Qt WebEngine" that you have to check during installation:

enter image description here

SteakOverflow
  • 1,953
  • 13
  • 26