Qt: Simplify some string conversion bloat

This commit is contained in:
Megamouse 2024-09-24 02:37:34 +02:00
parent 82f97d33d1
commit c4282e63fb
10 changed files with 16 additions and 37 deletions

View file

@ -5,8 +5,6 @@
#include <QKeyEvent>
#include <QMouseEvent>
constexpr auto qstr = QString::fromStdString;
call_stack_list::call_stack_list(QWidget* parent) : QListWidget(parent)
{
setEditTriggers(QAbstractItemView::NoEditTriggers);
@ -37,7 +35,7 @@ void call_stack_list::HandleUpdate(const std::vector<std::pair<u32, u32>>& call_
for (const auto& addr : call_stack)
{
const QString text = qstr(fmt::format("0x%08llx (sp=0x%08llx)", addr.first, addr.second));
const QString text = QString::fromStdString(fmt::format("0x%08llx (sp=0x%08llx)", addr.first, addr.second));
QListWidgetItem* call_stack_item = new QListWidgetItem(text);
call_stack_item->setData(Qt::UserRole, { addr.first });
addItem(call_stack_item);