Conversation
thp
left a comment
There was a problem hiding this comment.
Thanks for updating the code! I've added some comments. Please have a look.
| SIGNAL(orientation(qreal,qreal,qreal,qreal,qreal,qreal,qreal)), | ||
| &view, | ||
| SLOT(orientation(qreal,qreal,qreal,qreal,qreal,qreal,qreal))); | ||
| &Orientation::orientation, // new function-pointer syntax |
There was a problem hiding this comment.
This is a good change, but the comment is more for explaining the PR and not the code:
| &Orientation::orientation, // new function-pointer syntax | |
| &Orientation::orientation, |
| #ifndef ORIENTATION_H | ||
| #define ORIENTATION_H |
There was a problem hiding this comment.
While we are at it, might as well change it to #pragma once at the top (same for orientationview.h).
|
|
||
| if (move == NULL) { | ||
| fprintf(stderr, "Could not connect to controller.\n"); | ||
| QMetaObject::invokeMethod(qApp, "quit", Qt::QueuedConnection); |
There was a problem hiding this comment.
Can this also use the function pointer style syntax?
template <typename Functor, typename FunctorReturnType>
bool QMetaObject::invokeMethod(QObject *context, Functor function,
Qt::ConnectionType type = Qt::AutoConnection,
FunctorReturnType *ret = nullptr);Invokes the function in the event loop of context. function can be a functor or a pointer to a member function. Returns true if the function could be invoked. Returns false if there is no such function or the parameters did not match. The return value of the function call is placed in ret.
https://doc.qt.io/archives/qt-5.15/qmetaobject.html#invokeMethod-4
|
|
||
| psmove_tracker_free(tracker); | ||
| psmove_disconnect(move); | ||
| QMetaObject::invokeMethod(qApp, "quit", Qt::QueuedConnection); |
There was a problem hiding this comment.
Same as above, this can possibly use a function pointer/Functor instead of a C string "quit".
| # NEW: where your psmove landed | ||
| INCLUDEPATH += /usr/local/include | ||
| # Sometimes headers live in a nested folder, add this too if needed: | ||
| INCLUDEPATH += /usr/local/include/psmoveapi |
There was a problem hiding this comment.
Not sure if this is a good idea, we have the headers above and link against a local build. The headers in /usr/local might very well be a different version. Remove this...
| CONFIG += link_pkgconfig | ||
| PKGCONFIG += opencv4 |
There was a problem hiding this comment.
This currently isn't used by the code, so can be commented out by default?
No description provided.