summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qguiapplication.cpp2
-rw-r--r--src/gui/kernel/qhighdpiscaling_p.h4
-rw-r--r--src/gui/kernel/qkeysequence.cpp6
-rw-r--r--src/gui/kernel/qplatformwindow.cpp3
-rw-r--r--src/gui/kernel/qscreen.cpp4
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp4
6 files changed, 12 insertions, 11 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 46518e4701..632fe874a6 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1008,7 +1008,7 @@ QWindow *QGuiApplication::topLevelAt(const QPoint &pos)
QScreen *windowScreen = Q_NULLPTR;
// Find the window on the primary virtual desktop first
- foreach (QScreen *screen, primaryScreens) {
+ for (QScreen *screen : primaryScreens) {
if (screen->geometry().contains(pos)) {
windowScreen = screen;
break;
diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h
index 8540460a54..50fb4d73ea 100644
--- a/src/gui/kernel/qhighdpiscaling_p.h
+++ b/src/gui/kernel/qhighdpiscaling_p.h
@@ -454,7 +454,7 @@ QVector<T> fromNativePixels(const QVector<T> &pixelValues, const QWindow *window
return pixelValues;
QVector<T> pointValues;
- foreach (const T& pixelValue, pixelValues)
+ for (const T &pixelValue : pixelValues)
pointValues.append(pixelValue / QHighDpiScaling::factor(window));
return pointValues;
}
@@ -467,7 +467,7 @@ QVector<T> toNativePixels(const QVector<T> &pointValues, const QWindow *window)
return pointValues;
QVector<T> pixelValues;
- foreach (const T& pointValue, pointValues)
+ for (const T &pointValue : pointValues)
pixelValues.append(pointValue * QHighDpiScaling::factor(window));
return pixelValues;
}
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index c23dbbb3be..8a6eeb4cc9 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -1565,9 +1565,9 @@ QList<QKeySequence> QKeySequence::listFromString(const QString &str, SequenceFor
{
QList<QKeySequence> result;
- QStringList strings = str.split(QLatin1String("; "));
+ const QStringList strings = str.split(QLatin1String("; "));
result.reserve(strings.count());
- foreach (const QString &string, strings) {
+ for (const QString &string : strings) {
result << fromString(string, format);
}
@@ -1586,7 +1586,7 @@ QString QKeySequence::listToString(const QList<QKeySequence> &list, SequenceForm
{
QString result;
- foreach (const QKeySequence &sequence, list) {
+ for (const QKeySequence &sequence : list) {
result += sequence.toString(format);
result += QLatin1String("; ");
}
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index f5ddaa4bb7..abbd1fe999 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -554,9 +554,10 @@ static inline const QScreen *effectiveScreen(const QWindow *window)
#ifndef QT_NO_CURSOR
if (siblings.size() > 1) {
const QPoint referencePoint = window->transientParent() ? window->transientParent()->geometry().center() : QCursor::pos();
- foreach (const QScreen *sibling, siblings)
+ for (const QScreen *sibling : siblings) {
if (sibling->geometry().contains(referencePoint))
return sibling;
+ }
}
#endif
return screen;
diff --git a/src/gui/kernel/qscreen.cpp b/src/gui/kernel/qscreen.cpp
index ae6879cf84..0e17b2d803 100644
--- a/src/gui/kernel/qscreen.cpp
+++ b/src/gui/kernel/qscreen.cpp
@@ -364,10 +364,10 @@ QRect QScreen::availableGeometry() const
QList<QScreen *> QScreen::virtualSiblings() const
{
Q_D(const QScreen);
- QList<QPlatformScreen *> platformScreens = d->platformScreen->virtualSiblings();
+ const QList<QPlatformScreen *> platformScreens = d->platformScreen->virtualSiblings();
QList<QScreen *> screens;
screens.reserve(platformScreens.count());
- foreach (QPlatformScreen *platformScreen, platformScreens)
+ for (QPlatformScreen *platformScreen : platformScreens)
screens << platformScreen->screen();
return screens;
}
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index d17c9c08a8..2489974bb3 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -504,7 +504,7 @@ QList<QWindowSystemInterface::TouchPoint>
{
QList<QWindowSystemInterface::TouchPoint> newList;
newList.reserve(pointList.size());
- foreach (const QTouchEvent::TouchPoint &pt, pointList) {
+ for (const QTouchEvent::TouchPoint &pt : pointList) {
QWindowSystemInterface::TouchPoint p;
p.id = pt.id();
p.flags = pt.flags();
@@ -928,7 +928,7 @@ static QList<struct QWindowSystemInterface::TouchPoint> touchPointList(const QLi
{
QList<struct QWindowSystemInterface::TouchPoint> newList;
- Q_FOREACH (QTouchEvent::TouchPoint p, pointList)
+ for (const QTouchEvent::TouchPoint &p : pointList)
newList.append(touchPoint(p));
return newList;