Uploaded image for project: 'Qt Automotive Suite'
  1. Qt Automotive Suite
  2. AUTOSUITE-1170

WindowManager.raiseApplicationWindow provides an applicationId not a window

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 5.13.0
    • Qt Application Manager
    • None
    • All

    Description

      When trying to hook up the WindowManager with a SwipeView I needed to write some glue code, as the raiseApplicationWindow exposed an applicationId and not a window. The WindowManager provides a function to get an index from a window but there is no direct way to get a window from an applicationId.

      See example below

          SwipeView {
              id: stackView
              anchors.fill: parent
              Repeater {
                  model: WindowManager
                  Loader {
                      sourceComponent: AppWindow {
                          window: model.window
                      }
                      onLoaded: stackView.currentIndex = SwipeView.index
                  }
              }
          }
      
          Connections {
              target: WindowManager
              onWindowAdded:  {
                  console.log("window added")
      
              }
              onRaiseApplicationWindow: {
                  console.log("raise window: ", applicationId)
                 // GLUE CODE
                  for(var i=0; i<WindowManager.count; i++) {
                      var surface = WindowManager.get(i)
                      console.log(surface.applicationId, applicationId)
                      if (surface.applicationId === applicationId) {
                          stackView.currentIndex = i
                      }
                  }
              }
          }
      

      Ideally I would like write

              onRaiseApplicationWindow: {
                  console.log("raise window: ", applicationId)
                  stackView.currentIndex = WindowManager.indexOfWindow(window)
              }
      

      Attachments

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

        Activity

          People

            rgriebl Robert Griebl
            jryannel-lxft Jürgen Bocklage-Ryannel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes