umbrello: Dialog_Utils Namespace Reference

umbrello 2.38.5 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

- Main Page
- Related Pages
- Topics
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

Functions
Dialog_Utils Namespace Reference

## Functions
QLineEdit * | makeLabeledEditField (QGridLayout *layout, int row, QLabel *&label, const QString &labelText, QLineEdit *&editField, const QString &editFieldText, int columnOffset)
void | makeTagEditFields (UMLObject *o, QGridLayout *genLayout, QLabel *pTagLabel[N_STEREOATTRS], QLineEdit *pTagLineEdit[N_STEREOATTRS], int row)
void | remakeTagEditFields (const QString &stereoText, UMLObject *, QGridLayout *genLayout, QLabel *pTagLabel[N_STEREOATTRS], QLineEdit *pTagLineEdit[N_STEREOATTRS], int row)
void | updateTagsFromEditFields (UMLObject *o, QLineEdit *pTagLineEdit[N_STEREOATTRS])
void | askNameForWidget (UMLWidget *&targetWidget, const QString &dialogTitle, const QString &dialogPrompt, const QString &defaultName)
bool | askName (const QString &title, const QString &prompt, QString &name)
bool | askDeleteAssociation ()
bool | askDeleteDiagram (const QString &name)
bool | askNewName (WidgetBase::WidgetType type, QString &name)
bool | askRenameName (WidgetBase::WidgetType type, QString &name)
bool | askDefaultNewName (WidgetBase::WidgetType type, QString &name)
bool | askNewName (UMLObject::ObjectType type, QString &name)
bool | askRenameName (UMLObject::ObjectType type, QString &name)
bool | askDefaultNewName (UMLObject::ObjectType type, QString &name)
void | insertStereotypesSorted (KComboBox *kcb, const QString &type)
int | spacingHint ()

## Detailed Description

Dialog utilities.

Author
  Oliver Kellogg Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org

## Function Documentation

## ◆ askDefaultNewName() [1/2]

bool Dialog_Utils::askDefaultNewName | ( | UMLObject::ObjectType | type,
|  | QString & | name )

Ask the user for a default new widget name

The name is predefined by the widgets type default name

Returns
  true on user pressed okay
  false on user pressed cancel

## ◆ askDefaultNewName() [2/2]

bool Dialog_Utils::askDefaultNewName | ( | WidgetBase::WidgetType | type,
|  | QString & | name )

Ask the user for a default new widget name

The name is predefined by the widgets type default name

Returns
  true on user pressed okay
  false on user pressed cancel

## ◆ askDeleteAssociation()

bool Dialog_Utils::askDeleteAssociation | ( |  | ) |

Ask the user for permission to delete an association.

Returns
  true - user want to continue
  false - user want to cancel

## ◆ askDeleteDiagram()

bool Dialog_Utils::askDeleteDiagram | ( | const QString & | name | ) |

Ask the user for permission to delete a diagram.

Returns
  true - user want to continue
  false - user want to cancel

## ◆ askName()

bool Dialog_Utils::askName | ( | const QString & | title,
|  | const QString & | prompt,
|  | QString & | name )

Helper function for requesting a name using a dialog.

Parameters

  title | Title of the dialog.
  prompt | Prompt of the dialog.
  name | Default value of the name field.

Returns
  true on user pressed okay
  false on user pressed cancel

## ◆ askNameForWidget()

void Dialog_Utils::askNameForWidget | ( | UMLWidget *& | targetWidget,
|  | const QString & | dialogTitle,
|  | const QString & | dialogPrompt,
|  | const QString & | defaultName )

Helper function for requesting a name for a UMLWidget using a dialog.

Parameters

  targetWidget | By-reference pointer to the widget to request the name for. The widget may be deallocated, and the pointer returned set to 0, if the user presses Cancel in the dialog.
  dialogTitle | Title of the dialog.
  dialogPrompt | Prompt of the dialog.
  defaultName | Default value of the name field.

## ◆ askNewName() [1/2]

bool Dialog_Utils::askNewName | ( | UMLObject::ObjectType | type,
|  | QString & | name )

Ask the user for a new object name

Returns
  true on user pressed okay
  false on user pressed cancel

## ◆ askNewName() [2/2]

bool Dialog_Utils::askNewName | ( | WidgetBase::WidgetType | type,
|  | QString & | name )

Ask the user for a new widget name

Returns
  true on user pressed okay
  false on user pressed cancel

## ◆ askRenameName() [1/2]

bool Dialog_Utils::askRenameName | ( | UMLObject::ObjectType | type,
|  | QString & | name )

Ask the user for renaming a widget name

Returns
  true on user pressed okay
  false on user pressed cancel

## ◆ askRenameName() [2/2]

bool Dialog_Utils::askRenameName | ( | WidgetBase::WidgetType | type,
|  | QString & | name )

Ask the user for renaming a widget name

Returns
  true on user pressed okay
  false on user pressed cancel

## ◆ insertStereotypesSorted()

void Dialog_Utils::insertStereotypesSorted | ( | KComboBox * | kcb,
|  | const QString & | type )

Helper function for inserting available stereotypes into a KComboBox

Parameters

  kcb | The KComboBox into which to insert the stereotypes
  type | The stereotype to activate

## ◆ makeLabeledEditField()

QLineEdit * Dialog_Utils::makeLabeledEditField | ( | QGridLayout * | layout,
|  | int | row,
|  | QLabel *& | label,
|  | const QString & | labelText,
|  | QLineEdit *& | editField,
|  | const QString & | editFieldText,
|  | int | columnOffset )

Create a labeled text lineedit widget.

Parameters

  layout | The QGridLayout to use.
  row | The row number within the QGridLayout.
  label | The QLabel object allocated (return value)
  labelText | The label text.
  editField | The QLineEdit object allocated (return value)
  editFieldText | Initialization text in the editField (optional.)
  columnOffset | Optional column number within the QGridLayout (default: 0)

Returns
  a pointer to the QLineEdit so you can setFocus() if necessary

## ◆ makeTagEditFields()

void Dialog_Utils::makeTagEditFields | ( | UMLObject * | o,
|  | QGridLayout * | genLayout,
|  | QLabel * | pTagLabel[N_STEREOATTRS],
|  | QLineEdit * | pTagLineEdit[N_STEREOATTRS],
|  | int | row )

Make labeled edit fields for stereotype tags. The label/line-edit pairs are arranged horizontally on the same row. The label texts are taken from the AttributeDefs of the object's UMLStereotype.

## ◆ remakeTagEditFields()

void Dialog_Utils::remakeTagEditFields | ( | const QString & | stereoText,
|  | UMLObject * | ,
|  | QGridLayout * | genLayout,
|  | QLabel * | pTagLabel[N_STEREOATTRS],
|  | QLineEdit * | pTagLineEdit[N_STEREOATTRS],
|  | int | row )

Remake labeled edit fields for stereotype tags. "Remake" means that the existing label/line-edit pairs are deleted and new ones are created afresh. This is useful when the object's stereotype has changed. The label/line-edit pairs are arranged horizontally on the same row. The label texts are taken from the AttributeDefs of the object's UMLStereotype.

## ◆ spacingHint()

int Dialog_Utils::spacingHint | ( |  | ) |

Returns the number of pixels that should be used between widgets inside a dialog according to the KDE standard. Source: kdelibs4support/src/kdeui/kdialog.cpp

## ◆ updateTagsFromEditFields()

void Dialog_Utils::updateTagsFromEditFields | ( | UMLObject * | o,
|  | QLineEdit * | pTagLineEdit[N_STEREOATTRS] )

Update the stereotype tag values of the given UMLObject from the corresponding values in the given array of QLineEdit widgets. This is useful as the action in the slot method when the Apply or OK button is pressed.