Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-84999

Widgets embedded to floating palettes of non-Qt apps are shifted on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P2: Important P2: Important
    • None
    • 5.12.6
    • None
    • Windows 10
    • Windows

      We embed Qt controls into native floating palettes of Adobe Illustrator, i.e. of a 3rd-party non-Qt app. After the widget is created we do this:

      window->setProperty("_q_embedded_native_parent_handle", (WId)hParent);

      HWND h = static_cast<HWND>(QGuiApplication::platformNativeInterface()->nativeResourceForWindow("handle", window));

      SetParent(h, hParent);

      window->setFlags(Qt::FramelessWindowHint);

      However, since Qt 5.9, our widgets are shifted up-left by (8, 31) pixels.

      Before Qt 5.9, thanks to the fix for QTBUG-40578, QWindowsWindow::frameMarginsDp() always returned empty margins for Qt::FramelessWindowHint.

      But there is no such explicit check on Qt::FramelessWindowHint since Qt 5.9, QWindowsGeometryHint::frame() now returns {8, 31, 8, 8} as the margins, based on the style. I believe WindowCreationData::style should not include WS_CHILD for embedded frameless windows. Then the margins will again be zeros. A patch (for Qt 5.12) is attached.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            jan.patera Jan Patera
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes