diff --git a/0001_add-setting-thc-ICON-size-attribute-in-lineedit-to-the-style-plugin.patch b/0001_add-setting-thc-ICON-size-attribute-in-lineedit-to-the-style-plugin.patch new file mode 100644 index 0000000000000000000000000000000000000000..120b13b75b4b06eb079aeb502882eb37aa7966b6 --- /dev/null +++ b/0001_add-setting-thc-ICON-size-attribute-in-lineedit-to-the-style-plugin.patch @@ -0,0 +1,71 @@ +From 52aa36ffc852efc242b1559df7d97fe7bde71a9d Mon Sep 17 00:00:00 2001 +From: root +Date: Tue, 5 Jul 2022 10:13:41 +0800 +Subject: [PATCH] + 0001_add-setting-thc-ICON-size-attribute-in-lineedit-to-the-style-plugin + +--- + src/widgets/styles/qcommonstyle.cpp | 3 +++ + src/widgets/styles/qfusionstyle.cpp | 3 +++ + src/widgets/styles/qstyle.cpp | 3 +++ + src/widgets/styles/qstyle.h | 2 ++ + 4 files changed, 11 insertions(+) + +diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp +index 559ad913..bcc6160c 100644 +--- a/src/widgets/styles/qcommonstyle.cpp ++++ b/src/widgets/styles/qcommonstyle.cpp +@@ -4832,6 +4832,9 @@ QT_WARNING_POP + case PM_IconViewIconSize: + ret = proxy()->pixelMetric(PM_LargeIconSize, opt, widget); + break; ++ case PM_LineEditIconSize: ++ ret = proxy()->pixelMetric(PM_SmallIconSize, opt, widget); ++ break; + + case PM_LargeIconSize: + ret = int(QStyleHelper::dpiScaled(32, opt)); +diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp +index 46e5b6dd..1cd31c10 100644 +--- a/src/widgets/styles/qfusionstyle.cpp ++++ b/src/widgets/styles/qfusionstyle.cpp +@@ -3052,6 +3052,9 @@ int QFusionStyle::pixelMetric(PixelMetric metric, const QStyleOption *option, co + case PM_ListViewIconSize: + val = 24; + break; ++ case PM_LineEditIconSize: ++ val = 24; ++ break; + case PM_DialogButtonsSeparator: + case PM_ScrollBarSliderMin: + val = 26; +diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp +index d80dafcc..f8eb505d 100644 +--- a/src/widgets/styles/qstyle.cpp ++++ b/src/widgets/styles/qstyle.cpp +@@ -1501,6 +1501,9 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, + \value PM_TitleBarButtonSize The size of buttons on a title bar. + This enum value has been introduced in Qt 5.8. + ++ \value PM_LineEditIconSize The default size for icons in a line edit. ++ This enum value has been introduced in Qt 6.2. ++ + \value PM_CustomBase Base value for custom pixel metrics. Custom + values must be greater than this value. + +diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h +index 5be1b4b2..8fdee8ca 100644 +--- a/src/widgets/styles/qstyle.h ++++ b/src/widgets/styles/qstyle.h +@@ -587,6 +587,8 @@ public: + PM_TitleBarButtonIconSize, + PM_TitleBarButtonSize, + ++ PM_LineEditIconSize, ++ + // do not add any values below/greater than this + PM_CustomBase = 0xf0000000 + }; +-- +2.31.1 + diff --git a/0001_fix-QDoubleSpinbox-and-QSpinbox-not-change-value-when-mouse-scroll.patch b/0001_fix-QDoubleSpinbox-and-QSpinbox-not-change-value-when-mouse-scroll.patch new file mode 100644 index 0000000000000000000000000000000000000000..58aaef4630a00527c3b3ee17118fd446e6674ede --- /dev/null +++ b/0001_fix-QDoubleSpinbox-and-QSpinbox-not-change-value-when-mouse-scroll.patch @@ -0,0 +1,90 @@ +From 690fe8b7adc60eaf5867c692ebf517e35697c74b Mon Sep 17 00:00:00 2001 +From: root +Date: Tue, 5 Jul 2022 10:06:08 +0800 +Subject: [PATCH] + 0001_fix-QDoubleSpinbox-and-QSpinbox-not-change-value-when-mouse-scroll + +--- + src/widgets/kernel/qapplication.cpp | 10 ++++++- + src/widgets/widgets/qabstractspinbox.cpp | 34 +++++++++++++----------- + 2 files changed, 27 insertions(+), 17 deletions(-) + +diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp +index 03e68217..1d5ad478 100644 +--- a/src/widgets/kernel/qapplication.cpp ++++ b/src/widgets/kernel/qapplication.cpp +@@ -114,6 +114,9 @@ + #include + #include + ++#include ++#include ++ + //#define ALIEN_DEBUG + + static void initResources() +@@ -4092,7 +4095,12 @@ void QApplicationPrivate::giveFocusAccordingToFocusPolicy(QWidget *widget, QEven + if (focusWidget->isEnabled() + && focusWidget->rect().contains(localPos) + && QApplicationPrivate::shouldSetFocus(focusWidget, focusPolicy)) { +- focusWidget->setFocus(Qt::MouseFocusReason); ++ if ((qobject_cast(focusWidget) != nullptr || qobject_cast(focusWidget) != nullptr) ++ && event->type() == QEvent::Wheel) { ++ return; ++ }else{ ++ focusWidget->setFocus(Qt::MouseFocusReason); ++ } + break; + } + if (focusWidget->isWindow()) +diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp +index bdceb91f..37479b4d 100644 +--- a/src/widgets/widgets/qabstractspinbox.cpp ++++ b/src/widgets/widgets/qabstractspinbox.cpp +@@ -1167,25 +1167,27 @@ void QAbstractSpinBox::keyReleaseEvent(QKeyEvent *event) + void QAbstractSpinBox::wheelEvent(QWheelEvent *event) + { + Q_D(QAbstractSpinBox); ++ if (this->hasFocus()) { + #ifdef Q_OS_MACOS +- // If the event comes from a real mouse wheel, rather than a track pad +- // (Qt::MouseEventSynthesizedBySystem), the shift modifier changes the +- // scroll orientation to horizontal. +- // Convert horizontal events back to vertical whilst shift is held. +- if ((event->modifiers() & Qt::ShiftModifier) +- && event->source() == Qt::MouseEventNotSynthesized) { +- d->wheelDeltaRemainder += event->angleDelta().x(); +- } else { +- d->wheelDeltaRemainder += event->angleDelta().y(); +- } ++ // If the event comes from a real mouse wheel, rather than a track pad ++ // (Qt::MouseEventSynthesizedBySystem), the shift modifier changes the ++ // scroll orientation to horizontal. ++ // Convert horizontal events back to vertical whilst shift is held. ++ if ((event->modifiers() & Qt::ShiftModifier) ++ && event->source() == Qt::MouseEventNotSynthesized) { ++ d->wheelDeltaRemainder += event->angleDelta().x(); ++ } else { ++ d->wheelDeltaRemainder += event->angleDelta().y(); ++ } + #else +- d->wheelDeltaRemainder += event->angleDelta().y(); ++ d->wheelDeltaRemainder += event->angleDelta().y(); + #endif +- const int steps = d->wheelDeltaRemainder / 120; +- d->wheelDeltaRemainder -= steps * 120; +- if (stepEnabled() & (steps > 0 ? StepUpEnabled : StepDownEnabled)) +- stepBy(event->modifiers() & d->stepModifier ? steps * 10 : steps); +- event->accept(); ++ const int steps = d->wheelDeltaRemainder / 120; ++ d->wheelDeltaRemainder -= steps * 120; ++ if (stepEnabled() & (steps > 0 ? StepUpEnabled : StepDownEnabled)) ++ stepBy(event->modifiers() & d->stepModifier ? steps * 10 : steps); ++ event->accept(); ++ } + } + #endif + +-- +2.31.1 + diff --git a/0001_fix_action_distance_lineedit.patch b/0001_fix_action_distance_lineedit.patch new file mode 100644 index 0000000000000000000000000000000000000000..fa082ccd3fabc8ce4539a9615746fbf2cb83dad9 --- /dev/null +++ b/0001_fix_action_distance_lineedit.patch @@ -0,0 +1,44 @@ +From 53a442d3bf09cfa89ad51873bf49765991a55e6e Mon Sep 17 00:00:00 2001 +From: root +Date: Mon, 4 Jul 2022 17:52:50 +0800 +Subject: [PATCH] 0001_fix_action_distance_lineedit + +--- + src/widgets/widgets/qlineedit_p.cpp | 21 ++++++++++++++++++--- + 1 file changed, 18 insertions(+), 3 deletions(-) + +diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp +index b854d9d2..413f1a44 100644 +--- a/src/widgets/widgets/qlineedit_p.cpp ++++ b/src/widgets/widgets/qlineedit_p.cpp +@@ -489,9 +489,24 @@ QLineEditPrivate::SideWidgetParameters QLineEditPrivate::sideWidgetParameters() + Q_Q(const QLineEdit); + SideWidgetParameters result; + result.iconSize = q->style()->pixelMetric(QStyle::PM_SmallIconSize, nullptr, q); +- result.margin = result.iconSize / 4; +- result.widgetWidth = result.iconSize + 6; +- result.widgetHeight = result.iconSize + 2; ++ bool ok = true; ++ int margin = q->property("_d_dtk_lineeditActionMargin").toInt(&ok); ++ ++ if (!ok) ++ margin = result.iconSize / 4; ++ int widgetWidth = q->property("_d_dtk_lineeditActionWidth").toInt(&ok); ++ ++ if (!ok) ++ widgetWidth = 6; ++ int widgetHeight = q->property("_d_dtk_lineeditActionHeight").toInt(&ok); ++ ++ if (!ok) ++ widgetHeight = 2; ++ ++ result.margin = margin; ++ result.widgetWidth = result.iconSize + widgetWidth; ++ result.widgetHeight = result.iconSize + widgetHeight; ++ + return result; + } + +-- +2.31.1 + diff --git a/0002_add-setting-thc-ICON-size-attribute-in-lineedit-to-the-style-plugin.patch b/0002_add-setting-thc-ICON-size-attribute-in-lineedit-to-the-style-plugin.patch new file mode 100644 index 0000000000000000000000000000000000000000..5c5e9b1c85a68804a732995de6c4c53c10126d38 --- /dev/null +++ b/0002_add-setting-thc-ICON-size-attribute-in-lineedit-to-the-style-plugin.patch @@ -0,0 +1,26 @@ +From db8d48e1014d2c75ab55a727fe99adae372f5124 Mon Sep 17 00:00:00 2001 +From: root +Date: Tue, 5 Jul 2022 10:16:31 +0800 +Subject: [PATCH] + 0002_add-setting-thc-ICON-size-attribute-in-lineedit-to-the-style-plugin + +--- + src/widgets/widgets/qlineedit_p.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp +index ff293d53..f1c49d45 100644 +--- a/src/widgets/widgets/qlineedit_p.cpp ++++ b/src/widgets/widgets/qlineedit_p.cpp +@@ -504,7 +504,7 @@ QLineEditPrivate::SideWidgetParameters QLineEditPrivate::sideWidgetParameters() + { + Q_Q(const QLineEdit); + SideWidgetParameters result; +- result.iconSize = q->style()->pixelMetric(QStyle::PM_SmallIconSize, nullptr, q); ++ result.iconSize = q->style()->pixelMetric(QStyle::PM_LineEditIconSize, nullptr, q); + bool ok = true; + int margin = q->property("_d_dtk_lineeditActionMargin").toInt(&ok); + +-- +2.31.1 + diff --git a/0009-fix_qss_border_cap_style.patch b/0009-fix_qss_border_cap_style.patch new file mode 100644 index 0000000000000000000000000000000000000000..8e733337a8831c7a1d0412a11d931c1417c91907 --- /dev/null +++ b/0009-fix_qss_border_cap_style.patch @@ -0,0 +1,46 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + qtbase-opensource-src (5.6.1+dfsg-3) unstable; urgency=medium + . + [ Lisandro Damián Nicanor Pérez Meyer ] + * Make libqtcore5a break libqt5scintilla2-12v5 (<< 2.9.2+dfsg-2~), pointed + out by Scott Kitterman. + . + [ Dmitry Shachnev ] + * Move qt5-default into libdevel section (like qtchooser itself; closes: + #827659). + * Move mesa-utils from Depends to Recommends (closes: #827896). + * Add a (temporary) patch to fix the QProcessPrivate::createPipe issue on + GNU/kFreeBSD (closes: #827935). + * Update symbols files from buildds’ logs. +Author: Dmitry Shachnev + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: 2017-10-30 + +--- qtbase-opensource-src-5.6.1+dfsg.orig/src/gui/painting/qcssutil.cpp ++++ qtbase-opensource-src-5.6.1+dfsg/src/gui/painting/qcssutil.cpp +@@ -134,7 +134,7 @@ void qDrawRoundedCorners(QPainter *p, qr + qreal pwby2 = pw/2; + p->setBrush(Qt::NoBrush); + QPen pen = qPenFromStyle(c, pw, s); +- pen.setCapStyle(Qt::SquareCap); // this eliminates the offby1 errors that we might hit below ++ //pen.setCapStyle(Qt::SquareCap); // this eliminates the offby1 errors that we might hit below + p->setPen(pen); + switch (edge) { + case TopEdge: diff --git a/Avoid_adding_null-objects_to_the_icon_cache.patch b/Avoid_adding_null-objects_to_the_icon_cache.patch new file mode 100644 index 0000000000000000000000000000000000000000..194d7359a993c5dbde219871cc0a78afec2eb036 --- /dev/null +++ b/Avoid_adding_null-objects_to_the_icon_cache.patch @@ -0,0 +1,22 @@ +Author: Fan Ruijie +Date: Fri May 7 20:08:57 2021 +0800 +Subject: Avoid adding null-objects to the icon cache +Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/343396/10/src/gui/image/qicon.cpp#1328 +--- +Index: qtbase-opensource-src/src/gui/image/qicon.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/gui/image/qicon.cpp ++++ qtbase-opensource-src/src/gui/image/qicon.cpp +@@ -1266,9 +1266,9 @@ QIcon QIcon::fromTheme(const QString &na + bool hasUserTheme = QIconLoader::instance()->hasUserTheme(); + QIconEngine * const engine = (platformTheme && !hasUserTheme) ? platformTheme->createIconEngine(name) + : new QIconLoaderEngine(name); +- QIcon *cachedIcon = new QIcon(engine); +- icon = *cachedIcon; +- qtIconCache()->insert(name, cachedIcon); ++ icon = QIcon(engine); ++ if (!icon.isNull()) ++ qtIconCache()->insert(name, new QIcon(icon)); + } + + return icon; diff --git a/QTBUG-86253-Mouse-source-point-error-caused-by-multi-touch.patch b/QTBUG-86253-Mouse-source-point-error-caused-by-multi-touch.patch new file mode 100644 index 0000000000000000000000000000000000000000..026f93a60b862173ca5fea8ed2b54350845e7439 --- /dev/null +++ b/QTBUG-86253-Mouse-source-point-error-caused-by-multi-touch.patch @@ -0,0 +1,25 @@ +From ddcd3369219fbbc5576567a4eeae57abe9f0fa6d Mon Sep 17 00:00:00 2001 +From: root +Date: Mon, 4 Jul 2022 20:58:47 +0800 +Subject: [PATCH] QTBUG-86253-Mouse-source-point-error-caused-by-multi-touch + +--- + src/gui/kernel/qguiapplication.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp +index bf17c871..5fbf1541 100644 +--- a/src/gui/kernel/qguiapplication.cpp ++++ b/src/gui/kernel/qguiapplication.cpp +@@ -3054,7 +3054,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To + QEvent::Type mouseEventType = QEvent::MouseMove; + Qt::MouseButton button = Qt::NoButton; + Qt::MouseButtons buttons = Qt::LeftButton; +- if (eventType == QEvent::TouchBegin && m_fakeMouseSourcePointId < 0) ++ if (eventType == QEvent::TouchBegin && m_fakeMouseSourcePointId < 0 || touchPoints.count() == 1) + m_fakeMouseSourcePointId = touchPoints.first().id(); + for (const auto &touchPoint : touchPoints) { + if (touchPoint.id() == m_fakeMouseSourcePointId) { +-- +2.31.1 + diff --git a/QTBUG-86850-Fix-invalid-QSortFilterProxyModel-dataChanged-parameters.patch b/QTBUG-86850-Fix-invalid-QSortFilterProxyModel-dataChanged-parameters.patch new file mode 100644 index 0000000000000000000000000000000000000000..5d19d5fe9b8330c39923f598de6b0850f9efa915 --- /dev/null +++ b/QTBUG-86850-Fix-invalid-QSortFilterProxyModel-dataChanged-parameters.patch @@ -0,0 +1,223 @@ +Index: qtbase-opensource-src/src/corelib/itemmodels/qsortfilterproxymodel.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/corelib/itemmodels/qsortfilterproxymodel.cpp ++++ qtbase-opensource-src/src/corelib/itemmodels/qsortfilterproxymodel.cpp +@@ -1489,15 +1489,19 @@ void QSortFilterProxyModelPrivate::_q_so + while (source_left_column < source_bottom_right.column() + && m->proxy_columns.at(source_left_column) == -1) + ++source_left_column; +- const QModelIndex proxy_top_left = create_index( +- proxy_start_row, m->proxy_columns.at(source_left_column), it); +- int source_right_column = source_bottom_right.column(); +- while (source_right_column > source_top_left.column() +- && m->proxy_columns.at(source_right_column) == -1) +- --source_right_column; +- const QModelIndex proxy_bottom_right = create_index( +- proxy_end_row, m->proxy_columns.at(source_right_column), it); +- emit q->dataChanged(proxy_top_left, proxy_bottom_right, roles); ++ if (m->proxy_columns.at(source_left_column) != -1) { ++ const QModelIndex proxy_top_left = create_index( ++ proxy_start_row, m->proxy_columns.at(source_left_column), it); ++ int source_right_column = source_bottom_right.column(); ++ while (source_right_column > source_top_left.column() ++ && m->proxy_columns.at(source_right_column) == -1) ++ --source_right_column; ++ if (m->proxy_columns.at(source_right_column) != -1) { ++ const QModelIndex proxy_bottom_right = create_index( ++ proxy_end_row, m->proxy_columns.at(source_right_column), it); ++ emit q->dataChanged(proxy_top_left, proxy_bottom_right, roles); ++ } ++ } + } + } + +Index: qtbase-opensource-src/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp +=================================================================== +--- qtbase-opensource-src.orig/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp ++++ qtbase-opensource-src/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp +@@ -2220,6 +2220,172 @@ void tst_QSortFilterProxyModel::changeSo + QCOMPARE(afterDataChangedSpy.size(), 1); + } + ++void tst_QSortFilterProxyModel::changeSourceDataProxyFilterSingleColumn() ++{ ++ enum modelRow { Row0, Row1, RowCount }; ++ enum modelColumn { Column0, Column1, Column2, Column3, Column4, Column5, ColumnCount }; ++ ++ class FilterProxyModel : public QSortFilterProxyModel ++ { ++ public: ++ bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const override { ++ Q_UNUSED(source_parent); ++ switch (source_column) { ++ case Column2: ++ case Column4: ++ return true; ++ default: ++ return false; ++ } ++ } ++ }; ++ ++ QStandardItemModel model; ++ FilterProxyModel proxy; ++ proxy.setSourceModel(&model); ++ model.insertRows(0, RowCount); ++ model.insertColumns(0, ColumnCount); ++ ++ QSignalSpy modelDataChangedSpy(&model, &QSortFilterProxyModel::dataChanged); ++ QSignalSpy proxyDataChangedSpy(&proxy, &FilterProxyModel::dataChanged); ++ ++ QVERIFY(modelDataChangedSpy.isValid()); ++ QVERIFY(proxyDataChangedSpy.isValid()); ++ ++ modelDataChangedSpy.clear(); ++ proxyDataChangedSpy.clear(); ++ model.setData(model.index(Row0, Column1), QStringLiteral("new data"), Qt::DisplayRole); ++ QCOMPARE(modelDataChangedSpy.size(), 1); ++ QCOMPARE(proxyDataChangedSpy.size(), 0); ++ ++ modelDataChangedSpy.clear(); ++ proxyDataChangedSpy.clear(); ++ model.setData(model.index(Row0, Column2), QStringLiteral("new data"), Qt::DisplayRole); ++ QCOMPARE(modelDataChangedSpy.size(), 1); ++ QCOMPARE(proxyDataChangedSpy.size(), 1); ++ ++ modelDataChangedSpy.clear(); ++ proxyDataChangedSpy.clear(); ++ model.setData(model.index(Row0, Column3), QStringLiteral("new data"), Qt::DisplayRole); ++ QCOMPARE(modelDataChangedSpy.size(), 1); ++ QCOMPARE(proxyDataChangedSpy.size(), 0); ++ ++ modelDataChangedSpy.clear(); ++ proxyDataChangedSpy.clear(); ++ model.setData(model.index(Row0, Column4), QStringLiteral("new data"), Qt::DisplayRole); ++ QCOMPARE(modelDataChangedSpy.size(), 1); ++ QCOMPARE(proxyDataChangedSpy.size(), 1); ++ ++ modelDataChangedSpy.clear(); ++ proxyDataChangedSpy.clear(); ++ model.setData(model.index(Row0, Column5), QStringLiteral("new data"), Qt::DisplayRole); ++ QCOMPARE(modelDataChangedSpy.size(), 1); ++ QCOMPARE(proxyDataChangedSpy.size(), 0); ++} ++ ++void tst_QSortFilterProxyModel::changeSourceDataProxyFilterMultipleColumns() ++{ ++ class FilterProxyModel : public QSortFilterProxyModel ++ { ++ public: ++ bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const override { ++ Q_UNUSED(source_parent); ++ switch (source_column) { ++ case 2: ++ case 4: ++ return true; ++ default: ++ return false; ++ } ++ } ++ }; ++ ++ class MyTableModel : public QAbstractTableModel ++ { ++ public: ++ explicit MyTableModel() = default; ++ int rowCount(const QModelIndex &parent = QModelIndex()) const override { ++ Q_UNUSED(parent) ++ return 10; ++ } ++ int columnCount(const QModelIndex &parent = QModelIndex()) const override { ++ Q_UNUSED(parent) ++ return 10; ++ } ++ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override { ++ Q_UNUSED(index) ++ Q_UNUSED(role) ++ return QString("testData"); ++ } ++ ++ void testDataChanged(const int topLeftRow, const int topLeftColumn, const int bottomRightRow, const int bottomRightColumn) { ++ QModelIndex topLeft = index(topLeftRow, topLeftColumn); ++ QModelIndex bottomRight = index(bottomRightRow, bottomRightColumn); ++ QVERIFY(topLeft.isValid()); ++ QVERIFY(bottomRight.isValid()); ++ emit dataChanged(topLeft, bottomRight); ++ } ++ }; ++ ++ MyTableModel baseModel; ++ FilterProxyModel proxyModel; ++ ++ proxyModel.setSourceModel(&baseModel); ++ ++ QSignalSpy baseModelDataChangedSpy(&baseModel, &MyTableModel::dataChanged); ++ QSignalSpy proxyModelDataChangedSpy(&proxyModel, &FilterProxyModel::dataChanged); ++ ++ connect(&proxyModel, &FilterProxyModel::dataChanged, [=](const QModelIndex &topLeft, const QModelIndex &bottomRight) { ++ QVERIFY(topLeft.isValid()); ++ QVERIFY(bottomRight.isValid()); ++ ++ //make sure every element is valid ++ int topLeftRow = topLeft.row(); ++ int topLeftColumn = topLeft.column(); ++ int bottomRightRow = bottomRight.row(); ++ int bottomRightColumn = bottomRight.column(); ++ for (int row = topLeftRow; row <= bottomRightRow; ++row) { ++ for (int column = topLeftColumn; column <= bottomRightColumn; ++column) { ++ QModelIndex index = topLeft.model()->index(row, column); ++ QVERIFY(index.isValid()); ++ } ++ } ++ }); ++ ++ QVERIFY(baseModelDataChangedSpy.isValid()); ++ QVERIFY(proxyModelDataChangedSpy.isValid()); ++ ++ baseModelDataChangedSpy.clear(); ++ proxyModelDataChangedSpy.clear(); ++ baseModel.testDataChanged(0, 0, 1, 1); ++ QCOMPARE(baseModelDataChangedSpy.size(), 1); ++ QCOMPARE(proxyModelDataChangedSpy.size(), 0); ++ ++ baseModelDataChangedSpy.clear(); ++ proxyModelDataChangedSpy.clear(); ++ baseModel.testDataChanged(0, 0, 1, 2); ++ QCOMPARE(baseModelDataChangedSpy.size(), 1); ++ QCOMPARE(proxyModelDataChangedSpy.size(), 1); ++ ++ baseModelDataChangedSpy.clear(); ++ proxyModelDataChangedSpy.clear(); ++ baseModel.testDataChanged(0, 3, 1, 3); ++ QCOMPARE(baseModelDataChangedSpy.size(), 1); ++ QCOMPARE(proxyModelDataChangedSpy.size(), 0); ++ ++ baseModelDataChangedSpy.clear(); ++ proxyModelDataChangedSpy.clear(); ++ baseModel.testDataChanged(0, 3, 1, 5); ++ QCOMPARE(baseModelDataChangedSpy.size(), 1); ++ QCOMPARE(proxyModelDataChangedSpy.size(), 1); ++ ++ baseModelDataChangedSpy.clear(); ++ proxyModelDataChangedSpy.clear(); ++ baseModel.testDataChanged(0, 0, 1, 5); ++ QCOMPARE(baseModelDataChangedSpy.size(), 1); ++ QCOMPARE(proxyModelDataChangedSpy.size(), 1); ++} ++ + void tst_QSortFilterProxyModel::sortFilterRole() + { + QStandardItemModel model; +Index: qtbase-opensource-src/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h +=================================================================== +--- qtbase-opensource-src.orig/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h ++++ qtbase-opensource-src/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h +@@ -91,6 +91,8 @@ private slots: + void changeSourceDataKeepsStableSorting_qtbug1548(); + void changeSourceDataForwardsRoles_qtbug35440(); + void changeSourceDataProxySendDataChanged_qtbug87781(); ++ void changeSourceDataProxyFilterSingleColumn(); ++ void changeSourceDataProxyFilterMultipleColumns(); + void resortingDoesNotBreakTreeModels(); + void dynamicFilterWithoutSort(); + void sortFilterRole(); diff --git a/QTBUG-87035-fix-logicadpi-return-invalid-value.patch b/QTBUG-87035-fix-logicadpi-return-invalid-value.patch new file mode 100644 index 0000000000000000000000000000000000000000..d584f77259c5f388ee402c3b4e3479bcf8c92f72 --- /dev/null +++ b/QTBUG-87035-fix-logicadpi-return-invalid-value.patch @@ -0,0 +1,14 @@ +Index: qtbase-opensource-src/src/gui/kernel/qplatformscreen.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/gui/kernel/qplatformscreen.cpp ++++ qtbase-opensource-src/src/gui/kernel/qplatformscreen.cpp +@@ -189,6 +189,8 @@ QDpi QPlatformScreen::logicalDpi() const + QSizeF ps = physicalSize(); + QSize s = geometry().size(); + ++ if (qFuzzyIsNull(ps.width()) || qFuzzyIsNull(ps.height())) ++ return QDpi(96, 96); + return QDpi(25.4 * s.width() / ps.width(), + 25.4 * s.height() / ps.height()); + } + diff --git a/QTBUG-87781-Fix-QSFPM-not-emitting-dataChanged-when-source-model-is-set.patch b/QTBUG-87781-Fix-QSFPM-not-emitting-dataChanged-when-source-model-is-set.patch new file mode 100644 index 0000000000000000000000000000000000000000..3c9688a26e2c9bec0a584388db7a4158f5b6786b --- /dev/null +++ b/QTBUG-87781-Fix-QSFPM-not-emitting-dataChanged-when-source-model-is-set.patch @@ -0,0 +1,72 @@ +Index: qtbase-opensource-src/src/corelib/itemmodels/qsortfilterproxymodel.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/corelib/itemmodels/qsortfilterproxymodel.cpp ++++ qtbase-opensource-src/src/corelib/itemmodels/qsortfilterproxymodel.cpp +@@ -1564,6 +1564,7 @@ void QSortFilterProxyModelPrivate::_q_so + _q_clearMapping(); + // All internal structures are deleted in clear() + q->endResetModel(); ++ create_mapping(QModelIndex()); + update_source_sort_column(); + if (dynamic_sortfilter && update_source_sort_column()) + sort(); +@@ -2141,6 +2142,7 @@ void QSortFilterProxyModel::setSourceMod + connect(d->model, SIGNAL(modelReset()), this, SLOT(_q_sourceReset())); + + endResetModel(); ++ d->create_mapping(QModelIndex()); + if (d->update_source_sort_column() && d->dynamic_sortfilter) + d->sort(); + } +Index: qtbase-opensource-src/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp +=================================================================== +--- qtbase-opensource-src.orig/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp ++++ qtbase-opensource-src/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.cpp +@@ -2191,6 +2191,35 @@ void tst_QSortFilterProxyModel::changeSo + QCOMPARE(spy.at(1).at(2).value >(), expectedChangedRoles); + } + ++void tst_QSortFilterProxyModel::changeSourceDataProxySendDataChanged_qtbug87781() ++{ ++ QStandardItemModel baseModel; ++ QSortFilterProxyModel proxyModelBefore; ++ QSortFilterProxyModel proxyModelAfter; ++ ++ QSignalSpy baseDataChangedSpy(&baseModel, &QStandardItemModel::dataChanged); ++ QSignalSpy beforeDataChangedSpy(&proxyModelBefore, &QSortFilterProxyModel::dataChanged); ++ QSignalSpy afterDataChangedSpy(&proxyModelAfter, &QSortFilterProxyModel::dataChanged); ++ ++ QVERIFY(baseDataChangedSpy.isValid()); ++ QVERIFY(beforeDataChangedSpy.isValid()); ++ QVERIFY(afterDataChangedSpy.isValid()); ++ ++ proxyModelBefore.setSourceModel(&baseModel); ++ baseModel.insertRows(0, 1); ++ baseModel.insertColumns(0, 1); ++ proxyModelAfter.setSourceModel(&baseModel); ++ ++ QCOMPARE(baseDataChangedSpy.size(), 0); ++ QCOMPARE(beforeDataChangedSpy.size(), 0); ++ QCOMPARE(afterDataChangedSpy.size(), 0); ++ ++ baseModel.setData(baseModel.index(0, 0), QStringLiteral("new data"), Qt::DisplayRole); ++ QCOMPARE(baseDataChangedSpy.size(), 1); ++ QCOMPARE(beforeDataChangedSpy.size(), 1); ++ QCOMPARE(afterDataChangedSpy.size(), 1); ++} ++ + void tst_QSortFilterProxyModel::sortFilterRole() + { + QStandardItemModel model; +Index: qtbase-opensource-src/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h +=================================================================== +--- qtbase-opensource-src.orig/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h ++++ qtbase-opensource-src/tests/auto/corelib/itemmodels/qsortfilterproxymodel_common/tst_qsortfilterproxymodel.h +@@ -90,6 +90,7 @@ private slots: + void changeSourceData(); + void changeSourceDataKeepsStableSorting_qtbug1548(); + void changeSourceDataForwardsRoles_qtbug35440(); ++ void changeSourceDataProxySendDataChanged_qtbug87781(); + void resortingDoesNotBreakTreeModels(); + void dynamicFilterWithoutSort(); + void sortFilterRole(); diff --git a/QTBUG-89155-Assertion-violation-in-text-shaping-on-special-string-with-EmojiOneColor-font.patch b/QTBUG-89155-Assertion-violation-in-text-shaping-on-special-string-with-EmojiOneColor-font.patch new file mode 100644 index 0000000000000000000000000000000000000000..12b50e52a0a5a00c1e8c236da38a54072e0f262a --- /dev/null +++ b/QTBUG-89155-Assertion-violation-in-text-shaping-on-special-string-with-EmojiOneColor-font.patch @@ -0,0 +1,58 @@ +Author: Zhang Hao +Date: Thu Jul 22 10:47:50 2021 +0800 +Upstream: https://github.com/qt/qtbase/commit/fccd419dd632306a4bd85928223e0a56a59510ef +Subject: Assertion violation in text shaping on special string with EmojiOneColor font + +Index: qtbase-opensource-src/src/gui/text/qtextengine.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/gui/text/qtextengine.cpp ++++ qtbase-opensource-src/src/gui/text/qtextengine.cpp +@@ -1496,7 +1496,14 @@ void QTextEngine::shapeText(int item) co + si.num_glyphs = shapeTextWithHarfbuzz(si, string, itemLength, fontEngine, itemBoundaries, kerningEnabled); + } + if (Q_UNLIKELY(si.num_glyphs == 0)) { +- Q_UNREACHABLE(); // ### report shaping errors somehow ++ if (Q_UNLIKELY(!ensureSpace(si.glyph_data_offset + 1))) { ++ qWarning() << "Unable to allocate space for place-holder glyph"; ++ return; ++ } ++ si.num_glyphs = 1; ++ // Overwrite with 0 token to indicate failure ++ QGlyphLayout g = availableGlyphs(&si); ++ g.glyphs[0] = 0; + return; + } + +Index: qtbase-opensource-src/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp +=================================================================== +--- qtbase-opensource-src.orig/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp ++++ qtbase-opensource-src/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp +@@ -66,6 +66,7 @@ private slots: + void boundingRect(); + void mixedScripts(); + void multiLineBoundingRect(); ++ void defaultIgnorables(); + + private: + int m_testFontId; +@@ -762,6 +763,20 @@ void tst_QGlyphRun::multiLineBoundingRec + QVERIFY(firstLineGlyphRun.boundingRect().height() < allGlyphRun.boundingRect().height()); + } + ++void tst_QGlyphRun::defaultIgnorables() ++{ ++ QTextLayout layout; ++ layout.setFont(QFont("QtsSpecialTestFont")); ++ layout.setText(QChar(0x200D)); ++ layout.beginLayout(); ++ layout.createLine(); ++ layout.endLayout(); ++ QList runs = layout.glyphRuns(); ++ QCOMPARE(runs.size(), 1); ++ QCOMPARE(runs.at(0).glyphIndexes().size(), 1); ++ QCOMPARE(runs.at(0).glyphIndexes()[0], 0); ++} ++ + #endif // QT_NO_RAWFONT + + QTEST_MAIN(tst_QGlyphRun) diff --git a/QTBUG-89184-QInputControl-accept-surrogate-category-character.patch b/QTBUG-89184-QInputControl-accept-surrogate-category-character.patch new file mode 100644 index 0000000000000000000000000000000000000000..1c8725c046f942ecb283b222c8af37949c080031 --- /dev/null +++ b/QTBUG-89184-QInputControl-accept-surrogate-category-character.patch @@ -0,0 +1,78 @@ +From: Tang Haixiang +Date: Tue Apr 06 16:08:13 2021 +0800 +Subject: QInputControl: accept surrogate category character +Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/327425 + +--- + +Index: qtbase-opensource-src/src/gui/text/qinputcontrol.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/gui/text/qinputcontrol.cpp ++++ qtbase-opensource-src/src/gui/text/qinputcontrol.cpp +@@ -79,6 +79,9 @@ bool QInputControl::isAcceptableInput(co + if (c.category() == QChar::Other_PrivateUse) + return true; + ++ if (c.isHighSurrogate() && text.length() > 1 && text.at(1).isLowSurrogate()) ++ return true; ++ + if (m_type == TextEdit && c == QLatin1Char('\t')) + return true; + +Index: qtbase-opensource-src/tests/auto/gui/text/qinputcontrol/tst_qinputcontrol.cpp +=================================================================== +--- qtbase-opensource-src.orig/tests/auto/gui/text/qinputcontrol/tst_qinputcontrol.cpp ++++ qtbase-opensource-src/tests/auto/gui/text/qinputcontrol/tst_qinputcontrol.cpp +@@ -58,6 +58,52 @@ void tst_QInputControl::isAcceptableInpu + QTest::newRow("printable-latin-with-ctrl-shift") << QString(QLatin1Char('a')) << Qt::KeyboardModifiers(Qt::ControlModifier | Qt::ShiftModifier) << false; + QTest::newRow("printable-hebrew") << QString(QChar(0x2135)) << Qt::KeyboardModifiers() << true; + QTest::newRow("private-use-area") << QString(QChar(0xE832)) << Qt::KeyboardModifiers() << true; ++ QTest::newRow("good-surrogate-0") << QString::fromUtf16(u"\U0001F44D") << Qt::KeyboardModifiers() << true; ++ { ++ const QChar data[] = { QChar(0xD800), QChar(0xDC00) }; ++ const QString str = QString(data, 2); ++ QTest::newRow("good-surrogate-1") << str << Qt::KeyboardModifiers() << true; ++ } ++ { ++ const QChar data[] = { QChar(0xD800), QChar(0xDFFF) }; ++ const QString str = QString(data, 2); ++ QTest::newRow("good-surrogate-2") << str << Qt::KeyboardModifiers() << true; ++ } ++ { ++ const QChar data[] = { QChar(0xDBFF), QChar(0xDC00) }; ++ const QString str = QString(data, 2); ++ QTest::newRow("good-surrogate-3") << str << Qt::KeyboardModifiers() << true; ++ } ++ { ++ const QChar data[] = { QChar(0xDBFF), QChar(0xDFFF) }; ++ const QString str = QString(data, 2); ++ QTest::newRow("good-surrogate-4") << str << Qt::KeyboardModifiers() << true; ++ } ++ { ++ const QChar data[] = { QChar(0xD7FF), QChar(0xDC00) }; ++ const QString str = QString(data, 2); ++ QTest::newRow("bad-surrogate-1") << str << Qt::KeyboardModifiers() << false; ++ } ++ { ++ const QChar data[] = { QChar(0xD7FF), QChar(0xDFFF) }; ++ const QString str = QString(data, 2); ++ QTest::newRow("bad-surrogate-2") << str << Qt::KeyboardModifiers() << false; ++ } ++ { ++ const QChar data[] = { QChar(0xDC00), QChar(0xDC00) }; ++ const QString str = QString(data, 2); ++ QTest::newRow("bad-surrogate-3") << str << Qt::KeyboardModifiers() << false; ++ } ++ { ++ const QChar data[] = { QChar(0xD800), QChar(0xE000) }; ++ const QString str = QString(data, 2); ++ QTest::newRow("bad-surrogate-4") << str << Qt::KeyboardModifiers() << false; ++ } ++ { ++ const QChar data[] = { QChar(0xD800) }; ++ const QString str = QString(data, 1); ++ QTest::newRow("bad-surrogate-5") << str << Qt::KeyboardModifiers() << false; ++ } + QTest::newRow("multiple-printable") << QStringLiteral("foobar") << Qt::KeyboardModifiers() << true; + QTest::newRow("rlm") << QString(QChar(0x200F)) << Qt::KeyboardModifiers() << true; + QTest::newRow("rlm-with-ctrl") << QString(QChar(0x200F)) << Qt::KeyboardModifiers(Qt::ControlModifier) << true; diff --git a/QTBUG-89902-QComboBox-popup-menu-hide-when-press-arrow-button-more-than-double-click-time.patch b/QTBUG-89902-QComboBox-popup-menu-hide-when-press-arrow-button-more-than-double-click-time.patch new file mode 100644 index 0000000000000000000000000000000000000000..e2e6e866749109c3a04dd8515e6deae995b9f11e --- /dev/null +++ b/QTBUG-89902-QComboBox-popup-menu-hide-when-press-arrow-button-more-than-double-click-time.patch @@ -0,0 +1,65 @@ +From: zhanghao +Date: Tue Jan 12 10:36:47 2021 +0800 +Subject: Fix QComboBox popup menu will hide when press arrow button more than double click time. +--- + +Index: qtbase-opensource-src-5.11/src/widgets/widgets/qcombobox.cpp +=================================================================== +--- qtbase-opensource-src-5.11.orig/src/widgets/widgets/qcombobox.cpp ++++ qtbase-opensource-src-5.11/src/widgets/widgets/qcombobox.cpp +@@ -744,6 +744,8 @@ bool QComboBoxPrivateContainer::eventFil + if (indexUnderMouse.isValid() + && !QComboBoxDelegate::isSeparator(indexUnderMouse)) { + view->setCurrentIndex(indexUnderMouse); ++ if(maybeIgnoreMouseButtonRelease) ++ maybeIgnoreMouseButtonRelease = false; + } + } + break; +@@ -751,11 +753,9 @@ bool QComboBoxPrivateContainer::eventFil + maybeIgnoreMouseButtonRelease = false; + break; + case QEvent::MouseButtonRelease: { +- bool ignoreEvent = maybeIgnoreMouseButtonRelease && popupTimer.elapsed() < QApplication::doubleClickInterval(); +- + QMouseEvent *m = static_cast(e); + if (isVisible() && view->rect().contains(m->pos()) && view->currentIndex().isValid() +- && !blockMouseReleaseTimer.isActive() && !ignoreEvent ++ && !blockMouseReleaseTimer.isActive() && !maybeIgnoreMouseButtonRelease + && (view->currentIndex().flags() & Qt::ItemIsEnabled) + && (view->currentIndex().flags() & Qt::ItemIsSelectable)) { + combo->hidePopup(); +@@ -806,7 +806,8 @@ void QComboBoxPrivateContainer::mousePre + void QComboBoxPrivateContainer::mouseReleaseEvent(QMouseEvent *e) + { + Q_UNUSED(e); +- if (!blockMouseReleaseTimer.isActive()){ ++ bool ignoreEvent = popupTimer.elapsed() > QApplication::doubleClickInterval(); ++ if (!blockMouseReleaseTimer.isActive() && !ignoreEvent) { + combo->hidePopup(); + emit resetButton(); + } +@@ -2848,7 +2849,7 @@ void QComboBox::showPopup() + #endif + if (startTimer) { + container->popupTimer.start(); +- container->maybeIgnoreMouseButtonRelease = true; ++ container->maybeIgnoreMouseButtonRelease = usePopup; + } + } + +@@ -3161,13 +3161,6 @@ void QComboBoxPrivate::showPopupFromMouseEvent(QMouseEvent *e) + } + #endif + q->showPopup(); +- // The code below ensures that regular mousepress and pick item still works +- // If it was not called the viewContainer would ignore event since it didn't have +- // a mousePressEvent first. +- if (viewContainer()) { +- viewContainer()->blockMouseReleaseTimer.start(QApplication::doubleClickInterval()); +- viewContainer()->maybeIgnoreMouseButtonRelease = false; +- } + } else { + #ifdef QT_KEYPAD_NAVIGATION + if (QApplication::keypadNavigationEnabled() && sc == QStyle::SC_ComboBoxEditField && lineEdit) { + diff --git a/QTBUG-92366-Check-scrollbar-visibility-when-computing-QListView-Margins.patch b/QTBUG-92366-Check-scrollbar-visibility-when-computing-QListView-Margins.patch new file mode 100644 index 0000000000000000000000000000000000000000..f6faf8180fcb4fa2b41d7050b5a9d6171c6bf435 --- /dev/null +++ b/QTBUG-92366-Check-scrollbar-visibility-when-computing-QListView-Margins.patch @@ -0,0 +1,100 @@ +From 55241556c113b47b5cb58f8cf72d939eef9683f6 Mon Sep 17 00:00:00 2001 +From: root +Date: Tue, 5 Jul 2022 10:48:29 +0800 +Subject: [PATCH] + QTBUG-92366-Check-scrollbar-visibility-when-computing-QListView-Margins + +--- + src/widgets/itemviews/qlistview.cpp | 2 +- + .../itemviews/qlistview/tst_qlistview.cpp | 55 +++++++++++++++++++ + 2 files changed, 56 insertions(+), 1 deletion(-) + +diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp +index 2d33759d..764855d8 100644 +--- a/src/widgets/itemviews/qlistview.cpp ++++ b/src/widgets/itemviews/qlistview.cpp +@@ -1787,7 +1787,7 @@ void QListViewPrivate::prepareItemsLayout() + // maximumViewportSize() already takes scrollbar into account if policy is + // Qt::ScrollBarAlwaysOn but scrollbar extent must be deduced if policy + // is Qt::ScrollBarAsNeeded +- int verticalMargin = vbarpolicy==Qt::ScrollBarAsNeeded ++ int verticalMargin = (vbarpolicy == Qt::ScrollBarAsNeeded) && (flow == QListView::LeftToRight || vbar->isVisible()) + ? q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, nullptr, vbar) + frameAroundContents + : 0; + int horizontalMargin = hbarpolicy==Qt::ScrollBarAsNeeded +diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +index 941ff523..83856380 100644 +--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp ++++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +@@ -167,6 +167,7 @@ private slots: + void taskQTBUG_51086_skippingIndexesInSelectedIndexes(); + void taskQTBUG_47694_indexOutOfBoundBatchLayout(); + void itemAlignment(); ++ void spacingWithWordWrap(); + void internalDragDropMove_data(); + void internalDragDropMove(); + }; +@@ -2512,6 +2513,60 @@ void tst_QListView::taskQTBUG_47694_indexOutOfBoundBatchLayout() + view.scrollTo(model.index(batchSize - 1, 0)); + } + ++/*! ++ Verify fix for QTBUG-92366 ++*/ ++void tst_QListView::spacingWithWordWrap() ++{ ++ const int listViewResizeCount = 200; ++ QWidget window; ++ window.resize(300, 200); ++ QListView lv(&window); ++ ++ lv.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); ++ lv.setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); ++ lv.setFlow(QListView::TopToBottom); ++ lv.setWordWrap(true); ++ lv.setSpacing(0); ++ lv.setGeometry(0, 0, 200, 150); ++ ++ QStandardItem *it1 = new QStandardItem("qqqqqqqqqqqqqqqqqqqqq-ttttttttttttttttt"); ++ QStandardItem *it2 = new QStandardItem("qqqqqqqqqqqqqqqq-tttttttttttt"); ++ QStandardItemModel model; ++ lv.setModel(&model); ++ model.appendRow(it1); ++ model.appendRow(it2); ++ ++ window.show(); ++ QVERIFY(QTest::qWaitForWindowExposed(&window)); ++ ++ QVERIFY(!lv.verticalScrollBar()->isVisible()); ++ for (int i = 0; i < listViewResizeCount; ++i) { ++ lv.resize(lv.width() + 1, lv.height()); ++ QRect rectForRowOne = lv.visualRect(model.index(0, 0)); ++ QRect rectForRowTwo = lv.visualRect(model.index(1, 0)); ++ ++ QCOMPARE(rectForRowOne.y() + rectForRowOne.height(), rectForRowTwo.y()); ++ } ++ ++ lv.resize(200, 150); ++ const QStringList &stringList = generateList(QStringLiteral("Test_Abnormal_Spacing"), 30); ++ for (const QString &item_string : stringList) { ++ QStandardItem *item = new QStandardItem(item_string); ++ model.appendRow(item); ++ } ++ ++ // test whether the height of item is correct if the vbar is shown. ++ QTRY_VERIFY(lv.verticalScrollBar()->isVisible()); ++ for (int i = 0; i < listViewResizeCount; ++i) { ++ lv.resize(lv.width() + 1, lv.height()); ++ QRect rectForRowOne = lv.visualRect(model.index(0, 0)); ++ QRect rectForRowTwo = lv.visualRect(model.index(1, 0)); ++ ++ QCOMPARE(rectForRowOne.y() + rectForRowOne.height(), rectForRowTwo.y()); ++ } ++} ++ + void tst_QListView::itemAlignment() + { + auto item1 = new QStandardItem("111"); +-- +2.31.1 + diff --git a/QTBUG-92468-fix-qtextedit-cursor-drawn-incorrectly.patch b/QTBUG-92468-fix-qtextedit-cursor-drawn-incorrectly.patch new file mode 100644 index 0000000000000000000000000000000000000000..d2653c2e3e47e8395e202851b234dbf755610504 --- /dev/null +++ b/QTBUG-92468-fix-qtextedit-cursor-drawn-incorrectly.patch @@ -0,0 +1,28 @@ +Author: Tang Haixiang +Date: Tue Apr 20 14:10:57 2021 +0800 +Subject: fix Draw the cursor considering the descent is 0 +Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/342138 + +--- + +Index: qtbase-opensource-src/src/gui/text/qtextlayout.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/gui/text/qtextlayout.cpp ++++ qtbase-opensource-src/src/gui/text/qtextlayout.cpp +@@ -1325,13 +1325,13 @@ void QTextLayout::drawCursor(QPainter *p + bool rightToLeft = d->isRightToLeft(); + if (itm >= 0) { + const QScriptItem &si = d->layoutData->items.at(itm); +- if (si.ascent > 0) ++ if (si.ascent >= 0) + base = si.ascent; +- if (si.descent > 0) ++ if (si.descent >= 0) + descent = si.descent; + rightToLeft = si.analysis.bidiLevel % 2; + } +- qreal y = position.y() + (sl.y + sl.base() - base).toReal(); ++ qreal y = position.y() + (sl.y + sl.base() + sl.descent - base - descent).toReal(); + bool toggleAntialiasing = !(p->renderHints() & QPainter::Antialiasing) + && (p->transform().type() > QTransform::TxTranslate); + if (toggleAntialiasing) diff --git a/QTBUG-92583-fix-pagedown-behavior-and-pageup.patch b/QTBUG-92583-fix-pagedown-behavior-and-pageup.patch new file mode 100644 index 0000000000000000000000000000000000000000..99fedf585af20724a8daaeaf6a2bd8f818e238a4 --- /dev/null +++ b/QTBUG-92583-fix-pagedown-behavior-and-pageup.patch @@ -0,0 +1,147 @@ +From: Tang Haixiang +Date: Mon, May 31 13:24:30 2021 +0800 +Subject: Fix PageDown behavior and PageUP +Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/351728 + +--- + +Index: qtbase-opensource-src/src/widgets/itemviews/qlistview.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/widgets/itemviews/qlistview.cpp ++++ qtbase-opensource-src/src/widgets/itemviews/qlistview.cpp +@@ -1155,13 +1155,25 @@ QModelIndex QListView::moveCursor(Cursor + d->removeCurrentAndDisabled(&intersectVector, current); + } + return d->closestIndex(initialRect, intersectVector); +- case MovePageUp: +- // move current by (visibileRowCount - 1) items. +- // rect.translate(0, -rect.height()); will happen in the switch fallthrough for MoveUp. +- rect.moveTop(rect.top() - d->viewport->height() + 2 * rect.height()); +- if (rect.top() < rect.height()) +- rect.moveTop(rect.height()); +- Q_FALLTHROUGH(); ++ case MovePageUp: { ++ rect.moveTop(rect.top() - d->viewport->height() + 1 ); ++ if (rect.top() < rect.height()) { ++ rect.setTop(0); ++ rect.setBottom(1); ++ } ++ QModelIndex findindex = current; ++ while (intersectVector.isEmpty() ++ || rectForIndex(findindex).top() <= (rectForIndex(current).bottom() - d->viewport->rect().height()) ++ || rect.top() <= 0) { ++ rect.translate(0, 1); ++ if (rect.bottom() <= 0) { ++ return current; ++ } ++ intersectVector = d->intersectingSet(rect); ++ findindex = d->closestIndex(initialRect, intersectVector); ++ } ++ return findindex; ++ } + case MovePrevious: + case MoveUp: + while (intersectVector.isEmpty()) { +@@ -1184,13 +1196,26 @@ QModelIndex QListView::moveCursor(Cursor + d->removeCurrentAndDisabled(&intersectVector, current); + } + return d->closestIndex(initialRect, intersectVector); +- case MovePageDown: +- // move current by (visibileRowCount - 1) items. +- // rect.translate(0, rect.height()); will happen in the switch fallthrough for MoveDown. +- 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 MovePageDown: { ++ rect.moveTop(rect.top() + d->viewport->height() - 1 ); ++ if (rect.bottom() > contents.height() - rect.height()){ ++ rect.setTop(contents.height() - 1); ++ rect.setBottom(contents.height()); ++ } ++ QModelIndex index = current; ++ // index's bottom() - current's top() always <= (d->viewport->rect().height() ++ while (intersectVector.isEmpty() ++ || rectForIndex(index).bottom() >= (d->viewport->rect().height() + rectForIndex(current).top()) ++ || rect.bottom() > contents.height()) { ++ rect.translate(0, -1); ++ if (rect.top() >= contents.height()) { ++ return current; ++ } ++ intersectVector = d->intersectingSet(rect); ++ index = d->closestIndex(initialRect, intersectVector); ++ } ++ return index; ++ } + case MoveNext: + case MoveDown: + while (intersectVector.isEmpty()) { +Index: qtbase-opensource-src/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +=================================================================== +--- qtbase-opensource-src.orig/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp ++++ qtbase-opensource-src/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +@@ -93,6 +93,7 @@ private slots: + void moveCursor(); + void moveCursor2(); + void moveCursor3(); ++ void moveCursor4(); + void indexAt(); + void clicked(); + void singleSelectionRemoveRow(); +@@ -559,6 +560,56 @@ void tst_QListView::moveCursor3() + QCOMPARE(view.selectionModel()->currentIndex(), model.index(0, 0)); + } + ++void tst_QListView::moveCursor4() ++{ ++ int indexCount = 100; ++ PublicListView listView; ++ QStandardItemModel model; ++ for (int i = 0; i < 100; i++) ++ { ++ QStandardItem* item = new QStandardItem(QString("item 0%0").arg(i)); ++ QFont font = item->font(); ++ font.setPixelSize(14); ++ item->setFont(font); ++ model.appendRow(item); ++ } ++ QFont font = model.item(0)->font(); ++ font.setPixelSize(50); ++ font.setBold(true); ++ model.item(0)->setFont(font); ++ listView.setModel(&model); ++ listView.setFixedSize(200, 200); ++ listView.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); ++ listView.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); ++ listView.show(); ++ listView.selectionModel()->setCurrentIndex(model.index(0, 0), QItemSelectionModel::SelectCurrent); ++ ++ QModelIndex idx = listView.moveCursor(PublicListView::MovePageDown, Qt::NoModifier); ++ ++ int actualIndex = 0; ++ int indexHeight = 0; ++ while (indexHeight <= listView.viewport()->height()) { ++ indexHeight += listView.visualRect(model.item(actualIndex)->index()).height(); ++ actualIndex++; ++ } ++ QTRY_COMPARE(idx, model.index(actualIndex - 2, 0)); ++ idx = listView.moveCursor(PublicListView::MoveUp, Qt::NoModifier); ++ QTRY_COMPARE(idx, model.index(0, 0)); ++ ++ listView.setCurrentIndex(model.index(indexCount - 2, 0)); ++ idx = listView.moveCursor(PublicListView::MovePageDown, Qt::NoModifier); ++ QTRY_COMPARE(idx, model.index(99, 0)); ++ ++ listView.setCurrentIndex(model.index(3, 0)); ++ actualIndex = 3; ++ indexHeight = 0; ++ while (indexHeight <= listView.viewport()->height()) { ++ indexHeight += listView.visualRect(model.item(actualIndex)->index()).height(); ++ actualIndex++; ++ } ++ idx = listView.moveCursor(PublicListView::MovePageDown, Qt::NoModifier); ++ QTRY_COMPARE(idx, model.index(actualIndex - 2, 0)); ++} + + class QListViewShowEventListener : public QListView + { diff --git a/QTBUG-93742-fix-misplacement-of-placeholder-text-in-QLineEdit-with-RTL-content.patch b/QTBUG-93742-fix-misplacement-of-placeholder-text-in-QLineEdit-with-RTL-content.patch new file mode 100644 index 0000000000000000000000000000000000000000..ddae82df78bdd1c793f5c68120258f4fc3a3b58b --- /dev/null +++ b/QTBUG-93742-fix-misplacement-of-placeholder-text-in-QLineEdit-with-RTL-content.patch @@ -0,0 +1,45 @@ +Author: fanruijie +Date: Wed July 7 10:56:24 2021 +0800 +Subject: fix misplacement of placeholder text in QLineEdit with RTL content + +Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/350236 + +Index: qtbase-opensource-src/src/widgets/widgets/qlineedit_p.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/widgets/widgets/qlineedit_p.cpp ++++ qtbase-opensource-src/src/widgets/widgets/qlineedit_p.cpp +@@ -678,10 +678,18 @@ static int effectiveTextMargin(int defau + if (widgets.empty()) + return defaultMargin; + +- return defaultMargin + (parameters.margin + parameters.widgetWidth) * +- int(std::count_if(widgets.begin(), widgets.end(), ++ const auto visibleSideWidgetCount = std::count_if(widgets.begin(), widgets.end(), + [](const QLineEditPrivate::SideWidgetEntry &e) { +- return e.widget->isVisibleTo(e.widget->parentWidget()); })); ++#if QT_CONFIG(animation) ++ // a button that's fading out doesn't get any space ++ if (auto* iconButton = qobject_cast(e.widget)) ++ return iconButton->needsSpace(); ++ ++#endif ++ return e.widget->isVisibleTo(e.widget->parentWidget()); ++ }); ++ ++ return defaultMargin + (parameters.margin + parameters.widgetWidth) * visibleSideWidgetCount; + } + + int QLineEditPrivate::effectiveLeftTextMargin() const +Index: qtbase-opensource-src/src/widgets/widgets/qlineedit_p.h +=================================================================== +--- qtbase-opensource-src.orig/src/widgets/widgets/qlineedit_p.h ++++ qtbase-opensource-src/src/widgets/widgets/qlineedit_p.h +@@ -94,6 +94,8 @@ public: + + bool shouldHideWithText() const; + void setHideWithText(bool hide); ++ // m_wasHidden is true unless the button is fading out ++ bool needsSpace() const { return m_wasHidden; } + #endif + + protected: diff --git a/QTBUG-94248-Check-scrollbar-ScrollBarOverlap-when-computing-QListView-margins.patch b/QTBUG-94248-Check-scrollbar-ScrollBarOverlap-when-computing-QListView-margins.patch new file mode 100644 index 0000000000000000000000000000000000000000..f7cca0bea938476b5ff06fbb76ee84d50dc8d4a7 --- /dev/null +++ b/QTBUG-94248-Check-scrollbar-ScrollBarOverlap-when-computing-QListView-margins.patch @@ -0,0 +1,84 @@ +From c0f754214f5a9a9cc792ca245c6f873cc79ffb33 Mon Sep 17 00:00:00 2001 +From: root +Date: Tue, 5 Jul 2022 10:55:11 +0800 +Subject: [PATCH] + QTBUG-94248-Check-scrollbar-ScrollBarOverlap-when-computing-QListView-margins + +--- + src/widgets/itemviews/qlistview.cpp | 1 + + .../itemviews/qlistview/tst_qlistview.cpp | 31 +++++++++++++++++++ + 2 files changed, 32 insertions(+) + +diff --git a/src/widgets/itemviews/qlistview.cpp b/src/widgets/itemviews/qlistview.cpp +index 57bfdcde..99224f9c 100644 +--- a/src/widgets/itemviews/qlistview.cpp ++++ b/src/widgets/itemviews/qlistview.cpp +@@ -1823,6 +1823,7 @@ void QListViewPrivate::prepareItemsLayout() + // Qt::ScrollBarAlwaysOn but scrollbar extent must be deduced if policy + // is Qt::ScrollBarAsNeeded + int verticalMargin = (vbarpolicy == Qt::ScrollBarAsNeeded) && (flow == QListView::LeftToRight || vbar->isVisible()) ++ && !q->style()->pixelMetric(QStyle::PM_ScrollView_ScrollBarOverlap, nullptr, vbar) + ? q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, nullptr, vbar) + frameAroundContents + : 0; + int horizontalMargin = hbarpolicy==Qt::ScrollBarAsNeeded +diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +index d80cc6bd..46589dd7 100644 +--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp ++++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -168,6 +169,7 @@ private slots: + void taskQTBUG_51086_skippingIndexesInSelectedIndexes(); + void taskQTBUG_47694_indexOutOfBoundBatchLayout(); + void itemAlignment(); ++ void spacingWithWordWrap_data(); + void spacingWithWordWrap(); + void internalDragDropMove_data(); + void internalDragDropMove(); +@@ -2567,8 +2569,37 @@ void tst_QListView::taskQTBUG_47694_indexOutOfBoundBatchLayout() + /*! + Verify fix for QTBUG-92366 + */ ++void tst_QListView::spacingWithWordWrap_data() ++{ ++ QTest::addColumn("scrollBarOverlap"); ++ ++ QTest::addRow("Without overlap") << false; ++ QTest::addRow("With overlap") << true; ++} ++ + void tst_QListView::spacingWithWordWrap() + { ++ QFETCH(bool, scrollBarOverlap); ++ ++ class MyStyle : public QProxyStyle ++ { ++ bool scrollBarOverlap; ++ public: ++ MyStyle(bool scrollBarOverlap) : scrollBarOverlap(scrollBarOverlap) {} ++ ++ int pixelMetric(PixelMetric metric, const QStyleOption *option = nullptr, ++ const QWidget *widget = nullptr) const override{ ++ switch (metric) { ++ case QStyle::PM_ScrollView_ScrollBarOverlap: return scrollBarOverlap; ++ default: ++ break; ++ } ++ return QProxyStyle::pixelMetric(metric, option, widget); ++ } ++ }; ++ ++ QApplication::setStyle(new MyStyle(scrollBarOverlap)); ++ + const int listViewResizeCount = 200; + QWidget window; + window.resize(300, 200); +-- +2.31.1 + diff --git a/QTBUG-94538-fix-cursorTheme-update-issue.patch b/QTBUG-94538-fix-cursorTheme-update-issue.patch new file mode 100644 index 0000000000000000000000000000000000000000..923152431a955b6f10a05f0eaf3aa69b66117b3e --- /dev/null +++ b/QTBUG-94538-fix-cursorTheme-update-issue.patch @@ -0,0 +1,38 @@ +From: Tang Haixiang +Date: Fri, Jun 24 09:24:30 2021 +0800 +Subject: fix cursorTheme update issue +Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/354674 + +Index: qtbase-opensource-src/src/plugins/platforms/xcb/qxcbcursor.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/plugins/platforms/xcb/qxcbcursor.cpp ++++ qtbase-opensource-src/src/plugins/platforms/xcb/qxcbcursor.cpp +@@ -533,6 +533,8 @@ bool updateCursorTheme(void *dpy, const + Q_UNUSED(screen); + Q_UNUSED(name); + QXcbCursor *self = static_cast(handle); ++ self->m_cursorHash.clear(); ++ + updateCursorTheme(self->connection()->xlib_display(),property.toByteArray()); + } + +@@ -558,14 +560,17 @@ xcb_cursor_t QXcbCursor::createFontCurso + int cursorId = cursorIdForShape(cshape); + xcb_cursor_t cursor = XCB_NONE; + +- // Try Xcursor first ++ + #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) ++ if (m_screen->xSettings()->initialized()) ++ m_screen->xSettings()->registerCallbackForProperty("Gtk/CursorThemeName",cursorThemePropertyChanged,this); ++ ++ // Try Xcursor first + if (cshape >= 0 && cshape <= Qt::LastCursor) { + void *dpy = connection()->xlib_display(); + cursor = loadCursor(dpy, cshape); + if (!cursor && !m_gtkCursorThemeInitialized && m_screen->xSettings()->initialized()) { + QByteArray gtkCursorTheme = m_screen->xSettings()->setting("Gtk/CursorThemeName").toByteArray(); +- m_screen->xSettings()->registerCallbackForProperty("Gtk/CursorThemeName",cursorThemePropertyChanged,this); + if (updateCursorTheme(dpy,gtkCursorTheme)) { + cursor = loadCursor(dpy, cshape); + } diff --git a/QTBUG-94824-fix-placement-of-placeholder-text-in-QLineEdits-with-action-icons.patch b/QTBUG-94824-fix-placement-of-placeholder-text-in-QLineEdits-with-action-icons.patch new file mode 100644 index 0000000000000000000000000000000000000000..7730887dd0c0318b8c0d8c6a046f50df8f7e6834 --- /dev/null +++ b/QTBUG-94824-fix-placement-of-placeholder-text-in-QLineEdits-with-action-icons.patch @@ -0,0 +1,141 @@ +Author: fanruijie +Date: Thur July 8 11:34:24 2021 +0800 +Subject: Fix placement of placeholder text in QLineEdits with action icons + +Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/358205 + +Index: qtbase-opensource-src/src/widgets/widgets/qlineedit_p.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/widgets/widgets/qlineedit_p.cpp ++++ qtbase-opensource-src/src/widgets/widgets/qlineedit_p.cpp +@@ -412,8 +412,9 @@ void QLineEditIconButton::setHideWithTex + + void QLineEditIconButton::onAnimationFinished() + { +- if (shouldHideWithText() && isVisible() && !m_wasHidden) { ++ if (shouldHideWithText() && isVisible() && m_fadingOut) { + hide(); ++ m_fadingOut = false; + + // Invalidate previous geometry to take into account new size of side widgets + if (auto le = lineEditPrivate()) +@@ -423,7 +424,7 @@ void QLineEditIconButton::onAnimationFin + + void QLineEditIconButton::animateShow(bool visible) + { +- m_wasHidden = visible; ++ m_fadingOut = !visible; + + if (shouldHideWithText() && !isVisible()) { + show(); +Index: qtbase-opensource-src/src/widgets/widgets/qlineedit_p.h +=================================================================== +--- qtbase-opensource-src.orig/src/widgets/widgets/qlineedit_p.h ++++ qtbase-opensource-src/src/widgets/widgets/qlineedit_p.h +@@ -94,8 +94,11 @@ public: + + bool shouldHideWithText() const; + void setHideWithText(bool hide); +- // m_wasHidden is true unless the button is fading out +- bool needsSpace() const { return m_wasHidden; } ++ bool needsSpace() const { ++ if (m_fadingOut) ++ return false; ++ return isVisibleTo(parentWidget()); ++ } + #endif + + protected: +@@ -119,7 +122,7 @@ private: + + #if QT_CONFIG(animation) + bool m_hideWithText = false; +- bool m_wasHidden = false; ++ bool m_fadingOut = false; + #endif + + }; +Index: qtbase-opensource-src/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +=================================================================== +--- qtbase-opensource-src.orig/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp ++++ qtbase-opensource-src/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +@@ -294,6 +294,7 @@ private slots: + void clearButtonVisibleAfterSettingText_QTBUG_45518(); + void sideWidgets(); + void sideWidgetsActionEvents(); ++ void sideWidgetsEffectiveMargins(); + + void shouldShowPlaceholderText_data(); + void shouldShowPlaceholderText(); +@@ -4535,6 +4536,71 @@ void tst_QLineEdit::sideWidgetsActionEve + QCOMPARE(toolButton2->x(), toolButton1X); + } + ++/*! ++ Verify that side widgets are positioned correctly and result in ++ correct effective text margins. ++*/ ++void tst_QLineEdit::sideWidgetsEffectiveMargins() ++{ ++#ifndef QT_BUILD_INTERNAL ++ QSKIP("This test requires a developer build."); ++#else ++ QLineEdit edit; ++ edit.setPlaceholderText("placeholder"); ++ edit.setClearButtonEnabled(true); ++ edit.show(); ++ QLineEditPrivate *priv = QLineEditPrivate::get(&edit); ++ const auto sideWidgetParameters = priv->sideWidgetParameters(); ++ const int sideWidgetWidth = sideWidgetParameters.widgetWidth + sideWidgetParameters.margin; ++ QVERIFY(QTest::qWaitForWindowExposed(&edit)); ++ ++ QCOMPARE(priv->effectiveTextMargins().left(), 0); ++ QCOMPARE(priv->effectiveTextMargins().right(), 0); ++ ++ edit.setText("Left to right"); // clear button fades in on the right ++ QCOMPARE(priv->effectiveTextMargins().left(), 0); ++ QCOMPARE(priv->effectiveTextMargins().right(), sideWidgetWidth); ++ edit.clear(); ++ QCOMPARE(priv->effectiveTextMargins().left(), 0); ++ QCOMPARE(priv->effectiveTextMargins().right(), 0); ++ ++ edit.setLayoutDirection(Qt::RightToLeft); ++ edit.setText("ئۇيغۇر تىلى"); // clear button fades in on the left ++ QCOMPARE(priv->effectiveTextMargins().left(), sideWidgetWidth); ++ QCOMPARE(priv->effectiveTextMargins().right(), 0); ++ edit.clear(); ++ QCOMPARE(priv->effectiveTextMargins().left(), 0); ++ QCOMPARE(priv->effectiveTextMargins().right(), 0); ++ ++ edit.setLayoutDirection(Qt::LeftToRight); ++ ++ const QIcon leftIcon = edit.style()->standardIcon(QStyle::SP_FileIcon); ++ const QIcon rightIcon = edit.style()->standardIcon(QStyle::SP_DirIcon); ++ edit.addAction(leftIcon, QLineEdit::ActionPosition::LeadingPosition); ++ QCOMPARE(priv->effectiveTextMargins().left(), sideWidgetWidth); ++ QCOMPARE(priv->effectiveTextMargins().right(), 0); ++ ++ edit.addAction(rightIcon, QLineEdit::ActionPosition::TrailingPosition); ++ QCOMPARE(priv->effectiveTextMargins().left(), sideWidgetWidth); ++ QCOMPARE(priv->effectiveTextMargins().right(), sideWidgetWidth); ++ ++ edit.setText("Left to right"); // clear button on the right ++ QCOMPARE(priv->effectiveTextMargins().left(), sideWidgetWidth); ++ QCOMPARE(priv->effectiveTextMargins().right(), 2 * sideWidgetWidth); ++ edit.clear(); ++ QCOMPARE(priv->effectiveTextMargins().left(), sideWidgetWidth); ++ QCOMPARE(priv->effectiveTextMargins().right(), sideWidgetWidth); ++ ++ edit.setLayoutDirection(Qt::RightToLeft); ++ edit.setText("ئۇيغۇر تىلى"); // clear button fades in on the left ++ QCOMPARE(priv->effectiveTextMargins().left(), 2 * sideWidgetWidth); ++ QCOMPARE(priv->effectiveTextMargins().right(), sideWidgetWidth); ++ edit.clear(); ++ QCOMPARE(priv->effectiveTextMargins().left(), sideWidgetWidth); ++ QCOMPARE(priv->effectiveTextMargins().right(), sideWidgetWidth); ++#endif ++} ++ + Q_DECLARE_METATYPE(Qt::AlignmentFlag) + void tst_QLineEdit::shouldShowPlaceholderText_data() + { diff --git a/QTBUG-95011-do-not-change-layout-direction-on-keyboard-input.patch b/QTBUG-95011-do-not-change-layout-direction-on-keyboard-input.patch new file mode 100644 index 0000000000000000000000000000000000000000..3bd9ceb4bfa993685bb04b68f77a55f8fa99ea23 --- /dev/null +++ b/QTBUG-95011-do-not-change-layout-direction-on-keyboard-input.patch @@ -0,0 +1,23 @@ +Author: fanruijie +Date: Wed July 14 10:42:24 2021 +0800 +Subject: fix QColorDialog html do not translate + +Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/358558 + +Index: qtbase-opensource-src/src/widgets/widgets/qlineedit.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/widgets/widgets/qlineedit.cpp ++++ qtbase-opensource-src/src/widgets/widgets/qlineedit.cpp +@@ -1782,11 +1782,8 @@ void QLineEdit::keyPressEvent(QKeyEvent + } + #endif + d->control->processKeyEvent(event); +- if (event->isAccepted()) { +- if (layoutDirection() != d->control->layoutDirection()) +- setLayoutDirection(d->control->layoutDirection()); ++ if (event->isAccepted()) + d->control->updateCursorBlinking(); +- } + } + + /*! diff --git a/QTBUG-95341-Account-for-the-placeholderText-when-computing-lineRect.patch b/QTBUG-95341-Account-for-the-placeholderText-when-computing-lineRect.patch new file mode 100644 index 0000000000000000000000000000000000000000..b33c60c9d5cb87bd9c1829bb4a0b2dfe357bf53a --- /dev/null +++ b/QTBUG-95341-Account-for-the-placeholderText-when-computing-lineRect.patch @@ -0,0 +1,49 @@ +From 8f53d8ced4d81468121ad3dbb469095c2666eb46 Mon Sep 17 00:00:00 2001 +From: root +Date: Tue, 5 Jul 2022 11:13:27 +0800 +Subject: [PATCH] + QTBUG-95341-Account-for-the-placeholderText-when-computing-lineRect + +--- + src/widgets/widgets/qlineedit.cpp | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp +index 9e1d0d23..8227786d 100644 +--- a/src/widgets/widgets/qlineedit.cpp ++++ b/src/widgets/widgets/qlineedit.cpp +@@ -2032,21 +2032,28 @@ void QLineEdit::paintEvent(QPaintEvent *) + p.setClipRect(r); + + QFontMetrics fm = fontMetrics(); ++ int fmHeight = 0; ++ if (d->shouldShowPlaceholderText()) ++ fmHeight = fm.boundingRect(d->placeholderText).height(); ++ else ++ fmHeight = fm.boundingRect(d->control->text() + d->control->preeditAreaText()).height(); ++ fmHeight = qMax(fmHeight, fm.height()); ++ + Qt::Alignment va = QStyle::visualAlignment(d->control->layoutDirection(), QFlag(d->alignment)); + switch (va & Qt::AlignVertical_Mask) { + case Qt::AlignBottom: +- d->vscroll = r.y() + r.height() - fm.height() - QLineEditPrivate::verticalMargin; ++ d->vscroll = r.y() + r.height() - fmHeight - QLineEditPrivate::verticalMargin; + break; + case Qt::AlignTop: + d->vscroll = r.y() + QLineEditPrivate::verticalMargin; + break; + default: + //center +- d->vscroll = r.y() + (r.height() - fm.height() + 1) / 2; ++ d->vscroll = r.y() + (r.height() - fmHeight + 1) / 2; + break; + } + QRect lineRect(r.x() + QLineEditPrivate::horizontalMargin, d->vscroll, +- r.width() - 2 * QLineEditPrivate::horizontalMargin, fm.height()); ++ r.width() - 2 * QLineEditPrivate::horizontalMargin, fmHeight); + + if (d->shouldShowPlaceholderText()) { + if (!d->placeholderText.isEmpty()) { +-- +2.31.1 + diff --git a/QTBUG-95607-Close-all-popup-windows-when-the-screen-is-rotated.patch b/QTBUG-95607-Close-all-popup-windows-when-the-screen-is-rotated.patch new file mode 100644 index 0000000000000000000000000000000000000000..8805b2bd5bcea0cbceb6dd25bf2e008781de3435 --- /dev/null +++ b/QTBUG-95607-Close-all-popup-windows-when-the-screen-is-rotated.patch @@ -0,0 +1,58 @@ +Author: Tang Haixiang +Date: Fri Aug 13 9:22:24 2021 +0800 +Subject: Close all popup windows when the screen is rotated +Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/363462 + +--- + +Index: qtbase-opensource-src/src/widgets/kernel/qapplication.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/widgets/kernel/qapplication.cpp ++++ qtbase-opensource-src/src/widgets/kernel/qapplication.cpp +@@ -3050,8 +3050,10 @@ bool QApplication::notify(QObject *recei + + switch (e->type()) { + case QEvent::ApplicationDeactivate: +- // Close all popups (triggers when switching applications +- // by pressing ALT-TAB on Windows, which is not receive as key event. ++ case QEvent::OrientationChange: ++ // Close all popups (triggers when switching applications ++ // by pressing ALT-TAB on Windows, which is not receive as key event. ++ // triggers when the screen rotates.) + closeAllPopups(); + break; + case QEvent::Wheel: // User input and window activation makes tooltips sleep +Index: qtbase-opensource-src/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp +=================================================================== +--- qtbase-opensource-src.orig/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp ++++ qtbase-opensource-src/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp +@@ -127,6 +127,7 @@ private slots: + void menuSize_Scrolling(); + void tearOffMenuNotDisplayed(); + void QTBUG_61039_menu_shortcuts(); ++ void screenOrientationChangedCloseMenu(); + + protected slots: + void onActivated(QAction*); +@@ -1678,5 +1679,21 @@ void tst_QMenu::QTBUG_61039_menu_shortcu + QTRY_COMPARE(actionJoeSpy.count(), 1); + } + ++void tst_QMenu::screenOrientationChangedCloseMenu() ++{ ++ QMenu menu; ++ menu.addAction("action1"); ++ menu.show(); ++ menu.screen()->setOrientationUpdateMask(Qt::PortraitOrientation | Qt::LandscapeOrientation ++ | Qt::InvertedPortraitOrientation | Qt::InvertedLandscapeOrientation); ++ QTRY_COMPARE(menu.isVisible(),true); ++ ++ Qt::ScreenOrientation orientation = menu.screen()->orientation() == Qt::PortraitOrientation ? Qt::LandscapeOrientation : Qt::PortraitOrientation; ++ QScreenOrientationChangeEvent event(menu.screen(), orientation); ++ QCoreApplication::sendEvent(QCoreApplication::instance(), &event); ++ ++ QTRY_COMPARE(menu.isVisible(),false); ++} ++ + QTEST_MAIN(tst_QMenu) + #include "tst_qmenu.moc" diff --git a/QTBUG-95942-Fix-text-ellipsis-not-implemented-in-Tibetan.patch b/QTBUG-95942-Fix-text-ellipsis-not-implemented-in-Tibetan.patch new file mode 100644 index 0000000000000000000000000000000000000000..d2e01165ad6c44ac7cca60b5acf8f3fced7098e2 --- /dev/null +++ b/QTBUG-95942-Fix-text-ellipsis-not-implemented-in-Tibetan.patch @@ -0,0 +1,21 @@ +Author: Fan RuiJie +Date: Tue Aug 31 16:29:10 2021 +0800 +Subject: fix text ellipsis not implemented in Tibetan +Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/367457 + +Index: qtbase-opensource-src/src/gui/text/qtextengine.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/gui/text/qtextengine.cpp ++++ qtbase-opensource-src/src/gui/text/qtextengine.cpp +@@ -3219,6 +3219,11 @@ QString QTextEngine::elidedText(Qt::Text + + ellipsisWidth *= 3; + ellipsisText = QStringLiteral("..."); ++ } else { ++ engine = fnt.d->engineForScript(QChar::Script_Common); ++ glyph = engine->glyphIndex(ellipsisChar.unicode()); ++ engine->recalcAdvances(&glyphs, { }); ++ ellipsisText = ellipsisChar; + } + } + } diff --git a/QTBUG001-85978-85985-QLineEdit-Fix-the-problem-under-the-touch-screen.patch b/QTBUG001-85978-85985-QLineEdit-Fix-the-problem-under-the-touch-screen.patch new file mode 100644 index 0000000000000000000000000000000000000000..a99dc40d2c955196e86625f702fef2f547324036 --- /dev/null +++ b/QTBUG001-85978-85985-QLineEdit-Fix-the-problem-under-the-touch-screen.patch @@ -0,0 +1,187 @@ +From d458d0957b54bfee185ce0833a220e9ab20a718f Mon Sep 17 00:00:00 2001 +From: root +Date: Mon, 4 Jul 2022 18:10:03 +0800 +Subject: [PATCH] + QTBUG001-85978-85985-QLineEdit-Fix-the-problem-under-the-touch-screen + +--- + src/widgets/widgets/qlineedit.cpp | 52 ++++++++++++++++++++++++++++- + src/widgets/widgets/qlineedit.h | 1 + + src/widgets/widgets/qlineedit_p.cpp | 16 +++++++++ + src/widgets/widgets/qlineedit_p.h | 9 +++++ + 4 files changed, 77 insertions(+), 1 deletion(-) + +diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp +index 0c725693..f5b1e495 100644 +--- a/src/widgets/widgets/qlineedit.cpp ++++ b/src/widgets/widgets/qlineedit.cpp +@@ -1536,6 +1536,13 @@ bool QLineEdit::event(QEvent * e) + void QLineEdit::mousePressEvent(QMouseEvent* e) + { + Q_D(QLineEdit); ++ if (e->source() == Qt::MouseEventSynthesizedByQt) { ++ d->touchPress = true; ++ if (d->touchPopup) ++ d->touchPopup = false; ++ d->oldPosX = e->screenPos().x(); ++ } ++ + + d->mousePressPos = e->pos(); + +@@ -1569,7 +1576,14 @@ void QLineEdit::mousePressEvent(QMouseEvent* e) + } else + #endif + { +- d->control->moveCursor(cursor, mark); ++ if (d->touchPress) { ++ d->CurrentCursor = cursor; ++ d->modStateMark = mark; ++ QTimer::singleShot(QApplication::doubleClickInterval(), this, SLOT(_q_waitTouchPopup())); ++ } else { ++ d->control->moveCursor(cursor, mark); ++ } ++ + } + } + +@@ -1612,6 +1626,26 @@ void QLineEdit::mouseMoveEvent(QMouseEvent * e) + } else + #endif + { ++ if (d->oldPosX == 0) { ++ d->oldPosX = e->screenPos().x(); ++ return; ++ } ++ ++ if (d->doublePress) ++ return; ++ ++ // 1.0: Touch jitter causes the range of coordinates to change ++ if ((d->touchPress && !d->touchPopup) && (qAbs(e->screenPos().x() - d->oldPosX) < 1.0)) { ++ d->oldPosX = e->screenPos().x(); ++ return; ++ } ++ ++ d->oldPosX = e->screenPos().x(); ++ ++ //A long press under the touch screen will trigger Qt::MouseEventSource(MouseEventNotSynthesized) ++ if (d->touchPress && (e->screenPos().x() - (qreal)e->screenPos().toPoint().rx() == 0)) ++ return; ++ + d->control->moveCursor(d->xToPos(e->pos().x()), select); + } + } +@@ -1625,6 +1659,15 @@ void QLineEdit::mouseMoveEvent(QMouseEvent * e) + void QLineEdit::mouseReleaseEvent(QMouseEvent* e) + { + Q_D(QLineEdit); ++ if (e->source() == Qt::MouseEventSynthesizedByQt && d->touchPress) { ++ d->touchPress = false; ++ d->touchPopup = true; ++ if (d->doublePress) { ++ d->touchPopup = false; ++ d->doublePress = false; ++ } ++ } ++ + if (d->sendMouseEventToInputContext(e)) + return; + #if QT_CONFIG(draganddrop) +@@ -1657,6 +1700,8 @@ void QLineEdit::mouseReleaseEvent(QMouseEvent* e) + void QLineEdit::mouseDoubleClickEvent(QMouseEvent* e) + { + Q_D(QLineEdit); ++ if (e->source() == Qt::MouseEventSynthesizedByQt) ++ d->doublePress = true; + + if (e->button() == Qt::LeftButton) { + int position = d->xToPos(e->pos().x()); +@@ -2179,6 +2224,11 @@ void QLineEdit::dropEvent(QDropEvent* e) + */ + void QLineEdit::contextMenuEvent(QContextMenuEvent *event) + { ++ Q_D(QLineEdit); ++ d->touchPress = false; ++ d->touchPopup = false; ++ d->doublePress = false; ++ + if (QMenu *menu = createStandardContextMenu()) { + menu->setAttribute(Qt::WA_DeleteOnClose); + menu->popup(event->globalPos()); +diff --git a/src/widgets/widgets/qlineedit.h b/src/widgets/widgets/qlineedit.h +index 1cf1f244..4a575c13 100644 +--- a/src/widgets/widgets/qlineedit.h ++++ b/src/widgets/widgets/qlineedit.h +@@ -255,6 +255,7 @@ private: + Q_PRIVATE_SLOT(d_func(), void _q_handleWindowActivate()) + Q_PRIVATE_SLOT(d_func(), void _q_textEdited(const QString &)) + Q_PRIVATE_SLOT(d_func(), void _q_cursorPositionChanged(int, int)) ++ Q_PRIVATE_SLOT(d_func(), void _q_waitTouchPopup()) + #if QT_CONFIG(completer) + Q_PRIVATE_SLOT(d_func(), void _q_completionHighlighted(const QString &)) + #endif +diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp +index 413f1a44..ff293d53 100644 +--- a/src/widgets/widgets/qlineedit_p.cpp ++++ b/src/widgets/widgets/qlineedit_p.cpp +@@ -144,6 +144,15 @@ void QLineEditPrivate::_q_cursorPositionChanged(int from, int to) + emit q->cursorPositionChanged(from, to); + } + ++void QLineEditPrivate::_q_waitTouchPopup() ++{ ++ if (touchPopup) { ++ control->moveCursor(CurrentCursor, modStateMark); ++ touchPopup = false; ++ } ++} ++ ++ + #ifdef QT_KEYPAD_NAVIGATION + void QLineEditPrivate::_q_editFocusChange(bool e) + { +@@ -241,6 +250,13 @@ void QLineEditPrivate::init(const QString& txt) + + q->setAttribute(Qt::WA_MacShowFocusRect); + ++ touchPress = false; ++ touchPopup = false; ++ doublePress = false; ++ oldPosX = 0; ++ CurrentCursor = 0; ++ modStateMark = false; ++ + initMouseYThreshold(); + } + +diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h +index 5ae402b9..fcb52b47 100644 +--- a/src/widgets/widgets/qlineedit_p.h ++++ b/src/widgets/widgets/qlineedit_p.h +@@ -206,6 +206,14 @@ public: + uint clickCausedFocus : 1; + uint edited : 1; + int hscroll; ++ ++ int CurrentCursor; ++ bool touchPress; ++ bool touchPopup; ++ bool doublePress; ++ bool modStateMark; ++ qreal oldPosX ; ++ + int vscroll; + uint alignment; + static const int verticalMargin; +@@ -218,6 +226,7 @@ public: + void _q_handleWindowActivate(); + void _q_textEdited(const QString &); + void _q_cursorPositionChanged(int, int); ++ void _q_waitTouchPopup(); + #ifdef QT_KEYPAD_NAVIGATION + void _q_editFocusChange(bool); + #endif +-- +2.31.1 + diff --git a/QTBUG002-85088-QGraphicsView-show-error-after-lose-focus.patch b/QTBUG002-85088-QGraphicsView-show-error-after-lose-focus.patch new file mode 100644 index 0000000000000000000000000000000000000000..84fb0e1eea942a74b2ab2567d7c93cc57339f897 --- /dev/null +++ b/QTBUG002-85088-QGraphicsView-show-error-after-lose-focus.patch @@ -0,0 +1,95 @@ +From 24149dcbfa0c63d8429cdbb5cc249ad4beada387 Mon Sep 17 00:00:00 2001 +From: root +Date: Mon, 4 Jul 2022 18:30:01 +0800 +Subject: [PATCH] QTBUG002-85088-QGraphicsView-show-error-after-lose-focus + +--- + src/widgets/graphicsview/qgraphicsscene.cpp | 9 ++++- + .../qgraphicsscene/tst_qgraphicsscene.cpp | 37 ++++++++++++++++++- + 2 files changed, 43 insertions(+), 3 deletions(-) + +diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp +index a428329a..75199f84 100644 +--- a/src/widgets/graphicsview/qgraphicsscene.cpp ++++ b/src/widgets/graphicsview/qgraphicsscene.cpp +@@ -4230,8 +4230,13 @@ void QGraphicsScene::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent) + void QGraphicsScene::inputMethodEvent(QInputMethodEvent *event) + { + Q_D(QGraphicsScene); +- if (d->focusItem && (d->focusItem->flags() & QGraphicsItem::ItemAcceptsInputMethod)) +- d->sendEvent(d->focusItem, event); ++ if (d->focusItem && (d->focusItem->flags() & QGraphicsItem::ItemAcceptsInputMethod)) { ++ d->sendEvent(d->focusItem, event); ++ return; ++ } ++ if (d->lastFocusItem && d->lastFocusItem != d->focusItem && (d->lastFocusItem->flags() & QGraphicsItem::ItemAcceptsInputMethod)) ++ d->sendEvent(d->lastFocusItem, event); ++ + } + + /*! +diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +index 7e5d94da..c3e49131 100644 +--- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp ++++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp +@@ -289,6 +289,7 @@ private slots: + void taskQTBUG_15977_renderWithDeviceCoordinateCache(); + void taskQTBUG_16401_focusItem(); + void taskQTBUG_42915_focusNextPrevChild(); ++ void taskQTBUG_85088_previewTextfailWhenLostFocus(); + + private: + QRect m_availableGeometry = QGuiApplication::primaryScreen()->availableGeometry(); +@@ -3868,7 +3869,7 @@ void tst_QGraphicsScene::inputMethod() + + item->eventCalls = 0; + QCoreApplication::sendEvent(&scene, &event); +- QCOMPARE(item->eventCalls, 0); ++ QCOMPARE(item->eventCalls, callFocusItem ? 1 : 0); + + item->queryCalls = 0; + scene.inputMethodQuery(Qt::InputMethodQuery(0)); +@@ -3943,6 +3944,40 @@ void tst_QGraphicsScene::dispatchHoverOnPress() + } + } + ++void tst_QGraphicsScene::taskQTBUG_85088_previewTextfailWhenLostFocus() ++{ ++ QString str = "simpleTextItem"; ++ QGraphicsScene scene; ++ QGraphicsView view(&scene); ++ ++ QGraphicsTextItem *simpleTextItem = new QGraphicsTextItem; ++ simpleTextItem->setFlag(QGraphicsTextItem::ItemIsFocusScope); ++ simpleTextItem->setTextInteractionFlags(Qt::TextEditorInteraction); ++ simpleTextItem->setPlainText(str); ++ scene.addItem(simpleTextItem); ++ ++ scene.setFocusItem(simpleTextItem); ++ view.setGeometry(100, 100, 600, 400); ++ view.show(); ++ ++ QInputMethodEvent inputEvent; ++ QString &preedictStr = const_cast(inputEvent.preeditString()); ++ preedictStr = str; ++ QApplication::sendEvent(&scene, &inputEvent); ++ QCOMPARE(simpleTextItem->toPlainText(), str); ++ ++ // focusItem will lose focus ++ QMouseEvent pressEvent(QEvent::MouseButtonPress, QPointF(0, 0), ++ Qt::LeftButton, Qt::NoButton, Qt::NoModifier); ++ QApplication::sendEvent(view.viewport(), &pressEvent); ++ ++ preedictStr.clear(); ++ inputEvent.setCommitString(str); ++ QApplication::sendEvent(&scene, &inputEvent); ++ QCOMPARE(simpleTextItem->toPlainText(), str + str); ++} ++ ++ + void tst_QGraphicsScene::initialFocus_data() + { + QTest::addColumn("activeScene"); +-- +2.31.1 + diff --git a/QTBUG003-86846-Fixed-the-password-box-not-refreshed-under-Chinese-input-method.patch b/QTBUG003-86846-Fixed-the-password-box-not-refreshed-under-Chinese-input-method.patch new file mode 100644 index 0000000000000000000000000000000000000000..55a0f0e0bbb453e51e71ef2c2d1efbfbb9999baa --- /dev/null +++ b/QTBUG003-86846-Fixed-the-password-box-not-refreshed-under-Chinese-input-method.patch @@ -0,0 +1,25 @@ +From 6e12b24d070f58e619f089c40b6141305ac182e0 Mon Sep 17 00:00:00 2001 +From: root +Date: Mon, 4 Jul 2022 20:43:34 +0800 +Subject: [PATCH] + QTBUG003-86846-Fixed-the-password-box-not-refreshed-under-Chinese-input-method + +--- + src/widgets/widgets/qlineedit.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp +index f5b1e495..d568a1e0 100644 +--- a/src/widgets/widgets/qlineedit.cpp ++++ b/src/widgets/widgets/qlineedit.cpp +@@ -1948,6 +1948,7 @@ void QLineEdit::focusInEvent(QFocusEvent *e) + selectAll(); + } else if (e->reason() == Qt::MouseFocusReason) { + d->clickCausedFocus = 1; ++ updateMicroFocus(); + } + #ifdef QT_KEYPAD_NAVIGATION + if (!QApplicationPrivate::keypadNavigationEnabled() || (hasEditFocus() && ( e->reason() == Qt::PopupFocusReason))) { +-- +2.31.1 + diff --git a/QTBUG007-88227-Fix-regular-expression-initialize-with-incorrect-filters.patch b/QTBUG007-88227-Fix-regular-expression-initialize-with-incorrect-filters.patch new file mode 100644 index 0000000000000000000000000000000000000000..a0f16000ba9aca76e3b3989657980812787f217c --- /dev/null +++ b/QTBUG007-88227-Fix-regular-expression-initialize-with-incorrect-filters.patch @@ -0,0 +1,39 @@ +From 41cc42a09efb365a1c0412dbfa4bf5db54477a5b Mon Sep 17 00:00:00 2001 +From: root +Date: Tue, 5 Jul 2022 09:45:00 +0800 +Subject: [PATCH] + QTBUG007-88227-Fix-regular-expression-initialize-with-incorrect-filters + +--- + src/corelib/io/qdiriterator.cpp | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp +index 7411eab6..c58dde8b 100644 +--- a/src/corelib/io/qdiriterator.cpp ++++ b/src/corelib/io/qdiriterator.cpp +@@ -125,7 +125,7 @@ class QDirIteratorPrivate + { + public: + QDirIteratorPrivate(const QFileSystemEntry &entry, const QStringList &nameFilters, +- QDir::Filters filters, QDirIterator::IteratorFlags flags, bool resolveEngine = true); ++ QDir::Filters _filters, QDirIterator::IteratorFlags flags, bool resolveEngine = true); + + void advance(); + +@@ -164,10 +164,10 @@ public: + \internal + */ + QDirIteratorPrivate::QDirIteratorPrivate(const QFileSystemEntry &entry, const QStringList &nameFilters, +- QDir::Filters filters, QDirIterator::IteratorFlags flags, bool resolveEngine) ++ QDir::Filters _filters, QDirIterator::IteratorFlags flags, bool resolveEngine) + : dirEntry(entry) + , nameFilters(nameFilters.contains(QLatin1String("*")) ? QStringList() : nameFilters) +- , filters(QDir::NoFilter == filters ? QDir::AllEntries : filters) ++ , filters(QDir::NoFilter == _filters ? QDir::AllEntries : _filters) + , iteratorFlags(flags) + { + #if defined(QT_BOOTSTRAPPED) +-- +2.31.1 + diff --git a/QTBUG008-89578-QLineEdit-cursor-show-white-area-when-set-inputMask.patch b/QTBUG008-89578-QLineEdit-cursor-show-white-area-when-set-inputMask.patch new file mode 100644 index 0000000000000000000000000000000000000000..7026cc0da37ee33ecde5eb1668e6e4d54b783422 --- /dev/null +++ b/QTBUG008-89578-QLineEdit-cursor-show-white-area-when-set-inputMask.patch @@ -0,0 +1,32 @@ +From bd7da753fe76bbe8ce55d2bdc9b9c765b957f6f9 Mon Sep 17 00:00:00 2001 +From: root +Date: Tue, 5 Jul 2022 09:48:04 +0800 +Subject: [PATCH] + QTBUG008-89578-QLineEdit-cursor-show-white-area-when-set-inputMask + +--- + src/widgets/widgets/qlineedit.cpp | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp +index d568a1e0..70d27b58 100644 +--- a/src/widgets/widgets/qlineedit.cpp ++++ b/src/widgets/widgets/qlineedit.cpp +@@ -2128,9 +2128,12 @@ void QLineEdit::paintEvent(QPaintEvent *) + + // Asian users see an IM selection text as cursor on candidate + // selection phase of input method, so the ordinary cursor should be +- // invisible if we have a preedit string. +- if (d->cursorVisible && !d->control->isReadOnly()) ++ // invisible if we have a preedit string. another condition is when inputmask ++ // isn't empty,we don't need draw cursor,because cursor and character overlaping ++ // area is white. ++ if (d->cursorVisible && !d->control->isReadOnly() && d->control->inputMask().isEmpty()) + flags |= QWidgetLineControl::DrawCursor; ++ + + d->control->setCursorWidth(style()->pixelMetric(QStyle::PM_TextCursorWidth, &panel)); + d->control->draw(&p, topLeft, r, flags); +-- +2.31.1 + diff --git a/StyleSheetStyle-fix-distorted-hiDPI-pngs.patch b/StyleSheetStyle-fix-distorted-hiDPI-pngs.patch new file mode 100644 index 0000000000000000000000000000000000000000..26ced6b19d65011e05baf5242448446d9f04a738 --- /dev/null +++ b/StyleSheetStyle-fix-distorted-hiDPI-pngs.patch @@ -0,0 +1,26 @@ +diff -Naur a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp +--- a/src/widgets/styles/qstylesheetstyle.cpp 2021-08-11 11:36:05.811389639 +0800 ++++ b/src/widgets/styles/qstylesheetstyle.cpp 2021-08-11 13:32:16.259120027 +0800 +@@ -6133,11 +6133,19 @@ + else + ratio = 1.0; + } +- ++ + qreal sourceDevicePixelRatio = 1.0; +- QString resolvedFileName = qt_findAtNxFile(fileName, ratio, &sourceDevicePixelRatio); ++ qreal devicePixelRatio = qApp->devicePixelRatio(); ++ QString resolvedFileName = qt_findAtNxFile(fileName, devicePixelRatio, &sourceDevicePixelRatio); + QPixmap pixmap(resolvedFileName); +- pixmap.setDevicePixelRatio(sourceDevicePixelRatio); ++ if (sourceDevicePixelRatio > 1.0) { ++ pixmap = pixmap.scaled(devicePixelRatio / sourceDevicePixelRatio * pixmap.width(), ++ devicePixelRatio / sourceDevicePixelRatio * pixmap.height(), ++ Qt::IgnoreAspectRatio, Qt::SmoothTransformation); ++ pixmap.setDevicePixelRatio(devicePixelRatio); ++ } else { ++ pixmap.setDevicePixelRatio(sourceDevicePixelRatio); ++ } + return pixmap; + } + diff --git a/armv4.diff b/armv4.diff new file mode 100644 index 0000000000000000000000000000000000000000..9d0cad753f6840ce515fccb28db3f2f1b602f989 --- /dev/null +++ b/armv4.diff @@ -0,0 +1,35 @@ +From e2bc11edb30fbfb8ff2f8ff74b83e7d81dd98498 Mon Sep 17 00:00:00 2001 +From: root +Date: Tue, 5 Jul 2022 15:31:49 +0800 +Subject: [PATCH] armv4 + +--- + src/corelib/global/qprocessordetection.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h +index 99adb3e3..54958584 100644 +--- a/src/corelib/global/qprocessordetection.h ++++ b/src/corelib/global/qprocessordetection.h +@@ -144,6 +144,8 @@ + # elif defined(__ARM_ARCH_5TEJ__) \ + || defined(__ARM_ARCH_5TE__) + # define Q_PROCESSOR_ARM 5 ++# elif defined(__ARM_ARCH_4T__) ++# define Q_PROCESSOR_ARM 4 + # else + # define Q_PROCESSOR_ARM 0 + # endif +@@ -158,6 +160,9 @@ + # endif + # if Q_PROCESSOR_ARM >= 5 + # define Q_PROCESSOR_ARM_V5 ++# endif ++# if Q_PROCESSOR_ARM >= 4 ++# define Q_PROCESSOR_ARM_V4 + # else + # error "ARM architecture too old" + # endif +-- +2.31.1 + diff --git a/cross_build_mysql.diff b/cross_build_mysql.diff new file mode 100644 index 0000000000000000000000000000000000000000..9d5ce09c6c6aa2edff5547231ac34ab9d0a4184f --- /dev/null +++ b/cross_build_mysql.diff @@ -0,0 +1,20 @@ +Description: call pkgconfig in order to be able to cross build qtbase with MySql. + Qt's build system calls mysql_config... which won't work in a cross build + environment like Debian's, as it will throw an exec format error. + . + In order to solve this call pkgconfig and use mysqlclient.pc. +Author: Helmut Grohne +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=971604 +Forwarded: not-needed +Reviewed-by: Lisandro Damián Nicanor Pérez Meyer + +--- qtbase-opensource-src-5.14.2+dfsg.orig/src/plugins/sqldrivers/configure.json ++++ qtbase-opensource-src-5.14.2+dfsg/src/plugins/sqldrivers/configure.json +@@ -67,6 +67,7 @@ + }, + "headers": "mysql.h", + "sources": [ ++ { "type": "pkgConfig", "args": "mysqlclient" }, + { "type": "mysqlConfig", "query": "--libs_r", "cleanlibs": true }, + { "type": "mysqlConfig", "query": "--libs", "cleanlibs": true }, + { "type": "mysqlConfig", "query": "--libs_r", "cleanlibs": false }, diff --git a/dnot_add_application_path_to_library_path_for_default.patch b/dnot_add_application_path_to_library_path_for_default.patch new file mode 100644 index 0000000000000000000000000000000000000000..6d4c4596f6dae6210a50cce2abafbb18ece439e5 --- /dev/null +++ b/dnot_add_application_path_to_library_path_for_default.patch @@ -0,0 +1,37 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + qtbase-opensource-src (5.11.3+dfsg1-1) unstable; urgency=medium + . + * Repack the tarball and strip some files and directories with copyright + issues (closes: #924599). +Author: Dmitry Shachnev + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: 2019-07-26 + +--- qtbase-opensource-src-5.11.3+dfsg1.orig/src/corelib/kernel/qcoreapplication.cpp ++++ qtbase-opensource-src-5.11.3+dfsg1/src/corelib/kernel/qcoreapplication.cpp +@@ -581,6 +581,8 @@ void QCoreApplicationPrivate::checkRecei + + void QCoreApplicationPrivate::appendApplicationPathToLibraryPaths() + { ++ if (!qEnvironmentVariableIsSet("Q_ADD_APPLICATION_PATH_TO_LIBRARY_PATH")) ++ return; + #if QT_CONFIG(library) + QStringList *app_libpaths = coreappdata()->app_libpaths.data(); + if (!app_libpaths) diff --git a/feat-touch-screen-QListView-sliding-acceleration.patch b/feat-touch-screen-QListView-sliding-acceleration.patch new file mode 100644 index 0000000000000000000000000000000000000000..835c28b3f582cf9f6618353fa1a083c7e8508b54 --- /dev/null +++ b/feat-touch-screen-QListView-sliding-acceleration.patch @@ -0,0 +1,109 @@ +Index: qtbase-opensource-src/src/widgets/itemviews/qabstractitemview.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/widgets/itemviews/qabstractitemview.cpp ++++ qtbase-opensource-src/src/widgets/itemviews/qabstractitemview.cpp +@@ -1668,6 +1668,11 @@ bool QAbstractItemView::event(QEvent *ev + case QEvent::FontChange: + d->doDelayedItemsLayout(); // the size of the items will change + break; ++ case QEvent::Scroll: ++ if (static_cast(event)->scrollState() == QScrollEvent::ScrollFinished && QScroller::hasScroller(this)) ++ if (QScroller::scroller(this)->state() == QScroller::State::Inactive) ++ QScroller::scroller(this)->deleteLater(); ++ break; + default: + break; + } +@@ -1753,6 +1758,21 @@ bool QAbstractItemView::viewportEvent(QE + void QAbstractItemView::mousePressEvent(QMouseEvent *event) + { + Q_D(QAbstractItemView); ++ ++ if (event->source() == Qt::MouseEventSynthesizedByQt) { ++ if (event->button() == Qt::LeftButton) { ++ ++ if (QScroller::hasScroller(this)) { ++ QScroller::scroller(this)->deleteLater(); ++ } ++ d->touchSlideTimer.start(QApplication::doubleClickInterval(), this); ++ } ++ } else { ++ if (QScroller::hasScroller(this)) { ++ QScroller::scroller(this)->deleteLater(); ++ } ++ } ++ + d->delayedAutoScroll.stop(); //any interaction with the view cancel the auto scrolling + QPoint pos = event->pos(); + QPersistentModelIndex index = indexAt(pos); +@@ -1819,6 +1839,35 @@ void QAbstractItemView::mousePressEvent( + void QAbstractItemView::mouseMoveEvent(QMouseEvent *event) + { + Q_D(QAbstractItemView); ++ ++ if (event->source() == Qt::MouseEventSynthesizedByQt) { ++ if (QScroller::hasScroller(this)) { ++ return; ++ } ++ ++ if (d->touchSlideTimer.isActive()) { ++ QMargins margins= viewportMargins(); ++ QPoint pos = event->pos(); ++ pos = pos + QPoint(margins.left(),margins.top()); ++ if ((d->pressedPosition - d->offset() - pos).manhattanLength() > 1.5 * QApplication::startDragDistance()) { ++ this->setVerticalScrollMode(ScrollPerPixel); ++ this->setHorizontalScrollMode(ScrollPerPixel); ++ QScroller::grabGesture(this, QScroller::LeftMouseButtonGesture); ++ ++ QScroller *scroller = QScroller::scroller(this); ++ scroller->handleInput(QScroller::InputPress, pos, static_cast(event->timestamp())); ++ scroller->handleInput(QScroller::InputMove, pos, static_cast(event->timestamp())); ++ ++ } ++ return; ++ } ++ } else { ++ if (QScroller::hasScroller(this)) { ++ QScroller::ungrabGesture(this); ++ QScroller::scroller(this)->deleteLater(); ++ } ++ } ++ + QPoint topLeft; + QPoint bottomRight = event->pos(); + +@@ -2541,6 +2590,8 @@ void QAbstractItemView::timerEvent(QTime + doAutoScroll(); + else if (event->timerId() == d->updateTimer.timerId()) + d->updateDirtyRegion(); ++ else if (event->timerId() == d->touchSlideTimer.timerId()) ++ d->touchSlideTimer.stop(); + else if (event->timerId() == d->delayedEditing.timerId()) { + d->delayedEditing.stop(); + edit(currentIndex()); +@@ -4103,7 +4154,12 @@ QItemSelectionModel::SelectionFlags QAbs + return QItemSelectionModel::Toggle|selectionBehaviorFlags(); + if (state == QAbstractItemView::DragSelectingState) { + //when drag-selecting we need to clear any previous selection and select the current one +- return QItemSelectionModel::Clear|QItemSelectionModel::SelectCurrent|selectionBehaviorFlags(); ++ ++ //fix multiple selection of QListView under touch screen and long press function conflict ++ if(event && event->type() == QEvent::MouseButtonPress) ++ return QItemSelectionModel::ClearAndSelect|selectionBehaviorFlags(); ++ else ++ return QItemSelectionModel::Clear|QItemSelectionModel::SelectCurrent|selectionBehaviorFlags(); + } + + return QItemSelectionModel::ClearAndSelect|selectionBehaviorFlags(); +Index: qtbase-opensource-src/src/widgets/itemviews/qabstractitemview_p.h +=================================================================== +--- qtbase-opensource-src.orig/src/widgets/itemviews/qabstractitemview_p.h ++++ qtbase-opensource-src/src/widgets/itemviews/qabstractitemview_p.h +@@ -432,6 +432,7 @@ public: + QBasicTimer delayedEditing; + QBasicTimer delayedAutoScroll; //used when an item is clicked + QBasicTimer delayedReset; ++ QBasicTimer touchSlideTimer; + + QAbstractItemView::ScrollMode verticalScrollMode; + QAbstractItemView::ScrollMode horizontalScrollMode; diff --git a/fix-Clicking-the-left-and-right-buttons-crash.patch b/fix-Clicking-the-left-and-right-buttons-crash.patch new file mode 100644 index 0000000000000000000000000000000000000000..2885d7496961c0c67ddb7eca188ae9db1732889a --- /dev/null +++ b/fix-Clicking-the-left-and-right-buttons-crash.patch @@ -0,0 +1,30 @@ +From c4aba54472a19a57adbc5bb0111b3c55c3b9043b Mon Sep 17 00:00:00 2001 +From: luyaning +Date: Thu, 4 Jun 2020 14:24:00 +0800 +Subject: [PATCH] fix:Clicking the left and right buttons simultaneously causes + a crash + +--- + src/platformsupport/linuxaccessibility/atspiadaptor.cpp | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +index 580cf0e3..235bd715 100644 +--- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp ++++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp +@@ -803,6 +803,12 @@ void AtSpiAdaptor::windowActivated(QObject* window, bool active) + return; + + QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(window); ++ /*! ++ The window has been quickly activated or disabled will cause a crash. ++ */ ++ if (iface == nullptr) ++ return; ++ + Q_ASSERT(iface); + Q_ASSERT(!active || iface->isValid()); + +-- +2.20.1 + diff --git a/fix-QLineEdit-cursor-jumping-on-touch-screen.patch b/fix-QLineEdit-cursor-jumping-on-touch-screen.patch new file mode 100644 index 0000000000000000000000000000000000000000..0c12e2c716a88aa90136c45ffac02490a4fbe692 --- /dev/null +++ b/fix-QLineEdit-cursor-jumping-on-touch-screen.patch @@ -0,0 +1,135 @@ +From 1ac5b8f6afbc441aa6cc2a1c81a604108eb11ee3 Mon Sep 17 00:00:00 2001 +From: root +Date: Tue, 5 Jul 2022 11:07:10 +0800 +Subject: [PATCH] fix-QLineEdit-cursor-jumping-on-touch-screen + +--- + src/widgets/widgets/qlineedit.cpp | 21 ++++++++++++--------- + src/widgets/widgets/qlineedit_p.cpp | 7 ------- + src/widgets/widgets/qlineedit_p.h | 4 +--- + 3 files changed, 13 insertions(+), 19 deletions(-) + +diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp +index 70d27b58..ae089ed5 100644 +--- a/src/widgets/widgets/qlineedit.cpp ++++ b/src/widgets/widgets/qlineedit.cpp +@@ -1477,6 +1477,8 @@ bool QLineEdit::event(QEvent * e) + } + else if (timerId == d->tripleClickTimer.timerId()) + d->tripleClickTimer.stop(); ++ else if (timerId == d->popupClickTimer.timerId()) ++ d->popupClickTimer.stop(); + } else if (e->type() == QEvent::ContextMenu) { + #ifndef QT_NO_IM + if (d->control->composeMode()) +@@ -1538,8 +1540,6 @@ void QLineEdit::mousePressEvent(QMouseEvent* e) + Q_D(QLineEdit); + if (e->source() == Qt::MouseEventSynthesizedByQt) { + d->touchPress = true; +- if (d->touchPopup) +- d->touchPopup = false; + d->oldPosX = e->screenPos().x(); + } + +@@ -1577,9 +1577,11 @@ void QLineEdit::mousePressEvent(QMouseEvent* e) + #endif + { + if (d->touchPress) { +- d->CurrentCursor = cursor; +- d->modStateMark = mark; +- QTimer::singleShot(QApplication::doubleClickInterval(), this, SLOT(_q_waitTouchPopup())); ++ if(selectionLength() == 0) { ++ d->control->moveCursor(cursor, mark); ++ }else { ++ d->popupClickTimer.start(QApplication::doubleClickInterval(), this); ++ } + } else { + d->control->moveCursor(cursor, mark); + } +@@ -1635,7 +1637,7 @@ void QLineEdit::mouseMoveEvent(QMouseEvent * e) + return; + + // 1.0: Touch jitter causes the range of coordinates to change +- if ((d->touchPress && !d->touchPopup) && (qAbs(e->screenPos().x() - d->oldPosX) < 1.0)) { ++ if (d->touchPress && (qAbs(e->screenPos().x() - d->oldPosX) < 1.0)) { + d->oldPosX = e->screenPos().x(); + return; + } +@@ -1661,11 +1663,13 @@ void QLineEdit::mouseReleaseEvent(QMouseEvent* e) + Q_D(QLineEdit); + if (e->source() == Qt::MouseEventSynthesizedByQt && d->touchPress) { + d->touchPress = false; +- d->touchPopup = true; + if (d->doublePress) { +- d->touchPopup = false; + d->doublePress = false; + } ++ //Press is triggered when the status is selected. Short press is normally triggered if the status is not long pressed ++ if (d->popupClickTimer.isActive()) { ++ d->control->moveCursor(d->xToPos(e->pos().x())); ++ } + } + + if (d->sendMouseEventToInputContext(e)) +@@ -2230,7 +2234,6 @@ void QLineEdit::contextMenuEvent(QContextMenuEvent *event) + { + Q_D(QLineEdit); + d->touchPress = false; +- d->touchPopup = false; + d->doublePress = false; + + if (QMenu *menu = createStandardContextMenu()) { +diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp +index f1c49d45..231892f2 100644 +--- a/src/widgets/widgets/qlineedit_p.cpp ++++ b/src/widgets/widgets/qlineedit_p.cpp +@@ -146,10 +146,6 @@ void QLineEditPrivate::_q_cursorPositionChanged(int from, int to) + + void QLineEditPrivate::_q_waitTouchPopup() + { +- if (touchPopup) { +- control->moveCursor(CurrentCursor, modStateMark); +- touchPopup = false; +- } + } + + +@@ -251,11 +247,8 @@ void QLineEditPrivate::init(const QString& txt) + q->setAttribute(Qt::WA_MacShowFocusRect); + + touchPress = false; +- touchPopup = false; + doublePress = false; + oldPosX = 0; +- CurrentCursor = 0; +- modStateMark = false; + + initMouseYThreshold(); + } +diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h +index fcb52b47..406f0d39 100644 +--- a/src/widgets/widgets/qlineedit_p.h ++++ b/src/widgets/widgets/qlineedit_p.h +@@ -199,6 +199,7 @@ public: + + QPoint tripleClick; + QBasicTimer tripleClickTimer; ++ QBasicTimer popupClickTimer; + uint frame : 1; + uint contextMenuEnabled : 1; + uint cursorVisible : 1; +@@ -207,11 +208,8 @@ public: + uint edited : 1; + int hscroll; + +- int CurrentCursor; + bool touchPress; +- bool touchPopup; + bool doublePress; +- bool modStateMark; + qreal oldPosX ; + + int vscroll; +-- +2.31.1 + diff --git a/fix-QListView-singal-slip.patch b/fix-QListView-singal-slip.patch new file mode 100644 index 0000000000000000000000000000000000000000..60fd136a230892fdfdafbc88a9a6547ae5a586ba --- /dev/null +++ b/fix-QListView-singal-slip.patch @@ -0,0 +1,59 @@ +Author: Zhang Hao +Date: Thu Jun 10 15:38:20 2021 +0800 +Subject: 将单指滑动的实现代码移动到基类中进行实现 +--- + +Index: qtbase-opensource-src/src/widgets/itemviews/qlistview.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/widgets/itemviews/qlistview.cpp ++++ qtbase-opensource-src/src/widgets/itemviews/qlistview.cpp +@@ -771,6 +771,11 @@ void QListView::rowsAboutToBeRemoved(con + d->doDelayedItemsLayout(); + } + ++void QListView::mousePressEvent(QMouseEvent *e) ++{ ++ QAbstractItemView::mousePressEvent(e); ++} ++ + /*! + \reimp + */ +@@ -1665,6 +1670,11 @@ bool QListView::event(QEvent *e) + return QAbstractItemView::event(e); + } + ++bool QListView::eventFilter(QObject *obj, QEvent *e) ++{ ++ return QAbstractItemView::eventFilter(obj, e); ++} ++ + /* + * private object implementation + */ +Index: qtbase-opensource-src/src/widgets/itemviews/qlistview.h +=================================================================== +--- qtbase-opensource-src.orig/src/widgets/itemviews/qlistview.h ++++ qtbase-opensource-src/src/widgets/itemviews/qlistview.h +@@ -141,6 +141,10 @@ protected: + + bool event(QEvent *e) override; + ++#if defined(QT_BUILD_WIDGETS_LIB) && !defined(Q_CLANG_QDOC) ++ bool eventFilter(QObject *obj, QEvent *e) override; ++#endif ++ + void scrollContentsBy(int dx, int dy) override; + + void resizeContents(int width, int height); +@@ -150,6 +154,10 @@ protected: + void rowsInserted(const QModelIndex &parent, int start, int end) override; + void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override; + ++#if defined(QT_BUILD_WIDGETS_LIB) && !defined(Q_CLANG_QDOC) ++ void mousePressEvent(QMouseEvent *e) override; ++#endif ++ + void mouseMoveEvent(QMouseEvent *e) override; + void mouseReleaseEvent(QMouseEvent *e) override; + #if QT_CONFIG(wheelevent) diff --git a/fix-QMenu-is-scrollable-should-not-reset-activeAction.patch b/fix-QMenu-is-scrollable-should-not-reset-activeAction.patch new file mode 100644 index 0000000000000000000000000000000000000000..dadf5863601515ba1d506cb05c3762fe80ce8617 --- /dev/null +++ b/fix-QMenu-is-scrollable-should-not-reset-activeAction.patch @@ -0,0 +1,19 @@ +Author: Zhang Hao +Date: Wed Apr 7 11:10:57 2021 +0800 +Subject: QMenu is scrollable should not reset activeAction +Upstream: https://codereview.qt-project.org/c/qt/qtbase/+/340546 +--- + +Index: qtbase-opensource-src/src/widgets/widgets/qmenu.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/widgets/widgets/qmenu.cpp ++++ qtbase-opensource-src/src/widgets/widgets/qmenu.cpp +@@ -2237,7 +2237,7 @@ void QMenu::setActiveAction(QAction *act + { + Q_D(QMenu); + d->setCurrentAction(act, 0); +- if (d->scroll) ++ if (d->scroll && act) + d->scrollMenu(act, QMenuPrivate::QMenuScroller::ScrollCenter); + } + diff --git a/fix-_NET_SUPPORTED-attribute-cannot-be-updated.patch b/fix-_NET_SUPPORTED-attribute-cannot-be-updated.patch new file mode 100644 index 0000000000000000000000000000000000000000..db2cfdef9bd265983749967261ebf2fd39ad4d5c --- /dev/null +++ b/fix-_NET_SUPPORTED-attribute-cannot-be-updated.patch @@ -0,0 +1,19 @@ +From: Tang Haixiang +Date: Thu, 25 Feb 2021 14:00:00 +0800 +Subject: Fix-_NET_SUPPORTED-attribute-cannot-be-updated + +--- + +Index: qtbase-opensource-src/src/plugins/platforms/xcb/qxcbconnection.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/plugins/platforms/xcb/qxcbconnection.cpp ++++ qtbase-opensource-src/src/plugins/platforms/xcb/qxcbconnection.cpp +@@ -659,6 +659,8 @@ void QXcbConnection::handleXcbEvent(xcb_ + QXcbVirtualDesktop *virtualDesktop = virtualDesktopForRootWindow(propertyNotify->window); + if (virtualDesktop) + virtualDesktop->updateWorkArea(); ++ } else if(propertyNotify->atom == atom(QXcbAtom::_NET_SUPPORTED)) { ++ m_wmSupport->updateNetWMAtoms(); + } else { + HANDLE_PLATFORM_WINDOW_EVENT(xcb_property_notify_event_t, window, handlePropertyNotifyEvent); + } diff --git a/fix-cant-parse-big-texts.patch b/fix-cant-parse-big-texts.patch new file mode 100644 index 0000000000000000000000000000000000000000..c777e65fd381d5a0b7323a7f702cc75c67f73a8c --- /dev/null +++ b/fix-cant-parse-big-texts.patch @@ -0,0 +1,17 @@ +Index: qtbase_temp/src/plugins/platforms/xcb/qxcbclipboard.cpp +=================================================================== +--- qtbase_temp.orig/src/plugins/platforms/xcb/qxcbclipboard.cpp ++++ qtbase_temp/src/plugins/platforms/xcb/qxcbclipboard.cpp +@@ -865,7 +865,11 @@ QByteArray QXcbClipboard::clipboardReadI + offset += length; + } + } else { +- break; ++ //waitForClipboardEvent等待到的事件不一定有效,事件队列中还存在其它有效 ++ //事件等待获取,此处应当继续wait事件,而不是直接break ++ //正确的改法应当是在wait事件时,判断事件队列中是否存在此窗口属性被删除 ++ //的消息,如果有,应当抛弃这次wait到的时间,转而继续wait ++ //break; + } + } + diff --git a/fix-combobox-cant-popup-on-mouse-release.patch b/fix-combobox-cant-popup-on-mouse-release.patch new file mode 100644 index 0000000000000000000000000000000000000000..cd0225f181cdc78695b5198232c13aeb7ae69a0b --- /dev/null +++ b/fix-combobox-cant-popup-on-mouse-release.patch @@ -0,0 +1,34 @@ +Description: Fix combobox can't popup listview on the mouse button release + If the QStyleHints::setFocusOnTouchRelease is true + . + qtbase-opensource-src (5.11.3.5-1+deepin) unstable; urgency=low + . + * ['Autobuild release-candidate: ec09ce1048e94cf8dd2c7cd3723325975c1092b1'] +Author: zccrs + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: https://bugreports.qt.io/browse/QTBUG-81095 +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: 2020-01-06 + +--- qtbase-opensource-src-5.11.3.5.orig/src/widgets/widgets/qcombobox.cpp ++++ qtbase-opensource-src-5.11.3.5/src/widgets/widgets/qcombobox.cpp +@@ -3189,8 +3190,9 @@ void QComboBox::mouseReleaseEvent(QMouse + { + Q_D(QComboBox); + d->updateArrow(QStyle::State_None); +- if (QGuiApplication::styleHints()->setFocusOnTouchRelease() && hasFocus()) ++ if (QGuiApplication::styleHints()->setFocusOnTouchRelease() && (hasFocus() || !(focusPolicy() & Qt::ClickFocus))) { + d->showPopupFromMouseEvent(e); ++ } + } + + /*! diff --git a/fix-shortcut-show-in-menu-with-default.patch b/fix-shortcut-show-in-menu-with-default.patch new file mode 100644 index 0000000000000000000000000000000000000000..976f1bba819f61b31533ace770ca5629f2094da1 --- /dev/null +++ b/fix-shortcut-show-in-menu-with-default.patch @@ -0,0 +1,18 @@ +Author: Zhang Hao +Date: Thu Mar 4 20:08:13 2021 +0800 +Subject: fix QMenu do not show shortcuts in context menus by default +--- + +Index: qtbase-opensource-src/src/gui/kernel/qplatformtheme.cpp +=================================================================== +--- qtbase-opensource-src.orig/src/gui/kernel/qplatformtheme.cpp ++++ qtbase-opensource-src/src/gui/kernel/qplatformtheme.cpp +@@ -523,7 +523,7 @@ QVariant QPlatformTheme::defaultThemeHin + case QPlatformTheme::StyleNames: + return QVariant(QStringList()); + case QPlatformTheme::ShowShortcutsInContextMenus: +- return QVariant(true); ++ return QVariant(false); + case TextCursorWidth: + return QVariant(1); + case DropShadow: diff --git a/fix_qrasterpaintengine_rect_for_hidpi.patch b/fix_qrasterpaintengine_rect_for_hidpi.patch new file mode 100644 index 0000000000000000000000000000000000000000..0b5de4a2af93798c4e8069531d8d3939516651cf --- /dev/null +++ b/fix_qrasterpaintengine_rect_for_hidpi.patch @@ -0,0 +1,39 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + qtbase-opensource-src (5.6.1+dfsg-11deepin) unstable; urgency=medium + . + * add 0010-fix_qrasterpaintengine_rect_for_hidpi.patch + * add 0011-fix_qwidget_paint_area_for_hidpi.patch +Author: Deepin Packages Builder + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: https://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: 2017-12-01 + +--- qtbase-opensource-src-5.6.1+dfsg.orig/src/gui/painting/qpaintengine_raster.cpp ++++ qtbase-opensource-src-5.6.1+dfsg/src/gui/painting/qpaintengine_raster.cpp +@@ -1637,6 +1637,10 @@ QRect QRasterPaintEngine::toNormalizedFi + if (y2 < y1) + qSwap(y1, y2); + ++ if (!s->flags.legacy_rounding) { ++ return QRect(x1, y1, qMax(x2 - x1, qRound(rect.width() - 1)), qMax(y2 - y1, qRound(rect.height() - 1))); ++ } ++ + return QRect(x1, y1, x2 - x1, y2 - y1); + } + diff --git a/fix_qstylesheetstyle_clip_border_error.patch b/fix_qstylesheetstyle_clip_border_error.patch new file mode 100644 index 0000000000000000000000000000000000000000..9168eda496c60642818a161944be358dcfce8178 --- /dev/null +++ b/fix_qstylesheetstyle_clip_border_error.patch @@ -0,0 +1,35 @@ +From 78a4962728faf41a13e4575187b46afc5c63cd80 Mon Sep 17 00:00:00 2001 +From: Iceyer Lee +Date: Fri, 26 Jan 2018 16:25:02 +0800 +Subject: [PATCH] Fix qstylesheetstyle clip border error + +The left border path clip error when border size is odd. +That because borderClip calc path with border with divide 2. +It should be 2.0 that make result to accurately real number. + +Change-Id: Iabef104efbe65e738884e72f4a7122724d76303c +--- + src/widgets/styles/qstylesheetstyle.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp +index 9ce1a04..4235755 100644 +--- a/src/widgets/styles/qstylesheetstyle.cpp ++++ b/src/widgets/styles/qstylesheetstyle.cpp +@@ -1299,11 +1299,11 @@ QPainterPath QRenderRule::borderClip(QRect r) + + path.lineTo(rect.x() + blr.width(), curY); + curX = rect.left() + borders[LeftEdge]/2.0; +- path.arcTo(curX, rect.bottom() - 2*blr.height() + borders[BottomEdge]/2, ++ path.arcTo(curX, rect.bottom() - 2*blr.height() + borders[BottomEdge]/2.0, + blr.width()*2 - borders[LeftEdge], blr.height()*2 - borders[BottomEdge], 270, -90); + + path.lineTo(curX, rect.top() + tlr.height()); +- path.arcTo(curX, rect.top() + borders[TopEdge]/2, ++ path.arcTo(curX, rect.top() + borders[TopEdge]/2.0, + tlr.width()*2 - borders[LeftEdge], tlr.height()*2 - borders[TopEdge], 180, -90); + + path.closeSubpath(); +-- +2.7.4 + diff --git a/gnukfreebsd.diff b/gnukfreebsd.diff new file mode 100644 index 0000000000000000000000000000000000000000..079c02ffa7fdbba518c11280bc62a999a6367ddd --- /dev/null +++ b/gnukfreebsd.diff @@ -0,0 +1,168 @@ +Author: Pino Toscano +Description: Initial GNU/kFreeBSD support + - add a gnukfreebsd-g++ qmake mkspec, mostly copied from the hurd-g++ one + - properly use LD_LIBRARY_PATH on GNU/* systems +Last-Update: 2015-06-03 +Forwarded: no + +--- + mkspecs/features/qt_functions.prf | 2 + mkspecs/gnukfreebsd-g++/qmake.conf | 54 ++++++++++++++++++++ + mkspecs/gnukfreebsd-g++/qplatformdefs.h | 84 ++++++++++++++++++++++++++++++++ + 3 files changed, 140 insertions(+) + +--- /dev/null ++++ b/mkspecs/gnukfreebsd-g++/qmake.conf +@@ -0,0 +1,54 @@ ++# ++# qmake configuration for gnukfreebsd-g++ ++# ++ ++MAKEFILE_GENERATOR = UNIX ++QMAKE_PLATFORM += gnukfreebsd ++CONFIG += incremental ++QMAKE_INCREMENTAL_STYLE = sublib ++ ++QMAKE_CFLAGS_THREAD += -D_REENTRANT ++QMAKE_CXXFLAGS_THREAD += $$QMAKE_CFLAGS_THREAD ++QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections ++ ++QMAKE_INCDIR = ++QMAKE_LIBDIR = ++QMAKE_INCDIR_X11 = ++QMAKE_LIBDIR_X11 = ++QMAKE_INCDIR_OPENGL = ++QMAKE_LIBDIR_OPENGL = ++QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL ++QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL ++QMAKE_INCDIR_EGL = ++QMAKE_LIBDIR_EGL = ++QMAKE_INCDIR_OPENVG = ++QMAKE_LIBDIR_OPENVG = ++ ++QMAKE_LIBS = ++QMAKE_LIBS_DYNLOAD = -ldl ++QMAKE_LIBS_X11 = -lXext -lX11 -lm ++QMAKE_LIBS_NIS = -lnsl ++QMAKE_LIBS_EGL = -lEGL ++QMAKE_LIBS_OPENGL = -lGL ++QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 ++QMAKE_LIBS_OPENVG = -lOpenVG ++QMAKE_LIBS_THREAD = -lpthread ++ ++QMAKE_CFLAGS_XCB = ++QMAKE_LIBS_XCB = ++QMAKE_DEFINES_XCB = ++ ++QMAKE_AR = ar cqs ++QMAKE_OBJCOPY = objcopy ++QMAKE_NM = nm -P ++QMAKE_RANLIB = ++ ++QMAKE_STRIP = strip ++QMAKE_STRIPFLAGS_LIB += --strip-unneeded ++QMAKE_INSTALL_FILE = install -m 644 -p ++QMAKE_INSTALL_PROGRAM = install -m 755 -p ++ ++include(../common/unix.conf) ++include(../common/gcc-base-unix.conf) ++include(../common/g++-unix.conf) ++load(qt_config) +--- /dev/null ++++ b/mkspecs/gnukfreebsd-g++/qplatformdefs.h +@@ -0,0 +1,84 @@ ++/**************************************************************************** ++** ++** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). ++** Contact: http://www.qt-project.org/legal ++** ++** This file is part of the qmake spec of the Qt Toolkit. ++** ++** $QT_BEGIN_LICENSE:LGPL21$ ++** Commercial License Usage ++** Licensees holding valid commercial Qt licenses may use this file in ++** accordance with the commercial license agreement provided with the ++** Software or, alternatively, in accordance with the terms contained in ++** a written agreement between you and Digia. For licensing terms and ++** conditions see http://qt.digia.com/licensing. For further information ++** use the contact form at http://qt.digia.com/contact-us. ++** ++** GNU Lesser General Public License Usage ++** Alternatively, this file may be used under the terms of the GNU Lesser ++** General Public License version 2.1 or version 3 as published by the Free ++** Software Foundation and appearing in the file LICENSE.LGPLv21 and ++** LICENSE.LGPLv3 included in the packaging of this file. Please review the ++** following information to ensure the GNU Lesser General Public License ++** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ++** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ++** ++** In addition, as a special exception, Digia gives you certain additional ++** rights. These rights are described in the Digia Qt LGPL Exception ++** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ++** ++** $QT_END_LICENSE$ ++** ++****************************************************************************/ ++ ++#ifndef QPLATFORMDEFS_H ++#define QPLATFORMDEFS_H ++ ++// Get Qt defines/settings ++ ++#include "qglobal.h" ++ ++// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs ++ ++// 1) need to reset default environment if _BSD_SOURCE is defined ++// 2) need to specify POSIX thread interfaces explicitly in glibc 2.0 ++// 3) it seems older glibc need this to include the X/Open stuff ++#ifndef _GNU_SOURCE ++# define _GNU_SOURCE ++#endif ++ ++#include ++ ++ ++// We are hot - unistd.h should have turned on the specific APIs we requested ++ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#ifndef QT_NO_IPV6IFNAME ++#include ++#endif ++ ++#include "../common/posix/qplatformdefs.h" ++ ++#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500) ++#define QT_SNPRINTF ::snprintf ++#define QT_VSNPRINTF ::vsnprintf ++#endif ++ ++#endif // QPLATFORMDEFS_H +--- a/mkspecs/features/qt_functions.prf ++++ b/mkspecs/features/qt_functions.prf +@@ -215,6 +215,8 @@ defineTest(qtAddTargetEnv) { + deppath.name = PATH + } else:contains(QMAKE_HOST.os, Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|SunOS|HP-UX|QNX|GNU) { + deppath.name = LD_LIBRARY_PATH ++ } else:contains(QMAKE_HOST.os, ^GNU/.*) { ++ deppath.name = LD_LIBRARY_PATH + } else:contains(QMAKE_HOST.os, Haiku) { + deppath.name = LIBRARY_PATH + } else:equals(QMAKE_HOST.os, Darwin) { diff --git a/gnukfreebsd_linker_corelib_warnings.patch b/gnukfreebsd_linker_corelib_warnings.patch new file mode 100644 index 0000000000000000000000000000000000000000..99db83651311f8dd6364814ec7e26bc76e1b2e0c --- /dev/null +++ b/gnukfreebsd_linker_corelib_warnings.patch @@ -0,0 +1,27 @@ +diff -Naur a/src/corelib/configure.json b/src/corelib/configure.json +--- a/src/corelib/configure.json 2021-08-11 11:36:05.723388182 +0800 ++++ b/src/corelib/configure.json 2021-08-11 15:39:10.355265884 +0800 +@@ -285,6 +285,7 @@ + "label": "O_CLOEXEC", + "type": "compile", + "test": { ++ "qmake": "QMAKE_LFLAGS += -Wl,--fatal-warnings", + "head": "#define _GNU_SOURCE 1", + "include": [ "sys/types.h", "sys/socket.h", "fcntl.h", "unistd.h" ], + "main": [ +@@ -340,6 +341,7 @@ + "include": "sys/stat.h", + "main": "futimens(-1, 0);", + "qmake": [ ++ "QMAKE_LFLAGS += -Wl,--fatal-warnings", + "# Block futimens() on Apple platforms unless it's available on ALL", + "# deployment targets. This simplifies the logic at the call site", + "# dramatically, as it isn't strictly needed compared to futimes().", +@@ -367,6 +369,7 @@ + "label": "getentropy()", + "type": "compile", + "test": { ++ "qmake": "QMAKE_LFLAGS += -Wl,--fatal-warnings", + "include": "unistd.h", + "main": [ + "char buf[32];", diff --git a/no_htmlinfo_example.diff b/no_htmlinfo_example.diff new file mode 100644 index 0000000000000000000000000000000000000000..8632c4a94ce2e03945bd3f2728f4f4df144a88d4 --- /dev/null +++ b/no_htmlinfo_example.diff @@ -0,0 +1,15 @@ +Description: disable htmlinfo example which contains non-free files +Author: Dmitry Shachnev +Forwarded: not-needed +Last-Update: 2014-12-17 + +--- a/examples/xml/xml.pro ++++ b/examples/xml/xml.pro +@@ -1,6 +1,5 @@ + TEMPLATE = subdirs +-SUBDIRS = htmlinfo \ +- xmlstreamlint ++SUBDIRS = xmlstreamlint + + qtHaveModule(widgets) { + SUBDIRS += dombookmarks \ diff --git a/nonlinux_utime.diff b/nonlinux_utime.diff new file mode 100644 index 0000000000000000000000000000000000000000..ae67a4713f58e7718e74403b8755be59c396b184 --- /dev/null +++ b/nonlinux_utime.diff @@ -0,0 +1,33 @@ +Description: guard UTIME_NOW/UTIME_OMIT usages +Author: Dmitry Shachnev +Author: Pino Toscano +Forwarded: no +Last-Update: 2018-02-22 + +--- + qmake/library/ioutils.cpp | 2 +- + src/corelib/io/qfilesystemengine_unix.cpp | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/qmake/library/ioutils.cpp ++++ b/qmake/library/ioutils.cpp +@@ -228,7 +228,7 @@ bool IoUtils::touchFile(const QString &t + *errorString = fL1S("Cannot stat() reference file %1: %2.").arg(referenceFileName, fL1S(strerror(errno))); + return false; + } +-# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L ++# if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L && defined(UTIME_NOW) + const struct timespec times[2] = { { 0, UTIME_NOW }, st.st_mtim }; + const bool utimeError = utimensat(AT_FDCWD, targetFileName.toLocal8Bit().constData(), times, 0) < 0; + # else +--- a/src/corelib/io/qfilesystemengine_unix.cpp ++++ b/src/corelib/io/qfilesystemengine_unix.cpp +@@ -1595,7 +1595,7 @@ bool QFileSystemEngine::setFileTime(int + return false; + } + +-#if QT_CONFIG(futimens) ++#if QT_CONFIG(futimens) && defined(UTIME_OMIT) + struct timespec ts[2]; + + ts[0].tv_sec = ts[1].tv_sec = 0; diff --git a/qdoc_default_incdirs.diff b/qdoc_default_incdirs.diff new file mode 100644 index 0000000000000000000000000000000000000000..453604abb6de9d6d476a2c5340a34cf5683172c1 --- /dev/null +++ b/qdoc_default_incdirs.diff @@ -0,0 +1,27 @@ +From 01db4badfc3bfaf81e1195cde6f6619dcb8eeb52 Mon Sep 17 00:00:00 2001 +From: root +Date: Tue, 5 Jul 2022 15:47:16 +0800 +Subject: [PATCH] qdoc_default_incdirs + +--- + mkspecs/features/qt_docs.prf | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf +index 095bf15d..5178a7d8 100644 +--- a/mkspecs/features/qt_docs.prf ++++ b/mkspecs/features/qt_docs.prf +@@ -98,6 +98,10 @@ doc_command = $$QDOC $$QMAKE_DOCS + prepare_docs { + prepare_docs.commands += $$doc_command -prepare $$PREP_DOC_INDEXES -no-link-errors $$QDOC_INCLUDE_PATHS + generate_docs.commands += $$doc_command -generate $$DOC_INDEXES $$QDOC_INCLUDE_PATHS ++ for (incdir, QMAKE_DEFAULT_INCDIRS) { ++ prepare_docs.commands += -I$$shell_quote($$incdir) ++ generate_docs.commands += -I$$shell_quote($$incdir) ++ } + prepare_docs.depends += qtattributionsscanner + } else { + html_docs.commands += $$doc_command $$DOC_INDEXES $(QDOC_INCLUDE_PATHS) +-- +2.31.1 + diff --git a/qt5-qtbase-fix-bug108222-linewrap-carriage_return-different_rowspacing.patch b/qt5-qtbase-fix-bug108222-linewrap-carriage_return-different_rowspacing.patch new file mode 100644 index 0000000000000000000000000000000000000000..c341c1a82b41a0f6cd8526e97781ab1f7aab30ea --- /dev/null +++ b/qt5-qtbase-fix-bug108222-linewrap-carriage_return-different_rowspacing.patch @@ -0,0 +1,25 @@ +From 4fd9ee945b281d55569222000ae6a7e33f2d84cc Mon Sep 17 00:00:00 2001 +From: Zhang xianting +Date: Mon, 10 Jan 2022 18:16:31 +0800 +Subject: [PATCH] qt5-qtbase fix bug108222 linewrap and carriage_return get different rowspacing. + +--- + src/gui/text/qtextdocumentlayout.cpp | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp +index bed0a2c4..7291eca2 100644 +--- a/src/gui/text/qtextdocumentlayout.cpp ++++ b/src/gui/text/qtextdocumentlayout.cpp +@@ -2546,7 +2546,7 @@ void QTextDocumentLayoutPrivate::layoutFlow(QTextFrame::Iterator it, QTextLayout + static inline void getLineHeightParams(const QTextBlockFormat &blockFormat, const QTextLine &line, qreal scaling, + QFixed *lineAdjustment, QFixed *lineBreakHeight, QFixed *lineHeight, QFixed *lineBottom) + { +- qreal rawHeight = qCeil(line.ascent() + line.descent() + line.leading()); ++ qreal rawHeight = qCeil(line.ascent() + line.descent()); + *lineHeight = QFixed::fromReal(blockFormat.lineHeight(rawHeight, scaling)); + *lineBottom = QFixed::fromReal(blockFormat.lineHeight(line.height(), scaling)); + +-- +2.27.0 + diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index e0b189b706ef08dc43ad72ff8f7ac86e92fa3f82..de653fe2ce6843f04e845e0563363e8cd75db667 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 # See http://bugzilla.redhat.com/223663 %global multilib_archs x86_64 %{ix86} %{?mips} ppc64 ppc s390x s390 sparc64 sparcv9 %global multilib_basearchs x86_64 %{?mips64} ppc64 s390x sparc64 @@ -111,8 +111,65 @@ Patch68: qtbase-ambiguous-python-shebang.patch Patch100: qtbase-CVE-2021-38593.patch -#Add by anolis +#Add by anolis DDE +# DDE-2021-0810 qt5-qtbase: qt: qt5 for armv4 architecture +Patch210: armv4.diff +Patch216: gnukfreebsd.diff +Patch217: no_htmlinfo_example.diff +Patch218: remove_privacy_breachs.diff +Patch220: gnukfreebsd_linker_corelib_warnings.patch +Patch221: nonlinux_utime.diff +Patch223: qdoc_default_incdirs.diff +Patch230: StyleSheetStyle-fix-distorted-hiDPI-pngs.patch +Patch231: 0009-fix_qss_border_cap_style.patch +Patch232: fix_qstylesheetstyle_clip_border_error.patch +Patch233: fix_qrasterpaintengine_rect_for_hidpi.patch +Patch234: dnot_add_application_path_to_library_path_for_default.patch +Patch235: fix-Clicking-the-left-and-right-buttons-crash.patch + Patch1000: 0001-qt5-qtbase-anolis-add-loongarch.patch +Patch1001: qtbase-use-wayland-on-gnome.patch +Patch1015: fix-cant-parse-big-texts.patch +Patch1016: 0001_fix_action_distance_lineedit.patch +Patch1019: QTBUG001-85978-85985-QLineEdit-Fix-the-problem-under-the-touch-screen.patch +Patch1020: QTBUG002-85088-QGraphicsView-show-error-after-lose-focus.patch +Patch1021: QTBUG003-86846-Fixed-the-password-box-not-refreshed-under-Chinese-input-method.patch +Patch1023: QTBUG-86253-Mouse-source-point-error-caused-by-multi-touch.patch +Patch1024: fix-combobox-cant-popup-on-mouse-release.patch +Patch1025: cross_build_mysql.diff +Patch1028: QTBUG-87035-fix-logicadpi-return-invalid-value.patch +Patch1032: QTBUG-87781-Fix-QSFPM-not-emitting-dataChanged-when-source-model-is-set.patch +Patch1033: QTBUG007-88227-Fix-regular-expression-initialize-with-incorrect-filters.patch +Patch1035: QTBUG-86850-Fix-invalid-QSortFilterProxyModel-dataChanged-parameters.patch +Patch1036: feat-touch-screen-QListView-sliding-acceleration.patch +Patch1037: QTBUG008-89578-QLineEdit-cursor-show-white-area-when-set-inputMask.patch +Patch1038: 0001_fix-QDoubleSpinbox-and-QSpinbox-not-change-value-when-mouse-scroll.patch +Patch1039: fix-_NET_SUPPORTED-attribute-cannot-be-updated.patch +Patch1040: fix-shortcut-show-in-menu-with-default.patch +Patch1042: 0001_add-setting-thc-ICON-size-attribute-in-lineedit-to-the-style-plugin.patch +Patch1043: 0002_add-setting-thc-ICON-size-attribute-in-lineedit-to-the-style-plugin.patch +Patch1045: QTBUG-92468-fix-qtextedit-cursor-drawn-incorrectly.patch +# +Patch1049: QTBUG-89902-QComboBox-popup-menu-hide-when-press-arrow-button-more-than-double-click-time.patch +Patch1052: QTBUG-89184-QInputControl-accept-surrogate-category-character.patch +Patch1053: fix-QMenu-is-scrollable-should-not-reset-activeAction.patch +Patch1054: Avoid_adding_null-objects_to_the_icon_cache.patch +Patch1055: QTBUG-92366-Check-scrollbar-visibility-when-computing-QListView-Margins.patch +Patch1056: QTBUG-92583-fix-pagedown-behavior-and-pageup.patch +Patch1057: fix-QListView-singal-slip.patch +Patch1058: QTBUG-94248-Check-scrollbar-ScrollBarOverlap-when-computing-QListView-margins.patch +Patch1059: QTBUG-94538-fix-cursorTheme-update-issue.patch +Patch1060: fix-QLineEdit-cursor-jumping-on-touch-screen.patch +Patch1061: QTBUG-93742-fix-misplacement-of-placeholder-text-in-QLineEdit-with-RTL-content.patch +Patch1062: QTBUG-94824-fix-placement-of-placeholder-text-in-QLineEdits-with-action-icons.patch +Patch1063: QTBUG-95011-do-not-change-layout-direction-on-keyboard-input.patch +Patch1064: QTBUG-89155-Assertion-violation-in-text-shaping-on-special-string-with-EmojiOneColor-font.patch +Patch1065: uos-fix-sunway-cpu-support.patch +Patch1066: QTBUG-95607-Close-all-popup-windows-when-the-screen-is-rotated.patch +Patch1067: QTBUG-95341-Account-for-the-placeholderText-when-computing-lineRect.patch +Patch1068: QTBUG-95942-Fix-text-ellipsis-not-implemented-in-Tibetan.patch +Patch1070: qt5-qtbase-fix-bug108222-linewrap-carriage_return-different_rowspacing.patch +Patch1071: remove-the-X11-True-and-False.patch #End # Do not check any files in %%{_qt5_plugindir}/platformthemes/ for requires. @@ -366,8 +423,63 @@ Qt5 libraries used for drawing widgets and OpenGL items. %patch100 -p1 -b .CVE-2021-38593 -#Add by anolis +#Add by anolis DDE +%patch210 -p1 +%patch216 -p1 +%patch217 -p1 +%patch218 -p1 +%patch220 -p1 +%patch221 -p1 +%patch223 -p1 +%patch230 -p1 +%patch231 -p1 +%patch232 -p1 +%patch233 -p1 +%patch234 -p1 +%patch235 -p1 + %patch1000 -p1 +%patch1001 -p1 +%patch1015 -p1 +%patch1016 -p1 +%patch1019 -p1 +%patch1020 -p1 +%patch1021 -p1 +%patch1023 -p1 +%patch1024 -p1 +%patch1025 -p1 +%patch1028 -p1 +%patch1032 -p1 +%patch1033 -p1 +%patch1035 -p1 +%patch1036 -p1 +%patch1037 -p1 +%patch1038 -p1 +%patch1039 -p1 +%patch1040 -p1 +%patch1042 -p1 +%patch1043 -p1 +%patch1045 -p1 +%patch1049 -p1 -F2 +%patch1052 -p1 +%patch1053 -p1 +%patch1054 -p1 +%patch1055 -p1 +%patch1056 -p1 +%patch1057 -p1 +%patch1058 -p1 +%patch1059 -p1 +%patch1060 -p1 +%patch1061 -p1 -F2 +%patch1062 -p1 +%patch1063 -p1 +%patch1064 -p1 +%patch1065 -p1 +%patch1066 -p1 +%patch1067 -p1 +%patch1068 -p1 +%patch1070 -p1 +%patch1071 -p1 #End # move some bundled libs to ensure they're not accidentally used @@ -1035,6 +1147,9 @@ fi %changelog +* Tue Jul 05 2022 liuxingwei - 5.15.2-4.0.2 +- feature: add patchs for DDE + * Mon Apr 18 2022 liuzhilin - 5.15.2-4.0.1 - fix:add support loongarch64 diff --git a/qtbase-use-wayland-on-gnome.patch b/qtbase-use-wayland-on-gnome.patch new file mode 100644 index 0000000000000000000000000000000000000000..526963cbfc61dd24832588ae2e6be570a703387d --- /dev/null +++ b/qtbase-use-wayland-on-gnome.patch @@ -0,0 +1,20 @@ +diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp +index b8bfad4f16..676fdfad5e 100644 +--- a/src/gui/kernel/qguiapplication.cpp ++++ b/src/gui/kernel/qguiapplication.cpp +@@ -1376,14 +1376,7 @@ void QGuiApplicationPrivate::createPlatformIntegration() + if (sessionType == QByteArrayLiteral("x11") && !platformName.contains(QByteArrayLiteral("xcb"))) { + platformName = QByteArrayLiteral("xcb"); + } else if (sessionType == QByteArrayLiteral("wayland") && !platformName.contains(QByteArrayLiteral("wayland"))) { +- QByteArray currentDesktop = qgetenv("XDG_CURRENT_DESKTOP").toLower(); +- QByteArray sessionDesktop = qgetenv("XDG_SESSION_DESKTOP").toLower(); +- if (currentDesktop.contains("gnome") || sessionDesktop.contains("gnome")) { +- qInfo() << "Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome." +- << "Use QT_QPA_PLATFORM=wayland to run on Wayland anyway."; +- } else { +- platformName = QByteArrayLiteral("wayland"); +- } ++ platformName = QByteArrayLiteral("wayland"); + } + } + #ifdef QT_QPA_DEFAULT_PLATFORM_NAME diff --git a/remove-the-X11-True-and-False.patch b/remove-the-X11-True-and-False.patch new file mode 100644 index 0000000000000000000000000000000000000000..80195094e5dcd77e8a63c49428ed2c920f40422b --- /dev/null +++ b/remove-the-X11-True-and-False.patch @@ -0,0 +1,72 @@ +From 90621fb3d5c4f40ba8914bf39a5b8f693ef8ad8d Mon Sep 17 00:00:00 2001 +From: root +Date: Fri, 8 Jul 2022 11:23:57 +0800 +Subject: [PATCH] remove-the-X11-True-and-False + +--- + src/corelib/serialization/qcborcommon.h | 1 - + src/corelib/serialization/qcborstreamreader.h | 4 ++-- + src/corelib/serialization/qcborstreamwriter.h | 4 ++-- + src/corelib/serialization/qcborvalue.h | 4 ++-- + 4 files changed, 6 insertions(+), 7 deletions(-) + +diff --git a/src/corelib/serialization/qcborcommon.h b/src/corelib/serialization/qcborcommon.h +index bec46399..625af982 100644 +--- a/src/corelib/serialization/qcborcommon.h ++++ b/src/corelib/serialization/qcborcommon.h +@@ -50,7 +50,6 @@ + + /* X11 headers use these values too, but as defines */ + #if defined(False) && defined(True) +-# define QT_X11_DEFINES_FOUND 1 + # undef True + # undef False + #endif +diff --git a/src/corelib/serialization/qcborstreamreader.h b/src/corelib/serialization/qcborstreamreader.h +index 6d5feccf..3665b09e 100644 +--- a/src/corelib/serialization/qcborstreamreader.h ++++ b/src/corelib/serialization/qcborstreamreader.h +@@ -49,8 +49,8 @@ + + QT_REQUIRE_CONFIG(cborstreamreader); + +-// See qcborcommon.h for why we check +-#if defined(QT_X11_DEFINES_FOUND) ++/* X11 headers use these values too, but as defines */ ++#if defined(False) && defined(True) + # undef True + # undef False + #endif +diff --git a/src/corelib/serialization/qcborstreamwriter.h b/src/corelib/serialization/qcborstreamwriter.h +index f8c94ceb..9c2f9e81 100644 +--- a/src/corelib/serialization/qcborstreamwriter.h ++++ b/src/corelib/serialization/qcborstreamwriter.h +@@ -51,8 +51,8 @@ + + QT_REQUIRE_CONFIG(cborstreamwriter); + +-// See qcborcommon.h for why we check +-#if defined(QT_X11_DEFINES_FOUND) ++/* X11 headers use these values too, but as defines */ ++#if defined(False) && defined(True) + # undef True + # undef False + #endif +diff --git a/src/corelib/serialization/qcborvalue.h b/src/corelib/serialization/qcborvalue.h +index aa51e5da..4dc4ed69 100644 +--- a/src/corelib/serialization/qcborvalue.h ++++ b/src/corelib/serialization/qcborvalue.h +@@ -53,8 +53,8 @@ + #include + #include + +-// See qcborcommon.h for why we check +-#if defined(QT_X11_DEFINES_FOUND) ++/* X11 headers use these values too, but as defines */ ++#if defined(False) && defined(True) + # undef True + # undef False + #endif +-- +2.31.1 + diff --git a/remove_privacy_breachs.diff b/remove_privacy_breachs.diff new file mode 100644 index 0000000000000000000000000000000000000000..e9111497ae4088a79742b8133f034ec7a696c213 --- /dev/null +++ b/remove_privacy_breachs.diff @@ -0,0 +1,26 @@ +Description: remove non-used privacy-breach code + This code makes Lintian unhappy. But we are really not using it, it only + gets inserted when building the online doc. + Anyways the best way to calm down Lintian is to simply remove it. +Author: Lisandro Damián Nicanor Pérez Meyer +Forwarded: not-needed +Last-Update: 2015-02-18 + +--- + doc/global/template/scripts/main.js | 5 ----- + 1 file changed, 5 deletions(-) + +--- a/doc/global/template/scripts/main.js ++++ b/doc/global/template/scripts/main.js +@@ -94,11 +94,6 @@ $(document).ready(function($) { + }); + + $( window ).load(function() { +- load_sdk('script', 'facebook-jssdk','//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=207346529386114&version=v2.0'); +- load_sdk('script', 'twitter-wjs', '//platform.twitter.com/widgets.js'); +- $.getScript("//www.google.com/jsapi", function(){ +- google.load("feeds", "1", {"callback": oneQt.liveFeeds}); +- }); + }); + + var oneQt = { diff --git a/uos-fix-sunway-cpu-support.patch b/uos-fix-sunway-cpu-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..21d7d5ac66b16ab98ff818b4cceac5458235617e --- /dev/null +++ b/uos-fix-sunway-cpu-support.patch @@ -0,0 +1,36 @@ +Origin: uniontech +Reviewed-By: zhangfeilong@uniontech.com +Last-Update: 2021-07-28 + +--- qtbase-opensource-src-5.11.3.35.orig/src/corelib/global/archdetect.cpp ++++ qtbase-opensource-src-5.11.3.35/src/corelib/global/archdetect.cpp +@@ -77,6 +77,8 @@ + # define ARCH_PROCESSOR "sparcv9" + #elif defined(Q_PROCESSOR_SPARC) + # define ARCH_PROCESSOR "sparc" ++#elif defined(Q_PROCESSOR_SW_64) ++# define ARCH_PROCESSOR "sw_64" + #else + # define ARCH_PROCESSOR "unknown" + #endif +--- qtbase-opensource-src-5.11.3.35.orig/src/corelib/global/qprocessordetection.h ++++ qtbase-opensource-src-5.11.3.35/src/corelib/global/qprocessordetection.h +@@ -89,6 +89,18 @@ + // Q_BYTE_ORDER not defined, use endianness auto-detection + + /* ++ SW64 family ++ ++ SW64 is little-endian. ++*/ ++ ++#if defined(__sw_64__) ++# define Q_PROCESSOR_SW_64 ++# define Q_BYTE_ORDER Q_LITTLE_ENDIAN ++# define Q_PROCESSOR_WORDSIZE 8 ++#endif ++ ++/* + ARM family, known revisions: V5, V6, V7, V8 + + ARM is bi-endian, detect using __ARMEL__ or __ARMEB__, falling back to