2017-07-18 124 views
0

Windows 10和Qt Creator MSVC2015_64,我編譯並運行一個QWebEngineView的例子。就像這樣:QWebEngineView無法運行

#include "mainwindow.h" 
#include <QApplication> 
#include <QWebEngineView> 
int main(int argc, char *argv[]) 
{ 
    QApplication a(argc, argv); 

    QWebEngineView *view = new QWebEngineView(); 
    view->load(QUrl("http://qt-project.org/")); 
    view->show(); 

    return a.exec(); 
} 

但是這個代碼不顯示視圖,它給一些消息:

[2460:3120:0718/170222.823:INFO:dxva_video_decode_accelerator_win.cc(1120)] mf.dll is required for hardware video decoding 
[2460:3120:0718/170222.823:INFO:dxva_video_decode_accelerator_win.cc(1120)] mf.dll is required for hardware video decoding 
[2460:3120:0718/170223.229:ERROR:gl_context_wgl.cc(78)] Could not share GL contexts. 
[2460:3120:0718/170223.229:ERROR:gl_context_wgl.cc(78)] Could not share GL contexts. 

如何解決呢?

回答

0

您正在運行哪個Windows版本?

mf.dll是Windows 6/7/8/10的一部分(因此不能在Windows XP上運行)。如果您正在運行Windows XP,則必須將Qt與配置選項「-target xp」混淆,以選擇「-no-wmf-backend」以與Windows XP兼容。

如果您運行的是一個現代版,然後通過安裝Windows Live Essentials嘗試和Media Feature Package