QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskFontRole.cpp
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#include "QskFontRole.h"
7#include <qhash.h>
8
9static void qskRegisterFontRole()
10{
11 qRegisterMetaType< QskFontRole >();
12
13#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
14 QMetaType::registerEqualsComparator< QskFontRole >();
15#endif
16}
17
18Q_CONSTRUCTOR_FUNCTION( qskRegisterFontRole )
19
20QskHashValue QskFontRole::hash( QskHashValue seed ) const noexcept
21{
22 const auto v = static_cast< ushort >( category() )
23 | ( static_cast< ushort >( emphasis() ) << 8 );
24
25 return qHash( v, seed );
26}
27
28#ifndef QT_NO_DEBUG_STREAM
29
30#include <qdebug.h>
31
32QDebug operator<<( QDebug debug, const QskFontRole& fontRole )
33{
34 QDebugStateSaver saver( debug );
35 debug.nospace();
36
37 debug << "FontRole( " << fontRole.category()
38 << ", " << fontRole.emphasis() << " )";
39
40 return debug;
41}
42
43#endif
44
45#include "moc_QskFontRole.cpp"