Hi,
i want to draw a line on top of another widget, but it's drawn below.
Is it possible to draw over an other widget?
Thanks in advance,
Jones
Hi,
i want to draw a line on top of another widget, but it's drawn below.
Is it possible to draw over an other widget?
Thanks in advance,
Jones
Great. It does exactly, what i want.
Thanks allot.
i think that i have the same problem!
two widgets, one inside another one, and i want to draw a line in the widget that is inside the big one.
QPen pen(Qt::yellow,2,Qt::SolidLine);
QPainter painter(ui.the_widget_that_is_inside);
painter.setPen(pen);
painter.drawLine(200,300,400,150);
this code it doesn't work! anybody can help me,please?
thanks in advance!
You cannot paint like that !!QPainter painter(ui.the_widget_that_is_inside);
You will need to subclass ui.the_widget_that_is_inside and do the painting in paintEvent() function.
what do you mean when you say to subclass?
i have edit inside the main widget a simple class(without .ui) and it doesn't work!
i think that i didn't understand you!
Bookmarks