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. How to create a js code snippet and debug it in Qt Quick
Forum Updated to NodeBB v4.3 + New Features

How to create a js code snippet and debug it in Qt Quick

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 422 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.
  • MLandgrafM Offline
    MLandgrafM Offline
    MLandgraf
    wrote on last edited by
    #1

    Dear All,

    I try to get some js code snippet executed.

    I have this procedural js code from an application which is built the JS engine in Qt to execute a custom tailorable code segment.
    It starts with some variable declarations and then several functions follow. The first function is called from the original application.
    Now I want to modify and debug it.

    Where / how shall I execute it?
    Your ideas would be greatly appreciated.

    Regards, Mathias

    1 Reply Last reply
    0
    • SikarjanS Offline
      SikarjanS Offline
      Sikarjan
      wrote on last edited by
      #2

      Hi Mathias,

      your question is kind of vague, I guess but I try to make a suggestion.

      Text {
          function testText(test){
              var testArray = test.split(',')
              var text = ''
              for(var i = 0; i < testArray.length; ++i){
                  text += testArray[i]+'/'
              }
              text = text.slice(0, -1)
              return text
          }
          text:  testText(test)
      }
      

      I use this snipped in a ListView delegate. test is a variable from my model and will be passed through the JS function before it is displayed. The function testText does not need to be within Text, it could be in an external JS file.

      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