aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-12-02 17:03:29 +0100
committerlonkaars <loek@pipeframe.xyz>2022-12-02 17:03:29 +0100
commit652450629442677317fc45c3f5cfb8ab1cfac6f2 (patch)
tree80ebc746a43e74a7b2a8e600fd2101f2693ae855
parentbb7ec2144fecd1c7a41d14cc42f144c9923d70dc (diff)
qt gui starting point
-rw-r--r--confui/.gitignore1
-rw-r--r--confui/confui.pro8
-rw-r--r--confui/mainwindow.cpp20
-rw-r--r--confui/mainwindow.h7
-rw-r--r--confui/ui_automations.cpp18
-rw-r--r--confui/ui_automations.h15
-rw-r--r--confui/ui_node_overview.cpp9
-rw-r--r--confui/ui_node_overview.h15
8 files changed, 87 insertions, 6 deletions
diff --git a/confui/.gitignore b/confui/.gitignore
index 383d0c8..d120e5e 100644
--- a/confui/.gitignore
+++ b/confui/.gitignore
@@ -24,7 +24,6 @@ Makefile*
*.prl
*.app
moc_*.cpp
-ui_*.h
qrc_*.cpp
Thumbs.db
*.res
diff --git a/confui/confui.pro b/confui/confui.pro
index 8c38727..761cd31 100644
--- a/confui/confui.pro
+++ b/confui/confui.pro
@@ -3,11 +3,15 @@ QT += core gui widgets
SOURCES += \
main.cpp \
mainwindow.cpp \
- mesh_connector.cpp
+ mesh_connector.cpp \
+ ui_automations.cpp \
+ ui_node_overview.cpp
HEADERS += \
mainwindow.h \
- mesh_connector.h
+ mesh_connector.h \
+ ui_automations.h \
+ ui_node_overview.h
CONFIG += c++17
diff --git a/confui/mainwindow.cpp b/confui/mainwindow.cpp
index 93ca8d7..b6d952b 100644
--- a/confui/mainwindow.cpp
+++ b/confui/mainwindow.cpp
@@ -1,7 +1,27 @@
+#include <QMenuBar>
+#include <QGridLayout>
+#include <QTabWidget>
+
#include "mainwindow.h"
+#include "ui_automations.h"
+#include "ui_node_overview.h"
CDMainWindow::CDMainWindow(QWidget *parent) : QMainWindow(parent) {
this->mesh_connector = new CDMeshConnector();
+
+ QMenuBar* menu_bar = new QMenuBar(this);
+ menu_bar->addMenu("ayo");
+
+ QTabWidget* tab_bar_widget = new QTabWidget(this);
+ this->automations_widget = new CDAutomationsWidget(this);
+ this->node_overview_widget = new CDNodeOverviewWidget(this);
+
+ tab_bar_widget->addTab(this->automations_widget, "automations");
+ tab_bar_widget->addTab(this->node_overview_widget, "node overview");
+
+ setMenuBar(menu_bar);
+ setCentralWidget(tab_bar_widget);
+ setWindowTitle("confui");
}
CDMainWindow::~CDMainWindow() {
diff --git a/confui/mainwindow.h b/confui/mainwindow.h
index da98cb4..61b2f24 100644
--- a/confui/mainwindow.h
+++ b/confui/mainwindow.h
@@ -7,15 +7,16 @@
#include "mesh_connector.h"
-QT_BEGIN_NAMESPACE
-namespace Ui { class CDMainWindow; }
-QT_END_NAMESPACE
+class CDAutomationsWidget;
+class CDNodeOverviewWidget;
class CDMainWindow : public QMainWindow {
Q_OBJECT
public:
CDMeshConnector *mesh_connector = nullptr;
+ CDAutomationsWidget* automations_widget = nullptr;
+ CDNodeOverviewWidget* node_overview_widget = nullptr;
CDMainWindow(QWidget *parent = nullptr);
~CDMainWindow();
diff --git a/confui/ui_automations.cpp b/confui/ui_automations.cpp
new file mode 100644
index 0000000..94c1618
--- /dev/null
+++ b/confui/ui_automations.cpp
@@ -0,0 +1,18 @@
+#include <QVBoxLayout>
+#include <QWidget>
+#include <QLabel>
+
+#include "ui_automations.h"
+
+CDAutomationsWidget::~CDAutomationsWidget() { }
+CDAutomationsWidget::CDAutomationsWidget(CDMainWindow* main_window) : QWidget(main_window) {
+ this->mainwindow = main_window;
+
+ QVBoxLayout* main_layout = new QVBoxLayout;
+
+ QLabel* label_test = new QLabel("Automations widget test");
+ main_layout->addWidget(label_test);
+
+ setLayout(main_layout);
+}
+
diff --git a/confui/ui_automations.h b/confui/ui_automations.h
new file mode 100644
index 0000000..c60bf9f
--- /dev/null
+++ b/confui/ui_automations.h
@@ -0,0 +1,15 @@
+#pragma once
+
+#include <QMainWindow>
+
+#include "mainwindow.h"
+
+class CDAutomationsWidget : public QWidget {
+ Q_OBJECT
+
+public:
+ CDMainWindow *mainwindow = nullptr;
+
+ CDAutomationsWidget(CDMainWindow *main_window = nullptr);
+ virtual ~CDAutomationsWidget();
+};
diff --git a/confui/ui_node_overview.cpp b/confui/ui_node_overview.cpp
new file mode 100644
index 0000000..eb6f976
--- /dev/null
+++ b/confui/ui_node_overview.cpp
@@ -0,0 +1,9 @@
+#include <QWidget>
+#include <QLabel>
+
+#include "ui_node_overview.h"
+
+CDNodeOverviewWidget::~CDNodeOverviewWidget() { }
+CDNodeOverviewWidget::CDNodeOverviewWidget(CDMainWindow* main_window) : QWidget(main_window) {
+ this->mainwindow = main_window;
+}
diff --git a/confui/ui_node_overview.h b/confui/ui_node_overview.h
new file mode 100644
index 0000000..bf5f120
--- /dev/null
+++ b/confui/ui_node_overview.h
@@ -0,0 +1,15 @@
+#pragma once
+
+#include <QMainWindow>
+
+#include "mainwindow.h"
+
+class CDNodeOverviewWidget : public QWidget {
+ Q_OBJECT
+
+public:
+ CDMainWindow *mainwindow = nullptr;
+
+ CDNodeOverviewWidget(CDMainWindow *main_window = nullptr);
+ virtual ~CDNodeOverviewWidget();
+};