summaryrefslogtreecommitdiffstats
path: root/tools/assistant
diff options
context:
space:
mode:
authorkh1 <qt-info@nokia.com>2010-05-17 13:56:58 (GMT)
committerkh1 <qt-info@nokia.com>2010-05-17 14:00:58 (GMT)
commit25dd6dfe1c7c78370e7cbb266234f6ec5cf0eb95 (patch)
tree709745242b1c5bd963cf793cb64b8dcfedbc67d0 /tools/assistant
parentcb3d2252eaacf35a5b3c76eaa884ab4b46af74dd (diff)
downloadQt-25dd6dfe1c7c78370e7cbb266234f6ec5cf0eb95.zip
Qt-25dd6dfe1c7c78370e7cbb266234f6ec5cf0eb95.tar.gz
Qt-25dd6dfe1c7c78370e7cbb266234f6ec5cf0eb95.tar.bz2
Assistant has unnecessary repaints when expand/collapse selected node.
Task-number: QTBUG-10575 Reviewed-by: ck
Diffstat (limited to 'tools/assistant')
-rw-r--r--tools/assistant/tools/assistant/contentwindow.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/tools/assistant/tools/assistant/contentwindow.cpp b/tools/assistant/tools/assistant/contentwindow.cpp
index e0347c8..8afa1df 100644
--- a/tools/assistant/tools/assistant/contentwindow.cpp
+++ b/tools/assistant/tools/assistant/contentwindow.cpp
@@ -133,11 +133,13 @@ bool ContentWindow::eventFilter(QObject *o, QEvent *e)
if (m_contentWidget && o == m_contentWidget->viewport()
&& e->type() == QEvent::MouseButtonRelease) {
QMouseEvent *me = static_cast<QMouseEvent*>(e);
- QModelIndex index = m_contentWidget->indexAt(me->pos());
- QItemSelectionModel *sm = m_contentWidget->selectionModel();
+ const QModelIndex &index = m_contentWidget->indexAt(me->pos());
+ if (!index.isValid())
+ return QWidget::eventFilter(o, e);
- Qt::MouseButtons button = me->button();
- if (index.isValid() && (sm && sm->isSelected(index))) {
+ const Qt::MouseButtons button = me->button();
+ QItemSelectionModel *sm = m_contentWidget->selectionModel();
+ if (sm->isSelected(index)) {
if ((button == Qt::LeftButton && (me->modifiers() & Qt::ControlModifier))
|| (button == Qt::MidButton)) {
QHelpContentModel *contentModel =
@@ -189,9 +191,11 @@ void ContentWindow::itemClicked(const QModelIndex &index)
qobject_cast<QHelpContentModel*>(m_contentWidget->model());
if (contentModel) {
- QHelpContentItem *itm = contentModel->contentItemAt(index);
- if (itm)
- emit linkActivated(itm->url());
+ if (QHelpContentItem *itm = contentModel->contentItemAt(index)) {
+ const QUrl &url = itm->url();
+ if (url != CentralWidget::instance()->currentSource())
+ emit linkActivated(url);
+ }
}
}