summaryrefslogtreecommitdiffhomepage
path: root/options/value.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-06 18:34:03 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-10 10:31:58 +0200
commit61884594ceff59279abe5530c8c1af1870dc8fbb (patch)
treec896d862a5dee2ea1647ab9f68961381339fc669 /options/value.hpp
parent4ad996e116e78dd5f03c1ec47df2d380f6e23a68 (diff)
Revert "options/value: add `QObject::connect` wrapper"
This reverts commit a67e8630caf20e7f48151024e9e68dd9271d75c7.
Diffstat (limited to 'options/value.hpp')
-rw-r--r--options/value.hpp21
1 files changed, 1 insertions, 20 deletions
diff --git a/options/value.hpp b/options/value.hpp
index c752d497..dacd0ea9 100644
--- a/options/value.hpp
+++ b/options/value.hpp
@@ -26,10 +26,10 @@ namespace options::detail {
{
t x;
public:
+ constexpr t const* operator->() const { return &x; }
constexpr t* operator->() { return &x; }
constexpr explicit dereference_wrapper(t&& x) : x(x) {}
};
- template<typename t, typename...> /*MSVC workaround*/ static constexpr bool is_enum_v = std::is_enum_v<t>;
} // ns options::detail
namespace options {
@@ -85,9 +85,6 @@ class value final : public value_
}
public:
- using signal_sig = typename value_::signal_sig_<t>;
- using slot_sig = typename value_::slot_sig_<t>;
-
QVariant get_variant() const noexcept override
{
if (QVariant ret{b->get_variant(self_name)}; ret.isValid() && !ret.isNull())
@@ -197,22 +194,6 @@ public:
{
return static_cast<u>(get());
}
-
- template<typename Q, typename F>
- QMetaObject::Connection
- connect_to(Q* qobject, F&& writer, Qt::ConnectionType conn = Qt::QueuedConnection) {
- return QObject::connect(this, static_cast<signal_sig>(&value<t>::valueChanged), qobject, std::forward<F>(writer), conn);
- }
- template<typename Q, typename F>
- QMetaObject::Connection
- connect_from(Q* qobject, F&& reader, Qt::ConnectionType conn = Qt::DirectConnection) {
- return QObject::connect(qobject, std::forward<F>(reader), this, static_cast<slot_sig>(&value<t>::setValue), conn);
- }
- template<typename Q, typename F, typename G>
- QMetaObject::Connection
- connect_from(Q* qobject, F&& reader, G&& fn, Qt::ConnectionType conn = Qt::DirectConnection) {
- return QObject::connect(qobject, std::forward<F>(reader), this, std::forward<G>(fn), conn);
- }
};
#if !defined OTR_OPTIONS_INST_VALUE