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

Make Menu.popup() compilable by qmlsc

XMLWordPrintable

      QQuickMenu::popup() is currently uncompilable (see https://github.com/qt/qtdeclarative/blob/dev/src/quicktemplates/qquickmenu_p.h#L100):

      Q_REVISION(2, 3) Q_INVOKABLE void popup(QQmlV4Function *args);
      

       

      Code

      import QtQuick.Controls.Basic
      
      ApplicationWindow {
          width: 640
          height: 480
          visible: true
      
          Menu { id: contextMenu }
          Component.onCompleted: contextMenu.popup()
      }
      

       

      qmlsc output

      Warning: Main.qml:9:37: Could not compile binding for onCompleted: Cannot generate efficient code for call to untyped JavaScript function [compiler]
          Component.onCompleted: contextMenu.popup()
                                             ^^^^^
      

        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
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes