Home › Forums › Software Development › Using Tobii EyeX with QT creator ?
- This topic has 9 replies, 4 voices, and was last updated 8 years, 4 months ago by
Kate.
- AuthorPosts
- 08/04/2015 at 17:06 #2833
LIAGRE
ParticipantHi,
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
27/04/2015 at 17:05 #2906LIAGRE
ParticipantI’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
30/04/2015 at 13:28 #2911Jenny [Tobii]
ParticipantHi 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.
05/05/2015 at 12:46 #2933LIAGRE
ParticipantHi 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 type11/05/2015 at 12:50 #2953Thomas Mielle
ParticipantHi 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 !
01/06/2015 at 13:12 #3031LIAGRE
ParticipantHi,
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 ?
01/06/2015 at 13:39 #3034Jenny [Tobii]
ParticipantHi 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.
01/06/2015 at 13:46 #3035Jenny [Tobii]
ParticipantHi 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.
02/06/2015 at 10:39 #3049LIAGRE
ParticipantHi 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.
AddCONFIG += 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 scopeThe other errors are linked to these one, for example line 105 :
– expected primary-expression before ‘[‘ token
– expected primary-expression before ‘*’ token
…
…03/06/2015 at 10:25 #3056Kate
ParticipantNice choice)
- AuthorPosts
- You must be logged in to reply to this topic.