qskinny/src/controls/QskSkinTransition.h
Uwe Rathmann 9ca02d7f1c moving away from std::unordered_map towards QHash. For transitions between
color schemes we need to copy out hash tables, what is way much easier
with the COW concept of the Qt containers. Also: according to
https://tessil.github.io/2016/08/29/benchmark-hopscotch-map.html QHash
seems to be faster in the most relevant category "Random full reads: execution time (integers)"
2024-01-30 13:04:38 +01:00

53 lines
1.1 KiB
C++

/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#ifndef QSK_SKIN_TRANSITION_H
#define QSK_SKIN_TRANSITION_H
#include "QskAspect.h"
#include <memory>
class QskAnimationHint;
class QskSkin;
class QQuickWindow;
class QVariant;
template< typename Key, typename T > class QHash;
class QSK_EXPORT QskSkinTransition
{
public:
enum Type
{
Color = 1,
Metric = 2,
AllTypes = Color | Metric
};
QskSkinTransition();
virtual ~QskSkinTransition();
void setSourceSkin( const QskSkin* );
void setTargetSkin( const QskSkin* );
void setMask( Type );
Type mask() const;
void run( const QskAnimationHint& );
static bool isRunning();
static QVariant animatedHint( const QQuickWindow*, QskAspect );
static QVariant animatedGraphicFilter( const QQuickWindow*, int graphicRole );
private:
Q_DISABLE_COPY( QskSkinTransition )
class PrivateData;
std::unique_ptr< PrivateData > m_data;
};
#endif