Update
This commit is contained in:
@@ -68,7 +68,7 @@ EinsatzplanFrame::EinsatzplanFrame(QWidget* parent, QString id, bool admin)
|
||||
planGrid_m->show();
|
||||
|
||||
QVBoxLayout* totalLayout = new QVBoxLayout(this);
|
||||
totalLayout->setContentsMargins(50,20,50,20);
|
||||
totalLayout->setContentsMargins(30,20,30,20);
|
||||
|
||||
QHBoxLayout* topLayout = new QHBoxLayout(this);
|
||||
topLayout->addWidget(profileImg_m, 1, Qt::AlignLeft);
|
||||
@@ -83,7 +83,7 @@ EinsatzplanFrame::EinsatzplanFrame(QWidget* parent, QString id, bool admin)
|
||||
|
||||
|
||||
totalLayout->addLayout(topLayout);
|
||||
totalLayout->addLayout(bottomLayout);
|
||||
totalLayout->addLayout(bottomLayout,2);
|
||||
|
||||
|
||||
|
||||
@@ -116,6 +116,9 @@ EinsatzplanFrame::EinsatzplanFrame(QWidget* parent, QString id, bool admin)
|
||||
background-color: #DCFF78;
|
||||
border-radius: 10px;
|
||||
}
|
||||
#deleteMember:pressed{
|
||||
background-color: #CCEF68;
|
||||
}
|
||||
)");
|
||||
deleteMemberButton_m->show();
|
||||
|
||||
@@ -130,6 +133,9 @@ EinsatzplanFrame::EinsatzplanFrame(QWidget* parent, QString id, bool admin)
|
||||
background-color: #DCFF78;
|
||||
border-radius: 10px;
|
||||
}
|
||||
#createVeranstaltung:pressed{
|
||||
background-color: #CCEF68;
|
||||
}
|
||||
)");
|
||||
createVeranstaltungButton_m->show();
|
||||
|
||||
@@ -144,14 +150,18 @@ EinsatzplanFrame::EinsatzplanFrame(QWidget* parent, QString id, bool admin)
|
||||
background-color: #DCFF78;
|
||||
border-radius: 10px;
|
||||
}
|
||||
#deleteVeranstaltung:pressed{
|
||||
background-color: #CCEF68;
|
||||
}
|
||||
)");
|
||||
deleteVeranstaltungButton_m->show();
|
||||
|
||||
QHBoxLayout* adminLayout = new QHBoxLayout(this);
|
||||
adminLayout->addWidget(createMemberButton_m, 1, Qt::AlignCenter);
|
||||
adminLayout->addWidget(deleteMemberButton_m,1 , Qt::AlignCenter);
|
||||
adminLayout->addWidget(createVeranstaltungButton_m,1 , Qt::AlignCenter);
|
||||
adminLayout->addWidget(deleteVeranstaltungButton_m,1 , Qt::AlignCenter);
|
||||
adminLayout->addWidget(createMemberButton_m, 1, Qt::AlignLeft);
|
||||
adminLayout->addWidget(deleteMemberButton_m,1 , Qt::AlignLeft);
|
||||
adminLayout->addStretch(1);
|
||||
adminLayout->addWidget(createVeranstaltungButton_m,1 , Qt::AlignRight);
|
||||
adminLayout->addWidget(deleteVeranstaltungButton_m,1 , Qt::AlignRight);
|
||||
|
||||
totalLayout->addLayout(adminLayout);
|
||||
|
||||
|
||||
@@ -29,18 +29,36 @@ PlanGrid::PlanGrid(QWidget* parent)
|
||||
times[9] = "17:00 - 18:00";
|
||||
|
||||
|
||||
|
||||
planMap = new QMap<QPair<QString, QString>, QLabel*>( );
|
||||
|
||||
gridLayout = new QGridLayout(this);
|
||||
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
for (int j = 0; j < 10; ++j) {
|
||||
planMap->insert(qMakePair(weekdays[i], times[j]), nullptr);
|
||||
QLabel* temp = new QLabel();
|
||||
temp->setObjectName("temp");
|
||||
temp->setStyleSheet(R"(
|
||||
#temp{
|
||||
|
||||
}
|
||||
)");
|
||||
temp->setFixedSize(250,40);
|
||||
planMap->insert(qMakePair(weekdays[i], times[j]), temp);
|
||||
}
|
||||
}
|
||||
|
||||
populateGrid();
|
||||
|
||||
|
||||
QLabel* temp = new QLabel();
|
||||
temp->setFixedSize(124,100);
|
||||
temp->setObjectName("temp");
|
||||
temp->setStyleSheet(R"(
|
||||
#temp{
|
||||
border-top-left-radius: 10px;
|
||||
}
|
||||
)");
|
||||
temp->setFixedSize(140,80);
|
||||
gridLayout->addWidget(temp, 0, 0);
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
@@ -51,24 +69,34 @@ PlanGrid::PlanGrid(QWidget* parent)
|
||||
#temp{
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: #d8d8d8
|
||||
color: #d8d8d8;
|
||||
}
|
||||
)");
|
||||
gridLayout->addWidget(temp, 0, i+1,Qt::AlignCenter);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
QLabel* temp = new QLabel(times[i]);
|
||||
temp->setFixedSize(124,50);
|
||||
temp->setFixedSize(140,40);
|
||||
temp->setObjectName("temp");
|
||||
temp->setStyleSheet(R"(
|
||||
#temp{
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #d8d8d8
|
||||
color: #d8d8d8;
|
||||
}
|
||||
)");
|
||||
gridLayout->addWidget(temp, i+1, 0, Qt::AlignCenter);
|
||||
}
|
||||
|
||||
gridLayout->setSpacing(0);
|
||||
setLayout(gridLayout);
|
||||
}
|
||||
|
||||
void PlanGrid::populateGrid(){
|
||||
for (int i = 0; i<5; i++){
|
||||
for (int j = 0; j < 10; ++j){
|
||||
gridLayout->addWidget(planMap->value(qMakePair(weekdays[i],times[j])),j+1,i+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,8 @@ class PlanGrid : public QWidget {
|
||||
private:
|
||||
QString weekdays[5];
|
||||
QString times[10];
|
||||
|
||||
void populateGrid();
|
||||
protected:
|
||||
QGridLayout* gridLayout;
|
||||
QMap<QPair<QString, QString>, QLabel*>* planMap;
|
||||
|
||||
Reference in New Issue
Block a user