make sure all animations have a parent
This commit is contained in:
parent
264e4c71ed
commit
e33478ad49
|
@ -17,6 +17,8 @@ TogglePrivate::TogglePrivate(Toggle *q)
|
|||
thumb(new ToggleThumb(q)),
|
||||
offState(new QState),
|
||||
onState(new QState),
|
||||
ripple(new RippleOverlay(q->parentWidget())),
|
||||
machine(new QStateMachine),
|
||||
orientation(Qt::Horizontal),
|
||||
useThemeColors(true)
|
||||
{
|
||||
|
@ -26,8 +28,7 @@ void TogglePrivate::init()
|
|||
{
|
||||
Q_Q(Toggle);
|
||||
|
||||
ripple = new RippleOverlay(q->parentWidget());
|
||||
machine = new QStateMachine(q);
|
||||
machine->setParent(q);
|
||||
|
||||
q->setCheckable(true);
|
||||
q->setChecked(false);
|
||||
|
|
|
@ -26,14 +26,14 @@ public:
|
|||
ToggleThumb *const thumb;
|
||||
QState *const offState;
|
||||
QState *const onState;
|
||||
RippleOverlay *ripple;
|
||||
QStateMachine *machine;
|
||||
Qt::Orientation orientation;
|
||||
QColor disabledColor;
|
||||
QColor activeColor;
|
||||
QColor inactiveColor;
|
||||
QColor trackColor;
|
||||
bool useThemeColors;
|
||||
RippleOverlay *const ripple;
|
||||
QStateMachine *const machine;
|
||||
Qt::Orientation orientation;
|
||||
QColor disabledColor;
|
||||
QColor activeColor;
|
||||
QColor inactiveColor;
|
||||
QColor trackColor;
|
||||
bool useThemeColors;
|
||||
};
|
||||
|
||||
#endif // TOGGLE_P_H
|
||||
|
|
Loading…
Reference in New Issue