Compare commits

..

6 commits

Author SHA1 Message Date
31d46866f2 more on mainwindow 2018-07-14 15:54:29 +02:00
a490dafb02 use unique pointer 2018-07-14 15:54:11 +02:00
5ebb7b3e67 new dialog 2018-07-14 15:53:47 +02:00
a255fab884 new menu item 2018-07-14 15:53:28 +02:00
90cd0c4b54 add include directory (for gui) 2018-07-14 15:53:01 +02:00
5ca2265fb9 config changed 2018-07-14 15:52:30 +02:00
7 changed files with 164 additions and 12 deletions

View file

@ -4,7 +4,8 @@
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/qt"
"/usr/include/qt",
"/usr/include/qt/QtWidgets"
],
"defines": [],
"compilerPath": "/usr/bin/clang",

View file

@ -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
@ -20,3 +15,4 @@ set(CORE_SOURCES
add_library(core STATIC ${CORE_SOURCES})
target_link_libraries(core Boost::boost Boost::date_time)
target_link_libraries(core sqlite3)
target_include_directories(core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

View file

@ -1,5 +1,7 @@
#include "mainwindow.h"
#include <memory>
#include <QApplication>
@ -9,8 +11,8 @@ int main(int argc, char* argv[])
QApplication kimaApp{argc, argv};
MainWindow mainWin{};
mainWin.show();
auto mainWin = std::make_unique<MainWindow>();
mainWin->show();
return kimaApp.exec();
}

View file

@ -2,5 +2,10 @@
MainWindow::MainWindow()
{
ui.setupUi(this);
ui_.setupUi(this);
connect(ui_.actionQuit, &QAction::triggered, qApp, QApplication::quit);
marketplace_ = std::make_unique<Marketplace>();
}

View file

@ -1,9 +1,13 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <marketplace.h>
#include "ui_mainwindow.h"
#include <QMainWindow>
#include <memory>
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> marketplace_;
};
#endif

View file

@ -23,8 +23,36 @@
<height>24</height>
</rect>
</property>
<widget class="QMenu" name="menu_Datei">
<property name="title">
<string>&amp;Datei</string>
</property>
<addaction name="actionQuit"/>
</widget>
<widget class="QMenu" name="menu_Edit">
<property name="title">
<string>&amp;Bearbeiten</string>
</property>
<addaction name="actionEditSeller"/>
</widget>
<addaction name="menu_Datei"/>
<addaction name="menu_Edit"/>
</widget>
<widget class="QStatusBar" name="statusbar"/>
<action name="actionQuit">
<property name="icon">
<iconset theme="application-exit">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>&amp;Beenden</string>
</property>
</action>
<action name="actionEditSeller">
<property name="text">
<string>&amp;Verkäufer...</string>
</property>
</action>
</widget>
<resources/>
<connections/>

115
src/gui/sellerdialog.ui Normal file
View file

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>sellerDialog</class>
<widget class="QDialog" name="sellerDialog">
<property name="windowModality">
<enum>Qt::NonModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Verkäufer Dialog</string>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTableView" name="tableView"/>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QPushButton" name="newButton">
<property name="text">
<string>Neu</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="editButton">
<property name="text">
<string>Bearbeiten</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="deleteButton">
<property name="text">
<string>Löschen</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>sellerDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>sellerDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>