Hello,

putting a Widget inside a QScrollArea despends on where the pointer variable to the QScrollArea is saved. If I have: (Pseudo-Code)

Qt Code:
  1. class1():new class2(&class1)
  2.  
  3. class2():QScrollArea->setWidget(this)
To copy to clipboard, switch view to plain text mode 

I don't get scrollbars.

If I have:

Qt Code:
  1. class1():new class2(&class1),QScrollArea->setWidget(class2)
To copy to clipboard, switch view to plain text mode 

I get scrollbars.

Why is this?

The only differences is the location of the QScrollArea pointer variable (class1 or class 2). In both cases class2 gets set and class2 should be reparented from class1 to QScrollArea while class1 becomes the parent of QScrollArea.
As an object shouldn't have access to the scope it is placed in, it shouldn't matter whether the pointer variable is in class2 or in class1!

BR

Lars