summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muse2/ChangeLog2
-rw-r--r--muse2/muse/arranger/alayout.cpp32
-rw-r--r--muse2/muse/arranger/alayout.h38
3 files changed, 57 insertions, 15 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index ffb91b58..30415c52 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -1,3 +1,5 @@
+07.11.2010
+ - Conversion of TLLayout class to QT4. (Tim)
06.11.2010
- Yipee! De retour aux les popup menus 'stay-open'. (Tim)
- Fixed PopupMenu class. All routing popups done (midi trackinfo, midi strip, audio strip).
diff --git a/muse2/muse/arranger/alayout.cpp b/muse2/muse/arranger/alayout.cpp
index 04665b24..5f6ec0d1 100644
--- a/muse2/muse/arranger/alayout.cpp
+++ b/muse2/muse/arranger/alayout.cpp
@@ -6,9 +6,10 @@
//=========================================================
#include "alayout.h"
-#include <qscrollbar.h>
+#include <QScrollBar>
+#include <QList>
//Added by qt3to4:
-#include <Q3PtrList>
+//#include <Q3PtrList>
#include "arranger.h"
@@ -26,6 +27,7 @@ void TLLayout::wadd(int idx, QWidget* w)
addItem(li[idx]);
}
+#if 0
//---------------------------------------------------------
// TLLayoutIterator
//---------------------------------------------------------
@@ -61,6 +63,8 @@ TLLayout::~TLLayout()
deleteAllItems();
}
+#endif
+
//---------------------------------------------------------
// setGeometry
// perform geometry management for tracklist:
@@ -159,3 +163,27 @@ QSize TLLayout::maximumSize() const
return QSize(440, 100000);
}
+//---------------------------------------------------------
+// takeAt
+//---------------------------------------------------------
+
+QLayoutItem* TLLayout::takeAt(int i)
+ {
+ if (i >= 0 && i < ilist.size())
+ return ilist.takeAt(i);
+ else
+ return 0;
+ }
+
+//---------------------------------------------------------
+// clear
+//---------------------------------------------------------
+
+void TLLayout::clear()
+ {
+ QLayoutItem* child;
+ while ((child = takeAt(0)) != 0) {
+ delete child->widget();
+ delete child;
+ }
+ }
diff --git a/muse2/muse/arranger/alayout.h b/muse2/muse/arranger/alayout.h
index 225a416f..ce863c26 100644
--- a/muse2/muse/arranger/alayout.h
+++ b/muse2/muse/arranger/alayout.h
@@ -8,11 +8,13 @@
#ifndef __ALAYOUT_H__
#define __ALAYOUT_H__
-#include <qlayout.h>
-#include <Q3PtrList>
+#include <QLayout>
+//#include <Q3PtrList>
+#include <QList>
class QScrollBar;
class WidgetStack;
+class QLayoutItem;
//---------------------------------------------------------
// TLLayout
@@ -23,26 +25,36 @@ class TLLayout : public QLayout
{
Q_OBJECT
- Q3PtrList<QLayoutItem> ilist;
+ //Q3PtrList<QLayoutItem> ilist;
+ QList<QLayoutItem*> ilist;
QLayoutItem* li[6];
QScrollBar* sb;
WidgetStack* stack;
public:
- TLLayout(QWidget *parent) : QLayout(parent, 0, -1) {}
- ~TLLayout();
+ //TLLayout(QWidget *parent) : QLayout(parent, 0, -1) {}
+ TLLayout(QWidget *parent) : QLayout(parent) { setMargin(0); setSpacing(0); }
+ ~TLLayout() { clear(); }
- void addItem(QLayoutItem *item);
+ void addItem(QLayoutItem *item) { ilist.append(item); }
+ Qt::Orientations expandingDirections() const { return 0; }
+ bool hasHeightForWidth() const { return false; }
+ int count() const { return ilist.size(); }
+ void clear();
void wadd(int idx, QWidget* w);
- virtual QSize sizeHint() const;
- virtual QSize minimumSize() const;
- virtual QSize maximumSize() const;
- QLayoutIterator iterator();
+ ///virtual QSize sizeHint() const;
+ ///virtual QSize minimumSize() const;
+ ///virtual QSize maximumSize() const;
+ QSize sizeHint() const;
+ QSize minimumSize() const;
+ QSize maximumSize() const;
+ ///QLayoutIterator iterator();
void setGeometry(const QRect &rect);
- virtual QLayoutItem* itemAt(int) const { return 0;} // ddskrjo, is pure virtual, overridden
- virtual QLayoutItem* takeAt(int) { return 0;} // ddskrjo, is pure virtual, overridden
- virtual int count() const { return ilist.count(); } // ddskrjo, is pure virtual, overridden
+ //virtual QLayoutItem* itemAt(int) const { return 0;} // ddskrjo, is pure virtual, overridden
+ virtual QLayoutItem* itemAt(int i) const { return ilist.value(i);}
+ virtual QLayoutItem* takeAt(int); // { return 0;} // ddskrjo, is pure virtual, overridden
+ ///virtual int count() const { return ilist.count(); } // ddskrjo, is pure virtual, overridden
};
#endif