-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
project(gui LANGUAGES CXX) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
set(CMAKE_AUTOUIC ON) | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
# QtCreator supports the following variables for Android, which are identical to qmake Android variables. | ||
# Check https://doc.qt.io/qt/deployment-android.html for more information. | ||
# They need to be set before the find_package( ...) calls below. | ||
|
||
#if(ANDROID) | ||
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") | ||
# if (ANDROID_ABI STREQUAL "armeabi-v7a") | ||
# set(ANDROID_EXTRA_LIBS | ||
# ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libcrypto.so | ||
# ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libssl.so) | ||
# endif() | ||
#endif() | ||
|
||
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED) | ||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED) | ||
|
||
set(PROJECT_SOURCES | ||
main.cpp | ||
../davis_one/davis.h | ||
../davis_one/davis.cpp | ||
davis_gui.cpp | ||
davis_gui.h | ||
davis_gui.ui | ||
) | ||
|
||
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) | ||
qt_add_executable(gui | ||
${PROJECT_SOURCES} | ||
) | ||
else() | ||
if(ANDROID) | ||
add_library(gui SHARED | ||
${PROJECT_SOURCES} | ||
) | ||
else() | ||
add_executable(gui | ||
${PROJECT_SOURCES} | ||
) | ||
endif() | ||
endif() | ||
|
||
target_link_libraries(gui PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "davis_gui.h" | ||
#include "./ui_davis_gui.h" | ||
|
||
#include "../davis_one/davis.h" | ||
|
||
DavisGUI::DavisGUI(QWidget *parent) | ||
: QMainWindow(parent) | ||
, ui(new Ui::DavisGUI) | ||
{ | ||
ui->setupUi(this); | ||
//std::vector<double> test_data = {5,6,8}; | ||
//dv::show(test_data); | ||
} | ||
|
||
DavisGUI::~DavisGUI() | ||
{ | ||
delete ui; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef DAVISGUI_H | ||
#define DAVISGUI_H | ||
|
||
#include <QMainWindow> | ||
|
||
QT_BEGIN_NAMESPACE | ||
namespace Ui { class DavisGUI; } | ||
QT_END_NAMESPACE | ||
|
||
class DavisGUI : public QMainWindow | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
DavisGUI(QWidget *parent = nullptr); | ||
~DavisGUI(); | ||
|
||
private: | ||
Ui::DavisGUI *ui; | ||
}; | ||
#endif // DAVISGUI_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>DavisGUI</class> | ||
<widget class="QMainWindow" name="DavisGUI"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>800</width> | ||
<height>600</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string>DavisGUI</string> | ||
</property> | ||
<widget class="QWidget" name="centralwidget"/> | ||
<widget class="QMenuBar" name="menubar"/> | ||
<widget class="QStatusBar" name="statusbar"/> | ||
</widget> | ||
<resources/> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "davis_gui.h" | ||
|
||
#include <QApplication> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
QApplication a(argc, argv); | ||
DavisGUI w; | ||
w.show(); | ||
return a.exec(); | ||
} |