QNI manual test: Remove unnecessary capturing and wrapping
No need to capture anything by reference, it's a leftover from when the MainWindow was changed from inside the lambda. And no need to wrap the argument to QLatin1String.arg() with QStringView explicitly. This change is made just for brevity and consistency. Change-Id: Ib8c163bcf5932d35a9d43dd8ce124588c539d5a4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
parent
83ddf49bc7
commit
58b37f5908
@ -86,7 +86,7 @@ private:
|
||||
QString str =
|
||||
QLatin1String("Reachability: %1\nBehind captive portal: %2\nTransport medium: %3"
|
||||
"\nMetered: %4")
|
||||
.arg(enumToString(reachability), QStringView(captive ? u"true" : u"false"),
|
||||
.arg(enumToString(reachability), captive ? u"true" : u"false",
|
||||
enumToString(transportMedium), metered ? u"true" : u"false");
|
||||
label->setText(str);
|
||||
}
|
||||
|
@ -58,15 +58,15 @@ int main(int argc, char **argv)
|
||||
qDebug() << "Now you can make changes to the current network connection. Qt should see the "
|
||||
"changes and notify about it.";
|
||||
QObject::connect(info, &QNetworkInformation::reachabilityChanged,
|
||||
[&](QNetworkInformation::Reachability newStatus) {
|
||||
[](QNetworkInformation::Reachability newStatus) {
|
||||
qDebug() << "Updated:" << newStatus;
|
||||
});
|
||||
|
||||
QObject::connect(info, &QNetworkInformation::isBehindCaptivePortalChanged,
|
||||
[&](bool status) { qDebug() << "Updated, behind captive portal:" << status; });
|
||||
[](bool status) { qDebug() << "Updated, behind captive portal:" << status; });
|
||||
|
||||
QObject::connect(info, &QNetworkInformation::transportMediumChanged,
|
||||
[&](QNetworkInformation::TransportMedium newMedium) {
|
||||
[](QNetworkInformation::TransportMedium newMedium) {
|
||||
qDebug() << "Updated, current transport medium:" << newMedium;
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user