mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-22 21:55:52 +00:00
Implemented PerformanceCounterViewer::OnEventChanged handling
Implemented PerformanceCounterViewer::OnEventChanged to handle global event changes. Behaviour can be toggled on/off via a new 'Sync Views' button similar to the Mesh Viewer; the default is off.
This commit is contained in:
@@ -281,6 +281,24 @@ void PerformanceCounterViewer::OnCaptureLoaded()
|
||||
ui->saveCSV->setEnabled(true);
|
||||
}
|
||||
|
||||
void PerformanceCounterViewer::OnEventChanged(uint32_t eventId)
|
||||
{
|
||||
if(ui->syncViews->isChecked())
|
||||
{
|
||||
const int numItems = (int)ui->counterResults->rowCount();
|
||||
for(int i = 0; i < numItems; ++i)
|
||||
{
|
||||
QTableWidgetItem *item = ui->counterResults->item(i, 0);
|
||||
if(item->data(Qt::UserRole).toUInt() == eventId)
|
||||
{
|
||||
ui->counterResults->setCurrentItem(item);
|
||||
ui->counterResults->scrollToItem(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PerformanceCounterViewer::on_counterResults_doubleClicked(const QModelIndex &index)
|
||||
{
|
||||
QTableWidgetItem *item = ui->counterResults->item(index.row(), 0);
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
void OnCaptureLoaded() override;
|
||||
void OnCaptureClosed() override;
|
||||
void OnSelectedEventChanged(uint32_t eventId) override {}
|
||||
void OnEventChanged(uint32_t eventId) override {}
|
||||
void OnEventChanged(uint32_t eventId) override;
|
||||
private slots:
|
||||
// automatic slots
|
||||
void on_counterResults_doubleClicked(const QModelIndex &index);
|
||||
|
||||
@@ -81,6 +81,39 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="syncViews">
|
||||
<property name="toolTip">
|
||||
<string>Sync Views</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Sync Views</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../Resources/resources.qrc">
|
||||
<normaloff>:/arrow_join.png</normaloff>:/arrow_join.png</iconset>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="arrowType">
|
||||
<enum>Qt::NoArrow</enum>
|
||||
</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="saveCSV">
|
||||
<property name="toolTip">
|
||||
|
||||
Reference in New Issue
Block a user