IMPROVEMENT: add a clicked() slot (which just backends on to animateClick()), and make setChecked a slot like it is in the native widget
svn path=/trunk/KDE/kdelibs/; revision=1175311
This commit is contained in:
parent
e4c6d2e92b
commit
1fc68e3ef9
@ -308,6 +308,11 @@ void PushButton::setChecked(bool checked)
|
||||
nativeWidget()->setChecked(checked);
|
||||
}
|
||||
|
||||
void PushButton::click()
|
||||
{
|
||||
nativeWidget()->animateClick();
|
||||
}
|
||||
|
||||
bool PushButton::isChecked() const
|
||||
{
|
||||
return nativeWidget()->isChecked();
|
||||
|
@ -158,13 +158,6 @@ public:
|
||||
*/
|
||||
bool isCheckable() const;
|
||||
|
||||
/**
|
||||
* Sets whether or not this button is checked. Implies setIsCheckable(true).
|
||||
*
|
||||
* @since 4.3
|
||||
*/
|
||||
void setChecked(bool checked);
|
||||
|
||||
/**
|
||||
* @return true if the button is checked; requires setIsCheckable(true) to
|
||||
* be called
|
||||
@ -209,6 +202,20 @@ Q_SIGNALS:
|
||||
*/
|
||||
void toggled(bool);
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
* Performs a visual click and emits the associated signals
|
||||
* @since 4.6
|
||||
*/
|
||||
void click();
|
||||
|
||||
/**
|
||||
* Sets whether or not this button is checked. Implies setIsCheckable(true).
|
||||
*
|
||||
* @since 4.3
|
||||
*/
|
||||
void setChecked(bool checked);
|
||||
|
||||
protected:
|
||||
void paint(QPainter *painter,
|
||||
const QStyleOptionGraphicsItem *option,
|
||||
|
Loading…
Reference in New Issue
Block a user