Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9

This commit is contained in:
Liang Qi 2017-03-28 11:13:44 +00:00 committed by The Qt Project
commit 5d3b27f521
14 changed files with 50 additions and 23 deletions

View File

@ -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

View File

@ -185,6 +185,6 @@ public class QtServiceDelegate
public void onDestroy()
{
QtNative.setService(null, null);
QtNative.quitQtCoreApplication();
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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();

View File

@ -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},

View File

@ -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();
}

View File

@ -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()))

View File

@ -1500,6 +1500,7 @@ void QGraphicsWidget::changeEvent(QEvent *event)
unsetWindowFrameMargins();
if (d->layout)
d->layout->invalidate();
Q_FALLTHROUGH();
case QEvent::FontChange:
update();
updateGeometry();

View File

@ -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:

View File

@ -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);

View File

@ -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()) {

View File

@ -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()) {