1015补充:ubuntu 10下, qt474也存在同样问题。
centos下编译qtwebkit。
选用qt-everywhere-opensource-src-4.7.1包。下载地址:ftp://ftp.trolltech.com/qt/source/
编译命令:
./configure --prefix=/usr/local/qt47 -release -opensource -shared -webkit -largefile -qt-sql-mysql -no-multimedia -no-qt3support -no-gtkstyle -no-opengl -no-xvideo -nomake examples -nomake demos -nomake docs
./configure --prefix=/opt/qtsdk474 -debug-and-release -opensource -shared -webkit -largefile -qt-sql-mysql -no-qt3support -no-gtkstyle -I/opt/local/include/mysql5/mysql -L/opt/local/lib/mysql5/mysql
报错:
../WebKit/qt/Api/qwebpage.cpp:1571: error: class WebCore::EventHandler has no member named handleTouchEvent
定位到 对应文件,修改为:
1564 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
1565 void QWebPagePrivate::touchEvent(QTouchEvent* event)
1566 {
1567 //add by alex
1568 #if ENABLE(TOUCH_EVENTS)
1569 //end add.
1570 WebCore::Frame* frame = QWebFramePrivate::core(mainFrame);
1571 if (!frame->view())
1572 return;
1573
1574 bool accepted = frame->eventHandler()->handleTouchEvent(PlatformTouchEvent(event));
1575 event->setAccepted(accepted);
1576 //add by alex
1577 #else
1578 event->ignore();
1579 return;
1580 #endif
1581 //end add.
1582 }
1583 #endif
即 加上 判断: if ENABLE(TOUCH_EVENTS)
对应的Diff 看这里: DIFF
webkit bugzilla 的解释为: The call to ignore() is mandatory because touch event are accepted by default.