forked from qt-creator/qt-creator
QmlDesigner: Move StyleAnimator to Utils
StyleAnimator moved to Utils in order to be used by other modules and styles. Since Utils is the most common dependency, it's chosen as the right place of StyleAnimator. Task-number: QDS-9522 Change-Id: Idbf55875e0c320ccfa21e1c479bf5997ea7d150d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -164,6 +164,7 @@ add_qtc_library(Utils
|
||||
statuslabel.cpp statuslabel.h
|
||||
stringtable.cpp stringtable.h
|
||||
stringutils.cpp stringutils.h
|
||||
styleanimator.cpp styleanimator.h
|
||||
styledbar.cpp styledbar.h
|
||||
stylehelper.cpp stylehelper.h
|
||||
tasktree.cpp tasktree.h
|
||||
|
@@ -3,9 +3,13 @@
|
||||
|
||||
#include "styleanimator.h"
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include "algorithm.h"
|
||||
|
||||
#include <QPainter>
|
||||
#include <QStyleOption>
|
||||
#include <QWidget>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
Animation * StyleAnimator::widgetAnimation(const QWidget *widget) const
|
||||
{
|
@@ -3,13 +3,17 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "utils_global.h"
|
||||
|
||||
#include <QBasicTimer>
|
||||
#include <QPointer>
|
||||
#include <QTime>
|
||||
#include <QBasicTimer>
|
||||
#include <QStyle>
|
||||
#include <QPainter>
|
||||
#include <QWidget>
|
||||
|
||||
class QPainter;
|
||||
class QStyleOption;
|
||||
|
||||
namespace Utils {
|
||||
/*
|
||||
* This is a set of helper classes to allow for widget animations in
|
||||
* the style. Its mostly taken from Vista style so it should be fully documented
|
||||
@@ -17,7 +21,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
class Animation
|
||||
class QTCREATOR_UTILS_EXPORT Animation
|
||||
{
|
||||
public :
|
||||
Animation() = default;
|
||||
@@ -41,7 +45,7 @@ protected:
|
||||
};
|
||||
|
||||
// Handles state transition animations
|
||||
class Transition : public Animation
|
||||
class QTCREATOR_UTILS_EXPORT Transition : public Animation
|
||||
{
|
||||
public :
|
||||
Transition() = default;
|
||||
@@ -54,7 +58,7 @@ public :
|
||||
int m_duration = 100; //set time in ms to complete a state transition
|
||||
};
|
||||
|
||||
class StyleAnimator : public QObject
|
||||
class QTCREATOR_UTILS_EXPORT StyleAnimator : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -70,3 +74,4 @@ private:
|
||||
QBasicTimer animationTimer;
|
||||
QList <Animation*> animations;
|
||||
};
|
||||
}
|
@@ -293,6 +293,8 @@ Project {
|
||||
"stringtable.h",
|
||||
"stringutils.cpp",
|
||||
"stringutils.h",
|
||||
"styleanimator.cpp",
|
||||
"styleanimator.h",
|
||||
"styledbar.cpp",
|
||||
"styledbar.h",
|
||||
"stylehelper.cpp",
|
||||
|
@@ -150,7 +150,6 @@ add_qtc_plugin(Core
|
||||
sidebar.cpp sidebar.h
|
||||
sidebarwidget.cpp sidebarwidget.h
|
||||
statusbarmanager.cpp statusbarmanager.h
|
||||
styleanimator.cpp styleanimator.h
|
||||
systemsettings.cpp systemsettings.h
|
||||
textdocument.cpp textdocument.h
|
||||
themechooser.cpp themechooser.h
|
||||
|
@@ -157,8 +157,6 @@ Project {
|
||||
"sidebarwidget.h",
|
||||
"statusbarmanager.cpp",
|
||||
"statusbarmanager.h",
|
||||
"styleanimator.cpp",
|
||||
"styleanimator.h",
|
||||
"systemsettings.cpp",
|
||||
"systemsettings.h",
|
||||
"textdocument.cpp",
|
||||
|
@@ -3,16 +3,14 @@
|
||||
|
||||
#include "manhattanstyle.h"
|
||||
|
||||
#include "styleanimator.h"
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/stylehelper.h>
|
||||
|
||||
#include <utils/fancymainwindow.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/styleanimator.h>
|
||||
#include <utils/stylehelper.h>
|
||||
#include <utils/theme/theme.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCheckBox>
|
||||
|
Reference in New Issue
Block a user