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

OS X: QWindow::setGeometry() and QWindow::resize doesn't emit signals for windows embedded in native windows

    XMLWordPrintable

Details

    • macOS

    Description

      QWindow::setGeometry and QWindow::resize doesn't emit widthChanged() or heightChanged() signals in case of native window.

      void QWindow::setGeometry(const QRect &rect)
      {
          Q_D(QWindow);
          d->positionAutomatic = false;
          if (rect == geometry())
              return;
          QRect oldRect = geometry();
      
          d->positionPolicy = QWindowPrivate::WindowFrameExclusive;
          if (d->platformWindow) {
              d->platformWindow->setGeometry(rect);
          } else {
              d->geometry = rect;
      
              if (rect.x() != oldRect.x())
                  emit xChanged(rect.x());
              if (rect.y() != oldRect.y())
                  emit yChanged(rect.y());
              if (rect.width() != oldRect.width())
                  emit widthChanged(rect.width());
              if (rect.height() != oldRect.height())
                  emit heightChanged(rect.height());
          }
      }
      
      void QWindow::resize(const QSize &newSize)
      {
          Q_D(QWindow);
          if (d->platformWindow) {
              d->platformWindow->setGeometry(QRect(position(), newSize));
          } else {
              const QSize oldSize = d->geometry.size();
              d->geometry.setSize(newSize);
              if (newSize.width() != oldSize.width())
                  emit widthChanged(newSize.width());
              if (newSize.height() != oldSize.height())
                  emit heightChanged(newSize.height());
          }
      }
      

      this happens when embedding a QWindow into a native cocoa window via getEmbeddableView (as in qtmacextras/examples/macextras/embeddedqwindow/main.mm).

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            kileppal Kimmo Leppälä
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes