21 #include "checkbox.moc"
25 : TQCheckBox(parent, name),
26 mFocusPolicy(focusPolicy()),
32 : TQCheckBox(text, parent, name),
33 mFocusPolicy(focusPolicy()),
44 if ((
int)ro != (
int)mReadOnly)
47 setFocusPolicy(ro ? TQWidget::NoFocus : mFocusPolicy);
59 mFocusWidgetEnable = enable;
61 connect(
this, TQ_SIGNAL(clicked()), TQ_SLOT(slotClicked()));
63 disconnect(
this, TQ_SIGNAL(clicked()),
this, TQ_SLOT(slotClicked()));
70 void CheckBox::slotClicked()
72 if (mFocusWidget && isChecked())
74 if (mFocusWidgetEnable)
75 mFocusWidget->setEnabled(
true);
76 mFocusWidget->setFocus();
84 void CheckBox::mousePressEvent(TQMouseEvent* e)
89 if (e->button() == TQt::LeftButton)
92 TQCheckBox::mousePressEvent(e);
95 void CheckBox::mouseReleaseEvent(TQMouseEvent* e)
100 if (e->button() == TQt::LeftButton)
103 TQCheckBox::mouseReleaseEvent(e);
106 void CheckBox::mouseMoveEvent(TQMouseEvent* e)
109 TQCheckBox::mouseMoveEvent(e);
112 void CheckBox::keyPressEvent(TQKeyEvent* e)
126 TQCheckBox::keyPressEvent(e);
129 void CheckBox::keyReleaseEvent(TQKeyEvent* e)
132 TQCheckBox::keyReleaseEvent(e);
CheckBox(TQWidget *parent, const char *name=0)
Constructor.
void setFocusWidget(TQWidget *widget, bool enable=true)
Specifies a widget to receive focus when the user selects the check box by clicking on it.
virtual void setReadOnly(bool readOnly)
Sets whether the check box is read-only for the user.