QDialog* eulaWin
= new QDialog(this, Qt
::Dialog | Qt
::Window | Qt
::WindowStaysOnTopHint );
QDialog* eulaWin = new QDialog(this, Qt::Dialog | Qt::Window | Qt::WindowStaysOnTopHint );
To copy to clipboard, switch view to plain text mode
void FXManager
::expand(QWidget *widget,
int direction,
int speed,
int ratio, QEasingCurve easingCurve
) {
QPropertyAnimation* animationFrame = new QPropertyAnimation(widget, "geometry", widget);
animationFrame->setDuration(speed);
animationFrame->setEasingCurve(easingCurve);
animationFrame
->setStartValue
(QRect(widget
->geometry
().
x(),widget
->geometry
().
y(), widget
->geometry
().
width(), widget
->geometry
().
height()));
switch(direction)
{
case (int)FX_LEFT
: animationFrame
->setEndValue
(QRect(widget
->geometry
().
x() - ratio,widget
->geometry
().
y()+0, widget
->geometry
().
width() + ratio, widget
->geometry
().
height()));
break;
case (int)FX_RIGHT
: animationFrame
->setEndValue
(QRect(widget
->geometry
().
x()+0,widget
->geometry
().
y()+0, widget
->geometry
().
width() + ratio, widget
->geometry
().
height()));
break;
case (int)FX_UP
: animationFrame
->setEndValue
(QRect(widget
->geometry
().
x()+0,widget
->geometry
().
y() - ratio, widget
->geometry
().
width(), widget
->geometry
().
height() + ratio
));
break;
case (int)FX_DOWN
: animationFrame
->setEndValue
(QRect(widget
->geometry
().
x()+0,widget
->geometry
().
y()+0, widget
->geometry
().
width(), widget
->geometry
().
height() + ratio
));
break;
}
animationFrame->start(QPropertyAnimation::DeleteWhenStopped);
widget->repaint();
}
void FXManager::expand(QWidget *widget, int direction, int speed, int ratio, QEasingCurve easingCurve)
{
QPropertyAnimation* animationFrame = new QPropertyAnimation(widget, "geometry", widget);
animationFrame->setDuration(speed);
animationFrame->setEasingCurve(easingCurve);
animationFrame->setStartValue(QRect(widget->geometry().x(),widget->geometry().y(), widget->geometry().width(), widget->geometry().height()));
switch(direction)
{
case (int)FX_LEFT: animationFrame->setEndValue(QRect(widget->geometry().x() - ratio,widget->geometry().y()+0, widget->geometry().width() + ratio, widget->geometry().height()));
break;
case (int)FX_RIGHT: animationFrame->setEndValue(QRect(widget->geometry().x()+0,widget->geometry().y()+0, widget->geometry().width() + ratio, widget->geometry().height()));
break;
case (int)FX_UP: animationFrame->setEndValue(QRect(widget->geometry().x()+0,widget->geometry().y() - ratio, widget->geometry().width(), widget->geometry().height() + ratio));
break;
case (int)FX_DOWN: animationFrame->setEndValue(QRect(widget->geometry().x()+0,widget->geometry().y()+0, widget->geometry().width(), widget->geometry().height() + ratio));
break;
}
animationFrame->start(QPropertyAnimation::DeleteWhenStopped);
widget->repaint();
QApplication::processEvents();
}
To copy to clipboard, switch view to plain text mode
Bookmarks