EDIT: Maybe I found the problem
EDIT2: Indeed I did. Ok, I did not, but it works now
. As you said I had to call show() to the single widgets.

Originally Posted by
jpn
Sounds like a parenting issue. A widget with no parent is same as a top level window. So the QFrame has no parent. And the QLabel won't be visible if it's parent (QFrame) is hidden.
Double check the code where you do the reparenting/layout switching. There must be a quirk somewhere.
There was a small mistake: I did it this way
QHBoxLayout->QFrame->QHBoxLayout->QLabel and QLabel;
The additional QFrame is for easy layouting and dragndrop.
So I add the QFrame to the QHBoxLayout. Is not the QHBoxLayout now automatically the new parent? Because of your suggestion I tried
addWidget(itemframe) //it's in the constructor of the derived QHBoxLayout class
itemframe->setParent(this) //this is the QHBoxLayout
addWidget(itemframe) //it's in the constructor of the derived QHBoxLayout class
itemframe->setParent(this) //this is the QHBoxLayout
To copy to clipboard, switch view to plain text mode
but the compiler says that only a QWidget can be the parent of itemframe :-/
btw.: jpn, you're my personal hero for this month
Bookmarks