MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / showAnimated

Method showAnimated

pj_widgets/src/ToastNotification.cpp:86–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void ToastNotification::showAnimated() {
87 // The target is the position ToastManager already move()d us to.
88 const QPoint end_pos = pos();
89
90 QPoint start_pos = end_pos;
91 start_pos.setX(end_pos.x() + width() + 50);
92
93 move(start_pos);
94 show();
95
96 slide_animation_->setStartValue(start_pos);
97 slide_animation_->setEndValue(end_pos);
98 slide_animation_->start();
99
100 // Only start the auto-dismiss countdown once the entrance finishes.
101 if (timeout_timer_ && timeout_ms_ > 0) {
102 QTimer::singleShot(kAnimationDurationMs, this, [this]() {
103 if (timeout_timer_ && !is_closing_) {
104 timeout_timer_->start(timeout_ms_);
105 }
106 });
107 }
108}
109
110void ToastNotification::hideAnimated() {
111 if (is_closing_) {

Callers 1

showToastMethod · 0.80

Calls 3

setXMethod · 0.80
xMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected