From 991b6bc973238a6fd73c4c71e7c642b8cc455df3 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 4 Sep 2009 11:06:08 +0200 Subject: Fix a regression with QListView::setRowHidden() when a root index is set When setRowHidden() was called after a root index was set then it would not actually hide the row, if a root index is not set then it worked fine. Task-number: 260879 Reviewed-by: Jan-Arve --- src/gui/itemviews/qlistview.cpp | 8 ++++---- tests/auto/qlistview/tst_qlistview.cpp | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp index 35b44b4..1212194 100644 --- a/src/gui/itemviews/qlistview.cpp +++ b/src/gui/itemviews/qlistview.cpp @@ -549,16 +549,16 @@ void QListView::setRowHidden(int row, bool hide) const bool hidden = d->isHidden(row); if (d->viewMode == ListMode) { if (hide && !hidden) - d->hiddenRows.append(d->model->index(row, 0)); + d->hiddenRows.append(d->model->index(row, 0, rootIndex())); else if (!hide && hidden) - d->hiddenRows.remove(d->hiddenRows.indexOf(d->model->index(row, 0))); + d->hiddenRows.remove(d->hiddenRows.indexOf(d->model->index(row, 0, rootIndex()))); d->doDelayedItemsLayout(); } else { if (hide && !hidden) { d->dynamicListView->removeItem(row); - d->hiddenRows.append(d->model->index(row, 0)); + d->hiddenRows.append(d->model->index(row, 0, rootIndex())); } else if (!hide && hidden) { - d->hiddenRows.remove(d->hiddenRows.indexOf(d->model->index(row, 0))); + d->hiddenRows.remove(d->hiddenRows.indexOf(d->model->index(row, 0, rootIndex()))); d->dynamicListView->insertItem(row); } if (d->resizeMode == Adjust) diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp index b52bef0..27c6a05 100644 --- a/tests/auto/qlistview/tst_qlistview.cpp +++ b/tests/auto/qlistview/tst_qlistview.cpp @@ -417,6 +417,18 @@ void tst_QListView::hideRows() view.setRowHidden(0, false); QVERIFY(!view.isRowHidden(0)); + QStandardItemModel sim(0); + QStandardItem *root = new QStandardItem("Root row"); + for (int i=0;i<5;i++) + root->appendRow(new QStandardItem(QString("Row %1").arg(i))); + sim.appendRow(root); + view.setModel(&sim); + view.setRootIndex(root->index()); + QVERIFY(!view.isRowHidden(0)); + view.setRowHidden(0, true); + QVERIFY(view.isRowHidden(0)); + view.setRowHidden(0, false); + QVERIFY(!view.isRowHidden(0)); } -- cgit v0.12 From a42610cc9c9cb9f8de52b519fad190746063335f Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Mon, 3 Aug 2009 15:46:04 +0200 Subject: Wizard background images incorrect in Snow Leopard. We need to clear the QPixmap before the image is drawn using the CGContextDrawImage(). Reviewed-by: Norwegian Rock Cat --- src/gui/image/qpixmap_mac.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index 3a9676d..35d5d4b 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -1321,6 +1321,7 @@ QPixmap QPixmap::fromMacCGImageRef(CGImageRef image) const size_t w = CGImageGetWidth(image), h = CGImageGetHeight(image); QPixmap ret(w, h); + ret.fill(Qt::transparent); CGRect rect = CGRectMake(0, 0, w, h); CGContextRef ctx = qt_mac_cg_context(&ret); qt_mac_drawCGImage(ctx, &rect, image); -- cgit v0.12 From 4d3a876a87bec473b73b7ded74393b50b52f2e2a Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Fri, 4 Sep 2009 14:22:17 +0200 Subject: Fix pixel snow on the combo box popup on Snow Leopard. On 10.5 and below the pixmap data bytes happened to be initialized by malloc, on 10.6 this is no longer the case. Revby: Gunnar Sletta Similar to 28f94e1ef94f. --- src/gui/styles/qmacstyle_mac.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index 194c244..4cd8332 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -2147,6 +2147,7 @@ void QMacStyle::polish(QWidget* w) w->setWindowOpacity(QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5 ? 0.985 : 0.94); if (!w->testAttribute(Qt::WA_SetPalette)) { QPixmap px(64, 64); + px.fill(Qt::white); HIThemeMenuDrawInfo mtinfo; mtinfo.version = qt_mac_hitheme_version; mtinfo.menuType = kThemeMenuTypePopUp; -- cgit v0.12 From d35fe5bb21008ab30c76ebd2fe688ea3e35c084e Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Sat, 5 Sep 2009 11:17:32 +1000 Subject: Remove license header, which cannot be parsed by Sun assembler. Commit 2e0d78836becf24c7f27c982316cf1b4492f27aa fixed this for i386 but omitted the fix for x86_64. --- src/corelib/arch/x86_64/qatomic_sun.s | 40 ----------------------------------- 1 file changed, 40 deletions(-) diff --git a/src/corelib/arch/x86_64/qatomic_sun.s b/src/corelib/arch/x86_64/qatomic_sun.s index 4517fe4..37969e6 100644 --- a/src/corelib/arch/x86_64/qatomic_sun.s +++ b/src/corelib/arch/x86_64/qatomic_sun.s @@ -1,43 +1,3 @@ -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! -!! Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -!! Contact: Nokia Corporation (qt-info@nokia.com) -!! -!! This file is part of the QtGui module of the Qt Toolkit. -!! -!! $QT_BEGIN_LICENSE:LGPL$ -!! No Commercial Usage -!! This file contains pre-release code and may not be distributed. -!! You may use this file in accordance with the terms and conditions -!! contained in the Technology Preview License Agreement accompanying -!! this package. -!! -!! 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 as published by the Free Software -!! Foundation and appearing in the file LICENSE.LGPL included in the -!! packaging of this file. Please review the following information to -!! ensure the GNU Lesser General Public License version 2.1 requirements -!! will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -!! -!! In addition, as a special exception, Nokia gives you certain -!! additional rights. These rights are described in the Nokia Qt LGPL -!! Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this -!! package. -!! -!! If you have questions regarding the use of this file, please contact -!! Nokia at qt-info@nokia.com. -!! -!! -!! -!! -!! -!! -!! -!! -!! $QT_END_LICENSE$ -!! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .code64 .globl q_atomic_increment -- cgit v0.12