kexi
KFormDesigner::Form Class Reference#include <form.h>
List of all members.
Detailed Description
A simple class representing a form.
This class represents one form and holds the corresponding ObjectTree and Containers. It takes care of widget selection and pasting widgets.
Definition at line 135 of file form.h.
|
Public Slots |
void | changeName (const QCString &oldname, const QCString &newname) |
void | setSelectedWidget (QWidget *selected, bool add=false, bool dontRaise=false) |
void | unSelectWidget (QWidget *w) |
void | selectFormWidget () |
void | clearSelection () |
Signals |
void | selectionChanged (QWidget *w, bool add) |
void | childAdded (ObjectTreeItem *it) |
void | childRemoved (ObjectTreeItem *it) |
void | destroying () |
Public Member Functions |
| Form (WidgetLibrary *library, const char *name=0, bool designMode=true) |
| ~Form () |
WidgetLibrary * | library () const |
void | createToplevel (QWidget *container, FormWidget *formWidget=0, const QCString &classname="QWidget") |
Container * | toplevelContainer () const |
FormWidget * | formWidget () const |
ObjectTree * | objectTree () const |
QWidget * | widget () const |
Container * | activeContainer () |
Container * | parentContainer (QWidget *w=0) |
ObjectTreeItem * | commonParentContainer (WidgetList *wlist) |
WidgetList * | selectedWidgets () const |
QWidget * | selectedWidget () const |
void | emitActionSignals (bool withUndoAction=true) |
void | emitSelectionSignals () |
void | setInteractiveMode (bool interactive) |
bool | interactiveMode () const |
void | setDesignMode (bool design) |
bool | designMode () const |
bool | isModified () |
int | gridSize () |
int | defaultMargin () |
int | defaultSpacing () |
void | emitChildAdded (ObjectTreeItem *item) |
void | emitChildRemoved (ObjectTreeItem *item) |
QString | filename () const |
void | setFilename (const QString &file) |
KCommandHistory * | commandHistory () const |
ConnectionBuffer * | connectionBuffer () const |
PixmapCollection * | pixmapCollection () const |
void | addCommand (KCommand *command, bool execute) |
void | clearCommandHistory () |
ObjectTreeList * | tabStops () const |
ObjectTreeListIterator | tabStopsIterator () const |
void | updateTabStopsOrder () |
void | addWidgetToTabStops (ObjectTreeItem *c) |
bool | autoTabStops () const |
void | setAutoTabStops (bool autoTab) |
void | autoAssignTabStops () |
ResizeHandleSet * | resizeHandlesForWidget (QWidget *w) |
QMap< QCString, QString > * | headerProperties () const |
uint | formatVersion () const |
void | setFormatVersion (uint ver) |
uint | originalFormatVersion () const |
void | setOriginalFormatVersion (uint ver) |
Protected Slots |
void | formDeleted () |
void | emitUndoEnabled () |
void | emitRedoEnabled () |
void | slotCommandExecuted () |
void | slotFormRestored () |
Protected Member Functions |
void | setConnectionBuffer (ConnectionBuffer *b) |
void | setFormWidget (FormWidget *w) |
Friends |
class | FormManager |
class | FormWidget |
class | ConnectionDialog |
Constructor & Destructor Documentation
Form::Form |
( |
WidgetLibrary * |
library, |
|
|
const char * |
name = 0 , |
|
|
bool |
designMode = true |
|
) |
|
|
Member Function Documentation
|
- Returns:
- A pointer to the currently active Container, ie the parent Container for a simple widget, and the widget's Container if it is itself a container.
Definition at line 150 of file form.cpp. |
void Form::addCommand |
( |
KCommand * |
command, |
|
|
bool |
execute |
|
) |
|
|
|
Adds a widget in the form's command history. Please use it instead of calling directly actionCollection()->addCommand().
Definition at line 400 of file form.cpp. |
|
Adds the widget at the end of tabstops list. Called on widget creation.
Definition at line 454 of file form.cpp. |
void Form::autoAssignTabStops |
( |
|
) |
|
|
|
Tells the Form to reassign the tab stops because the widget layout has changed (called for example before saving or displaying the tab order dialog)
Definition at line 496 of file form.cpp. |
bool KFormDesigner::Form::autoTabStops |
( |
|
) |
const [inline] |
|
|
- Returns:
- True if the Form automatically handles tab stops.
Definition at line 278 of file form.h. |
void Form::changeName |
( |
const QCString & |
oldname, |
|
|
const QCString & |
newname |
|
) |
[slot] |
|
|
This slot is called when the name of a widget was changed in Property Editor. It renames the ObjectTreeItem associated to this widget.
Definition at line 360 of file form.cpp. |
void KFormDesigner::Form::childRemoved |
( |
ObjectTreeItem * |
it |
) |
[signal] |
|
void Form::clearCommandHistory |
( |
|
) |
|
|
|
Clears form's command history.
Definition at line 410 of file form.cpp. |
|
- Returns:
- The Container which is a parent of all widgets in wlist. Used by activeContainer(), and to find where to paste widgets when multiple widgets are selected.
Definition at line 170 of file form.cpp. |
void Form::createToplevel |
( |
QWidget * |
container, |
|
|
FormWidget * |
formWidget = 0 , |
|
|
const QCString & |
classname = "QWidget" |
|
) |
|
|
|
Creates a toplevel widget out of another widget. container will become the Form toplevel widget, will be associated to an ObjectTree and so on. QWidget *toplevel = new QWidget(this);
form->createToplevel(toplevel);
Definition at line 126 of file form.cpp. |
int KFormDesigner::Form::defaultMargin |
( |
|
) |
[inline] |
|
|
- Returns:
- the default margin for all the layout inside this Form.
Definition at line 234 of file form.h. |
int KFormDesigner::Form::defaultSpacing |
( |
|
) |
[inline] |
|
|
- Returns:
- the default spacing for all the layout inside this Form.
Definition at line 237 of file form.h. |
bool KFormDesigner::Form::designMode |
( |
|
) |
const [inline] |
|
|
- Returns:
- The actual mode of the Form.
Definition at line 225 of file form.h. |
void KFormDesigner::Form::destroying |
( |
|
) |
[signal] |
|
|
This signal emitted when Form is about to be destroyed.
|
void Form::emitActionSignals |
( |
bool |
withUndoAction = true |
) |
|
|
|
Emits the action signals, and optionaly the undo/redo related signals if withUndoAction == true. See FormManager for signals description.
Definition at line 310 of file form.cpp. |
void Form::emitSelectionSignals |
( |
|
) |
|
|
QString KFormDesigner::Form::filename |
( |
|
) |
const [inline] |
|
|
- Returns:
- The filename of the UI file this Form was saved to, or QString::null if the Form hasn't be saved yet.
Definition at line 247 of file form.h. |
uint Form::formatVersion |
( |
|
) |
const |
|
void Form::formDeleted |
( |
|
) |
[protected, slot] |
|
|
This slot is called when the toplevel widget of this Form is deleted (ie the window closed) so that the Form gets deleted at the same time.
Definition at line 344 of file form.cpp. |
FormWidget* KFormDesigner::Form::formWidget |
( |
|
) |
const [inline] |
|
int KFormDesigner::Form::gridSize |
( |
|
) |
[inline] |
|
|
- Returns:
- the distance between two dots in the form background.
- Todo:
- make gridSize configurable at global level
Definition at line 231 of file form.h. |
QMap<QCString,QString>* KFormDesigner::Form::headerProperties |
( |
|
) |
const [inline] |
|
|
A set of value/key pairs provided to be stored as attributes in <kfd:customHeader/> XML element (saved as a first child of <UI> element).
Definition at line 305 of file form.h. |
bool KFormDesigner::Form::interactiveMode |
( |
|
) |
const [inline] |
|
|
- Returns:
- true if the Form is being updated by the user, ie the created widget were drawn on the Form.
false if the Form is being updated by the program, ie the widget are created by FormIO, and so composed widgets should not be populated automatically (such as QTabWidget).
Definition at line 217 of file form.h. |
ObjectTree* KFormDesigner::Form::objectTree |
( |
|
) |
const [inline] |
|
uint Form::originalFormatVersion |
( |
|
) |
const |
|
|
- Returns:
- original format version number for this form (as loaded from .ui XML string) For new forms it is equal to KFormDesigner::version().
Definition at line 546 of file form.cpp. |
Container * Form::parentContainer |
( |
QWidget * |
w = 0 |
) |
|
|
|
- Returns:
- A pointer to the parent Container of the currently selected widget. It is the same as activeContainer() for a simple widget, but unlike this function it will also return the parent Container if the widget itself is a Container.
Definition at line 195 of file form.cpp. |
QWidget* KFormDesigner::Form::selectedWidget |
( |
|
) |
const [inline] |
|
|
- Returns:
- currently selected widget in this form, or 0 if there is no widget selected or more than one widget selected.
- See also:
- selectedWidgets()
Definition at line 196 of file form.h. |
WidgetList* KFormDesigner::Form::selectedWidgets |
( |
|
) |
const [inline] |
|
|
- Returns:
- the list of currently selected widgets in this form
Definition at line 191 of file form.h. |
void Form::selectFormWidget |
( |
|
) |
[slot] |
|
|
Sets the form widget (it will be uniquely selected widget).
Definition at line 295 of file form.cpp. |
void KFormDesigner::Form::selectionChanged |
( |
QWidget * |
w, |
|
|
bool |
add |
|
) |
[signal] |
|
|
This signal is emitted when user selects a new widget, to update both Property Editor and ObjectTreeView. w is the newly selected widget. |
void KFormDesigner::Form::setAutoTabStops |
( |
bool |
autoTab |
) |
[inline] |
|
|
If autoTab is true, then the Form will automatically handle tab stops, and the "Edit Tab Order" dialog will be disabled. The tab widget will be set from the top-left to the bottom-right corner.
If \ autoTab is false, then it's up to the user to change tab stops (which are by default in order of creation).
Definition at line 285 of file form.h. |
void Form::setDesignMode |
( |
bool |
design |
) |
|
|
|
If design is true, the Form is in Design Mode (by default). If design is false, then the Form is in Preview Mode, so the ObjectTree and the Containers are removed.
Definition at line 213 of file form.cpp. |
void KFormDesigner::Form::setFilename |
( |
const QString & |
file |
) |
[inline] |
|
|
Sets the filename of this Form to filename.
Definition at line 250 of file form.h. |
void KFormDesigner::Form::setInteractiveMode |
( |
bool |
interactive |
) |
[inline] |
|
|
Sets the Form interactivity mode. Form is not interactive when pasting widgets, or loading a Form.
Definition at line 209 of file form.h. |
void Form::setSelectedWidget |
( |
QWidget * |
selected, |
|
|
bool |
add = false , |
|
|
bool |
dontRaise = false |
|
) |
[slot] |
|
|
Sets selected to be the selected widget of this Form. If add is true, the formerly selected widget is still selected, and the new one is just added. If false, selected replace the actually selected widget. The form widget is always selected alone.
Definition at line 236 of file form.cpp. |
void Form::slotCommandExecuted |
( |
|
) |
[protected, slot] |
|
|
This slot is called when a command is executed. The undo/redo signals are emitted to update actions.
Definition at line 418 of file form.cpp. |
void Form::slotFormRestored |
( |
|
) |
[protected, slot] |
|
|
This slot is called when form is restored, ie when the user has undone all actions. The form modified flag is updated, and FormManager::dirty() is called.
Definition at line 444 of file form.cpp. |
|
- Returns:
- A pointer to this Form tabstops list : it contains all the widget that can have focus ( ie no labels, etc) in the order of the tabs.
Definition at line 266 of file form.h. |
Container* KFormDesigner::Form::toplevelContainer |
( |
|
) |
const [inline] |
|
void Form::unSelectWidget |
( |
QWidget * |
w |
) |
[slot] |
|
|
Unselects the widget w. Te widget is removed from the Cntainer 's list and its resizeHandle is removed.
Definition at line 288 of file form.cpp. |
void Form::updateTabStopsOrder |
( |
|
) |
|
|
|
Called (e.g. by KexiDBForm) when certain widgets can have updated focusPolicy properties these having no TabFocus flags set are removed from tabStops() list.
Definition at line 483 of file form.cpp. |
QWidget * Form::widget |
( |
|
) |
const |
|
The documentation for this class was generated from the following files:
|