Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
hpp-gui
Commits
256e0e06
Commit
256e0e06
authored
Feb 12, 2018
by
Joseph Mirabel
Committed by
Joseph Mirabel
Feb 12, 2018
Browse files
Fix plugin remoteimu and make it compatible with Qt5
parent
2a86c056
Changes
3
Hide whitespace changes
Inline
Side-by-side
plugins/remoteimuplugin/CMakeLists.txt
View file @
256e0e06
...
...
@@ -29,12 +29,17 @@ SET(${PLUGIN_NAME}_FORMS
SET
(
${
PLUGIN_NAME
}
_RESOURCES
)
QT4_WRAP_CPP
(
${
PLUGIN_NAME
}
_HEADERS_MOC
${${
PLUGIN_NAME
}
_HEADERS
}
OPTIONS -I
${
GEPETTO_VIEWER_CORBA_INCLUDEDIR
}
)
QT4_WRAP_UI
(
${
PLUGIN_NAME
}
_FORMS_HEADERS
${${
PLUGIN_NAME
}
_FORMS
}
)
QT4_ADD_RESOURCES
(
${
PLUGIN_NAME
}
_RESOURCES_RCC
${${
PLUGIN_NAME
}
_RESOURCES
}
)
IF
(
USE_QT4
)
QT4_WRAP_CPP
(
${
PLUGIN_NAME
}
_HEADERS_MOC
${${
PLUGIN_NAME
}
_HEADERS
}
OPTIONS -I
${
GEPETTO_VIEWER_CORBA_INCLUDEDIR
}
)
QT4_WRAP_UI
(
${
PLUGIN_NAME
}
_FORMS_HEADERS
${${
PLUGIN_NAME
}
_FORMS
}
)
QT4_ADD_RESOURCES
(
${
PLUGIN_NAME
}
_RESOURCES_RCC
${${
PLUGIN_NAME
}
_RESOURCES
}
)
INCLUDE
(
${
QT_USE_FILE
}
)
ELSE
(
USE_QT4
)
QT5_WRAP_CPP
(
${
PLUGIN_NAME
}
_HEADERS_MOC
${${
PLUGIN_NAME
}
_HEADERS
}
OPTIONS -I
${
GEPETTO_VIEWER_CORBA_INCLUDEDIR
}
)
QT5_WRAP_UI
(
${
PLUGIN_NAME
}
_FORMS_HEADERS
${${
PLUGIN_NAME
}
_FORMS
}
)
QT5_ADD_RESOURCES
(
${
PLUGIN_NAME
}
_RESOURCES_RCC
${${
PLUGIN_NAME
}
_RESOURCES
}
)
ENDIF
(
USE_QT4
)
INCLUDE_DIRECTORIES
(
${
CMAKE_CURRENT_SOURCE_DIR
}
)
INCLUDE
(
${
QT_USE_FILE
}
)
ADD_DEFINITIONS
(
${
QT_DEFINITIONS
}
)
ADD_DEFINITIONS
(
-DQT_PLUGIN
)
ADD_DEFINITIONS
(
-DQT_SHARED
)
...
...
@@ -49,7 +54,7 @@ ADD_LIBRARY(${PLUGIN_NAME} SHARED ${${PLUGIN_NAME}_SOURCES}
${${
PLUGIN_NAME
}
_RESOURCES_RCC
}
)
TARGET_LINK_LIBRARIES
(
${
PLUGIN_NAME
}
${
QT_LIBRARIES
}
)
TARGET_LINK_LIBRARIES
(
${
PLUGIN_NAME
}
${
QT_LIBRARIES
}
"hppwidgetsplugin"
)
PKG_CONFIG_USE_DEPENDENCY
(
${
PLUGIN_NAME
}
"remoteimu"
)
PKG_CONFIG_USE_DEPENDENCY
(
${
PLUGIN_NAME
}
"hpp-corbaserver"
)
...
...
plugins/remoteimuplugin/remoteimuplugin.cc
View file @
256e0e06
...
...
@@ -6,11 +6,12 @@
#include
<gepetto/gui/mainwindow.hh>
#include
<gepetto/gui/windows-manager.hh>
#include
<../hppwidgetsplugin/joint-action.hh>
namespace
hpp
{
namespace
gui
{
using
gepetto
::
gui
::
ModelInterface
;
using
gepetto
::
gui
::
MainWindow
;
using
gepetto
::
gui
::
JointAction
;
AttitudeEventSender
::
AttitudeEventSender
()
{
...
...
@@ -237,7 +238,7 @@ namespace hpp {
return
QString
(
"Remote IMU"
);
}
Joint
Action
*
RemoteImuPlugin
::
action
(
const
std
::
string
&
jointName
)
const
Q
Action
*
RemoteImuPlugin
::
action
(
const
std
::
string
&
jointName
)
const
{
JointAction
*
action
=
new
JointAction
(
tr
(
"Attach to attitude device..."
),
jointName
,
NULL
);
action
->
setIcon
(
QIcon
::
fromTheme
(
"smartphone"
));
...
...
@@ -252,6 +253,8 @@ namespace hpp {
msgBox_
->
show
();
}
#ifdef USE_QT4
Q_EXPORT_PLUGIN2
(
remoteimuplugin
,
RemoteImuPlugin
)
#endif // USE_QT4
}
// namespace gui
}
// namespace hpp
plugins/remoteimuplugin/remoteimuplugin.hh
View file @
256e0e06
...
...
@@ -103,6 +103,9 @@ namespace hpp {
{
Q_OBJECT
Q_INTERFACES
(
gepetto
::
gui
::
PluginInterface
gepetto
::
gui
::
JointModifierInterface
)
#ifndef USE_QT4
Q_PLUGIN_METADATA
(
IID
"hpp-gui.remoteimuplugin"
)
#endif // USE_QT4
public:
virtual
~
RemoteImuPlugin
();
...
...
@@ -111,7 +114,7 @@ namespace hpp {
QString
name
()
const
;
gepetto
::
gui
::
Joint
Action
*
action
(
const
std
::
string
&
jointName
)
const
;
Q
Action
*
action
(
const
std
::
string
&
jointName
)
const
;
public
slots
:
void
newDevice
(
const
std
::
string
jointName
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment