Mercurial > hg > easaier-soundaccess
view widgets/AudioFilterViewerWidget.cpp @ 73:a5d941805d45
widgets for the audio filter list
author | benoitrigolleau |
---|---|
date | Wed, 13 Jun 2007 14:07:29 +0000 |
parents | |
children | afcf540ae3a2 |
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 "data/model/LayerItemModel.h" #include "AudioFilterViewerWidget.h" #include <iostream> AudioFilterViewerWidget::AudioFilterViewerWidget(QWidget *parent) : QFrame(parent){ /* Init all variables*/ m_pushButtonCONFIG = new QPushButton; m_pushButtonUP = new QPushButton; m_pushButtonDOWN = new QPushButton; m_pushButtonREMOVE = new QPushButton; m_pushButtonNEW = new QPushButton; m_layoutACTION = new QHBoxLayout; m_layoutMAIN = new QVBoxLayout; m_widgetLIST = new ItemContainer(); /* set the correct widget parameters*/ m_pushButtonCONFIG->setMaximumSize(20,20); m_pushButtonCONFIG->setIcon(QIcon(":icons/layerViewer_btn_config.png")); m_pushButtonUP->setMaximumSize(20,20); m_pushButtonUP->setIcon(QIcon(":icons/layerViewer_btn_up.png")); m_pushButtonDOWN->setMaximumSize(20,20); m_pushButtonDOWN->setIcon(QIcon(":icons/layerViewer_btn_down.png")); m_pushButtonREMOVE->setMaximumSize(20,20); m_pushButtonREMOVE->setIcon(QIcon(":icons/layerViewer_btn_remove.png")); m_pushButtonNEW->setMaximumSize(20,20); m_pushButtonNEW->setIcon(QIcon(":icons/layerViewer_btn_new.png")); //the action one: m_layoutACTION->addWidget(m_pushButtonCONFIG); m_layoutACTION->addStretch(); m_layoutACTION->addWidget(m_pushButtonUP); m_layoutACTION->addWidget(m_pushButtonDOWN); m_layoutACTION->addWidget(m_pushButtonNEW); m_layoutACTION->addSpacing(10); m_layoutACTION->addWidget(m_pushButtonREMOVE); //the main one: m_layoutMAIN->addWidget(m_widgetLIST); m_layoutMAIN->addLayout(m_layoutACTION); /* connect pushButtons*/ connect(m_pushButtonUP,SIGNAL(clicked()),m_widgetLIST,SLOT(upCurrentItem())); connect(m_pushButtonDOWN,SIGNAL(clicked()),m_widgetLIST,SLOT(downCurrentItem())); connect(m_pushButtonCONFIG,SIGNAL(clicked()),m_widgetLIST,SLOT(openConfigBoxForCurrentItem())); connect(m_pushButtonREMOVE,SIGNAL(clicked()),this,SLOT(removeSelectedItemRequested())); /*connect the list of items */ connect(m_widgetLIST,SIGNAL(currentChanged(int)),this,SLOT(newItemSelected(int))); /*add the main layout in this widget*/ this->setLayout(m_layoutMAIN); this->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); this->setLineWidth(2); } void AudioFilterViewerWidget::addItem(ItemAudioFilterList *item){ m_widgetLIST->addItem(item); } void AudioFilterViewerWidget::removeAllItems(){ m_widgetLIST->removeAllItems(); } void AudioFilterViewerWidget::setCurrentIndex(int i){ } /************** SLOTS ********/ void AudioFilterViewerWidget::newItemSelected(int i){ emit currentChanged(i); } void AudioFilterViewerWidget::removeSelectedItemRequested(){ }