From eea978b9744c24200496af4f8a37d76228a29320 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 19 May 2010 16:33:48 +0200 Subject: Fixed an assert in QMenu The code was changed and changed the behaviour. This is basically a kind of revert. Reviewed-By: gabi Task-Number: QTBUG-10735 --- tests/auto/qmenu/tst_qmenu.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'tests') diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp index e10d7ee69a..c8dc5161bf 100644 --- a/tests/auto/qmenu/tst_qmenu.cpp +++ b/tests/auto/qmenu/tst_qmenu.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -106,6 +107,7 @@ private slots: void pushButtonPopulateOnAboutToShow(); void QTBUG7907_submenus_autoselect(); void QTBUG7411_submenus_activate(); + void QTBUG_10735_crashWithDialog(); protected slots: void onActivated(QAction*); void onHighlighted(QAction*); @@ -969,5 +971,57 @@ void tst_QMenu::QTBUG7411_submenus_activate() +class MyMenu : public QMenu +{ + Q_OBJECT +public: + MyMenu() : m_currentIndex(0) + { + for (int i = 0; i < 2; ++i) + dialogActions[i] = addAction( QString("dialog %1").arg(i), dialogs + i, SLOT(exec())); + } + + + void activateAction(int index) + { + m_currentIndex = index; + popup(QPoint()); + QTest::qWaitForWindowShown(this); + setActiveAction(dialogActions[index]); + QTimer::singleShot(0, this, SLOT(checkVisibility())); + QTest::keyClick(this, Qt::Key_Enter); //activation + } + +public slots: + void activateLastAction() + { + activateAction(1); + } + + void checkVisibility() + { + QTRY_VERIFY(dialogs[m_currentIndex].isVisible()); + if (m_currentIndex == 1) { + QApplication::closeAllWindows(); //this is the end of the test + } + } + + +private: + QAction *dialogActions[2]; + QDialog dialogs[2]; + int m_currentIndex; +}; + +void tst_QMenu::QTBUG_10735_crashWithDialog() +{ + MyMenu menu; + + QTimer::singleShot(1000, &menu, SLOT(activateLastAction())); + menu.activateAction(0); + +} + + QTEST_MAIN(tst_QMenu) #include "tst_qmenu.moc" -- cgit v1.2.3 From 9c13272ddeea2408c83eb12a9f1fcceeb6a7589e Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Thu, 20 May 2010 10:47:19 +0200 Subject: more subtests for QChar Merge-request: 2392 Reviewed-by: Olivier Goffart --- tests/auto/qchar/tst_qchar.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') diff --git a/tests/auto/qchar/tst_qchar.cpp b/tests/auto/qchar/tst_qchar.cpp index 5ca225529f..9f70b8c6e3 100644 --- a/tests/auto/qchar/tst_qchar.cpp +++ b/tests/auto/qchar/tst_qchar.cpp @@ -75,6 +75,7 @@ private slots: void isPrint(); void isUpper(); void isLower(); + void isTitle(); void category(); void direction(); void joining(); @@ -234,6 +235,11 @@ void tst_QChar::isUpper() QVERIFY(!QChar('?').isUpper()); QVERIFY(QChar(0xC2).isUpper()); // A with ^ QVERIFY(!QChar(0xE2).isUpper()); // a with ^ + + for (uint codepoint = 0; codepoint <= UNICODE_LAST_CODEPOINT; ++codepoint) { + if (QChar::category(codepoint) == QChar::Letter_Uppercase) + QVERIFY(codepoint == QChar::toUpper(codepoint)); + } } void tst_QChar::isLower() @@ -245,6 +251,19 @@ void tst_QChar::isLower() QVERIFY(!QChar('?').isLower()); QVERIFY(!QChar(0xC2).isLower()); // A with ^ QVERIFY(QChar(0xE2).isLower()); // a with ^ + + for (uint codepoint = 0; codepoint <= UNICODE_LAST_CODEPOINT; ++codepoint) { + if (QChar::category(codepoint) == QChar::Letter_Lowercase) + QVERIFY(codepoint == QChar::toLower(codepoint)); + } +} + +void tst_QChar::isTitle() +{ + for (uint codepoint = 0; codepoint <= UNICODE_LAST_CODEPOINT; ++codepoint) { + if (QChar::category(codepoint) == QChar::Letter_Titlecase) + QVERIFY(codepoint == QChar::toTitleCase(codepoint)); + } } void tst_QChar::category() -- cgit v1.2.3 From 89a5f382e1eff75c3d3f015b3fce0a58b8079e04 Mon Sep 17 00:00:00 2001 From: Ritt Konstantin Date: Thu, 20 May 2010 10:47:21 +0200 Subject: improve Unicode Normalization autotest Merge-request: 2392 Reviewed-by: Olivier Goffart --- tests/auto/qchar/tst_qchar.cpp | 85 ++++++++++++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 28 deletions(-) (limited to 'tests') diff --git a/tests/auto/qchar/tst_qchar.cpp b/tests/auto/qchar/tst_qchar.cpp index 9f70b8c6e3..93aaf9632f 100644 --- a/tests/auto/qchar/tst_qchar.cpp +++ b/tests/auto/qchar/tst_qchar.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #if defined(Q_OS_WINCE) #include @@ -84,7 +85,9 @@ private slots: void decomposition(); // void ligature(); void lineBreakClass(); + void normalization_data(); void normalization(); + void normalization_manual(); void normalizationCorrections(); void unicodeVersion(); #if defined(Q_OS_WINCE) @@ -505,31 +508,13 @@ void tst_QChar::lineBreakClass() QVERIFY(QUnicodeTables::lineBreakClass(0x0fffdu) == QUnicodeTables::LineBreak_AL); } -void tst_QChar::normalization() +void tst_QChar::normalization_data() { - { - QString composed; - composed += QChar(0xc0); - QString decomposed; - decomposed += QChar(0x41); - decomposed += QChar(0x300); + QTest::addColumn("columns"); + QTest::addColumn("part"); - QVERIFY(composed.normalized(QString::NormalizationForm_D) == decomposed); - QVERIFY(composed.normalized(QString::NormalizationForm_C) == composed); - QVERIFY(composed.normalized(QString::NormalizationForm_KD) == decomposed); - QVERIFY(composed.normalized(QString::NormalizationForm_KC) == composed); - } - { - QString composed; - composed += QChar(0xa0); - QString decomposed; - decomposed += QChar(0x20); - - QVERIFY(composed.normalized(QString::NormalizationForm_D) == composed); - QVERIFY(composed.normalized(QString::NormalizationForm_C) == composed); - QVERIFY(composed.normalized(QString::NormalizationForm_KD) == decomposed); - QVERIFY(composed.normalized(QString::NormalizationForm_KC) == decomposed); - } + int linenum = 0; + int part = 0; QFile f(SRCDIR "NormalizationTest.txt"); QVERIFY(f.exists()); @@ -537,6 +522,8 @@ void tst_QChar::normalization() f.open(QIODevice::ReadOnly); while (!f.atEnd()) { + linenum++; + QByteArray line; line.resize(1024); int len = f.readLine(line.data(), 1024); @@ -546,8 +533,11 @@ void tst_QChar::normalization() if (comment >= 0) line = line.left(comment); - if (line.startsWith("@")) + if (line.startsWith("@")) { + if (line.startsWith("@Part") && line.size() > 5 && QChar(line.at(5)).isDigit()) + part = QChar(line.at(5)).digitValue(); continue; + } if (line.isEmpty()) continue; @@ -560,8 +550,10 @@ void tst_QChar::normalization() Q_ASSERT(l.size() == 5); - QString columns[5]; + QStringList columns; for (int i = 0; i < 5; ++i) { + columns.append(QString()); + QList c = l.at(i).split(' '); Q_ASSERT(!c.isEmpty()); @@ -572,15 +564,26 @@ void tst_QChar::normalization() columns[i].append(QChar(uc)); else { // convert to utf16 - uc -= 0x10000; - ushort high = uc/0x400 + 0xd800; - ushort low = uc%0x400 + 0xdc00; + ushort high = QChar::highSurrogate(uc); + ushort low = QChar::lowSurrogate(uc); columns[i].append(QChar(high)); columns[i].append(QChar(low)); } } } + QString nm = QString("line #%1:").arg(linenum); + QTest::newRow(nm.toLatin1()) << columns << part; + } +} + +void tst_QChar::normalization() +{ + QFETCH(QStringList, columns); + QFETCH(int, part); + + Q_UNUSED(part) + // CONFORMANCE: // 1. The following invariants must be true for all conformant implementations // @@ -630,6 +633,32 @@ void tst_QChar::normalization() // ################# +} + +void tst_QChar::normalization_manual() +{ + { + QString composed; + composed += QChar(0xc0); + QString decomposed; + decomposed += QChar(0x41); + decomposed += QChar(0x300); + + QVERIFY(composed.normalized(QString::NormalizationForm_D) == decomposed); + QVERIFY(composed.normalized(QString::NormalizationForm_C) == composed); + QVERIFY(composed.normalized(QString::NormalizationForm_KD) == decomposed); + QVERIFY(composed.normalized(QString::NormalizationForm_KC) == composed); + } + { + QString composed; + composed += QChar(0xa0); + QString decomposed; + decomposed += QChar(0x20); + + QVERIFY(composed.normalized(QString::NormalizationForm_D) == composed); + QVERIFY(composed.normalized(QString::NormalizationForm_C) == composed); + QVERIFY(composed.normalized(QString::NormalizationForm_KD) == decomposed); + QVERIFY(composed.normalized(QString::NormalizationForm_KC) == decomposed); } } -- cgit v1.2.3 From 76fcf30c0f275a7c9f9752b1be5cb1d5ba98d9b6 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 20 May 2010 12:26:11 +0200 Subject: Autotest fix on macosx --- tests/auto/qmenu/tst_qmenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp index c8dc5161bf..b6bdb36a96 100644 --- a/tests/auto/qmenu/tst_qmenu.cpp +++ b/tests/auto/qmenu/tst_qmenu.cpp @@ -988,7 +988,7 @@ public: popup(QPoint()); QTest::qWaitForWindowShown(this); setActiveAction(dialogActions[index]); - QTimer::singleShot(0, this, SLOT(checkVisibility())); + QTimer::singleShot(500, this, SLOT(checkVisibility())); QTest::keyClick(this, Qt::Key_Enter); //activation } -- cgit v1.2.3 From 2c1d1c136102a17eef9ae3c4e9f0cf01338306ae Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 20 May 2010 13:07:41 +0200 Subject: Deselect the current selection when the QItemSelectionModel::model is reset. Merge-request: 639 Reviewed-by: Olivier Goffart --- .../tst_qitemselectionmodel.cpp | 47 ++++++++++++++++++++-- 1 file changed, 43 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp index 3b2a7167c0..9858829936 100644 --- a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp +++ b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp @@ -1536,6 +1536,43 @@ public: inline void reset() { QStandardItemModel::reset(); } }; +class ResetObserver : public QObject +{ + QItemSelectionModel * const m_selectionModel; + QItemSelection m_selection; + Q_OBJECT +public: + ResetObserver(QItemSelectionModel *selectionModel) + : m_selectionModel(selectionModel) + { + connect(selectionModel->model(), SIGNAL(modelAboutToBeReset()),SLOT(modelAboutToBeReset())); + connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(selectionChanged(QItemSelection,QItemSelection))); + connect(selectionModel->model(), SIGNAL(modelReset()),SLOT(modelReset())); + } + +private slots: + void modelAboutToBeReset() + { + m_selection = m_selectionModel->selection(); + foreach(const QItemSelectionRange &range, m_selection) + { + QVERIFY(range.isValid()); + } + } + + void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) + { + qDebug() << deselected << selected; + QCOMPARE(m_selection, deselected); + m_selection.clear(); + } + + void modelReset() + { + QVERIFY(m_selectionModel->selection().isEmpty()); + } +}; + void tst_QItemSelectionModel::resetModel() { MyStandardItemModel model(20, 20); @@ -1555,11 +1592,13 @@ void tst_QItemSelectionModel::resetModel() view.selectionModel()->select(QItemSelection(model.index(0, 0), model.index(5, 5)), QItemSelectionModel::Select); - QCOMPARE(spy.count(), 2); - QCOMPARE(spy.at(1).count(), 2); + // We get this signal three times. Twice in this test method and once because the source reset causes the current selection to + // be deselected. + QCOMPARE(spy.count(), 3); + QCOMPARE(spy.at(2).count(), 2); // make sure we don't get an "old selection" - QCOMPARE(spy.at(1).at(1).userType(), qMetaTypeId()); - QVERIFY(qvariant_cast(spy.at(1).at(1)).isEmpty()); + QCOMPARE(spy.at(2).at(1).userType(), qMetaTypeId()); + QVERIFY(qvariant_cast(spy.at(2).at(1)).isEmpty()); } void tst_QItemSelectionModel::removeRows_data() -- cgit v1.2.3 From e5e40e6eb10e6760c6fac3673aa0a5afe074ae9b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Fri, 21 May 2010 10:38:40 +0200 Subject: Revert "Deselect the current selection when the QItemSelectionModel::model is reset." This reverts commit 2c1d1c136102a17eef9ae3c4e9f0cf01338306ae. Regressions: TESTCASE_FAIL qtreeview (pulse_win32-msvc2005_windows_xp) TESTCASE_FAIL qtreeview (pulse_win32-msvc2008_windows_xp) TESTCASE_FAIL qtreewidget (pulse_win32-msvc2005_windows_xp) TESTCASE_FAIL qtreewidget (pulse_win32-msvc2008_windows_xp) TESTFUNCTION_FAIL qitemselectionmodel::unselectable (pulse_linux-g++) TESTFUNCTION_FAIL qitemselectionmodel::unselectable (pulse_qws/linux-x86-g++) TESTFUNCTION_FAIL qsortfilterproxymodel::testMultipleProxiesWithSelection (pulse_linux-g++) TESTFUNCTION_FAIL qsortfilterproxymodel::testMultipleProxiesWithSelection (pulse_macx-g++_cocoa_32) TESTFUNCTION_FAIL qsortfilterproxymodel::testMultipleProxiesWithSelection (pulse_qws/linux-x86-g++) TESTFUNCTION_FAIL qsortfilterproxymodel::testMultipleProxiesWithSelection (pulse_win32-msvc2005_windows_xp) TESTFUNCTION_FAIL qsortfilterproxymodel::testMultipleProxiesWithSelection (pulse_win32-msvc2008_windows_xp) TESTFUNCTION_FAIL qtreeview::taskQTBUG_6450_selectAllWith1stColumnHidden (pulse_linux-g++) TESTFUNCTION_FAIL qtreeview::taskQTBUG_6450_selectAllWith1stColumnHidden (pulse_qws/linux-x86-g++) TESTFUNCTION_FAIL qtreeview::taskQTBUG_6450_selectAllWith1stColumnHidden (pulse_win32-msvc2005_windows_xp) TESTFUNCTION_FAIL qtreeview::taskQTBUG_6450_selectAllWith1stColumnHidden (pulse_win32-msvc2008_windows_xp) TESTFUNCTION_FAIL qtreewidget::task191552_rtl (pulse_linux-g++) TESTFUNCTION_FAIL qtreewidget::task203673_selection (pulse_qws/linux-x86-g++) TESTFUNCTION_FAIL qtreewidget::task203673_selection (pulse_win32-msvc2005_windows_xp) TESTFUNCTION_FAIL qtreewidget::task203673_selection (pulse_win32-msvc2008_windows_xp) --- .../tst_qitemselectionmodel.cpp | 47 ++-------------------- 1 file changed, 4 insertions(+), 43 deletions(-) (limited to 'tests') diff --git a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp index 9858829936..3b2a7167c0 100644 --- a/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp +++ b/tests/auto/qitemselectionmodel/tst_qitemselectionmodel.cpp @@ -1536,43 +1536,6 @@ public: inline void reset() { QStandardItemModel::reset(); } }; -class ResetObserver : public QObject -{ - QItemSelectionModel * const m_selectionModel; - QItemSelection m_selection; - Q_OBJECT -public: - ResetObserver(QItemSelectionModel *selectionModel) - : m_selectionModel(selectionModel) - { - connect(selectionModel->model(), SIGNAL(modelAboutToBeReset()),SLOT(modelAboutToBeReset())); - connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), SLOT(selectionChanged(QItemSelection,QItemSelection))); - connect(selectionModel->model(), SIGNAL(modelReset()),SLOT(modelReset())); - } - -private slots: - void modelAboutToBeReset() - { - m_selection = m_selectionModel->selection(); - foreach(const QItemSelectionRange &range, m_selection) - { - QVERIFY(range.isValid()); - } - } - - void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) - { - qDebug() << deselected << selected; - QCOMPARE(m_selection, deselected); - m_selection.clear(); - } - - void modelReset() - { - QVERIFY(m_selectionModel->selection().isEmpty()); - } -}; - void tst_QItemSelectionModel::resetModel() { MyStandardItemModel model(20, 20); @@ -1592,13 +1555,11 @@ void tst_QItemSelectionModel::resetModel() view.selectionModel()->select(QItemSelection(model.index(0, 0), model.index(5, 5)), QItemSelectionModel::Select); - // We get this signal three times. Twice in this test method and once because the source reset causes the current selection to - // be deselected. - QCOMPARE(spy.count(), 3); - QCOMPARE(spy.at(2).count(), 2); + QCOMPARE(spy.count(), 2); + QCOMPARE(spy.at(1).count(), 2); // make sure we don't get an "old selection" - QCOMPARE(spy.at(2).at(1).userType(), qMetaTypeId()); - QVERIFY(qvariant_cast(spy.at(2).at(1)).isEmpty()); + QCOMPARE(spy.at(1).at(1).userType(), qMetaTypeId()); + QVERIFY(qvariant_cast(spy.at(1).at(1)).isEmpty()); } void tst_QItemSelectionModel::removeRows_data() -- cgit v1.2.3 From 1a0c51ffed4f7d86620b00adc3e22d044deef0c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Tue, 11 May 2010 19:06:12 +0200 Subject: Fixes QGraphicsItem::scroll issues The biggest and most important issue was that QGraphicsItem::scroll always accelerated the scroll without taking overlapping items or opacity into account, which caused drawing artifacts. We can only do accelerated scrolling if the item is opaque and not overlapped by other items. There's no (sane) way to detect whether an item is opaque or not (similar to Qt::WA_OpaquePaintEvent), which means we cannot support accelerated scrolling unless the item is cached into a pixmap (QGraphicsItem::setCacheMode). The second issue was that QStyleOptionGraphicsItem::exposedRect always contained the whole boundinRect() after an accelerated scroll (even with the QGraphicsItem::ItemUsesExtendedStyleOption flag enabled). Auto test included. Task-number: QTBUG-8378, QTBUG-7703 Reviewed-by: yoann --- tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp | 85 +++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp index 5a5a821424..300afc3ffe 100644 --- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp @@ -236,11 +236,12 @@ public: QRectF boundingRect() const { return br; } - void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) + void paint(QPainter *painter, const QStyleOptionGraphicsItem *o, QWidget *) { hints = painter->renderHints(); painter->setBrush(brush); painter->drawRect(boundingRect()); + lastExposedRect = o->exposedRect; ++repaints; } @@ -250,10 +251,19 @@ public: return QGraphicsItem::sceneEvent(event); } + void reset() + { + events.clear(); + hints = QPainter::RenderHints(0); + repaints = 0; + lastExposedRect = QRectF(); + } + QList events; QPainter::RenderHints hints; int repaints; QRectF br; + QRectF lastExposedRect; QBrush brush; }; @@ -430,6 +440,7 @@ private slots: void scenePosChange(); void updateMicroFocus(); void textItem_shortcuts(); + void scroll(); // task specific tests below me void task141694_textItemEnsureVisible(); @@ -10155,6 +10166,78 @@ void tst_QGraphicsItem::textItem_shortcuts() QTRY_COMPARE(item->textCursor().selectedText(), item->toPlainText()); } +void tst_QGraphicsItem::scroll() +{ + // Create two overlapping rectangles in the scene: + // +-------+ + // | | <- item1 + // | +-------+ + // | | | + // +---| | <- item2 + // | | + // +-------+ + + EventTester *item1 = new EventTester; + item1->br = QRectF(0, 0, 200, 200); + item1->brush = Qt::red; + item1->setFlag(QGraphicsItem::ItemUsesExtendedStyleOption); + + EventTester *item2 = new EventTester; + item2->br = QRectF(0, 0, 200, 200); + item2->brush = Qt::blue; + item2->setFlag(QGraphicsItem::ItemUsesExtendedStyleOption); + item2->setPos(100, 100); + + QGraphicsScene scene(0, 0, 300, 300); + scene.addItem(item1); + scene.addItem(item2); + + MyGraphicsView view(&scene); + view.setFrameStyle(0); + view.show(); + QTest::qWaitForWindowShown(&view); + QTRY_VERIFY(view.repaints > 0); + + view.reset(); + item1->reset(); + item2->reset(); + + const QRectF item1BoundingRect = item1->boundingRect(); + const QRectF item2BoundingRect = item2->boundingRect(); + + // Scroll item1: + // Item1 should get full exposure + // Item2 should get exposure for the part that overlaps item1. + item1->scroll(0, -10); + QTRY_VERIFY(view.repaints > 0); + QCOMPARE(item1->lastExposedRect, item1BoundingRect); + + QRectF expectedItem2Expose = item2BoundingRect; + // NB! Adjusted by 2 pixels for antialiasing + expectedItem2Expose &= item1->mapRectToItem(item2, item1BoundingRect.adjusted(-2, -2, 2, 2)); + QCOMPARE(item2->lastExposedRect, expectedItem2Expose); + + // Enable ItemCoordinateCache on item1. + view.reset(); + item1->setCacheMode(QGraphicsItem::ItemCoordinateCache); + QTRY_VERIFY(view.repaints > 0); + view.reset(); + item1->reset(); + item2->reset(); + + // Scroll item1: + // Item1 should only get expose for the newly exposed area (accelerated scroll). + // Item2 should get exposure for the part that overlaps item1. + item1->scroll(0, -10, QRectF(50, 50, 100, 100)); + QTRY_VERIFY(view.repaints > 0); + QCOMPARE(item1->lastExposedRect, QRectF(50, 140, 100, 10)); + + expectedItem2Expose = item2BoundingRect; + // NB! Adjusted by 2 pixels for antialiasing + expectedItem2Expose &= item1->mapRectToItem(item2, QRectF(50, 50, 100, 100).adjusted(-2, -2, 2, 2)); + QCOMPARE(item2->lastExposedRect, expectedItem2Expose); +} + void tst_QGraphicsItem::QTBUG_5418_textItemSetDefaultColor() { struct Item : public QGraphicsTextItem -- cgit v1.2.3