summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2010-11-07 22:22:05 +0000
committerTim E. Real <termtech@rogers.com>2010-11-07 22:22:05 +0000
commit990e587a24686c77f63b9f7d280e3d16ac9d7626 (patch)
treefae91c73b60b9dfb768d26c679452ef2cc7295e3 /muse2/muse
parent4ea1c4ed67ee6fd46dbe393d05b7d835e3a33299 (diff)
Conversion of TLLayout class to QT4.
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/arranger/alayout.cpp32
-rw-r--r--muse2/muse/arranger/alayout.h38
2 files changed, 55 insertions, 15 deletions
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