summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJan-Arve Sæther <jan-arve.saether@nokia.com>2009-10-29 12:17:38 (GMT)
committerJan-Arve Sæther <jan-arve.saether@nokia.com>2009-10-29 12:17:38 (GMT)
commit95ddf23a0c9e0120d55d7104480d78a64fa8cc77 (patch)
tree4ed0e2dc6a78d07a8338965200ecc14a705bc743 /tests
parentaa8c3b5f31ddd778ab8e9285a69bbe535fb23017 (diff)
parent316bf04887aed61804e16d64857754b78cf2f713 (diff)
downloadQt-95ddf23a0c9e0120d55d7104480d78a64fa8cc77.zip
Qt-95ddf23a0c9e0120d55d7104480d78a64fa8cc77.tar.gz
Qt-95ddf23a0c9e0120d55d7104480d78a64fa8cc77.tar.bz2
Merge branch '4.6' of git@scm.dev.troll.no:qt/qt-widget-team into 4.6
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp21
-rw-r--r--tests/auto/qvariant/tst_qvariant.cpp4
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp3
3 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index fe2794f..227ca6f 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -203,6 +203,8 @@ private slots:
void addColumnWhileEditing();
void task234926_setHeaderSorting();
+
+ void changeHeaderData();
};
// Testing get/set functions
@@ -3883,5 +3885,24 @@ void tst_QTableView::taskQTBUG_5062_spansInconsistency()
VERIFY_SPANS_CONSISTENCY(&view);
}
+void tst_QTableView::changeHeaderData()
+{
+ QTableView view;
+ QStandardItemModel model(5,5);
+ view.setModel(&model);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+
+ QString text = "long long long text";
+ const int textWidth = view.fontMetrics().width(text);
+ QVERIFY(view.verticalHeader()->width() < textWidth);
+
+ model.setHeaderData(2, Qt::Vertical, text);
+ QTest::qWait(100); //leave time for layout
+
+ QVERIFY(view.verticalHeader()->width() > textWidth);
+}
+
+
QTEST_MAIN(tst_QTableView)
#include "tst_qtableview.moc"
diff --git a/tests/auto/qvariant/tst_qvariant.cpp b/tests/auto/qvariant/tst_qvariant.cpp
index 61e9a4f..e2a606f 100644
--- a/tests/auto/qvariant/tst_qvariant.cpp
+++ b/tests/auto/qvariant/tst_qvariant.cpp
@@ -3380,6 +3380,10 @@ void tst_QVariant::variantInVariant()
QVariant var8 = qvariant_cast<QVariant>(QVariant::fromValue(QVariant::fromValue(str)));
QCOMPARE((int)var8.type(), (int)QVariant::String);
QCOMPARE(qvariant_cast<QString>(QVariant(qvariant_cast<QVariant>(var8))), str);
+
+ QVariant var9(qMetaTypeId<QVariant>(), &var1);
+ QCOMPARE(var9.userType(), qMetaTypeId<QVariant>());
+ QCOMPARE(qvariant_cast<QVariant>(var9), var1);
}
QTEST_MAIN(tst_QVariant)
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 9c421d1..c27de1d 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -6320,6 +6320,7 @@ void tst_QWidget::compatibilityChildInsertedEvents()
widget.show();
expected =
EventRecorder::EventList()
+ << qMakePair(&widget, QEvent::WinIdChange)
<< qMakePair(&widget, QEvent::Polish)
<< qMakePair(&widget, QEvent::Move)
<< qMakePair(&widget, QEvent::Resize)
@@ -6405,6 +6406,7 @@ void tst_QWidget::compatibilityChildInsertedEvents()
widget.show();
expected =
EventRecorder::EventList()
+ << qMakePair(&widget, QEvent::WinIdChange)
<< qMakePair(&widget, QEvent::Polish)
#ifdef QT_HAS_QT3SUPPORT
<< qMakePair(&widget, QEvent::ChildInserted)
@@ -6502,6 +6504,7 @@ void tst_QWidget::compatibilityChildInsertedEvents()
widget.show();
expected =
EventRecorder::EventList()
+ << qMakePair(&widget, QEvent::WinIdChange)
<< qMakePair(&widget, QEvent::Polish)
#ifdef QT_HAS_QT3SUPPORT
<< qMakePair(&widget, QEvent::ChildInserted)