From baff7f213f07b7ae134062cd54b22c691f48fbe4 Mon Sep 17 00:00:00 2001 From: xmrdsc Date: Sun, 14 Apr 2019 17:12:24 +0200 Subject: Animation slow down for debugging --- filter.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'filter.cpp') diff --git a/filter.cpp b/filter.cpp index 9129d92b..e66e5ade 100644 --- a/filter.cpp +++ b/filter.cpp @@ -27,9 +27,14 @@ // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "filter.h" +#include #include #include +#ifdef QT_DEBUG + #include "private/qabstractanimation_p.h" +#endif + filter::filter(QObject *parent) : QObject(parent) { @@ -79,6 +84,21 @@ bool filter::eventFilter(QObject *obj, QEvent *ev) { case QEvent::KeyRelease: { QKeyEvent *ke = static_cast(ev); +#ifdef QT_DEBUG + if(ke->key() == Qt::Key_F9){ + QUnifiedTimer::instance()->setSlowModeEnabled(true); + QUnifiedTimer::instance()->setSlowdownFactor(10); + qDebug() << "Slow animations enabled"; + } + + if(ke->key() == Qt::Key_F10){ + QUnifiedTimer::instance()->setSlowModeEnabled(false); + QUnifiedTimer::instance()->setSlowdownFactor(1); + + qDebug() << "Slow animations disabled"; + } +#endif + if(ke->key() == Qt::Key_Backtab) m_backtabPressed = false; -- cgit v1.2.3