41 lines
884 B
C++
Executable File
41 lines
884 B
C++
Executable File
#pragma once
|
|
|
|
#include <LtsScriptTimeline/ltsscripttimeline_export.h>
|
|
#include <LtsScriptTimeline/track_content_widget.h>
|
|
#include <QCursor>
|
|
|
|
class QMouseEvent;
|
|
class QKeyEvent;
|
|
|
|
namespace LtsScriptTimeline
|
|
{
|
|
class LTSSCRIPTTIMELINE_EXPORT ResizeHandler
|
|
{
|
|
public:
|
|
explicit ResizeHandler(TrackContentWidget *_tcw)
|
|
: m_trackContentWidget(_tcw)
|
|
, m_resizing(false)
|
|
, m_possible(false)
|
|
, m_oldLength(-1)
|
|
, m_mainTeLength(-1)
|
|
{}
|
|
|
|
void mousePressEvent(QMouseEvent *event);
|
|
void mouseReleaseEvent(QMouseEvent *event);
|
|
bool mouseMoveEvent(QMouseEvent *event);
|
|
void keyPressEvent(QKeyEvent *event);
|
|
|
|
TrackContentWidget *m_trackContentWidget;
|
|
QVector<TrackContentWidget *> m_tcwCorresponding;
|
|
|
|
bool m_resizing;
|
|
bool m_possible;
|
|
int m_oldLength;
|
|
int m_mainTeLength;
|
|
Qt::CursorShape m_cursor;
|
|
|
|
private:
|
|
bool isCollision(int newLength) const;
|
|
};
|
|
}
|