31 #ifndef KSELECTACTION_H
32 #define KSELECTACTION_H
34 #include <QtGui/QToolButton>
38 class KSelectActionPrivate;
54 Q_PROPERTY(
QAction* currentAction READ currentAction WRITE setCurrentAction )
55 Q_PROPERTY(
bool editable READ isEditable WRITE setEditable )
56 Q_PROPERTY(
int comboWidth READ comboWidth WRITE setComboWidth )
57 Q_PROPERTY(
QString currentText READ currentText )
59 Q_PROPERTY(
ToolBarMode toolBarMode READ toolBarMode WRITE setToolBarMode )
60 Q_PROPERTY(
QToolButton::ToolButtonPopupMode toolButtonPopupMode READ toolButtonPopupMode WRITE setToolButtonPopupMode )
61 Q_PROPERTY(
int currentItem READ currentItem WRITE setCurrentItem )
118 ToolBarMode toolBarMode()
const;
123 void setToolBarMode(ToolBarMode mode);
131 QToolButton::ToolButtonPopupMode toolButtonPopupMode()
const;
136 void setToolButtonPopupMode(QToolButton::ToolButtonPopupMode mode);
141 QActionGroup* selectableActionGroup()
const;
147 QAction* currentAction()
const;
154 int currentItem()
const;
171 QAction* action(
int index)
const;
177 QAction* action(
const QString& text, Qt::CaseSensitivity cs = Qt::CaseSensitive)
const;
186 bool setCurrentAction(
QAction* action);
199 bool setCurrentItem(
int index);
212 bool setCurrentAction(
const QString& text, Qt::CaseSensitivity cs = Qt::CaseSensitive);
217 virtual void addAction(
QAction* action);
263 bool isEditable()
const;
269 void setEditable(
bool );
275 int comboWidth()
const;
282 void setComboWidth(
int width );
288 void setMaxComboViewCount(
int n );
297 void removeAllActions();
309 void setMenuAccelsEnabled(
bool b );
315 bool menuAccelsEnabled()
const;
320 void changeItem(
int index,
const QString& text );
345 virtual void actionTriggered(
QAction* action);
350 void slotToggled(
bool);
361 virtual void deleteWidget(
QWidget *widget);
363 virtual bool event(QEvent *event);
365 virtual bool eventFilter (
QObject *watched, QEvent *event);
379 Q_PRIVATE_SLOT( d_func(),
void _k_comboBoxDeleted(
QObject*) )
380 Q_PRIVATE_SLOT( d_func(),
void _k_comboBoxCurrentIndexChanged(
int) )
Creates a button which pops up a menu when interacted with, as defined by toolButtonPopupMode().
KSelectActionPrivate * d_ptr
Action for selecting one of several items.
A wrapper around QIcon that provides KDE icon features.
KAction * clear(const QObject *recvr, const char *slot, QObject *parent)
Clear the content of the focus widget.
void triggered(Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
Emitted when the action is triggered.
Class to encapsulate user-driven action or event.