KWidgetsAddons
kselectaction.cpp
85 QObject::connect(q_ptr->selectableActionGroup(), &QActionGroup::triggered, q_ptr, &KSelectAction::actionTriggered);
91 QObject::connect(q_ptr, qOverload<int>(&KSelectAction::triggered), q_ptr, &KSelectAction::indexTriggered);
92 QObject::connect(q_ptr, qOverload<const QString &>(&KSelectAction::triggered), q_ptr, &KSelectAction::textTriggered);
138 qCWarning(KWidgetsAddonsLog) << "Action does not have the correct properties to be current:" << action->text();
197 // qCDebug(KWidgetsAddonsLog) << "KSelectAction::setCurrentAction(" << text << ",cs=" << cs << ")";
321 // qCDebug(KWidgetsAddonsLog) << "KSelectAction::actionTriggered(" << action << ") text=" << text
325 trigger(); // then imitate usual QAction behaviour so that other submenus (and their items) become unchecked
477 // qCDebug(KWidgetsAddonsLog) << "KSelectActionPrivate::comboBoxCurrentIndexChanged(" << index << ")";
487 } else if (q->isEditable() && triggeringCombo && triggeringCombo->count() > 0 && index == triggeringCombo->count() - 1) {
544 QObject::connect(toolBar, &QToolBar::toolButtonStyleChanged, button, &QToolButton::setToolButtonStyle);
649 // qCDebug(KWidgetsAddonsLog) << "\t\taction " << action << " (text=" << action->text () << ") isChecked";
660 // qCDebug(KWidgetsAddonsLog) << "\t\tcurrent action still selected? " << (curAction && curAction->isChecked ());
697 const int index = e->before() ? comboBox->findData(QVariant::fromValue(e->before())) : comboBox->count();
709 comboBox->insertItem(index, e->action()->icon(), ::DropAmpersands(e->action()->text()), QVariant::fromValue(e->action()));
void setToolBarMode(ToolBarMode mode)
Set the type of widget to be inserted in a toolbar to mode.
Definition: kselectaction.cpp:451
currentText
int findData(const QVariant &data, int role, Qt::MatchFlags flags) const const
void setWhatsThis(const QString &)
void actionTriggered(QAction *action)
void addActions(QList< QAction * > actions)
ActionChanged
void setFocusPolicy(Qt::FocusPolicy policy)
void setEditable(bool)
When this action is plugged into a toolbar, it creates a combobox.
Definition: kselectaction.cpp:419
void iconSizeChanged(const QSize &iconSize)
CaseSensitivity
QVariant fromValue(const T &value)
void setMaxComboViewCount(int n)
Sets the maximum items that are visible at once if the action is a combobox, that is the number of it...
Definition: kselectaction.cpp:217
Q_EMITQ_EMIT
virtual void actionTriggered(QAction *action)
This function is called whenever an action from the selections is triggered.
Definition: kselectaction.cpp:315
int count(const T &value) const const
QWidget * createWidget(QWidget *parent) override
Reimplemented from QWidgetAction.
Definition: kselectaction.cpp:521
KSelectAction(QObject *parent)
Constructs a selection action with the specified parent.
Definition: kselectaction.cpp:52
currentIndex
QAction * action(int index) const
Returns the action at index, if one exists.
Definition: kselectaction.cpp:159
void setItems(const QStringList &lst)
Convenience function to create the list of selectable items.
Definition: kselectaction.cpp:364
void setShortcut(const QKeySequence &shortcut)
QAbstractItemModel * model() const const
QAction(QObject *parent)
QAction * before() const const
QAction * checkedAction() const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QList< QAction * > actions() const
Returns the list of selectable actions.
Definition: kselectaction.cpp:102
void insertAction(QAction *before, QAction *action)
void indexTriggered(int index)
This signal is emitted when an item is selected.
QString itemText(int index) const const
void setMaximumWidth(int maxw)
void reserve(int alloc)
void setEditText(const QString &text)
void destroyed(QObject *obj)
int size() const const
void setIcon(const QIcon &icon)
void deleteLater()
void triggered(QAction *action)
This signal is emitted when an item is selected.
void setAutoRaise(bool enable)
bool isEditable() const
When this action is plugged into a toolbar, it creates a combobox.
Definition: kselectaction.cpp:431
void setItemText(int index, const QString &text)
ActiveWindowFocusReason
QList< QAction * > actions() const const
statusTip
bool blockSignals(bool block)
void toggled(bool checked)
iconSize
void insertItem(int index, const QString &text, const QVariant &userData)
void setActionGroup(QActionGroup *group)
int indexOf(const T &value, int from) const const
void installEventFilter(QObject *filterObj)
int length() const const
const T & at(int i) const const
Qt::FocusReason reason() const const
ToolButtonPopupMode
void setText(const QString &text)
bool isEmpty() const const
count
AKONADI_CALENDAR_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item)
@ MenuMode
Creates a button which pops up a menu when interacted with, as defined by toolButtonPopupMode().
Definition: kselectaction.h:98
void textTriggered(const QString &text)
This signal is emitted when an item is selected.
void setDefaultAction(QAction *action)
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const const
void changeItem(int index, const QString &text)
Changes the text of item.
Definition: kselectaction.cpp:353
whatsThis
void setEnabled(bool enabled)
void setEnabled(bool)
bool isCheckable() const const
void setComboWidth(int width)
When this action is plugged into a toolbar, it creates a combobox.
Definition: kselectaction.cpp:201
void trigger()
QString & remove(int position, int n)
void deleteWidget(QWidget *widget) override
Reimplemented from QWidgetAction.
Definition: kselectaction.cpp:599
void removeAction(QAction *action)
void setIconSize(const QSize &size)
bool isVisible() const const
QString label(StandardShortcut id)
void setStatusTip(const QString &)
void addAction(QAction *action)
Add action to the list of selectable actions.
Definition: kselectaction.cpp:235
void setToolButtonStyle(Qt::ToolButtonStyle style)
bool setProperty(const char *name, const QVariant &value)
void setEditable(bool editable)
toolTip
bool isEnabled() const const
void setToolTip(const QString &)
void triggered(QAction *action)
void toolButtonStyleChanged(Qt::ToolButtonStyle toolButtonStyle)
bool menuAccelsEnabled() const
Returns whether ampersands passed to methods using QStrings are interpreted as keyboard accelerator i...
Definition: kselectaction.cpp:515
bool setCurrentItem(int index)
Convenience function to set the currently checked action to be the action at index index.
Definition: kselectaction.cpp:153
void removeItem(int index)
void currentIndexChanged(int index)
void setMaxVisibleItems(int maxItems)
toolButtonStyle
bool setCurrentAction(QAction *action)
Sets the currently checked item.
Definition: kselectaction.cpp:126
virtual QAction * removeAction(QAction *action)
Remove the specified action from this action selector.
Definition: kselectaction.cpp:264
void triggered(QAction *action)
virtual bool event(QEvent *event) override
QAction * action() const const
void addAction(QAction *action)
void setChecked(bool)
void setItemIcon(int index, const QIcon &icon)
NoFocus
void setSeparator(bool b)
void setToolButtonPopupMode(QToolButton::ToolButtonPopupMode mode)
Set how this list of actions should behave when in popup mode and plugged into a toolbar.
Definition: kselectaction.cpp:463
void setPopupMode(QToolButton::ToolButtonPopupMode mode)
QActionGroup * selectableActionGroup() const
The action group used to create exclusivity between the actions associated with this action.
Definition: kselectaction.cpp:96
void setMenuAccelsEnabled(bool b)
Sets whether any occurrence of the ampersand character ( & ) in items should be interpreted as keyboa...
Definition: kselectaction.cpp:509
virtual void deleteWidget(QWidget *widget)
virtual void insertAction(QAction *before, QAction *action)
Inserts the action action to this widget's list of actions, before the action before.
Definition: kselectaction.cpp:293
QObject * parent() const const
Q_D(Todo)
void changed()
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Dec 7 2023 04:02:18 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Dec 7 2023 04:02:18 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.