MCPcopy Create free account
hub / github.com/MediaArea/MediaInfo / HTMLViewWidget

Method HTMLViewWidget

Source/GUI/Qt/htmlwidget.cpp:24–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22using namespace ZenLib;
23
24HTMLViewWidget::HTMLViewWidget(Core *C, QSettings *settings, QWidget *parent)
25 : QWidget(parent), C(C), FilePos(0) {
26
27 if (C->Kind_Get() == Core::Kind_Graph_Svg) {
28 C->Menu_Option_Preferences_Option(__T("Graph_Adm_ShowTrackUIDs"), settings->value("Graph_Adm_ShowTrackUIDs",false).toBool() ? __T("1") : __T("0"));
29 C->Menu_Option_Preferences_Option(__T("Graph_Adm_ShowChannelFormats"), settings->value("Graph_Adm_ShowChannelFormats",false).toBool() ? __T("1") : __T("0"));
30
31 QComboBox *fileChoice = new QComboBox(this);
32 fileChoice->setMinimumContentsLength(1);
33 for (size_t Pos = 0; Pos < C->Count_Get(); ++Pos)
34 fileChoice->addItem(wstring2QString(C->Get(Pos, Stream_General, 0, __T("CompleteName"))));
35 fileChoice->setCurrentIndex(FilePos);
36 connect(fileChoice, SIGNAL(currentIndexChanged(int)), SLOT(changeFilePos(int)));
37
38 webView = new WebViewWidget(this);
39
40 QVBoxLayout *layout = new QVBoxLayout(this);
41 layout->addWidget(fileChoice);
42 layout->addWidget(webView);
43
44 this->setLayout(layout);
45 }
46 else {
47 webView = new WebViewWidget(this);
48 QVBoxLayout *layout = new QVBoxLayout(this);
49 layout->setContentsMargins(0, 0, 0, 0);
50 layout->addWidget(webView);
51 this->setLayout(layout);
52 }
53
54#if defined(EDGE_WEBVIEW2_YES) && (QT_VERSION >= QT_VERSION_CHECK(6, 8, 0))
55 webView->setPreferredColorScheme(qApp->styleHints()->colorScheme());
56#endif
57
58 tempFile.setFileTemplate(tempFile.fileTemplate() + ".html");
59 refresh();
60}
61
62QString HTMLViewWidget::generateGraphHTML() {
63 QString html;

Callers

nothing calls this directly

Calls 5

Kind_GetMethod · 0.80
Count_GetMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected