RESOLVED FIXED 88308
[Qt][Win] Fix building Source/WebCore/plugins/win/PluginViewWin.cpp
https://bugs.webkit.org/show_bug.cgi?id=88308
Summary [Qt][Win] Fix building Source/WebCore/plugins/win/PluginViewWin.cpp
Csaba Osztrogonác
Reported 2012-06-05 01:21:57 PDT
- Use QtWidgets/QWidget include instead of obsolete QWidget - QWidget->winId() doesn't work for some reason
Attachments
Patch (1.13 KB, patch)
2012-06-05 09:10 PDT, Csaba Osztrogonác
no flags
Patch (1.48 KB, patch)
2012-06-07 09:43 PDT, Csaba Osztrogonác
no flags
Patch (1.67 KB, patch)
2012-06-08 07:59 PDT, Balazs Kelemen
no flags
Patch (1.83 KB, patch)
2012-06-08 09:59 PDT, Balazs Kelemen
no flags
Csaba Osztrogonác
Comment 1 2012-06-05 09:10:39 PDT
Csaba Osztrogonác
Comment 2 2012-06-05 09:14:00 PDT
(In reply to comment #0) > - Use QtWidgets/QWidget include instead of obsolete QWidget > - QWidget->winId() doesn't work for some reason The patch only fixes the first bug. The second one is here, but I don't know how to fix it: f:\WebKit\Source\WebCore\plugins\win\PluginViewWin.cpp(105) : error C2440: 'return' : cannot convert from 'WId' to 'HWND' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Caio Marcelo de Oliveira Filho
Comment 3 2012-06-05 11:19:33 PDT
(In reply to comment #2) > (In reply to comment #0) > > - Use QtWidgets/QWidget include instead of obsolete QWidget > > - QWidget->winId() doesn't work for some reason > > The patch only fixes the first bug. > > The second one is here, but I don't know how to fix it: > f:\WebKit\Source\WebCore\plugins\win\PluginViewWin.cpp(105) : error C2440: 'return' : cannot convert from 'WId' to 'HWND' > Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast WId used to be a typedef to HWND, but it isn't anymore. It seems to me we need to do more work to get the HWND. By insepcting Qt code, it seems using QApplicationPrivate::getHWNDForWidget() instead of winId() would suffice.
Simon Hausmann
Comment 4 2012-06-05 14:08:54 PDT
Comment on attachment 145814 [details] Patch Hm no, if we were using QT += widgets in WebCore, then this would not be needed. But we shouldn't use QT += widgets in WebCore, so the question is: Why dos PluginViewWin.cpp need QWidget? I have the feeling that for Qt 5 it's not actually QWidget that's needed but QWindow instead, to make the resolution from the WebView to a HWND.
Caio Marcelo de Oliveira Filho
Comment 5 2012-06-05 15:44:21 PDT
(In reply to comment #3) > By insepcting Qt code, it seems using QApplicationPrivate::getHWNDForWidget() instead of winId() would suffice. Note that getHWNDForWidget() is implemented using the QWidget's QWindow, so we possibly can do the same, getting rid of the QWidget dependency.
Caio Marcelo de Oliveira Filho
Comment 6 2012-06-05 15:44:45 PDT
(In reply to comment #5) > Note that getHWNDForWidget() is implemented using the QWidget's QWindow, so we possibly can do the same, getting rid of the QWidget dependency. (...in this particular case.)
Csaba Osztrogonác
Comment 7 2012-06-07 07:53:39 PDT
I don't understand what are you talking about. :) Any volunteer to fix it?
Csaba Osztrogonác
Comment 8 2012-06-07 09:43:59 PDT
Created attachment 146311 [details] Patch Please don't review it, I don't want to land it. It is only a workaround until proper fix to be able test other build problems.
Csaba Osztrogonác
Comment 9 2012-06-07 09:44:30 PDT
No, I didn't want to assign it to myself, but webkit-patch did it again ...
Balazs Kelemen
Comment 10 2012-06-08 07:59:28 PDT
Balazs Kelemen
Comment 11 2012-06-08 08:01:04 PDT
Ossy, could you test it? Maybe a cast is missing.
Csaba Osztrogonác
Comment 12 2012-06-08 09:11:20 PDT
(In reply to comment #11) > Ossy, could you test it? Maybe a cast is missing. Sure. PluginViewWin.cpp f:\WebKit\Source\WebCore\plugins\win\PluginViewWin.cpp(104) : error C2027: use of undefined type 'QWindow' f:\qt5\qtbase\include\qtgui\../../src/gui/kernel/qwindowdefs.h(57) : see declaration of 'QWindow' f:\WebKit\Source\WebCore\plugins\win\PluginViewWin.cpp(104) : error C2227: left of '->winId' must point to class/struct/union/generic type NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 10.0\VC\Bin\cl.EXE"' : return code '0x2' Stop. It seems we need different codepaths for Qt4 and Qt5: #if HAVE(QT5) #include <QWindow> #else #include <QWidget> #endif ... and similar when we use included things and after this fix I got the following error: f:\WebKit\Source\WebCore\plugins\win\PluginViewWin.cpp(109) : error C2440: return' : cannot convert from 'WId' to 'HWND' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Balazs Kelemen
Comment 13 2012-06-08 09:59:43 PDT
Balazs Kelemen
Comment 14 2012-06-10 06:44:45 PDT
Comment on attachment 146590 [details] Patch Clearing flags on attachment: 146590 Committed r119927: <http://trac.webkit.org/changeset/119927>
Balazs Kelemen
Comment 15 2012-06-10 06:44:54 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.