aerothemeplasma/kwin/decoration/breeze-v5.93.0/kstyle/animations/breezespinboxengine.cpp

31 lines
685 B
C++
Raw Normal View History

/*
* SPDX-FileCopyrightText: 2014 Hugo Pereira Da Costa <hugo.pereira@free.fr>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "breezespinboxengine.h"
#include <QEvent>
namespace Breeze
{
//____________________________________________________________
2024-08-09 01:20:25 +00:00
bool SpinBoxEngine::registerWidget(QObject *target)
{
2024-08-09 01:20:25 +00:00
if (!target) {
return false;
}
// create new data class
2024-08-09 01:20:25 +00:00
if (!_data.contains(target)) {
_data.insert(target, new SpinBoxData(this, target, duration()), enabled());
}
// connect destruction signal
2024-08-09 01:20:25 +00:00
connect(target, &QObject::destroyed, this, &SpinBoxEngine::unregisterWidget, Qt::UniqueConnection);
return true;
}
}