Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: 在windows11 64bit, Qt5.15.2 + MSVC2022 64bit环境下崩溃 #381

Open
xiechongzhu opened this issue Mar 5, 2024 · 2 comments
Open

Comments

@xiechongzhu
Copy link

xiechongzhu commented Mar 5, 2024

操作系统:win11 64位企业版
Qt版本:5.15.2 MSVC 64位
VS版本:2022企业版64位

按照帮助文档里的方法写了一个demo,在程序启动的时候报错:
[0305/222822.360:WARNING:chrome_browser_cloud_management_controller.cc(87)] Could not create policy manager as CBCM is not enabled.
[0305/222822.360:WARNING:chrome_browser_cloud_management_controller.cc(87)] Could not create policy manager as CBCM is not enabled.

DevTools listening on ws://127.0.0.1:9000/devtools/browser/b00a81f8-8e1a-4485-bf0b-048b67cb8fb8
CCefAppDelegate is being destructed
[0305/222822.403:FATAL:request_context_impl.cc(97)] Check failed: false. context not valid
[0305/222822.403:FATAL:request_context_impl.cc(97)] Check failed: false. context not valid

程序代码:

int main(int argc, char *argv[])
{
    QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    QApplication a(argc, argv);
    QCefConfig config;
    config.setUserAgent("QCefViewTest");
    config.setLogLevel(QCefConfig::LOGSEVERITY_DEFAULT);
    config.setBridgeObjectName("CallBridge");
    config.setRemoteDebuggingPort(9000);
    config.setBackgroundColor(Qt::lightGray);

    // add command line args
    // config.addCommandLineSwitch("allow-universal-access-from-files");
    config.addCommandLineSwitch("enable-media-stream");
    config.addCommandLineSwitch("use-mock-keychain");
    config.addCommandLineSwitch("allow-file-access-from-files");
    config.addCommandLineSwitch("disable-spell-checking");
    config.addCommandLineSwitch("disable-site-isolation-trials");
    config.addCommandLineSwitch("enable-aggressive-domstorage-flushing");
    //config.addCommandLineSwitchWithValue("renderer-process-limit", "1");
    config.addCommandLineSwitchWithValue("disable-features", "BlinkGenPropertyTrees,TranslateUI,site-per-process");
    QCefContext(&a, argc, argv, &config);
    MainWindow w;
    w.show();
    return a.exec();
}

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QString htmlFile = qApp->applicationDirPath() + "/../../index.html";
    ui->widget->navigateToUrl(htmlFile);
}
@L-Super
Copy link
Member

L-Super commented Mar 7, 2024

Based on the limited information provided,you can try to search for information about CBCM, this should be related to CEF

@be-water-myFriend
Copy link
Contributor

ui->widget初始化有问题,你按example里面的方式试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants