aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-12-01 14:53:37 +0100
committerlonkaars <loek@pipeframe.xyz>2022-12-01 14:53:37 +0100
commit2f5d58c7eae101c3803a63ca11315aec5cd6e1f0 (patch)
treed7167064cbada7474e8c762ce5794038e5e9ba99
parent390726a83913552e63d4499d216ea6f370d6adad (diff)
folder restructure of confui
-rw-r--r--confui/.gitignore4
-rw-r--r--confui/QtClient.pro24
-rw-r--r--confui/confui.pro11
-rw-r--r--confui/main.cpp11
-rw-r--r--confui/mainwindow.cpp11
-rw-r--r--confui/mainwindow.h19
-rw-r--r--confui/mainwindow.ui22
-rw-r--r--confui/makefile14
8 files changed, 38 insertions, 78 deletions
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 <QApplication>
-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 <QMainWindow>
#include <QtSerialPort/QSerialPort>
@@ -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 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>800</width>
- <height>600</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>MainWindow</string>
- </property>
- <widget class="QWidget" name="centralwidget"/>
- <widget class="QMenuBar" name="menubar"/>
- <widget class="QStatusBar" name="statusbar"/>
- </widget>
- <resources/>
- <connections/>
-</ui>
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 $@