|
Packit |
8e9c33 |
//////////////////////////////////////////////////////////////////////////////
|
|
Packit |
8e9c33 |
// adwaitastackedwidgetengine.cpp
|
|
Packit |
8e9c33 |
// stores event filters and maps widgets to animations
|
|
Packit |
8e9c33 |
// -------------------
|
|
Packit |
8e9c33 |
//
|
|
Packit |
8e9c33 |
// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
|
|
Packit |
8e9c33 |
//
|
|
Packit |
8e9c33 |
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
Packit |
8e9c33 |
// of this software and associated documentation files (the "Software"), to
|
|
Packit |
8e9c33 |
// deal in the Software without restriction, including without limitation the
|
|
Packit |
8e9c33 |
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
Packit |
8e9c33 |
// sell copies of the Software, and to permit persons to whom the Software is
|
|
Packit |
8e9c33 |
// furnished to do so, subject to the following conditions:
|
|
Packit |
8e9c33 |
//
|
|
Packit |
8e9c33 |
// The above copyright notice and this permission notice shall be included in
|
|
Packit |
8e9c33 |
// all copies or substantial portions of the Software.
|
|
Packit |
8e9c33 |
//
|
|
Packit |
8e9c33 |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
Packit |
8e9c33 |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
Packit |
8e9c33 |
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
Packit |
8e9c33 |
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
Packit |
8e9c33 |
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
Packit |
8e9c33 |
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
Packit |
8e9c33 |
// IN THE SOFTWARE.
|
|
Packit |
8e9c33 |
//////////////////////////////////////////////////////////////////////////////
|
|
Packit |
8e9c33 |
|
|
Packit |
8e9c33 |
#include "adwaitastackedwidgetengine.h"
|
|
Packit |
8e9c33 |
|
|
Packit |
8e9c33 |
namespace Adwaita
|
|
Packit |
8e9c33 |
{
|
|
Packit |
8e9c33 |
|
|
Packit |
8e9c33 |
//____________________________________________________________
|
|
Packit |
8e9c33 |
bool StackedWidgetEngine::registerWidget( QStackedWidget* widget )
|
|
Packit |
8e9c33 |
{
|
|
Packit |
8e9c33 |
|
|
Packit |
8e9c33 |
if( !widget ) return false;
|
|
Packit |
8e9c33 |
if( !_data.contains( widget ) ) { _data.insert( widget, new StackedWidgetData( this, widget, duration() ), enabled() ); }
|
|
Packit |
8e9c33 |
|
|
Packit |
8e9c33 |
// connect destruction signal
|
|
Packit |
8e9c33 |
disconnect( widget, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterWidget(QObject*)) );
|
|
Packit |
8e9c33 |
connect( widget, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterWidget(QObject*)) );
|
|
Packit |
8e9c33 |
|
|
Packit |
8e9c33 |
return true;
|
|
Packit |
8e9c33 |
|
|
Packit |
8e9c33 |
}
|
|
Packit |
8e9c33 |
|
|
Packit |
8e9c33 |
}
|