本文整理汇总了C++中QEasingCurve::period方法的典型用法代码示例。如果您正苦于以下问题:C++ QEasingCurve::period方法的具体用法?C++ QEasingCurve::period怎么用?C++ QEasingCurve::period使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QEasingCurve
的用法示例。
在下文中一共展示了QEasingCurve::period方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: properties
// Test getting and setting easing properties via the metaobject system.
void tst_QEasingCurve::properties()
{
tst_QEasingProperties obj;
QEasingCurve inOutBack(QEasingCurve::InOutBack);
qreal overshoot = 1.5;
inOutBack.setOvershoot(overshoot);
qreal amplitude = inOutBack.amplitude();
qreal period = inOutBack.period();
obj.setEasing(inOutBack);
QEasingCurve easing = qVariantValue<QEasingCurve>(obj.property("easing"));
QCOMPARE(easing.type(), QEasingCurve::InOutBack);
QCOMPARE(easing.overshoot(), overshoot);
QCOMPARE(easing.amplitude(), amplitude);
QCOMPARE(easing.period(), period);
QEasingCurve linear(QEasingCurve::Linear);
overshoot = linear.overshoot();
amplitude = linear.amplitude();
period = linear.period();
obj.setProperty("easing",
qVariantFromValue(QEasingCurve(QEasingCurve::Linear)));
easing = qVariantValue<QEasingCurve>(obj.property("easing"));
QCOMPARE(easing.type(), QEasingCurve::Linear);
QCOMPARE(easing.overshoot(), overshoot);
QCOMPARE(easing.amplitude(), amplitude);
QCOMPARE(easing.period(), period);
}
示例2: pix
Window::Window(QWidget *parent)
: QWidget(parent),
m_iconSize(64, 64)
{
m_ui.setupUi(this);
QButtonGroup *buttonGroup = findChild<QButtonGroup *>(); // ### workaround for uic in 4.4
m_ui.easingCurvePicker->setIconSize(m_iconSize);
m_ui.easingCurvePicker->setMinimumHeight(m_iconSize.height() + 50);
buttonGroup->setId(m_ui.lineRadio, 0);
buttonGroup->setId(m_ui.circleRadio, 1);
QEasingCurve dummy;
m_ui.periodSpinBox->setValue(dummy.period());
m_ui.amplitudeSpinBox->setValue(dummy.amplitude());
m_ui.overshootSpinBox->setValue(dummy.overshoot());
connect(m_ui.easingCurvePicker, SIGNAL(currentRowChanged(int)), this, SLOT(curveChanged(int)));
connect(buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(pathChanged(int)));
connect(m_ui.periodSpinBox, SIGNAL(valueChanged(double)), this, SLOT(periodChanged(double)));
connect(m_ui.amplitudeSpinBox, SIGNAL(valueChanged(double)), this, SLOT(amplitudeChanged(double)));
connect(m_ui.overshootSpinBox, SIGNAL(valueChanged(double)), this, SLOT(overshootChanged(double)));
createCurveIcons();
QPixmap pix(QLatin1String(":/images/qt-logo.png"));
m_item = new PixmapItem(pix);
m_scene.addItem(m_item);
m_ui.graphicsView->setScene(&m_scene);
m_anim = new Animation(m_item, "pos");
m_anim->setEasingCurve(QEasingCurve::OutBounce);
m_ui.easingCurvePicker->setCurrentRow(int(QEasingCurve::OutBounce));
startAnimation();
}
示例3: if
/*!
Compare this easing curve with \a other and returns true if they are
equal. It will also compare the properties of a curve.
*/
bool QEasingCurve::operator==(const QEasingCurve &other) const
{
bool res = d_ptr->func == other.d_ptr->func
&& d_ptr->type == other.d_ptr->type;
if (res) {
if (d_ptr->config && other.d_ptr->config) {
// catch the config content
res = d_ptr->config->operator==(*(other.d_ptr->config));
} else if (d_ptr->config || other.d_ptr->config) {
// one one has a config object, which could contain default values
res = qFuzzyCompare(amplitude(), other.amplitude()) &&
qFuzzyCompare(period(), other.period()) &&
qFuzzyCompare(overshoot(), other.overshoot());
}
}
return res;
}