Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

509
Vistas
How to write a for loop in qml?

I am trying to add tick marks for dial on qml. I made the calculations and created the tick marks manually but want them to appear automatically based on the step size of the dial. My idea is to use a for loop but I don't know how to call the javascript in qml. Is the for loop the way to go and how does the code look like? Or do you have a better, more qml-like solution?

for i = (0,n):
  gamma = alpha+i*delta
  mix = sin (gamma) * (a+r+l/2)
  miy = cos (gamma) * (a+r+l/2)
  create tick mark i with mix, miy, gamma, l
end for

This is the logic that I want to put in the loop.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You should write your for loop inside a function like below:

function doing_in_loop() {
  for (var i = 0; i < 9; i++)  {
      console.log(i)
  }
}

or do in on a signal:

Component.onCompleted: {
   for (var i = 0; i < 9; i++)  {
      console.log(i)
   }
}
about 4 years ago · Juan Pablo Isaza Denunciar

0

I think you can just do it like this:

for (var i = 0; i < 10; i++) {

}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda