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.

Regards,

Nuno

> On 08/12/2015, at 16:14, René J.V. Bertin <rjvber...@gmail.com> wrote:
> 
> Hello,
> 
> I'm experiencing a crash in setMainWindow() with the code below (from 
> KF5-kwidgetsaddons).
> Is this something that is allowed on OS X, and supposed to work?
> 
> static QDialog *createWIdDialog(WId parent_id)
> {
>    QWidget *parent = QWidget::find(parent_id);
>    QDialog *dialog = new QDialog(parent, Qt::Dialog);
>    if (!parent && parent_id) {
>        setMainWindow(dialog, parent_id);
>    }
>    return dialog;
> }
> 
> Thanks,
> R.
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

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

Reply via email to