annotate widgets/LayerTree.h @ 298:226cb289bdf4

* Layer tree view updating when visibility / audibility changed (and layers updating when they are changed in view) -- still some problems when a model is loaded while the tree is visible * FFTW_MEASURE throughout -- it does turn out to make an appreciable difference sometimes
author Chris Cannam
date Thu, 16 Aug 2007 16:47:07 +0000
parents 705f05ab42e3
children 4a542ba875c2
rev   line source
Chris@43 1
Chris@58 2 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@43 3
Chris@43 4 /*
Chris@59 5 Sonic Visualiser
Chris@59 6 An audio file viewer and annotation editor.
Chris@59 7 Centre for Digital Music, Queen Mary, University of London.
Chris@59 8 This file copyright 2006 Chris Cannam.
Chris@43 9
Chris@59 10 This program is free software; you can redistribute it and/or
Chris@59 11 modify it under the terms of the GNU General Public License as
Chris@59 12 published by the Free Software Foundation; either version 2 of the
Chris@59 13 License, or (at your option) any later version. See the file
Chris@59 14 COPYING included with this distribution for more information.
Chris@43 15 */
Chris@43 16
Chris@43 17 #ifndef _LAYER_TREE_H_
Chris@43 18 #define _LAYER_TREE_H_
Chris@43 19
Chris@43 20 #include <QAbstractItemModel>
Chris@43 21
Chris@43 22 class PaneStack;
Chris@56 23 class View;
Chris@56 24 class Layer;
Chris@298 25 class PropertyContainer;
Chris@43 26
Chris@43 27 class LayerTreeModel : public QAbstractItemModel
Chris@43 28 {
Chris@43 29 Q_OBJECT
Chris@43 30
Chris@43 31 public:
Chris@43 32 LayerTreeModel(PaneStack *stack, QObject *parent = 0);
Chris@43 33 virtual ~LayerTreeModel();
Chris@43 34
Chris@43 35 QVariant data(const QModelIndex &index, int role) const;
Chris@43 36
Chris@298 37 bool setData(const QModelIndex &index, const QVariant &value, int role);
Chris@298 38
Chris@56 39 Qt::ItemFlags flags(const QModelIndex &index) const;
Chris@43 40
Chris@56 41 QVariant headerData(int section, Qt::Orientation orientation,
Chris@56 42 int role = Qt::DisplayRole) const;
Chris@43 43
Chris@43 44 QModelIndex index(int row, int column,
Chris@43 45 const QModelIndex &parent = QModelIndex()) const;
Chris@43 46
Chris@43 47 QModelIndex parent(const QModelIndex &index) const;
Chris@43 48
Chris@43 49 int rowCount(const QModelIndex &parent = QModelIndex()) const;
Chris@43 50 int columnCount(const QModelIndex &parent = QModelIndex()) const;
Chris@43 51
Chris@43 52 protected:
Chris@43 53 PaneStack *m_stack;
Chris@298 54
Chris@298 55 protected slots:
Chris@298 56 void propertyContainerAdded(PropertyContainer *);
Chris@298 57 void propertyContainerRemoved(PropertyContainer *);
Chris@298 58 void propertyContainerSelected(PropertyContainer *);
Chris@298 59 void propertyContainerPropertyChanged(PropertyContainer *);
Chris@298 60 void playParametersAudibilityChanged(bool);
Chris@43 61 };
Chris@43 62
Chris@43 63 #endif