summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/doc/snippets/code/src_gui_kernel_qapplication.cpp69
-rw-r--r--src/gui/doc/snippets/code/src_gui_kernel_qguiapplication.cpp102
-rw-r--r--src/gui/doc/snippets/code/src_gui_kernel_qguiapplication_x11.cpp (renamed from src/gui/doc/snippets/code/src_gui_kernel_qapplication_x11.cpp)0
-rw-r--r--src/gui/image/qicon.cpp8
-rw-r--r--src/gui/image/qimage.cpp17
-rw-r--r--src/gui/image/qpicture.cpp8
-rw-r--r--src/gui/image/qpixmap.cpp8
-rw-r--r--src/gui/kernel/qcursor.cpp8
-rw-r--r--src/gui/kernel/qguiapplication.cpp30
-rw-r--r--src/gui/kernel/qguiapplication_p.h3
-rw-r--r--src/gui/kernel/qkeysequence.cpp8
-rw-r--r--src/gui/kernel/qpalette.cpp8
-rw-r--r--src/gui/kernel/qplatformintegration.cpp22
-rw-r--r--src/gui/kernel/qplatformintegration.h2
-rw-r--r--src/gui/kernel/qsessionmanager.cpp50
-rw-r--r--src/gui/kernel/qstylehints.cpp2
-rw-r--r--src/gui/opengl/qopenglpixeltransferoptions.h2
-rw-r--r--src/gui/opengl/qopengltexture.cpp2
-rw-r--r--src/gui/painting/qbrush.cpp7
-rw-r--r--src/gui/painting/qpainterpath.cpp8
-rw-r--r--src/gui/painting/qpen.cpp8
-rw-r--r--src/gui/painting/qregion.cpp8
-rw-r--r--src/gui/text/qfont.cpp8
-rw-r--r--src/gui/text/qfontmetrics.cpp8
-rw-r--r--src/gui/text/qtextoption.cpp3
-rw-r--r--src/gui/text/qtextoption.h3
26 files changed, 283 insertions, 119 deletions
diff --git a/src/gui/doc/snippets/code/src_gui_kernel_qapplication.cpp b/src/gui/doc/snippets/code/src_gui_kernel_qapplication.cpp
index f30f88ccb7..b79a30f37b 100644
--- a/src/gui/doc/snippets/code/src_gui_kernel_qapplication.cpp
+++ b/src/gui/doc/snippets/code/src_gui_kernel_qapplication.cpp
@@ -107,79 +107,20 @@ void updateAllWidgets()
//! [6]
-int main(int argc, char *argv[])
-{
- QApplication::setDesktopSettingsAware(false);
- QApplication app(argc, argv);
- ...
- return app.exec();
-}
-//! [6]
-
-
-//! [7]
if ((startPos - currentPos).manhattanLength() >=
QApplication::startDragDistance())
startTheDrag();
-//! [7]
-
-
-//! [8]
-void MyApplication::commitData(QSessionManager& manager)
-{
- if (manager.allowsInteraction()) {
- int ret = QMessageBox::warning(
- mainWindow,
- tr("My Application"),
- tr("Save changes to document?"),
- QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
-
- switch (ret) {
- case QMessageBox::Save:
- manager.release();
- if (!saveDocument())
- manager.cancel();
- break;
- case QMessageBox::Discard:
- break;
- case QMessageBox::Cancel:
- default:
- manager.cancel();
- }
- } else {
- // we did not get permission to interact, then
- // do something reasonable instead
- }
-}
-//! [8]
-
-
-//! [9]
-appname -session id
-//! [9]
-
-
-//! [10]
-foreach (const QString &command, mySession.restartCommand())
- do_something(command);
-//! [10]
-
-
-//! [11]
-foreach (const QString &command, mySession.discardCommand())
- do_something(command);
-//! [11]
-
+//! [6]
-//! [12]
+//! [7]
QWidget *widget = qApp->widgetAt(x, y);
if (widget)
widget = widget->window();
-//! [12]
+//! [7]
-//! [13]
+//! [8]
QWidget *widget = qApp->widgetAt(point);
if (widget)
widget = widget->window();
-//! [13]
+//! [8]
diff --git a/src/gui/doc/snippets/code/src_gui_kernel_qguiapplication.cpp b/src/gui/doc/snippets/code/src_gui_kernel_qguiapplication.cpp
new file mode 100644
index 0000000000..914748b7dd
--- /dev/null
+++ b/src/gui/doc/snippets/code/src_gui_kernel_qguiapplication.cpp
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [0]
+int main(int argc, char *argv[])
+{
+ QApplication::setDesktopSettingsAware(false);
+ QApplication app(argc, argv);
+ ...
+ return app.exec();
+}
+//! [0]
+
+
+//! [1]
+MyMainWidget::MyMainWidget(QWidget *parent)
+ :QWidget(parent)
+{
+ connect(qApp, SIGNAL(commitDataRequest(QSessionManager)), SLOT(commitData(QSessionManager)));
+}
+
+void MyMainWidget::commitData(QSessionManager& manager)
+{
+ if (manager.allowsInteraction()) {
+ int ret = QMessageBox::warning(
+ mainWindow,
+ tr("My Application"),
+ tr("Save changes to document?"),
+ QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
+
+ switch (ret) {
+ case QMessageBox::Save:
+ manager.release();
+ if (!saveDocument())
+ manager.cancel();
+ break;
+ case QMessageBox::Discard:
+ break;
+ case QMessageBox::Cancel:
+ default:
+ manager.cancel();
+ }
+ } else {
+ // we did not get permission to interact, then
+ // do something reasonable instead
+ }
+}
+//! [1]
+
+
+//! [2]
+appname -session id
+//! [2]
+
+
+//! [3]
+foreach (const QString &command, mySession.restartCommand())
+ do_something(command);
+//! [3]
+
+
+//! [4]
+foreach (const QString &command, mySession.discardCommand())
+ do_something(command);
+//! [4]
diff --git a/src/gui/doc/snippets/code/src_gui_kernel_qapplication_x11.cpp b/src/gui/doc/snippets/code/src_gui_kernel_qguiapplication_x11.cpp
index b136c2ad51..b136c2ad51 100644
--- a/src/gui/doc/snippets/code/src_gui_kernel_qapplication_x11.cpp
+++ b/src/gui/doc/snippets/code/src_gui_kernel_qguiapplication_x11.cpp
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index cb508ae6c7..5a37a8fecf 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -644,6 +644,14 @@ QIcon &QIcon::operator=(const QIcon &other)
}
/*!
+ \fn QIcon &QIcon::operator=(QIcon &&other)
+
+ Move-assigns \a other to this QIcon instance.
+
+ \since 5.2
+*/
+
+/*!
\fn void QIcon::swap(QIcon &other)
\since 4.8
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 3d6315a7fe..28af8adf9c 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -602,6 +602,23 @@ bool QImageData::checkForAlphaPixels() const
*/
/*!
+ \fn QImage::QImage(QImage &&other)
+
+ Move-constructs a QImage instance, making it point at the same
+ object that \a other was pointing to.
+
+ \since 5.2
+*/
+
+/*!
+ \fn QImage &operator=(QImage &&other)
+
+ Move-assigns \a other to this QImage instance.
+
+ \since 5.2
+*/
+
+/*!
\typedef QImageCleanupFunction
\relates QImage
\since 5.0
diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp
index be7a1e8001..e11d3bb019 100644
--- a/src/gui/image/qpicture.cpp
+++ b/src/gui/image/qpicture.cpp
@@ -109,6 +109,14 @@ void qt_format_text(const QFont &fnt, const QRectF &_r,
\sa QMovie
*/
+/*!
+ \fn QPicture &QPicture::operator=(QPicture &&other)
+
+ Move-assigns \a other to this QPicture instance.
+
+ \since 5.2
+*/
+
const char *qt_mfhdr_tag = "QPIC"; // header tag
static const quint16 mfhdr_maj = 11; // major version #
static const quint16 mfhdr_min = 0; // minor version #
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index f98ca04f4d..bb48a4b3a5 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -392,6 +392,14 @@ QPixmap &QPixmap::operator=(const QPixmap &pixmap)
}
/*!
+ \fn QPixmap &QPixmap::operator=(QPixmap &&other)
+
+ Move-assigns \a other to this QPixmap instance.
+
+ \since 5.2
+*/
+
+/*!
\fn void QPixmap::swap(QPixmap &other)
\since 4.8
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp
index d6287aef5c..a33b264704 100644
--- a/src/gui/kernel/qcursor.cpp
+++ b/src/gui/kernel/qcursor.cpp
@@ -154,6 +154,14 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \fn QCursor &QCursor::operator=(QCursor &&other)
+
+ Move-assigns \a other to this QCursor instance.
+
+ \since 5.2
+*/
+
+/*!
\fn QPoint QCursor::pos(const QScreen *screen)
Returns the position of the cursor (hot spot) of the \a screen
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index 07ee8e9a64..eeeb5aaf90 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1029,27 +1029,23 @@ void QGuiApplicationPrivate::createPlatformIntegration()
}
+/*!
+ Called from QCoreApplication::init()
+
+ Responsible for creating an event dispatcher when QCoreApplication
+ decides that it needs one (because a custom one has not been set).
+*/
void QGuiApplicationPrivate::createEventDispatcher()
{
+ Q_ASSERT(!eventDispatcher);
+
if (platform_integration == 0)
createPlatformIntegration();
- if (!eventDispatcher) {
- QAbstractEventDispatcher *eventDispatcher = platform_integration->guiThreadEventDispatcher();
- setEventDispatcher(eventDispatcher);
- }
-}
-
-void QGuiApplicationPrivate::setEventDispatcher(QAbstractEventDispatcher *eventDispatcher)
-{
- Q_Q(QGuiApplication);
-
- if (!QCoreApplicationPrivate::eventDispatcher) {
- QCoreApplicationPrivate::eventDispatcher = eventDispatcher;
- QCoreApplicationPrivate::eventDispatcher->setParent(q);
- threadData->eventDispatcher = eventDispatcher;
- }
+ // The platform integration should not mess with the event dispatcher
+ Q_ASSERT(!eventDispatcher);
+ eventDispatcher = platform_integration->createEventDispatcher();
}
#if defined(QT_DEBUG) && defined(Q_OS_LINUX)
@@ -2942,7 +2938,7 @@ static inline void applyWindowCursor(const QList<QWindow *> &l)
restoreOverrideCursor(), otherwise the stack will never be emptied.
Example:
- \snippet code/src_gui_kernel_qapplication_x11.cpp 0
+ \snippet code/src_gui_kernel_qguiapplication_x11.cpp 0
\sa overrideCursor(), restoreOverrideCursor(), changeOverrideCursor(),
QWidget::setCursor()
@@ -3002,7 +2998,7 @@ QStyleHints *QGuiApplication::styleHints()
This function must be called before creating the QGuiApplication object, like
this:
- \snippet code/src_gui_kernel_qapplication.cpp 6
+ \snippet code/src_gui_kernel_qguiapplication.cpp 0
\sa desktopSettingsAware()
*/
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index b1d20c9ead..d49ebbab64 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -83,8 +83,7 @@ public:
~QGuiApplicationPrivate();
void createPlatformIntegration();
- void createEventDispatcher();
- void setEventDispatcher(QAbstractEventDispatcher *eventDispatcher);
+ void createEventDispatcher() Q_DECL_OVERRIDE;
virtual void notifyLayoutDirectionChange();
virtual void notifyActiveWindowChange(QWindow *previous);
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 16324b3659..1fcf1026d2 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -733,6 +733,14 @@ static const struct {
*/
/*!
+ \fn QKeySequence &QKeySequence::operator=(QKeySequence &&other)
+
+ Move-assigns \a other to this QKeySequence instance.
+
+ \since 5.2
+*/
+
+/*!
\since 4.2
Constructs a QKeySequence object for the given \a key.
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index b266d31c5c..00ab74e4e4 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -90,6 +90,14 @@ static void qt_palette_from_color(QPalette &pal, const QColor &button)
}
/*!
+ \fn QPalette &QPalette::operator=(QPalette &&other)
+
+ Move-assigns \a other to this QPalette instance.
+
+ \since 5.2
+*/
+
+/*!
\fn const QColor &QPalette::color(ColorRole role) const
\overload
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp
index dc775bcb61..3f93856349 100644
--- a/src/gui/kernel/qplatformintegration.cpp
+++ b/src/gui/kernel/qplatformintegration.cpp
@@ -231,17 +231,23 @@ QPlatformServices *QPlatformIntegration::services() const
are never repositioned by the window manager. The default implementation returns true.
*/
-
/*!
- \fn QAbstractEventDispatcher *QPlatformIntegration::guiThreadEventDispatcher() const = 0
+ \fn QAbstractEventDispatcher *QPlatformIntegration::createEventDispatcher() const = 0
+
+ Factory function for the GUI event dispatcher. The platform plugin should create
+ and return a QAbstractEventDispatcher subclass when this function is called.
+
+ If the platform plugin for some reason creates the event dispatcher outside of
+ this function (for example in the constructor), it needs to handle the case
+ where this function is never called, ensuring that the event dispatcher is
+ still deleted at some point (typically in the destructor).
+
+ Note that the platform plugin should never explicitly set the event dispatcher
+ itself, using QCoreApplication::setEventDispatcher(), but let QCoreApplication
+ decide when and which event dispatcher to create.
- Accessor function for the event dispatcher. The platform plugin should create
- an instance of the QAbstractEventDispatcher in its constructor and set it
- on the application using QGuiApplicationPrivate::instance()->setEventDispatcher().
- The event dispatcher is owned by QGuiApplication, the accessor should return
- a flat pointer.
- \sa QGuiApplicationPrivate
+ \since 5.2
*/
bool QPlatformIntegration::hasCapability(Capability cap) const
diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h
index 0204181ca6..0af74370b5 100644
--- a/src/gui/kernel/qplatformintegration.h
+++ b/src/gui/kernel/qplatformintegration.h
@@ -111,7 +111,7 @@ public:
virtual QPaintEngine *createImagePaintEngine(QPaintDevice *paintDevice) const;
// Event dispatcher:
- virtual QAbstractEventDispatcher *guiThreadEventDispatcher() const = 0;
+ virtual QAbstractEventDispatcher *createEventDispatcher() const = 0;
//Deeper window system integrations
virtual QPlatformFontDatabase *fontDatabase() const;
diff --git a/src/gui/kernel/qsessionmanager.cpp b/src/gui/kernel/qsessionmanager.cpp
index 8cc8d3d961..c46dd5f55a 100644
--- a/src/gui/kernel/qsessionmanager.cpp
+++ b/src/gui/kernel/qsessionmanager.cpp
@@ -74,10 +74,11 @@ QT_BEGIN_NAMESPACE
QSessionManager provides an interface between the application and the
session manager so that the program can work well with the session manager.
In Qt, session management requests for action are handled by the two
- virtual functions QApplication::commitData() and QApplication::saveState().
- Both provide a reference to a session manager object as argument, to allow
- the application to communicate with the session manager. The session
- manager can only be accessed through these functions.
+ signals QGuiApplication::commitDataRequest() and
+ QGuiApplication::saveStateRequest(). Both provide a reference to a session
+ manager object as argument, to allow the application to communicate with
+ the session manager. The session manager can only be accessed through these
+ functions.
No user interaction is possible \e unless the application gets explicit
permission from the session manager. You ask for permission by calling
@@ -94,7 +95,7 @@ QT_BEGIN_NAMESPACE
setRestartHint(), setProperty(), requestPhase2(). See the respective
function descriptions for further details.
- \sa QApplication, {Session Management}
+ \sa QGuiApplication, {Session Management}
*/
@@ -151,7 +152,7 @@ QSessionManager::~QSessionManager()
If the application has been restored from an earlier session, this
identifier is the same as it was in the earlier session.
- \sa sessionKey(), QApplication::sessionId()
+ \sa sessionKey(), QGuiApplication::sessionId()
*/
QString QSessionManager::sessionId() const
{
@@ -169,7 +170,7 @@ QString QSessionManager::sessionId() const
The session key changes with every call of commitData() or saveState().
- \sa sessionId(), QApplication::sessionKey()
+ \sa sessionId(), QGuiApplication::sessionKey()
*/
QString QSessionManager::sessionKey() const
{
@@ -197,15 +198,15 @@ QString QSessionManager::sessionKey() const
phase, you must tell the session manager that this has happened by calling
cancel().
- Here's an example of how an application's QApplication::commitData() might
- be implemented:
+ Here's an example of how an application's QGuiApplication::commitDataRequest()
+ might be implemented:
- \snippet code/src_gui_kernel_qapplication.cpp 8
+ \snippet code/src_gui_kernel_qguiapplication.cpp 8
If an error occurred within the application while saving its data, you may
want to try allowsErrorInteraction() instead.
- \sa QApplication::commitData(), release(), cancel()
+ \sa QGuiApplication::commitDataRequest(), release(), cancel()
*/
bool QSessionManager::allowsInteraction()
{
@@ -261,8 +262,9 @@ void QSessionManager::cancel()
\note These flags are only hints, a session manager may or may not respect
them.
- We recommend setting the restart hint in QApplication::saveState() because
- most session managers perform a checkpoint shortly after an application's
+ We recommend setting the restart hint in QGuiApplication::saveStateRequest()
+ because most session managers perform a checkpoint shortly after an
+ application's
startup.
\sa restartHint()
@@ -291,12 +293,13 @@ QSessionManager::RestartHint QSessionManager::restartHint() const
If the session manager is capable of restoring sessions it will execute
\a command in order to restore the application. The command defaults to
- \snippet code/src_gui_kernel_qapplication.cpp 9
+ \snippet code/src_gui_kernel_qguiapplication.cpp 9
- The \c -session option is mandatory; otherwise QApplication cannot tell
- whether it has been restored or what the current session identifier is.
- See QApplication::isSessionRestored() and QApplication::sessionId() for
- details.
+ The \c -session option is mandatory; otherwise QGuiApplication cannot
+ tell whether it has been restored or what the current session identifier
+ is.
+ See QGuiApplication::isSessionRestored() and
+ QGuiApplication::sessionId() for details.
If your application is very simple, it may be possible to store the entire
application state in additional command line options. This is usually a
@@ -318,7 +321,7 @@ void QSessionManager::setRestartCommand(const QStringList &command)
To iterate over the list, you can use the \l foreach pseudo-keyword:
- \snippet code/src_gui_kernel_qapplication.cpp 10
+ \snippet code/src_gui_kernel_qguiapplication.cpp 10
\sa setRestartCommand(), restartHint()
*/
@@ -344,7 +347,7 @@ void QSessionManager::setDiscardCommand(const QStringList &command)
To iterate over the list, you can use the \l foreach pseudo-keyword:
- \snippet code/src_gui_kernel_qapplication.cpp 11
+ \snippet code/src_gui_kernel_qguiapplication.cpp 11
\sa setDiscardCommand(), restartCommand(), setRestartCommand()
*/
@@ -396,9 +399,10 @@ bool QSessionManager::isPhase2() const
/*!
Requests a second session management phase for the application. The
- application may then return immediately from the QApplication::commitData()
- or QApplication::saveState() function, and they will be called again once
- most or all other applications have finished their session management.
+ application may then return immediately from the
+ QGuiApplication::commitDataRequest() or QApplication::saveStateRequest()
+ function, and they will be called again once most or all other
+ applications have finished their session management.
The two phases are useful for applications such as the X11 window manager
that need to store information about another application's windows and
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp
index a302f2186c..04ea9c27d5 100644
--- a/src/gui/kernel/qstylehints.cpp
+++ b/src/gui/kernel/qstylehints.cpp
@@ -106,7 +106,7 @@ int QStyleHints::mouseDoubleClickInterval() const
and the current position (e.g. in the mouse move event) is \c currentPos,
you can find out if a drag should be started with code like this:
- \snippet code/src_gui_kernel_qapplication.cpp 7
+ \snippet code/src_gui_kernel_qguiapplication.cpp 6
\sa startDragTime(), QPoint::manhattanLength(), {Drag and Drop}
*/
diff --git a/src/gui/opengl/qopenglpixeltransferoptions.h b/src/gui/opengl/qopenglpixeltransferoptions.h
index 1a416efe03..1a5d3f00e2 100644
--- a/src/gui/opengl/qopenglpixeltransferoptions.h
+++ b/src/gui/opengl/qopenglpixeltransferoptions.h
@@ -46,7 +46,7 @@
#if !defined(QT_NO_OPENGL)
-#include <QSharedDataPointer>
+#include <QtCore/QSharedDataPointer>
QT_BEGIN_NAMESPACE
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index d053937c89..a6e1c2953d 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -175,7 +175,7 @@ bool QOpenGLTexturePrivate::create()
void QOpenGLTexturePrivate::destroy()
{
- if (QOpenGLContext::currentContext() == context) {
+ if (QOpenGLContext::currentContext() != context) {
qWarning("Requires a valid current OpenGL context.\n"
"Texture has not been destroyed");
return;
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index 5b8556d198..252e6ff9b5 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -636,6 +636,13 @@ QBrush &QBrush::operator=(const QBrush &b)
return *this;
}
+/*!
+ \fn QBrush &QBrush::operator=(QBrush &&other)
+
+ Move-assigns \a other to this QBrush instance.
+
+ \since 5.2
+*/
/*!
\fn void QBrush::swap(QBrush &other)
diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp
index 626a91c331..1e36cd224a 100644
--- a/src/gui/painting/qpainterpath.cpp
+++ b/src/gui/painting/qpainterpath.cpp
@@ -608,6 +608,14 @@ QPainterPath &QPainterPath::operator=(const QPainterPath &other)
}
/*!
+ \fn QPainterPath &QPainterPath::operator=(QPainterPath &&other)
+
+ Move-assigns \a other to this QPainterPath instance.
+
+ \since 5.2
+*/
+
+/*!
\fn void QPainterPath::swap(QPainterPath &other)
\since 4.8
diff --git a/src/gui/painting/qpen.cpp b/src/gui/painting/qpen.cpp
index d27e0c409d..d8db244d66 100644
--- a/src/gui/painting/qpen.cpp
+++ b/src/gui/painting/qpen.cpp
@@ -378,6 +378,14 @@ QPen &QPen::operator=(const QPen &p)
}
/*!
+ \fn QPen &QPen::operator=(QPen &&other)
+
+ Move-assigns \a other to this QPen instance.
+
+ \since 5.2
+*/
+
+/*!
\fn void QPen::swap(QPen &other)
\since 4.8
diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp
index 47668c62b6..913daee3e1 100644
--- a/src/gui/painting/qregion.cpp
+++ b/src/gui/painting/qregion.cpp
@@ -361,6 +361,14 @@ void QRegion::exec(const QByteArray &buffer, int ver, QDataStream::ByteOrder byt
*/
/*!
+ \fn QRegion &QRegion::operator=(QRegion &&other)
+
+ Move-assigns \a other to this QRegion instance.
+
+ \since 5.2
+*/
+
+/*!
\fn void QRegion::swap(QRegion &other)
\since 4.8
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 9d603bb08d..2a9cac352d 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -537,6 +537,14 @@ QFontEngineData::~QFontEngineData()
*/
/*!
+ \fn QFont &QFont::operator=(QFont &&other)
+
+ Move-assigns \a other to this QFont instance.
+
+ \since 5.2
+*/
+
+/*!
\fn QString QFont::rawName() const
Returns the name of the font within the underlying window system.
diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp
index 160d66c96c..1d0a1c1078 100644
--- a/src/gui/text/qfontmetrics.cpp
+++ b/src/gui/text/qfontmetrics.cpp
@@ -213,6 +213,14 @@ QFontMetrics &QFontMetrics::operator=(const QFontMetrics &fm)
}
/*!
+ \fn QFontMetrics &QFontMetrics::operator=(QFontMetrics &&other)
+
+ Move-assigns \a other to this QFontMetrics instance.
+
+ \since 5.2
+*/
+
+/*!
\fn void QFontMetrics::swap(QFontMetrics &other)
\since 5.0
diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp
index c939020457..1284207307 100644
--- a/src/gui/text/qtextoption.cpp
+++ b/src/gui/text/qtextoption.cpp
@@ -61,6 +61,7 @@ QTextOption::QTextOption()
wordWrap(QTextOption::WordWrap),
design(false),
unused(0),
+ unused2(0),
f(0),
tab(-1),
d(0)
@@ -78,6 +79,7 @@ QTextOption::QTextOption(Qt::Alignment alignment)
wordWrap(QTextOption::WordWrap),
design(false),
unused(0),
+ unused2(0),
f(0),
tab(-1),
d(0)
@@ -104,6 +106,7 @@ QTextOption::QTextOption(const QTextOption &o)
design(o.design),
direction(o.direction),
unused(o.unused),
+ unused2(o.unused2),
f(o.f),
tab(o.tab),
d(0)
diff --git a/src/gui/text/qtextoption.h b/src/gui/text/qtextoption.h
index a6818eb79a..3c76768f87 100644
--- a/src/gui/text/qtextoption.h
+++ b/src/gui/text/qtextoption.h
@@ -134,7 +134,8 @@ private:
uint wordWrap : 4;
uint design : 1;
uint direction : 2;
- uint unused : 18;
+ uint unused : 17;
+ uint unused2; // ### Qt 6: remove unnecessary, extra 32 bits
uint f;
qreal tab;
QTextOptionPrivate *d;