Extending Qt Creator Manual | SubmitEditorWidget

Extending Qt Creator Manual 4.4.0

# SubmitEditorWidget Class

(VcsBase::SubmitEditorWidget)

The SubmitEditorWidget class presents a VCS commit message in a text editor and a checkable list of modified files in a list window. More...

Header: | #include <SubmitEditorWidget>

- List of all members, including inherited members

## Properties

descriptionMandatory : bool descriptionText : QString emptyFileListEnabled : bool | fileListSelectionMode : QAbstractItemView::SelectionMode lineWrap : bool lineWrapWidth : int

## Public Functions

| SubmitEditorWidget()
| ~SubmitEditorWidget() override
void | addDescriptionEditContextMenuAction(QAction *a)
void | addSubmitFieldWidget(SubmitFieldWidget *f)
virtual bool | canSubmit() const
QStringList | checkedFiles() const
Utils::CompletingTextEdit * | descriptionEdit() const
QString | descriptionText() const
QAbstractItemView::SelectionMode | fileListSelectionMode() const
SubmitFileModel * | fileModel() const
void | insertDescriptionEditContextMenuAction(int pos, QAction *a)
bool | isDescriptionMandatory() const
bool | isEmptyFileListEnabled() const
bool | lineWrap() const
int | lineWrapWidth() const
void | registerActions(QAction *editorUndoAction, QAction *editorRedoAction, QAction *submitAction = 0, QAction *diffAction = 0)
QList<int> | selectedRows() const
void | setDescriptionMandatory(bool)
void | setDescriptionText(const QString &text)
void | setEmptyFileListEnabled(bool e)
void | setFileListSelectionMode(QAbstractItemView::SelectionMode sm)
void | setFileModel(SubmitFileModel *model)
void | setLineWrap(bool)
void | setLineWrapWidth(int)
void | setSelectedRows(const QList<int> &rows)
void | setUpdateInProgress(bool value)
QList<SubmitFieldWidget *> | submitFieldWidgets() const
void | unregisterActions(QAction *editorUndoAction, QAction *editorRedoAction, QAction *submitAction = 0, QAction *diffAction = 0)
bool | updateInProgress() const

## Public Slots

void | updateSubmitAction()

## Signals

void | diffSelected(const QList<int> &)
void | fileSelectionChanged(bool someFileSelected)
void | submitActionEnabledChanged(bool)
void | submitActionTextChanged(const QString &)

## Protected Functions

void | addSubmitButtonMenu(QMenu *menu)
virtual QString | cleanupDescription(const QString &) const
virtual QString | commitName() const
void | hideDescription()
void | insertLeftWidget(QWidget *w)
void | insertTopWidget(QWidget *w)

## Protected Slots

void | descriptionTextChanged()

## Detailed Description

The SubmitEditorWidget class presents a VCS commit message in a text editor and a checkable list of modified files in a list window.

The user can delete files from the list by unchecking them or diff the selection by doubleclicking. A list model which contains state and file columns should be set using setFileModel().

Additionally, standard creator actions can be registered: Undo/redo will be set up to work with the description editor. Submit will be set up to be enabled according to checkstate. Diff will be set up to trigger diffSelected().

Note that the actions are connected by signals; in the rare event that there are several instances of the SubmitEditorWidget belonging to the same context active, the actions must be registered/unregistered in the editor change event. Care should be taken to ensure the widget is deleted properly when the editor closes.

## Property Documentation

### descriptionMandatory : bool

Access functions:

bool | isDescriptionMandatory() const
void | setDescriptionMandatory(bool)

### descriptionText : QString

Access functions:

QString | descriptionText() const
void | setDescriptionText(const QString &text)

### emptyFileListEnabled : bool

Access functions:

bool | isEmptyFileListEnabled() const
void | setEmptyFileListEnabled(bool e)

### fileListSelectionMode : QAbstractItemView::SelectionMode

Access functions:

QAbstractItemView::SelectionMode | fileListSelectionMode() const
void | setFileListSelectionMode(QAbstractItemView::SelectionMode sm)

### lineWrap : bool

Access functions:

bool | lineWrap() const
void | setLineWrap(bool)

### lineWrapWidth : int

Access functions:

int | lineWrapWidth() const
void | setLineWrapWidth(int)

## Member Function Documentation

### SubmitEditorWidget::SubmitEditorWidget()

Default constructs an instance of SubmitEditorWidget.

### SubmitEditorWidget::~SubmitEditorWidget()

Destroys the instance of SubmitEditorWidget.

### void SubmitEditorWidget::addDescriptionEditContextMenuAction(QAction *a)

### `[protected]` void SubmitEditorWidget::addSubmitButtonMenu(QMenu *menu)

### void SubmitEditorWidget::addSubmitFieldWidget(SubmitFieldWidget *f)

### `[virtual]` bool SubmitEditorWidget::canSubmit() const

### QStringList SubmitEditorWidget::checkedFiles() const

### `[virtual protected]` QString SubmitEditorWidget::cleanupDescription(const QString &) const

### `[virtual protected]` QString SubmitEditorWidget::commitName() const

### Utils::CompletingTextEdit *SubmitEditorWidget::descriptionEdit() const

### `[protected slot]` void SubmitEditorWidget::descriptionTextChanged()

### `[signal]` void SubmitEditorWidget::diffSelected(const QList<int> &)

### SubmitFileModel *SubmitEditorWidget::fileModel() const

See also setFileModel().

### `[signal]` void SubmitEditorWidget::fileSelectionChanged(bool someFileSelected)

### `[protected]` void SubmitEditorWidget::hideDescription()

### void SubmitEditorWidget::insertDescriptionEditContextMenuAction(int pos, QAction *a)

### `[protected]` void SubmitEditorWidget::insertLeftWidget(QWidget *w)

### `[protected]` void SubmitEditorWidget::insertTopWidget(QWidget *w)

### void SubmitEditorWidget::registerActions(QAction *editorUndoAction, QAction *editorRedoAction, QAction *submitAction = 0, QAction *diffAction = 0)

### QList<int> SubmitEditorWidget::selectedRows() const

See also setSelectedRows().

### void SubmitEditorWidget::setFileModel(SubmitFileModel *model)

See also fileModel().

### void SubmitEditorWidget::setSelectedRows(const QList<int> &rows)

See also selectedRows().

### void SubmitEditorWidget::setUpdateInProgress(bool value)

See also updateInProgress().

### `[signal]` void SubmitEditorWidget::submitActionEnabledChanged(bool)

### `[signal]` void SubmitEditorWidget::submitActionTextChanged(const QString &)

### QList<SubmitFieldWidget *> SubmitEditorWidget::submitFieldWidgets() const

### void SubmitEditorWidget::unregisterActions(QAction *editorUndoAction, QAction *editorRedoAction, QAction *submitAction = 0, QAction *diffAction = 0)

### bool SubmitEditorWidget::updateInProgress() const

See also setUpdateInProgress().

### `[slot]` void SubmitEditorWidget::updateSubmitAction()