Skip to content

Commit

Permalink
WIP QOpenGLWindow investigation
Browse files Browse the repository at this point in the history
  • Loading branch information
darbyjohnston committed Apr 22, 2024
1 parent bc2dec3 commit 8995b74
Show file tree
Hide file tree
Showing 7 changed files with 1,091 additions and 18 deletions.
18 changes: 10 additions & 8 deletions lib/tlPlayQtApp/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <tlQtWidget/TimeSpinBox.h>
#include <tlQtWidget/TimelineViewport.h>
#include <tlQtWidget/TimelineWidget.h>
#include <tlQtWidget/TimelineWindow.h>
#include <tlQtWidget/Util.h>

#if defined(TLRENDER_BMD)
Expand Down Expand Up @@ -93,7 +94,8 @@ namespace tl
ToolActions* toolActions = nullptr;

qtwidget::TimelineViewport* timelineViewport = nullptr;
qtwidget::TimelineWidget* timelineWidget = nullptr;
//qtwidget::TimelineWidget* timelineWidget = nullptr;
qtwidget::TimelineWindow* timelineWidget = nullptr;
qtwidget::TimeSpinBox* currentTimeSpinBox = nullptr;
QDoubleSpinBox* speedSpinBox = nullptr;
QToolButton* speedButton = nullptr;
Expand Down Expand Up @@ -168,7 +170,7 @@ namespace tl
auto context = app->getContext();
p.timelineViewport = new qtwidget::TimelineViewport(context);

p.timelineWidget = new qtwidget::TimelineWidget(
p.timelineWidget = new qtwidget::TimelineWindow(
ui::Style::create(context),
app->timeUnitsModel(),
context);
Expand Down Expand Up @@ -278,7 +280,7 @@ namespace tl
timelineDockWidget->setWindowTitle(tr("Timeline"));
timelineDockWidget->setFeatures(QDockWidget::DockWidgetClosable);
timelineDockWidget->setTitleBarWidget(new QWidget);
timelineDockWidget->setWidget(p.timelineWidget);
timelineDockWidget->setWidget(QWidget::createWindowContainer(p.timelineWidget));
addDockWidget(Qt::BottomDockWidgetArea, timelineDockWidget);

p.currentTimeSpinBox = new qtwidget::TimeSpinBox;
Expand Down Expand Up @@ -572,21 +574,21 @@ namespace tl

connect(
p.timelineWidget,
&qtwidget::TimelineWidget::editableChanged,
&qtwidget::TimelineWindow::editableChanged,
[this](bool value)
{
_p->timelineActions->actions()["Editable"]->setChecked(value);
});
connect(
p.timelineWidget,
&qtwidget::TimelineWidget::frameViewChanged,
&qtwidget::TimelineWindow::frameViewChanged,
[this](bool value)
{
_p->timelineActions->actions()["FrameView"]->setChecked(value);
});
/*connect(
p.timelineWidget,
&qtwidget::TimelineWidget::timeScrubbed,
&qtwidget::TimelineWindow::timeScrubbed,
[this](const otime::RationalTime& value)
{
std::cout << "Time scrubbed: " << value << std::endl;
Expand Down Expand Up @@ -696,7 +698,7 @@ namespace tl
timelineItemOptions.markers);
}

qtwidget::TimelineWidget* MainWindow::timelineWidget() const
qtwidget::TimelineWindow* MainWindow::timelineWidget() const
{
return _p->timelineWidget;
}
Expand Down Expand Up @@ -820,7 +822,7 @@ namespace tl

const auto& files = p.app->filesModel()->observeFiles()->get();
const size_t count = files.size();
p.timelineWidget->setEnabled(count > 0);
//p.timelineWidget->setEnabled(count > 0);
p.currentTimeSpinBox->setEnabled(count > 0);
p.speedSpinBox->setEnabled(count > 0);
p.volumeSlider->setEnabled(count > 0);
Expand Down
8 changes: 4 additions & 4 deletions lib/tlPlayQtApp/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace tl
{
namespace qtwidget
{
class TimelineWidget;
class TimelineWindow;
class TimelineViewport;
}

Expand All @@ -30,10 +30,10 @@ namespace tl

virtual ~MainWindow();

//! Get the timeline widget;
qtwidget::TimelineWidget* timelineWidget() const;
//! Get the timeline window.
qtwidget::TimelineWindow* timelineWidget() const;

//! Get the timeline viewport;
//! Get the timeline viewport.
qtwidget::TimelineViewport* timelineViewport() const;

protected:
Expand Down
2 changes: 1 addition & 1 deletion lib/tlPlayQtApp/TimelineActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <tlPlayQtApp/MainWindow.h>

#include <tlQtWidget/TimelineWidget.h>
#include <tlQtWidget/TimelineWindow.h>

#include <tlQt/MetaTypes.h>
#include <tlQt/TimeObject.h>
Expand Down
2 changes: 2 additions & 0 deletions lib/tlQtWidget/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set(HEADERS
TimeSpinBox.h
TimelineViewport.h
TimelineWidget.h
TimelineWindow.h
Util.h)
set(PRIVATE_HEADERS
BellowsPrivate.h)
Expand All @@ -41,6 +42,7 @@ set(SOURCE
TimeSpinBox.cpp
TimelineViewport.cpp
TimelineWidget.cpp
TimelineWindow.cpp
Util.cpp)

if(TLRENDER_QT6)
Expand Down
5 changes: 0 additions & 5 deletions lib/tlQtWidget/TimelineWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@

namespace tl
{
namespace timeline
{
class Player;
}

namespace qtwidget
{
//! Timeline widget.
Expand Down
Loading

0 comments on commit 8995b74

Please sign in to comment.