MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / init

Method init

src/WizWebSettingsDialog.cpp:34–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33
34void 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
78WizWebEngineView* WizWebSettingsDialog::web()

Callers

nothing calls this directly

Calls 5

createWebEngineProfileFunction · 0.85
isEmptyMethod · 0.80
setContentsMarginsMethod · 0.80
webMethod · 0.45
publicAPIsObjectMethod · 0.45

Tested by

no test coverage detected