title: Mac HUD window in Qt
body: <p>I am trying to create a HUD that is an NSPanel in Qt. I am using QMacCocoaViewContainer as suggested in the qt documentation.</p>
  
  <p>In HUD.h</p>
  
  <pre><code>#import &lt;QWidget&gt;
  #import &lt;QMacCocoaViewContainer&gt;
  
  
  class HUD : public QMacCocoaViewContainer
  {
  public:
      HUD(QWidget* parent);
  };
  </code></pre>
  
  <p>In HUD.mm</p>
  
  <pre><code>#import "HUD.h"
  #import &lt;Cocoa/Cocoa.h&gt;
  
      HUD::HUD(QWidget* parent) : QMacCocoaViewContainer(0,parent)
      {
          NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  
          NSPanel *panel = [[NSPanel alloc] initWithContentRect: NSRectFromCGRect(CGRectMake(0,0,250,250))                                     
                                              styleMask:NSHUDWindowMask | NSTitledWindowMask | NSUtilityWindowMask                        
                                              backing:NSBackingStoreBuffered 
                                              defer:YES   
                                              screen:[[NSApp mainWindow] screen]];
  
          setCocoaView(panel);
  
  
          [panel release];
          [pool release];
      }
  </code></pre>
  
  <p>Every time I run it however I get an error saying [NSPanel window]: unrecognized selector sent to instance 0x21231f0. Has anybody had any luck mixing Qt and Cocoa? Any tricks that you used to make it work?</p>