> + // queue the windowPropertyChanged signal. If it's emitted directly, the
> platformWindow will not yet be set for the window.
> + QMetaObject::invokeMethod(mNativeInterface, "windowPropertyChanged",
> Qt::QueuedConnection,
> + Q_ARG(QPlatformWindow*, this),
> + Q_ARG(QString, "persistentSurfaceId"));
>
> Why pass the PlatformWindow, why not the QWindow? I see you only using the
> QWindow in the appmenu stuff:
>
> + connect(nativeInterface,
> &QPlatformNativeInterface::windowPropertyChanged, this,
> [this](QPlatformWindow* window, const QString &property) {
> + if (property != QStringLiteral("persistentSurfaceId")) {
> + return;
> + }
> + if (window->window() == m_window) {
> + registerMenuForWindow(m_window, m_path);
> + }
Because the QPlatformNativeInterface::windowPropertyChanged signal takes a QPlatformWindow,* not a QWindow*.
> + // queue the windowPropertyC hanged signal. If it's emitted directly, the :invokeMethod( mNativeInterfac e, "windowProperty Changed" , ction, Window* , this), aceId") ); nativeInterface , eInterface: :windowProperty Changed, this, QPlatformWindow * window, const QString &property) { "persistentSurf aceId") ) { Window( m_window, m_path);
> platformWindow will not yet be set for the window.
> + QMetaObject:
> Qt::QueuedConne
> + Q_ARG(QPlatform
> + Q_ARG(QString, "persistentSurf
>
> Why pass the PlatformWindow, why not the QWindow? I see you only using the
> QWindow in the appmenu stuff:
>
> + connect(
> &QPlatformNativ
> [this](
> + if (property != QStringLiteral(
> + return;
> + }
> + if (window->window() == m_window) {
> + registerMenuFor
> + }
Because the QPlatformNative Interface: :windowProperty Changed signal takes a QPlatformWindow,* not a QWindow*.