You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 25, 2022. It is now read-only.
我是在QDialog里面嵌入的QCefView,因为关闭QDialog的时候,父窗口会阻塞卡死。
我用隐藏窗口的办法也出问题了,我在窗口重新显示的时候尝试调用navigateToUrl,直接崩溃报错
cef_ref_counted.h(325)] Assert failed: ptr_ != 0.
CaptchaDialog::CaptchaDialog(QWidget parent) :
QDialog(parent),
ui(new Ui::CaptchaDialog)
{
qDebug() << "CaptchaDialog init";
ui->setupUi(this);
QHBoxLayout layout = new QHBoxLayout();
layout->setContentsMargins(2, 2, 2, 2);
layout->setSpacing(3);
QDir dir = QCoreApplication::applicationDirPath();
QCefSetting::setBrowserSubProcessPath(dir.filePath("QCefWing.exe"));
QCefSetting::setResourceDirectoryPath(dir.filePath("resources"));
QCefSetting::setLocalesDirectoryPath(dir.filePath("resources/locales"));
cefview = new CustomCefView("https://www.google.com", ui->Container);
ui->vl_container->addWidget(cefview);
}
CaptchaDialog::~CaptchaDialog()
{
delete ui;
}
void CaptchaDialog::closeEvent(QCloseEvent *event)
{
qDebug() << "CaptchaDialog closeEvent";
showMinimized();
}
void CaptchaDialog::showEvent(QShowEvent *event)
{
qDebug() << "CaptchaDialog showEvent";
cefview->navigateToUrl(QString("http://www.qq.com/"));
}
The text was updated successfully, but these errors were encountered: