Note that there are some explanatory texts on larger screens.

plurals
  1. POExtending Qml in python : named signal parameters
    primarykey
    data
    text
    <p>According to Qt's doc :</p> <blockquote> <p>All Qt signals on a registered class become available as special "signal properties" within QML to which the user can assign a single JavaScript expression. The signal property's name is a transformed version of the Qt signal name: "on" is prepended, and the first letter of the signal name upper cased. For example, the signal used in the example above has the following C++ signature:</p> <p>signals: void partyStarted(const QTime &amp;time);</p> <p>Signal parameters become accessible by name to the assigned script. An unnamed parameter cannot be accessed, so care should be taken to name all the signal parameters in the C++ class declaration. The intrinsic types listed in Adding Types, as well registered object types are permitted as signal parameter types. Using other types is not an error, but the parameter value will not be accessible from script.</p> </blockquote> <p>"so care should be taken to name all the signal parameters in the C++ class declaration" => How do i do that in python ?</p> <p>I need this in my attempt to translate this custom C++ extension : <a href="http://qt-project.org/doc/note_revisions/44/221/view" rel="nofollow">http://qt-project.org/doc/note_revisions/44/221/view</a> (WheelArea) into some python/PySide or PyQt code :</p> <p>So far, i'm almost good, but i can't figure how to translate this part (the wheel event signals) :</p> <pre><code>signals: void verticalWheel(int delta); void horizontalWheel(int delta); </code></pre> <p>in python (the named signal parameters) to access the delta from qml.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload