diff options
Diffstat (limited to 'examples/bluetooth/btscanner')
-rw-r--r-- | examples/bluetooth/btscanner/device.cpp | 8 | ||||
-rw-r--r-- | examples/bluetooth/btscanner/device.h | 2 | ||||
-rw-r--r-- | examples/bluetooth/btscanner/main.cpp | 1 | ||||
-rw-r--r-- | examples/bluetooth/btscanner/service.h | 2 |
4 files changed, 7 insertions, 6 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)); } } } diff --git a/examples/bluetooth/btscanner/device.h b/examples/bluetooth/btscanner/device.h index 7111e1ec..35dc7965 100644 --- a/examples/bluetooth/btscanner/device.h +++ b/examples/bluetooth/btscanner/device.h @@ -67,7 +67,7 @@ class DeviceDiscoveryDialog : public QDialog Q_OBJECT public: - DeviceDiscoveryDialog(QWidget *parent = 0); + DeviceDiscoveryDialog(QWidget *parent = nullptr); ~DeviceDiscoveryDialog(); public slots: diff --git a/examples/bluetooth/btscanner/main.cpp b/examples/bluetooth/btscanner/main.cpp index ca762802..a84dcda9 100644 --- a/examples/bluetooth/btscanner/main.cpp +++ b/examples/bluetooth/btscanner/main.cpp @@ -54,6 +54,7 @@ int main(int argc, char *argv[]) { + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication app(argc, argv); DeviceDiscoveryDialog d; diff --git a/examples/bluetooth/btscanner/service.h b/examples/bluetooth/btscanner/service.h index 94748dad..93d1e12b 100644 --- a/examples/bluetooth/btscanner/service.h +++ b/examples/bluetooth/btscanner/service.h @@ -66,7 +66,7 @@ class ServiceDiscoveryDialog : public QDialog Q_OBJECT public: - ServiceDiscoveryDialog(const QString &name, const QBluetoothAddress &address, QWidget *parent = 0); + ServiceDiscoveryDialog(const QString &name, const QBluetoothAddress &address, QWidget *parent = nullptr); ~ServiceDiscoveryDialog(); public slots: |