Loading...
Searching...
No Matches
SignalUtils.hpp
1#pragma once
2#include <QCheckBox>
3#include <QComboBox>
4#include <QSpinBox>
5
7{
8 static constexpr auto QCheckBox_checkStateChanged()
9 {
10#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
11 return &QCheckBox::checkStateChanged;
12#else
13 return &QCheckBox::stateChanged;
14#endif
15 }
16 static constexpr auto QSpinBox_valueChanged_int()
17 {
18 return static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged);
19 }
20 static constexpr auto QDoubleSpinBox_valueChanged_double()
21 {
22 return static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged);
23 }
24 static constexpr auto QComboBox_currentIndexChanged_int()
25 {
26 return static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged);
27 }
28 static constexpr auto QComboBox_activated_int()
29 {
30 return static_cast<void (QComboBox::*)(int)>(&QComboBox::activated);
31 }
32
33 template <typename Spinbox_T>
34 static constexpr auto SpinBox_valueChanged();
35};
36
37template <>
38inline constexpr auto SignalUtils::SpinBox_valueChanged<QSpinBox>()
39{
40 return QSpinBox_valueChanged_int();
41}
42template <>
43inline constexpr auto SignalUtils::SpinBox_valueChanged<QDoubleSpinBox>()
44{
45 return QDoubleSpinBox_valueChanged_double();
46}
Definition SignalUtils.hpp:7