Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwineffectquickview.cpp
Show First 20 Lines • Show All 195 Lines • ▼ Show 20 Line(s) | 152 | { | |||
---|---|---|---|---|---|
196 | emit repaintNeeded(); | 196 | emit repaintNeeded(); | ||
197 | } | 197 | } | ||
198 | 198 | | |||
199 | void EffectQuickView::forwardMouseEvent(QEvent *e) | 199 | void EffectQuickView::forwardMouseEvent(QEvent *e) | ||
200 | { | 200 | { | ||
201 | if (!d->m_visible) { | 201 | if (!d->m_visible) { | ||
202 | return; | 202 | return; | ||
203 | } | 203 | } | ||
204 | switch (e->type()) { | ||||
205 | case QEvent::MouseMove: | ||||
206 | Q_FALLTHROUGH(); | ||||
zzag: Why did you put `Q_FALLTHOURGH` here? No compiler will complain about implicit fallthough in… | |||||
No specific reason. No compiler will complain about its presence either. davidedmundson: No specific reason. No compiler will complain about its presence either.
It's the same thing. | |||||
Okay, I see. Could you please drop these Q_FALLTHOUGH macros? There are a couple of reasons to do that: (a) Putting Q_FALLTHOUGH or [[fallthrough]] in empty case blocks is uncommon zzag: Okay, I see. Could you please drop these `Q_FALLTHOUGH` macros? There are a couple of reasons… | |||||
207 | case QEvent::MouseButtonPress: | ||||
208 | Q_FALLTHROUGH(); | ||||
209 | case QEvent::MouseButtonRelease: | ||||
210 | Q_FALLTHROUGH(); | ||||
211 | case QEvent::MouseButtonDblClick: | ||||
212 | { | ||||
204 | QMouseEvent *me = static_cast<QMouseEvent *>(e); | 213 | QMouseEvent *me = static_cast<QMouseEvent *>(e); | ||
205 | const QPoint widgetPos = d->m_view->mapFromGlobal(me->pos()); | 214 | const QPoint widgetPos = d->m_view->mapFromGlobal(me->pos()); | ||
206 | | ||||
207 | QMouseEvent cloneEvent(me->type(), widgetPos, me->pos(), me->button(), me->buttons(), me->modifiers()); | 215 | QMouseEvent cloneEvent(me->type(), widgetPos, me->pos(), me->button(), me->buttons(), me->modifiers()); | ||
208 | QCoreApplication::sendEvent(d->m_view, &cloneEvent); | 216 | QCoreApplication::sendEvent(d->m_view, &cloneEvent); | ||
209 | e->setAccepted(cloneEvent.isAccepted()); | 217 | e->setAccepted(cloneEvent.isAccepted()); | ||
218 | return; | ||||
219 | } | ||||
220 | case QEvent::HoverEnter: | ||||
221 | Q_FALLTHROUGH(); | ||||
222 | case QEvent::HoverLeave: | ||||
223 | Q_FALLTHROUGH(); | ||||
224 | case QEvent::HoverMove: | ||||
225 | { | ||||
226 | QHoverEvent *he = static_cast<QHoverEvent *>(e); | ||||
227 | const QPointF widgetPos = d->m_view->mapFromGlobal(he->pos()); | ||||
228 | const QPointF oldWidgetPos = d->m_view->mapFromGlobal(he->oldPos()); | ||||
229 | QHoverEvent cloneEvent(he->type(), widgetPos, oldWidgetPos, he->modifiers()); | ||||
230 | QCoreApplication::sendEvent(d->m_view, &cloneEvent); | ||||
231 | e->setAccepted(cloneEvent.isAccepted()); | ||||
232 | return; | ||||
233 | } | ||||
234 | default: | ||||
235 | return; | ||||
236 | } | ||||
210 | } | 237 | } | ||
211 | 238 | | |||
212 | void EffectQuickView::forwardKeyEvent(QKeyEvent *keyEvent) | 239 | void EffectQuickView::forwardKeyEvent(QKeyEvent *keyEvent) | ||
213 | { | 240 | { | ||
214 | if (!d->m_visible) { | 241 | if (!d->m_visible) { | ||
215 | return; | 242 | return; | ||
216 | } | 243 | } | ||
217 | QCoreApplication::sendEvent(d->m_view, keyEvent); | 244 | QCoreApplication::sendEvent(d->m_view, keyEvent); | ||
▲ Show 20 Lines • Show All 140 Lines • Show Last 20 Lines |
Why did you put Q_FALLTHOURGH here? No compiler will complain about implicit fallthough in this case.