0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
obs-studio/UI/qt-display.hpp
SuslikV e2be33956b UI: Correct custom property implementation
- Fixes Q_PROPERTY macro syntax
- Removes excessive notification declaration and slot
- Removes unneeded dynamic property
- Improves Themes versatility
2019-04-17 07:10:12 -07:00

39 lines
892 B
C++

#pragma once
#include <QWidget>
#include <obs.hpp>
#define GREY_COLOR_BACKGROUND 0xFF4C4C4C
class OBSQTDisplay : public QWidget {
Q_OBJECT
Q_PROPERTY(QColor displayBackgroundColor MEMBER backgroundColor
READ GetDisplayBackgroundColor
WRITE SetDisplayBackgroundColor)
OBSDisplay display;
void CreateDisplay();
void resizeEvent(QResizeEvent *event) override;
void paintEvent(QPaintEvent *event) override;
signals:
void DisplayCreated(OBSQTDisplay *window);
void DisplayResized();
public:
OBSQTDisplay(QWidget *parent = nullptr,
Qt::WindowFlags flags = nullptr);
virtual QPaintEngine *paintEngine() const override;
inline obs_display_t *GetDisplay() const {return display;}
uint32_t backgroundColor = GREY_COLOR_BACKGROUND;
QColor GetDisplayBackgroundColor() const;
void SetDisplayBackgroundColor(const QColor &color);
void UpdateDisplayBackgroundColor();
};