From 2f5d58c7eae101c3803a63ca11315aec5cd6e1f0 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 1 Dec 2022 14:53:37 +0100 Subject: folder restructure of confui --- confui/.gitignore | 4 +--- confui/QtClient.pro | 24 ------------------------ confui/confui.pro | 11 +++++++++++ confui/main.cpp | 11 +++++------ confui/mainwindow.cpp | 11 ++--------- confui/mainwindow.h | 19 +++++-------------- confui/mainwindow.ui | 22 ---------------------- confui/makefile | 14 ++++++++++++++ 8 files changed, 38 insertions(+), 78 deletions(-) delete mode 100644 confui/QtClient.pro create mode 100644 confui/confui.pro delete mode 100644 confui/mainwindow.ui create mode 100644 confui/makefile diff --git a/confui/.gitignore b/confui/.gitignore index fab7372..73a7ada 100644 --- a/confui/.gitignore +++ b/confui/.gitignore @@ -1,6 +1,3 @@ -# This file is used to ignore files which are generated -# ---------------------------------------------------------------------------- - *~ *.autosave *.a @@ -71,3 +68,4 @@ Thumbs.db *.dll *.exe +confui.mk diff --git a/confui/QtClient.pro b/confui/QtClient.pro deleted file mode 100644 index b915c09..0000000 --- a/confui/QtClient.pro +++ /dev/null @@ -1,24 +0,0 @@ -QT += core gui - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -CONFIG += c++17 - -# You can make your code fail to compile if it uses deprecated APIs. -# In order to do so, uncomment the following line. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - -SOURCES += \ - main.cpp \ - mainwindow.cpp - -HEADERS += \ - mainwindow.h - -FORMS += \ - mainwindow.ui - -# Default rules for deployment. -qnx: target.path = /tmp/$${TARGET}/bin -else: unix:!android: target.path = /opt/$${TARGET}/bin -!isEmpty(target.path): INSTALLS += target diff --git a/confui/confui.pro b/confui/confui.pro new file mode 100644 index 0000000..1d2ed4d --- /dev/null +++ b/confui/confui.pro @@ -0,0 +1,11 @@ +QT += core gui widgets + +SOURCES += \ + main.cpp \ + mainwindow.cpp + +HEADERS += \ + mainwindow.h + +CONFIG += c++17 + diff --git a/confui/main.cpp b/confui/main.cpp index fd3e533..ab8ae38 100644 --- a/confui/main.cpp +++ b/confui/main.cpp @@ -2,10 +2,9 @@ #include -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - MainWindow w; - w.show(); - return a.exec(); +int main(int argc, char *argv[]) { + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); } diff --git a/confui/mainwindow.cpp b/confui/mainwindow.cpp index 41a26bd..3bc79b5 100644 --- a/confui/mainwindow.cpp +++ b/confui/mainwindow.cpp @@ -1,15 +1,8 @@ #include "mainwindow.h" -#include "ui_mainwindow.h" -MainWindow::MainWindow(QWidget *parent) - : QMainWindow(parent) - , ui(new Ui::MainWindow) -{ - ui->setupUi(this); +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { } -MainWindow::~MainWindow() -{ - delete ui; +MainWindow::~MainWindow() { } diff --git a/confui/mainwindow.h b/confui/mainwindow.h index 57eb614..61402fc 100644 --- a/confui/mainwindow.h +++ b/confui/mainwindow.h @@ -1,5 +1,4 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#pragma once #include #include @@ -10,18 +9,10 @@ QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE -class MainWindow : public QMainWindow -{ - Q_OBJECT +class MainWindow : public QMainWindow { + Q_OBJECT public: - MainWindow(QWidget *parent = nullptr); - ~MainWindow(); - -private slots: - void on_pushButton_clicked(); - -private: - Ui::MainWindow *ui; + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); }; -#endif // MAINWINDOW_H diff --git a/confui/mainwindow.ui b/confui/mainwindow.ui deleted file mode 100644 index b232854..0000000 --- a/confui/mainwindow.ui +++ /dev/null @@ -1,22 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - MainWindow - - - - - - - - diff --git a/confui/makefile b/confui/makefile new file mode 100644 index 0000000..20a7c7e --- /dev/null +++ b/confui/makefile @@ -0,0 +1,14 @@ +all: confui + +ifeq ($(wildcard confui.mk),) +confui.mk: + qmake confui.pro -o confui.mk +endif + +include confui.mk + +OBJECTS += $(patsubst %.c,%.o, $(wildcard ../shared/*.c)) +confui: $(OBJECTS) + +../shared/%.o: ../shared/%.c + $(CC) -c $(CFLAGS) -w $< -o $@ -- cgit v1.2.3