[Qt-interest] Semitransparent QMdiWindow

Sean Hayes sean.t.hayes at vanderbilt.edu
Tue Apr 12 21:36:37 CEST 2011


I had not seen that QtQuarterly and had forgotten about setWindowOpacity().
Thank you for your help! You were correct; it does not have an effect on
QMdiSubWindow objects.

I have noticed on strange effect after enabling
the Qt::WA_TranslucentBackground* *attribute. If I paint a semitransparent
rectangle on the QMdiSubWindow I can get some transparency briefly. The
transparency becomes more apparent initially with middle ranges
(alpha around 0x7F). As values become higher, as expected window becomes
more opaque and the color I specified to be painted. However, as the alpha
values get lower, the window also becomes more opaque, and the widget color
becomes closer to black. In any case, each time the window receives a paint
event, the window becomes less transparent.

Is this related to a bug, preventing QMdiSubWindow from becoming
transparent? That is what it sounds like to me. I do not see anything
related at http://bugreports.qt.nokia.com

Sean

On Tue, Apr 12, 2011 at 12:48 PM, Harish Surana <surana4u at gmail.com> wrote:

> I don't know if you have scene 29th edition of QtQuarterly(
> http://doc.qt.nokia.com/qq/QtQuarterly29.pdf). On first page they have
> article about Translucency. You can also look at setWindowOpacity to make it
> semi transparent. But I doubt that it will work in QMdiSubWindow.
>
> On Tue, Apr 12, 2011 at 10:09 PM, Sean Hayes <sean.t.hayes at vanderbilt.edu>wrote:
>
>> Can anyone at least confirm that the normal/best way create a
>> semitransparent widget or window is with a semitransparent brush and
>> the Qt::WA_TranslucentBackground attribute?
>>
>> Thanks,
>> Sean
>>
>>
>> On Mon, Apr 11, 2011 at 9:38 AM, Sean Hayes <sean.t.hayes at vanderbilt.edu>wrote:
>>
>>> How can I create transparent and semitransparent QMdiWindows? I have
>>> tried setting the alpha value for the brush within my
>>> QMdiSubwindow::paintEvent() subclass. I have also tried setting
>>> the Qt::WA_TranslucentBackground attribute.
>>>
>>> I am using Qt 4.7.2 on Windows 7.
>>>
>>> Thank you for your help,
>>> Sean
>>>
>>
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at qt.nokia.com
>> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110412/3d587e95/attachment.html 


More information about the Qt-interest-old mailing list