|
|
KDE Panel Applet class
This class implements panel applets.
enum Stretch {Fixed=0, Small, Medium, Large, Huge} |
Sizes to which your applet may be streched when laying out the toolbar.
KApplet ( QWidget* parent = 0, const char* name = 0 ) |
Construct a KApplet widget just like any other widget.
~KApplet () |
Destructor
void init ( int& argc, char ** argv ) |
Initialize the applet according to the passed command line parameters
Evalutate some command line arguments, dock into the respective applet container and eventually call setupGeometry().
void setupGeometry ( Orientation orientation, int width, int height ) |
Set up the applet's geometry. This function needs to be reimplemented by subclasses.
The size parameter is meant as a hint in case an applet supports different look&feels depending on the target size. Of course, an applet could do these things in resizeEvent(), but this way it's more convenient.
The applet container that will embed this applet will resize itself to the standard size of its applets. If your applet needs more space, ensure to set a proper minimum size with QWidget::setMinimumWidth() or QWidget::setMinimumHeight() depending on the applets orientation.
Keep in mind that setupGeometry() may be called several times during a life-cycle of your applet, for example when the applet container is resized, moved or changes orientation.
Parameters:
orientation | The applet's orientation, either Qt::Horizontal
or Qt::Vertical .
|
width | Width of the applet. |
height | Height of the applet. |
void setStretch (Stretch size) |
Set the applet to be fixed size or stretchable (and to what size).
Stretch stretch () |
Returns: Integer of type Stretch
indicating whether the applet is fixed size or stretchable (and to what size).
QSize sizeHint () |
Returns: A suggested size for the applet.
Orientation orientation () |
Returns the current orientation set by the last KApplet::init() call.