comparison view/Pane.cpp @ 172:d0b95a8cac96

* A start to a panner widget to go with thumbwheels
author Chris Cannam
date Wed, 18 Oct 2006 16:38:30 +0000
parents 793df5f0c6cb
children 9c40dc10c88c
comparison
equal deleted inserted replaced
171:78d523e8433e 172:d0b95a8cac96
31 //!!! for HUD -- pull out into a separate class 31 //!!! for HUD -- pull out into a separate class
32 #include <QFrame> 32 #include <QFrame>
33 #include <QGridLayout> 33 #include <QGridLayout>
34 #include <QPushButton> 34 #include <QPushButton>
35 #include "widgets/Thumbwheel.h" 35 #include "widgets/Thumbwheel.h"
36 #include "widgets/Panner.h"
36 37
37 using std::cerr; 38 using std::cerr;
38 using std::endl; 39 using std::endl;
39 40
40 Pane::Pane(QWidget *w) : 41 Pane::Pane(QWidget *w) :
82 layout->setMargin(0); 83 layout->setMargin(0);
83 layout->setSpacing(0); 84 layout->setSpacing(0);
84 m_headsUpDisplay->setLayout(layout); 85 m_headsUpDisplay->setLayout(layout);
85 86
86 m_hthumb = new Thumbwheel(Qt::Horizontal); 87 m_hthumb = new Thumbwheel(Qt::Horizontal);
87 layout->addWidget(m_hthumb, 1, 0); 88 layout->addWidget(m_hthumb, 1, 0, 2, 1);
88 m_hthumb->setFixedWidth(70); 89 m_hthumb->setFixedWidth(70);
89 m_hthumb->setFixedHeight(16); 90 m_hthumb->setFixedHeight(16);
90 m_hthumb->setDefaultValue(0); 91 m_hthumb->setDefaultValue(0);
91 m_hthumb->setSpeed(0.6); 92 m_hthumb->setSpeed(0.6);
92 connect(m_hthumb, SIGNAL(valueChanged(int)), this, 93 connect(m_hthumb, SIGNAL(valueChanged(int)), this,
93 SLOT(horizontalThumbwheelMoved(int))); 94 SLOT(horizontalThumbwheelMoved(int)));
94 95
96 m_vpan = new Panner;
97 layout->addWidget(m_vpan, 0, 1);
98 m_vpan->setFixedWidth(16);
99 m_vpan->setFixedHeight(70);
100
95 m_vthumb = new Thumbwheel(Qt::Vertical); 101 m_vthumb = new Thumbwheel(Qt::Vertical);
96 layout->addWidget(m_vthumb, 0, 1); 102 layout->addWidget(m_vthumb, 0, 2);
97 m_vthumb->setFixedWidth(16); 103 m_vthumb->setFixedWidth(16);
98 m_vthumb->setFixedHeight(70); 104 m_vthumb->setFixedHeight(70);
99 connect(m_vthumb, SIGNAL(valueChanged(int)), this, 105 connect(m_vthumb, SIGNAL(valueChanged(int)), this,
100 SLOT(verticalThumbwheelMoved(int))); 106 SLOT(verticalThumbwheelMoved(int)));
101 107
102 QPushButton *reset = new QPushButton; 108 QPushButton *reset = new QPushButton;
103 reset->setFixedHeight(16); 109 reset->setFixedHeight(16);
104 reset->setFixedWidth(16); 110 reset->setFixedWidth(16);
105 layout->addWidget(reset, 1, 1); 111 layout->addWidget(reset, 1, 2);
106 connect(reset, SIGNAL(clicked()), m_hthumb, SLOT(resetToDefault())); 112 connect(reset, SIGNAL(clicked()), m_hthumb, SLOT(resetToDefault()));
107 connect(reset, SIGNAL(clicked()), m_vthumb, SLOT(resetToDefault())); 113 connect(reset, SIGNAL(clicked()), m_vthumb, SLOT(resetToDefault()));
108 } 114 }
109 115
110 int count = 0; 116 int count = 0;