(→Services) |
|||
| Line 4: | Line 4: | ||
* <tt>X-Plasma-MainScript</tt> in the metadata.desktop file should point to the main script, relative to the contents directory | * <tt>X-Plasma-MainScript</tt> in the metadata.desktop file should point to the main script, relative to the contents directory | ||
* <tt>X-Plasma-DefaultSize</tt> in the metadata.desktop file specifies the default widget size in width,height format (eg: 200,100) | * <tt>X-Plasma-DefaultSize</tt> in the metadata.desktop file specifies the default widget size in width,height format (eg: 200,100) | ||
| − | |||
* <tt>plasmoidviewer</tt> is an immensely useful tool | * <tt>plasmoidviewer</tt> is an immensely useful tool | ||
* To connect to a signal use <tt>object.signalName.connect(function() {});</tt> | * To connect to a signal use <tt>object.signalName.connect(function() {});</tt> | ||
| Line 15: | Line 14: | ||
} | } | ||
</code> | </code> | ||
| + | |||
| + | == Global variables and functions == | ||
| + | |||
| + | * The <tt>plasmoid</tt> variable contains all the main plasmoid functionality and represents the main plasmoid widget, and corresponds to the <tt>Applet</tt> class in C++ | ||
| + | * The <tt>startupArguments</tt> variable contains any arguments that were passed to the plasmoid when it was started (such as when the plasmoid is registered as a handler for a mimetype) | ||
| + | * The <tt>loadui</tt> function can be used to load a Qt UI file. Beware that a relative path is relative to plasma's working directory (in 4.2 at least), and so may not do what you want. | ||
| + | * The <tt>print</tt> function prints debug output | ||
| + | * There are several ccontructor methods: | ||
| + | ** <tt>PlasmaSvg(file, parent)</tt> constructs a <tt>Plasma::Svg</tt>. The second argument is optional. | ||
| + | ** <tt>PlasmaFrameSvg(file, parent)</tt> constructs a <tt>Plasma:FrameSvg</tt>. The second argument is optional. | ||
| + | ** <tt>QPainter()</tt> | ||
| + | ** <tt>QGraphicsItem()</tt> | ||
| + | ** <tt>QTimer()</tt> | ||
| + | ** <tt>QFont()</tt> | ||
| + | ** <tt>QRectF()</tt> | ||
| + | ** <tt>QSizeF()</tt> | ||
| + | ** <tt>QPoint()</tt> | ||
| + | ** <tt>LinearLayout()</tt> constructs a <tt>QGraphicsLinearLayout</tt> | ||
| + | ** <tt>Url()</tt> constructs a <tt>KUrl</tt> | ||
| + | * Plus constructors for all the Plasma widgets (eg: <tt>IconWidget()</tt>). | ||
== Languages == | == Languages == | ||
Contents |
if (plasmoid.formFactor() == Vertical) {
layout.setOrientation(QtVertical);
} else {
layout.setOrientation(QtHorizontal);
}