diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-07-21 06:44:57 +0200 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-07-21 06:44:57 +0200 |
commit | 8833852acd495177320c20c0ce5a553783811fe6 (patch) | |
tree | 0bfd4eb68a78600b5055ca7e4dd04bedfcc8f0f3 /src/citra_qt/debugger/graphics_cmdlists.cpp | |
parent | Merge pull request #939 from Subv/queryprocmem (diff) | |
parent | citra-qt: Add support for copying the command list contents to clipboard. (diff) | |
download | yuzu-8833852acd495177320c20c0ce5a553783811fe6.tar yuzu-8833852acd495177320c20c0ce5a553783811fe6.tar.gz yuzu-8833852acd495177320c20c0ce5a553783811fe6.tar.bz2 yuzu-8833852acd495177320c20c0ce5a553783811fe6.tar.lz yuzu-8833852acd495177320c20c0ce5a553783811fe6.tar.xz yuzu-8833852acd495177320c20c0ce5a553783811fe6.tar.zst yuzu-8833852acd495177320c20c0ce5a553783811fe6.zip |
Diffstat (limited to 'src/citra_qt/debugger/graphics_cmdlists.cpp')
-rw-r--r-- | src/citra_qt/debugger/graphics_cmdlists.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index da19edef0..d37e865bd 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <QApplication> +#include <QClipboard> #include <QLabel> #include <QListView> #include <QMainWindow> @@ -304,16 +306,24 @@ GPUCommandListWidget::GPUCommandListWidget(QWidget* parent) : QDockWidget(tr("Pi this, SLOT(OnCommandDoubleClicked(const QModelIndex&))); toggle_tracing = new QPushButton(tr("Start Tracing")); + QPushButton* copy_all = new QPushButton(tr("Copy All")); connect(toggle_tracing, SIGNAL(clicked()), this, SLOT(OnToggleTracing())); connect(this, SIGNAL(TracingFinished(const Pica::DebugUtils::PicaTrace&)), model, SLOT(OnPicaTraceFinished(const Pica::DebugUtils::PicaTrace&))); + connect(copy_all, SIGNAL(clicked()), this, SLOT(CopyAllToClipboard())); + command_info_widget = new QWidget; QVBoxLayout* main_layout = new QVBoxLayout; main_layout->addWidget(list_widget); - main_layout->addWidget(toggle_tracing); + { + QHBoxLayout* sub_layout = new QHBoxLayout; + sub_layout->addWidget(toggle_tracing); + sub_layout->addWidget(copy_all); + main_layout->addLayout(sub_layout); + } main_layout->addWidget(command_info_widget); main_widget->setLayout(main_layout); @@ -330,3 +340,21 @@ void GPUCommandListWidget::OnToggleTracing() { toggle_tracing->setText(tr("Start Tracing")); } } + +void GPUCommandListWidget::CopyAllToClipboard() { + QClipboard* clipboard = QApplication::clipboard(); + QString text; + + QAbstractItemModel* model = (QAbstractListModel*)list_widget->model(); + + for (int row = 0; row < model->rowCount({}); ++row) { + for (int col = 0; col < model->columnCount({}); ++col) { + QModelIndex index = model->index(row, col); + text += model->data(index).value<QString>(); + text += '\t'; + } + text += '\n'; + } + + clipboard->setText(text); +} |