summaryrefslogtreecommitdiffstats
path: root/examples/itemviews/frozencolumn/freezetablewidget.cpp
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@nokia.com>2009-11-19 17:34:43 (GMT)
committerPierre Rossi <pierre.rossi@nokia.com>2009-11-23 14:50:48 (GMT)
commit44bea4d915ccfcb43b5392b4b915b9cb40f59faa (patch)
tree91f4e536c7e59b503854e693d6b77eb6428104b9 /examples/itemviews/frozencolumn/freezetablewidget.cpp
parent4cfc3a884835667fe8c3a6aa745dc4ace34794e4 (diff)
downloadQt-44bea4d915ccfcb43b5392b4b915b9cb40f59faa.zip
Qt-44bea4d915ccfcb43b5392b4b915b9cb40f59faa.tar.gz
Qt-44bea4d915ccfcb43b5392b4b915b9cb40f59faa.tar.bz2
A few tweaks to the frozen column example
Reviewed-By: Thierry
Diffstat (limited to 'examples/itemviews/frozencolumn/freezetablewidget.cpp')
-rw-r--r--examples/itemviews/frozencolumn/freezetablewidget.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/examples/itemviews/frozencolumn/freezetablewidget.cpp b/examples/itemviews/frozencolumn/freezetablewidget.cpp
index ee50ae1..72dc2a1 100644
--- a/examples/itemviews/frozencolumn/freezetablewidget.cpp
+++ b/examples/itemviews/frozencolumn/freezetablewidget.cpp
@@ -84,7 +84,8 @@ void FreezeTableWidget::init()
//! [init part2]
frozenTableView->setStyleSheet("QTableView { border: none;"
- "background-color: #8EDE21;}"); //for demo purposes
+ "background-color: #8EDE21;"
+ "selection-background-color: #999}"); //for demo purposes
frozenTableView->setSelectionModel(selectionModel());
for(int col=1; col<model()->columnCount(); col++)
frozenTableView->setColumnHidden(col, true);
@@ -146,6 +147,12 @@ QModelIndex FreezeTableWidget::moveCursor(CursorAction cursorAction,
}
//! [navigate]
+void FreezeTableWidget::scrollTo (const QModelIndex & index, ScrollHint hint){
+ if(index.column()>0)
+ QTableView::scrollTo(index, hint);
+}
+
+
//! [geometry]
void FreezeTableWidget::updateFrozenTableGeometry()