Places itself on top of any target Widget and provides five handles to move and resize the target. More...
#include <placehld.h>
The PlaceHolder class provides you with a means to resize or move any widget. By using the setTarget() member, you can specify the widget it should attach to. Typically you should create the PlaceHolder with the same parent as the target widget. The PlaceHolder will automatically place itself at the top of the child list of the mutual parent by calling raise()to make sure that no other widgets with the same parent obstruct it. As soon as you set the target to a valid widget, the PlaceHolder will make itself visible. It will place four SizeSlab widgets at the corners of the target widget and one at the center of the target.
The PlaceHolder has a grid setting. This grid setting is used to round the size and position of the target widget to the nearest gridpoints. The default value for the grid is 10x10 pixels. It can be changed with the setGrid() member function. The grid is not used during drag operations. As soon as the mouse button is released after dragging, the target widget is snapped to the grid.
Note: The sizeslabs are created by the PlaceHolder, but they are created as children of the target widget. Therefore, they are not deleted in the destructor of the PlaceHolder. This is not a memory leak!
Warning: Make sure the target set for the PlaceHolder is visible before you attach it. Otherwise it is undefined what will happen! Also, make sure you hide() the PlaceHolder before you delete its target widget!
Creates a new PlaceHolder. You should not supply 0 as the parent. This would make the SizeSlabs used by the PlaceHolder windows of their own, resulting in decorations being added by the window manager. The PlaceHolder is hidden by default until its target is set.
Deletes the PlaceHolder.
Hides the five SizeSlab widgets, making the PlaceHolder invisible.
Shows all five SizeSlab widgets if a valid target is set. Before they are shown, all five SizeSlabs are raised to make sure they are the topmost widgets on the list of children of the target.
Returns whether the PlaceHolder is visible.
Sets the target of the PlaceHolder. The SizeSlab widgets are placed in the correct position and the PlaceHolder is made visible.
Returns the target widget of the PlaceHolder.
Set the grid to x times \y pixels. The grid is used to snap the target widget to a grid on the mutual parent widget.
[slot]
The top left SizeSlab was moved, resize/move the whole widget to match the displacement.
[slot]
The top right SizeSlab was moved, resize/move the whole widget to match the displacement.
[slot]
The bottom left SizeSlab was moved, resize/move the whole widget to match the displacement.
[slot]
The bottom right SizeSlab was moved, resize/move the whole widget to match the displacement.
[slot]
The center SizeSlab was moved, move the whole widget to match the displacement.
[slot]
Snap the resized/moved widget back to the nearest grid points defined by the _gridx and _gridy members.
[protected]
Place the SizeSlab widgets on the correct position on the target widget. This is a bit complicated, as our parent may not be the same as the parent of the target widget.
[private]
The top left SizeSlab
[private]
The top right SizeSlab
[private]
The bottom left SizeSlab
[private]
The bottom right SizeSlab
[private]
The center SizeSlab
[private]
The target of the PlaceHolder
[private]
The grid value for the x-direction
[private]
The grid value for the y-direction