Added ID to strips
This commit is contained in:
@@ -756,7 +756,7 @@ void MainWindow::validateEntries()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_lastKontierungStart = startBuchung.time;
|
m_lastKontierungStart = startBuchung.time;
|
||||||
ui->verticalLayout2->addWidget(new BuchungStrip(startBuchung.time, startBuchung.type, ui->scrollAreaWidgetContents));
|
ui->verticalLayout2->addWidget(new BuchungStrip(startBuchung.id, startBuchung.time, startBuchung.type, ui->scrollAreaWidgetContents));
|
||||||
|
|
||||||
if(kontierungenIter == m_kontierungenModel->constEnd())
|
if(kontierungenIter == m_kontierungenModel->constEnd())
|
||||||
{
|
{
|
||||||
@@ -776,8 +776,8 @@ void MainWindow::validateEntries()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->verticalLayout2->addWidget(new KontierungStrip(QTime(0, 0), kontierung.timespan, kontierung.projekt,
|
ui->verticalLayout2->addWidget(new KontierungStrip(kontierung.id, kontierung.timespan, kontierung.projekt, kontierung.subprojekt,
|
||||||
kontierung.subprojekt, kontierung.workpackage, kontierung.text));
|
kontierung.workpackage, kontierung.text, ui->scrollAreaWidgetContents));
|
||||||
|
|
||||||
if(kontierung.timespan == QTime(0, 0))
|
if(kontierung.timespan == QTime(0, 0))
|
||||||
{
|
{
|
||||||
@@ -919,7 +919,7 @@ void MainWindow::validateEntries()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->verticalLayout2->addWidget(new BuchungStrip(endBuchung.time, endBuchung.type, ui->scrollAreaWidgetContents));
|
ui->verticalLayout2->addWidget(new BuchungStrip(endBuchung.id, endBuchung.time, endBuchung.type, ui->scrollAreaWidgetContents));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
|
|
||||||
BuchungStrip::BuchungStrip(const QTime &time, const QString &type, QWidget *parent) :
|
BuchungStrip::BuchungStrip(int id, const QTime &time, const QString &type, QWidget *parent) :
|
||||||
QFrame(parent),
|
QFrame(parent),
|
||||||
ui(new Ui::BuchungStrip)
|
ui(new Ui::BuchungStrip)
|
||||||
{
|
{
|
||||||
@@ -25,6 +25,8 @@ BuchungStrip::BuchungStrip(const QTime &time, const QString &type, QWidget *pare
|
|||||||
setStyleSheet("background-color: #FFFF7F;");
|
setStyleSheet("background-color: #FFFF7F;");
|
||||||
ui->labelType->setText(tr("UNKNOWN"));
|
ui->labelType->setText(tr("UNKNOWN"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui->labelId->setText(QString::number(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
BuchungStrip::~BuchungStrip()
|
BuchungStrip::~BuchungStrip()
|
||||||
|
@@ -12,7 +12,7 @@ class BuchungStrip : public QFrame
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BuchungStrip(const QTime &time, const QString &type, QWidget *parent = 0);
|
explicit BuchungStrip(int id, const QTime &time, const QString &type, QWidget *parent = 0);
|
||||||
~BuchungStrip();
|
~BuchungStrip();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -7,21 +7,9 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>500</width>
|
<width>500</width>
|
||||||
<height>50</height>
|
<height>52</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>50</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>50</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -31,7 +19,7 @@
|
|||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
|
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>20</number>
|
<number>20</number>
|
||||||
</property>
|
</property>
|
||||||
@@ -65,6 +53,16 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelId">
|
||||||
|
<property name="text">
|
||||||
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
@@ -6,9 +6,8 @@
|
|||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
KontierungStrip::KontierungStrip(const QTime &startTime, const QTime &endTime, const QString &projekt,
|
KontierungStrip::KontierungStrip(int id, const QTime &duration, const QString &projekt, const QString &subprojekt,
|
||||||
const QString &subprojekt, const QString &workpackage, const QString &text,
|
const QString &workpackage, const QString &text, QWidget *parent) :
|
||||||
QWidget *parent) :
|
|
||||||
QFrame(parent),
|
QFrame(parent),
|
||||||
ui(new Ui::KontierungStrip)
|
ui(new Ui::KontierungStrip)
|
||||||
{
|
{
|
||||||
@@ -16,18 +15,10 @@ KontierungStrip::KontierungStrip(const QTime &startTime, const QTime &endTime, c
|
|||||||
|
|
||||||
setStyleSheet("background-color: #7FFFFF;");
|
setStyleSheet("background-color: #7FFFFF;");
|
||||||
|
|
||||||
if(endTime == QTime(0, 0))
|
ui->labelTime->setText(duration == QTime(0, 0) ? QStringLiteral("???") : duration.toString("HH:mm"));
|
||||||
{
|
|
||||||
ui->labelTime->setText(QStringLiteral("%0 - ???").arg(startTime.toString("HH:mm")));
|
|
||||||
ui->labelDuration->setText(QStringLiteral("(???h)"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ui->labelTime->setText(startTime.toString("HH:mm") % " - " % endTime.toString("HH:mm"));
|
|
||||||
ui->labelDuration->setText("(" % MainWindow::timeBetween(startTime, endTime).toString("HH:mm") % "h)");
|
|
||||||
}
|
|
||||||
|
|
||||||
ui->labelProjekt->setText(projekt);
|
ui->labelProjekt->setText(projekt);
|
||||||
|
ui->labelId->setText(QString::number(id));
|
||||||
|
|
||||||
ui->labelSubprojekt->setText(subprojekt);
|
ui->labelSubprojekt->setText(subprojekt);
|
||||||
ui->labelWorkpackage->setText(workpackage);
|
ui->labelWorkpackage->setText(workpackage);
|
||||||
ui->labelText->setText(text);
|
ui->labelText->setText(text);
|
||||||
|
@@ -12,9 +12,8 @@ class KontierungStrip : public QFrame
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit KontierungStrip(const QTime &startTime, const QTime &endTime, const QString &projekt,
|
explicit KontierungStrip(int id, const QTime &duration, const QString &projekt, const QString &subprojekt,
|
||||||
const QString &subprojekt, const QString &workpackage, const QString &text,
|
const QString &workpackage, const QString &text, QWidget *parent = 0);
|
||||||
QWidget *parent = 0);
|
|
||||||
~KontierungStrip();
|
~KontierungStrip();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -10,18 +10,6 @@
|
|||||||
<height>102</height>
|
<height>102</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>100</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>102</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -36,7 +24,7 @@
|
|||||||
<number>20</number>
|
<number>20</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="labelTime">
|
<widget class="QLabel" name="labelTime">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
@@ -56,7 +44,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="labelDuration">
|
<widget class="QLabel" name="labelProjekt">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>20</pointsize>
|
<pointsize>20</pointsize>
|
||||||
@@ -67,17 +55,20 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
<widget class="QLabel" name="labelId">
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="labelProjekt">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>TextLabel</string>
|
<string>TextLabel</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,0,1">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="labelSubprojekt">
|
<widget class="QLabel" name="labelSubprojekt">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
Reference in New Issue
Block a user