neues Layout für die interne Vertretungsplananzeige
This commit is contained in:
parent
eb118bc094
commit
98e913a134
2 changed files with 18 additions and 91 deletions
|
@ -63,7 +63,7 @@ Page {
|
|||
|
||||
width: listView.width
|
||||
id: delegate
|
||||
height: visible ? cookteam.height + date.height + main_dish.height + main_dish_veg.height + garnish.height + dessert.height + spacer.height + cust_spacing*9 + 5:0
|
||||
height: visible ? cookteam.height + date.height + text.height + spacer.height + cust_spacing*9 + 5:0
|
||||
visible: listView.isDayVisible(index)
|
||||
|
||||
property int cust_spacing: 5
|
||||
|
@ -74,118 +74,42 @@ Page {
|
|||
anchors.top: parent.top
|
||||
anchors.topMargin: 10
|
||||
font.bold: true
|
||||
font.pixelSize: date.font.pixelSize * 1.5
|
||||
id: cookteam
|
||||
text: _cppServerConn.getEventData(index).grade
|
||||
width: parent.width - 10
|
||||
wrapMode: Label.Wrap
|
||||
height: text!=""? undefined:0
|
||||
height: text!==""? undefined:0
|
||||
}
|
||||
Label {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
anchors.top: cookteam.bottom
|
||||
font.bold: true
|
||||
id: date
|
||||
text: _cppServerConn.getEventData(index).hour
|
||||
text: _cppServerConn.getEventData(index).hour + " | "
|
||||
+ _cppServerConn.getEventData(index).replace + " | "
|
||||
+ _cppServerConn.getEventData(index).subject + " | "
|
||||
+ _cppServerConn.getEventData(index).room + " | "
|
||||
|
||||
width: parent.width - 10
|
||||
wrapMode: Label.Wrap
|
||||
}
|
||||
Rectangle {
|
||||
anchors.top: date.bottom
|
||||
anchors.topMargin: cust_spacing
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 10
|
||||
height: 2
|
||||
color: "grey"
|
||||
|
||||
}
|
||||
|
||||
Label {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
anchors.top: date.bottom
|
||||
anchors.topMargin: cust_spacing * 2
|
||||
width: parent.width - 10
|
||||
wrapMode: Label.Wrap
|
||||
id: main_dish
|
||||
text: _cppServerConn.getEventData(index).replace
|
||||
height: text!=""? undefined:0
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.top: main_dish.bottom
|
||||
anchors.topMargin: cust_spacing
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
width: parent.width / 10
|
||||
height: main_dish_veg.text!=""? 1:0
|
||||
color: "grey"
|
||||
|
||||
font.pixelSize: date.font.pixelSize * 2
|
||||
font.bold: true
|
||||
id: text
|
||||
text: _cppServerConn.getEventData(index).to + " " + _cppServerConn.getEventData(index).text
|
||||
}
|
||||
|
||||
Label {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
anchors.top: main_dish.bottom
|
||||
anchors.topMargin: cust_spacing * 2
|
||||
id: main_dish_veg
|
||||
text: _cppServerConn.getEventData(index).subject
|
||||
width: parent.width - 10
|
||||
wrapMode: Label.Wrap
|
||||
height: text!=""? undefined:0
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.top: main_dish_veg.bottom
|
||||
anchors.topMargin: cust_spacing
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
width: parent.width / 10
|
||||
height: garnish.text!=""? 1:0
|
||||
color: "grey"
|
||||
}
|
||||
|
||||
Label {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
anchors.top: main_dish_veg.bottom
|
||||
anchors.topMargin: cust_spacing * 2
|
||||
id: garnish
|
||||
text: _cppServerConn.getEventData(index).room
|
||||
width: parent.width - 10
|
||||
wrapMode: Label.Wrap
|
||||
height: text!=""? undefined:0
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.top: garnish.bottom
|
||||
anchors.topMargin: cust_spacing
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
width: parent.width / 10
|
||||
height: dessert.text!=""? 1:0
|
||||
color: "grey"
|
||||
|
||||
}
|
||||
|
||||
Label {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
anchors.top: garnish.bottom
|
||||
anchors.topMargin: cust_spacing * 2
|
||||
id: dessert
|
||||
text: _cppServerConn.getEventData(index).to
|
||||
width: parent.width - 10
|
||||
wrapMode: Label.Wrap
|
||||
height: text!=""? undefined:0
|
||||
}
|
||||
|
||||
Label {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
anchors.top: dessert.bottom
|
||||
anchors.top: test.bottom
|
||||
anchors.topMargin: cust_spacing
|
||||
id: spacer
|
||||
text: ""
|
||||
|
|
|
@ -382,7 +382,7 @@ QVariantMap ServerConn::getEventData(int index)
|
|||
|
||||
QStringList ret; //list to return
|
||||
//qDebug() << index;
|
||||
for(int i=0;i<=5;i++){
|
||||
for(int i=0;i<=6;i++){
|
||||
|
||||
if(m_eventlist.size() > index){
|
||||
//qDebug() << i << m_weekplan[index].size();
|
||||
|
@ -398,12 +398,15 @@ QVariantMap ServerConn::getEventData(int index)
|
|||
ret.append(NULL);
|
||||
}
|
||||
}
|
||||
if(ret.length() < 7){
|
||||
ret.append("");
|
||||
}
|
||||
QString date_string_on_db = ret[1];
|
||||
QDate Date = QDate::fromString(date_string_on_db," dd.MM.yyyy");
|
||||
//date_string_on_db
|
||||
qDebug() << Date;
|
||||
qDebug() << ret;
|
||||
return { {"grade", ret[0]}, {"hour", ret[1]}, {"replace", ret[2]}, {"subject", ret[3]}, {"room", ret[4]}, {"to", ret[5]} };
|
||||
return { {"grade", ret[0]}, {"hour", ret[1]}, {"replace", ret[2]}, {"subject", ret[3]}, {"room", ret[4]}, {"to", ret[5]}, {"text", ret[6]} };
|
||||
}
|
||||
|
||||
int ServerConn::getEventCount(){
|
||||
|
|
Reference in a new issue