add main window, compile Qt .ui file v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Mon, 24 Sep 2018 16:11:19 +0200
branchv_0
changeset 4 1622c087f3ea
parent 3 0d857519a4c9
child 5 0c07be8dad00
add main window, compile Qt .ui file
nbproject/configurations.xml
src/CMakeLists.txt
src/RelpipeChartMainWindow.cpp
src/RelpipeChartMainWindow.h
src/RelpipeChartMainWindow.ui
src/relpipe-out-chart.cpp
--- 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 @@
     </logicalFolder>
     <df root="." name="0">
       <df name="src">
+        <in>RelpipeChartMainWindow.cpp</in>
+        <in>RelpipeChartMainWindow.h</in>
+        <in>RelpipeChartMainWindow.ui</in>
         <in>relpipe-out-chart.cpp</in>
       </df>
     </df>
@@ -56,6 +59,12 @@
                    displayName="relpipe-out-chart_autogen"
                    projectFiles="true"
                    root="build/Debug/src/relpipe-out-chart_autogen">
+      <logicalFolder name="EWIEGA46WW" displayName="EWIEGA46WW" projectFiles="true">
+        <itemPath>build/Debug/src/relpipe-out-chart_autogen/EWIEGA46WW/moc_RelpipeChartMainWindow.cpp</itemPath>
+      </logicalFolder>
+      <logicalFolder name="include" displayName="include" projectFiles="true">
+        <itemPath>build/Debug/src/relpipe-out-chart_autogen/include/ui_RelpipeChartMainWindow.h</itemPath>
+      </logicalFolder>
       <itemPath>build/Debug/src/relpipe-out-chart_autogen/mocs_compilation.cpp</itemPath>
     </logicalFolder>
     <logicalFolder name="ExternalFiles"
@@ -80,7 +89,9 @@
         <rebuildPropChanged>false</rebuildPropChanged>
       </toolsSet>
       <flagsDictionary>
-        <element flagsID="0" commonFlags="-fsanitize=address -fPIC -std=gnu++11"/>
+        <element flagsID="0"
+                 commonFlags="-mtune=generic -march=x86-64 -std=gnu++11 -fsanitize=address -fPIC -fstack-protector-strong"/>
+        <element flagsID="1" commonFlags="-std=c++14"/>
       </flagsDictionary>
       <codeAssistance>
       </codeAssistance>
@@ -90,25 +101,6 @@
           <buildCommand>${MAKE} -f Makefile</buildCommand>
           <cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
           <executablePath>build/Debug/src/relpipe-out-chart</executablePath>
-          <ccTool>
-            <incDir>
-              <pElem>build/Debug/src</pElem>
-              <pElem>src</pElem>
-              <pElem>build/Debug/src/relpipe-out-chart_autogen/include</pElem>
-              <pElem>../relpipe-lib-reader.cpp/include</pElem>
-              <pElem>../relpipe-lib-cli.cpp/include</pElem>
-              <pElem>/usr/include/x86_64-linux-gnu/qt5</pElem>
-              <pElem>/usr/include/x86_64-linux-gnu/qt5/QtWidgets</pElem>
-              <pElem>/usr/include/x86_64-linux-gnu/qt5/QtGui</pElem>
-              <pElem>/usr/include/x86_64-linux-gnu/qt5/QtCore</pElem>
-              <pElem>/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++</pElem>
-            </incDir>
-            <preprocessorList>
-              <Elem>QT_CORE_LIB</Elem>
-              <Elem>QT_GUI_LIB</Elem>
-              <Elem>QT_WIDGETS_LIB</Elem>
-            </preprocessorList>
-          </ccTool>
         </makeTool>
         <preBuild>
           <preBuildCommandWorkingDir>build/Debug</preBuildCommandWorkingDir>
@@ -119,6 +111,13 @@
       <item path="/usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp"
             ex="false"
             tool="1"
+            flavor2="11">
+        <ccTool flags="1">
+        </ccTool>
+      </item>
+      <item path="build/Debug/src/relpipe-out-chart_autogen/EWIEGA46WW/moc_RelpipeChartMainWindow.cpp"
+            ex="true"
+            tool="3"
             flavor2="0">
       </item>
       <item path="build/Debug/src/relpipe-out-chart_autogen/mocs_compilation.cpp"
@@ -128,15 +127,77 @@
         <ccTool flags="0">
         </ccTool>
       </item>
+      <folder path="0">
+        <ccTool>
+          <incDir>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5/QtCore</pElem>
+          </incDir>
+        </ccTool>
+      </folder>
+      <folder path="home/fiki/projekty/relational-pipes/src/relpipe-out-chart.qt.cpp/build/Debug/src/relpipe-out-chart_autogen">
+        <ccTool>
+          <incDir>
+            <pElem>build/Debug/src/relpipe-out-chart_autogen/EWIEGA46WW</pElem>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5/QtCore</pElem>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5/QtGui</pElem>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5/QtWidgets</pElem>
+            <pElem>build/Debug/src/relpipe-out-chart_autogen/include</pElem>
+            <pElem>src</pElem>
+            <pElem>build/Debug/src/relpipe-out-chart_autogen</pElem>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5</pElem>
+            <pElem>build/Debug/src</pElem>
+          </incDir>
+        </ccTool>
+      </folder>
       <folder path="usr/share/cmake-3.10/Modules">
         <ccTool>
           <incDir>
+            <pElem>build/Debug/src</pElem>
+            <pElem>src</pElem>
+            <pElem>build/Debug/src/relpipe-out-chart_autogen/include</pElem>
+            <pElem>../relpipe-lib-reader.cpp/include</pElem>
+            <pElem>../relpipe-lib-cli.cpp/include</pElem>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5</pElem>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5/QtWidgets</pElem>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5/QtGui</pElem>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5/QtCore</pElem>
+            <pElem>/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++</pElem>
             <pElem>/usr/include</pElem>
           </incDir>
+          <preprocessorList>
+            <Elem>QT_CORE_LIB</Elem>
+            <Elem>QT_GUI_LIB</Elem>
+            <Elem>QT_WIDGETS_LIB</Elem>
+          </preprocessorList>
+        </ccTool>
+      </folder>
+      <item path="src/RelpipeChartMainWindow.cpp" ex="false" tool="1" flavor2="8">
+        <ccTool flags="0">
+          <incDir>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5/QtWidgets</pElem>
+            <pElem>build/Debug/src/relpipe-out-chart_autogen/include</pElem>
+            <pElem>src</pElem>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5/QtGui</pElem>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5</pElem>
+            <pElem>build/Debug/src</pElem>
+          </incDir>
         </ccTool>
-      </folder>
+      </item>
       <item path="src/relpipe-out-chart.cpp" ex="false" tool="1" flavor2="8">
         <ccTool flags="0">
+          <incDir>
+            <pElem>../relpipe-lib-cli.cpp/include/relpipe/cli</pElem>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5/QtWidgets</pElem>
+            <pElem>src</pElem>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5/QtGui</pElem>
+            <pElem>../relpipe-lib-reader.cpp/include/relpipe/reader</pElem>
+            <pElem>../relpipe-lib-reader.cpp/include/relpipe/reader/handlers</pElem>
+            <pElem>build/Debug/src/relpipe-out-chart_autogen/include</pElem>
+            <pElem>../relpipe-lib-cli.cpp/include</pElem>
+            <pElem>../relpipe-lib-reader.cpp/include</pElem>
+            <pElem>/usr/include/x86_64-linux-gnu/qt5</pElem>
+            <pElem>build/Debug/src</pElem>
+          </incDir>
         </ccTool>
       </item>
     </conf>
@@ -169,6 +230,12 @@
           <preBuildFirst>true</preBuildFirst>
         </preBuild>
       </makefileType>
+      <item path="src/RelpipeChartMainWindow.cpp" ex="false" tool="1" flavor2="0">
+      </item>
+      <item path="src/RelpipeChartMainWindow.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="src/RelpipeChartMainWindow.ui" ex="false" tool="3" flavor2="0">
+      </item>
       <item path="src/relpipe-out-chart.cpp" ex="false" tool="1" flavor2="0">
       </item>
     </conf>
--- 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)
--- /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() {
+}
--- /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 */
--- /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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>RelpipeChartMainWindow</class>
+ <widget class="QMainWindow" name="RelpipeChartMainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>800</width>
+    <height>600</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>RelpipeChartMainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralwidget"/>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>800</width>
+     <height>30</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--- 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 <relpipe/reader/RelationalReader.h>
 #include <relpipe/reader/RelpipeReaderException.h>
 
+#include "RelpipeChartMainWindow.h"
 
 using namespace relpipe::cli;
 using namespace relpipe::reader;
@@ -21,6 +22,13 @@
 	std::shared_ptr<RelationalReader> 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;
 }