Hilfe bei priv. Projekt benötigt (Schichtplan mit DB-basis)

Suche und Angebote - Sowohl für kommerzielle als auch freie Projekte
Antworten
Fenriswolf
Beiträge: 27
Registriert: 11. November 2014 18:06

Hilfe bei priv. Projekt benötigt (Schichtplan mit DB-basis)

Beitrag von Fenriswolf »

Hallo liebes Forum,
ich bin (immernoch) Anfänger, und schreibe ein kleines Programm. Name: Schichtplan. (sollte schon so ziemlich alles sagen)
Hier im Forum habe ich dafür schon einige Hilfe erfahren. Doch bin ich leider an einem Punkt, an dem ich nicht so recht weiter komme, weswegen ich euch hier einmal den kompletten Source offenbaren möchte.
Die Hilfe, ich ich dabei benötige:
1. Ich erstelle ein Unterfenster, in dem ich die Optionsdatei darstelle. Da diese Optionen geändert werden können, muss danach die "komplette" (/alternativ teilweise) Datenbank aktualisiert werden -> Wie?
2. Ich bitte um Hinweise zu Code-Optimierung (wie gesagt, Anfänger) Ich hab's erst mal so "hin gebastelt", dass es bis hierher funktioniert. Die "Schönheit" des Codes kommt für mich erst mal an zweiter Stelle.
->spezieller Hinweis: Wie sieht's mit der Speicherbereinigung im Code aus? Alles ok?

main.cpp

Code: Alles auswählen

#include "mainwindow.hpp"
#include <QtSql>
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    return a.exec();
}
mainwindow.hpp

Code: Alles auswählen

#ifndef MAINWINDOW_HPP
#define MAINWINDOW_HPP

#include <QMainWindow>
#include <QTableView>
#include <QtSql>
#include "ui_mainwindow.h"
#include "mysqlrelationmodel.hpp"
#include "options.hpp"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    QSqlError initDb();
    void showError(const QSqlError &err);
    void UpdSchicht();

private slots:
    void on_btnAdd_clicked();
    void on_actionBeenden_triggered();
    void on_actionEinstellungen_triggered();
    void on_btnaendern_clicked();

    void dateMonAnz_datAender(const QDate &date);
    void cmbTabellen_IndChanged(const QString &IndString);

private:
#ifdef QT_DEBUG
    QComboBox *cmbTabellen;
#endif

    Options *opt;
    Ui::MainWindow *ui;
    MySqlRelationModel *model;
    QSqlDatabase db;
    QSqlQuery *qry;
    QString EmployId;

    bool Initialize();
    void AnzeigeAktualisieren();
    void InsNameDat(const QString &VorNam, const QString &NachNam);
    QStringList ReadSchichten();
};

#endif // MAINWINDOW_HPP
dbinit.hpp

Code: Alles auswählen

#ifndef DBINIT_HPP
#define DBINIT_HPP

#include <QtSql>
#include <QMessageBox>
#include <QDebug>

#include "mainwindow.hpp"

/* ********************* *
 * SQLITE Init/create DB *
 * ********************* */

QSqlError MainWindow::initDb()
{
    db = QSqlDatabase::addDatabase("QSQLITE");
    db.setDatabaseName(QDir::currentPath() + "/Schichtplan.db");
    if (!QFile(db.databaseName()).exists())
    {
        QMessageBox MessageBox;
        MessageBox.setIcon(QMessageBox::Information);
        MessageBox.setWindowTitle(tr("Database not found!"));
        MessageBox.setText(tr("Database not found.\nA new Database will be created."));
        MessageBox.setStandardButtons(QMessageBox::Ok);
        MessageBox.exec();
    }

    if (!db.open())
        return db.lastError();

    qry = new QSqlQuery(db);
    if(!qry->exec("CREATE TABLE IF NOT EXISTS Mitarbeiter (id INTEGER NOT NULL PRIMARY KEY, Nachname VARCHAR(50), Vorname VARCHAR(50))"))
        return qry->lastError();

    return QSqlError();
}

#endif // DBINIT_HPP
mysqlrelationmodel.hpp

Code: Alles auswählen

#ifndef MYSQLRELATIONMODEL_HPP
#define MYSQLRELATIONMODEL_HPP

#include <QSqlRelationalTableModel>
#include <QBrush>

class MySqlRelationModel : public QSqlRelationalTableModel
{
    Q_OBJECT
public:
    explicit MySqlRelationModel(QObject *parent);
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
};

#endif // MYSQLRELATIONMODEL_HPP
options.hpp

Code: Alles auswählen

#ifndef OPTIONS_HPP
#define OPTIONS_HPP

#include <QDialog>
#include <QFile>
#include <QDir>
#include <QMultiMap>
#include <QTableWidget>
#include <QComboBox>

namespace Ui {
class Options;
}

class Options : public QDialog
{
    Q_OBJECT

public:
    QFile OptDatFi;
    const QString DatPfad = QDir::currentPath() + "/options.ini";
    QMultiMap<QString, QString> SchichtenMap;

    explicit Options(QWidget *parent = 0);
    ~Options();

    bool CreateOptFile();
    void showDialog();

private slots:
    void btnok_clicked();
    void btncancel_clicked();

private:
    QWidget *widget;
    QTableWidget *TblWid;
    QList<QComboBox*> comboList;
};

#endif // OPTIONS_HPP
options.cpp

Code: Alles auswählen

#include <QDir>
#include <QFile>
#include <QTextStream>
#include <QMessageBox>
#include <QtWidgets>
#include <QColorDialog>
#include "options.hpp"
#include "mainwindow.hpp"

Options::Options(QWidget *parent)
{
}

Options::~Options()
{
    //delete layout;
}

bool Options::CreateOptFile()
{
    OptDatFi.setFileName(DatPfad);
    if(!OptDatFi.exists())
    {
        if(!OptDatFi.open(QIODevice::ReadWrite))
            return false;
        QTextStream FiStream(&OptDatFi);
        FiStream << "#This is the optionsfile. DO NOT EDIT!" << endl;
        FiStream << endl;
        QMessageBox Message;
        Message.setIcon(QMessageBox::Information);
        Message.setWindowTitle(tr("First run!"));
        Message.setText(tr("This is your first run.\nPlease customize options first, to get best experience."));
        Message.setStandardButtons(QMessageBox::Ok);
        Message.exec();

#ifdef QT_DEBUG
        FiStream << "#Schichten" << endl;
        FiStream << "Normalschicht\tN\tblack" << endl;
        FiStream << "Frühschicht\tF\tblack" << endl;
        FiStream << "Spätschicht\tS\tblack" << endl;
        FiStream << "Bereitschaft\tB\tblack" << endl;
        FiStream << "Spät+Bereit\tSB\tblack" << endl;
        FiStream << "Urlaub\tU\tblack" << endl;
#endif

        OptDatFi.close();
    }// !QFile(OptDat.exists())
    if(!OptDatFi.open(QIODevice::ReadOnly))
        return false;
    OptDatFi.close();
    return true;
}

void Options::showDialog()
{
    widget = new QWidget(this);
    QPushButton *btnok = new QPushButton(widget);
    btnok->setText("OK");
    btnok->setGeometry(110, 210, 70, 25);
    btnok->show();
    connect(btnok, SIGNAL(clicked()), this, SLOT(btnok_clicked()));
    QPushButton *btncancel = new QPushButton(widget);
    btncancel->setText("Abbrechen");
    btncancel->setGeometry(20, 210, 70, 25);
    btncancel->show();
    connect(btncancel, SIGNAL(clicked()), this, SLOT(btncancel_clicked()));
    TblWid = new QTableWidget(1, 3, widget);
    QStringList header;
    header << "Bezeichnung" << "Abk" << "Farbe";
    TblWid->setHorizontalHeaderLabels(header);
    TblWid->setColumnWidth(0, 100);
    TblWid->setColumnWidth(1, 30);
    TblWid->setColumnWidth(2, 150);
    TblWid->verticalHeader()->hide();
    TblWid->verticalHeader()->setDefaultSectionSize(25);
    TblWid->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    TblWid->setShowGrid(false);
    TblWid->resize(300,200);
    TblWid->setFixedSize(TblWid->size());
    widget->resize(300,250);
    widget->setFixedSize(widget->size());

    if(SchichtenMap.size() > 0)
    {
        QMap<QString,QString>::const_iterator it = SchichtenMap.begin();
        for(int i = 0; i <= SchichtenMap.size() / 2 - 1; ++i)
        {
            QTableWidgetItem *key = new QTableWidgetItem();
            QTableWidgetItem *value = new QTableWidgetItem();
            TblWid->insertRow(i);
            key->setText(it.key());
            TblWid->setItem(i, 0, key);
            value->setText(it.value());
            TblWid->setItem(i, 1, value);
            ++it;

            QComboBox *cmbColor = new QComboBox;
            const QStringList colorNames = QColor::colorNames();
            comboList.append(cmbColor);
            int index = 0;
            foreach (const QString &colorName, colorNames)
            {
                const QColor color(colorName);
                cmbColor->addItem(colorName, color);
                const QModelIndex idx = cmbColor->model()->index(index++, 0);
                cmbColor->model()->setData(idx, color, Qt::BackgroundColorRole);
            }
            TblWid->setCellWidget(i, 2, cmbColor);
            cmbColor->setCurrentText(it.value());
            ++it;
        }
    }
}

void Options::btnok_clicked()
{
    QList<QString> SchichtenName;
    QList<QString> SchichtenAbk;
    QList<QString> SchichtenFarbe;
    bool aenderName = false;
    bool aenderAbk = false;
    bool aenderFarbe = false;

    for(int i = 0; i <= TblWid->rowCount()-2; ++i) //rows-2 becaus last row is empty and we're starting at 0
    {
        SchichtenName.append(TblWid->item(i,0)->text());
        SchichtenAbk.append(TblWid->item(i,1)->text());
        SchichtenFarbe.append(comboList.value(i)->currentText());
    }

    QMap<QString,QString>::const_iterator it = SchichtenMap.begin();
    for(int i = 0; i <= SchichtenName.count()-1; ++i) //keine Rolle, ob SchichtenName oder etwas anderes, da alle die gleiche Anzahl
    {
        if(SchichtenName.at(i) != it.key())
        {
            qDebug() << "SchichtenName stimmt nicht überein" << endl
                     << "Alte Schicht: " << it.key() << " Neue Schicht: " << SchichtenName.at(i);
        }
        if(SchichtenAbk.at(i) != it.value())
        {
            qDebug() << "SchichtenAbk stimmt nicht überein" << endl
                     << "Alte Abk: " << it.value() << " Neue Abk: " << SchichtenAbk.at(i);

        }
        ++it;
        if(SchichtenFarbe.at(i) != it.value())
        {
            qDebug() << "SchichtenFarbe stimmt nicht überein"<< endl
                     << "Alte Farbe: " << it.value() << " Neue Farbe: " << SchichtenFarbe.at(i);
        }
        ++it;
    }

    if(aenderName == true || aenderAbk == true || aenderFarbe == true)
        //DB aktualisieren

    close();
}

void Options::btncancel_clicked()
{
    close();
}
mainwindow.cpp

Code: Alles auswählen

#include <QMessageBox>
#include <QString>
#include <QLatin1String>
#include <QtSql>
#include <QDebug>
#include "ui_mainwindow.h"
#include "options.hpp"
#include "mainwindow.hpp"
#include "mysqlrelationmodel.hpp"
#include "dbinit.hpp"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    opt = new Options(this);

#ifdef QT_DEBUG
    QStringList tables = db.tables();
    cmbTabellen = new QComboBox(this);
    cmbTabellen->setGeometry(28,160,221,22);
    cmbTabellen->show();
    cmbTabellen->addItems(tables);
    connect(cmbTabellen, SIGNAL(activated(QString)), this, SLOT(cmbTabellen_IndChanged(QString)));
#endif

    //set today as start-date
    ui->dateStart->setDate(QDate::currentDate());
    ui->dateEnde->setDate(QDate::currentDate());
    ui->dateMonAnz->setDate(QDate::currentDate().addDays(-1));

    //initialize DB
    QSqlError err = initDb();
    if (err.type() != QSqlError::NoError)
    {
        showError(err);
        ui->dateMonAnz->setDate(QDate::currentDate());
        return;
    }

    Options opt(this);
    if(!opt.CreateOptFile())
    {
        QMessageBox messbox;
        messbox.setIcon(QMessageBox::Information);
        messbox.setWindowTitle(tr("Unable to load options-file!"));
        messbox.setText(tr("Couldn't load options.ini.\nGoing on with standard parameters."));
        messbox.setStandardButtons(QMessageBox::Ok);
        messbox.exec();
    }

    // Create a new model
    model = new MySqlRelationModel(ui->tableView);
    model->setEditStrategy(QSqlTableModel::OnFieldChange);

    ui->tableView->verticalHeader()->show();

    // Set the model and hide the ID column
    ui->tableView->setModel(model);

    connect(ui->dateMonAnz, SIGNAL(dateChanged(QDate)), this, SLOT(dateMonAnz_datAender(QDate)));
    ui->dateMonAnz->setDate(QDate::currentDate());

    ui->cmbSchicht->addItems(ReadSchichten());
}

MainWindow::~MainWindow()
{
    db.close();
    delete ui;
}

void MainWindow::showError(const QSqlError &err)
{
    QMessageBox::critical(this, "Unable to initialize Database", "Error initializing database: " + err.text());
}

void MainWindow::dateMonAnz_datAender(const QDate &date)
{
    QString dateStr = date.toString("MMMyyyy");

    if(!db.tables().contains(QLatin1String("tbl" + dateStr.toLatin1() + "")))
    {
        //create table with columns "names"
        if(!qry->exec("CREATE TABLE IF NOT EXISTS tbl" + dateStr + "(Nachname INTEGER UNIQUE, Vorname INTEGER UNIQUE);"))
            showError(qry->lastError());

        //
        for(int day = 1; day <= date.daysInMonth(); ++day)
            if(!qry->exec("ALTER TABLE tbl" + dateStr + " ADD COLUMN '" + QString::number(day) + "' VARCHAR(10);"))
                showError(qry->lastError());

        //read all IDs
        QStringList ID;
        qry->exec("SELECT * FROM Mitarbeiter");
        while (qry->next())
            ID.append(qry->value(qry->record().indexOf("id")).toString());

        int it = 0;
        while(it <= ID.count()-1)
        {
            qry->exec("INSERT INTO tbl" + dateStr + " (Nachname, Vorname) VALUES('" + ID.at(it) + "', '" + ID.at(it) + "')");
            it++;
        }
    }
    QStringList ListName;
    qry->exec("SELECT * FROM Mitarbeiter");
    while (qry->next())
        ListName.append(qry->value(qry->record().indexOf("Nachname")).toString() + ", " + qry->value(qry->record().indexOf("Vorname")).toString());

    model->setTable("tbl" + dateStr);

    AnzeigeAktualisieren();

    ListName.sort(Qt::CaseSensitive);

    ui->cmbName->clear();
    ui->cmbName->addItems(ListName);

#ifdef QT_DEBUG
    QStringList tables = db.tables();
    cmbTabellen->clear();
    cmbTabellen->addItems(tables);
#endif
}

void MainWindow::on_btnAdd_clicked()
{
    if (ui->edtVorNam->text().isEmpty()) //Vorname fehlt
    {
        if (ui->edtNachNam->text().isEmpty()) //Beide Namen fehlen
            QMessageBox::information(this, "Name fehlt!", "Es wurde kein Name eingetragen!", QMessageBox::Ok);
        else
        {
            QMessageBox MessageBox;
            MessageBox.setIcon(QMessageBox::Information);
            MessageBox.setWindowTitle("Name fehlt!");
            MessageBox.setText("Es wurde kein Vorname eingetragen!\nTrotzdem hinzufügen?");
            MessageBox.setStandardButtons(QMessageBox::Yes|QMessageBox::Cancel);
            MessageBox.button(QMessageBox::Yes)->setText(tr("Ja"));
            MessageBox.button(QMessageBox::Cancel)->setText(tr("Abbrechen"));
            if(MessageBox.exec() == QMessageBox::Yes)
            {//in Datenbank eintragen
                InsNameDat(ui->edtVorNam->text(), ui->edtNachNam->text());
            }
        }
    } //end if (Vorname fehlt)
    else if (ui->edtNachNam->text().isEmpty()) //Nachname fehlt
    {
        QMessageBox MessageBox;
        MessageBox.setIcon(QMessageBox::Information);
        MessageBox.setWindowTitle("Name fehlt!");
        MessageBox.setText("Es wurde kein Nachname eingetragen!\nTrotzdem hinzufügen?");
        MessageBox.setStandardButtons(QMessageBox::Yes|QMessageBox::Cancel);
        MessageBox.button(QMessageBox::Yes)->setText(tr("Ja"));
        MessageBox.button(QMessageBox::Cancel)->setText(tr("Abbrechen"));
        if(MessageBox.exec() == QMessageBox::Yes)
        {//in Datenbank eintragen
            InsNameDat(ui->edtVorNam->text(), ui->edtNachNam->text());
        }
    } //end else if (Nachname fehlt)
    else //Alle Namen eingetragen
    {//in Datenbank eintragen
        InsNameDat(ui->edtVorNam->text(), ui->edtNachNam->text());
    }
}

void MainWindow::InsNameDat(const QString &VorNam, const QString &NachNam)
{
    //Mitarbeiter in "Mitarbeiter" eintragen
    if (!qry->exec("INSERT INTO Mitarbeiter (Nachname, Vorname) VALUES ('"+ NachNam + "', '" + VorNam + "')"))
        showError(qry->lastError());
    EmployId = qry->lastInsertId().toString();

    //Mitarbeiter in aktuelle Tabelle eintragen
    QString dateStr = ui->dateMonAnz->date().toString("MMMyyyy");
    if(!qry->exec("INSERT INTO tbl" + dateStr + " (Nachname, Vorname) VALUES('" + EmployId + "', '" + EmployId + "')"))
        showError(qry->lastError());

    if (!model->select())
    {
        showError(model->lastError());
        return;
    }

    QStringList ListName;
    qry->exec("SELECT * FROM Mitarbeiter");
    while (qry->next())
        ListName.append(qry->value(qry->record().indexOf("Nachname")).toString() + ", " + qry->value(qry->record().indexOf("Vorname")).toString());

    ListName.sort(Qt::CaseSensitive);

    ui->cmbName->clear();
    ui->cmbName->addItems(ListName);
}

void MainWindow::cmbTabellen_IndChanged(const QString &IndString)
 {
    model->setTable(IndString);

    // Set the relations to the other database tables
    if(IndString != "Mitarbeiter")
    {
        AnzeigeAktualisieren();
    }
    else
    {
        if (!model->select())
        {
            showError(model->lastError());
            return;
        }

        ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection);
        ui->tableView->resizeColumnsToContents();
        ui->tableView->resizeRowsToContents();
    }
 }

void MainWindow::AnzeigeAktualisieren()
{
    model->setRelation(0, QSqlRelation("Mitarbeiter", "id", "Nachname"));
    model->setRelation(1, QSqlRelation("Mitarbeiter", "id", "Vorname"));

    for(int i = 2; i <= ui->dateMonAnz->date().daysInMonth()+1; ++i)
    {
        QDate datum;
        datum.setDate(ui->dateMonAnz->date().year(), ui->dateMonAnz->date().month(), i-1);
        model->setHeaderData(i, Qt::Horizontal, QString::number(i-1) + "\n" + QDate::shortDayName(datum.dayOfWeek(), QDate::DateFormat).toLatin1());
    }

    if (!model->select())
    {
        showError(model->lastError());
        return;
    }

    ui->tableView->setSelectionMode(QAbstractItemView::SingleSelection);
    ui->tableView->resizeColumnsToContents();
    ui->tableView->resizeRowsToContents();
}

void MainWindow::on_btnaendern_clicked()
{
    //in Nach-/Vorname aufteilen
    QStringList names = ui->cmbName->currentText().split(",");
    //read ID from "Mitarbeiter"
    if(!qry->exec("SELECT id, Nachname, Vorname FROM Mitarbeiter WHERE Nachname = '" + names.at(0) + "' AND Vorname = '" + names.at(1).right(names.at(1).length()-1) + "'"))
        showError(qry->lastError());
    else
    {
        QString ID;
        while(qry->next())
           ID = qry->value(0).toString();

        //if Key not found, return empty string to delete
        QString SchichtKurz = opt->SchichtenMap.value(ui->cmbSchicht->currentText(),"");
        QDate von = ui->dateStart->date();
        QDate bis = ui->dateEnde->date();

        bool Sa = ui->chkSa->isChecked();
        bool So = ui->chkSo->isChecked();
        QDate datum;
        for(int day = von.day(); day <= bis.day(); ++day)
        {
            datum.setDate(ui->dateMonAnz->date().year(), ui->dateMonAnz->date().month(), day);
            if(QDate::shortDayName(datum.dayOfWeek()) == "Sa" && Sa || QDate::shortDayName(datum.dayOfWeek()) == "So" && So
                    || QDate::shortDayName(datum.dayOfWeek()) != "Sa" && QDate::shortDayName(datum.dayOfWeek()) != "So" || SchichtKurz == "")
            if(!qry->exec("UPDATE tblNov2014 SET '" + QString::number(day) + "' = '" + SchichtKurz +"' WHERE Nachname = '" + ID + "' AND Vorname = '" + ID + "'"))
                showError(qry->lastError());
        }

        AnzeigeAktualisieren();
    }
}

void MainWindow::on_actionBeenden_triggered()
{
    QApplication::quit();
}

void MainWindow::on_actionEinstellungen_triggered()
{
    opt->showDialog();
    opt->show();
}

QStringList MainWindow::ReadSchichten()
{
    QStringList SchichtenStr;

    opt->OptDatFi.setFileName(opt->DatPfad);
    if(!opt->OptDatFi.open(QIODevice::ReadOnly))
        qDebug() << "File not open";

    //start at line four
    opt->OptDatFi.readLine();//intro
    opt->OptDatFi.readLine();//empty
    opt->OptDatFi.readLine();//"Schichten"

    while(!opt->OptDatFi.atEnd())
    {
        QString ZwSpei(opt->OptDatFi.readLine());
        if (ZwSpei == "\n")
            break;
        opt->SchichtenMap.insert(opt->SchichtenMap.constBegin(), ZwSpei.split("\t").at(0), ZwSpei.split("\t").at(2).split("\n").at(0)); //Schicht Farbe zuweisen
        opt->SchichtenMap.insert(opt->SchichtenMap.constEnd(), ZwSpei.split("\t").at(0), ZwSpei.split("\t").at(1));   //Schicht Kürzel zuweisen
        SchichtenStr.append(ZwSpei.split("\t").at(0));
    }
    SchichtenStr.append("*löschen*");
    return SchichtenStr;
}
mainwindow.ui

Code: Alles auswählen

<?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>1200</width>
    <height>650</height>
   </rect>
  </property>
  <property name="sizePolicy">
   <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
    <horstretch>0</horstretch>
    <verstretch>0</verstretch>
   </sizepolicy>
  </property>
  <property name="maximumSize">
   <size>
    <width>1200</width>
    <height>650</height>
   </size>
  </property>
  <property name="windowTitle">
   <string>MainWindow</string>
  </property>
  <widget class="QWidget" name="centralWidget">
   <property name="sizePolicy">
    <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
   <property name="maximumSize">
    <size>
     <width>1200</width>
     <height>650</height>
    </size>
   </property>
   <widget class="QTableView" name="tableView">
    <property name="geometry">
     <rect>
      <x>55</x>
      <y>171</y>
      <width>1100</width>
      <height>401</height>
     </rect>
    </property>
    <property name="sizePolicy">
     <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
      <horstretch>0</horstretch>
      <verstretch>0</verstretch>
     </sizepolicy>
    </property>
    <property name="maximumSize">
     <size>
      <width>1100</width>
      <height>550</height>
     </size>
    </property>
    <property name="frameShadow">
     <enum>QFrame::Plain</enum>
    </property>
    <property name="autoScroll">
     <bool>false</bool>
    </property>
    <property name="editTriggers">
     <set>QAbstractItemView::NoEditTriggers</set>
    </property>
    <property name="showDropIndicator" stdset="0">
     <bool>false</bool>
    </property>
    <property name="dragDropOverwriteMode">
     <bool>false</bool>
    </property>
    <attribute name="verticalHeaderVisible">
     <bool>false</bool>
    </attribute>
   </widget>
   <widget class="QCheckBox" name="chkSa">
    <property name="geometry">
     <rect>
      <x>880</x>
      <y>70</y>
      <width>121</width>
      <height>17</height>
     </rect>
    </property>
    <property name="text">
     <string>Samstag einbeziehen</string>
    </property>
   </widget>
   <widget class="QCheckBox" name="chkSo">
    <property name="geometry">
     <rect>
      <x>880</x>
      <y>90</y>
      <width>121</width>
      <height>17</height>
     </rect>
    </property>
    <property name="text">
     <string>Sonntag einbeziehen</string>
    </property>
   </widget>
   <widget class="QPushButton" name="btnaendern">
    <property name="geometry">
     <rect>
      <x>1020</x>
      <y>80</y>
      <width>75</width>
      <height>23</height>
     </rect>
    </property>
    <property name="text">
     <string>Eintragen</string>
    </property>
   </widget>
   <widget class="QDateEdit" name="dateEnde">
    <property name="geometry">
     <rect>
      <x>740</x>
      <y>80</y>
      <width>110</width>
      <height>22</height>
     </rect>
    </property>
    <property name="calendarPopup">
     <bool>true</bool>
    </property>
   </widget>
   <widget class="QDateEdit" name="dateStart">
    <property name="geometry">
     <rect>
      <x>590</x>
      <y>80</y>
      <width>110</width>
      <height>22</height>
     </rect>
    </property>
    <property name="calendarPopup">
     <bool>true</bool>
    </property>
   </widget>
   <widget class="QLabel" name="label">
    <property name="geometry">
     <rect>
      <x>710</x>
      <y>85</y>
      <width>46</width>
      <height>13</height>
     </rect>
    </property>
    <property name="font">
     <font>
      <pointsize>10</pointsize>
     </font>
    </property>
    <property name="text">
     <string>bis:</string>
    </property>
   </widget>
   <widget class="QLabel" name="label_2">
    <property name="geometry">
     <rect>
      <x>560</x>
      <y>85</y>
      <width>46</width>
      <height>13</height>
     </rect>
    </property>
    <property name="font">
     <font>
      <pointsize>10</pointsize>
     </font>
    </property>
    <property name="text">
     <string>von:</string>
    </property>
   </widget>
   <widget class="QComboBox" name="cmbSchicht">
    <property name="geometry">
     <rect>
      <x>330</x>
      <y>80</y>
      <width>211</width>
      <height>22</height>
     </rect>
    </property>
   </widget>
   <widget class="QComboBox" name="cmbName">
    <property name="geometry">
     <rect>
      <x>100</x>
      <y>80</y>
      <width>221</width>
      <height>22</height>
     </rect>
    </property>
    <property name="duplicatesEnabled">
     <bool>true</bool>
    </property>
   </widget>
   <widget class="QDateEdit" name="dateMonAnz">
    <property name="geometry">
     <rect>
      <x>540</x>
      <y>130</y>
      <width>111</width>
      <height>22</height>
     </rect>
    </property>
    <property name="buttonSymbols">
     <enum>QAbstractSpinBox::UpDownArrows</enum>
    </property>
    <property name="displayFormat">
     <string>MMMM yyyy</string>
    </property>
    <property name="calendarPopup">
     <bool>true</bool>
    </property>
   </widget>
   <widget class="QLineEdit" name="edtVorNam">
    <property name="geometry">
     <rect>
      <x>100</x>
      <y>30</y>
      <width>113</width>
      <height>20</height>
     </rect>
    </property>
   </widget>
   <widget class="QLineEdit" name="edtNachNam">
    <property name="geometry">
     <rect>
      <x>230</x>
      <y>30</y>
      <width>113</width>
      <height>20</height>
     </rect>
    </property>
   </widget>
   <widget class="QPushButton" name="btnAdd">
    <property name="geometry">
     <rect>
      <x>360</x>
      <y>30</y>
      <width>75</width>
      <height>23</height>
     </rect>
    </property>
    <property name="text">
     <string>Hinzufügen</string>
    </property>
   </widget>
  </widget>
  <widget class="QMenuBar" name="menuBar">
   <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>1200</width>
     <height>21</height>
    </rect>
   </property>
   <widget class="QMenu" name="menuMen">
    <property name="title">
     <string>Menü</string>
    </property>
    <addaction name="actionBeenden"/>
   </widget>
   <widget class="QMenu" name="menuExtras">
    <property name="title">
     <string>Extras</string>
    </property>
    <addaction name="actionEinstellungen"/>
   </widget>
   <addaction name="menuMen"/>
   <addaction name="menuExtras"/>
  </widget>
  <widget class="QToolBar" name="mainToolBar">
   <property name="movable">
    <bool>false</bool>
   </property>
   <property name="allowedAreas">
    <set>Qt::TopToolBarArea</set>
   </property>
   <attribute name="toolBarArea">
    <enum>TopToolBarArea</enum>
   </attribute>
   <attribute name="toolBarBreak">
    <bool>false</bool>
   </attribute>
  </widget>
  <widget class="QStatusBar" name="statusBar"/>
  <action name="actionBeenden">
   <property name="text">
    <string>Beenden</string>
   </property>
  </action>
  <action name="actionEinstellungen">
   <property name="text">
    <string>Einstellungen</string>
   </property>
  </action>
 </widget>
 <layoutdefault spacing="6" margin="11"/>
 <resources/>
 <connections/>
</ui>
Ich danke euch schon mal für jegliche Hilfe.

MfG
Fenriswolf
Ich bin die Summer meiner Erfahrungen; und heute bin ich mehr, als ich gestern war
Antworten