3422631152
(Non-compiling commit: windowless-context branch) This makes it so that OBSQTDisplay now uses/controls an obs_display object directly (rather than having the owner have to associate an OBSDisplay with it). It was separated before because the main window for the basic UI would was using the "main preview" stuff before the windowless context and had to be handled differently, so you couldn't just associate an obs_display object with OBSQTDisplay, meaning that all "secondary" previews such as properties/filters/etc had to handle the obs_display alone, which caused a lot of needlessly duplicated code. Also adds a DisplayCreated signal to allow owners to be able to add callbacks and such on creation of the actual obs_display context.
27 lines
512 B
C++
27 lines
512 B
C++
#pragma once
|
|
|
|
#include <QWidget>
|
|
#include <obs.hpp>
|
|
|
|
class OBSQTDisplay : public QWidget {
|
|
Q_OBJECT
|
|
|
|
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 = 0, Qt::WindowFlags flags = 0);
|
|
|
|
virtual QPaintEngine *paintEngine() const override;
|
|
|
|
inline obs_display_t *GetDisplay() const {return display;}
|
|
};
|