Add toolbar buttons for previous/next drawcall step

This commit is contained in:
baldurk
2017-02-13 14:51:42 +00:00
parent 4a9b5ae60c
commit 1100f36d77
3 changed files with 57 additions and 20 deletions
+24 -18
View File
@@ -106,28 +106,12 @@ EventBrowser::EventBrowser(CaptureContext &ctx, QWidget *parent)
{
QShortcut *sc = new QShortcut(QKeySequence(Qt::Key_Left | Qt::ControlModifier), this);
QObject::connect(sc, &QShortcut::activated, [this]() {
if(!m_Ctx.LogLoaded())
return;
const FetchDrawcall *draw = m_Ctx.CurDrawcall();
if(draw && draw->previous >= 0)
SelectEvent(draw->previous);
});
QObject::connect(sc, &QShortcut::activated, this, &EventBrowser::on_stepPrev_clicked);
}
{
QShortcut *sc = new QShortcut(QKeySequence(Qt::Key_Right | Qt::ControlModifier), this);
QObject::connect(sc, &QShortcut::activated, [this]() {
if(!m_Ctx.LogLoaded())
return;
const FetchDrawcall *draw = m_Ctx.CurDrawcall();
if(draw && draw->next >= 0)
SelectEvent(draw->next);
});
QObject::connect(sc, &QShortcut::activated, this, &EventBrowser::on_stepNext_clicked);
}
}
@@ -381,6 +365,28 @@ void EventBrowser::on_findPrev_clicked()
Find(false);
}
void EventBrowser::on_stepNext_clicked()
{
if(!m_Ctx.LogLoaded())
return;
const FetchDrawcall *draw = m_Ctx.CurDrawcall();
if(draw && draw->next > 0)
SelectEvent(draw->next);
}
void EventBrowser::on_stepPrev_clicked()
{
if(!m_Ctx.LogLoaded())
return;
const FetchDrawcall *draw = m_Ctx.CurDrawcall();
if(draw && draw->previous > 0)
SelectEvent(draw->previous);
}
void EventBrowser::events_keyPress(QKeyEvent *event)
{
if(!m_Ctx.LogLoaded())
+2
View File
@@ -67,6 +67,8 @@ private slots:
void on_events_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
void on_findNext_clicked();
void on_findPrev_clicked();
void on_stepNext_clicked();
void on_stepPrev_clicked();
// manual slots
void findHighlight_timeout();
+31 -2
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>662</width>
<height>590</height>
<width>275</width>
<height>298</height>
</rect>
</property>
<property name="windowTitle">
@@ -62,6 +62,35 @@
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="stepPrev">
<property name="icon">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/back.png</normaloff>:/back.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="stepNext">
<property name="icon">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/forward.png</normaloff>:/forward.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">