From 0cfcc1d5952f6360cc142410b3395ba8cca5cf4a Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Thu, 10 May 2018 18:41:14 +0200 Subject: [PATCH] initial import --- .gitignore | 2 ++ CMakeLists.txt | 5 +++++ source/CMakeLists.txt | 27 +++++++++++++++++++++++++++ source/LogoTest.cpp | 11 +++++++++++ source/mainwindow.cpp | 16 ++++++++++++++++ source/mainwindow.h | 19 +++++++++++++++++++ source/mainwindow.ui | 31 +++++++++++++++++++++++++++++++ 7 files changed, 111 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 source/CMakeLists.txt create mode 100644 source/LogoTest.cpp create mode 100644 source/mainwindow.cpp create mode 100644 source/mainwindow.h create mode 100644 source/mainwindow.ui diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c55df6d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +compile_commands.json +_build diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..908eff4 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.5) + +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +add_subdirectory(source) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt new file mode 100644 index 0000000..a28384f --- /dev/null +++ b/source/CMakeLists.txt @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 3.6) + +project(LogoTest LANGUAGES CXX) + +find_package(Qt5Widgets REQUIRED) + +set(CMAKE_AUTOMOC ON) + +qt5_wrap_ui(UI_HEADERS + mainwindow.ui +) + +add_executable(${PROJECT_NAME} + LogoTest.cpp + mainwindow.cpp + ${UI_HEADERS} +) + +target_include_directories(${PROJECT_NAME} + PRIVATE + ${CMAKE_CURRENT_BINARY_DIR} +) + +target_link_libraries(${PROJECT_NAME} + PRIVATE + Qt5::Widgets +) diff --git a/source/LogoTest.cpp b/source/LogoTest.cpp new file mode 100644 index 0000000..30539a1 --- /dev/null +++ b/source/LogoTest.cpp @@ -0,0 +1,11 @@ +#include "mainwindow.h" +#include + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + MainWindow mainWindow; + mainWindow.show(); + + return app.exec(); +} diff --git a/source/mainwindow.cpp b/source/mainwindow.cpp new file mode 100644 index 0000000..c41b6fd --- /dev/null +++ b/source/mainwindow.cpp @@ -0,0 +1,16 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::MainWindow) +{ + ui->setupUi(this); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + + diff --git a/source/mainwindow.h b/source/mainwindow.h new file mode 100644 index 0000000..2847620 --- /dev/null +++ b/source/mainwindow.h @@ -0,0 +1,19 @@ +#pragma once + +#include + +namespace Ui { + class MainWindow; +}; + +class MainWindow : public QMainWindow +{ + Q_OBJECT + + public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + + private: + Ui::MainWindow *ui; +}; diff --git a/source/mainwindow.ui b/source/mainwindow.ui new file mode 100644 index 0000000..6e80a62 --- /dev/null +++ b/source/mainwindow.ui @@ -0,0 +1,31 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + MainWindow + + + + + + 0 + 0 + 800 + 19 + + + + + + + +