summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/accessible/qaccessible.cpp14
-rw-r--r--src/gui/configure.json5
-rw-r--r--src/gui/image/qimage.cpp2
-rw-r--r--src/gui/itemmodels/qstandarditemmodel.cpp18
-rw-r--r--src/gui/kernel/qevent.cpp4
-rw-r--r--src/gui/kernel/qguiapplication.cpp14
-rw-r--r--src/gui/kernel/qguiapplication_p.h1
-rw-r--r--src/gui/kernel/qhighdpiscaling.cpp9
-rw-r--r--src/gui/kernel/qopenglcontext.cpp2
-rw-r--r--src/gui/kernel/qplatformcursor.cpp2
-rw-r--r--src/gui/kernel/qplatformintegration.cpp2
-rw-r--r--src/gui/kernel/qplatformscreen.cpp2
-rw-r--r--src/gui/kernel/qwindow.cpp4
-rw-r--r--src/gui/opengl/qopengltexture.cpp7
-rw-r--r--src/gui/painting/qdrawhelper_sse4.cpp2
-rw-r--r--src/gui/painting/qpaintengine.cpp2
-rw-r--r--src/gui/text/qsyntaxhighlighter.cpp1
-rw-r--r--src/gui/text/qtextcursor.cpp6
-rw-r--r--src/gui/text/qtextobject.cpp2
19 files changed, 58 insertions, 41 deletions
diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp
index a3f53e149b..46dec7f28d 100644
--- a/src/gui/accessible/qaccessible.cpp
+++ b/src/gui/accessible/qaccessible.cpp
@@ -654,7 +654,7 @@ void QAccessible::removeActivationObserver(ActivationObserver *observer)
/*!
If a QAccessibleInterface implementation exists for the given \a object,
this function returns a pointer to the implementation; otherwise it
- returns 0.
+ returns \nullptr.
The function calls all installed factory functions (from most
recently installed to least recently installed) until one is found
@@ -770,7 +770,7 @@ QAccessible::Id QAccessible::uniqueId(QAccessibleInterface *iface)
/*!
Returns the QAccessibleInterface belonging to the \a id.
- Returns 0 if the id is invalid.
+ Returns \nullptr if the id is invalid.
*/
QAccessibleInterface *QAccessible::accessibleInterface(Id id)
{
@@ -1119,7 +1119,7 @@ QAccessibleInterface *QAccessibleInterface::focusChild() const
\fn QAccessibleInterface *QAccessibleInterface::childAt(int x, int y) const
Returns the QAccessibleInterface of a child that contains the screen coordinates (\a x, \a y).
- If there are no children at this position this function returns 0.
+ If there are no children at this position this function returns \nullptr.
The returned accessible must be a child, but not necessarily a direct child.
This function is only relyable for visible objects (invisible
@@ -1139,7 +1139,7 @@ QAccessibleInterface *QAccessibleInterface::focusChild() const
Returns the QAccessibleInterface of the parent in the accessible object hierarchy.
- Returns 0 if no parent exists (e.g. for the top level application object).
+ Returns \nullptr if no parent exists (e.g. for the top level application object).
\sa child()
*/
@@ -1150,7 +1150,7 @@ QAccessibleInterface *QAccessibleInterface::focusChild() const
Returns the accessible child with index \a index.
0-based index. The number of children of an object can be checked with childCount.
- Returns 0 when asking for an invalid child (e.g. when the child became invalid in the meantime).
+ Returns \nullptr when asking for an invalid child (e.g. when the child became invalid in the meantime).
\sa childCount(), parent()
*/
@@ -1356,7 +1356,7 @@ QAccessibleEvent::~QAccessibleEvent()
\internal
Returns the uniqueId of the QAccessibleInterface represented by this event.
- In case the object() function returns 0 this is the only way to access the
+ In case the object() function returns \nullptr, this is the only way to access the
interface.
*/
QAccessible::Id QAccessibleEvent::uniqueId() const
@@ -1786,7 +1786,7 @@ QAccessibleInterface *QAccessibleEvent::accessibleInterface() const
(This means that at least one interface among the ancestors should
return a valid QWindow pointer).
- The default implementation returns 0.
+ The default implementation returns \nullptr.
*/
QWindow *QAccessibleInterface::window() const
{
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 89934c8f1d..97883d97ad 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -250,7 +250,7 @@
"test": {
"tail": [
"#ifndef FC_RGBA_UNKNOWN",
- "# error This version of fontconfig is tool old, it is missing the FC_RGBA_UNKNOWN define",
+ "# error This version of fontconfig is too old, it is missing the FC_RGBA_UNKNOWN define",
"#endif"
],
"main": [
@@ -1436,7 +1436,7 @@
},
"eglfs_x11": {
"label": "EGLFS X11",
- "condition": "features.eglfs && features.xcb && features.xcb-xlib && features.egl_x11",
+ "condition": "features.eglfs && features.xcb-xlib && features.egl_x11",
"output": [ "privateFeature" ]
},
"gif": {
@@ -1569,7 +1569,6 @@
},
"xcb-xlib": {
"label": "XCB Xlib",
- "emitIf": "features.xcb",
"condition": "features.xlib && libs.xcb_xlib",
"output": [ "privateFeature" ]
},
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 830a110d68..9897c3aa6f 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -113,7 +113,7 @@ QImageData::QImageData()
\internal
Creates a new image data.
- Returns 0 if invalid parameters are give or anything else failed.
+ Returns \nullptr if invalid parameters are give or anything else failed.
*/
QImageData * QImageData::create(const QSize &size, QImage::Format format)
{
diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp
index 430ba152a9..7afad95bd9 100644
--- a/src/gui/itemmodels/qstandarditemmodel.cpp
+++ b/src/gui/itemmodels/qstandarditemmodel.cpp
@@ -879,8 +879,8 @@ QStandardItem::~QStandardItem()
}
/*!
- Returns the item's parent item, or 0 if the item has no parent.
- \note For toplevel items parent() returns 0. To receive toplevel
+ Returns the item's parent item, or \nullptr if the item has no parent.
+ \note For toplevel items parent() returns \nullptr. To receive toplevel
item's parent use QStandardItemModel::invisibleRootItem() instead.
\sa child(), QStandardItemModel::invisibleRootItem()
@@ -1548,7 +1548,7 @@ QModelIndex QStandardItem::index() const
Returns the QStandardItemModel that this item belongs to.
If the item is not a child of another item that belongs to the model, this
- function returns 0.
+ function returns \nullptr.
\sa index()
*/
@@ -1865,7 +1865,7 @@ void QStandardItem::setChild(int row, int column, QStandardItem *item)
/*!
Returns the child item at (\a row, \a column) if one has been set; otherwise
- returns 0.
+ returns \nullptr.
\sa setChild(), takeChild(), parent()
*/
@@ -1881,7 +1881,7 @@ QStandardItem *QStandardItem::child(int row, int column) const
/*!
Removes the child item at (\a row, \a column) without deleting it, and returns
a pointer to the item. If there was no child at the given location, then
- this function returns 0.
+ this function returns \nullptr.
Note that this function, unlike takeRow() and takeColumn(), does not affect
the dimensions of the child table.
@@ -2283,7 +2283,7 @@ void QStandardItemModel::clear()
itemPrototype()), and set it in the parent item's child table, if no item
already exists at that index.
- If \a index is an invalid index, this function returns 0.
+ If \a index is an invalid index, this function returns \nullptr.
\sa indexFromItem()
*/
@@ -2380,7 +2380,7 @@ void QStandardItemModel::setItem(int row, int column, QStandardItem *item)
\since 4.2
Returns the item for the given \a row and \a column if one has been set;
- otherwise returns 0.
+ otherwise returns \nullptr.
\sa setItem(), takeItem(), itemFromIndex()
*/
@@ -2453,7 +2453,7 @@ void QStandardItemModel::setHorizontalHeaderItem(int column, QStandardItem *item
\since 4.2
Returns the horizontal header item for \a column if one has been set;
- otherwise returns 0.
+ otherwise returns \nullptr.
\sa setHorizontalHeaderItem(), verticalHeaderItem()
*/
@@ -2509,7 +2509,7 @@ void QStandardItemModel::setVerticalHeaderItem(int row, QStandardItem *item)
\since 4.2
Returns the vertical header item for row \a row if one has been set;
- otherwise returns 0.
+ otherwise returns \nullptr.
\sa setVerticalHeaderItem(), horizontalHeaderItem()
*/
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 53d1ac1fc0..7123c4d8ba 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -3072,7 +3072,7 @@ QDropEvent::~QDropEvent()
/*!
If the source of the drag operation is a widget in this
application, this function returns that source; otherwise it
- returns 0. The source of the operation is the first parameter to
+ returns \nullptr. The source of the operation is the first parameter to
the QDrag object used instantiate the drag.
This is useful if your widget needs special behavior when dragging
@@ -3514,7 +3514,7 @@ QActionEvent::~QActionEvent()
\fn QAction *QActionEvent::before() const
If type() is \l ActionAdded, returns the action that should
- appear before action(). If this function returns 0, the action
+ appear before action(). If this function returns \nullptr, the action
should be appended to already existing actions on the same
widget.
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index f4e2dda05a..fd01f8bb7b 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -3747,7 +3747,7 @@ Qt::LayoutDirection QGuiApplication::layoutDirection()
Returns the active application override cursor.
- This function returns 0 if no application cursor has been defined (i.e. the
+ This function returns \nullptr if no application cursor has been defined (i.e. the
internal cursor stack is empty).
\sa setOverrideCursor(), restoreOverrideCursor()
@@ -3983,6 +3983,9 @@ void QGuiApplicationPrivate::notifyThemeChanged()
!QCoreApplication::testAttribute(Qt::AA_SetPalette)) {
clearPalette();
initPalette();
+ emit qGuiApp->paletteChanged(*app_pal);
+ if (is_app_running && !is_app_closing)
+ sendApplicationPaletteChange();
}
if (!(applicationResourceFlags & ApplicationFontExplicitlySet)) {
QMutexLocker locker(&applicationFontMutex);
@@ -3991,6 +3994,15 @@ void QGuiApplicationPrivate::notifyThemeChanged()
}
}
+void QGuiApplicationPrivate::sendApplicationPaletteChange(bool toAllWidgets, const char *className)
+{
+ Q_UNUSED(toAllWidgets)
+ Q_UNUSED(className)
+
+ QEvent event(QEvent::ApplicationPaletteChange);
+ QGuiApplication::sendEvent(QGuiApplication::instance(), &event);
+}
+
#if QT_CONFIG(draganddrop)
void QGuiApplicationPrivate::notifyDragStarted(const QDrag *drag)
{
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index 79c1a1c820..042a36c31f 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -313,6 +313,7 @@ public:
protected:
virtual void notifyThemeChanged();
+ virtual void sendApplicationPaletteChange(bool toAllWidgets = false, const char *className = nullptr);
bool tryCloseRemainingWindows(QWindowList processedWindows);
#if QT_CONFIG(draganddrop)
virtual void notifyDragStarted(const QDrag *);
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp
index a455aa639d..22e46e0851 100644
--- a/src/gui/kernel/qhighdpiscaling.cpp
+++ b/src/gui/kernel/qhighdpiscaling.cpp
@@ -313,9 +313,12 @@ void QHighDpiScaling::updateHighDpiScaling()
}
m_active = m_globalScalingActive || m_screenFactorSet || m_pixelDensityScalingActive;
- QPlatformScreen *primaryScreen = QGuiApplication::primaryScreen()->handle();
- qreal sf = screenSubfactor(primaryScreen);
- QDpi primaryDpi = primaryScreen->logicalDpi();
+ QScreen *primaryScreen = QGuiApplication::primaryScreen();
+ if (!primaryScreen)
+ return;
+ QPlatformScreen *platformScreen = primaryScreen->handle();
+ qreal sf = screenSubfactor(platformScreen);
+ QDpi primaryDpi = platformScreen->logicalDpi();
m_logicalDpi = QDpi(primaryDpi.first / sf, primaryDpi.second / sf);
}
diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp
index c5d5490ea0..be04513de6 100644
--- a/src/gui/kernel/qopenglcontext.cpp
+++ b/src/gui/kernel/qopenglcontext.cpp
@@ -1118,7 +1118,7 @@ void QOpenGLContext::swapBuffers(QSurface *surface)
/*!
Resolves the function pointer to an OpenGL extension function, identified by \a procName
- Returns 0 if no such function can be found.
+ Returns \nullptr if no such function can be found.
*/
QFunctionPointer QOpenGLContext::getProcAddress(const QByteArray &procName) const
{
diff --git a/src/gui/kernel/qplatformcursor.cpp b/src/gui/kernel/qplatformcursor.cpp
index bab26f6028..76e38ab12d 100644
--- a/src/gui/kernel/qplatformcursor.cpp
+++ b/src/gui/kernel/qplatformcursor.cpp
@@ -84,7 +84,7 @@ QT_BEGIN_NAMESPACE
\a windowCursor is a pointer to the QCursor that should be displayed.
- To unset the cursor of \a window, 0 is passed. This means \a window does not have
+ To unset the cursor of \a window, \nullptr is passed. This means \a window does not have
a cursor set and the cursor of a the first parent window which has a cursor explicitly
set or the system default cursor should take effect.
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp
index 6e285a8fa5..7d1fcd4eeb 100644
--- a/src/gui/kernel/qplatformintegration.cpp
+++ b/src/gui/kernel/qplatformintegration.cpp
@@ -350,7 +350,7 @@ void QPlatformIntegration::destroy()
/*!
Returns the platforms input context.
- The default implementation returns 0, implying no input method support.
+ The default implementation returns \nullptr, implying no input method support.
*/
QPlatformInputContext *QPlatformIntegration::inputContext() const
{
diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp
index 9614be7f3e..b7b312e89e 100644
--- a/src/gui/kernel/qplatformscreen.cpp
+++ b/src/gui/kernel/qplatformscreen.cpp
@@ -370,7 +370,7 @@ QString QPlatformScreen::serialNumber() const
/*!
Reimplement this function in subclass to return the cursor of the screen.
- The default implementation returns 0.
+ The default implementation returns \nullptr.
*/
QPlatformCursor *QPlatformScreen::cursor() const
{
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 0f5873543b..f1e08826a8 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -2587,6 +2587,8 @@ void QWindowPrivate::maybeQuitOnLastWindowClosed()
return;
Q_Q(QWindow);
+ if (!q->isTopLevel())
+ return;
// Attempt to close the application only if this has WA_QuitOnClose set and a non-visible parent
bool quitOnClose = QGuiApplication::quitOnLastWindowClosed() && !q->parent();
QWindowList list = QGuiApplication::topLevelWindows();
@@ -2643,7 +2645,7 @@ QOpenGLContext *QWindowPrivate::shareContext() const
native window, or to embed a native window inside a QWindow.
If foreign windows are not supported or embedding the native window
- failed in the platform plugin, this function returns 0.
+ failed in the platform plugin, this function returns \nullptr.
\note The resulting QWindow should not be used to manipulate the underlying
native window (besides re-parenting), or to observe state changes of the
diff --git a/src/gui/opengl/qopengltexture.cpp b/src/gui/opengl/qopengltexture.cpp
index cea4b51a5c..5b7956d31e 100644
--- a/src/gui/opengl/qopengltexture.cpp
+++ b/src/gui/opengl/qopengltexture.cpp
@@ -3914,8 +3914,7 @@ bool QOpenGLTexture::isAutoMipMapGenerationEnabled() const
have disabled automatic mipmap generation then you need to call this function
or the overload to create the mipmap chain.
- \note Mipmap generation is not supported for compressed textures with OpenGL
- ES 2.0.
+ \note Mipmap generation is not supported for compressed textures with OpenGL ES.
\sa setAutoMipMapGenerationEnabled(), setMipLevels(), mipLevels()
*/
@@ -3926,7 +3925,7 @@ void QOpenGLTexture::generateMipMaps()
Q_ASSERT(d->textureId);
if (isCompressedFormat(d->format)) {
if (QOpenGLContext *ctx = QOpenGLContext::currentContext())
- if (ctx->isOpenGLES() && ctx->format().majorVersion() < 3)
+ if (ctx->isOpenGLES())
return;
}
d->texFuncs->glGenerateTextureMipmap(d->textureId, d->target, d->bindingTarget);
@@ -3951,7 +3950,7 @@ void QOpenGLTexture::generateMipMaps(int baseLevel, bool resetBaseLevel)
Q_ASSERT(d->textureId);
if (isCompressedFormat(d->format)) {
if (QOpenGLContext *ctx = QOpenGLContext::currentContext())
- if (ctx->isOpenGLES() && ctx->format().majorVersion() < 3)
+ if (ctx->isOpenGLES())
return;
}
int oldBaseLevel;
diff --git a/src/gui/painting/qdrawhelper_sse4.cpp b/src/gui/painting/qdrawhelper_sse4.cpp
index e3cc1dd43e..f6c2f11eaf 100644
--- a/src/gui/painting/qdrawhelper_sse4.cpp
+++ b/src/gui/painting/qdrawhelper_sse4.cpp
@@ -174,7 +174,7 @@ template<bool RGBA>
static inline void convertARGBFromRGBA64PM_sse4(uint *buffer, const QRgba64 *src, int count)
{
int i = 0;
- const __m128i alphaMask = _mm_set1_epi64x(Q_UINT64_C(0xffff) << 48);
+ const __m128i alphaMask = _mm_set1_epi64x(qint64(Q_UINT64_C(0xffff) << 48));
const __m128i alphaMask32 = _mm_set1_epi32(0xff000000);
const __m128i rgbaMask = _mm_setr_epi8(2, 1, 0, 3, 6, 5, 4, 7, 10, 9, 8, 11, 14, 13, 12, 15);
const __m128i zero = _mm_setzero_si128();
diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp
index 1aee7d5f74..bfe1c9cadf 100644
--- a/src/gui/painting/qpaintengine.cpp
+++ b/src/gui/painting/qpaintengine.cpp
@@ -913,7 +913,7 @@ void QPaintEngine::setPaintDevice(QPaintDevice *device)
/*!
Returns the device that this engine is painting on, if painting is
- active; otherwise returns 0.
+ active; otherwise returns \nullptr.
*/
QPaintDevice *QPaintEngine::paintDevice() const
{
diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp
index b09f8b565a..0e07b69868 100644
--- a/src/gui/text/qsyntaxhighlighter.cpp
+++ b/src/gui/text/qsyntaxhighlighter.cpp
@@ -376,6 +376,7 @@ void QSyntaxHighlighter::rehighlight()
QTextCursor cursor(d->doc);
d->rehighlight(cursor, QTextCursor::End);
+ d->rehighlightPending = false; // user manually did a full rehighlight
}
/*!
diff --git a/src/gui/text/qtextcursor.cpp b/src/gui/text/qtextcursor.cpp
index af8fcf369c..7719a2e6da 100644
--- a/src/gui/text/qtextcursor.cpp
+++ b/src/gui/text/qtextcursor.cpp
@@ -2116,7 +2116,7 @@ QTextList *QTextCursor::createList(QTextListFormat::Style style)
/*!
Returns the current list if the cursor position() is inside a
- block that is part of a list; otherwise returns 0.
+ block that is part of a list; otherwise returns \nullptr.
\sa insertList(), createList()
*/
@@ -2176,7 +2176,7 @@ QTextTable *QTextCursor::insertTable(int rows, int cols, const QTextTableFormat
/*!
Returns a pointer to the current table if the cursor position()
- is inside a block that is part of a table; otherwise returns 0.
+ is inside a block that is part of a table; otherwise returns \nullptr.
\sa insertTable()
*/
@@ -2213,7 +2213,7 @@ QTextFrame *QTextCursor::insertFrame(const QTextFrameFormat &format)
}
/*!
- Returns a pointer to the current frame. Returns 0 if the cursor is invalid.
+ Returns a pointer to the current frame. Returns \nullptr if the cursor is invalid.
\sa insertFrame()
*/
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index e2130a09d9..0ed8be8530 100644
--- a/src/gui/text/qtextobject.cpp
+++ b/src/gui/text/qtextobject.cpp
@@ -1301,7 +1301,7 @@ const QTextDocument *QTextBlock::document() const
/*!
If the block represents a list item, returns the list that the item belongs
- to; otherwise returns 0.
+ to; otherwise returns \nullptr.
*/
QTextList *QTextBlock::textList() const
{