mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-22 13:45:55 +00:00
Convert counter viewer to item model, sync filter with event browser
This commit is contained in:
@@ -111,6 +111,8 @@ void RDHeaderView::reset()
|
||||
{
|
||||
if(m_customSizing)
|
||||
cacheSections();
|
||||
|
||||
QHeaderView::reset();
|
||||
}
|
||||
|
||||
void RDHeaderView::cacheSections()
|
||||
@@ -247,7 +249,10 @@ int RDHeaderView::visualIndexAt(int position) const
|
||||
|
||||
int RDHeaderView::logicalIndexAt(int position) const
|
||||
{
|
||||
return visualIndexAt(position);
|
||||
if(m_customSizing)
|
||||
return visualIndexAt(position);
|
||||
|
||||
return QHeaderView::logicalIndexAt(position);
|
||||
}
|
||||
|
||||
int RDHeaderView::count() const
|
||||
@@ -570,6 +575,8 @@ void RDHeaderView::mousePressEvent(QMouseEvent *event)
|
||||
paintSection(&painter, QRect(QPoint(0, 0), m_sectionPreview->size()), idx);
|
||||
painter.end();
|
||||
|
||||
m_cursorPos = QCursor::pos().x();
|
||||
|
||||
m_sectionPreview->setPixmap(preview);
|
||||
|
||||
m_sectionPreviewOffset = mousePos - secPos;
|
||||
@@ -577,6 +584,7 @@ void RDHeaderView::mousePressEvent(QMouseEvent *event)
|
||||
m_sectionPreview->move(mousePos - m_sectionPreviewOffset, 0);
|
||||
m_sectionPreview->show();
|
||||
|
||||
QHeaderView::mousePressEvent(event);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -741,6 +749,8 @@ void RDHeaderView::mouseReleaseEvent(QMouseEvent *event)
|
||||
int mousePos = event->x();
|
||||
int idx = logicalIndexAt(mousePos);
|
||||
|
||||
m_sectionPreview->hide();
|
||||
|
||||
if(idx >= 0)
|
||||
{
|
||||
int secSize = sectionSize(idx);
|
||||
@@ -769,21 +779,17 @@ void RDHeaderView::mouseReleaseEvent(QMouseEvent *event)
|
||||
else
|
||||
moveSection(srcSection, dstSection);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_sectionPreview->hide();
|
||||
}
|
||||
|
||||
m_movingSection = -1;
|
||||
|
||||
if(m_customSizing)
|
||||
{
|
||||
m_resizeState = qMakePair(NoResize, -1);
|
||||
|
||||
return QAbstractItemView::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
QHeaderView::mouseReleaseEvent(event);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user