Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package qt6-base for openSUSE:Factory 
checked in at 2023-06-07 23:08:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/qt6-base (Old)
 and      /work/SRC/openSUSE:Factory/.qt6-base.new.15902 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "qt6-base"

Wed Jun  7 23:08:02 2023 rev:34 rq:1091331 version:6.5.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/qt6-base/qt6-base.changes        2023-06-05 
18:08:27.339788454 +0200
+++ /work/SRC/openSUSE:Factory/.qt6-base.new.15902/qt6-base.changes     
2023-06-07 23:08:42.395790910 +0200
@@ -1,0 +2,6 @@
+Wed Jun  7 17:58:46 UTC 2023 - Jonas Kvinge <[email protected]>
+
+- Add patch for QTabBar regression in Qt 6.5.1 (QTBUG-114204)
+  * 0001-tabbar-fix.patch
+
+-------------------------------------------------------------------

New:
----
  0001-tabbar-fix.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ qt6-base.spec ++++++
--- /var/tmp/diff_new_pack.JDdJS9/_old  2023-06-07 23:08:44.099800805 +0200
+++ /var/tmp/diff_new_pack.JDdJS9/_new  2023-06-07 23:08:44.143801060 +0200
@@ -1,5 +1,5 @@
 #
-# spec file for package qt6-base
+# spec file
 #
 # Copyright (c) 2023 SUSE LLC
 #
@@ -41,6 +41,7 @@
 # Patches 0-100 are upstream patches #
 Patch0:         0001-Schannel-Reject-certificate-not-signed-by-a-configur.patch
 Patch1:         0001-Ssl-Copy-the-on-demand-cert-loading-bool-from-defaul.patch
+Patch2:         0001-tabbar-fix.patch
 # Patches 100-200 are openSUSE and/or non-upstream(able) patches #
 Patch100:       0001-Tell-the-truth-about-private-API.patch
 # No need to pollute the library dir with object files, install them in the 
qt6 subfolder
@@ -577,8 +578,8 @@
 %description -n qt6-docs-common
 This package contains common files used for building Qt documentation.
 
-### Static libraries ###
 
+### Static libraries ###
 %package -n qt6-exampleicons-devel-static
 Summary:        Qt ExampleIcons module
 # TODO
@@ -635,8 +636,8 @@
 This package provides private headers of libQt6PlatformSupport that do not have
 any ABI or API guarantees.
 
-### Plugins ###
 
+### Plugins ###
 %package -n qt6-networkinformation-glib
 Summary:        Network information for QNetworkInformation using 
GNetworkMonitor
 

++++++ 0001-tabbar-fix.patch ++++++
>From 2a7da1b3c8c4096d7c2b09f3fcc58e9cf47867cd Mon Sep 17 00:00:00 2001
From: Volker Hilsheimer <[email protected]>
Date: Mon, 5 Jun 2023 17:10:00 +0200
Subject: QTabBar: recalculate scroll offset when showing

If an application sets the current index and resizes the tab widget
before showing it, then the scroll offset might be calculated based on
an old size. Since after ca15f650a1a914bb9a41131109c46c4e52c5ebb1,
resizing explicitly avoids scrolling, this could result in tabs ending
up scrolled outside of the tab bar when showing the tab widget.

Fix that by explicitly making the current tab visible in the tab bar's
showEvent handler, which recalculates the scroll offset based on the
actual size.

This is only reproducible with a tab widget, which lays out the tab bar
for each change and resets the tab bar's layoutDirty flag. Add a test
case there.

Pick-to: 6.5 6.6
Fixes: QTBUG-114204
Change-Id: I1e9506b9dde1dd892291d108dd2c7b675ef99509
Reviewed-by: Axel Spoerl <[email protected]>
Reviewed-by: Jonas Kvinge <[email protected]>
---
 src/widgets/widgets/qtabbar.cpp                    |  2 ++
 .../widgets/widgets/qtabwidget/tst_qtabwidget.cpp  | 37 ++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index 75cb6dd4ea..ea408ec7f6 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -1656,6 +1656,8 @@ void QTabBar::showEvent(QShowEvent *)
         d->refresh();
     if (!d->validIndex(d->currentIndex))
         setCurrentIndex(0);
+    else
+        d->makeVisible(d->currentIndex);
     d->updateMacBorderMetrics();
 }
 
diff --git a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp 
b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
index 00cb26c2d3..eb29933fd1 100644
--- a/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
+++ b/tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
@@ -79,6 +79,9 @@ private slots:
     void moveCurrentTab();
     void autoHide();
 
+    void setCurrentBeforeShow_data();
+    void setCurrentBeforeShow();
+
   private:
     int addPage();
     void removePage(int index);
@@ -750,5 +753,39 @@ void tst_QTabWidget::autoHide()
     QVERIFY(heightForWidth1 > tabWidget.heightForWidth(20));
 }
 
+void tst_QTabWidget::setCurrentBeforeShow_data()
+{
+    QTest::addColumn<QTabWidget::TabPosition>("tabPosition");
+    QTest::newRow("West") << QTabWidget::West;
+    QTest::newRow("North") << QTabWidget::North;
+    QTest::newRow("East") << QTabWidget::East;
+    QTest::newRow("South") << QTabWidget::South;
+}
+
+void tst_QTabWidget::setCurrentBeforeShow()
+{
+    QFETCH(QTabWidget::TabPosition, tabPosition);
+
+    QTabWidget tabWidget;
+    tabWidget.setTabPosition(tabPosition);
+
+    QPixmap pm(50, 50);
+    pm.fill(Qt::red);
+    const QIcon icon(pm);
+    for (int i = 0; i < 4; ++i)
+        tabWidget.addTab(new QWidget, icon, QString("Tab %1").arg(i));
+
+    // the tab widget has space for the entire tab bar
+    tabWidget.resize(tabWidget.tabBar()->sizeHint() + QSize(50, 50));
+    tabWidget.setCurrentIndex(2);
+    tabWidget.show();
+    QVERIFY(QTest::qWaitForWindowExposed(&tabWidget));
+
+    QCOMPARE_GE(tabWidget.tabBar()->tabRect(0).x(), 0);
+    QCOMPARE_GE(tabWidget.tabBar()->tabRect(0).y(), 0);
+
+    QTest::qWait(2000);
+}
+
 QTEST_MAIN(tst_QTabWidget)
 #include "tst_qtabwidget.moc"
-- 
cgit v1.2.3

Reply via email to