--- a/cadMousePro-gui/nbproject/configurations.xml Thu Aug 29 20:23:37 2019 +0200
+++ b/cadMousePro-gui/nbproject/configurations.xml Thu Aug 29 22:20:18 2019 +0200
@@ -41,7 +41,27 @@
<configurationDescriptor version="100">
<logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
<df root="." name="0">
+ <df name="build">
+ <df name="Debug">
+ <df name="src">
+ <df name="generated-sources">
+ <in>Proxy.cpp</in>
+ </df>
+ </df>
+ </df>
+ <df name="qt">
+ <df name="src">
+ <df name="cadMousePro-gui_autogen">
+ <in>mocs_compilation.cpp</in>
+ </df>
+ <df name="generated-sources">
+ <in>Proxy.cpp</in>
+ </df>
+ </df>
+ </df>
+ </df>
<df name="src">
+ <in>MouseMainWindow.h</in>
<in>cadMouseProGUI.cpp</in>
</df>
</df>
@@ -83,7 +103,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>
@@ -93,20 +115,7 @@
<buildCommand>${MAKE} -f Makefile</buildCommand>
<cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
<executablePath>build/Debug/src/cadMousePro-gui</executablePath>
- <ccTool>
- <incDir>
- <pElem>build/Debug/src</pElem>
- <pElem>src</pElem>
- <pElem>build/Debug/src/cadMousePro-gui_autogen/include</pElem>
- <pElem>/usr/include/x86_64-linux-gnu/qt5</pElem>
- <pElem>/usr/include/x86_64-linux-gnu/qt5/QtDBus</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_DBUS_LIB</Elem>
- </preprocessorList>
+ <ccTool flags="-fsanitize=address -fPIC -std=gnu++11">
</ccTool>
</makeTool>
<preBuild>
@@ -119,6 +128,8 @@
ex="false"
tool="1"
flavor2="11">
+ <ccTool flags="1">
+ </ccTool>
</item>
<item path="build/Debug/src/cadMousePro-gui_autogen/S5VNLJ26FI/moc_Proxy.cpp"
ex="true"
@@ -137,6 +148,79 @@
tool="1"
flavor2="8">
<ccTool flags="0">
+ </ccTool>
+ </item>
+ <item path="build/qt/src/cadMousePro-gui_autogen/mocs_compilation.cpp"
+ ex="false"
+ tool="1"
+ flavor2="8">
+ <ccTool flags="0">
+ </ccTool>
+ </item>
+ <item path="build/qt/src/generated-sources/Proxy.cpp"
+ ex="false"
+ tool="1"
+ flavor2="8">
+ <ccTool flags="0">
+ </ccTool>
+ </item>
+ <folder path="0/build/Debug">
+ <ccTool>
+ <incDir>
+ <pElem>build/Debug/src/generated-sources</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5/QtCore</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5/QtDBus</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5</pElem>
+ <pElem>build/Debug/src</pElem>
+ </incDir>
+ <preprocessorList>
+ <Elem>QT_CORE_LIB</Elem>
+ <Elem>QT_DBUS_LIB</Elem>
+ <Elem>QT_GUI_LIB</Elem>
+ <Elem>QT_WIDGETS_LIB</Elem>
+ </preprocessorList>
+ </ccTool>
+ </folder>
+ <folder path="0/build/qt/src/cadMousePro-gui_autogen">
+ <ccTool>
+ <incDir>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5/QtCore</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5/QtDBus</pElem>
+ <pElem>build/qt/src/generated-sources</pElem>
+ <pElem>build/qt/src/cadMousePro-gui_autogen/S5VNLJ26FI</pElem>
+ <pElem>build/qt/src/cadMousePro-gui_autogen</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5</pElem>
+ <pElem>build/qt/src</pElem>
+ </incDir>
+ </ccTool>
+ </folder>
+ <folder path="0/build/qt/src/generated-sources">
+ <ccTool>
+ <incDir>
+ <pElem>build/qt/src/generated-sources</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5/QtCore</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5/QtDBus</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5</pElem>
+ <pElem>build/qt/src</pElem>
+ </incDir>
+ </ccTool>
+ </folder>
+ <folder path="0/src">
+ <ccTool>
+ <incDir>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5/QtCore</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5/QtDBus</pElem>
+ <pElem>build/Debug/src/generated-sources</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>build/Debug/src</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5</pElem>
+ </incDir>
+ </ccTool>
+ </folder>
+ <folder path="Modules">
+ <ccTool>
<incDir>
<pElem>build/Debug/src</pElem>
<pElem>src</pElem>
@@ -145,13 +229,34 @@
<pElem>/usr/include/x86_64-linux-gnu/qt5/QtDBus</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/x86_64-linux-gnu/qt5/QtWidgets</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5/QtGui</pElem>
+ <pElem>/usr/include</pElem>
</incDir>
<preprocessorList>
<Elem>QT_CORE_LIB</Elem>
<Elem>QT_DBUS_LIB</Elem>
+ <Elem>QT_GUI_LIB</Elem>
+ <Elem>QT_WIDGETS_LIB</Elem>
</preprocessorList>
</ccTool>
- </item>
+ </folder>
+ <folder path="cadMousePro-gui_autogen">
+ <ccTool>
+ <incDir>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5/QtCore</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5/QtDBus</pElem>
+ <pElem>build/Debug/src/generated-sources</pElem>
+ <pElem>build/Debug/src/cadMousePro-gui_autogen/S5VNLJ26FI</pElem>
+ <pElem>src</pElem>
+ <pElem>build/Debug/src/cadMousePro-gui_autogen/EWIEGA46WW</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5/QtGui</pElem>
+ <pElem>build/Debug/src/cadMousePro-gui_autogen</pElem>
+ <pElem>/usr/include/x86_64-linux-gnu/qt5</pElem>
+ <pElem>build/Debug/src</pElem>
+ </incDir>
+ </ccTool>
+ </folder>
<item path="src/cadMouseProGUI.cpp" ex="false" tool="1" flavor2="8">
<ccTool flags="0">
</ccTool>
@@ -186,6 +291,8 @@
<preBuildFirst>true</preBuildFirst>
</preBuild>
</makefileType>
+ <item path="src/MouseMainWindow.h" ex="false" tool="3" flavor2="0">
+ </item>
</conf>
</confs>
</configurationDescriptor>
--- a/cadMousePro-gui/src/CMakeLists.txt Thu Aug 29 20:23:37 2019 +0200
+++ b/cadMousePro-gui/src/CMakeLists.txt Thu Aug 29 22:20:18 2019 +0200
@@ -5,6 +5,7 @@
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(Qt5 CONFIG REQUIRED Core DBus)
+find_package(Qt5Widgets CONFIG REQUIRED)
# Add ASan AddressSanitizer
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
@@ -28,9 +29,11 @@
${EXECUTABLE_FILE}
${CMAKE_CURRENT_BINARY_DIR}/generated-sources/Proxy.h
${CMAKE_CURRENT_BINARY_DIR}/generated-sources/Proxy.cpp
+ MouseMainWindow.h
cadMouseProGUI.cpp
)
# Link libraries:
target_link_libraries(${EXECUTABLE_FILE} Qt5::DBus)
+target_link_libraries(${EXECUTABLE_FILE} Qt5::Widgets)
set_property(TARGET ${EXECUTABLE_FILE} PROPERTY INSTALL_RPATH_USE_LINK_PATH TRUE)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cadMousePro-gui/src/MouseMainWindow.h Thu Aug 29 22:20:18 2019 +0200
@@ -0,0 +1,35 @@
+/**
+ * cadMousePro
+ * Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#pragma once
+
+#include <QMainWindow>
+
+class MouseMainWindow : public QMainWindow {
+
+ Q_OBJECT
+public:
+ MouseMainWindow() {
+ resize(640, 480);
+ setWindowTitle("cadMousePro");
+
+ }
+
+ virtual ~MouseMainWindow() {
+ }
+
+};
\ No newline at end of file
--- a/cadMousePro-gui/src/cadMouseProGUI.cpp Thu Aug 29 20:23:37 2019 +0200
+++ b/cadMousePro-gui/src/cadMouseProGUI.cpp Thu Aug 29 22:20:18 2019 +0200
@@ -17,22 +17,27 @@
*/
#include <iostream>
-#include <QCoreApplication>
+#include <QApplication>
#include <QtDBus/QDBusConnection>
#include "generated-sources/Proxy.h"
+#include "MouseMainWindow.h"
int main(int argc, char** argv) {
std::wcout << L"cadMousePro GUI" << std::endl;
- QCoreApplication qtApplication(argc, argv);
+ QApplication qtApplication(argc, argv);
+
+ MouseMainWindow window;
+ window.show();
+
QDBusConnection connection = QDBusConnection::systemBus();
InfoGlobalcodeMouseCadMouseProInterface* proxy = new InfoGlobalcodeMouseCadMouseProInterface("info.globalcode.mouse.cadMousePro", "/info/globalcode/mouse/cadMousePro", connection, &qtApplication);
-
+
std::wcout << (proxy->isValid() ? L"connected" : L"disconnected") << std::endl;
std::wcout << (proxy->devicePresent() ? L"mouse found" : L"mouse not found") << std::endl;
std::wcout << L"mouse name: " << proxy->deviceName().toStdWString() << std::endl;