mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 11:04:25 -04:00
Implement native toolbars on macos on Qt6 to have a modern looking unified toolbars
This commit is contained in:
25
third_party/KDToolBox/KDSignalThrottler.cpp
vendored
25
third_party/KDToolBox/KDSignalThrottler.cpp
vendored
@ -180,4 +180,29 @@ KDSignalLeadingDebouncer::KDSignalLeadingDebouncer(QObject *parent)
|
||||
|
||||
KDSignalLeadingDebouncer::~KDSignalLeadingDebouncer() = default;
|
||||
|
||||
|
||||
KDStringSignalDebouncer::KDStringSignalDebouncer(QObject *parent)
|
||||
: QObject(parent), m_debouncer(KDGenericSignalThrottler::Kind::Debouncer,
|
||||
KDGenericSignalThrottler::EmissionPolicy::Trailing,
|
||||
parent)
|
||||
{
|
||||
connect(&m_debouncer, &KDGenericSignalThrottler::triggered,
|
||||
this, [=] {
|
||||
emit triggered(this->value);
|
||||
});
|
||||
}
|
||||
|
||||
void KDStringSignalDebouncer::setTimeout(int msec) {
|
||||
m_debouncer.setTimeout(msec);
|
||||
}
|
||||
|
||||
int KDStringSignalDebouncer::timeout() const {
|
||||
return m_debouncer.timeout();
|
||||
}
|
||||
|
||||
void KDStringSignalDebouncer::throttle(QString value) {
|
||||
this->value = value;
|
||||
m_debouncer.throttle();
|
||||
}
|
||||
|
||||
} // namespace KDToolBox
|
||||
|
Reference in New Issue
Block a user