move initialization code to private class
This commit is contained in:
parent
4ef57f8d3a
commit
61c2364fbb
|
@ -13,16 +13,6 @@ Slider::Slider(QWidget *parent)
|
|||
d_ptr(new SliderPrivate(this))
|
||||
{
|
||||
d_func()->init(this);
|
||||
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
|
||||
QSizePolicy sp(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
if (orientation() == Qt::Vertical)
|
||||
sp.transpose();
|
||||
setSizePolicy(sp);
|
||||
setAttribute(Qt::WA_WState_OwnSizePolicy, false);
|
||||
|
||||
QCoreApplication::processEvents();
|
||||
}
|
||||
|
||||
Slider::~Slider()
|
||||
|
|
|
@ -202,6 +202,16 @@ void SliderPrivate::init(Slider *slider)
|
|||
normalState->addTransition(transition);
|
||||
|
||||
machine.start();
|
||||
|
||||
slider->setFocusPolicy(Qt::StrongFocus);
|
||||
|
||||
QSizePolicy sp(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
if (slider->orientation() == Qt::Vertical)
|
||||
sp.transpose();
|
||||
slider->setSizePolicy(sp);
|
||||
slider->setAttribute(Qt::WA_WState_OwnSizePolicy, false);
|
||||
|
||||
QCoreApplication::processEvents();
|
||||
}
|
||||
|
||||
QRectF SliderPrivate::trackGeometry() const
|
||||
|
|
Loading…
Reference in New Issue