# HG changeset patch # User František Kučera # Date 1537798279 -7200 # Node ID 1622c087f3ead51b5394e36027fc2c12aa2aaa6d # Parent 0d857519a4c9fb2bc18c2a7bb1e4efc871f9306c add main window, compile Qt .ui file diff -r 0d857519a4c9 -r 1622c087f3ea nbproject/configurations.xml --- a/nbproject/configurations.xml Mon Sep 24 14:03:46 2018 +0200 +++ b/nbproject/configurations.xml Mon Sep 24 16:11:19 2018 +0200 @@ -49,6 +49,9 @@ + RelpipeChartMainWindow.cpp + RelpipeChartMainWindow.h + RelpipeChartMainWindow.ui relpipe-out-chart.cpp @@ -56,6 +59,12 @@ displayName="relpipe-out-chart_autogen" projectFiles="true" root="build/Debug/src/relpipe-out-chart_autogen"> + + build/Debug/src/relpipe-out-chart_autogen/EWIEGA46WW/moc_RelpipeChartMainWindow.cpp + + + build/Debug/src/relpipe-out-chart_autogen/include/ui_RelpipeChartMainWindow.h + build/Debug/src/relpipe-out-chart_autogen/mocs_compilation.cpp false - + + @@ -90,25 +101,6 @@ ${MAKE} -f Makefile ${MAKE} -f Makefile clean build/Debug/src/relpipe-out-chart - - - build/Debug/src - src - build/Debug/src/relpipe-out-chart_autogen/include - ../relpipe-lib-reader.cpp/include - ../relpipe-lib-cli.cpp/include - /usr/include/x86_64-linux-gnu/qt5 - /usr/include/x86_64-linux-gnu/qt5/QtWidgets - /usr/include/x86_64-linux-gnu/qt5/QtGui - /usr/include/x86_64-linux-gnu/qt5/QtCore - /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ - - - QT_CORE_LIB - QT_GUI_LIB - QT_WIDGETS_LIB - - build/Debug @@ -119,6 +111,13 @@ + + + + + + + + /usr/include/x86_64-linux-gnu/qt5/QtCore + + + + + + + build/Debug/src/relpipe-out-chart_autogen/EWIEGA46WW + /usr/include/x86_64-linux-gnu/qt5/QtCore + /usr/include/x86_64-linux-gnu/qt5/QtGui + /usr/include/x86_64-linux-gnu/qt5/QtWidgets + build/Debug/src/relpipe-out-chart_autogen/include + src + build/Debug/src/relpipe-out-chart_autogen + /usr/include/x86_64-linux-gnu/qt5 + build/Debug/src + + + + build/Debug/src + src + build/Debug/src/relpipe-out-chart_autogen/include + ../relpipe-lib-reader.cpp/include + ../relpipe-lib-cli.cpp/include + /usr/include/x86_64-linux-gnu/qt5 + /usr/include/x86_64-linux-gnu/qt5/QtWidgets + /usr/include/x86_64-linux-gnu/qt5/QtGui + /usr/include/x86_64-linux-gnu/qt5/QtCore + /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ /usr/include + + QT_CORE_LIB + QT_GUI_LIB + QT_WIDGETS_LIB + + + + + + + /usr/include/x86_64-linux-gnu/qt5/QtWidgets + build/Debug/src/relpipe-out-chart_autogen/include + src + /usr/include/x86_64-linux-gnu/qt5/QtGui + /usr/include/x86_64-linux-gnu/qt5 + build/Debug/src + - + + + ../relpipe-lib-cli.cpp/include/relpipe/cli + /usr/include/x86_64-linux-gnu/qt5/QtWidgets + src + /usr/include/x86_64-linux-gnu/qt5/QtGui + ../relpipe-lib-reader.cpp/include/relpipe/reader + ../relpipe-lib-reader.cpp/include/relpipe/reader/handlers + build/Debug/src/relpipe-out-chart_autogen/include + ../relpipe-lib-cli.cpp/include + ../relpipe-lib-reader.cpp/include + /usr/include/x86_64-linux-gnu/qt5 + build/Debug/src + @@ -169,6 +230,12 @@ true + + + + + + diff -r 0d857519a4c9 -r 1622c087f3ea src/CMakeLists.txt --- a/src/CMakeLists.txt Mon Sep 24 14:03:46 2018 +0200 +++ b/src/CMakeLists.txt Mon Sep 24 16:11:19 2018 +0200 @@ -1,22 +1,30 @@ set(EXECUTABLE_FILE "relpipe-out-chart") -# Qt: +# Qt libraries: set(CMAKE_INCLUDE_CURRENT_DIR ON) # Find includes in corresponding build directories set(CMAKE_AUTOMOC ON) # Instruct CMake to run moc automatically when needed set(CMAKE_AUTOUIC ON) # Create code from a list of Qt designer ui files find_package(Qt5Widgets CONFIG REQUIRED) # Find the QtWidgets library +# Relpipe libraries: +INCLUDE(FindPkgConfig) +pkg_check_modules (RELPIPE_LIB_READER relpipe-lib-reader.cpp relpipe-lib-cli.cpp) +include_directories(${RELPIPE_LIB_READER_INCLUDE_DIRS}) +link_directories(${RELPIPE_LIB_READER_LIBRARY_DIRS}) + # Add ASan AddressSanitizer set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address") # From ASan wiki: "To get nicer stack traces in error messages add -fno-omit-frame-pointer." -INCLUDE(FindPkgConfig) -pkg_check_modules (RELPIPE_LIB_READER relpipe-lib-reader.cpp relpipe-lib-cli.cpp) -include_directories(${RELPIPE_LIB_READER_INCLUDE_DIRS}) -link_directories(${RELPIPE_LIB_READER_LIBRARY_DIRS}) +# Executable output: +add_executable( + ${EXECUTABLE_FILE} + RelpipeChartMainWindow.ui + RelpipeChartMainWindow.cpp + relpipe-out-chart.cpp +) -add_executable (${EXECUTABLE_FILE} relpipe-out-chart.cpp) - +# Link libraries: target_link_libraries(${EXECUTABLE_FILE} ${RELPIPE_LIB_READER_LIBRARIES}) target_link_libraries(${EXECUTABLE_FILE} Qt5::Widgets) diff -r 0d857519a4c9 -r 1622c087f3ea src/RelpipeChartMainWindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/RelpipeChartMainWindow.cpp Mon Sep 24 16:11:19 2018 +0200 @@ -0,0 +1,21 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +/* + * File: RelpipeChartMainWindow.cpp + * Author: Ing. František Kučera (frantovo.cz) + * + * Created on 24. září 2018, 15:53 + */ + +#include "RelpipeChartMainWindow.h" + +RelpipeChartMainWindow::RelpipeChartMainWindow() { + widget.setupUi(this); +} + +RelpipeChartMainWindow::~RelpipeChartMainWindow() { +} diff -r 0d857519a4c9 -r 1622c087f3ea src/RelpipeChartMainWindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/RelpipeChartMainWindow.h Mon Sep 24 16:11:19 2018 +0200 @@ -0,0 +1,28 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +/* + * File: RelpipeChartMainWindow.h + * Author: Ing. František Kučera (frantovo.cz) + * + * Created on 24. září 2018, 15:53 + */ + +#ifndef _RELPIPECHARTMAINWINDOW_H +#define _RELPIPECHARTMAINWINDOW_H + +#include "ui_RelpipeChartMainWindow.h" + +class RelpipeChartMainWindow : public QMainWindow { + Q_OBJECT +public: + RelpipeChartMainWindow(); + virtual ~RelpipeChartMainWindow(); +private: + Ui::RelpipeChartMainWindow widget; +}; + +#endif /* _RELPIPECHARTMAINWINDOW_H */ diff -r 0d857519a4c9 -r 1622c087f3ea src/RelpipeChartMainWindow.ui --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/RelpipeChartMainWindow.ui Mon Sep 24 16:11:19 2018 +0200 @@ -0,0 +1,31 @@ + + + RelpipeChartMainWindow + + + + 0 + 0 + 800 + 600 + + + + RelpipeChartMainWindow + + + + + + 0 + 0 + 800 + 30 + + + + + + + + diff -r 0d857519a4c9 -r 1622c087f3ea src/relpipe-out-chart.cpp --- a/src/relpipe-out-chart.cpp Mon Sep 24 14:03:46 2018 +0200 +++ b/src/relpipe-out-chart.cpp Mon Sep 24 16:11:19 2018 +0200 @@ -8,6 +8,7 @@ #include #include +#include "RelpipeChartMainWindow.h" using namespace relpipe::cli; using namespace relpipe::reader; @@ -21,6 +22,13 @@ std::shared_ptr reader(Factory::create(std::cin)); int resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; + + RelpipeChartMainWindow window; + window.resize(640, 480); + window.show(); + + app.exec(); + //return app.exec(); return resultCode; }