Skip to content

Instantly share code, notes, and snippets.

@ilkka
Created November 10, 2011 16:46
Show Gist options
  • Select an option

  • Save ilkka/1355358 to your computer and use it in GitHub Desktop.

Select an option

Save ilkka/1355358 to your computer and use it in GitHub Desktop.
.pro file:
--------------
...
CONFIG += mobility
MOBILITY += connectivity
...
TARGET.UID3 = <from protected range>
TARGET.CAPABILITY += LocalServices
...
C++:
--------------
MyNfcItem::MyNfcItem() : QDeclarativeItem(this)
{
QNearFieldManager *m = new QNearFieldManager(this);
if (m->isAvailable() && m->startTargetDetection()) {
// Never get here, because isAvailable() always returns false :/
} else {
barf();
}
}
QML:
----------------
Blah {
...
MyNfcItem {
}
...
}
@ilkka
Copy link
Copy Markdown
Author

ilkka commented Nov 10, 2011

NFC does work though because I get a system dialog for the tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment