best so far

This commit is contained in:
BENEDEK 2024-05-14 11:30:26 +02:00
parent 8865e6c7b7
commit 1787f701e9
5 changed files with 33 additions and 15 deletions

View File

@ -28,7 +28,6 @@ find_package(Qt6 REQUIRED COMPONENTS Widgets)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
# qt_standard_project_setup()
file(GLOB_RECURSE SERVER_SOURCES "${CMAKE_SOURCE_DIR}/src/graph/server/*.cpp")
file(GLOB_RECURSE SERVER_UI "${CMAKE_SOURCE_DIR}/src/graph/server/*.ui")

View File

@ -9,16 +9,17 @@ namespace Ui {
class MainWindow;
}
namespace Graph::GUI {
class MainWindow : public QMainWindow {
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
QMenuBar *menuBar;
QToolBar *toolbar;
QStatusBar *statusBar;
private slots:
void on_actionExit_triggered();
private:
Ui::MainWindow *ui;
};
} // namespace Graph::GUI

View File

@ -1,10 +1,15 @@
#include <graph/server/gui/mainwindow.h>
#include <ui_mainwindow.h>
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) {
namespace Graph::GUI {
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow) {
ui->setupUi(this);
}
MainWindow::~MainWindow() {
delete ui;
MainWindow::~MainWindow() { delete ui; }
void MainWindow::on_actionExit_triggered() {
this->close();
}
} // namespace Graph::GUI

View File

@ -13,10 +13,23 @@
<x>0</x>
<y>0</y>
<width>640</width>
<width>480</width>
<height>480</height>
</rect>
</property>
<widget class="QMenuBar" name="menuBar"/>
<widget class="QMenuBar" name="menuBar">
<widget class="QMenu" name="menuFile">
<property name="title">
<string>&amp;File</string>
</property>
<addaction name="actionExit"/>
</widget>
<addaction name="menuFile"/>
</widget>
<action name="actionExit">
<property name="text">
<string>E&amp;xit</string>
</property>
</action>
<widget class="QToolBar" name="toolBar"/>
<widget class="QWidget" name="centralWidget"/>
<widget class="QStatusBar" name="statusBar"/>

View File

@ -9,7 +9,7 @@ int main(int argc, char** argv) {
plugin.init((update_callback_t)1);
QApplication app(argc, argv);
MainWindow window;
Graph::GUI::MainWindow window;
window.show();
return app.exec();