QCefView,借用了github上的一個test示例,ui替換成了QWidget,運行時QCefView初始化錯誤,麻煩哪位大佬幫忙看看
QCefViewTest::QCefViewTest(QWidget *parent)
: QMainWindow(parent)
{
m_widget = new QWidget;
QHBoxLayout *layout = new QHBoxLayout(this);
QPushButton *pBtnChangeColor = new QPushButton("Change Color", this);
connect(pBtnChangeColor, SIGNAL(clicked()), this, SLOT(onBtnChangeColorClicked()));
layout->addWidget(pBtnChangeColor);
QDir dir = QCoreApplication::applicationDirPath();
QString uri = QDir::toNativeSeparators(dir.filePath("QCefViewTestPage.html"));
m_cefView = new QCefView(uri, m_widget);
layout->addWidget(m_cefView);
m_widget->setLayout(layout);
this->setCentralWidget(m_widget);
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/232765.html
標籤:C++ 語言
