Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Script - new angle ?
Forum Updated to NodeBB v4.3 + New Features

Qt Script - new angle ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 1 Posters 518 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.
  • D Offline
    D Offline
    David King
    wrote on last edited by
    #1

    Hi,

    I'm using Qt Script only. In other words just a .js and .ui file.
    This because Qt Script is all that our vendor custom-functions, support.
    So no full blown Qt, for us :-/

    I'm familiar with Qt Scripting such as the following, that updates the text in a label,
    in response to changes to a dial:

    var label = myDialog.findChild("label_Foo");
    var dial = myDialog.findChild("dial_Foo");

    dial.valueChanged.connect(label.setText);

    My I ask though, if I've added a conical gradient to my label, via a stylesheet,
    and want to call setAngle( ) of the gradient, in response to changes to the dial,
    to whiz around the gradient, is that possible, from just Qt Script ?

    Stumbling around a bit, I've tried the following.
    Also same with : or :: or -> instead of . after the Foo.

    var gradient = myDialog.findChild("label_Foo.QConicalGradient");
    dial.valueChanged.connect(gradient.setAngle);

    I've tried also the following.
    Also same with : or :: or -> instead of . after the connect, each place.

    var label = myDialog.findChild("label_Foo");
    dial.valueChanged.connect(label.QConicalGradient.setAngle);

    But all throw errors.
    I'm sure not surprisingly given the comic element of some of the syntax I've been trying.

    Best regards,

    David

    1 Reply Last reply
    0
    • D Offline
      D Offline
      David King
      wrote on last edited by
      #2

      Hi,

      And if I can't call setAngle, from Qt Script, then I'd settle just for dynamic change to a stylesheet.
      Specifically, the angle number, below.
      Or the whole stylesheet text, with just the angle number altered.

      background-color: qconicalgradient(cx:0.5, cy:0.7, angle:90.0, stop:0.499 red, stop:0.5 grey);

      Provided, dynamic change to a stylesheet, actually results in a change on-screen.
      And reasonably good update rate.
      I'd settle for 10 a second :-)

      Best regards,

      David

      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