ich habe folgendes Problem:
Ich habe 2 identische Layouts die folgendermaßen aufgebaut sind: Zwei QHBoxLayouta bestehend aus jeweils einem QLabel und einem QLineEdit. Diese beiden QHbox Layouts sind wiederrum in einem QVBoxLayout abgelegt.
Diese Konstruktion habe ich wie gesagt zweimal, und möchte die beiden "Großen" Layouts nun in ein umfassende QHBoxLayout packen was auch so funktioniert, wenn die Anwendung gestartet wird sieht das Layout aus wie gewünscht.
Gebe ich allerdings in ein QLineEdit des linke Layouts etwas ein und beende die Eingabe, so rutscht das gesamte rechte Layout ein Stück nach rechts, und ich wiess nicht warum.
Hier mal der besagte Code:
Code: Alles auswählen
//lAYOUT-1
QHBoxLayout *nav1EingabeLayout = new QHBoxLayout;
nav1EingabeLayout->addWidget(nav1);
nav1EingabeLayout->addWidget(nav1eingabe);
QHBoxLayout *nav1AusgabeLayout = new QHBoxLayout;
nav1AusgabeLayout->addWidget(nav1name);
QVBoxLayout *nav1Layout = new QVBoxLayout;
nav1Layout->addLayout(nav1EingabeLayout);
nav1Layout->addLayout(nav1AusgabeLayout);
//Layout-2
QHBoxLayout *nav2EingabeLayout = new QHBoxLayout;
nav2EingabeLayout->addWidget(nav2);
nav2EingabeLayout->addWidget(nav2eingabe);
QHBoxLayout *nav2AusgabeLayout = new QHBoxLayout;
nav2AusgabeLayout->addWidget(nav2kuerzel);
nav2AusgabeLayout->addWidget(nav2name);
QVBoxLayout *nav2Layout = new QVBoxLayout;
nav2Layout->addLayout(nav2EingabeLayout);
nav2Layout->addLayout(nav2AusgabeLayout);
//Layout gesamt
QHBoxLayout *navLayout = new QHBoxLayout;
navLayout->addLayout(nav1Layout);
navLayout->addStretch();
navLayout->addLayout(nav2Layout);
Versteht jemand das Problem, und hat einen Tipp zur Lösung?
MfG