Repaint Widget in an other
Hi,
I actually try to repaint a widget with an other widget, but it seems that not work. So, perhaps I'm in a wrong way about how to use that.
The code is really simple
Code:
void
QpulsarPopupEditorContainer
::paintEvent(QPaintEvent *event
){
// m_waitEditor, QWidget that contain a QLabel with text
if(m_waitEditor)
{
QPainter *l_painter
= l_paintEngine
->painter
();
}
else
}
Does anyone have a solution ?
Thanks in advance
Philippe
Re: Repaint Widget in an other
How about:
Code:
m_waitEditor->update(); // schedules a paint event
Re: Repaint Widget in an other
That not work in my case, the problem is that I try to get the painter from a widget and putting it in an other.
When I arrive in the paint event, it display nothing. I think that my problem is in my paintEvent but I don't no what !
Philippe
Re: Repaint Widget in an other
What is it you are actually trying to achieve? Maybe there's a better way.. ;) In Qt4 you cannot paint outside paintEvent(). See notes about Qt::WA_PaintOutsidePaintEvent.
Re: Repaint Widget in an other
I do not try to paint outside, the problem is, when I paint in the paint event, I only have an empty widget. I try to use drawText and the result is the same.
Perhaps there is a better way, but for now, I do not see which way
Philippe
Re: Repaint Widget in an other
Re: Repaint Widget in an other
No, the problem stay.
I try to find if I can find an other solution with QWidget::stackUnder() but it seems that was no the solution too.
Re: Repaint Widget in an other
How did you use the redirecting?
Code:
QPainter::setRedirected(m_waitEditor,
this);
QPainter::restoreRedirected(m_waitEditor
);