3

Is there a way to create a transparent panel as described by the Apple Human Interface Guidelines in Qt 4.6 (built for OS X 10.6/Cocoa)?

If not, are there any alternatives similar in look and function?

I understand that Qt is a cross platform toolkit, but I want my application to feel as "native" as possible.

dnadlinger
  • 5,883
  • 4
  • 21
  • 24

1 Answers1

2

I haven't tried on Mac, but this should be possible. Here's what the QWidget docs say:

Creating Translucent Windows

Since Qt 4.5, it has been possible to create windows with translucent regions on window systems that support compositing.

To enable this feature in a top-level widget, set its Qt::WA_TranslucentBackground attribute with setAttribute() and ensure that its background is painted with non-opaque colors in the regions you want to be partially transparent.

Platform notes:

X11: This feature relies on the use of an X server that supports ARGB visuals and a compositing window manager.

Windows: The widget needs to have the Qt::FramelessWindowHint window flag set for the translucency to work.

I imagine your panel is a top-level widget, so make sure to set Qt::WA_TranslucentBackground as directed in the above.

Community
  • 1
  • 1
Kaleb Pederson
  • 45,767
  • 19
  • 102
  • 147
  • Thanks for your answer, but I am really looking for a way to create Cocoa »transparent panels« as described/depicted in the linked part of the Apple Human Interface Guidelines. – dnadlinger Sep 06 '10 at 15:21
  • I don't know much about Mac. Can you explain the difference between the two? – Kaleb Pederson Sep 06 '10 at 15:47
  • Sorry, I must have missed your response. The difference is illustrated in Figure 14-1 of the Apple Human Interface Guidelines linked in the original question. I have not checked the source code yet, but I'm afraid Qt simply does not support this platform-dependent alternative widget set, since I have not found any references to it in the docs. – dnadlinger Dec 03 '10 at 01:10