[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [calligra/calligra/2.9] kexi/widget/tableview: Kexi table view: update the highlighted row while scr
From: Jaroslaw Staniek <staniek () kde ! org>
Date: 2015-10-02 23:24:56
Message-ID: E1Zi9hA-0002uW-Qp () scm ! kde ! org
[Download RAW message or body]
Git commit 34dcb43d9e0512297b5e5d83f5a97e87c3fbce48 by Jaroslaw Staniek.
Committed on 02/10/2015 at 23:21.
Pushed by staniek into branch 'calligra/2.9'.
Kexi table view: update the highlighted row while scrolling the viewport
FIXED-IN:2.9.8
M +13 -0 kexi/widget/tableview/KexiTableScrollArea.cpp
M +1 -3 kexi/widget/tableview/KexiTableScrollArea.h
http://commits.kde.org/calligra/34dcb43d9e0512297b5e5d83f5a97e87c3fbce48
diff --git a/kexi/widget/tableview/KexiTableScrollArea.cpp \
b/kexi/widget/tableview/KexiTableScrollArea.cpp index d0acef3..0768dd1 100644
--- a/kexi/widget/tableview/KexiTableScrollArea.cpp
+++ b/kexi/widget/tableview/KexiTableScrollArea.cpp
@@ -1838,6 +1838,19 @@ void \
KexiTableScrollArea::slotRowRepaintRequested(KexiDB::RecordData& record) \
updateRow(m_data->indexOf(&record)); }
+void KexiTableScrollArea::verticalScrollBarValueChanged(int v)
+{
+ KexiDataAwareObjectInterface::verticalScrollBarValueChanged(v);
+ const QPoint posInViewport = viewport()->mapFromGlobal(QCursor::pos())
+ - QPoint(contentsMargins().left(), \
contentsMargins().top()); + //kDebug() << posInViewport << contentsRect().size() - \
QSize(leftMargin(), topMargin()) + // << QRect(QPoint(0, 0), \
contentsRect().size() - QSize(leftMargin(), topMargin())); + const int row = \
rowAt(posInViewport.y() + verticalScrollBar()->value()); + if (row >= 0) {
+ setHighlightedRow(row);
+ }
+}
+
#ifndef KEXI_NO_PRINT
void
KexiTableScrollArea::print(QPrinter & /*printer*/ , QPrintDialog & /*printDialog*/)
diff --git a/kexi/widget/tableview/KexiTableScrollArea.h \
b/kexi/widget/tableview/KexiTableScrollArea.h index 64c24c7..46eb511 100644
--- a/kexi/widget/tableview/KexiTableScrollArea.h
+++ b/kexi/widget/tableview/KexiTableScrollArea.h
@@ -482,9 +482,7 @@ protected Q_SLOTS:
/*! Handles verticalScrollBar()'s valueChanged(int) signal.
Called when vscrollbar's value has been changed. */
- virtual void verticalScrollBarValueChanged(int v) {
- KexiDataAwareObjectInterface::verticalScrollBarValueChanged(v);
- }
+ virtual void verticalScrollBarValueChanged(int v);
//! for navigator
virtual void moveToRecordRequested(uint row);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic