connect(spin, SIGNAL(valueChanged(int)), this, SLOT(commitEditorData()));
connect(spin, SIGNAL(editingFinished()), this, SLOT(commitAndCloseEditor()));
return spin;
- } else return QItemDelegate::createEditor(parent, option, index);
+ } else {
+ return QItemDelegate::createEditor(parent, option, index);
+ }
}
QSpinBox *spin = qobject_cast< QSpinBox* >(editor);
spin->setRange(m_min, m_max);
spin->setValue(index.model()->data(index).toInt());
- } else QItemDelegate::setEditorData(editor, index);
+ } else {
+ QItemDelegate::setEditorData(editor, index);
+ }
}
private slots:
{
Q_OBJECT
public:
- explicit KeyframeEdit(QDomElement e, int maxFrame, int minVal, int maxVal, Timecode tc, const QString paramName = QString(), QWidget* parent = 0);
+ explicit KeyframeEdit(QDomElement e, int minFrame, int maxFrame, int minVal, int maxVal, Timecode tc, int active_keyframe, QWidget* parent = 0);
virtual ~KeyframeEdit();
- void setupParam(QDomElement e = QDomElement());
+ void setupParam();
+ void addParameter(QDomElement e);
+ const QString getValue(const QString &name);
+ /** @brief Updates the timecode display according to settings (frame number or hh:mm:ss:ff) */
+ void updateTimecodeFormat();
private:
- QDomElement m_param;
+ QList <QDomElement> m_params;
+ int m_min;
int m_max;
int m_minVal;
int m_maxVal;
Timecode m_timecode;
int m_previousPos;
- KeyItemDelegate *m_delegate;
-
-public slots:
-
+ //KeyItemDelegate *m_delegate;
+ void generateAllParams();
+ QGridLayout *m_slidersLayout;
+ int m_active_keyframe;
+
+ /** @brief Gets the position of a keyframe from the table.
+ * @param row Row of the keyframe in the table */
+ int getPos(int row);
+ /** @brief Converts a frame value to timecode considering the frames vs. HH:MM:SS:FF setting.
+ * @return timecode */
+ QString getPosString(int pos);
private slots:
void slotDeleteKeyframe();
void slotAddKeyframe();
- void slotGenerateParams(QTreeWidgetItem *item = NULL, int column = -1);
- void slotAdjustKeyframeInfo();
+ void slotGenerateParams(int row, int column);
+ void slotAdjustKeyframeInfo(bool seek = true);
void slotAdjustKeyframePos(int value);
void slotAdjustKeyframeValue(int value);
- void slotSaveCurrentParam(QTreeWidgetItem *item, int column);
+ /** @brief Turns the seek to keyframe position setting on/off.
+ * @param state State of the associated checkbox */
+ void slotSetSeeking(int state);
+ //void slotSaveCurrentParam(QTreeWidgetItem *item, int column);
signals:
void parameterChanged();