summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qclipboard.cpp8
-rw-r--r--src/gui/kernel/qevent.cpp3
-rw-r--r--src/gui/kernel/qguiapplication.cpp4
-rw-r--r--src/gui/kernel/qkeysequence.cpp13
-rw-r--r--src/gui/kernel/qopenglcontext.cpp4
-rw-r--r--src/gui/kernel/qplatformintegration.cpp4
-rw-r--r--src/gui/kernel/qplatformscreen.cpp2
-rw-r--r--src/gui/kernel/qwindow.cpp8
-rw-r--r--src/gui/kernel/qwindowsysteminterface.h4
9 files changed, 26 insertions, 24 deletions
diff --git a/src/gui/kernel/qclipboard.cpp b/src/gui/kernel/qclipboard.cpp
index 7932b9a2dc..e9da36a42a 100644
--- a/src/gui/kernel/qclipboard.cpp
+++ b/src/gui/kernel/qclipboard.cpp
@@ -67,7 +67,7 @@ QT_BEGIN_NAMESPACE
Drop}.
There is a single QClipboard object in an application, accessible
- as QApplication::clipboard().
+ as QGuiApplication::clipboard().
Example:
\snippet code/src_gui_kernel_qclipboard.cpp 0
@@ -137,7 +137,7 @@ QT_BEGIN_NAMESPACE
\endlist
- \sa QApplication
+ \sa QGuiApplication
*/
/*!
@@ -147,7 +147,7 @@ QT_BEGIN_NAMESPACE
Do not call this function.
- Call QApplication::clipboard() instead to get a pointer to the
+ Call QGuiApplication::clipboard() instead to get a pointer to the
application's global clipboard object.
There is only one clipboard in the window system, and creating
@@ -165,7 +165,7 @@ QClipboard::QClipboard(QObject *parent)
Destroys the clipboard.
- You should never delete the clipboard. QApplication will do this
+ You should never delete the clipboard. QGuiApplication will do this
when the application terminates.
*/
QClipboard::~QClipboard()
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 305ce5c82e..6adbea6da6 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -3904,6 +3904,9 @@ QDebug operator<<(QDebug dbg, const QEvent *e)
case QEvent::Expose:
dbg << "QExposeEvent(" << static_cast<const QExposeEvent *>(e)->region() << ')';
break;
+ case QEvent::Paint:
+ dbg << "QPaintEvent(" << static_cast<const QPaintEvent *>(e)->region() << ')';
+ break;
case QEvent::MouseButtonPress:
case QEvent::MouseMove:
case QEvent::MouseButtonRelease:
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index d0bfc7ff5f..7afeadcced 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1035,7 +1035,7 @@ QWindow *QGuiApplication::topLevelAt(const QPoint &pos)
// may repeat. Find only when there is more than one virtual desktop.
if (!windowScreen && screens.count() != primaryScreens.count()) {
for (int i = 1; i < screens.size(); ++i) {
- QScreen *screen = screens[i];
+ QScreen *screen = screens.at(i);
if (screen->geometry().contains(pos)) {
windowScreen = screen;
break;
@@ -2641,7 +2641,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
if (b == Qt::NoButton)
self->synthesizedMousePoints.clear();
- QList<QTouchEvent::TouchPoint> touchPoints = touchEvent.touchPoints();
+ const QList<QTouchEvent::TouchPoint> &touchPoints = touchEvent.touchPoints();
if (eventType == QEvent::TouchBegin)
m_fakeMouseSourcePointId = touchPoints.first().id();
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 8ccd85795b..e7b1f9e073 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -1154,21 +1154,22 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
}
int p = accel.lastIndexOf(QLatin1Char('+'), str.length() - 2); // -2 so that Ctrl++ works
+ QStringRef accelRef(&accel);
if(p > 0)
- accel = accel.mid(p + 1);
+ accelRef = accelRef.mid(p + 1);
int fnum = 0;
- if (accel.length() == 1) {
+ if (accelRef.length() == 1) {
#if defined(Q_OS_MACX)
- int qtKey = qtkeyForMacSymbol(accel[0]);
+ int qtKey = qtkeyForMacSymbol(accelRef.at(0));
if (qtKey != -1) {
ret |= qtKey;
} else
#endif
{
- ret |= accel[0].toUpper().unicode();
+ ret |= accelRef.at(0).toUpper().unicode();
}
- } else if (accel[0] == QLatin1Char('f') && (fnum = accel.mid(1).toInt()) && (fnum >= 1) && (fnum <= 35)) {
+ } else if (accelRef.at(0) == QLatin1Char('f') && (fnum = accelRef.mid(1).toInt()) >= 1 && fnum <= 35) {
ret |= Qt::Key_F1 + fnum - 1;
} else {
// For NativeText, check the traslation table first,
@@ -1182,7 +1183,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
QString keyName(tran == 0
? QCoreApplication::translate("QShortcut", keyname[i].name)
: QString::fromLatin1(keyname[i].name));
- if (accel == keyName.toLower()) {
+ if (accelRef == keyName.toLower()) {
ret |= keyname[i].key;
found = true;
break;
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index 19464eeca3..7e5697e5d8 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -1418,7 +1418,7 @@ void QOpenGLContextGroupPrivate::removeContext(QOpenGLContext *ctx)
m_shares.removeOne(ctx);
if (ctx == m_context && !m_shares.isEmpty())
- m_context = m_shares.first();
+ m_context = m_shares.constFirst();
if (!m_refs.deref()) {
cleanup();
@@ -1582,7 +1582,7 @@ QOpenGLMultiGroupSharedResource::~QOpenGLMultiGroupSharedResource()
#endif
for (int i = 0; i < m_groups.size(); ++i) {
if (!m_groups.at(i)->shares().isEmpty()) {
- QOpenGLContext *context = m_groups.at(i)->shares().first();
+ QOpenGLContext *context = m_groups.at(i)->shares().constFirst();
QOpenGLSharedResource *resource = value(context);
if (resource)
resource->free();
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp
index a0e65654a6..3490e786a8 100644
--- a/src/gui/kernel/qplatformintegration.cpp
+++ b/src/gui/kernel/qplatformintegration.cpp
@@ -474,11 +474,11 @@ void QPlatformIntegration::screenAdded(QPlatformScreen *ps, bool isPrimary)
void QPlatformIntegration::removeScreen(QScreen *screen)
{
- const bool wasPrimary = (!QGuiApplicationPrivate::screen_list.isEmpty() && QGuiApplicationPrivate::screen_list[0] == screen);
+ const bool wasPrimary = (!QGuiApplicationPrivate::screen_list.isEmpty() && QGuiApplicationPrivate::screen_list.at(0) == screen);
QGuiApplicationPrivate::screen_list.removeOne(screen);
if (wasPrimary && qGuiApp && !QGuiApplicationPrivate::screen_list.isEmpty())
- emit qGuiApp->primaryScreenChanged(QGuiApplicationPrivate::screen_list[0]);
+ emit qGuiApp->primaryScreenChanged(QGuiApplicationPrivate::screen_list.at(0));
}
/*!
diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp
index 8450c6a083..3c1552c31e 100644
--- a/src/gui/kernel/qplatformscreen.cpp
+++ b/src/gui/kernel/qplatformscreen.cpp
@@ -93,7 +93,7 @@ QPixmap QPlatformScreen::grabWindow(WId window, int x, int y, int width, int hei
*/
QWindow *QPlatformScreen::topLevelAt(const QPoint & pos) const
{
- QWindowList list = QGuiApplication::topLevelWindows();
+ const QWindowList list = QGuiApplication::topLevelWindows();
for (int i = list.size()-1; i >= 0; --i) {
QWindow *w = list[i];
if (w->isVisible() && QHighDpi::toNativePixels(w->geometry(), w).contains(pos))
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 81310ae2a2..fa26fd77a3 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1688,11 +1688,9 @@ void QWindow::destroy()
if (QGuiApplicationPrivate::currentMousePressWindow == this)
QGuiApplicationPrivate::currentMousePressWindow = parent();
- for (int i = 0; i < QGuiApplicationPrivate::tabletDevicePoints.size(); ++i) {
- QGuiApplicationPrivate::TabletPointData &pointData = QGuiApplicationPrivate::tabletDevicePoints[i];
- if (pointData.target == this)
- pointData.target = parent();
- }
+ for (int i = 0; i < QGuiApplicationPrivate::tabletDevicePoints.size(); ++i)
+ if (QGuiApplicationPrivate::tabletDevicePoints.at(i).target == this)
+ QGuiApplicationPrivate::tabletDevicePoints[i].target = parent();
bool wasVisible = isVisible();
d->visibilityOnDestroy = wasVisible && d->platformWindow;
diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h
index cde70a1102..5e42f5ba90 100644
--- a/src/gui/kernel/qwindowsysteminterface.h
+++ b/src/gui/kernel/qwindowsysteminterface.h
@@ -117,7 +117,7 @@ public:
static void handleWheelEvent(QWindow *w, ulong timestamp, const QPointF & local, const QPointF & global, int d, Qt::Orientation o, Qt::KeyboardModifiers mods = Qt::NoModifier);
struct TouchPoint {
- TouchPoint() : id(0), uniqueId(-1), pressure(0), rotation(0), state(Qt::TouchPointStationary), flags(0) { }
+ TouchPoint() : id(0), uniqueId(-1), pressure(0), rotation(0), state(Qt::TouchPointStationary) { }
int id; // for application use
qint64 uniqueId; // for TUIO: object/token ID; otherwise empty
// TODO for TUIO 2.0: add registerPointerUniqueID(QPointerUniqueId)
@@ -142,7 +142,7 @@ public:
// rect is relative to parent
static void handleGeometryChange(QWindow *w, const QRect &newRect, const QRect &oldRect = QRect());
- static void handleCloseEvent(QWindow *w, bool *accepted = 0);
+ static void handleCloseEvent(QWindow *w, bool *accepted = Q_NULLPTR);
static void handleEnterEvent(QWindow *w, const QPointF &local = QPointF(), const QPointF& global = QPointF());
static void handleLeaveEvent(QWindow *w);
static void handleEnterLeaveEvent(QWindow *enter, QWindow *leave, const QPointF &local = QPointF(), const QPointF& global = QPointF());