Mercurial > hg > svgui
comparison widgets/LayerTree.cpp @ 271:1a49bd0d8375
* Change a number of keyboard shortcuts -- get rid of all the Alt+ shortcuts
and introduce a few more Ctrl+ ones instead, as well as a number of plain
single keypresses
* Add Playback menu
* Add time-ruler support for snap to feature, use it in ffwd/rewind
(rewind still needs fixing)
* restore layer hierarchy window prior to making it work correctly
author | Chris Cannam |
---|---|
date | Thu, 28 Jun 2007 14:50:58 +0000 |
parents | 33929e0c3c6b |
children | 8acd30ed735c |
comparison
equal
deleted
inserted
replaced
270:61a704654497 | 271:1a49bd0d8375 |
---|---|
25 | 25 |
26 | 26 |
27 class ViewObjectAssoc : public QObject | 27 class ViewObjectAssoc : public QObject |
28 { | 28 { |
29 public: | 29 public: |
30 ViewObjectAssoc(QObject *parent, View *v, QObject *o) : | 30 ViewObjectAssoc(View *v, QObject *o) : |
31 QObject(parent), view(v), object(o) { | 31 QObject(0), view(v), object(o) { |
32 ++extantCount; | 32 ++extantCount; |
33 std::cerr << "ViewObjectAssoc (now " << extantCount << " extant)" | |
34 << std::endl; | |
33 } | 35 } |
34 | 36 |
35 virtual ~ViewObjectAssoc() { | 37 virtual ~ViewObjectAssoc() { |
36 std::cerr << "~ViewObjectAssoc (now " << --extantCount << " extant)" | 38 std::cerr << "~ViewObjectAssoc (now " << --extantCount << " extant)" |
37 << std::endl; | 39 << std::endl; |
48 | 50 |
49 LayerTreeModel::LayerTreeModel(PaneStack *stack, QObject *parent) : | 51 LayerTreeModel::LayerTreeModel(PaneStack *stack, QObject *parent) : |
50 QAbstractItemModel(parent), | 52 QAbstractItemModel(parent), |
51 m_stack(stack) | 53 m_stack(stack) |
52 { | 54 { |
55 connect(stack, SIGNAL(paneAdded()), this, SIGNAL(layoutChanged())); | |
56 connect(stack, SIGNAL(paneDeleted()), this, SIGNAL(layoutChanged())); | |
53 } | 57 } |
54 | 58 |
55 LayerTreeModel::~LayerTreeModel() | 59 LayerTreeModel::~LayerTreeModel() |
56 { | 60 { |
57 } | 61 } |
154 if (row < pane->getLayerCount()) { | 158 if (row < pane->getLayerCount()) { |
155 Layer *layer = pane->getLayer(row); | 159 Layer *layer = pane->getLayer(row); |
156 if (column == 0) { | 160 if (column == 0) { |
157 std::cerr << "parent is pane, returning layer" << std::endl; | 161 std::cerr << "parent is pane, returning layer" << std::endl; |
158 ViewObjectAssoc *assoc = new ViewObjectAssoc | 162 ViewObjectAssoc *assoc = new ViewObjectAssoc |
159 (const_cast<LayerTreeModel *>(this), pane, layer); | 163 // (const_cast<LayerTreeModel *>(this), pane, layer); |
164 (pane, layer); | |
160 return createIndex(row, column, assoc); | 165 return createIndex(row, column, assoc); |
161 } else { | 166 } else { |
162 std::cerr << "parent is pane, column != 0, returning model" << std::endl; | 167 std::cerr << "parent is pane, column != 0, returning model" << std::endl; |
163 ViewObjectAssoc *assoc = new ViewObjectAssoc | 168 ViewObjectAssoc *assoc = new ViewObjectAssoc |
164 (const_cast<LayerTreeModel *>(this), pane, layer->getModel()); | 169 // (const_cast<LayerTreeModel *>(this), pane, layer->getModel()); |
170 (pane, layer->getModel()); | |
165 return createIndex(row, column, assoc); | 171 return createIndex(row, column, assoc); |
166 } | 172 } |
167 } | 173 } |
168 } | 174 } |
169 | 175 |