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

QWidget::winId() failed to get native window

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.12.0
    • None
    • macOS

    Description

      1.setQuitOnLastWindowClosed(true);
      
      2.create a widget
      
      3.use QWidget::winId() to get a native window
      
      4.use NSView *view = (NSView*)widget->winId() conver to NSView , and it works.
      

      On the first time I can get a native NSView, but if i close the widget by click the native close button, and then I call show() to make the widget visible again. After that, the value winId() returned is no longer a valid NSView.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            flqshcat flqshcat
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes