Changeset View
Changeset View
Standalone View
Standalone View
src/kpassivepopup.cpp
Show First 20 Lines • Show All 229 Lines • ▼ Show 20 Line(s) | 229 | if (x < r.left()) { | |||
---|---|---|---|---|---|
230 | x = r.left(); | 230 | x = r.left(); | ||
231 | } | 231 | } | ||
232 | 232 | | |||
233 | return QPoint(x, y); | 233 | return QPoint(x, y); | ||
234 | } | 234 | } | ||
235 | 235 | | |||
236 | QRect desktopRectForPoint(const QPoint &point) | 236 | QRect desktopRectForPoint(const QPoint &point) | ||
237 | { | 237 | { | ||
238 | QList<QScreen*> screens = QGuiApplication::screens(); | 238 | const QList<QScreen*> screens = QGuiApplication::screens(); | ||
239 | Q_FOREACH(const QScreen *screen, screens) { | 239 | for(const QScreen *screen : screens) { | ||
240 | if (screen->geometry().contains(point)) { | 240 | if (screen->geometry().contains(point)) { | ||
241 | return screen->geometry(); | 241 | return screen->geometry(); | ||
242 | } | 242 | } | ||
243 | } | 243 | } | ||
244 | 244 | | |||
245 | // If no screen was found, return the primary screen's geometry | 245 | // If no screen was found, return the primary screen's geometry | ||
246 | return QGuiApplication::primaryScreen()->geometry(); | 246 | return QGuiApplication::primaryScreen()->geometry(); | ||
247 | } | 247 | } | ||
▲ Show 20 Lines • Show All 391 Lines • Show Last 20 Lines |