PDA

View Full Version : QWidget::render() and sharedPainter



faldzip
10th November 2008, 20:04
Hi!

I want to render my widget in my delegate's paint() method, so i'm doing those things:


void PropertiesDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
widget->render(painter, option.rect.topLeft(), option.rect);
}

where widget is a pointer to my widget instance. And that code was working with Qt 4.3.3 but now i have Qt 4.4.3 and there is a problem, because i get error ASSERT: "sharedPainter ? sharedPainter->isActive() : true". But when i just started this thread it started to work (no runtime errors) but it's not working good. Only 1 item is rendered good and other are just white background and after scrolling some of them appear and some disappear... How should I do this to work fine? I mean I want now just to fill item rect with an rendered widget.