51 #include "private/qabstractbutton_p.h" 173 q->setCheckable(
true);
174 q->setMouseTracking(
true);
194 if (
d->tristate &&
d->noChange)
204 option->
text =
d->text;
205 option->
icon =
d->icon;
258 if (
d->tristate &&
d->noChange)
279 d->blockRefresh =
true;
281 d->blockRefresh =
false;
283 if ((
uint)state !=
d->publishedState) {
284 d->publishedState = state;
296 if (
d->sizeHint.isValid())
343 if (hit !=
d->hovering) {
371 if ((
uint)state !=
d->publishedState) {
372 d->publishedState = state;
The QFontMetrics class provides font metrics information.
#define QT_END_NAMESPACE
This macro expands to.
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
void drawControl(QStyle::ControlElement ce, const QStyleOption &opt)
Use the widget's style to draw a control element ce specified by QStyleOption option.
QStyle::State state
the style flags that are used when drawing the control
static QSize globalStrut()
bool event(QEvent *e)
Reimplemented Function
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
The QString class provides a Unicode character string.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
void setObjectName(const QString &name)
void initStyleOption(QStyleOptionButton *option) const
Initializes option with the values from this QCheckBox.
int width() const
Returns the width.
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual QRect itemTextRect(const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const
Returns the area within the given rectangle in which to draw the provided text according to the speci...
bool hitButton(const QPoint &pos) const
Reimplemented Function
QCheckBox(QWidget *parent=0)
Constructs a checkbox with the given parent, but with no text.
void setTristate(bool y=true)
void mouseMoveEvent(QMouseEvent *)
Reimplemented Function
void initFrom(const QWidget *w)
QSize size() const
Returns the size of the rectangle.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
void stateChanged(int)
This signal is emitted whenever the check box's state changes, i.
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
The QMouseEvent class contains parameters that describe a mouse event.
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=0) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
#define Q_DECLARE_PUBLIC(Class)
virtual QRect subElementRect(SubElement subElement, const QStyleOption *option, const QWidget *widget=0) const =0
Returns the sub-area for the given element as described in the provided style option.
Qt::CheckState checkState() const
Returns the check box's check state.
void checkStateSet()
Reimplemented Function
QSize minimumSizeHint() const
Reimplemented Function
void nextCheckState()
Reimplemented Function
QObject * parent() const
Returns a pointer to the parent object.
The QPoint class defines a point in the plane using integer precision.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
int height() const
Returns the height.
The QRect class defines a rectangle in the plane using integer precision.
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget...
QSize sizeHint() const
Reimplemented Function
The QSize class defines the size of a two-dimensional object using integer point precision.
The QPaintEvent class contains event parameters for paint events.
void setCheckState(Qt::CheckState state)
Sets the check box's check state to state.
The QCheckBox widget provides a checkbox with a text label.
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
void paintEvent(QPaintEvent *)
Reimplemented Function