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
|
width: listView.width
|
||||||
id: delegate
|
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)
|
visible: listView.isDayVisible(index)
|
||||||
|
|
||||||
property int cust_spacing: 5
|
property int cust_spacing: 5
|
||||||
|
@ -74,118 +74,42 @@ Page {
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 10
|
anchors.topMargin: 10
|
||||||
font.bold: true
|
font.bold: true
|
||||||
|
font.pixelSize: date.font.pixelSize * 1.5
|
||||||
id: cookteam
|
id: cookteam
|
||||||
text: _cppServerConn.getEventData(index).grade
|
text: _cppServerConn.getEventData(index).grade
|
||||||
width: parent.width - 10
|
width: parent.width - 10
|
||||||
wrapMode: Label.Wrap
|
wrapMode: Label.Wrap
|
||||||
height: text!=""? undefined:0
|
height: text!==""? undefined:0
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 10
|
anchors.leftMargin: 10
|
||||||
anchors.top: cookteam.bottom
|
anchors.top: cookteam.bottom
|
||||||
font.bold: true
|
|
||||||
id: date
|
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
|
width: parent.width - 10
|
||||||
wrapMode: Label.Wrap
|
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 {
|
Label {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 10
|
anchors.leftMargin: 10
|
||||||
anchors.top: date.bottom
|
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.topMargin: cust_spacing
|
||||||
anchors.left: parent.left
|
font.pixelSize: date.font.pixelSize * 2
|
||||||
anchors.leftMargin: 10
|
font.bold: true
|
||||||
width: parent.width / 10
|
id: text
|
||||||
height: main_dish_veg.text!=""? 1:0
|
text: _cppServerConn.getEventData(index).to + " " + _cppServerConn.getEventData(index).text
|
||||||
color: "grey"
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 10
|
anchors.leftMargin: 10
|
||||||
anchors.top: main_dish.bottom
|
anchors.top: test.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.topMargin: cust_spacing
|
anchors.topMargin: cust_spacing
|
||||||
id: spacer
|
id: spacer
|
||||||
text: ""
|
text: ""
|
||||||
|
|
|
@ -382,7 +382,7 @@ QVariantMap ServerConn::getEventData(int index)
|
||||||
|
|
||||||
QStringList ret; //list to return
|
QStringList ret; //list to return
|
||||||
//qDebug() << index;
|
//qDebug() << index;
|
||||||
for(int i=0;i<=5;i++){
|
for(int i=0;i<=6;i++){
|
||||||
|
|
||||||
if(m_eventlist.size() > index){
|
if(m_eventlist.size() > index){
|
||||||
//qDebug() << i << m_weekplan[index].size();
|
//qDebug() << i << m_weekplan[index].size();
|
||||||
|
@ -398,12 +398,15 @@ QVariantMap ServerConn::getEventData(int index)
|
||||||
ret.append(NULL);
|
ret.append(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(ret.length() < 7){
|
||||||
|
ret.append("");
|
||||||
|
}
|
||||||
QString date_string_on_db = ret[1];
|
QString date_string_on_db = ret[1];
|
||||||
QDate Date = QDate::fromString(date_string_on_db," dd.MM.yyyy");
|
QDate Date = QDate::fromString(date_string_on_db," dd.MM.yyyy");
|
||||||
//date_string_on_db
|
//date_string_on_db
|
||||||
qDebug() << Date;
|
qDebug() << Date;
|
||||||
qDebug() << ret;
|
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(){
|
int ServerConn::getEventCount(){
|
||||||
|
|
Reference in a new issue