Hello again,
today i had the time to solve this problem with your suggestions
At: http://doc.trolltech.com/latest/qscr...html#setWidget
is the hint:
Note that You must add the layout of widget before you call this function; if you add it later, the widget will not be visible - regardless of when you show() the scroll area. In this case, you can also not show() the widget later.
With QLayout i had some problems, but at last:
I had to set the minimum size of my custom widget, before i add it to the scrollArea.
So everytime i change the size of pJob because of adding new functionyllity -eg widgets to it scrollArea will adapt automatically.
i did at my constructor:
...
m_ui->setupUi(this);
Jobs *pjob = new Jobs();
QSize AdjustSize
= pjob
->size
();
AdjustSize.width(); // for debugging...
// Adjust scrollArea to this size,
pjob->setMinimumSize(AdjustSize); // Advantage: everytime you change the size of pJob,
// because of adding new functionyllity -eg widgets to it..
// scrollArea will adapt automatically (-:
m_ui->scrollArea->setWidgetResizable(true);
m_ui->scrollArea->setWidget(pjob);
...
m_ui->setupUi(this);
Jobs *pjob = new Jobs();
QSize AdjustSize = pjob->size();
AdjustSize.width(); // for debugging...
// Adjust scrollArea to this size,
pjob->setMinimumSize(AdjustSize); // Advantage: everytime you change the size of pJob,
// because of adding new functionyllity -eg widgets to it..
// scrollArea will adapt automatically (-:
m_ui->scrollArea->setWidgetResizable(true);
m_ui->scrollArea->setWidget(pjob);
To copy to clipboard, switch view to plain text mode
Thank you very much,
& have a nice day
Astronomy
Bookmarks