USGS

Isis 3.0 Object Programmers' Reference

Home

ImageGroupTreeWidgetItem.cpp
1 #include "ImageGroupTreeWidgetItem.h"
2 
3 #include <QDebug>
4 
5 #include "ImageList.h"
6 
7 namespace Isis {
8 
17  QTreeWidgetItem(parent, UserType) {
18  m_imageList = imageList;
19 
20  setText(0, m_imageList->name());
21  updateCount(m_imageList->count());
22  setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable);
23  setIcon(0, QIcon(":pictures"));
24 
25  connect(m_imageList, SIGNAL(destroyed(QObject *)), this, SLOT(deleteLater()));
26  connect(m_imageList, SIGNAL(countChanged(int)), this, SLOT(updateCount(int)));
27  }
28 
29 
30  ImageGroupTreeWidgetItem::~ImageGroupTreeWidgetItem() {
31  m_imageList = NULL;
32  }
33 
34 
35  ImageList *ImageGroupTreeWidgetItem::imageList() {
36  return m_imageList;
37  }
38 
39 
40  void ImageGroupTreeWidgetItem::selectionChanged() {
41  foreach (Image *image, *m_imageList) {
42  image->displayProperties()->setSelected(isSelected());
43  }
44  }
45 
46 
47  void ImageGroupTreeWidgetItem::updateCount(int newCount) {
48  setToolTip(0, tr("%1 Images").arg(newCount));
49  }
50 }