Thanks spirit, but I still don't understand. Let me try to be more exact.

So I created a gui (called Editor) in desginer and it contains a button and a QGroupBox. I managed to connect the button to a slot in the Editor class. In this slot I can get a reference to thisQGroupBox like this:
Qt Code:
  1. Editor::slot()
  2. {
  3. ui.groupBox->doSomething();
  4. }
To copy to clipboard, switch view to plain text mode 


just like the second method you suggested. Now I would like to make a QFrame appear on this QGroupBox, so I figured:

Qt Code:
  1. Editor::slot()
  2. {
  3. QFrame* frame = new QFrame(ui.groupBox);
  4. frame->setGeometry(10, 10, 100, 100);
  5. frame->setLineWidth(20);
  6. frame->show();
  7. }
To copy to clipboard, switch view to plain text mode 

but it doesn't show. What I understood so far is that you put a widget "into" another one by declaring the other one as the parent in the constructor. Is that not the right way?


The painting is a different issue. groupBox should paint a line when I press the button. For this I would have to override a paint method (I need to look up the syntax yet) right? And then the Qt framework would call this paint method when it thinks it's the right time? Or triggered by me...somehow. Having a pointer to groupBox, nor the subclassing suggestion would help me with the overriding.

I ordered the book yesterday, but I'm too impatient and I want to leeearn.

Cruz