vn.py官网
Veighna量化社区 | 你的开源社区量化交易平台
Member
avatar
加入于:
帖子: 318
声望: 94

登录时就报,来自qt.network.ssl,QSslSocket,如何解决?

description

Member
avatar
加入于:
帖子: 2874
声望: 200

可参考此帖试试看

Member
avatar
加入于:
帖子: 318
声望: 94

谢谢xiaohe!

我照帖子做了,错误少了些,可是仍然有未实现的、不支持的许可类型13的问题,这是什么问题呢:

(VN Studio) D:\ProgramFiles\VnStudio>python -m vnstation
[15944:4792:0731/160033.348:ERROR:permission_manager_qt.cpp(82)] NOT IMPLEMENTEDUnsupported permission type: 13
[15944:4792:0731/160033.348:ERROR:permission_manager_qt.cpp(82)] NOT IMPLEMENTEDUnsupported permission type: 13
[15944:4792:0731/160036.222:ERROR:permission_manager_qt.cpp(82)] NOT IMPLEMENTEDUnsupported permission type: 13
[15944:4792:0731/160036.222:ERROR:permission_manager_qt.cpp(82)] NOT IMPLEMENTEDUnsupported permission type: 13

description

是安装OpenSLL时需要捐献造成的吗?

安装完成OpenSLL的时候,显示捐献窗口,最少10$,没有选择。如何在覆盖vnpy下图的这两个DLL,这会有问题吗?

Member
avatar
加入于:
帖子: 318
声望: 94

1 找到了原因了,这是因为PyQt5中使用到Qt WebEngine造成的

https://stackoverflow.com/questions/57733039/errorpermission-manager-qt-cpp82-unsupported-permission-type-13

2 看看下面这个例子

import sys
from PyQt5.QtCore    import *
from PyQt5.QtGui     import *
from PyQt5.QtWidgets import *
from PyQt5.QtWebEngineWidgets import QWebEngineView, QWebEngineProfile, QWebEnginePage


class MainWindow(QMainWindow):
    def __init__(self, *args, **kwargs):
        super(MainWindow, self).__init__(*args, **kwargs)

        self.webview = QWebEngineView()
        webpage = QWebEnginePage(self.webview)

        self.useragent = QWebEngineProfile(self.webview)

        agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246"
        self.useragent.defaultProfile().setHttpUserAgent(agent)

        self.webview.setPage(webpage)
        self.webview.setUrl(QUrl("http://www.vnpy.com/"))

        self.setCentralWidget(self.webview)


if __name__ == '__main__':
    app = QApplication(sys.argv)
    w = MainWindow()
    w.show()
    sys.exit(app.exec_())

3 运行后结果

3.1 显示vnpy程序界面

description

3.2 cmd窗口显示结果

[16132:2840:0801/150727.844:ERROR:permission_manager_qt.cpp(82)] NOT IMPLEMENTEDUnsupported permission type: 13
[16132:2840:0801/150727.845:ERROR:permission_manager_qt.cpp(82)] NOT IMPLEMENTEDUnsupported permission type: 13
[16132:2840:0801/150730.048:ERROR:permission_manager_qt.cpp(82)] NOT IMPLEMENTEDUnsupported permission type: 13
[16132:2840:0801/150730.049:ERROR:permission_manager_qt.cpp(82)] NOT IMPLEMENTEDUnsupported permission type: 13

4 看看比较靠谱的回答

The problem has nothing to do with program execution permissions.

Qt WebEngine is written on the basis of chromium so the Qt developers do not currently implement all the functionalities but will add more functionalities little by little. In this case, the permissions available by chromium are:

enum class PermissionType {
  MIDI_SYSEX = 1,
  // PUSH_MESSAGING = 2,
  NOTIFICATIONS = 3,
  GEOLOCATION = 4,
  PROTECTED_MEDIA_IDENTIFIER = 5,
  MIDI = 6,
  DURABLE_STORAGE = 7,
  AUDIO_CAPTURE = 8,
  VIDEO_CAPTURE = 9,
  BACKGROUND_SYNC = 10,
  FLASH = 11,
  SENSORS = 12,
  ACCESSIBILITY_EVENTS = 13,
  CLIPBOARD_READ = 14,
  CLIPBOARD_WRITE = 15,
  PAYMENT_HANDLER = 16,
  BACKGROUND_FETCH = 17,
  IDLE_DETECTION = 18,
  PERIODIC_BACKGROUND_SYNC = 19,
  WAKE_LOCK_SCREEN = 20,
  WAKE_LOCK_SYSTEM = 21,

  // Always keep this at the end.
  NUM,
};
But in the case of Qt WebEngine does not handle all cases:

ProfileAdapter::PermissionType toQt(content::PermissionType type)
{
    switch (type) {
    case content::PermissionType::GEOLOCATION:
        return ProfileAdapter::GeolocationPermission;
    case content::PermissionType::AUDIO_CAPTURE:
        return ProfileAdapter::AudioCapturePermission;
    case content::PermissionType::VIDEO_CAPTURE:
        return ProfileAdapter::VideoCapturePermission;
    case content::PermissionType::FLASH:
    case content::PermissionType::NOTIFICATIONS:
    case content::PermissionType::MIDI_SYSEX:
    case content::PermissionType::PROTECTED_MEDIA_IDENTIFIER:
    case content::PermissionType::MIDI:
    case content::PermissionType::DURABLE_STORAGE:
    case content::PermissionType::BACKGROUND_SYNC:
    case content::PermissionType::SENSORS:
    case content::PermissionType::ACCESSIBILITY_EVENTS:
        break;
    case content::PermissionType::CLIPBOARD_READ:
        return ProfileAdapter::ClipboardRead;
    case content::PermissionType::CLIPBOARD_WRITE:
        return ProfileAdapter::ClipboardWrite;
    case content::PermissionType::PAYMENT_HANDLER:
    case content::PermissionType::NUM:
        break;
    }
    return ProfileAdapter::UnsupportedPermission;
}
For example in your case the warning message:

... NOT IMPLEMENTEDUnsupported permission type: 13
It follows that the PermissionType::ACCESSIBILITY_EVENTS permission is required, but according to the QtWebEngine logic return a ProfileAdapter::UnsupportedPermission which is what the warning message indicates.

Conclusion:

There is no way to solve from your side since it is a Qt/chromium warning, besides it is not an error it is only indicating that you do not have that permission.
© 2015-2022 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3

沪公网安备 31011502017034号

【用户协议】
【隐私政策】
【免责条款】