umbrello 25.04.1
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
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
titleTitle of the dialog.
promptPrompt of the dialog.
nameDefault 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
targetWidgetBy-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.
dialogTitleTitle of the dialog.
dialogPromptPrompt of the dialog.
defaultNameDefault 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
kcbThe KComboBox into which to insert the stereotypes
typeThe 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
layoutThe QGridLayout to use.
rowThe row number within the QGridLayout.
labelThe QLabel object allocated (return value)
labelTextThe label text.
editFieldThe QLineEdit object allocated (return value)
editFieldTextInitialization text in the editField (optional.)
columnOffsetOptional 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.