Qml how Open new Window capture Barcode



  • Hi.

    I have a Window:

    0_1557682836272_Cattura.JPG

    open a new window where I will do the barcode capture logic (I have it ready) but I don't know how to do to:

    1. open a new window
    2. send the data back to the root window

    Do you have any examples? also trivial

    Thank you all


  • Moderators

    This might work (brain-to-terminal, completely untested):

    ApplicationWindow {
      BarcodeWindow {
        id: barcodeWindow
        onBarcodeScanned: {
          console.log("Scanned: " + blah)
        }
      }
    
      Button {
        onClicked: barcodeWindow.visible = !barcodeWindow.visible
      }
    }
    
    // BarcodeWindow.qml
    Window {
      signal barcodeScanned(string blah)
      visible: false
      // ...your barcode scannning code...
    }
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.