Isis 3.0 Programmer Reference
Back | Home
TableColumn.cpp
1 #include "TableColumn.h"
2 
3 #include <algorithm>
4 #include <iostream>
5 
6 #include <QString>
7 
8 
9 using std::swap;
10 
11 
12 namespace Isis {
13  namespace CnetViz {
14  TableColumn::TableColumn(QString text, bool m_readOnlyStatus,
15  bool affectsNetStructure) {
16  nullify();
17 
18  m_title = new QString(text);
19  m_visible = true;
20  m_readOnly = m_readOnlyStatus;
21  m_affectsNetworkStructure = affectsNetStructure;
22  m_ascendingSortOrder = true;
23  }
24 
25 
26  TableColumn::TableColumn(const TableColumn &other) {
27  nullify();
28 
29  m_title = new QString(*other.m_title);
30  m_visible = other.m_visible;
31  m_readOnly = other.m_readOnly;
32  m_width = other.m_width;
33  }
34 
35 
36  TableColumn::~TableColumn() {
37  delete m_title;
38  m_title = NULL;
39  }
40 
41 
42  QString TableColumn::getTitle() const {
43  return *m_title;
44  }
45 
46 
47  void TableColumn::setTitle(QString text) {
48  *m_title = text;
49  }
50 
51 
52  TableColumn &TableColumn::operator=(TableColumn other) {
53  swap(*m_title, *other.m_title);
54  swap(m_visible, other.m_visible);
55  swap(m_readOnly, other.m_readOnly);
56  swap(m_width, other.m_width);
57 
58  return *this;
59  }
60 
61 
62  bool TableColumn::isVisible() const {
63  return m_visible;
64  }
65 
66 
67  void TableColumn::setVisible(bool visibility) {
68  m_visible = visibility;
69  emit visibilityChanged();
70  }
71 
72 
73  int TableColumn::getWidth() const {
74  return m_width;
75  }
76 
77 
78  void TableColumn::setWidth(int newWidth) {
79  m_width = newWidth;
80  emit widthChanged();
81  }
82 
83 
84  bool TableColumn::isReadOnly() const {
85  return m_readOnly;
86  }
87 
88 
89  bool TableColumn::hasNetworkStructureEffect() const {
90  return m_affectsNetworkStructure;
91  }
92 
93 
94  bool TableColumn::sortAscending() const {
95  return m_ascendingSortOrder;
96  }
97 
98 
99  void TableColumn::setSortAscending(bool ascending) {
100  m_ascendingSortOrder = ascending;
101  emit sortOutDated();
102  }
103 
104 
105  void TableColumn::nullify() {
106  m_title = NULL;
107  }
108  }
109 }

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:30:22