MCPcopy Create free account
hub / github.com/Linloir/GraphBuilder / Init

Method Init

mainwindow.cpp:22–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22void MainWindow::Init(){
23 /* Create main widget and set mask, style sheet and shadow */
24 QPainterPath path;
25 path.addRoundedRect(ui->mainWidget->rect(), cornerRadius - 1, cornerRadius - 1);
26 QRegion mask(path.toFillPolygon().toPolygon());
27 ui->mainWidget->setMask(mask);
28
29 QString mainStyle;
30 ui->mainWidget->setObjectName("mainWidget");
31 mainStyle = "QWidget#mainWidget{background-color:" + mainBackGround.name() + QString::asprintf(";border-radius:%dpx", cornerRadius) + "}";
32 ui->mainWidget->setStyleSheet(mainStyle);
33
34 windowShadow = new QGraphicsDropShadowEffect(this);
35 windowShadow->setBlurRadius(30);
36 windowShadow->setColor(QColor(0, 0, 0));
37 windowShadow->setOffset(0, 0);
38 ui->mainWidget->setGraphicsEffect(windowShadow);
39 /**********************************************************/
40
41 /* Create border in order to cover the zigzag edge of the region */
42 border = new QWidget(this);
43 border->move(ui->mainWidget->pos() - QPoint(1, 1));
44 border->resize(ui->mainWidget->size() + QSize(2, 2));
45 QString borderStyle;
46 borderStyle = "background-color:#00FFFFFF;border:1.5px solid #686868; border-radius:" + QString::asprintf("%d",cornerRadius) + "px";
47 border->setStyleSheet(borderStyle);
48 border->setAttribute(Qt::WA_TransparentForMouseEvents);
49 border->show();
50 /*****************************************************************/
51
52 /* Create about page */
53 defaultSettingsPage = new SlidePage(cornerRadius, "ABOUT", ui->mainWidget);
54 textInputItem *version = new textInputItem("version", defaultSettingsPage);
55 version->setValue("1.3-beta");
56 version->setEnabled(false);
57 textInputItem *updateDate = new textInputItem("last-upd", defaultSettingsPage);
58 updateDate->setValue("2021/12/6 10:14");
59 updateDate->setEnabled(false);
60 textInputItem *Author = new textInputItem("author", defaultSettingsPage);
61 Author->setValue("Linloir | Made with love");
62 Author->setEnabled(false);
63 textInputItem *lic = new textInputItem("lic", defaultSettingsPage);
64 lic->setValue("MIT License");
65 lic->setEnabled(false);
66 textInputItem *GitHub = new textInputItem("git", defaultSettingsPage);
67 GitHub->setValue("github.com/Linloir");
68 GitHub->setEnabled(false);
69 defaultSettingsPage->AddContent(GitHub);
70 defaultSettingsPage->AddContent(lic);
71 defaultSettingsPage->AddContent(Author);
72 defaultSettingsPage->AddContent(updateDate);
73 defaultSettingsPage->AddContent(version);
74 curSettingsPage = defaultSettingsPage;
75 defaultSettingsPage->show();
76 pageList.push_back(defaultSettingsPage);
77
78 /************************/
79

Callers

nothing calls this directly

Calls 15

nameMethod · 0.80
moveMethod · 0.80
setValueMethod · 0.80
AddContentMethod · 0.80
slideInMethod · 0.80
addWidgetMethod · 0.80
setScaleMethod · 0.80
descriptionMethod · 0.80
AddItemMethod · 0.80
SetSelectionMethod · 0.80
settingPageMethod · 0.80
setTitleMethod · 0.80

Tested by

no test coverage detected