From 5b5e61c0ae3aa071fbdf8c640c7e8b05063cc02b Mon Sep 17 00:00:00 2001 From: Edward Venator Date: Fri, 10 Jun 2016 16:57:17 -0500 Subject: [PATCH] Update C++ source for Qt5. --- include/swri_console/console_master.h | 2 +- include/swri_console/console_window.h | 2 +- include/swri_console/ros_thread.h | 2 +- src/console_master.cpp | 4 ++-- src/main.cpp | 2 +- src/ros_thread.cpp | 5 ++--- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/swri_console/console_master.h b/include/swri_console/console_master.h index 5983793..3245364 100644 --- a/include/swri_console/console_master.h +++ b/include/swri_console/console_master.h @@ -51,7 +51,7 @@ class ConsoleMaster : public QObject Q_OBJECT; public: - ConsoleMaster(); + ConsoleMaster(int argc, char** argv); virtual ~ConsoleMaster(); public Q_SLOTS: diff --git a/include/swri_console/console_window.h b/include/swri_console/console_window.h index 2a6e3a7..61a5936 100644 --- a/include/swri_console/console_window.h +++ b/include/swri_console/console_window.h @@ -31,7 +31,7 @@ #ifndef SWRI_CONSOLE_CONSOLE_WINDOW_H_ #define SWRI_CONSOLE_CONSOLE_WINDOW_H_ -#include +#include #include #include #include diff --git a/include/swri_console/ros_thread.h b/include/swri_console/ros_thread.h index 5ea60b9..dff0eaf 100644 --- a/include/swri_console/ros_thread.h +++ b/include/swri_console/ros_thread.h @@ -43,7 +43,7 @@ namespace swri_console { Q_OBJECT public: - RosThread(); + RosThread(int argc, char** argv); /* * Shuts down ROS and causes the thread to exit. */ diff --git a/src/console_master.cpp b/src/console_master.cpp index b689b9e..70a171c 100644 --- a/src/console_master.cpp +++ b/src/console_master.cpp @@ -37,8 +37,8 @@ namespace swri_console { -ConsoleMaster::ConsoleMaster() - : +ConsoleMaster::ConsoleMaster(int argc, char** argv): + ros_thread_(argc, argv), connected_(false), window_font_(QFont("Ubuntu Mono", 9)) { diff --git a/src/main.cpp b/src/main.cpp index 67f4896..8d6aaf2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -82,7 +82,7 @@ int main(int argc, char **argv) QCoreApplication::setOrganizationDomain("swri.org"); QCoreApplication::setApplicationName("SwRI Console"); - swri_console::ConsoleMaster master; + swri_console::ConsoleMaster master(argc, argv); master.createNewWindow(); app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); int result = app.exec(); diff --git a/src/ros_thread.cpp b/src/ros_thread.cpp index 6ac67e5..ce1973d 100644 --- a/src/ros_thread.cpp +++ b/src/ros_thread.cpp @@ -33,12 +33,11 @@ using namespace swri_console; -RosThread::RosThread() : +RosThread::RosThread(int argc, char** argv) : is_connected_(false), is_running_(true) { - int argc = QCoreApplication::argc(); - ros::init(argc, QCoreApplication::argv(), "swri_console", + ros::init(argc, argv, "swri_console", ros::init_options::AnonymousName | ros::init_options::NoRosout); }