summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtableview
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-11-05 10:08:11 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-11-05 10:10:15 (GMT)
commite7dc9a35aa7b0e16457526647a8884ff3b4da4fe (patch)
treed9ec28adbfea548adc3508aa512604691cf53c48 /tests/auto/qtableview
parent5f9187991c25c3bbe812b788251678f0ab1116a3 (diff)
downloadQt-e7dc9a35aa7b0e16457526647a8884ff3b4da4fe.zip
Qt-e7dc9a35aa7b0e16457526647a8884ff3b4da4fe.tar.gz
Qt-e7dc9a35aa7b0e16457526647a8884ff3b4da4fe.tar.bz2
Fix textControl so that it ignores mouse press events when needed
This fixes the issue in the itemviews that the selection would not change when clicking on rich text labels. Task-number: QTBUG-4516 Reviewed-by: ogoffart
Diffstat (limited to 'tests/auto/qtableview')
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index 227ca6f..f571e8a 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -197,6 +197,7 @@ private slots:
void task259308_scrollVerticalHeaderSwappedSections();
void task191545_dragSelectRows();
void taskQTBUG_5062_spansInconsistency();
+ void taskQTBUG_4516_clickOnRichTextLabel();
void mouseWheel_data();
void mouseWheel();
@@ -3885,6 +3886,24 @@ void tst_QTableView::taskQTBUG_5062_spansInconsistency()
VERIFY_SPANS_CONSISTENCY(&view);
}
+void tst_QTableView::taskQTBUG_4516_clickOnRichTextLabel()
+{
+ QTableView view;
+ QStandardItemModel model(5,5);
+ view.setModel(&model);
+ QLabel label("rich text");
+ label.setTextFormat(Qt::RichText);
+ view.setIndexWidget(model.index(1,1), &label);
+ view.setCurrentIndex(model.index(0,0));
+ QCOMPARE(view.currentIndex(), model.index(0,0));
+
+ QTest::mouseClick(&label, Qt::LeftButton);
+ QCOMPARE(view.currentIndex(), model.index(1,1));
+
+
+}
+
+
void tst_QTableView::changeHeaderData()
{
QTableView view;