From 5ca2265fb9e8683264c2a479e2d68f6bba58e3e8 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Sat, 14 Jul 2018 15:52:30 +0200 Subject: [PATCH 1/6] config changed --- .vscode/c_cpp_properties.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 779ce6d..238b7e5 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -4,7 +4,8 @@ "name": "Linux", "includePath": [ "${workspaceFolder}/**", - "/usr/include/qt" + "/usr/include/qt", + "/usr/include/qt/QtWidgets" ], "defines": [], "compilerPath": "/usr/bin/clang", From 90cd0c4b54de61f94dc520c257e80f119a21a3bf Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Sat, 14 Jul 2018 15:53:01 +0200 Subject: [PATCH 2/6] add include directory (for gui) --- src/core/CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 78113b5..2c7f713 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -3,11 +3,6 @@ find_package(Boost 1.62 COMPONENTS date_time REQUIRED) find_package(SQLite3 REQUIRED) -#set(CORE_HEADERS -# entity.h -# database.h -#) - set(CORE_SOURCES database.cpp entity.cpp @@ -19,4 +14,5 @@ set(CORE_SOURCES add_library(core STATIC ${CORE_SOURCES}) target_link_libraries(core Boost::boost Boost::date_time) -target_link_libraries(core sqlite3) \ No newline at end of file +target_link_libraries(core sqlite3) +target_include_directories(core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file From a255fab884320765c39a88f165856249413fa5e2 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Sat, 14 Jul 2018 15:53:28 +0200 Subject: [PATCH 3/6] new menu item --- src/gui/mainwindow.ui | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/gui/mainwindow.ui b/src/gui/mainwindow.ui index ca4bfd5..79a4517 100644 --- a/src/gui/mainwindow.ui +++ b/src/gui/mainwindow.ui @@ -23,8 +23,36 @@ 24 + + + &Datei + + + + + + &Bearbeiten + + + + + + + + + .. + + + &Beenden + + + + + &Verkäufer... + + From 5ebb7b3e6772c7c1e461d42f26854811c06737cd Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Sat, 14 Jul 2018 15:53:47 +0200 Subject: [PATCH 4/6] new dialog --- src/gui/sellerdialog.ui | 115 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 src/gui/sellerdialog.ui diff --git a/src/gui/sellerdialog.ui b/src/gui/sellerdialog.ui new file mode 100644 index 0000000..b789849 --- /dev/null +++ b/src/gui/sellerdialog.ui @@ -0,0 +1,115 @@ + + + sellerDialog + + + Qt::NonModal + + + + 0 + 0 + 400 + 300 + + + + Verkäufer Dialog + + + true + + + + + + + + + + + + + Neu + + + + + + + Bearbeiten + + + + + + + Löschen + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + sellerDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + sellerDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + From a490dafb02b4380859924e1d9e45cc8cbb467ba3 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Sat, 14 Jul 2018 15:54:11 +0200 Subject: [PATCH 5/6] use unique pointer --- src/gui/kima2.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/kima2.cpp b/src/gui/kima2.cpp index 372e273..cb210ef 100644 --- a/src/gui/kima2.cpp +++ b/src/gui/kima2.cpp @@ -1,5 +1,7 @@ #include "mainwindow.h" +#include + #include @@ -9,8 +11,8 @@ int main(int argc, char* argv[]) QApplication kimaApp{argc, argv}; - MainWindow mainWin{}; - mainWin.show(); + auto mainWin = std::make_unique(); + mainWin->show(); return kimaApp.exec(); } From 31d46866f22e5da228890767818fdd535085a913 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Sat, 14 Jul 2018 15:54:29 +0200 Subject: [PATCH 6/6] more on mainwindow --- src/gui/mainwindow.cpp | 9 +++++++-- src/gui/mainwindow.h | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index c94ac19..d352cfe 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -2,5 +2,10 @@ MainWindow::MainWindow() { - ui.setupUi(this); -} \ No newline at end of file + ui_.setupUi(this); + + connect(ui_.actionQuit, &QAction::triggered, qApp, QApplication::quit); + + marketplace_ = std::make_unique(); +} + diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index 2cc3dad..943382c 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -1,9 +1,13 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H +#include + #include "ui_mainwindow.h" #include +#include + class MainWindow : public QMainWindow { Q_OBJECT @@ -12,7 +16,8 @@ class MainWindow : public QMainWindow MainWindow(); private: - Ui::MainWindow ui; + Ui::MainWindow ui_; + std::unique_ptr marketplace_; }; #endif \ No newline at end of file