# object class

Base class for all the KVIrc objects

Inherits
none
Description
This is the base class for all the builtin KVirc object classes. It exports the functions to retrieve the object name, to iterate through children objects and to lookup a child object by name or class. Additionally , this class provides the builtin timer functionality. The $constructor and $destructor functions are empty implementations that all the other classes inherit.
Functions

`$constructor()`
Constructor for this object class. The default implementation does nothing.
`$destructor()`
Destructor for this object class. The default implementation emits the signal "destroyed".
`$name()`
Returns the name of this object.
`$parent()`
Returns the parent object of this object or 0 if this object has no parent.
`$timerEvent(<timerId>)`
Handler for the timer events. The default implementation does nothing. See also $startTimer() and $killTimer().
`$startTimer(<timeout>)`
Starts a builtin timer for this object and returns its timer id as a string or '-1' if the <timeout> was invalid. The $timerEvent() handler function will be called at each <timeout>. The <timeout> is in milliseconds.
`$killTimer(<timer id>)`
Stops the timer specified by <timer id>.
`$killTimers()`
Stops all the builtin timers running.
`$className()`
Returns the class name of this object instance
`$findChild(<class>,<name>)`
Returns the first child that matches <class> and <name>. If <class> is an empty string, any class matches, if <name> is an empty string, any name matches. This function traverses the entire tree of children but is NOT recursive.
`$childCount()`
Returns the number of children objects
`$emit(<signal_name>[,parameters])`
Emits the signal <signal_name> passing the optional [parameters]. See the objects documentation for an overview of signals and slots.
`$children()`
Returns an array of children object identifiers.
`$signalSender()`
Returns the current signal sender when in a slot connected to a signal. In other contexts this function returns an empty string. You can safely use it to test if the current function has been triggered directly or from a signal emission.
`$signalName()`
Returns the name of the signal last signal that has triggered one of this object's slots. This means that in a slot handler it returns the name of the signal that has triggered it.
`$property(<Qt property name>[,bNowarning:boolean])`

This is for really advanced scripting.
All KVIrc widgets are based on the Qt library ones.
The Qt library allow to set and read special properties.
You will have to take a look at the Qt documentation for each widget type to see the available property names.
The supported property types are: Rect, Size, Point, Color, String, CString, Int, UInt, Bool and enumeration types.
For example, the widget's x coordinate can be retrieved by using the $x() function or by calling $property(x).
There are many properties that are available ony through the [classfnc]$property()[classfnc]" call:
For example, you can find out if the widget accepts drops by calling [classfnc]$property(acceptDrops)[classfnc].
This function will be mainly useful in the wrapper class.

`$setProperty(<Qt property>,<property value>)`

Sets a qt property for this widget.
This is for advanced scripting, and can control really many features of the Qt widgets.
For example, the multilineedit widgets can be set to the "password" echo mode only by using this function call:

        %X=$new(lineedit, 0, a_name)     %X->$show()     %X->$setProperty(echoMode,Password)

The available properties to be set are listed by $listProperties()
and must appear in the list as writeable.
This function will be mainly useful in the wrapper class.

`$listProperties([bArray])`
Lists the properties of this object. If <bArray> is $true then the function returns the properties as an array of descriptive strings, otherwise the properties are dumped to the active window. If <bArray> is not passed then it is assumed to be $false. This function will be mainly useful in the wrapper class.

Signals

`destroyed()`
Emitted by the default implementation of $destructor. If you reimplement $destructor in one of the derived classes (or as a private implementation), and still want this signal to be emitted you must emit it by yourself, or (better) call the base class destructor.

Index, Object Classes

KVIrc 3.4.0 Documentation
Generated by linimon at Wed Dec 3 16:16:57 2008