MCPcopy Create free account
hub / github.com/analogdevicesinc/scopy / next

Method next

gui/src/tutorialoverlay.cpp:81–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void TutorialOverlay::next()
82{
83 cleanupChapter();
84
85 if(cnt == chapter.count()) {
86 // stop story
87 finish();
88 return;
89 }
90 if(cnt > 0)
91 Q_EMIT chapter[cnt - 1]->chapterFinished();
92
93 Q_EMIT chapter[cnt]->chapterStarted();
94
95 initPopupWidget();
96 m_popupWidget->setDescription(chapter[cnt]->description);
97 overlay->raise();
98 overlay->clearHoles();
99
100 QList<QWidget *> subjects = chapter[cnt]->subjects;
101 if(!subjects.isEmpty()) {
102 overlay->setHoles(subjects);
103
104 m_hoverWidget = new HoverWidget(m_popupWidget, chapter[cnt]->mainSubject, qApp->activeWindow());
105 m_hoverWidget->setContentPos(chapter[cnt]->content);
106 m_hoverWidget->setAnchorPos(chapter[cnt]->anchor);
107 m_hoverWidget->setAnchorOffset(QPoint(chapter[cnt]->x_offset, chapter[cnt]->y_offset));
108
109 m_hoverWidget->raise();
110 m_hoverWidget->setVisible(true);
111 for(QWidget *subj : qAsConst(subjects)) {
112 subj->raise();
113 m_popupWidget->setFocusOnContinueButton();
114 auto *highlight = new TintedOverlay(subj, QColor(255, 255, 255, 35));
115 highlight->raise();
116 highlight->show();
117 highlights.append(highlight);
118 }
119 }
120
121 QString storyTitle = title + " " + QString::number(cnt + 1) + "/" + QString::number(chapter.count());
122 m_popupWidget->setTitle(storyTitle);
123
124 raise();
125 show();
126 m_popupWidget->raise();
127
128 cnt++;
129 if(cnt == chapter.count())
130 m_popupWidget->getContinueBtn()->setText("Finish");
131}
132
133void TutorialOverlay::finish()
134{

Callers 5

removeDisabledPluginsMethod · 0.45
getUsbFdMethod · 0.45
createSnapshotChannelMethod · 0.45
getQssListMethod · 0.45

Calls 15

QPointClass · 0.85
QColorClass · 0.85
clearHolesMethod · 0.80
setHolesMethod · 0.80
setContentPosMethod · 0.80
setAnchorPosMethod · 0.80
setAnchorOffsetMethod · 0.80
appendMethod · 0.80
countMethod · 0.45
setDescriptionMethod · 0.45
raiseMethod · 0.45

Tested by

no test coverage detected