From 522b06bd0885ee13143684daf2f30ad5f7e0f090 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Thu, 22 Dec 2022 13:21:28 +0600 Subject: [PATCH] qt_mcadevicelist: device IDs are always 4 hex digits long --- src/qt/qt_mcadevicelist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/qt_mcadevicelist.cpp b/src/qt/qt_mcadevicelist.cpp index 95ae17f45..b8c3ed3c9 100644 --- a/src/qt/qt_mcadevicelist.cpp +++ b/src/qt/qt_mcadevicelist.cpp @@ -22,7 +22,7 @@ MCADeviceList::MCADeviceList(QWidget *parent) for (int i = 0; i < mca_get_nr_cards(); i++) { uint32_t deviceId = (mca_read_index(0x00, i) | (mca_read_index(0x01, i) << 8)); if (deviceId != 0xFFFF) { - QString hexRepresentation = QString::number(deviceId, 16).toUpper(); + QString hexRepresentation = QString::asprintf("%04X", deviceId); ui->listWidget->addItem(QString("Slot %1: 0x%2 (@%3.ADF)").arg(i + 1).arg(hexRepresentation, hexRepresentation)); } }