1 //////////////////////////////////////////////////////////////////////////////
2 // oxygenstackedwidgetengine.cpp
3 // stores event filters and maps widgets to animations
4 // -------------------
5 //
6 // SPDX-FileCopyrightText: 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
7 //
8 // SPDX-License-Identifier: MIT
9 //////////////////////////////////////////////////////////////////////////////
10 
11 #include "oxygenstackedwidgetengine.h"
12 
13 namespace Oxygen
14 {
15 
16     //____________________________________________________________
registerWidget(QStackedWidget * widget)17     bool StackedWidgetEngine::registerWidget( QStackedWidget* widget )
18     {
19 
20         if( !widget ) return false;
21         if( !_data.contains( widget ) ) { _data.insert( widget, new StackedWidgetData( this, widget, duration() ), enabled() ); }
22 
23         // connect destruction signal
24         disconnect( widget, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterWidget(QObject*)) );
25         connect( widget, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterWidget(QObject*)) );
26 
27         return true;
28 
29     }
30 
31 }
32