这个问题在这里已有答案:
我需要从qtwebkit获取隐藏的API WebCore。
例如
QWebPage *page = mainWidget->page();
QWebFrame *qtWebFrame = mainWidget->page()->mainFrame();
QWebFramePrivate *qtWebFramePrivate = qtWebFrame->d;
WebCore::Frame *frame = qtWebFramePrivate->frame;
WebCore::DocumentWriter m_writer(frame);
m_writer.setFrame(frame);
m_writer.begin(url, false);
m_writer.setDocumentWasLoadedAsPartOfNavigation();
m_writer.setEncoding("utf-8", true);
m_writer.addData(html ,strlen(html) );
m_writer.end();
如何导出这个私有WebCore?
您必须在目标上设置正确的属性:
add_executable(MyTarget ...)
set_target_properties(MyTarget PROPERTIES CXX_VISIBILITY_PRESET default)