- 具体错误
[4448:9040:0109/135034.634:FATAL:render_frame_host_impl.cc(672)] Check failed: ::content::BrowserThread::CurrentlyOn(BrowserThread::UI). Must be called on Chrome_UIThread; actually called on Unknown Thread.
Backtrace:QWebEngineUrlSchemeHandler::qt_static_metacall [0x00007FFFA9DF24D2+994866]QWebEngineUrlSchemeHandler::qt_static_metacall [0x00007FFFA9D876CC+557100]QWebEngineUrlSchemeHandler::qt_static_metacall [0x00007FFFA9D87683+557027]QWebEngineUrlSchemeHandler::qt_static_metacall [0x00007FFFA9CFFFAE+2318]GetHandleVerifier [0x00007FFFACB15F0F+47108287]GetHandleVerifier [0x00007FFFACB15E27+47108055]GetHandleVerifier [0x00007FFFACC1E651+48191489]QtWebEngineCore::WebContentsAdapter::runJavaScript [0x00007FFFA61C4871+193]QWebEngineHistory::currentItemIndex [0x00007FF81C758937+87637]BaiduMapWidget::callToWeb [0x00007FF7689B42EB+43] (D:\SVN-WORK\branch\BaiduMap\BaiduMapWidget.cpp:55)BaiduMapWidget::targetAdd [0x00007FF7689B3B60+672] (D:\SVN-WORK\branch\BaiduMap\BaiduMapWidget.cpp:129)RadarWorker::run [0x00007FF7689B8813+355] (D:\SVN-WORK\branch\BaiduMap\RadarWorker.cpp:24)QTextStream::realNumberPrecision [0x00007FFFE629AA8B+564878]BaseThreadInitThunk [0x00007FF874C4E8D7+23]RtlUserThreadStart [0x00007FF87523FBCC+44]
- 解决办法
出错是因为调用时,不在期望的线程中。参考:
QMetaObject::invokeMethod使用方法-CSDN博客