Important: Please read the Qt Code of Conduct -

Attribute Access

  • Hi,

    As mentioned in other posts, we're using Qt Script only, no fullblown Qt,
    due to restriction placed by our vendor tool, that launches our .js.
    Which then in turn, via vendor command, launches our .ui.

    As I understand from the vendor, from script, I can access widget properties,
    and public slot functions. But not other functions, for example setAttribute.

    However, I would quite like to use on a widget, setAttribute( TransparentForMouseEvents, true);
    Does anyone know, if there might be a way to do so, from script ?
    I just need that attribute true always.
    Is there a way to initialise a widget, with a certain attribute true ?

    Best regards,


  • not without a bit of C++ to expose setAttribute as Q_INVOKABLE.

  • Hi VRonin,

    Thank you so much for your response. Ah, I feared as much.
    I've asked the vendor if they might consider adding the following 2 functions accessible by script:

    util.setAttribute( widgetName, attributeNumber, false or true );
    util.testAttribute( widgetName, attributeNumber );

    Best regards,


Log in to reply