Skip to content

Commit

Permalink
FrameSpinBox: support timecode input
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Jun 28, 2024
1 parent 2a3d7b4 commit 512670c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ui/widgets/framespinbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@ QString FrameSpinBox::textFromValue(int value) const
{
return mDisplayTimecode ? AppSupport::getTimeCodeFromFrame(value, mFps) : QSpinBox::textFromValue(value);
}

void FrameSpinBox::fixup(QString &str) const
{
if (mDisplayTimecode) {
str = QString::number(AppSupport::getFrameFromTimeCode(str, mFps));
}
QSpinBox::fixup(str);
}
1 change: 1 addition & 0 deletions src/ui/widgets/framespinbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class UI_EXPORT FrameSpinBox : public QSpinBox
void setDisplayTimeCode(const bool &enabled);
void updateFps(const qreal &fps);
QString textFromValue(int value) const override;
void fixup(QString &str) const override;

private:
bool mDisplayTimecode = false;
Expand Down

0 comments on commit 512670c

Please sign in to comment.