Commit 256e0e06 authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Fix plugin remoteimu and make it compatible with Qt5

parent 2a86c056
......@@ -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")
......
......@@ -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");
}
JointAction *RemoteImuPlugin::action(const std::string &jointName) const
QAction *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
......@@ -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::JointAction* action (const std::string &jointName) const;
QAction* action (const std::string &jointName) const;
public slots:
void newDevice (const std::string jointName);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment