summaryrefslogtreecommitdiffhomepage
path: root/options/base-value.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-07-01 18:07:03 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-07-01 18:07:03 +0200
commita67e8630caf20e7f48151024e9e68dd9271d75c7 (patch)
treee7418eabdfb4abd6ca88c0ba6a427ca5a40e7c32 /options/base-value.hpp
parent74dff816c07737b7e697e5d63222e59a9fefe23e (diff)
options/value: add `QObject::connect` wrapper
This is useful not just to save on complexity in call sites, but also because I plan on using the Verdigris library to remove needless `valueChanged()` and `setValue()` overloads from each `value<t>` instance. Also fix a bug in `options/tie.hpp` where `QComboBox::setCurrentIndex` was erroneously called as `Qt::DirectConnection`.
Diffstat (limited to 'options/base-value.hpp')
-rw-r--r--options/base-value.hpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/options/base-value.hpp b/options/base-value.hpp
index eb8c89b7..81da0513 100644
--- a/options/base-value.hpp
+++ b/options/base-value.hpp
@@ -10,6 +10,7 @@
#include "value-traits.hpp"
#include <utility>
+#include <type_traits>
#include <QObject>
#include <QString>
@@ -26,21 +27,15 @@ class OTR_OPTIONS_EXPORT value_ : public QObject
{
Q_OBJECT
- template<typename t> using cv_qualified = detail::cv_qualified<t>;
- template<typename t>
- using signal_sig = void(value_::*)(cv_qualified<t>) const;
+protected:
+ template<typename t> using signal_sig_ = void(value_::*)(detail::cv_qualified<detail::maybe_enum_type_t<t>>) const;
+ template<typename t> using slot_sig_ = void(value_::*)(detail::cv_qualified<detail::maybe_enum_type_t<t>>);
public:
QString name() const { return self_name; }
value_(bundle const& b, const QString& name) noexcept;
~value_() override;
- template<typename t>
- static constexpr auto value_changed()
- {
- return static_cast<signal_sig<t>>(&value_::valueChanged);
- }
-
static const bool TRACE_NOTIFY;
signals: