MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / paint

Method paint

Gui/TrackerPanel.cpp:107–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void
108TrackerTableItemDelegate::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

Callers

nothing calls this directly

Calls 15

itemMethod · 0.80
columnMethod · 0.80
editedItemMethod · 0.80
getKnobAtMethod · 0.80
getAnimationLevelMethod · 0.80
getInterpolatedColorMethod · 0.80
getCurrentSettingsMethod · 0.80
getKeyframeColorMethod · 0.80
getTextColorMethod · 0.80
isValidMethod · 0.45
rowMethod · 0.45
flagsMethod · 0.45

Tested by

no test coverage detected