Home Forums Software Development Using Tobii EyeX with QT creator ?

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #2833
    LIAGRE
    Participant

    Hi,

    I am currently working on a project for my engineering school, I have to create a GUI with QT creator and use the Tobii Eye tracking device to modify this GUI.

    My GUI is very simple, it is just a window with a button on it, and I want to change the text of this button depending on where I am looking at.
    For example, if I look at the left side of the screen, the button says “you’re looking at the left side” and if I look at the right side of the screen it changes to “you’re looking at the right side”.

    But I’m having problems linking tobii with QT creator.
    I have followed the guide designed for Visual Studio (http://developer.tobii.com/walkthrough-setting-cc-project-eyex-c-api/)
    I have pasted the directories “eyex” and “eyex-cpp” from the “include” directory from the SDK for C/C++, included “Eyex.hpp” to my “main.cpp” and linked the “Tobii.EyeX.Client.lib” library to my project, but when I try to compilate I have a bunch of errors (268 exactly).

    Am I doing something wrong ? Or am I missing something ?

    I know it would be easier if worked with Visual Studio but I have to use QT creator.

    Thank you in advance

    #2906
    LIAGRE
    Participant

    I’m updating this topic because I just need a quick answer to my question.

    I know it is possible (but tricky) to use the Analytics SDK with Qt (library) under Visual Studio.

    But for my project I have to use Qt Creator (IDE).

    Has anyone been able to use the EyeX SDK (or the GazeSDK or the AnalyticsSDK) with Qt creator ?
    Is this even possible ?

    I would be very glad if it was possible because if it isn’t I’ll have to use the EyeTribe eye tracking device and the accuracy is terrible !

    Regards

    #2911
    Jenny [Tobii]
    Participant

    Hi Liagre,

    What are the top five compilation errors? Another thing to try is to use the C API directly, using EyeX.h instead of EyeX.hpp. I think the C++ binding requires Windows.h, and the C API is the one used in the samples included in the SDK.

    #2933
    LIAGRE
    Participant

    Hi Jenny,

    I get the same errors if I include “EyeX.h” or “EyeX.hpp”. I think this is due to the fact that “EyeX.hpp” includes “EyeX.h”.

    The top 5 errors are :

    – in “EyeXClientTypes.h”, line 293
    typedef void (TX_CALLCONVENTION *TX_CONNECTIONSTATECHANGEDCALLBACK)(TX_CONNECTIONSTATE state,TX_USERPARAM userParam);
    -> expected initializer before ‘<‘ token

    – in “EyeXClientTypes.h”, line 323
    typedef std::function<void (TX_CONSTHANDLE)> AsyncDataCallback;
    -> expected initializer before ‘<‘ token

    – in “EyeXContext.h”, line 421
    TX_API_FUNCTION_CPP(RegisterConnectionStateChangedHandler,(TX_CONTEXTHANDLE hContext, TX_TICKET* pTicket, const Tx::ConnectionStateChangedCallback& handler));
    -> expected unqualified-id before ‘&’ token
    -> expected ‘)’ before ‘&’ token
    -> expected initializer before ‘&’ token

    -in “EyeXUtils.h”, line 47
    auto handle = _handle;
    -> ISO C++ forbids declaration of ‘handle’ with no type

    #2953
    Thomas Mielle
    Participant

    Hi all,

    I reply to this post because I also want to use EyeX SDK on Qt but it doesn’t work !
    I’ve included the ‘eyex’ directory into my project, and then when I try to include ‘<eyex/Eyex.h>’… 238 problems !

    'function' in namespace 'std' does not name a template type
             typedef std::function<void (TX_CONNECTIONSTATE)> ConnectionStateChangedCallback;
    'ConnectionStateChangedCallback' in namespace 'Tx' does not name a type
             const Tx::ConnectionStateChangedCallback& handler));


    There are a tutorial for liking Qt and Tobii EyeX SDK ? Or a sample exemple for Qt ?

    Thanks !

    #3031
    LIAGRE
    Participant

    Hi,

    I just wanted to add something.

    The errors I talked about in my previous message appear when I try to use EyeX SDK on Qt Creator 2.4.1 (with Qt 4.8.4).

    The errors Thomas reported appear when trying to use EyeX SDK with Qt Creator 3.3.1 (with Qt 5.4.1)

    Any help here ?

    #3034
    Jenny [Tobii]
    Participant

    Hi Liagre,

    It looks like your compiler does not support C++11 since it complains on a line using the auto keyword. I think only newer versions of Qt Creator supports C++11 and that you have to set an explicit CONFIG flag to enable it.

    #3035
    Jenny [Tobii]
    Participant

    Hi Thomas,

    We do not currently have any official support for using the EyeX SDK with Qt. We only support using the EyeX SDK for C/C++ with Microsoft Visual Studio and have a tutorial how to setup using EyeX with Visual Studio. I do not myself use Qt, and can only give some hints, like above, based on general C++ knowledge on how to go about using EyeX with Qt.

    We know Qt and Qt Creator are used by many C++ developers, and we will hopefully provide an EyeX integration for Qt in the future.

    #3049
    LIAGRE
    Participant

    Hi Thomas, Hi Jenny,

    I just wanted to inform that I successfully used the Tobii EyeX SDK with Qt Creator 3.3.1 (with Qt 5.4.1).
    Jenny was right, it didn’t work because of a missing CONFIG flag.
    Add CONFIG += c++11 to your .pro file, copy the content of the sample “MinimalGazeDataStream.c” and paste it to your “main”.
    It should run without error.

    I am still trying to make it work with Qt 4.8.4 (it should be compatible with c++11), I still have some errors (13), but I still have hope 🙂 .
    The errors I come up against are :
    – In ‘EyeXUtils.h’ line 82
    resultCode = fnGetBuf(nullptr, &size);
    ‘nullptr’ was not declared in this scope

    – In ‘EyeXUtils.h’ line 105
    std::function<TX_RESULT (TElement1*, TX_SIZE*)> fnGetBuf = [handle, pFn](TElement1* pBuf, TX_SIZE* pSize)
    ‘pBuf’ was not declared in this scope
    ‘pSize’ was not declared in this scope

    – In ‘EyeXUtils.h’ line 127
    auto fnGetString = [handle, pFn](TX_STRING pStr, TX_SIZE* pSize)
    ‘pSize’ was not declared in this scope

    The other errors are linked to these one, for example line 105 :
    – expected primary-expression before ‘[‘ token
    – expected primary-expression before ‘*’ token

    #3056
    Kate
    Participant

    Nice choice)

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.