kexi
KFormDesigner::PasteWidgetCommand Class Reference
#include <commands.h>
Inheritance diagram for KFormDesigner::PasteWidgetCommand:

Detailed Description
This command is used when pasting widgets. You need to give the QDomDocument containing the widget(s) to paste, and optionnally the point where to paste widgets.
Definition at line 243 of file commands.h.
Public Member Functions | |
PasteWidgetCommand (QDomDocument &domDoc, Container *container, const QPoint &p=QPoint()) | |
virtual void | execute () |
virtual void | unexecute () |
virtual QString | name () const |
virtual void | debug () |
Protected Member Functions | |
void | changePos (QDomElement &widg, const QPoint &newpos) |
void | fixPos (QDomElement &el, Container *container) |
void | moveWidgetBy (QDomElement &el, Container *container, const QPoint &p) |
void | fixNames (QDomElement &el) |
Protected Attributes | |
Form * | m_form |
QCString | m_data |
QString | m_containername |
QPoint | m_point |
QStringList | m_names |
Member Function Documentation
void PasteWidgetCommand::changePos | ( | QDomElement & | widg, | |
const QPoint & | newpos | |||
) | [protected] |
Internal function used to change the coordinates of a widget to newpos before pasting it (to paste it at the position of the contextual menu). It modifies the "geometry" property of the QDomElement representing the widget.
Definition at line 1207 of file commands.cpp.
void PasteWidgetCommand::fixPos | ( | QDomElement & | el, | |
Container * | container | |||
) | [protected] |
Internal function used to fix the coordinates of a widget before pasting it (to avoid having two widgets at the same position). It moves the widget by (10, 10) increment (several times if there are already pasted widgets at this position).
Definition at line 1232 of file commands.cpp.
void PasteWidgetCommand::fixNames | ( | QDomElement & | el | ) | [protected] |
Internal function used to fix the names of the widgets before pasting them. It prevents from pasting a widget with the same name as an actual widget. The child widgets are also fixed recursively.
If the name of the widget ends with a number (eg "QLineEdit1"), the new name is just incremented by one (eg becomes "QLineEdit2"). Otherwise, a "2" is just appended at the end of the name (eg "myWidget" becomes "myWidget2").
Definition at line 1329 of file commands.cpp.
The documentation for this class was generated from the following files: