Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. How to get the return value synchronously, when invoking a slot method with qwebchannel.js?
Forum Update on Monday, May 27th 2025

How to get the return value synchronously, when invoking a slot method with qwebchannel.js?

Scheduled Pinned Locked Moved Unsolved QtWebEngine
5 Posts 3 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X Offline
    X Offline
    xiao499242740
    wrote on last edited by aha_1980
    #1

    Hi guys,I had read the help document about qwebchannel.js as the picture shows, but I want to get the return value synchronously. How should i do ? Can i get the return value synchronously? Thank you!
    0_1518080467754_95f1a793-bac6-44be-a4d9-ed16deaa6478-image.png

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MsLiu
      wrote on last edited by
      #2

      Is this the js function? You can invoke Qt's function or emit signal from callback,the value passed through param

      hope to help you

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xiao499242740
        wrote on last edited by
        #3

        @MsLiu said in How to get the return value synchronously ,when invoking a slot medthod with qwebchannel.js?:

        You can invoke Qt's functio

        Thanks for your help! But I Want get the return value synchronously ,not asynchronously. How should i do?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MsLiu
          wrote on last edited by
          #4

          You can synchronize with the semaphore by yourself ,You can wait in invoke function until callback function return
          hope to help you

          1 Reply Last reply
          1
          • A Offline
            A Offline
            amithooda
            wrote on last edited by
            #5

            I am also in need to sync call from JS side to c++ side using QWebChannels. I have a list which populates and then i need to serve it to the JS side. How should i do it ?

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved