File indexing completed on 2024-05-12 05:28:39
0001 /* 0002 * SPDX-FileCopyrightText: 2014 Hugo Pereira Da Costa <hugo.pereira@free.fr> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "breezetoolboxengine.h" 0008 0009 namespace Breeze 0010 { 0011 //____________________________________________________________ 0012 bool ToolBoxEngine::registerWidget(QWidget *widget) 0013 { 0014 if (!widget) { 0015 return false; 0016 } 0017 if (!_data.contains(widget)) { 0018 _data.insert(widget, new WidgetStateData(this, widget, duration()), enabled()); 0019 } 0020 0021 // connect destruction signal 0022 connect(widget, &QObject::destroyed, this, &ToolBoxEngine::unregisterWidget, Qt::UniqueConnection); 0023 return true; 0024 } 0025 0026 //____________________________________________________________ 0027 bool ToolBoxEngine::updateState(const QPaintDevice *object, bool value) 0028 { 0029 const QPointer<WidgetStateData> data = ToolBoxEngine::data(object); 0030 return (data && data.data()->updateState(value)); 0031 } 0032 0033 //____________________________________________________________ 0034 bool ToolBoxEngine::isAnimated(const QPaintDevice *object) 0035 { 0036 const QPointer<WidgetStateData> data = ToolBoxEngine::data(object); 0037 return (data && data.data()->animation() && data.data()->animation().data()->isRunning()); 0038 } 0039 0040 }