Mercurial > hg > easaier-soundaccess
view widgets/MultiPaneLayerContainer.cpp @ 68:77e1fa5497e7
MultiPaneLayerContainer (manage several panes in the layer list) is added
author | benoitrigolleau |
---|---|
date | Wed, 13 Jun 2007 09:35:02 +0000 |
parents | |
children | c70c6b99d871 |
line wrap: on
line source
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ /* Sound Access EASAIER client application. Silogic 2007. Benoit Rigolleau. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See the file COPYING included with this distribution for more information. */ #include "MultiPaneLayerContainer.h" MultiPaneLayerContainer::MultiPaneLayerContainer(QWidget *parent): QWidget(parent){ m_map = new QMap<Pane*,PropertyStack*>(); m_layout = new QVBoxLayout; this->setLayout(m_layout); } MultiPaneLayerContainer::~MultiPaneLayerContainer(){ } void MultiPaneLayerContainer::addPane(Pane *pane){ PropertyStack *propertyStack = new PropertyStack(0, pane); connect(propertyStack, SIGNAL(removeSelectedItem()), this, SIGNAL(removeSelectedItem())); m_map->insert(pane,propertyStack); m_layout->addWidget(propertyStack); m_layout->setMargin(0); m_layout->setSpacing(0); } void MultiPaneLayerContainer::removePane(Pane *pane){ m_layout->removeWidget(m_map->value(pane)); delete m_map->value(pane); m_map->remove(pane); } //////////////////SLOTS /////////////////////// void MultiPaneLayerContainer::currentPaneChanged(Pane *pane){ QMap<Pane*,PropertyStack*>::Iterator it; for (it = m_map->begin(); it != m_map->end(); ++it ) { m_map->value(it.key())->setVisible(false); } if(m_map->contains(pane)){ m_map->value(pane)->setVisible(true); } } void MultiPaneLayerContainer::paneAdded(Pane *pane){ addPane(pane); } void MultiPaneLayerContainer::paneRemoved(Pane *pane){ removePane(pane); }