Nuno Santos wrote:

Hello Nunos,

Have you tried using a `ptr` that comes from another application? I think 
that's 
the context in which I get the crash.

I'll keep your code in mind though; the crash issue also reminded me that KF5 
KWindowSystem doesn't yet have a plugin (backed) implemented for OS X, so I'm 
porting the one from KDE4... Fun times!

R.

> Rene,
> 
> I have recently dealt with creating content within a native window on mac
> given a pointer. This was I got to:
> 
> QMacNativeWidget* IVstEditor::fromWindowRef(void *ptr)
> {
>     NSView* view = (NSView*) ptr;
> 
>     QMacNativeWidget *nativeWidget = new QMacNativeWidget(view);
> 
>     nativeWidget->move(0, 0);
>     nativeWidget->setPalette(QPalette(Qt::red));
>     nativeWidget->setAutoFillBackground(true);
>     nativeWidget->setWindowFlags(Qt::FramelessWindowHint |
>     Qt::WindowDoesNotAcceptFocus);
> 
>     NSView *nativeWidgetView = reinterpret_cast<NSView
>     *>(nativeWidget->winId());
> 
>     [view addSubview:nativeWidgetView];
> 
>     nativeWidget->show();
> 
>     return nativeWidget;
> }
> 
> I don’t know if you can turn a simple widget into a QDialog but maybe you can
> find something useful here.



_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to