yolobs-studio/UI/qt-display.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
915 B
C++
Raw Permalink Normal View History

2016-02-23 23:16:51 +00:00
#pragma once
#include <QWidget>
#include <obs.hpp>
2019-07-27 12:47:10 +00:00
#define GREY_COLOR_BACKGROUND 0xFF4C4C4C
2016-02-23 23:16:51 +00:00
class OBSQTDisplay : public QWidget {
Q_OBJECT
2019-09-22 21:19:10 +00:00
Q_PROPERTY(QColor displayBackgroundColor MEMBER backgroundColor READ
GetDisplayBackgroundColor WRITE
SetDisplayBackgroundColor)
2016-02-23 23:16:51 +00:00
OBSDisplay display;
void CreateDisplay();
void resizeEvent(QResizeEvent *event) override;
void paintEvent(QPaintEvent *event) override;
signals:
void DisplayCreated(OBSQTDisplay *window);
void DisplayResized();
public:
2019-07-27 12:47:10 +00:00
OBSQTDisplay(QWidget *parent = nullptr,
2020-10-01 20:15:25 +00:00
Qt::WindowFlags flags = Qt::WindowFlags());
2016-02-23 23:16:51 +00:00
virtual QPaintEngine *paintEngine() const override;
2019-09-22 21:19:10 +00:00
inline obs_display_t *GetDisplay() const { return display; }
2019-07-27 12:47:10 +00:00
uint32_t backgroundColor = GREY_COLOR_BACKGROUND;
QColor GetDisplayBackgroundColor() const;
void SetDisplayBackgroundColor(const QColor &color);
void UpdateDisplayBackgroundColor();
2016-02-23 23:16:51 +00:00
};