wrapper class

# wrapper class Provides a wrapper class that hooks to an existing Qt graphic object modifying it.
Inherits
object widget
Description
This is a class for advanced KVIrc scripting. It can wrap any existing KVIrc widget. This class allows some unbelievable changes to the whole graphic environment of the kvirc, in fact, could hook every widget, you can modify the property or you can be inserted other widget as child of this... in short you have absolute liberty. The power of this class is fantastic, because it allows the change at "run time" of almost all the elements of the Kvirc. But to use this class in optimal way and to exploit its power, you have to know the Qt.... so you won't have limits The KVIrc Qt widgets are arranged in trees (just as the objects). The difference is that there are more toplevel widgets (and so more than one tree). You can use $objects.dump() to take a look at the KVIrc Qt objects tree. Here is a part of the tree: Ptr 14332520: top level object: kvirc_frame, class KviFrame, visible, rect = -4, -4, 1024, 708 Ptr 17296024: object: qt_top_dock, class QDockArea Ptr 14882136: object: qt_custom_toolbar, class KviCustomToolBar Ptr 18143368: object: qt_dockwidget_internal, class QDockWindowTitleBar Every listed widget has a "name", a "class" and a set of properties. The first entry in this example is a KVIrc server window, class "KviFrame" and name "kvirc_frame": it is a toplevel widget. The "qt_top_dock", "qt_custom_toolbar" and the "qt_dockwidget_internal" are direct children of that widget. To indicate a specific widget we will use the "class::name" form. So to indicate the main KVIrc frame you will use "KviFrame::kvirc_main_frame". Look at this example: %A=$new(wrapper,0,test,KviFrame::kvirc_frame,KviStatusBar::unnamed) %A->$setBackGroundColor(FFFFFF) For first thing we create an object type wrapper,then we flow the tree that there from the command /object.dump and we will have: . . Ptr 14196288: top level object: kvirc_frame, class KviFrame, visible, rect = -4, -4, 1024, 712 . Ptr 17197360: object: unnamed, class KviStatusBar . . in this way we can follow the order, father->child from the top-level widget(KviFrame::kvirc_frame) to reach the child that interests us (KviStatusBar::unnamed) Then, following the syntax we will have: %A=$new(wrapper,0,test,KviFrame::kvirc_frame,KviStatusBar::unnamed) Now %A. will be point to the wrapped object, therefore we could modify its property or to consider it as if it were an object created by us in scripting. Obviously, deleting the created object (for example %A) you don't will delete the object of Kvirc (in this case the statusbar). Another example could be this: %A=$new(wrapper,0,test,KviFrame::kvirc_frame,QToolButton::kvirc.identityoptions) %A->$setProperty(usesBigPixmap,0) In this fool example with the function $setProperty, we has setted the property usesBigPixmap to False, making to become the small icons of the ToolBar. The wrapping object search can optionally start with a window identifier with the following syntax: WinId::<window_id>.

Index, Object Classes

KVIrc 3.4.0 Documentation
Generated by loris at Mon Mar 17 20:35:38 2008