kexi
KFormDesigner::Form Class Reference#include <form.h>
Inherits QObject.
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, bool moreWillBeSelected=false) |
void | unSelectWidget (QWidget *w) |
void | selectFormWidget () |
void | clearSelection () |
Signals |
void | selectionChanged (QWidget *w, bool add, bool moreWillBeSelected=false) |
void | childAdded (ObjectTreeItem *it) |
void | childRemoved (ObjectTreeItem *it) |
void | destroying () |
Public Member Functions |
| Form (WidgetLibrary *library, const char *name=0, bool designMode=true) |
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 *it) |
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
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);
todo: copy caption in Kexi from object's caption
Definition at line 127 of file form.cpp.
Container* KFormDesigner::Form::toplevelContainer |
( |
|
) |
const [inline] |
FormWidget* KFormDesigner::Form::formWidget |
( |
|
) |
const [inline] |
ObjectTree* KFormDesigner::Form::objectTree |
( |
|
) |
const [inline] |
QWidget * Form::widget |
( |
|
) |
const |
- 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 151 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 196 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 171 of file form.cpp.
WidgetList* KFormDesigner::Form::selectedWidgets |
( |
|
) |
const [inline] |
- Returns:
- the list of currently selected widgets in this form
Definition at line 191 of file form.h.
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.
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 311 of file form.cpp.
void Form::emitSelectionSignals |
( |
|
) |
|
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.
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.
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 214 of file form.cpp.
bool KFormDesigner::Form::designMode |
( |
|
) |
const [inline] |
- Returns:
- The actual mode of the Form.
Definition at line 225 of file form.h.
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.
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.
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.
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 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 401 of file form.cpp.
void Form::clearCommandHistory |
( |
|
) |
|
Clears form's command history.
Definition at line 411 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.
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 479 of file form.cpp.
Adds the widget at the end of tabstops list. Called on widget creation.
Definition at line 455 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 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::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). Automatically sorts widget from the top-left to bottom-right corner. Widget can be grouped with containers. In paticular, for tab widgets, child widgets should ordered by parent tab's order.
We automatically sort widget from the top-left to bottom-right corner - Todo:
- Handle RTL layout (ie from top-right to bottom-left)
Definition at line 506 of file form.cpp.
Internal: called by ResizeHandle when mouse move event causes first resize handle's dragging. As a result, current widget's editing (if any) is finished - see WidgetFactory::resetEditor().
Definition at line 283 of file form.cpp.
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 308 of file form.h.
uint Form::formatVersion |
( |
|
) |
const |
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 580 of file form.cpp.
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 361 of file form.cpp.
void Form::setSelectedWidget |
( |
QWidget * |
selected, |
|
|
bool |
add = false , |
|
|
bool |
dontRaise = false , |
|
|
bool |
moreWillBeSelected = 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. moreWillBeSelected indicates whether more widgets will be selected soon (so for multiselection we should not update the property pane before the last widget is selected)
Definition at line 237 of file form.cpp.
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 289 of file form.cpp.
void Form::selectFormWidget |
( |
|
) |
[slot] |
Sets the form widget (it will be uniquely selected widget).
Definition at line 296 of file form.cpp.
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 345 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 419 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 445 of file form.cpp.
void KFormDesigner::Form::selectionChanged |
( |
QWidget * |
w, |
|
|
bool |
add, |
|
|
bool |
moreWillBeSelected = false | |
|
) |
| | [signal] |
void KFormDesigner::Form::childRemoved |
( |
ObjectTreeItem * |
it |
) |
[signal] |
void KFormDesigner::Form::destroying |
( |
|
) |
[signal] |
This signal emitted when Form is about to be destroyed.
The documentation for this class was generated from the following files:
|