PimCommon::SimpleStringListEditor Class

The SimpleStringListEditor class provides a widget for editing a list of strings with add and remove buttons Author: Laurent Montel <montel@kde.org>. More...

Header: #include <PimCommon/SimpleStringListEditor>
CMake: find_package(KPim6PimCommon REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::PimCommon)

Public Functions

SimpleStringListEditor(QWidget *parent = nullptr, PimCommon::SimpleStringListEditor::ButtonCode buttons = Unsorted, const QString &addLabel = QString(), const QString &removeLabel = QString(), const QString &modifyLabel = QString(), const QString &addDialogLabel = QString())
virtual ~SimpleStringListEditor() override
virtual void addNewEntry()
void appendStringList(const QStringList &strings)
virtual QString customEntry(const QString &text)
virtual QString modifyEntry(const QString &text)
void setAddDialogLabel(const QString &addDialogLabel)
void setAddDialogTitle(const QString &str)
void setButtonText(PimCommon::SimpleStringListEditor::ButtonCode button, const QString &text)
void setModifyDialogLabel(const QString &str)
void setModifyDialogTitle(const QString &str)
void setRemoveDialogLabel(const QString &removeDialogLabel)
void setStringList(const QStringList &strings)
void setUpDownAutoRepeat(bool b)
QStringList stringList() const

Reimplemented Public Functions

virtual QSize sizeHint() const override

Signals

void aboutToAdd(QString &)
void changed()

Protected Functions

void insertNewEntry(const QString &newEntry)

Protected Slots

void slotAdd()
void slotCustomize()
void slotDown()
void slotModify()
void slotRemove()
void slotSelectionChanged()
void slotUp()

Detailed Description

Member Function Documentation

[explicit] SimpleStringListEditor::SimpleStringListEditor(QWidget *parent = nullptr, PimCommon::SimpleStringListEditor::ButtonCode buttons = Unsorted, const QString &addLabel = QString(), const QString &removeLabel = QString(), const QString &modifyLabel = QString(), const QString &addDialogLabel = QString())

Constructs a SimpleStringListEditor. @param parent The parent widget @param buttons The buttons to display @param addLabel The label for the add button @param removeLabel The label for the remove button @param modifyLabel The label for the modify button @param addDialogLabel The label for the add dialog

[override virtual noexcept] SimpleStringListEditor::~SimpleStringListEditor()

Destructs the SimpleStringListEditor.

[signal] void SimpleStringListEditor::aboutToAdd(QString &)

Emitted before adding an entry. Connected slots can alter the entry or suppress it by setting to QString(). @param entry The entry about to be added

[virtual] void SimpleStringListEditor::addNewEntry()

Adds a new entry to the list.

void SimpleStringListEditor::appendStringList(const QStringList &strings)

Adds strings to the list of displayed strings. @param strings The list of strings to add

[signal] void SimpleStringListEditor::changed()

Emitted when the list has changed.

[virtual] QString SimpleStringListEditor::customEntry(const QString &text)

Handles custom entry input. @param text The text to process @return The processed entry

[protected] void SimpleStringListEditor::insertNewEntry(const QString &newEntry)

Inserts a new entry into the list. @param newEntry The entry to insert

[virtual] QString SimpleStringListEditor::modifyEntry(const QString &text)

Handles modification of an entry. @param text The text to modify @return The modified text

void SimpleStringListEditor::setAddDialogLabel(const QString &addDialogLabel)

Sets the label for the add dialog. @param addDialogLabel The label text

void SimpleStringListEditor::setAddDialogTitle(const QString &str)

Sets the title for the add dialog. @param str The title text

void SimpleStringListEditor::setButtonText(PimCommon::SimpleStringListEditor::ButtonCode button, const QString &text)

Sets the text of a button. @param button The button code @param text The text to display on the button

void SimpleStringListEditor::setModifyDialogLabel(const QString &str)

Sets the label for the modify dialog. @param str The label text

void SimpleStringListEditor::setModifyDialogTitle(const QString &str)

Sets the title for the modify dialog. @param str The title text

void SimpleStringListEditor::setRemoveDialogLabel(const QString &removeDialogLabel)

Sets the label for the remove dialog. @param removeDialogLabel The label text

void SimpleStringListEditor::setStringList(const QStringList &strings)

Sets the list of strings displayed. @param strings The list of strings to display

See also stringList().

void SimpleStringListEditor::setUpDownAutoRepeat(bool b)

Sets whether buttons auto-repeat when held down. @param b true to enable auto-repeat, false otherwise

[override virtual] QSize SimpleStringListEditor::sizeHint() const

Returns the size hint for this widget. @return The size hint

[protected slot] void SimpleStringListEditor::slotAdd()

Adds a new entry to the list.

[protected slot] void SimpleStringListEditor::slotCustomize()

Customizes the selected entry.

[protected slot] void SimpleStringListEditor::slotDown()

Moves the selected entry down in the list.

[protected slot] void SimpleStringListEditor::slotModify()

Modifies the selected entry.

[protected slot] void SimpleStringListEditor::slotRemove()

Removes the selected entry from the list.

[protected slot] void SimpleStringListEditor::slotSelectionChanged()

Handles selection changes.

[protected slot] void SimpleStringListEditor::slotUp()

Moves the selected entry up in the list.

QStringList SimpleStringListEditor::stringList() const

Returns the current list of strings. @return The list of strings

See also setStringList().