| 149 | } |
| 150 | |
| 151 | void PropertyEditorDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, |
| 152 | const QModelIndex &index) const |
| 153 | { |
| 154 | const QVariant value = index.data(Qt::EditRole); |
| 155 | if (value.canConvert<QMatrix4x4>()) { |
| 156 | paint(painter, option, index, value.value<QMatrix4x4>()); |
| 157 | } else if (value.typeId() == QMetaType::QTransform) { |
| 158 | paint(painter, option, index, value.value<QTransform>()); |
| 159 | } else if (value.canConvert<QVector2D>()) { |
| 160 | paint(painter, option, index, value.value<QVector2D>()); |
| 161 | } else if (value.canConvert<QVector3D>()) { |
| 162 | paint(painter, option, index, value.value<QVector3D>()); |
| 163 | } else if (value.canConvert<QVector4D>()) { |
| 164 | paint(painter, option, index, value.value<QVector4D>()); |
| 165 | } else if (value.typeId() == QMetaType::QQuaternion) { |
| 166 | paint(painter, option, index, value.value<QQuaternion>()); |
| 167 | } else { |
| 168 | QStyledItemDelegate::paint(painter, option, index); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | QSize PropertyEditorDelegate::sizeHint(const QStyleOptionViewItem &option, |
| 173 | const QModelIndex &index) const |