summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java1
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java2
-rw-r--r--src/gui/painting/qdrawhelper.cpp16
-rw-r--r--src/gui/painting/qdrawhelper_sse2.cpp24
-rw-r--r--src/gui/painting/qpdf.cpp3
-rw-r--r--src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar.cpp2
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp7
-rw-r--r--src/printsupport/kernel/qcups.cpp1
-rw-r--r--src/widgets/accessible/itemviews.cpp1
-rw-r--r--src/widgets/graphicsview/qgraphicswidget.cpp1
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp1
-rw-r--r--src/widgets/itemviews/qheaderview.cpp1
-rw-r--r--src/widgets/itemviews/qlistview.cpp2
-rw-r--r--src/widgets/widgets/qmenubar.cpp11
14 files changed, 50 insertions, 23 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
index b6dbd82597..c74e38d997 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -348,6 +348,7 @@ public class QtNative
// application methods
public static native void startQtApplication(String params, String env);
public static native boolean startQtAndroidPlugin();
+ public static native void quitQtCoreApplication();
public static native void quitQtAndroidPlugin();
public static native void terminateQt();
// application methods
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java
index 5ac406c710..035a65a84c 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java
@@ -185,6 +185,6 @@ public class QtServiceDelegate
public void onDestroy()
{
- QtNative.setService(null, null);
+ QtNative.quitQtCoreApplication();
}
}
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index 5c38648fe7..0cd5ff1d0e 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -6315,13 +6315,13 @@ inline void qt_memfill_template(T *dest, T color, int count)
int n = (count + 7) / 8;
switch (count & 0x07)
{
- case 0: do { *dest++ = color;
- case 7: *dest++ = color;
- case 6: *dest++ = color;
- case 5: *dest++ = color;
- case 4: *dest++ = color;
- case 3: *dest++ = color;
- case 2: *dest++ = color;
+ case 0: do { *dest++ = color; Q_FALLTHROUGH();
+ case 7: *dest++ = color; Q_FALLTHROUGH();
+ case 6: *dest++ = color; Q_FALLTHROUGH();
+ case 5: *dest++ = color; Q_FALLTHROUGH();
+ case 4: *dest++ = color; Q_FALLTHROUGH();
+ case 3: *dest++ = color; Q_FALLTHROUGH();
+ case 2: *dest++ = color; Q_FALLTHROUGH();
case 1: *dest++ = color;
} while (--n > 0);
}
@@ -6332,7 +6332,7 @@ inline void qt_memfill_template(quint16 *dest, quint16 value, int count)
{
if (count < 3) {
switch (count) {
- case 2: *dest++ = value;
+ case 2: *dest++ = value; Q_FALLTHROUGH();
case 1: *dest = value;
}
return;
diff --git a/src/gui/painting/qdrawhelper_sse2.cpp b/src/gui/painting/qdrawhelper_sse2.cpp
index edce70d2d0..3013d2cf3e 100644
--- a/src/gui/painting/qdrawhelper_sse2.cpp
+++ b/src/gui/painting/qdrawhelper_sse2.cpp
@@ -237,11 +237,11 @@ void qt_memfill32(quint32 *dest, quint32 value, int count)
{
if (count < 7) {
switch (count) {
- case 6: *dest++ = value;
- case 5: *dest++ = value;
- case 4: *dest++ = value;
- case 3: *dest++ = value;
- case 2: *dest++ = value;
+ case 6: *dest++ = value; Q_FALLTHROUGH();
+ case 5: *dest++ = value; Q_FALLTHROUGH();
+ case 4: *dest++ = value; Q_FALLTHROUGH();
+ case 3: *dest++ = value; Q_FALLTHROUGH();
+ case 2: *dest++ = value; Q_FALLTHROUGH();
case 1: *dest = value;
}
return;
@@ -249,16 +249,16 @@ void qt_memfill32(quint32 *dest, quint32 value, int count)
const int align = (quintptr)(dest) & 0xf;
switch (align) {
- case 4: *dest++ = value; --count;
- case 8: *dest++ = value; --count;
+ case 4: *dest++ = value; --count; Q_FALLTHROUGH();
+ case 8: *dest++ = value; --count; Q_FALLTHROUGH();
case 12: *dest++ = value; --count;
}
const int rest = count & 0x3;
if (rest) {
switch (rest) {
- case 3: dest[count - 3] = value;
- case 2: dest[count - 2] = value;
+ case 3: dest[count - 3] = value; Q_FALLTHROUGH();
+ case 2: dest[count - 2] = value; Q_FALLTHROUGH();
case 1: dest[count - 1] = value;
}
}
@@ -277,8 +277,8 @@ void qt_memfill32(quint32 *dest, quint32 value, int count)
}
switch (count128 & 0x3) {
- case 3: _mm_stream_si128(dst128++, value128);
- case 2: _mm_stream_si128(dst128++, value128);
+ case 3: _mm_stream_si128(dst128++, value128); Q_FALLTHROUGH();
+ case 2: _mm_stream_si128(dst128++, value128); Q_FALLTHROUGH();
case 1: _mm_stream_si128(dst128++, value128);
}
}
@@ -318,7 +318,7 @@ void qt_memfill16(quint16 *dest, quint16 value, int count)
{
if (count < 3) {
switch (count) {
- case 2: *dest++ = value;
+ case 2: *dest++ = value; Q_FALLTHROUGH();
case 1: *dest = value;
}
return;
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 7b8bae1642..ca3e3ac362 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -2082,7 +2082,8 @@ int QPdfEnginePrivate::createShadingFunction(const QGradient *gradient, int from
for (int i = 0; i < gradientBounds.size(); ++i)
s << gradientBounds.at(i).function << "0 R ";
s << "]\n"
- ">>\n";
+ ">>\n"
+ "endobj\n";
write(data);
} else {
function = functions.at(0);
diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar.cpp b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar.cpp
index fb0705c8c7..b13c875854 100644
--- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar.cpp
+++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenubar.cpp
@@ -120,7 +120,7 @@ void QDBusMenuBar::syncMenu(QPlatformMenu *menu)
void QDBusMenuBar::handleReparent(QWindow *newParentWindow)
{
- if (newParentWindow && newParentWindow->winId() != m_windowId) {
+ if (newParentWindow) {
unregisterMenuBar();
m_windowId = newParentWindow->winId();
registerMenuBar();
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index 0fabb25233..17c197ea38 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -533,6 +533,12 @@ static jboolean startQtApplication(JNIEnv *env, jobject /*object*/, jstring para
return pthread_create(&m_qtAppThread, nullptr, startMainMethod, nullptr) == 0;
}
+static void quitQtCoreApplication(JNIEnv *env, jclass /*clazz*/)
+{
+ Q_UNUSED(env);
+ QCoreApplication::quit();
+}
+
static void quitQtAndroidPlugin(JNIEnv *env, jclass /*clazz*/)
{
Q_UNUSED(env);
@@ -733,6 +739,7 @@ static JNINativeMethod methods[] = {
{"startQtAndroidPlugin", "()Z", (void *)startQtAndroidPlugin},
{"startQtApplication", "(Ljava/lang/String;Ljava/lang/String;)V", (void *)startQtApplication},
{"quitQtAndroidPlugin", "()V", (void *)quitQtAndroidPlugin},
+ {"quitQtCoreApplication", "()V", (void *)quitQtCoreApplication},
{"terminateQt", "()V", (void *)terminateQt},
{"setDisplayMetrics", "(IIIIDDDD)V", (void *)setDisplayMetrics},
{"setSurface", "(ILjava/lang/Object;II)V", (void *)setSurface},
diff --git a/src/printsupport/kernel/qcups.cpp b/src/printsupport/kernel/qcups.cpp
index 3c6a6caffa..d655dd09ba 100644
--- a/src/printsupport/kernel/qcups.cpp
+++ b/src/printsupport/kernel/qcups.cpp
@@ -101,6 +101,7 @@ static inline QString jobHoldToString(const QCUPSSupport::JobHoldUntil jobHold,
return localDateTime.toUTC().time().toString(QStringLiteral("HH:mm"));
}
// else fall through:
+ Q_FALLTHROUGH();
case QCUPSSupport::NoHold:
return QString();
}
diff --git a/src/widgets/accessible/itemviews.cpp b/src/widgets/accessible/itemviews.cpp
index db5af4fd7c..eec9a0021c 100644
--- a/src/widgets/accessible/itemviews.cpp
+++ b/src/widgets/accessible/itemviews.cpp
@@ -310,6 +310,7 @@ bool QAccessibleTable::selectColumn(int column)
case QAbstractItemView::SingleSelection:
if (view()->selectionBehavior() != QAbstractItemView::SelectColumns && rowCount() > 1)
return false;
+ Q_FALLTHROUGH();
case QAbstractItemView::ContiguousSelection:
if ((!column || !view()->selectionModel()->isColumnSelected(column - 1, view()->rootIndex()))
&& !view()->selectionModel()->isColumnSelected(column + 1, view()->rootIndex()))
diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp
index 2adc58e4a4..1ff01b875c 100644
--- a/src/widgets/graphicsview/qgraphicswidget.cpp
+++ b/src/widgets/graphicsview/qgraphicswidget.cpp
@@ -1500,6 +1500,7 @@ void QGraphicsWidget::changeEvent(QEvent *event)
unsetWindowFrameMargins();
if (d->layout)
d->layout->invalidate();
+ Q_FALLTHROUGH();
case QEvent::FontChange:
update();
updateGeometry();
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 20002b1f82..d24456edef 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -4035,6 +4035,7 @@ QItemSelectionModel::SelectionFlags QAbstractItemViewPrivate::extendedSelectionC
switch (static_cast<const QKeyEvent*>(event)->key()) {
case Qt::Key_Backtab:
modifiers = modifiers & ~Qt::ShiftModifier; // special case for backtab
+ Q_FALLTHROUGH();
case Qt::Key_Down:
case Qt::Key_Up:
case Qt::Key_Left:
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index d2f9618c29..e0e993ce77 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -2565,6 +2565,7 @@ void QHeaderView::mouseReleaseEvent(QMouseEvent *e)
d->updateSectionIndicator(d->section, pos);
break;
} // not moving
+ Q_FALLTHROUGH();
case QHeaderViewPrivate::SelectSections:
if (!d->clickableSections) {
int section = logicalIndexAt(pos);
diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp
index 653b03ef0d..3ef5b788c6 100644
--- a/src/widgets/itemviews/qlistview.cpp
+++ b/src/widgets/itemviews/qlistview.cpp
@@ -1157,6 +1157,7 @@ QModelIndex QListView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie
rect.moveTop(rect.top() - d->viewport->height() + 2 * rect.height());
if (rect.top() < rect.height())
rect.moveTop(rect.height());
+ Q_FALLTHROUGH();
case MovePrevious:
case MoveUp:
while (intersectVector.isEmpty()) {
@@ -1185,6 +1186,7 @@ QModelIndex QListView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie
rect.moveTop(rect.top() + d->viewport->height() - 2 * rect.height());
if (rect.bottom() > contents.height() - rect.height())
rect.moveBottom(contents.height() - rect.height());
+ Q_FALLTHROUGH();
case MoveNext:
case MoveDown:
while (intersectVector.isEmpty()) {
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index 77ed7a4f78..c16b2a5ac1 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -1470,6 +1470,17 @@ bool QMenuBar::eventFilter(QObject *object, QEvent *event)
}
}
+ if (isNativeMenuBar() && event->type() == QEvent::ShowToParent) {
+ // On some desktops like Unity, the D-Bus menu bar is unregistered
+ // when the window is hidden. So when the window is shown, we need
+ // to forcefully re-register it. The only way to force re-registering
+ // with D-Bus menu is the handleReparent method.
+ QWidget *widget = qobject_cast<QWidget *>(object);
+ QWindow *handle = widget ? widget->windowHandle() : nullptr;
+ if (handle != nullptr)
+ d->platformMenuBar->handleReparent(handle);
+ }
+
if (style()->styleHint(QStyle::SH_MenuBar_AltKeyNavigation, 0, this)) {
if (d->altPressed) {
switch (event->type()) {