summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2010-10-22 05:33:28 +0000
committerTim E. Real <termtech@rogers.com>2010-10-22 05:33:28 +0000
commitcdb70a764bc9683d93f64f2aac71b4fbaf610049 (patch)
tree93bbb5e3b6a85f686fb1a7d01b7d8c12bcc71f0b
parente81ee4e40e8f2b83e944ae7850fbff8ff13bfebe (diff)
See ChangeLog
-rw-r--r--muse2/ChangeLog1
-rw-r--r--muse2/muse/widgets/tb1.cpp56
-rw-r--r--muse2/muse/widgets/tb1.h9
3 files changed, 46 insertions, 20 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index e91586ec..461c40e7 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -1,4 +1,5 @@
21.10.2010 Toolbar1 usage of Q3ListBox changed to QTableWidget. (p4.0.3 Tim)
+ More Toolbar1 fixes. (p4.0.4 Tim)
20.10.2010
* Fixed: cmake should work now. (T356)
- Changed the QT4_WRAP_UI3 macro to generate <filename>.h instead of ui_<filename>.h
diff --git a/muse2/muse/widgets/tb1.cpp b/muse2/muse/widgets/tb1.cpp
index 0b1faac8..d2b9b4a7 100644
--- a/muse2/muse/widgets/tb1.cpp
+++ b/muse2/muse/widgets/tb1.cpp
@@ -9,11 +9,16 @@
#include <stdio.h>
#include <values.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <q3listbox.h>
-#include <qtoolbutton.h>
-#include <QTableWidget> // p4.0.3
+//#include <qlabel.h>
+//#include <qlayout.h>
+//#include <q3listbox.h>
+//#include <qtoolbutton.h>
+// p4.0.3
+#include <QLabel>
+#include <QLayout>
+#include <QToolButton>
+#include <QTableWidget>
+#include <QListWidget>
#include "config.h"
#include "lcombo.h"
@@ -53,10 +58,12 @@ static const char* quantStrings[] = {
//---------------------------------------------------------
Toolbar1::Toolbar1(Q3MainWindow* parent, int r, int q, bool sp)
- : Q3ToolBar(QString("Qant'n'Snap-tools"), parent)
+//Toolbar1::Toolbar1(QWidget* parent, int r, int q, bool sp) // p4.0.4
+ : Q3ToolBar(QString("Quant'n'Snap-tools"), parent)
+ //: QToolBar(QString("Qant'n'Snap-tools"), parent)
{
showPitch = sp;
- setHorizontalStretchable(false);
+ setHorizontalStretchable(false);
solo = new QToolButton(this);
solo->setText(tr("Solo"));
@@ -84,10 +91,23 @@ Toolbar1::Toolbar1(Q3MainWindow* parent, int r, int q, bool sp)
//Q3ListBox* rlist = new Q3ListBox(this);
//Q3ListBox* qlist = new Q3ListBox(this);
- QTableWidget* rlist = new QTableWidget(10, 3, this); // p4.0.3
- QTableWidget* qlist = new QTableWidget(8, 3, this); //
- rlist->setMinimumWidth(95);
- qlist->setMinimumWidth(95);
+ // p4.0.3
+ QTableWidget* rlist = new QTableWidget(10, 3, this);
+ QTableWidget* qlist = new QTableWidget(8, 3, this);
+ rlist->verticalHeader()->setDefaultSectionSize(22);
+ rlist->horizontalHeader()->setDefaultSectionSize(32);
+ rlist->setSelectionMode(QAbstractItemView::SingleSelection);
+ rlist->verticalHeader()->hide();
+ rlist->horizontalHeader()->hide();
+ qlist->verticalHeader()->setDefaultSectionSize(22);
+ qlist->horizontalHeader()->setDefaultSectionSize(32);
+ qlist->setSelectionMode(QAbstractItemView::SingleSelection);
+ qlist->verticalHeader()->hide();
+ qlist->horizontalHeader()->hide();
+
+ rlist->setMinimumWidth(96);
+ qlist->setMinimumWidth(96);
+
//raster->setListBox(rlist); ddskrjo
//quant->setListBox(qlist); ddskrjo
raster->setView(rlist); // p4.0.3
@@ -116,16 +136,22 @@ Toolbar1::Toolbar1(Q3MainWindow* parent, int r, int q, bool sp)
LabelCombo* to = new LabelCombo(tr("To"), this);
// Q3ListBox* toList = new Q3ListBox(this);
+ QListWidget* toList = new QListWidget(this); // p4.0.4
// //to->setListBox(toList); ddskrjo
+ to->setView(toList); // p4.0.4
+
// toList->insertItem(tr("All Events"), 0);
// toList->insertItem(tr("Looped Ev."), CMD_RANGE_LOOP);
// toList->insertItem(tr("Selected Ev."), CMD_RANGE_SELECTED);
// toList->insertItem(tr("Looped+Sel."), CMD_RANGE_LOOP | CMD_RANGE_SELECTED);
+ // p4.0.4
+ toList->insertItem(0, tr("All Events"));
+ toList->insertItem(CMD_RANGE_LOOP, tr("Looped Ev."));
+ toList->insertItem(CMD_RANGE_SELECTED, tr("Selected Ev."));
+ toList->insertItem(CMD_RANGE_LOOP | CMD_RANGE_SELECTED, tr("Looped+Sel."));
connect(raster, SIGNAL(activated(int)), SLOT(_rasterChanged(int)));
connect(quant, SIGNAL(activated(int)), SLOT(_quantChanged(int)));
- //connect(raster, SIGNAL(cellActivated(int, int)), SLOT(_rasterChanged(int, int))); // p4.0.3
- //connect(quant, SIGNAL(cellActivated(int, int)), SLOT(_quantChanged(int, int))); //
connect(to, SIGNAL(activated(int)), SIGNAL(toChanged(int)));
connect(solo, SIGNAL(toggled(bool)), SIGNAL(soloChanged(bool)));
pos->setEnabled(false);
@@ -136,10 +162,8 @@ Toolbar1::Toolbar1(Q3MainWindow* parent, int r, int q, bool sp)
//---------------------------------------------------------
void Toolbar1::_rasterChanged(int index)
-//void Toolbar1::_rasterChanged(int r, int c) // p4.0.3
{
emit rasterChanged(rasterTable[index]);
- //emit rasterChanged(rasterTable[r + c * 10]); // p4.0.3
}
//---------------------------------------------------------
@@ -147,10 +171,8 @@ void Toolbar1::_rasterChanged(int index)
//---------------------------------------------------------
void Toolbar1::_quantChanged(int index)
-//void Toolbar1::_quantChanged(int r, int c) // p4.0.3
{
emit quantChanged(quantTable[index]);
- //emit quantChanged(quantTable[r + c * 10]);
}
//---------------------------------------------------------
diff --git a/muse2/muse/widgets/tb1.h b/muse2/muse/widgets/tb1.h
index d971f9f9..40264abf 100644
--- a/muse2/muse/widgets/tb1.h
+++ b/muse2/muse/widgets/tb1.h
@@ -8,9 +8,12 @@
#ifndef __TB1_H__
#define __TB1_H__
-#include <qwidget.h>
+//#include <qwidget.h>
#include <q3toolbar.h>
+#include <QWidget> // p4.0.4
+//#include <QToolBar> //
+
class PosLabel;
class PitchLabel;
class Track;
@@ -22,6 +25,7 @@ class QToolButton;
//---------------------------------------------------------
class Toolbar1 : public Q3ToolBar {
+//class Toolbar1 : public QToolBar { // p4.0.4
QToolButton* solo;
PosLabel* pos;
PitchLabel* pitch;
@@ -44,13 +48,12 @@ class Toolbar1 : public Q3ToolBar {
signals:
void rasterChanged(int);
void quantChanged(int);
- //void rasterChanged(int, int); // p4.0.3
- //void quantChanged(int, int); //
void soloChanged(bool);
void toChanged(int);
public:
Toolbar1(Q3MainWindow* parent, int r=96,
+ //Toolbar1(QWidget* parent, int r=96, // p4.0.4
int q=96, bool showPitch=true);
void setSolo(bool val);
void setPitchMode(bool flag);