Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CMakeLists.txt has to be located in the project folder and cmake has to be
# executed from 'project/build' with 'cmake ../'.
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.0)
find_package(Rock)
rock_init(MyWidget 0.1)
project(MyWidget VERSION 0.1 DESCRIPTION "Widget tutorial")
rock_init()
rock_standard_layout()
4 changes: 2 additions & 2 deletions manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<logo>http://</logo>

<depend package="base/types" />
<depend package="qt4" />
<depend package="qt5" />
<depend package="qt-designer" />
<depend package="qt4-opengl" />
<depend package="qt5-opengl" />
</package>
13 changes: 6 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
find_package(Qt4 REQUIRED QtCore QtGui QtOpengl QtDesigner)
include_directories(${QT_INCLUDE_DIR})
include_directories(${QT_QTCORE_INCLUDE_DIR})
include_directories(${QT_QTGUI_INCLUDE_DIR})
rock_find_qt5(Core Gui Widgets UiPlugin OpenGL Designer REQUIRED)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

SET(MOC_HDRS
Expand All @@ -18,15 +16,16 @@ FILE(GLOB SRCS
)

SET(QtApp_RCCS resources.qrc)
QT4_ADD_RESOURCES(QtApp_RCC_SRCS ${QtApp_RCCS})
QT5_ADD_RESOURCES(QtApp_RCC_SRCS ${QtApp_RCCS})

rock_vizkit_widget(MyWidget
SOURCES ${SRCS} ${QtApp_RCC_SRCS}
HEADERS ${HDRS}
MOC ${MOC_HDRS}
DEPS_PKGCONFIG base-types base-lib QtCore QtGui
DEPS Qt5::Core Qt5::Gui Qt5::Widgets
DEPS_PKGCONFIG base-types base-lib
DEPS_CMAKE
LIBS ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTDESIGNER_LIBRARY}
LIBS ${QT5Core_LIBRARIES} ${Qt5Gui_LIBRARIES} ${QT5OpenGL_LIBRARIES} ${QT5Designer_LIBRARIES}
)

rock_executable(mywidgetTest
Expand Down
4 changes: 2 additions & 2 deletions src/MyWidget.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef MYWIDGET_H
#define MYWIDGET_H

#include <QtGui>
#include <QtWidgets>

#include <base/samples/RigidBodyState.hpp>

Expand All @@ -11,9 +11,9 @@ class MyWidget : public QWidget
public:
MyWidget(QWidget *parent = 0);
virtual ~MyWidget();
base::samples::RigidBodyState getPose();

public slots:
base::samples::RigidBodyState getPose();
void setPose(const base::samples::RigidBodyState pose);

private:
Expand Down
2 changes: 0 additions & 2 deletions src/MyWidgetPlugin.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include "MyWidgetPlugin.h"
#include "MyWidget.h"

Q_EXPORT_PLUGIN2(MyWidget, MyWidgetPlugin)

MyWidgetPlugin::MyWidgetPlugin(QObject *parent)
: QObject(parent)
{
Expand Down
4 changes: 2 additions & 2 deletions src/MyWidgetPlugin.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef MYWIDGETPLUGIN_H
#define MYWIDGETPLUGIN_H

#include <QtGui>
#include <QtDesigner/QDesignerCustomWidgetInterface>
#include <QtUiPlugin/QDesignerCustomWidgetInterface>

class MyWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.dfki-rock-tutorial")
Q_INTERFACES(QDesignerCustomWidgetInterface)

public:
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <QtGui/QApplication>
#include <QtWidgets/QApplication>

#include "MyWidget.h"

Expand Down