titanandrews
14th January 2010, 00:41
Hi All,
I have the following code to create a QScrollArea that is transparent with it's content also being transparent. So I want the northPanel's parent to show through.
QWidget* northPanel = new QWidget(this);
northPanel->setAttribute(Qt::WA_NoBackground);
// add some content to northPanel
QScrollArea* scroller = new QScrollArea(this);
scroller->setAttribute(Qt::WA_NoBackground);
scroller->setWidget(northPanel);
This works fine. However, when I scroll, the northPanel becomes blurred. I'm pretty sure it's because NoBackground attribute causes those widgets to not paint the background. What am I missing here? How do I make a transparent QScrollArea? Do I need to force a repaint or something?
many thanks,
B
I have the following code to create a QScrollArea that is transparent with it's content also being transparent. So I want the northPanel's parent to show through.
QWidget* northPanel = new QWidget(this);
northPanel->setAttribute(Qt::WA_NoBackground);
// add some content to northPanel
QScrollArea* scroller = new QScrollArea(this);
scroller->setAttribute(Qt::WA_NoBackground);
scroller->setWidget(northPanel);
This works fine. However, when I scroll, the northPanel becomes blurred. I'm pretty sure it's because NoBackground attribute causes those widgets to not paint the background. What am I missing here? How do I make a transparent QScrollArea? Do I need to force a repaint or something?
many thanks,
B