[Qt-interest] How to draw a line on the mainwindow

Jaco Naude naude.jaco at gmail.com
Tue Feb 10 07:26:29 CET 2009


Hi David

Your widget overlay worked first time for me on a QMdiArea, thanks for the
tutorial. I have one further question which might not be exactly related to
the overlay class but rather to the painting, which I'm not that familiar
with.

I paint text on the QMdiArea which change depending on the application
state. I'm struggling to get the painted text to update when the application
state changes. It only updates when I move a mdisubwindow over the area
containing the text, thus forcing that area to be repainted. Is there a way
to repaint the complete overlay?

I've called paintEvent() when the state change, as well as trying to repaint
the text outside of the paintEvent() method. Neither of these approaches
worked.

Any help would be much appreciated.
Thanks
Jaco

On Fri, Feb 6, 2009 at 2:55 PM, David Boddie <david.boddie at nokia.com> wrote:

> Alexandre Beraud wrote:
>
> > I don't know exactly why theQt::WA_TransparentForMouseEvents attribute
> > is not documented and maybe not officialy supported.
>
> I don't think there is a good reason why it isn't documented, so it will be
> documented in future releases:
>
>  http://doc.trolltech.com/4.5-snapshot/qt.html#WidgetAttribute-enum
>
> > Anyway it's the
> > only way to do it as far as I know. I would add to your tutorial that
> > the widget should be raised() every time there is a risk that another
> > widget is added over it.
>
> That might well be necessary in some situations. More experimentation is
> required. Please feel free to add your notes to the QtCentre Wiki! :-)
>
> David
> --
> David Boddie
> Senior Technical Writer
> Nokia, Qt Software
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090210/3d9c1bc3/attachment.html 


More information about the Qt-interest-old mailing list