0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 21:13:04 +02:00
obs-studio/UI/scene-tree.hpp
Clayton Groeneveld f580de0bc7 UI: Fix multiview update regression
Fixes bug where multiview won't update when reordering scenes with drag
and drop. Was originally fixed with #2114, but bcddf4d caused a
regression where it didn't work anymore.
2020-08-22 08:37:26 -07:00

41 lines
1.0 KiB
C++

#pragma once
#include <QListWidget>
#include <QEvent>
#include <QItemDelegate>
class SceneTree : public QListWidget {
Q_OBJECT
Q_PROPERTY(int gridItemWidth READ GetGridItemWidth WRITE
SetGridItemWidth DESIGNABLE true)
Q_PROPERTY(int gridItemHeight READ GetGridItemHeight WRITE
SetGridItemHeight DESIGNABLE true)
bool gridMode = false;
int maxWidth = 150;
int itemHeight = 24;
public:
void SetGridMode(bool grid);
bool GetGridMode();
void SetGridItemWidth(int width);
void SetGridItemHeight(int height);
int GetGridItemWidth();
int GetGridItemHeight();
explicit SceneTree(QWidget *parent = nullptr);
protected:
virtual bool eventFilter(QObject *obj, QEvent *event) override;
virtual void resizeEvent(QResizeEvent *event) override;
virtual void startDrag(Qt::DropActions supportedActions) override;
virtual void dropEvent(QDropEvent *event) override;
virtual void dragMoveEvent(QDragMoveEvent *event) override;
virtual void rowsInserted(const QModelIndex &parent, int start,
int end) override;
signals:
void scenesReordered();
};