From b171cddac0eac66294b7bb1a03ac051d7ec12d19 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 28 Sep 2017 15:52:24 +0200 Subject: Fix outdated BSD license header Change-Id: I28f5936913a6127806325df34af4bf71a142e72e Reviewed-by: Alex Blasche --- examples/nfc/annotatedurl/annotatedurl.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'examples/nfc/annotatedurl/annotatedurl.cpp') diff --git a/examples/nfc/annotatedurl/annotatedurl.cpp b/examples/nfc/annotatedurl/annotatedurl.cpp index a07aadcc..7f63f44b 100644 --- a/examples/nfc/annotatedurl/annotatedurl.cpp +++ b/examples/nfc/annotatedurl/annotatedurl.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtNfc module. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are -- cgit v1.2.1 From 1187c4cfcb8b02e499802331b8fe31dc2c17f53e Mon Sep 17 00:00:00 2001 From: Andrew O'Doherty Date: Wed, 20 Dec 2017 15:38:06 +0100 Subject: Revamp Qt NFC examples: annotatedurl example Align QtNfc Module examples to QML and c++ coding conventions. This commit is focused on the annotatedurl example. Task-number: QTBUG-60644 Change-Id: Ia8e847fe270a677812a75827945a1e85d6c1d1a9 Reviewed-by: Maurice Kalinowski --- examples/nfc/annotatedurl/annotatedurl.cpp | 40 ++++++++++++++---------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'examples/nfc/annotatedurl/annotatedurl.cpp') diff --git a/examples/nfc/annotatedurl/annotatedurl.cpp b/examples/nfc/annotatedurl/annotatedurl.cpp index 7f63f44b..5c4a0527 100644 --- a/examples/nfc/annotatedurl/annotatedurl.cpp +++ b/examples/nfc/annotatedurl/annotatedurl.cpp @@ -47,24 +47,22 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - #include "annotatedurl.h" -#include -#include -#include -#include -#include -#include - -#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include #include - -#include -#include -#include -#include -#include +#include AnnotatedUrl::AnnotatedUrl(QObject *parent) : QObject(parent) @@ -91,10 +89,10 @@ AnnotatedUrl::AnnotatedUrl(QObject *parent) qWarning() << "Platform does not support NDEF message handler registration"; manager->startTargetDetection(); - connect(manager, SIGNAL(targetDetected(QNearFieldTarget*)), - this, SLOT(targetDetected(QNearFieldTarget*))); - connect(manager, SIGNAL(targetLost(QNearFieldTarget*)), - this, SLOT(targetLost(QNearFieldTarget*))); + connect(manager, &QNearFieldManager::targetDetected, + this, &AnnotatedUrl::targetDetected); + connect(manager, &QNearFieldManager::targetLost, + this, &AnnotatedUrl::targetLost); } AnnotatedUrl::~AnnotatedUrl() @@ -107,8 +105,8 @@ void AnnotatedUrl::targetDetected(QNearFieldTarget *target) if (!target) return; - connect(target, SIGNAL(ndefMessageRead(QNdefMessage)), - this, SLOT(handlePolledNdefMessage(QNdefMessage))); + connect(target, &QNearFieldTarget::ndefMessageRead, + this, &AnnotatedUrl::handlePolledNdefMessage); target->readNdefMessages(); } -- cgit v1.2.1 From a0188acf80824e26632b8e008c22a4d2074d909a Mon Sep 17 00:00:00 2001 From: Andrew O'Doherty Date: Thu, 1 Feb 2018 12:46:32 +0100 Subject: Revamp Qt NFC examples: documentation update Update the documentation of annotatedurl and corkboard examples Task-number: QTBUG-60644 Change-Id: Ide980dd2573e443bc54553cd2916ac6b209da2c9 Reviewed-by: Alex Blasche --- examples/nfc/annotatedurl/annotatedurl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/nfc/annotatedurl/annotatedurl.cpp') diff --git a/examples/nfc/annotatedurl/annotatedurl.cpp b/examples/nfc/annotatedurl/annotatedurl.cpp index 5c4a0527..0e6b58fa 100644 --- a/examples/nfc/annotatedurl/annotatedurl.cpp +++ b/examples/nfc/annotatedurl/annotatedurl.cpp @@ -168,12 +168,12 @@ void AnnotatedUrl::handleMessage(const QNdefMessage &message, QNearFieldTarget * QNdefNfcUriRecord uriRecord(record); url = uriRecord.uri(); -//! [handleMessage 3] } else if (record.typeNameFormat() == QNdefRecord::Mime && record.type().startsWith("image/")) { pixmap = QPixmap::fromImage(QImage::fromData(record.payload())); -//! [handleMessage 4] } +//! [handleMessage 3] +//! [handleMessage 4] } emit annotatedUrl(url, title, pixmap); -- cgit v1.2.1