Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Block JS execution in same thread -- is it possible?
Forum Updated to NodeBB v4.3 + New Features

Block JS execution in same thread -- is it possible?

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 530 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    digorydoo
    wrote on last edited by
    #1

    My Qt app is intended for a mobile platform, i.e. there are no windows, and dialog boxes are created as a bunch of Rectangles on top of the rest. I wrote a dialog that allows the user to make some choice. The dialog first creates a semi-transparent Rectangle covering the entire screen and eating up all mouse events, effectively making the fake-dialog modal.

    In the current implementation, the call that opens the dialog can't directly read the result. Instead, the dialog passes the result back through a signal/slot mechanism. This works, but is somehow clumsy. It would be much nicer if I could simply write in Jawa-Script: [btw, why does this editor remove JS when correctly spelled?!]

    @
    var result = App.showChoiceDlg();
    console.log ("And the result is: " + result);
    @

    This means that showChoiceDlg() needs to block execution of the script until some event occurs. I wonder if this is possible? And how?

    EDIT: For clarification: App is a custom C++ class, which I made visible to QML through QQmlContext's setContextProperty method. showChoiceDlg() is a public slot in that C++ class, which dynamically loads my dialog QML file and adds it to some main container.

    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