mirror of
https://github.com/x-tools-author/x-tools.git
synced 2025-09-15 15:28:40 +08:00
chore: do something make old qt happy
This commit is contained in:
parent
e08b0bc327
commit
621b6e1319
@ -80,7 +80,11 @@ void BarCodeAssistant::onExportButtonClicked()
|
||||
return;
|
||||
}
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||
QPixmap pixmap = *ui->labelImage->pixmap();
|
||||
#else
|
||||
QPixmap pixmap = ui->labelImage->pixmap(Qt::ReturnByValue);
|
||||
#endif
|
||||
if (!pixmap.save(fileName)) {
|
||||
QMessageBox::warning(this, tr("Save Image"), tr("Failed to save image."));
|
||||
}
|
||||
@ -100,7 +104,7 @@ void BarCodeAssistant::onRefreshButtonClicked()
|
||||
} else {
|
||||
// If user typed something, try to find matching type
|
||||
QString currentText = ui->comboBoxType->currentText();
|
||||
for (const auto &item : m_allItems) {
|
||||
for (const auto &item : std::as_const(m_allItems)) {
|
||||
if (item.second.compare(currentText, Qt::CaseInsensitive) == 0) {
|
||||
barcodeType = item.first;
|
||||
break;
|
||||
@ -253,7 +257,7 @@ void BarCodeAssistant::setupTypeComboBox()
|
||||
|
||||
// Create completer for auto-completion
|
||||
QStringList itemNames;
|
||||
for (const auto &item : m_allItems) {
|
||||
for (const auto &item : std::as_const(m_allItems)) {
|
||||
itemNames << item.second;
|
||||
}
|
||||
|
||||
@ -274,7 +278,7 @@ void BarCodeAssistant::updateComboBoxItems(const QString &filter)
|
||||
ui->comboBoxType->clear();
|
||||
|
||||
// Filter items based on the search text
|
||||
for (const auto &item : m_allItems) {
|
||||
for (const auto &item : std::as_const(m_allItems)) {
|
||||
if (filter.isEmpty() || item.second.contains(filter, Qt::CaseInsensitive)) {
|
||||
ui->comboBoxType->addItem(item.second, item.first);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user