summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-02-11 11:54:26 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-02-11 11:38:27 +0000
commitca0594270cd2905c904c3a7ac578f5e1ac71f962 (patch)
tree139bd51aaa1022c1ff86bb823cc93ec6bcd21c03 /examples
parent8231e50c82c1cc2834c13263408fd4e38440c772 (diff)
btscanner example: Fix deprecation warning
device.cpp:112:49: warning: ‘void QListWidgetItem::setTextColor(const QColor&)’ is deprecated: Use QListWidgetItem::setForeground() instead [-Wdeprecated-declarations] device.cpp:114:49: warning: ‘void QListWidgetItem::setTextColor(const QColor&)’ is deprecated: Use QListWidgetItem::setForeground() instead [-Wdeprecated-declarations] device.cpp:221:49: warning: ‘void QListWidgetItem::setTextColor(const QColor&)’ is deprecated: Use QListWidgetItem::setForeground() instead [-Wdeprecated-declarations] device.cpp:226:47: warning: ‘void QListWidgetItem::setTextColor(const QColor&)’ is deprecated: Use QListWidgetItem::setForeground() instead [-Wdeprecated-declarations] Change-Id: I673b786d2d7b76ca4a51ba8eaad231592f4ad4fd Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/bluetooth/btscanner/device.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/bluetooth/btscanner/device.cpp b/examples/bluetooth/btscanner/device.cpp
index e97c0637..b6a07db4 100644
--- a/examples/bluetooth/btscanner/device.cpp
+++ b/examples/bluetooth/btscanner/device.cpp
@@ -109,9 +109,9 @@ void DeviceDiscoveryDialog::addDevice(const QBluetoothDeviceInfo &info)
QListWidgetItem *item = new QListWidgetItem(label);
QBluetoothLocalDevice::Pairing pairingStatus = localDevice->pairingStatus(info.address());
if (pairingStatus == QBluetoothLocalDevice::Paired || pairingStatus == QBluetoothLocalDevice::AuthorizedPaired )
- item->setTextColor(QColor(Qt::green));
+ item->setForeground(QColor(Qt::green));
else
- item->setTextColor(QColor(Qt::black));
+ item->setForeground(QColor(Qt::black));
ui->list->addItem(item);
}
@@ -218,12 +218,12 @@ void DeviceDiscoveryDialog::pairingDone(const QBluetoothAddress &address, QBluet
if (pairing == QBluetoothLocalDevice::Paired || pairing == QBluetoothLocalDevice::AuthorizedPaired ) {
for (int var = 0; var < items.count(); ++var) {
QListWidgetItem *item = items.at(var);
- item->setTextColor(QColor(Qt::green));
+ item->setForeground(QColor(Qt::green));
}
} else {
for (int var = 0; var < items.count(); ++var) {
QListWidgetItem *item = items.at(var);
- item->setTextColor(QColor(Qt::red));
+ item->setForeground(QColor(Qt::red));
}
}
}