libplasma
Plasma::NodeLayout Class Reference
#include <nodelayout.h>

Detailed Description
Node layout has an advanced layouting mechanism.Every item's position is defined by two nodes - one for top-left corner, and the other one for bottom-right corner.
Each node is defined by a pair of relative (xr, yr) and a pair of absolute (xa, ya) coordinates. The calculated node coordinates depend on the size and position of the NodeLayout object in the following manner: x = layoutLeft + (xr * layoutWidth) + xa y = layoutTop + (yr * layoutHeight) + ya
Alternatively, the item's position can be defined by using one node and one pair of relative coordinates (xr, yr). In that case, the item is sized following the sizeHint(). The relative coordinates (this time they are relative to the item's geometry, not the layout's) specify what point of the item will be bound to the defined node.
Definition at line 51 of file nodelayout.h.
Public Member Functions | |
| virtual Qt::Orientations | expandingDirections () const |
| NodeLayout (LayoutItem *parent=0) | |
| virtual | ~NodeLayout () |
| QSizeF | sizeHint () const |
| void | addItem (LayoutItem *item) |
| void | addItem (LayoutItem *item, NodeCoordinate topLeft, NodeCoordinate bottomRight) |
| void | addItem (LayoutItem *item, NodeCoordinate node, qreal xr=0, qreal yr=0) |
| void | removeItem (LayoutItem *item) |
| virtual int | count () const |
| virtual int | indexOf (LayoutItem *item) const |
| virtual LayoutItem * | itemAt (int i) const |
| virtual LayoutItem * | takeAt (int i) |
Protected Member Functions | |
| void | relayout () |
Classes | |
| class | NodeCoordinate |
Constructor & Destructor Documentation
| Plasma::NodeLayout::NodeLayout | ( | LayoutItem * | parent = 0 |
) | [explicit] |
Definition at line 155 of file nodelayout.cpp.
| Plasma::NodeLayout::~NodeLayout | ( | ) | [virtual] |
Definition at line 160 of file nodelayout.cpp.
Member Function Documentation
| Qt::Orientations Plasma::NodeLayout::expandingDirections | ( | ) | const [virtual] |
Returns a bitmask with the directions that this Item can be expanded.
Implements Plasma::LayoutItem.
Definition at line 165 of file nodelayout.cpp.
| QSizeF Plasma::NodeLayout::sizeHint | ( | ) | const [virtual] |
Returns the most appropriate size of this Item to hold whatever contents it has.
Implements Plasma::LayoutItem.
Definition at line 179 of file nodelayout.cpp.
| void Plasma::NodeLayout::addItem | ( | LayoutItem * | item | ) | [virtual] |
Adds item at top-left corner, with automatic sizing (using sizeHint of the item).
Implements Plasma::Layout.
Definition at line 184 of file nodelayout.cpp.
| void Plasma::NodeLayout::addItem | ( | LayoutItem * | item, | |
| NodeCoordinate | topLeft, | |||
| NodeCoordinate | bottomRight | |||
| ) |
Adds item with specified top-left and bottom right corners.
Definition at line 189 of file nodelayout.cpp.
| void Plasma::NodeLayout::addItem | ( | LayoutItem * | item, | |
| NodeCoordinate | node, | |||
| qreal | xr = 0, |
|||
| qreal | yr = 0 | |||
| ) |
Adds item with automatic sizing turned on.
xr and yr specify which point of the item is bound to node coordinate. Those are relative coordinates so (0, 0) represent top left corner, (0.5, 0.5) represent the center of the item etc.
Definition at line 200 of file nodelayout.cpp.
| void Plasma::NodeLayout::removeItem | ( | LayoutItem * | l | ) | [virtual] |
Removes a Item from this Layout.
- Parameters:
-
l Pointer to the Item to be removed.
Implements Plasma::Layout.
Definition at line 212 of file nodelayout.cpp.
| int Plasma::NodeLayout::count | ( | ) | const [virtual] |
Returns the number of elements of this Layout.
Implements Plasma::Layout.
Definition at line 223 of file nodelayout.cpp.
| int Plasma::NodeLayout::indexOf | ( | LayoutItem * | l | ) | const [virtual] |
Returns the index of a Item in this Layout.
- Parameters:
-
l Pointer to an Item to be queryed.
Implements Plasma::Layout.
Definition at line 228 of file nodelayout.cpp.
| LayoutItem * Plasma::NodeLayout::itemAt | ( | int | i | ) | const [virtual] |
Returns a Pointer to an Item in this Layout.
- Parameters:
-
i Index of the desired Item.
Implements Plasma::Layout.
Definition at line 237 of file nodelayout.cpp.
| LayoutItem * Plasma::NodeLayout::takeAt | ( | int | i | ) | [virtual] |
Takes the Pointer of an Item in this Layout.
- Parameters:
-
i Index of the desired Item.
Implements Plasma::Layout.
Definition at line 246 of file nodelayout.cpp.
| void Plasma::NodeLayout::relayout | ( | ) | [protected, virtual] |
Triggers a layout, usually after a change in geometry.
Implements Plasma::Layout.
Definition at line 170 of file nodelayout.cpp.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference