File: qt_compatibility.hpp

package info (click to toggle)
qt-color-widgets 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,088 kB
  • sloc: cpp: 7,426; sh: 236; makefile: 14
file content (32 lines) | stat: -rw-r--r-- 598 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * SPDX-FileCopyrightText: 2022-2022 Jeremy Borgman
 *
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#ifndef QT_COMPATIBILITY_HPP
#define QT_COMPATIBILITY_HPP

#include <QWidget>
/**
 * \brief pos is deprecated in Qt6.
 */
template <typename T>
QPointF pos_wrap(T* event)
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
    return event->position();
#else
    return event->pos();
#endif
}

// Qt6 change the type of QColor from qreal to float
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
typedef float qt_color_type;
#else
typedef qreal qt_color_type;
#endif


#endif // QT_COMPATIBILITY_HPP