summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/citra_qt/debugger/graphics_cmdlists.cpp34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp
index de10bce1f..7ac3ea542 100644
--- a/src/citra_qt/debugger/graphics_cmdlists.cpp
+++ b/src/citra_qt/debugger/graphics_cmdlists.cpp
@@ -10,6 +10,7 @@
10#include <QPushButton> 10#include <QPushButton>
11#include <QVBoxLayout> 11#include <QVBoxLayout>
12#include <QTreeView> 12#include <QTreeView>
13#include <QHeaderView>
13#include <QSpinBox> 14#include <QSpinBox>
14#include <QComboBox> 15#include <QComboBox>
15 16
@@ -174,7 +175,7 @@ int GPUCommandListModel::rowCount(const QModelIndex& parent) const {
174} 175}
175 176
176int GPUCommandListModel::columnCount(const QModelIndex& parent) const { 177int GPUCommandListModel::columnCount(const QModelIndex& parent) const {
177 return 2; 178 return 3;
178} 179}
179 180
180QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const { 181QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const {
@@ -187,14 +188,13 @@ QVariant GPUCommandListModel::data(const QModelIndex& index, int role) const {
187 188
188 if (role == Qt::DisplayRole) { 189 if (role == Qt::DisplayRole) {
189 QString content; 190 QString content;
190 if (index.column() == 0) { 191 switch ( index.column() ) {
191 QString content = QString::fromLatin1(Pica::Regs::GetCommandName(cmd.cmd_id).c_str()); 192 case 0:
192 content.append(" "); 193 return QString::fromLatin1(Pica::Regs::GetCommandName(cmd.cmd_id).c_str());
193 return content; 194 case 1:
194 } else if (index.column() == 1) { 195 return QString("%1").arg(cmd.cmd_id, 3, 16, QLatin1Char('0'));
195 QString content = QString("%1 ").arg(cmd.hex, 8, 16, QLatin1Char('0')); 196 case 2:
196 content.append(QString("%1 ").arg(val, 8, 16, QLatin1Char('0'))); 197 return QString("%1").arg(val, 8, 16, QLatin1Char('0'));
197 return content;
198 } 198 }
199 } else if (role == CommandIdRole) { 199 } else if (role == CommandIdRole) {
200 return QVariant::fromValue<int>(cmd.cmd_id.Value()); 200 return QVariant::fromValue<int>(cmd.cmd_id.Value());
@@ -207,10 +207,13 @@ QVariant GPUCommandListModel::headerData(int section, Qt::Orientation orientatio
207 switch(role) { 207 switch(role) {
208 case Qt::DisplayRole: 208 case Qt::DisplayRole:
209 { 209 {
210 if (section == 0) { 210 switch (section) {
211 case 0:
211 return tr("Command Name"); 212 return tr("Command Name");
212 } else if (section == 1) { 213 case 1:
213 return tr("Data"); 214 return tr("Register");
215 case 2:
216 return tr("New Value");
214 } 217 }
215 218
216 break; 219 break;
@@ -299,6 +302,13 @@ GPUCommandListWidget::GPUCommandListWidget(QWidget* parent) : QDockWidget(tr("Pi
299 list_widget->setModel(model); 302 list_widget->setModel(model);
300 list_widget->setFont(QFont("monospace")); 303 list_widget->setFont(QFont("monospace"));
301 list_widget->setRootIsDecorated(false); 304 list_widget->setRootIsDecorated(false);
305 list_widget->setUniformRowHeights(true);
306
307#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
308 list_widget->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
309#else
310 list_widget->header()->setResizeMode(QHeaderView::ResizeToContents);
311#endif
302 312
303 connect(list_widget->selectionModel(), SIGNAL(currentChanged(const QModelIndex&,const QModelIndex&)), 313 connect(list_widget->selectionModel(), SIGNAL(currentChanged(const QModelIndex&,const QModelIndex&)),
304 this, SLOT(SetCommandInfo(const QModelIndex&))); 314 this, SLOT(SetCommandInfo(const QModelIndex&)));