mainwindow.h Example File
ndefeditor/mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtNfc/qnearfieldtarget.h>
#include <QtWidgets/QMainWindow>
QT_FORWARD_DECLARE_CLASS(QNearFieldManager)
QT_FORWARD_DECLARE_CLASS(QNdefMessage)
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void addNfcTextRecord();
void addNfcUriRecord();
void addMimeImageRecord();
void addEmptyRecord();
void clearMessage();
void loadMessage();
void saveMessage();
void touchReceive();
void touchStore();
void targetDetected(QNearFieldTarget *target);
void targetLost(QNearFieldTarget *target);
void ndefMessageRead(const QNdefMessage &message);
void ndefMessageWritten();
void targetError(QNearFieldTarget::Error error, const QNearFieldTarget::RequestId &id);
private:
enum TouchAction {
NoAction,
ReadNdef,
WriteNdef
};
QNdefMessage ndefMessage() const;
private:
Ui::MainWindow *ui;
QNearFieldManager *m_manager;
TouchAction m_touchAction;
QNearFieldTarget::RequestId m_request;
};
#endif // MAINWINDOW_H