/usr/share/SuperCollider/SCClassLibrary/QtCollider/QUserView.sc is in supercollider-common 1:3.6.3~repack-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | QUserView : QView {
var <drawFunc, <drawingEnabled=true;
*qtClass { ^'QcCustomPainted' }
*new { arg parent, bounds;
var me = super.new(parent, bounds ?? {this.sizeHint} );
me.canFocus = true;
^me;
}
*sizeHint {
^Point(150,150);
}
drawingEnabled_ { arg boolean;
// Allow setting the property apart from the instance variable
// to optimize when drawFunc is nil. See drawFunc_ implementation.
drawingEnabled = boolean;
this.setProperty( \drawingEnabled, boolean );
}
clearOnRefresh { ^this.getProperty( \clearOnRefresh ); }
clearOnRefresh_ { arg boolean; this.setProperty( \clearOnRefresh, boolean ); }
clearDrawing { this.invokeMethod( \clear ); }
drawFunc_ { arg aFunction;
this.setProperty( \drawingEnabled, aFunction.notNil );
drawFunc = aFunction;
}
draw {
// NOTE: it is only allowed to call this while a QPaintEvent is being
// processed by this QWidget, or an error will be thrown.
drawFunc.value(this);
}
animate_ { arg bool; this.invokeMethod( \animate, bool ); }
frameRate_ { arg fps; this.setProperty( \frameRate, fps.asFloat ); }
frameRate { ^this.getProperty( \frameRate ); }
frame { ^this.getProperty( \frameCount ); }
// override QView's action_ to not connect to 'action()' signal
action_ { arg func;
action = func;
}
doDrawFunc { drawFunc.value(this) }
}
|