| 32 | |
| 33 | |
| 34 | void WizWebSettingsDialog::init(const WizWebEngineInjectObjectCollection &objects, QSize sz, QWidget *parent) |
| 35 | { |
| 36 | setContentsMargins(0, 0, 0, 0); |
| 37 | |
| 38 | if (!sz.isEmpty()) { |
| 39 | setFixedSize(sz); |
| 40 | } else { |
| 41 | setWindowFlags(Qt::Window); |
| 42 | setWindowState(windowState() | Qt::WindowMaximized); |
| 43 | setGeometry(parent->geometry()); |
| 44 | } |
| 45 | |
| 46 | QPalette pal = palette(); |
| 47 | pal.setBrush(backgroundRole(), QBrush("#FFFFFF")); |
| 48 | setPalette(pal); |
| 49 | |
| 50 | m_progressWebView = new WizLocalProgressWebView(objects, this); |
| 51 | |
| 52 | QVBoxLayout* layout = new QVBoxLayout(this); |
| 53 | layout->setSizeConstraint(QLayout::SetMaximumSize); |
| 54 | layout->setContentsMargins(0, 0, 0, 0); |
| 55 | layout->setSpacing(0); |
| 56 | layout->addWidget(m_progressWebView); |
| 57 | setLayout(layout); |
| 58 | |
| 59 | // Publish C++ object |
| 60 | WizWebEngineView* web = m_progressWebView->web(); |
| 61 | WizMainWindow* mainWindow = WizGlobal::mainWindow(); |
| 62 | if (mainWindow) { |
| 63 | WizWebEngineInjectObjectCollection tmp = objects; |
| 64 | tmp.insert("WizExplorerApp", mainWindow->publicAPIsObject()); |
| 65 | auto profile = createWebEngineProfile(tmp, this); |
| 66 | auto webPage = new WizWebEnginePage(tmp, profile, web); |
| 67 | web->setPage(webPage); |
| 68 | } |
| 69 | |
| 70 | connect(web, SIGNAL(loadFinishedEx(bool)), SLOT(on_web_loaded(bool))); |
| 71 | |
| 72 | QTimer::singleShot(100, [=] { |
| 73 | load(); |
| 74 | }); |
| 75 | } |
| 76 | |
| 77 | |
| 78 | WizWebEngineView* WizWebSettingsDialog::web() |
nothing calls this directly
no test coverage detected