Skip to content

Commit 6195ae8

Browse files
committed
Fixed presentation of chip ID in range 0x0-0xf
1 parent 1d1793d commit 6195ae8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

qt/main_window.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,11 @@ void MainWindow::slotProgReadDeviceIdCompleted(int status)
248248
return;
249249

250250
idStr = tr("0x%1 0x%2 0x%3 0x%4 0x%5")
251-
.arg(chipId.makerId, 2, 16)
252-
.arg(chipId.deviceId, 2, 16)
253-
.arg(chipId.thirdId, 2, 16)
254-
.arg(chipId.fourthId, 2, 16)
255-
.arg(chipId.fifthId, 2, 16);
251+
.arg(chipId.makerId, 2, 16, QLatin1Char('0'))
252+
.arg(chipId.deviceId, 2, 16, QLatin1Char('0'))
253+
.arg(chipId.thirdId, 2, 16, QLatin1Char('0'))
254+
.arg(chipId.fourthId, 2, 16, QLatin1Char('0'))
255+
.arg(chipId.fifthId, 2, 16, QLatin1Char('0'));
256256
ui->deviceValueLabel->setText(idStr);
257257

258258
qInfo() << QString("ID ").append(idStr).toLatin1().data();
@@ -525,11 +525,11 @@ void MainWindow::slotProgDetectChipReadChipIdCompleted(int status)
525525
return;
526526

527527
idStr = tr("0x%1 0x%2 0x%3 0x%4 0x%5")
528-
.arg(chipId.makerId, 2, 16)
529-
.arg(chipId.deviceId, 2, 16)
530-
.arg(chipId.thirdId, 2, 16)
531-
.arg(chipId.fourthId, 2, 16)
532-
.arg(chipId.fifthId, 2, 16);
528+
.arg(chipId.makerId, 2, 16, QLatin1Char('0'))
529+
.arg(chipId.deviceId, 2, 16, QLatin1Char('0'))
530+
.arg(chipId.thirdId, 2, 16, QLatin1Char('0'))
531+
.arg(chipId.fourthId, 2, 16, QLatin1Char('0'))
532+
.arg(chipId.fifthId, 2, 16), QLatin1Char('0');
533533

534534
ui->deviceValueLabel->setText(idStr);
535535

0 commit comments

Comments
 (0)