qt5base-lts/tests/manual/rhi/rhiwidget/rhiwidget.h
Lucie Gérard 05fc3aef53 Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Task-number: QTBUG-67283
Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-05-16 16:37:38 +02:00

57 lines
1.3 KiB
C++

// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef RHIWIDGET_H
#define RHIWIDGET_H
#include <QWidget>
#include <QtGui/private/qrhi_p.h>
class QRhiWidgetPrivate;
class QRhiWidget : public QWidget
{
Q_OBJECT
Q_DECLARE_PRIVATE(QRhiWidget)
Q_PROPERTY(QSize explicitSize READ explicitSize WRITE setExplicitSize NOTIFY explicitSizeChanged)
public:
QRhiWidget(QWidget *parent = nullptr, Qt::WindowFlags f = {});
~QRhiWidget();
enum Api {
OpenGL,
Metal,
Vulkan,
D3D11,
Null
};
Api api() const;
void setApi(Api api);
bool isDebugLayerEnabled() const;
void setDebugLayer(bool enable);
QRhiTexture::Format textureFormat() const;
void setTextureFormat(QRhiTexture::Format format);
QSize explicitSize() const;
void setExplicitSize(const QSize &pixelSize);
virtual void initialize(QRhi *rhi, QRhiTexture *outputTexture);
virtual void render(QRhiCommandBuffer *cb);
QImage grabTexture();
Q_SIGNALS:
void explicitSizeChanged(const QSize &pixelSize);
protected:
void resizeEvent(QResizeEvent *e) override;
void paintEvent(QPaintEvent *e) override;
bool event(QEvent *e) override;
};
#endif