This page explains how to integrate Receigen with a QT-based application. Note that this guide only covers the initial Receipt Validation.

The integration is done in two steps:

Here is the code for the wrapper function.

extern "C" {
    int main_(int argc, const char *argv[])
    {
        QApplication a(argc, (char**) argv);
        // Create and show main window here
        return a.exec();
    }
}

Here is the code for the main entry point.

int main_(int argc, const char *argv[]);

#define RUNNER (&main_)  // <= This is the function called when validation succeeds
#include "receipt.h"     // <= Receigen generated code

int main(int argc, char *argv[])
{
    return CheckReceiptAndRun(argc, (const char**)argv);
}