comparison 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
comparison
equal deleted inserted replaced
72:9e1a46a72cde 73:a5d941805d45
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 Sound Access
5 EASAIER client application.
6 Silogic 2007. Benoit Rigolleau.
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of the
11 License, or (at your option) any later version. See the file
12 COPYING included with this distribution for more information.
13 */
14
15 //#include "data/model/LayerItemModel.h"
16 #include "AudioFilterViewerWidget.h"
17 #include <iostream>
18
19 AudioFilterViewerWidget::AudioFilterViewerWidget(QWidget *parent) : QFrame(parent){
20 /* Init all variables*/
21 m_pushButtonCONFIG = new QPushButton;
22 m_pushButtonUP = new QPushButton;
23 m_pushButtonDOWN = new QPushButton;
24 m_pushButtonREMOVE = new QPushButton;
25 m_pushButtonNEW = new QPushButton;
26
27 m_layoutACTION = new QHBoxLayout;
28 m_layoutMAIN = new QVBoxLayout;
29
30 m_widgetLIST = new ItemContainer();
31
32 /* set the correct widget parameters*/
33 m_pushButtonCONFIG->setMaximumSize(20,20);
34 m_pushButtonCONFIG->setIcon(QIcon(":icons/layerViewer_btn_config.png"));
35 m_pushButtonUP->setMaximumSize(20,20);
36 m_pushButtonUP->setIcon(QIcon(":icons/layerViewer_btn_up.png"));
37 m_pushButtonDOWN->setMaximumSize(20,20);
38 m_pushButtonDOWN->setIcon(QIcon(":icons/layerViewer_btn_down.png"));
39 m_pushButtonREMOVE->setMaximumSize(20,20);
40 m_pushButtonREMOVE->setIcon(QIcon(":icons/layerViewer_btn_remove.png"));
41 m_pushButtonNEW->setMaximumSize(20,20);
42 m_pushButtonNEW->setIcon(QIcon(":icons/layerViewer_btn_new.png"));
43
44 //the action one:
45 m_layoutACTION->addWidget(m_pushButtonCONFIG);
46 m_layoutACTION->addStretch();
47 m_layoutACTION->addWidget(m_pushButtonUP);
48 m_layoutACTION->addWidget(m_pushButtonDOWN);
49 m_layoutACTION->addWidget(m_pushButtonNEW);
50 m_layoutACTION->addSpacing(10);
51 m_layoutACTION->addWidget(m_pushButtonREMOVE);
52
53 //the main one:
54 m_layoutMAIN->addWidget(m_widgetLIST);
55 m_layoutMAIN->addLayout(m_layoutACTION);
56
57 /* connect pushButtons*/
58 connect(m_pushButtonUP,SIGNAL(clicked()),m_widgetLIST,SLOT(upCurrentItem()));
59 connect(m_pushButtonDOWN,SIGNAL(clicked()),m_widgetLIST,SLOT(downCurrentItem()));
60 connect(m_pushButtonCONFIG,SIGNAL(clicked()),m_widgetLIST,SLOT(openConfigBoxForCurrentItem()));
61 connect(m_pushButtonREMOVE,SIGNAL(clicked()),this,SLOT(removeSelectedItemRequested()));
62
63 /*connect the list of items */
64 connect(m_widgetLIST,SIGNAL(currentChanged(int)),this,SLOT(newItemSelected(int)));
65
66
67 /*add the main layout in this widget*/
68 this->setLayout(m_layoutMAIN);
69 this->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
70 this->setLineWidth(2);
71 }
72
73 void AudioFilterViewerWidget::addItem(ItemAudioFilterList *item){
74 m_widgetLIST->addItem(item);
75 }
76
77 void AudioFilterViewerWidget::removeAllItems(){
78 m_widgetLIST->removeAllItems();
79 }
80
81 void AudioFilterViewerWidget::setCurrentIndex(int i){
82
83 }
84
85 /************** SLOTS ********/
86 void AudioFilterViewerWidget::newItemSelected(int i){
87 emit currentChanged(i);
88 }
89
90 void AudioFilterViewerWidget::removeSelectedItemRequested(){
91
92 }