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

Widgets yet to be shown shouldn't get a WinId() just because their parent have one.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.7.0
    • 4.4.0, 4.5.0, 4.5.1, 4.5.2, 4.5.3, 4.6.0, 4.6.1, 4.6.2, 4.6.3, 4.7.0, 4.7.1
    • None
    • 1d506981bcc3d2b8aad67989fd7946a0ad826856

    Description

      As this causes side effects on mapToGlobal() for instance (tries to call XTranslateCoordinates instead of using data()->crect)

      diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
      index c86927e..f1f1d9c 100644
      --- a/src/gui/kernel/qwidget_x11.cpp
      +++ b/src/gui/kernel/qwidget_x11.cpp
      @@ -1046,9 +1046,7 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
           q->setAttribute(Qt::WA_WState_Visible, false);
           q->setAttribute(Qt::WA_WState_Hidden, false);
           adjustFlags(data.window_flags, q);
      -    // keep compatibility with previous versions, we need to preserve the created state
      -    // (but we recreate the winId for the widget being reparented, again for compatibility)
      -    if (wasCreated || (!q->isWindow() && parent->testAttribute(Qt::WA_WState_Created)))
      +    if (wasCreated)
               createWinId();
           if (q->isWindow() || (!parent || parent->isVisible()) || explicitlyHidden)
               q->setAttribute(Qt::WA_WState_Hidden);
      
      

      Attachments

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

        Activity

          People

            dzyubenk Denis Dzyubenko (Inactive)
            ntg Pierre Rossi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes