3 #include "TableViewContent.h" 9 #include <QApplication> 13 #include <QMessageBox> 16 #include <QPaintEvent> 21 #include <QStyleOptionViewItemV4> 23 #include <QVBoxLayout> 29 #include "AbstractTableDelegate.h" 30 #include "AbstractTableModel.h" 31 #include "AbstractTreeItem.h" 32 #include "TableColumn.h" 33 #include "TableColumnList.h" 47 connect(m_model, SIGNAL(modelModified()),
this, SLOT(
refresh()));
48 connect(m_model, SIGNAL(filterProgressChanged(
int)),
50 connect(
this, SIGNAL(modelDataChanged()),
51 m_model, SLOT(applyFilter()));
59 m_columns =
getModel()->getColumns();
60 for (
int i = 0; i < m_columns->size(); i++) {
63 connect(column, SIGNAL(visibilityChanged()),
this, SLOT(
refresh()));
64 connect(column, SIGNAL(visibilityChanged()),
66 connect(column, SIGNAL(widthChanged()),
this, SLOT(
refresh()));
74 m_lastShiftArrowSelectedCell->first = NULL;
76 verticalScrollBar()->setSingleStep(1);
78 m_rowHeight = QFontMetrics(font()).height() + ITEM_PADDING;
79 ASSERT(m_rowHeight > 0);
81 connect(horizontalScrollBar(), SIGNAL(valueChanged(
int)),
82 this, SIGNAL(horizontalScrollBarValueChanged(
int)));
84 setMouseTracking(
true);
89 setContextMenuPolicy(Qt::CustomContextMenu);
90 connect(
this, SIGNAL(customContextMenuRequested(QPoint)),
93 m_activeControlNet =
false;
110 delete m_lastShiftSelection;
111 m_lastShiftSelection = NULL;
125 delete m_lastShiftArrowSelectedCell;
126 m_lastShiftArrowSelectedCell = NULL;
138 return QWidget::minimumSizeHint();
209 m_activeControlNet = activeNet;
218 if (!m_model->isFiltering()) {
219 int rowCount = m_model->getVisibleRowCount();
220 verticalScrollBar()->setRange(0, qMax(rowCount - 1, 0));
225 m_lastShiftSelection->clear();
227 if (m_model->getSelectedItems().size() &&
233 viewport()->update();
247 for (
int i = 0; i < visibleCols.size(); i++)
248 range += visibleCols[i]->getWidth() - 1;
252 horizontalScrollBar()->setRange(0, range - viewport()->width());
253 horizontalScrollBar()->setPageStep(viewport()->width());
256 horizontalScrollBar()->setValue(horizontalScrollBar()->maximum());
268 if (newlySelectedItems.size())
269 scrollTo(newlySelectedItems.last());
279 int row =
getModel()->indexOfVisibleItem(newlySelectedItem);
282 int topRow = verticalScrollBar()->value();
285 verticalScrollBar()->setValue(row);
288 int wholeVisibleRowCount = viewport()->height() / m_rowHeight;
289 int bottomRow = topRow + wholeVisibleRowCount;
291 verticalScrollBar()->setValue(row - wholeVisibleRowCount + 1);
295 viewport()->update();
308 return QObject::eventFilter(target, event);
318 if (event->buttons() & Qt::LeftButton) {
319 int rowNum =
event->pos().y() / m_rowHeight;
321 if (m_activeCell->first &&
cellIsEditable(rowNum, m_activeCell->second)) {
324 m_columns->getVisibleColumns()[m_activeCell->second];
328 m_editWidget = delegate->getWidget(col);
329 delegate->readData(m_editWidget, m_activeCell->first, col);
330 m_editWidget->setParent(
this);
331 m_editWidget->setFocus(Qt::OtherFocusReason);
334 viewport()->update();
346 if (event->buttons() & Qt::LeftButton) {
348 if (!(event->modifiers() & Qt::ShiftModifier))
351 int rowNum =
event->pos().y() / m_rowHeight;
361 if (rowNum >= 0 && rowNum < m_items->size() && m_activeCell->first) {
366 m_model->setGlobalSelection(
false);
369 if (event->modifiers() & Qt::ControlModifier) {
376 m_lastShiftSelection->clear();
379 if (event->modifiers() & Qt::ShiftModifier) {
387 m_lastShiftSelection->clear();
394 if (rowNum >= 0 && rowNum < m_items->size()) {
397 if (columnNum != -1) {
398 TableColumn *column = m_columns->getVisibleColumns()[columnNum];
399 if (column->getTitle().isEmpty()) {
405 if (event->modifiers() & Qt::ControlModifier) {
406 if (item->getPointerType() == AbstractTreeItem::Measure)
407 item->parent()->setSelected(!item->isSelected());
409 item->setSelected(!item->isSelected());
411 newlySelectedItems.append(item);
414 if (event->modifiers() & Qt::ShiftModifier) {
419 m_model->getSelectedItems();
422 if (selectedItem->getPointerType() ==
423 AbstractTreeItem::Measure)
424 selectedItem->parent()->setSelected(
false);
427 m_model->setGlobalSelection(
false);
429 if (item->getPointerType() == AbstractTreeItem::Measure)
430 item->parent()->setSelected(
true);
432 item->setSelected(
true);
434 newlySelectedItems.append(item);
439 newlySelectedItems.clear();
441 newlySelectedItems.append(i);
442 if (i->getPointerType() == AbstractTreeItem::Point) {
444 child->setSelected(
true);
445 newlySelectedItems.append(child);
450 emit tableSelectionChanged(newlySelectedItems);
459 viewport()->update();
460 emit tableSelectionChanged();
481 if (event->buttons() & Qt::LeftButton) {
482 int rowNum =
event->pos().y() / m_rowHeight;
485 int yPos =
event->pos().y();
486 if (yPos >= 0 && rowNum < m_items->size() && m_activeCell->first) {
495 if (yPos >= 0 && rowNum < m_items->size()) {
500 if (columnNum != -1) {
507 newlySelectedItems.append(i);
508 if (i->getPointerType() == AbstractTreeItem::Point) {
510 child->setSelected(
true);
511 newlySelectedItems.append(child);
516 emit tableSelectionChanged(newlySelectedItems);
521 QScrollBar *vertScroll = verticalScrollBar();
523 if (yPos > viewport()->height() &&
524 vertScroll->value() < vertScroll->maximum()) {
526 vertScroll->setValue(vertScroll->value() + 1);
529 if (yPos < 0 && vertScroll->value() > vertScroll->minimum())
530 vertScroll->setValue(vertScroll->value() - 1);
533 viewport()->update();
534 emit tableSelectionChanged();
556 Qt::Key key = (Qt::Key) event->key();
559 if (key == Qt::Key_A && event->modifiers() == Qt::ControlModifier) {
562 m_model->setGlobalSelection(
true);
563 viewport()->update();
565 emit tableSelectionChanged();
569 else if (key == Qt::Key_Escape) {
573 setFocus(Qt::ActiveWindowFocusReason);
574 viewport()->update();
579 else if (key == Qt::Key_Delete) {
585 else if (key == Qt::Key_Return || key == Qt::Key_Enter) {
591 else if (key == Qt::Key_Tab) {
597 else if (key == Qt::Key_Up || key == Qt::Key_Down ||
598 key == Qt::Key_Left || key == Qt::Key_Right) {
601 if (m_items && m_items->size()) {
602 m_activeCell->first = (*m_items)[0];
603 m_activeCell->second = 1;
609 ASSERT(m_items->size());
612 if (key == Qt::Key_Up && event->modifiers() == Qt::ShiftModifier) {
613 ASSERT(m_lastShiftArrowSelectedCell);
616 m_lastShiftArrowSelectedCell->first : m_activeCell->first;
618 int prevCellIndex =
getModel()->indexOfVisibleItem(prevCell);
620 if (prevCellIndex > 0) {
622 getModel()->getItems(prevCellIndex - 1, prevCellIndex);
624 if (itemList.size()) {
628 curItem == m_activeCell->first)
633 if (curItem == m_activeCell->first)
634 m_lastShiftArrowSelectedCell->first = NULL;
636 m_lastShiftArrowSelectedCell->first = curItem;
637 m_lastShiftArrowSelectedCell->second = m_activeCell->second;
640 int m_itemsPrevIndex = m_items->indexOf(prevCell);
641 int m_itemsCurIndex = m_items->indexOf(curItem);
642 if (m_itemsCurIndex == -1) {
643 if (m_itemsPrevIndex == 0) {
644 verticalScrollBar()->setValue(qMax(0, prevCellIndex - 1));
653 viewport()->update();
659 else if (key == Qt::Key_Down && event->modifiers() == Qt::ShiftModifier) {
661 m_lastShiftArrowSelectedCell->first : m_activeCell->first;
663 int prevCellIndex =
getModel()->indexOfVisibleItem(prevCell);
665 if (prevCellIndex >= 0 &&
666 prevCellIndex <
getModel()->getVisibleRowCount() - 1) {
668 getModel()->getItems(prevCellIndex + 1, prevCellIndex + 2);
670 if (itemList.size()) {
674 curItem == m_activeCell->first)
679 if (curItem == m_activeCell->first)
680 m_lastShiftArrowSelectedCell->first = NULL;
682 m_lastShiftArrowSelectedCell->first = curItem;
683 m_lastShiftArrowSelectedCell->second = m_activeCell->second;
684 viewport()->update();
687 int m_itemsPrevIndex = m_items->indexOf(prevCell);
688 int m_itemsCurIndex = m_items->indexOf(curItem);
689 if (m_itemsCurIndex == -1) {
690 if (m_itemsPrevIndex == m_items->size() - 1) {
691 int visibleItemCount =
getModel()->getVisibleRowCount();
692 verticalScrollBar()->setValue(qMin(visibleItemCount,
693 getModel()->indexOfVisibleItem(m_items->at(1))));
706 else if (key == Qt::Key_Up) {
711 else if (key == Qt::Key_Down) {
716 else if (key == Qt::Key_Left) {
721 else if (key == Qt::Key_Right) {
731 if (!m_items->contains(m_activeCell->first))
734 ASSERT(m_items->contains(m_activeCell->first));
736 if (m_items->contains(m_activeCell->first) &&
738 m_activeCell->second)) {
741 m_columns->getVisibleColumns()[m_activeCell->second];
745 m_editWidget = delegate->getWidget(col);
746 delegate->readData(m_editWidget, m_activeCell->first, col, event->text());
747 m_editWidget->setParent(
this);
748 m_editWidget->setFocus(Qt::OtherFocusReason);
751 viewport()->update();
763 m_columns->getVisibleColumns()[m_activeCell->second];
764 getModel()->getDelegate()->saveData(
765 m_editWidget, m_activeCell->first, col);
770 setFocus(Qt::ActiveWindowFocusReason);
779 int activeIndex = m_items->indexOf(m_activeCell->first);
780 if (activeIndex != -1) {
781 if (activeIndex == 0) {
782 int row = qMax(0,
getModel()->indexOfVisibleItem(
783 m_activeCell->first) - 1);
785 verticalScrollBar()->setValue(row);
788 m_activeCell->first = (*m_items)[qMax(0, activeIndex - 1)];
790 viewport()->update();
799 int activeIndex = m_items->indexOf(m_activeCell->first);
800 if (activeIndex != -1) {
801 if (activeIndex == m_items->size() - 1) {
802 int row = qMin(
getModel()->getVisibleRowCount() - 1,
803 getModel()->indexOfVisibleItem(m_items->at(0)));
805 verticalScrollBar()->setValue(row + 1);
806 activeIndex = m_items->indexOf(m_activeCell->first);
809 m_activeCell->first = (*m_items)[qMin(activeIndex + 1, m_items->size() - 1)];
811 viewport()->update();
820 m_activeCell->second = qMax(1, m_activeCell->second - 1);
822 if (leftMostVisibleCol == m_activeCell->second) {
823 horizontalScrollBar()->setValue(horizontalScrollBar()->value() -
824 m_columns->getVisibleColumns()[m_activeCell->second]->getWidth());
828 viewport()->update();
836 m_activeCell->second = qMin(m_columns->getVisibleColumns().size() - 1,
837 m_activeCell->second + 1);
839 if (rightMostVisibleCol == m_activeCell->second) {
840 horizontalScrollBar()->setValue(horizontalScrollBar()->value() +
841 m_columns->getVisibleColumns()[m_activeCell->second]->getWidth());
845 viewport()->update();
857 if (m_model && m_columns) {
859 int rowCount = (int) ceil(viewport()->height() / (double) m_rowHeight);
861 QPainter painter(viewport());
862 painter.setRenderHint(QPainter::Antialiasing,
false);
865 bool editWidgetVisible =
false;
866 for (
int i = 0; i < rowCount; i++) {
868 QPoint relativeTopLeft(0, i * m_rowHeight);
869 QPoint scrollBarPos(horizontalScrollBar()->value(),
870 verticalScrollBar()->value());
871 QPoint absoluteTopLeft(relativeTopLeft + scrollBarPos);
872 QSize rowSize(viewport()->width(), (
int) m_rowHeight);
875 painter.fillRect(QRect(relativeTopLeft, rowSize), palette().base());
877 if (i < m_items->size()) {
917 if (m_items->at(i)->isSelected()) {
918 QPoint selectionTopLeft(-absoluteTopLeft.x(), relativeTopLeft.y());
919 QSize selectionSize(m_columns->getVisibleWidth(), (int) m_rowHeight);
921 QRect selectionRect(selectionTopLeft, selectionSize);
922 painter.fillRect(selectionRect, palette().highlight().color());
925 paintRow(&painter, i, absoluteTopLeft, relativeTopLeft);
929 for (
int i = 0; i < rowCount; i++) {
930 if (i < m_items->size()) {
931 QPoint relativeTopLeft(0, i * m_rowHeight);
932 if (m_editWidget && m_activeCell->first == m_items->at(i)) {
937 QPoint(xRange.first - horizontalScrollBar()->value() - 1,
938 relativeTopLeft.y() + 1));
939 m_editWidget->resize(xRange.second - xRange.first, m_rowHeight + 1);
940 m_editWidget->setVisible(
true);
941 editWidgetVisible =
true;
944 if (m_activeCell->first == m_items->at(i)) {
948 QRect activeArea(activeXArea.first, relativeTopLeft.y(),
949 activeXArea.second - activeXArea.first, m_rowHeight);
952 activeArea.left() - horizontalScrollBar()->value());
953 activeArea.adjust(-1, -1, -2, -1);
957 painter.drawRect(activeArea);
963 if (m_editWidget && !editWidgetVisible)
964 m_editWidget->setVisible(
false);
967 QWidget::paintEvent(event);
978 QAbstractScrollArea::resizeEvent(event);
991 QAbstractScrollArea::scrollContentsBy(dx, dy);
1000 m_parentView = NULL;
1003 m_activeCell = NULL;
1004 m_lastShiftArrowSelectedCell = NULL;
1005 m_editWidget = NULL;
1007 m_lastShiftSelection = NULL;
1023 if (col->hasNetworkStructureEffect())
1026 emit modelDataChanged();
1034 m_activeCell->first = NULL;
1035 m_activeCell->second = -1;
1043 ASSERT(m_lastShiftArrowSelectedCell);
1044 m_lastShiftArrowSelectedCell->first = NULL;
1056 TableColumn *col = m_columns->getVisibleColumns()[m_activeCell->second];
1058 QString colTitle = col->getTitle();
1059 ASSERT(colTitle.size());
1063 QString cellData = m_activeCell->first->getFormattedData(colTitle);
1067 ASSERT(selection.size());
1069 bool needsDialog =
true;
1071 for (
int i = 0; !done && i < selection.size(); i++) {
1073 bool changeData =
true;
1075 QString warningText =
1076 m_model->getWarningMessage(row, col, cellData);
1077 if (needsDialog && warningText.size()) {
1078 QMessageBox::StandardButton status = QMessageBox::warning(
1079 this,
"Change cells?", warningText, QMessageBox::Yes |
1080 QMessageBox::No | QMessageBox::YesToAll | QMessageBox::NoToAll);
1083 case QMessageBox::YesToAll:
1084 needsDialog =
false;
1086 case QMessageBox::NoToAll:
1088 case QMessageBox::No:
1096 row->setData(colTitle, cellData);
1099 viewport()->update();
1116 m_applyToAllAct->setStatusTip(tr(
"Copy the contents of this cell to all" 1117 "cells in the current column"));
1123 tr(
"Delete the currently selected rows"));
1129 tr(
"Edit the selected control point or the parent control point of control measure"));
1144 for (
int i = 0; i < m_columns->getVisibleColumns().size(); i++) {
1146 int deltaX = -horizontalScrollBar()->value();
1148 if (cellXRange.first + deltaX < screenX &&
1149 cellXRange.second + deltaX > screenX) {
1166 int calculatedRowNum = screenY / m_rowHeight;
1168 if (calculatedRowNum >= 0 && calculatedRowNum < m_items->size() &&
1169 screenY >= 0 && screenY <= viewport()->height())
1170 return calculatedRowNum;
1182 return (m_activeCell->first && m_activeCell->second >= 0);
1192 return (m_model->getSelectedItems().size());
1208 m_activeCell->second == colNum);
1222 return (m_model->getSelectedItems().contains(row));
1236 if (rowNum >= 0 && rowNum < m_items->size())
1253 if (colNum >= 0 && colNum < m_columns->getVisibleColumns().size())
1269 ASSERT(rowNum >= 0 && rowNum < m_items->size());
1270 ASSERT(colNum >= 0 && colNum < m_columns->getVisibleColumns().size());
1272 bool editable =
false;
1274 QString colName = m_columns->getVisibleColumns()[colNum]->getTitle();
1275 if (m_items->at(rowNum)->isSelectable() &&
1276 m_items->at(rowNum)->isDataEditable(colName) &&
1277 !m_columns->getVisibleColumns()[colNum]->isReadOnly())
1293 return m_columns->getVisibleColumns()[colNum]->getTitle().size();
1306 QPoint absolutePosition, QPoint relativePosition) {
1308 ASSERT(rowNum >= 0 && rowNum < m_items->size());
1310 QPoint point(-absolutePosition.x(), relativePosition.y());
1316 QPen originalPen = painter->pen();
1318 QPoint textPoint(point.x() + ITEM_INDENTATION,
1319 point.y() + ITEM_PADDING / 2);
1322 int textHeight = m_rowHeight - ITEM_PADDING;
1324 QFontMetrics metrics(font());
1326 QPen gridPen(Qt::gray);
1330 for (
int i = 0; i < visibleCols.size(); i++) {
1333 QRect cellRect(cellXRange.first, point.y(),
1334 cellXRange.second - cellXRange.first, m_rowHeight);
1335 cellRect.moveLeft(cellRect.left() - horizontalScrollBar()->value() - 1);
1337 QString columnTitle = visibleCols[i]->getTitle();
1338 QRect textRect(textPoint, QSize(cellRect.right() - textPoint.x(),
1341 bool textCentered =
false;
1342 if (!columnTitle.isEmpty()) {
1343 text = item->getFormattedData(columnTitle);
1346 m_activeCell->second == i) {
1348 if (m_activeCell->first != item) {
1349 painter->fillRect(cellRect,
1350 QBrush(palette().highlight().color()));
1351 painter->setPen(palette().highlightedText().color());
1354 painter->setPen(palette().text().color());
1358 if (item->isSelected()) {
1359 painter->setPen(palette().highlightedText().color());
1372 painter->setPen(palette().color(QPalette::Disabled,
1376 painter->setPen(palette().text().color());
1383 text = QString::number(rowNum + verticalScrollBar()->value() + 1);
1384 textCentered =
true;
1387 int x = cellRect.center().x();
1388 QLinearGradient gradient(x, cellRect.top(), x, cellRect.bottom());
1390 bool selected = item->isSelected();
1391 QColor color = selected ? palette().highlight().color() :
1392 palette().button().color();
1394 int adjustment = 110;
1395 gradient.setColorAt(0, color.lighter(adjustment));
1396 gradient.setColorAt(1, color.darker(adjustment));
1397 painter->fillRect(cellRect, gradient);
1399 painter->setPen(palette().highlightedText().color());
1401 painter->setPen(palette().text().color());
1404 int flags = Qt::TextDontClip;
1406 flags |= Qt::AlignCenter;
1410 QFont normalFont = painter->font();
1412 if (item->getPointerType() == AbstractTreeItem::Measure) {
1414 if (cm && cm->Parent() && cm->Parent()->
GetRefMeasure() == cm) {
1415 QFont boldFont(normalFont);
1416 boldFont.setBold(
true);
1417 painter->setFont(boldFont);
1421 painter->drawText(textRect, flags,
1422 metrics.elidedText(text, Qt::ElideRight,
1423 textRect.width() - ITEM_INDENTATION));
1424 painter->setFont(normalFont);
1426 textPoint.setX(cellRect.right() + ITEM_INDENTATION);
1427 painter->setPen(originalPen);
1429 painter->setPen(gridPen);
1430 painter->drawLine(QPoint(cellRect.right(), point.y()),
1431 QPoint(cellRect.right(), point.y() + m_rowHeight));
1432 painter->setPen(originalPen);
1435 int left = -horizontalScrollBar()->value() - 1;
1436 int right = m_columns->getVisibleWidth();
1438 gridPen.setWidth(2);
1439 painter->setPen(gridPen);
1440 painter->drawLine(QPoint(left, point.y() + m_rowHeight),
1441 QPoint(right, point.y() + m_rowHeight));
1442 painter->setPen(originalPen);
1453 if (m_editWidget && m_activeCell->first && m_activeCell->second >= 0) {
1456 m_columns->getVisibleColumns()[m_activeCell->second];
1457 m_model->getDelegate()->saveData(m_editWidget, m_activeCell->first,
1463 QMessageBox::critical(
this,
"Failed to Set Data", e.
what());
1468 int oldActiveColumn = m_activeCell->second;
1476 for (
int i = 0; i < visibleCols.size(); i++) {
1478 QRect cellRect(cellXRange.first, m_rowHeight * rowNum,
1479 cellXRange.second - cellXRange.first, m_rowHeight);
1481 cellRect.moveLeft(cellRect.left() - horizontalScrollBar()->value());
1483 if (cellRect.contains(screenPos) &&
1484 (oldActiveColumn != -1 || !visibleCols[i]->getTitle().isEmpty())) {
1485 m_activeCell->first = item;
1486 m_activeCell->second = i;
1491 if (oldActiveColumn != m_activeCell->second) {
1514 *m_lastShiftSelection = m_model->getItems(
1518 m_lastShiftSelection->clear();
1537 if (row->getPointerType() == AbstractTreeItem::Point)
1539 child->setSelected(
false);
1541 if (row->getPointerType() == AbstractTreeItem::Measure)
1542 row->parent()->setSelected(
false);
1544 row->setSelected(
false);
1548 *m_lastShiftSelection = m_model->getItems(
1552 m_lastShiftSelection->clear();
1557 row->setSelected(
true);
1559 if (row->getPointerType() == AbstractTreeItem::Measure)
1560 row->parent()->setSelected(
true);
1562 newlySelectedItems.append(row);
1565 return newlySelectedItems;
1594 QMessageBox::StandardButton status = QMessageBox::warning(
1595 this,
"Delete row(s)?",
"Delete selected row(s)?",
1596 QMessageBox::Yes | QMessageBox::No);
1598 if (status == QMessageBox::Yes) {
1602 emit rebuildModels(selectedRows);
1603 emit modelDataChanged();
1605 m_lastShiftSelection->clear();
1616 QString serialNumber;
1620 if (m_model->getSelectedItems().count() == 0) {
1621 item = m_activeCell->first;
1629 if (item->getPointerType() == AbstractTreeItem::Point) {
1635 serialNumber = item->getData(
"Image ID").toString();
1651 int startRow = verticalScrollBar()->value();
1652 int rowCount = (int) ceil(viewport()->height() / (double) m_rowHeight);
1655 m_model->getItems(startRow, startRow + rowCount)) {
1656 m_items->append(item);
1659 viewport()->update();
1670 QMenu contextMenu(
this);
1681 if (QApplication::applicationName() !=
"cneteditor") {
1682 if (m_activeControlNet) {
1728 contextMenu.exec(mapToGlobal(mouseLocation));
virtual ~TableViewContent()
Destructor.
void leaveEvent(QEvent *event)
Overrides QWidget::leaveEvent.
void cellDataChanged(TableColumn const *col)
Rebuilds the models when the data is changed.
void scrollTo(QList< AbstractTreeItem * >)
Scrolls to the selected items.
const char * what() const
Returns a string representation of this exception in its current state.
void mousePressEvent(QMouseEvent *event)
Overrides QWidget::mousePressEvent.
QPair< int, int > getVisibleXRange(int visibleColumn)
void updateHorizontalScrollBar(bool scrollRight=false)
Updates the horizontal scroll bar.
void resizeEvent(QResizeEvent *event)
Updates the table when it is resized.
void copyAll()
Copies all of the cells.
void copyCellSelection(bool)
Copies the selected cells.
void editControlPoint()
Retrieves the control point from the selected cells for editing.
void finishEditing()
Saves the data from the cell the user was modifying.
void mouseMoveEvent(QMouseEvent *event)
Overrides QWidget::mouseMoveEvent.
void refresh()
Refreshes the table and viewport.
QAction * m_applyToAllAct
This action applies (copies) the contents of the active cell to all of the cells in the active cell's...
int getColumnFromScreenX(int screenX) const
Calculates the visible range of a column and returns the index of the column.
void deleteSelectedRows()
Deletes the selected rows.
void moveActiveCellDown()
Changes the viewport when the active cell is moved.
QAction * m_applyToSelectionAct
This action applies (copies) the contents of the active cell to the current selection.
void paintEvent(QPaintEvent *event)
Paints the table when there is a paint event.
void mouseDoubleClickEvent(QMouseEvent *event)
Overrides QWidget::mouseDoubleClickEvent.
bool isDataColumn(int) const
Checks if the column has a non empty title.
bool eventFilter(QObject *target, QEvent *event)
Overrides QObject::eventFilter.
void updateColumnGroupSelection(AbstractTreeItem *)
Updates which column is selected.
Translates the tree model into a table model.
void setActiveControlNet(bool activeNet)
Sets if there is an active control net.
bool mouseInCellSelection(QPoint) const
Checks if the mouse is in the selected cells.
void mouseReleaseEvent(QMouseEvent *event)
Overrides QWidget::mouseReleaseEvent.
void copySelection()
Copies selected cells.
bool hasRowSelection() const
Checks if there is a row selected.
void updateActiveCell(QPoint)
Updates which cell is active.
QList< AbstractTreeItem *> updateRowGroupSelection(int lastRow)
Updates which row is selected.
const ControlMeasure * GetRefMeasure() const
Get the reference control measure.
bool cellIsEditable(int, int) const
Checks if the cell is editable.
void moveActiveCellLeft()
Changes the viewport when the active cell is moved.
bool mouseInRowSelection(QPoint) const
Checks if the mouse is in the selected row.
void scrollContentsBy(int dx, int dy)
Updates the item list when the user scrolls.
void clearActiveCell()
Clears the active cell.
AbstractTableModel * getModel()
Returns the model.
Base class for delegates which create, read, and save data in the tables.
void paintRow(QPainter *, int, QPoint, QPoint)
Repaints the row.
Namespace for ISIS/Bullet specific routines.
bool columnIsValid(int colNum) const
Checks if the column number is valid.
QSize sizeHint() const
Returns the minimum size hint.
void moveActiveCellUp()
Shifts the active cell up.
void moveActiveCellRight()
Changes the viewport when the active cell is moved.
void keyPressEvent(QKeyEvent *event)
Overrides QWidget::keyPressEvent.
int getRowFromScreenY(int screenY) const
Calculates the visible range of a row and returns the index of the column.
Base class for an item in the tree.
void nullify()
Clears all member variables.
void createActions()
Builds the menus.
QSize minimumSizeHint() const
Returns the minimum size hint.
bool hasActiveCell() const
Checks if there is an active cell.
QAction * m_editControlPointAct
This action edits selected control point or if measure selected, edit parent control pt...
QList< AbstractTreeItem *> * rowsWithActiveColumnSelected
Stores a list of the rows that have their active column cells selected.
void showContextMenu(QPoint)
Populates the context menus based on where the user clicked.
void clearColumnSelection()
Clears the selected column.
AbstractTreeItem * m_lastDirectlySelectedRow
This is the last row that was selected by either a control-click or normal click. ...
bool rowIsValid(int rowNum) const
Checks if the row number is valid.
TableViewContent(AbstractTableModel *someModel)
Constructor.
void updateItemList()
Updates the item list.
QAction * m_deleteSelectedRowsAct
This action deletes the selected rows.