I intend to replace webkit QT with my own Webkit OSX in a QT-based application, which I did right now by creating a QT control inherited from QMacCocoaViewContainer and injecting cocoa web view into it. It may display the page correctly, but cocoa webview cannot receive the mouse move event, therefore the js / css hover effect cannot be shown. I tried comparing it with the cocoa native application and found that the cocoa web view could receive NSMouseMovedNotifcation from the notification center in the cocoa native application, but the QT application creates its own event loop and dispatches the event with its own strategy. notification is not accepted.
Who can tell me how to fix this? Any comments are greatly appreciated.
QTWebView(QWidget *pparent): QMacCocoaViewContainer(0, pparent) { ... xwebview = [[WebView alloc] init]; setCocoaView(xwebview); NSString *urldefault = @"http://www.google.com"; [[xwebview mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urldefault]]]; ... }
source share