comparison widgets/LayerTree.h @ 374:64e84e5efb76 spectrogram-cache-rejig

* Merge from trunk
author Chris Cannam
date Wed, 27 Feb 2008 11:59:42 +0000
parents 226cb289bdf4
children 1d85aa5a49be
comparison
equal deleted inserted replaced
332:6440e280122e 374:64e84e5efb76
17 #ifndef _LAYER_TREE_H_ 17 #ifndef _LAYER_TREE_H_
18 #define _LAYER_TREE_H_ 18 #define _LAYER_TREE_H_
19 19
20 #include <QAbstractItemModel> 20 #include <QAbstractItemModel>
21 21
22 #include <set>
23
22 class PaneStack; 24 class PaneStack;
23 class View; 25 class View;
26 class Pane;
24 class Layer; 27 class Layer;
25 class PropertyContainer; 28 class PropertyContainer;
29 class Model;
30
31 class ModelDataModel : public QAbstractItemModel
32 {
33 Q_OBJECT
34
35 public:
36 ModelDataModel(PaneStack *stack, bool waveModelsOnly, QObject *parent = 0);
37 virtual ~ModelDataModel();
38
39 QVariant data(const QModelIndex &index, int role) const;
40
41 bool setData(const QModelIndex &index, const QVariant &value, int role);
42
43 Qt::ItemFlags flags(const QModelIndex &index) const;
44
45 QVariant headerData(int section, Qt::Orientation orientation,
46 int role = Qt::DisplayRole) const;
47
48 QModelIndex index(int row, int column,
49 const QModelIndex &parent = QModelIndex()) const;
50
51 QModelIndex parent(const QModelIndex &index) const;
52
53 int rowCount(const QModelIndex &parent = QModelIndex()) const;
54 int columnCount(const QModelIndex &parent = QModelIndex()) const;
55
56 protected slots:
57 void paneAdded();
58 void paneDeleted();
59 void propertyContainerAdded(PropertyContainer *);
60 void propertyContainerRemoved(PropertyContainer *);
61 void propertyContainerSelected(PropertyContainer *);
62 void propertyContainerPropertyChanged(PropertyContainer *);
63 void playParametersAudibilityChanged(bool);
64 void paneLayerModelChanged();
65 void rebuildModelSet();
66
67 protected:
68 PaneStack *m_stack;
69 bool m_waveModelsOnly;
70 int m_modelTypeColumn;
71 int m_modelNameColumn;
72 int m_modelMakerColumn;
73 int m_modelSourceColumn;
74 int m_columnCount;
75
76 std::set<Model *> m_models;
77 };
26 78
27 class LayerTreeModel : public QAbstractItemModel 79 class LayerTreeModel : public QAbstractItemModel
28 { 80 {
29 Q_OBJECT 81 Q_OBJECT
30 82
47 QModelIndex parent(const QModelIndex &index) const; 99 QModelIndex parent(const QModelIndex &index) const;
48 100
49 int rowCount(const QModelIndex &parent = QModelIndex()) const; 101 int rowCount(const QModelIndex &parent = QModelIndex()) const;
50 int columnCount(const QModelIndex &parent = QModelIndex()) const; 102 int columnCount(const QModelIndex &parent = QModelIndex()) const;
51 103
52 protected:
53 PaneStack *m_stack;
54
55 protected slots: 104 protected slots:
105 void paneAdded();
106 void paneAboutToBeDeleted(Pane *);
56 void propertyContainerAdded(PropertyContainer *); 107 void propertyContainerAdded(PropertyContainer *);
57 void propertyContainerRemoved(PropertyContainer *); 108 void propertyContainerRemoved(PropertyContainer *);
58 void propertyContainerSelected(PropertyContainer *); 109 void propertyContainerSelected(PropertyContainer *);
59 void propertyContainerPropertyChanged(PropertyContainer *); 110 void propertyContainerPropertyChanged(PropertyContainer *);
111 void paneLayerModelChanged();
60 void playParametersAudibilityChanged(bool); 112 void playParametersAudibilityChanged(bool);
113
114 protected:
115 PaneStack *m_stack;
116 std::set<QObject *> m_deletedPanes;
117 int m_layerNameColumn;
118 int m_layerVisibleColumn;
119 int m_layerPlayedColumn;
120 int m_modelNameColumn;
121 int m_columnCount;
61 }; 122 };
62 123
63 #endif 124 #endif