bensh
17th March 2010, 21:46
Hi,
i trying to Port a GUI from QT3 to QT4.
The Scrolling in my Widget was implemented using QScrollview.
The painting works correct, but the Pixmap is painted in the background (not the correct widget) in full size and there are no scrollbars.
I think, that the setting of the widget is not happening correct..
The painting is done on viewport()..
Here's the piece of code I think the problem lies:
xxx::xxx(..* , ..* ..) : QScrollArea(parent) {
...
QWidget* widget = new QWidget;
QVBoxLayout* layout = new QVBoxLayout(this);
widget->setLayout(layout);
setWidget(widget);
setBackgroundRole(QPalette::Dark);
...
}
Thx in advance
--
bensh
i trying to Port a GUI from QT3 to QT4.
The Scrolling in my Widget was implemented using QScrollview.
The painting works correct, but the Pixmap is painted in the background (not the correct widget) in full size and there are no scrollbars.
I think, that the setting of the widget is not happening correct..
The painting is done on viewport()..
Here's the piece of code I think the problem lies:
xxx::xxx(..* , ..* ..) : QScrollArea(parent) {
...
QWidget* widget = new QWidget;
QVBoxLayout* layout = new QVBoxLayout(this);
widget->setLayout(layout);
setWidget(widget);
setBackgroundRole(QPalette::Dark);
...
}
Thx in advance
--
bensh