diff --git a/mkspecs/win32-icc/qmake.conf b/mkspecs/win32-icc/qmake.conf index 3cb0d58824..2447c712b1 100644 --- a/mkspecs/win32-icc/qmake.conf +++ b/mkspecs/win32-icc/qmake.conf @@ -12,6 +12,7 @@ include(../common/msvc-desktop.conf) # modifications to msvc-desktop.conf QMAKE_COMPILER += intel_icl +DEFINES += _ENABLE_EXTENDED_ALIGNED_STORAGE QMAKE_CFLAGS_OPTIMIZE_FULL = -O3 diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index d8402c4eb6..aa84f56368 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -471,8 +471,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if debug output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qDebug() */ @@ -493,8 +491,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if debug output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qDebug() */ @@ -518,8 +514,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if debug output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qInfo() */ @@ -540,8 +534,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if debug output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qInfo() */ @@ -565,8 +557,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if warning output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qWarning() */ @@ -587,8 +577,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if warning output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qWarning() */ @@ -612,8 +600,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if critical output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qCritical() */ @@ -634,8 +620,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if critical output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qCritical() */ /*! diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp index d8b4c8cc97..6b59b0723b 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp +++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp @@ -2347,7 +2347,7 @@ bool QSortFilterProxyModel::insertRows(int row, int count, const QModelIndex &pa if (row > m->source_rows.count()) return false; int source_row = (row >= m->source_rows.count() - ? m->source_rows.count() + ? m->proxy_rows.count() : m->source_rows.at(row)); return d->model->insertRows(source_row, count, source_parent); } @@ -2367,7 +2367,7 @@ bool QSortFilterProxyModel::insertColumns(int column, int count, const QModelInd if (column > m->source_columns.count()) return false; int source_column = (column >= m->source_columns.count() - ? m->source_columns.count() + ? m->proxy_columns.count() : m->source_columns.at(column)); return d->model->insertColumns(source_column, count, source_parent); } diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index a6bd7847a5..b74b1fd123 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -490,7 +490,7 @@ Q_OUTOFLINE_TEMPLATE typename QVarLengthArray::iterator QVarLengthA } } else { T *b = ptr + offset; - memmove(b + 1, b, (s - offset) * sizeof(T)); + memmove(static_cast(b + 1), static_cast(b), (s - offset) * sizeof(T)); new (b) T(std::move(t)); } s += 1; @@ -518,7 +518,7 @@ Q_OUTOFLINE_TEMPLATE typename QVarLengthArray::iterator QVarLengthA } else { T *b = ptr + offset; T *i = b + n; - memmove(i, b, (s - offset - n) * sizeof(T)); + memmove(static_cast(i), static_cast(b), (s - offset - n) * sizeof(T)); while (i != b) new (--i) T(copy); } @@ -544,7 +544,7 @@ Q_OUTOFLINE_TEMPLATE typename QVarLengthArray::iterator QVarLengthA i->~T(); } } else { - memmove(ptr + f, ptr + l, (s - l) * sizeof(T)); + memmove(static_cast(ptr + f), static_cast(ptr + l), (s - l) * sizeof(T)); } s -= n; return ptr + f; diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index f5527354a2..6f8ea6dc70 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -4163,7 +4163,7 @@ QDebug operator<<(QDebug dbg, const QEvent *e) const QNativeGestureEvent *ne = static_cast(e); dbg << "QNativeGestureEvent("; QtDebugUtils::formatQEnum(dbg, ne->gestureType()); - dbg << "localPos="; + dbg << ", localPos="; QtDebugUtils::formatQPoint(dbg, ne->localPos()); dbg << ", value=" << ne->value() << ')'; } diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 6826f62b61..4e9b00f9c9 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1043,19 +1043,31 @@ struct QBidiAlgorithm { } } - bool process() + bool checkForBidi() const { - memset(analysis, 0, length * sizeof(QScriptAnalysis)); - - bool hasBidi = (baseLevel != 0); - if (!hasBidi) { - for (int i = 0; i < length; ++i) { - if (text[i].unicode() >= 0x590) { - hasBidi = true; + if (baseLevel != 0) + return true; + for (int i = 0; i < length; ++i) { + if (text[i].unicode() >= 0x590) { + switch (text[i].direction()) { + case QChar::DirR: case QChar::DirAN: + case QChar::DirLRE: case QChar::DirLRO: case QChar::DirAL: + case QChar::DirRLE: case QChar::DirRLO: case QChar::DirPDF: + case QChar::DirLRI: case QChar::DirRLI: case QChar::DirFSI: case QChar::DirPDI: + return true; + default: break; } } } + return false; + } + + bool process() + { + memset(analysis, 0, length * sizeof(QScriptAnalysis)); + + bool hasBidi = checkForBidi(); if (!hasBidi) return false; @@ -2071,7 +2083,6 @@ void QTextEngine::itemize() const case QChar::Nbsp: if (option.flags() & QTextOption::ShowTabsAndSpaces) { analysis->flags = (*uc == QChar::Space) ? QScriptAnalysis::Space : QScriptAnalysis::Nbsp; - analysis->bidiLevel = bidi.baseLevel; break; } Q_FALLTHROUGH(); diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiautils.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiautils.cpp index 11397fb9ec..7a91c3d4e2 100644 --- a/src/plugins/platforms/windows/uiautomation/qwindowsuiautils.cpp +++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiautils.cpp @@ -180,7 +180,7 @@ long roleToControlTypeId(QAccessible::Role role) {QAccessible::PropertyPage, UIA_CustomControlTypeId}, {QAccessible::Indicator, UIA_CustomControlTypeId}, {QAccessible::Graphic, UIA_ImageControlTypeId}, - {QAccessible::StaticText, UIA_EditControlTypeId}, + {QAccessible::StaticText, UIA_TextControlTypeId}, {QAccessible::EditableText, UIA_EditControlTypeId}, {QAccessible::Button, UIA_ButtonControlTypeId}, {QAccessible::CheckBox, UIA_CheckBoxControlTypeId}, diff --git a/src/testlib/3rdparty/qt_attribution.json b/src/testlib/3rdparty/qt_attribution.json index 47625634e5..18522b6cd8 100644 --- a/src/testlib/3rdparty/qt_attribution.json +++ b/src/testlib/3rdparty/qt_attribution.json @@ -8,6 +8,7 @@ "Description": "An instrumentation framework for building dynamic analysis tools.", "Homepage": "http://valgrind.org/", + "Version": "3.3.0", "License": "BSD 4-clause \"Original\" or \"Old\" License", "LicenseId": "BSD-4-Clause", "LicenseFile": "VALGRIND_LICENSE.txt", @@ -36,6 +37,8 @@ Copyright (c) 2003, 2006 Massachusetts Institute of Technology" "Files": "linux_perf_event_p.h", "Description": "Allows access to the Linux kernel's performance events.", + "Homepage": "https://www.kernel.org", + "Version": "3.7", "License": "GNU General Public License v2.0 only with Linux Syscall Note", "LicenseId": "GPL-2.0 WITH Linux-syscall-note", "LicenseFile": "LINUX_LICENSE.txt", diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp index 94c3fa6e46..646f96c3a1 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp @@ -4662,4 +4662,236 @@ void tst_QSortFilterProxyModel::checkSetNewModel() QCoreApplication::processEvents(); } +enum ColumnFilterMode { + FilterNothing, + FilterOutMiddle, + FilterOutBeginEnd, + FilterAll +}; +Q_DECLARE_METATYPE(ColumnFilterMode) + +void tst_QSortFilterProxyModel::filterAndInsertColumn_data() +{ + + QTest::addColumn("insertCol"); + QTest::addColumn("filterMode"); + QTest::addColumn("expectedModelList"); + QTest::addColumn("expectedProxyModelList"); + + QTest::newRow("at_beginning_filter_out_middle") + << 0 + << FilterOutMiddle + << QStringList{{"", "A1", "B1", "C1", "D1"}} + << QStringList{{"", "D1"}} + ; + QTest::newRow("at_end_filter_out_middle") + << 2 + << FilterOutMiddle + << QStringList{{"A1", "B1", "C1", "D1", ""}} + << QStringList{{"A1", ""}} + ; + QTest::newRow("in_the_middle_filter_out_middle") + << 1 + << FilterOutMiddle + << QStringList{{"A1", "B1", "C1", "", "D1"}} + << QStringList{{"A1", "D1"}} + ; + QTest::newRow("at_beginning_filter_out_begin_and_end") + << 0 + << FilterOutBeginEnd + << QStringList{{"A1", "", "B1", "C1", "D1"}} + << QStringList{{"", "B1", "C1"}} + ; + QTest::newRow("at_end_filter_out_begin_and_end") + << 2 + << FilterOutBeginEnd + << QStringList{{"A1", "B1", "C1", "D1", ""}} + << QStringList{{"B1", "C1", "D1"}} + ; + QTest::newRow("in_the_middle_filter_out_begin_and_end") + << 1 + << FilterOutBeginEnd + << QStringList{{"A1", "B1", "", "C1", "D1"}} + << QStringList{{"B1", "", "C1"}} + ; + + QTest::newRow("at_beginning_filter_nothing") + << 0 + << FilterAll + << QStringList{{"", "A1", "B1", "C1", "D1"}} + << QStringList{{"", "A1", "B1", "C1", "D1"}} + ; + QTest::newRow("at_end_filter_nothing") + << 4 + << FilterAll + << QStringList{{"A1", "B1", "C1", "D1", ""}} + << QStringList{{"A1", "B1", "C1", "D1", ""}} + ; + QTest::newRow("in_the_middle_nothing") + << 2 + << FilterAll + << QStringList{{"A1", "B1", "", "C1", "D1"}} + << QStringList{{"A1", "B1", "", "C1", "D1"}} + ; + + QTest::newRow("filter_all") + << 0 + << FilterNothing + << QStringList{{"A1", "B1", "C1", "D1", ""}} + << QStringList{} + ; +} +void tst_QSortFilterProxyModel::filterAndInsertColumn() +{ + + class ColumnFilterProxy : public QSortFilterProxyModel { + Q_DISABLE_COPY(ColumnFilterProxy) + ColumnFilterMode filerMode; + public: + ColumnFilterProxy(ColumnFilterMode mode) + : filerMode(mode) + {} + bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const override + { + Q_UNUSED(source_parent) + switch (filerMode){ + case FilterAll: + return true; + case FilterNothing: + return false; + case FilterOutMiddle: + return source_column == 0 || source_column == sourceModel()->columnCount() - 1; + case FilterOutBeginEnd: + return source_column > 0 && source_column< sourceModel()->columnCount() - 1; + } + Q_UNREACHABLE(); + } + }; + QFETCH(int, insertCol); + QFETCH(ColumnFilterMode, filterMode); + QFETCH(QStringList, expectedModelList); + QFETCH(QStringList, expectedProxyModelList); + QStandardItemModel model; + model.insertColumns(0, 4); + model.insertRows(0, 1); + for (int i = 0; i < model.rowCount(); ++i) { + for (int j = 0; j < model.columnCount(); ++j) + model.setData(model.index(i, j), QString('A' + j) + QString::number(i + 1)); + } + ColumnFilterProxy proxy(filterMode); + proxy.setSourceModel(&model); + QVERIFY(proxy.insertColumn(insertCol)); + proxy.invalidate(); + QStringList modelStringList; + for (int i = 0; i < model.rowCount(); ++i) { + for (int j = 0; j < model.columnCount(); ++j) + modelStringList.append(model.index(i, j).data().toString()); + } + QCOMPARE(expectedModelList, modelStringList); + modelStringList.clear(); + for (int i = 0; i < proxy.rowCount(); ++i) { + for (int j = 0; j < proxy.columnCount(); ++j) + modelStringList.append(proxy.index(i, j).data().toString()); + } + QCOMPARE(expectedProxyModelList, modelStringList); +} + +void tst_QSortFilterProxyModel::filterAndInsertRow_data() +{ + QTest::addColumn("initialModelList"); + QTest::addColumn("row"); + QTest::addColumn("filterRegExp"); + QTest::addColumn("expectedModelList"); + QTest::addColumn("expectedProxyModelList"); + + QTest::newRow("at_beginning_filter_out_middle") + << QStringList{{"A5", "B5", "B6", "A7"}} + << 0 + << "^A" + << QStringList{{"", "A5", "B5", "B6", "A7"}} + << QStringList{{"A5", "A7"}}; + QTest::newRow("at_end_filter_out_middle") + << QStringList{{"A5", "B5", "B6", "A7"}} + << 2 + << "^A" + << QStringList{{"A5", "B5", "B6", "A7", ""}} + << QStringList{{"A5", "A7"}}; + QTest::newRow("in_the_middle_filter_out_middle") + << QStringList{{"A5", "B5", "B6", "A7"}} + << 1 + << "^A" + << QStringList{{"A5", "B5", "B6", "", "A7"}} + << QStringList{{"A5", "A7"}}; + + QTest::newRow("at_beginning_filter_out_first_and_last") + << QStringList{{"A5", "B5", "B6", "A7"}} + << 0 + << "^B" + << QStringList{{"A5", "", "B5", "B6", "A7"}} + << QStringList{{"B5", "B6"}}; + QTest::newRow("at_end_filter_out_first_and_last") + << QStringList{{"A5", "B5", "B6", "A7"}} + << 2 + << "^B" + << QStringList{{"A5", "B5", "B6", "A7", ""}} + << QStringList{{"B5", "B6"}}; + QTest::newRow("in_the_middle_filter_out_first_and_last") + << QStringList{{"A5", "B5", "B6", "A7"}} + << 1 + << "^B" + << QStringList{{"A5", "B5", "", "B6", "A7"}} + << QStringList{{"B5", "B6"}}; + + QTest::newRow("at_beginning_no_filter") + << QStringList{{"A5", "B5", "B6", "A7"}} + << 0 + << ".*" + << QStringList{{"", "A5", "B5", "B6", "A7"}} + << QStringList{{"", "A5", "B5", "B6", "A7"}}; + QTest::newRow("at_end_no_filter") + << QStringList{{"A5", "B5", "B6", "A7"}} + << 4 + << ".*" + << QStringList{{"A5", "B5", "B6", "A7", ""}} + << QStringList{{"A5", "B5", "B6", "A7", ""}}; + QTest::newRow("in_the_middle_no_filter") + << QStringList{{"A5", "B5", "B6", "A7"}} + << 2 + << ".*" + << QStringList{{"A5", "B5", "", "B6", "A7"}} + << QStringList{{"A5", "B5", "", "B6", "A7"}}; + + QTest::newRow("filter_all") + << QStringList{{"A5", "B5", "B6", "A7"}} + << 0 + << "$a" + << QStringList{{"A5", "B5", "B6", "A7", ""}} + << QStringList{}; +} + +void tst_QSortFilterProxyModel::filterAndInsertRow() +{ + QFETCH(QStringList, initialModelList); + QFETCH(int, row); + QFETCH(QString, filterRegExp); + QFETCH(QStringList, expectedModelList); + QFETCH(QStringList, expectedProxyModelList); + QStringListModel model; + QSortFilterProxyModel proxyModel; + + model.setStringList(initialModelList); + proxyModel.setSourceModel(&model); + proxyModel.setDynamicSortFilter(true); + proxyModel.setFilterRegExp(filterRegExp); + + QVERIFY(proxyModel.insertRow(row)); + QCOMPARE(model.stringList(), expectedModelList); + QCOMPARE(proxyModel.rowCount(), expectedProxyModelList.count()); + for (int r = 0; r < proxyModel.rowCount(); ++r) { + QModelIndex index = proxyModel.index(r, 0); + QVERIFY(index.isValid()); + QCOMPARE(proxyModel.data(index).toString(), expectedProxyModelList.at(r)); + } +} + #include "tst_qsortfilterproxymodel.moc" diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h index 92f0b35065..4ea5e8fb6a 100644 --- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h +++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h @@ -161,6 +161,10 @@ private slots: void emitLayoutChangedOnlyIfSortingChanged(); void checkSetNewModel(); + void filterAndInsertRow_data(); + void filterAndInsertRow(); + void filterAndInsertColumn_data(); + void filterAndInsertColumn(); void removeIntervals_data(); void removeIntervals(); diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index a593deb90e..8b24937079 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -3882,7 +3882,7 @@ void tst_QAccessibility::bridgeTest() // Label hr = nodeList.at(4)->get_CurrentControlType(&controlTypeId); QVERIFY(SUCCEEDED(hr)); - QCOMPARE(controlTypeId, UIA_EditControlTypeId); + QCOMPARE(controlTypeId, UIA_TextControlTypeId); for (auto nd : nodeList) { nd->Release();