forked from qt-creator/qt-creator
Display the current frame in a dedicated control
Enable immediate dragging of the playhead after clicking into the time-scale Rename "Curve Picker" to "Easing Curve Editor" and "Curve Editor" to "Animation Curve Editor" Change-Id: I0085a26d0ea510286586d89c6cddb9bbe720e49e Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -113,9 +113,20 @@ QToolBar *CurveEditor::createToolBar()
|
||||
durationWidget->setLayout(durationBox);
|
||||
bar->addWidget(durationWidget);
|
||||
|
||||
auto *cfspin = new QSpinBox;
|
||||
cfspin->setMinimum(0);
|
||||
cfspin->setMaximum(std::numeric_limits<int>::max());
|
||||
|
||||
auto intSignal = static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged);
|
||||
connect(cfspin, intSignal, [this](int val) { m_view->setCurrentFrame(val, false); });
|
||||
connect(m_view, &GraphicsView::notifyFrameChanged, [cfspin](int val) {
|
||||
QSignalBlocker blocker(cfspin);
|
||||
cfspin->setValue(val);
|
||||
});
|
||||
|
||||
auto *positionBox = new QHBoxLayout;
|
||||
positionBox->addWidget(new QLabel(tr("Current Frame")));
|
||||
positionBox->addWidget(new QSpinBox);
|
||||
positionBox->addWidget(cfspin);
|
||||
auto *positionWidget = new QWidget;
|
||||
positionWidget->setLayout(positionBox);
|
||||
bar->addWidget(positionWidget);
|
||||
|
||||
Reference in New Issue
Block a user