Form in 4 gleiche Layouts teilen
Verfasst: 26. Januar 2015 09:29
Hallo,
suche eine Möglichkeit meine Form in 4 gleichgroße teile zu splitten.
Die Idee war bisher das mit dem QVBoxLayout und dem QHBoxLayout zu machen,
allerdings ist die Aufteilung nicht wie erwartet.
Erwartet:
Real:
(Also Layout 3 und 4 kleben in der linken oberen Ecke, Layout 2 ist nicht oben angefügt, sondern beginnt in der Mitte der Form)
Sieht hier jemand warum das passiert? Ich stehe auf dem Schlauch.
Gruß
und Danke
Felix
suche eine Möglichkeit meine Form in 4 gleichgroße teile zu splitten.
Die Idee war bisher das mit dem QVBoxLayout und dem QHBoxLayout zu machen,
allerdings ist die Aufteilung nicht wie erwartet.
Erwartet:
Code: Alles auswählen
----------------------
| 1 | 2 |
----------------------
| 3 | 4 |
----------------------
Real:
Code: Alles auswählen
-3/4---------------
| | -------|
- 1 2
| | |
--------------------
Code: Alles auswählen
QHBoxLayout *lLayout_H1 =new QHBoxLayout(this);
QHBoxLayout *lLayout_H2 =new QHBoxLayout(this);
lLayout_H1->setGeometry(transformRect(QRect(5, 5, (this->height()/2)-6, this->width()-6)));
lLayout_H2->setGeometry(transformRect(QRect(5, (this->height()/2), (this->height()/2)-6, this->width()-6)));
QVBoxLayout *lLayout_1= new QVBoxLayout();
QVBoxLayout *lLayout_2= new QVBoxLayout();
QVBoxLayout *lLayout_3= new QVBoxLayout();
QVBoxLayout *lLayout_4= new QVBoxLayout();
lLayout_1->setGeometry(transformRect(QRect(5, 5, (this->height()/2)-6, this->width()/2-6)));
lLayout_2->setGeometry(transformRect(QRect((this->width()/2), 5, (this->height()/2)-6, this->width()-6)));
lLayout_3->setGeometry(transformRect(QRect(5, 5, (this->height()/2)-6, (this->width()/2)-6)));
lLayout_4->setGeometry(transformRect(QRect((this->width()/2), (this->height()/2), (this->height()/2)-6, this->width()-6)));
lLayout_H1->addLayout(lLayout_1);
lLayout_H1->addLayout(lLayout_2);
lLayout_H2->addLayout(lLayout_3);
lLayout_H2->addLayout(lLayout_4);
lbX1_Axis=new SlGfwLabel(this);
lbZ1_Axis=new SlGfwLabel(this);
lbB1_Axis=new SlGfwLabel(this);
lbC10_Axis=new SlGfwLabel(this);
lbW10_Axis=new SlGfwLabel(this);
lbZ20_Axis=new SlGfwLabel(this);
lbC20_Axis=new SlGfwLabel(this);
lbX1_Axis->setText("X-Achse: ");
lbC20_Axis->setText("C20-Achse: ");
lbZ1_Axis->setText("Z1-Achse: ");
lbB1_Axis->setText("B1-Achse: ");
lbC10_Axis->setText("Z1-Achse: ");
lLayout_1->addWidget(lbX1_Axis,0,0);
lLayout_2->addWidget(lbZ1_Axis,0,0);
lLayout_3->addWidget(lbB1_Axis,0,0);
lLayout_4->addWidget(lbC10_Axis,0,0);
lLayout_1->addWidget(lbW10_Axis,0,0);
lLayout_1->addWidget(lbZ20_Axis,0,0);
lLayout_1->addWidget(lbC20_Axis,0,0);
Sieht hier jemand warum das passiert? Ich stehe auf dem Schlauch.
Gruß
und Danke
Felix