| 105 | } |
| 106 | |
| 107 | void |
| 108 | TrackerTableItemDelegate::paint(QPainter * painter, |
| 109 | const QStyleOptionViewItem & option, |
| 110 | const QModelIndex & index) const |
| 111 | { |
| 112 | assert( index.isValid() ); |
| 113 | if ( !index.isValid() ) { |
| 114 | QStyledItemDelegate::paint(painter, option, index); |
| 115 | |
| 116 | return; |
| 117 | } |
| 118 | |
| 119 | TableModel* model = dynamic_cast<TableModel*>( _view->model() ); |
| 120 | assert(model); |
| 121 | if (!model) { |
| 122 | // coverity[dead_error_line] |
| 123 | QStyledItemDelegate::paint(painter, option, index); |
| 124 | |
| 125 | return; |
| 126 | } |
| 127 | TableItem* item = model->item(index); |
| 128 | assert(item); |
| 129 | if (!item) { |
| 130 | // coverity[dead_error_line] |
| 131 | QStyledItemDelegate::paint(painter, option, index); |
| 132 | |
| 133 | return; |
| 134 | } |
| 135 | |
| 136 | int col = index.column(); |
| 137 | if ( (col != COL_CENTER_X) && |
| 138 | ( col != COL_CENTER_Y) && |
| 139 | ( col != COL_OFFSET_X) && |
| 140 | ( col != COL_OFFSET_Y) && |
| 141 | ( col != COL_ERROR) ) { |
| 142 | QStyledItemDelegate::paint(painter, option, index); |
| 143 | |
| 144 | return; |
| 145 | } |
| 146 | |
| 147 | // If the item is being edited, do not draw it |
| 148 | if (_view->editedItem() == item) { |
| 149 | QStyledItemDelegate::paint(painter, option, index); |
| 150 | |
| 151 | return; |
| 152 | } |
| 153 | |
| 154 | // get the proper subrect from the style |
| 155 | QStyle *style = QApplication::style(); |
| 156 | QRect geom = style->subElementRect(QStyle::SE_ItemViewItemText, &option); |
| 157 | int dim = -1; |
| 158 | AnimationLevelEnum level = eAnimationLevelNone; |
| 159 | KnobIPtr knob = _panel->getKnobAt(index.row(), index.column(), &dim); |
| 160 | assert(knob); |
| 161 | if ( knob && (dim != -1) ) { |
| 162 | level = knob->getAnimationLevel(dim); |
| 163 | } |
| 164 |
nothing calls this directly
no test coverage detected