MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / event

Method event

lib/macro/macro-tree.cpp:92–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92bool MacroTreeItem::event(QEvent *event)
93{
94 if (event->type() != QEvent::ToolTip) {
95 return QFrame::event(event);
96 }
97
98 if (_macro->IsGroup()) {
99 return true;
100 }
101
102 QString text;
103 if (!_macro->WasExecutedSince({})) {
104 text = obs_module_text(
105 "AdvSceneSwitcher.macroTab.macroNotYetExecutedTooltip");
106 } else {
107 const QString formatStr = obs_module_text(
108 "AdvSceneSwitcher.macroTab.macroLastExecutedTooltip");
109 const auto secondsSinceLastRun =
110 std::chrono::duration_cast<std::chrono::seconds>(
111 std::chrono::high_resolution_clock::now() -
112 _macro->GetLastExecutionTime());
113 text = formatStr.arg(secondsSinceLastRun.count());
114 }
115
116 auto helpEvent = static_cast<QHelpEvent *>(event);
117 QToolTip::showText(helpEvent->globalPos(), text, this);
118 return true;
119}
120
121void MacroTreeItem::EnableHighlight(bool enable)
122{

Callers

nothing calls this directly

Calls 7

obs_module_textFunction · 0.85
nowClass · 0.85
IsGroupMethod · 0.80
WasExecutedSinceMethod · 0.80
GetLastExecutionTimeMethod · 0.80
countMethod · 0.80
typeMethod · 0.45

Tested by

no test coverage detected