Commit 9eab1cbd authored by roangel's avatar roangel
Browse files

First compiling version of Qt stuff with catkin

parent 9e9f3b09
......@@ -13,7 +13,6 @@ rosbuild_init()
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
......
......@@ -14,6 +14,10 @@ find_package(catkin REQUIRED COMPONENTS
)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
......@@ -22,16 +26,25 @@ find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
set(MY_LIB_PATH_SRC ${PROJECT_SOURCE_DIR}/GUI_Qt/CrazyFlyGUI/src)
set(MY_LIB_PATH_INC ${PROJECT_SOURCE_DIR}/GUI_Qt/CrazyFlyGUI/include)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# #set the default path for built executables to the "bin" directory
# set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
# #set the default path for built libraries to the "lib" directory
# set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
add_definitions(-std=c++11)
#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
set(SRC_HDRS
${MY_LIB_PATH_INC}/crazyFlyZoneTab.h
${MY_LIB_PATH_INC}/myGraphicsScene.h
${MY_LIB_PATH_INC}/myGraphicsView.h
${MY_LIB_PATH_INC}/mainguiwindow.h
)
qt5_wrap_ui(UIS_HDRS gui/untitled/mainguiwindow.ui)
qt5_wrap_cpp(SRC_HDRS gui/untitled/mainguiwindow.h)
qt5_wrap_ui(UIS_HDRS GUI_Qt/CrazyFlyGUI/src/mainguiwindow.ui)
qt5_wrap_cpp(SRC_MOC_HDRS ${SRC_HDRS})
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
......@@ -133,6 +146,7 @@ catkin_package(
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
GUI_Qt/CrazyFlyGUI/include
${catkin_INCLUDE_DIRS}
)
......@@ -151,7 +165,27 @@ include_directories(
## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/d_fall_gui_node.cpp)
add_executable(GUI )
add_executable(myGUI GUI_Qt/CrazyFlyGUI/src/mainguiwindow.cpp GUI_Qt/CrazyFlyGUI/src/main.cpp ${UIS_HDRS} ${SRC_HDRS})
qt5_use_modules(myGUI Widgets)
set(MY_LIB_SOURCES
${MY_LIB_PATH_SRC}/cornergrabber.cpp
${MY_LIB_PATH_SRC}/crazyFlyZone.cpp
${MY_LIB_PATH_SRC}/crazyFlyZoneTab.cpp
${MY_LIB_PATH_SRC}/myGraphicsRectItem.cpp
${MY_LIB_PATH_SRC}/myGraphicsScene.cpp
${MY_LIB_PATH_SRC}/myGraphicsView.cpp
${MY_LIB_PATH_SRC}/tablePiece.cpp
)
add_library(my_library ${MY_LIB_SOURCES})
target_link_libraries(myGUI Qt5::Widgets)
target_link_libraries(my_library Qt5::Widgets)
target_link_libraries(myGUI my_library)
## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
......
......@@ -12,6 +12,7 @@ TARGET = CrazyFlyGUI
TEMPLATE = app
INCLUDEPATH += $$PWD/include
CONFIG += c++11
SOURCES += \
......
......@@ -8,6 +8,7 @@
#include <QGridLayout>
#include <QGraphicsRectItem>
#ifndef DEBUG_GUI
#include "ros/callback_queue.h"
#include "ros/ros.h"
......
#include "mainguiwindow.h"
#include "ui_mainguiwindow.h"
#include "crazyFlyZoneTab.h"
#include "myGraphicsScene.h"
#include "myGraphicsView.h"
#include <QObject>
#include <QDoubleSpinBox>
#include <QTextEdit>
#include <QString>
#include <string>
#define N_MAX_CRAZYFLIES 20 // protection number
......@@ -43,12 +46,13 @@ MainGUIWindow::~MainGUIWindow()
void MainGUIWindow::set_tabs(int n)
{
ui->tabWidget->clear();
std::string str;
for (int i = 0; i < n; i++)
{
str = "CrazyFly ";
str += std::to_string(i+1);
QString qstr(str.c_str());
// str = "CrazyFly ";
// str += std::to_string(i+1);
QString qstr = "CrazyFly ";
qstr.append(QString::number(i+1));
// QString qstr(str.c_str());
crazyFlyZoneTab* widget = new crazyFlyZoneTab(i);
ui->tabWidget->addTab(widget, qstr);
connect(widget, SIGNAL(centerButtonClickedSignal(int)), this, SLOT(centerViewIndex(int)));
......
......@@ -316,7 +316,7 @@
<customwidget>
<class>myGraphicsView</class>
<extends>QGraphicsView</extends>
<header>./include/myGraphicsView.h</header>
<header>myGraphicsView.h</header>
</customwidget>
</customwidgets>
<resources/>
......
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