QRhiWidget: Use QRhiRenderTarget as the return type for renderTarget

There is no point in using the more specialized derived class
(QRhiTextureRenderTarget), even though that is what the rt always is.

None of the example and test code needs changes since relying on
QRhiTextureRenderTarget specifics is very rare in practice (now it will
need a static_cast), whereas in the majority of cases the return value
is passed on to other functions, for example, beginPass(), that take
a QRhiRenderTarget.

Change-Id: Ifaebb6320a156ec6a9013e72fede04e520aa9aaf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
Laszlo Agocs 2023-08-23 17:57:16 +02:00
parent 39b39f0d5f
commit 735a864360
2 changed files with 3 additions and 3 deletions

View File

@ -1259,7 +1259,7 @@ QRhiRenderBuffer *QRhiWidget::depthStencilBuffer() const
\sa colorTexture(), depthStencilBuffer()
*/
QRhiTextureRenderTarget *QRhiWidget::renderTarget() const
QRhiRenderTarget *QRhiWidget::renderTarget() const
{
Q_D(const QRhiWidget);
return d->renderTarget;

View File

@ -12,7 +12,7 @@ class QRhiWidgetPrivate;
class QRhi;
class QRhiTexture;
class QRhiRenderBuffer;
class QRhiTextureRenderTarget;
class QRhiRenderTarget;
class QRhiCommandBuffer;
class Q_WIDGETS_EXPORT QRhiWidget : public QWidget
@ -80,7 +80,7 @@ public:
QRhiRenderBuffer *msaaColorBuffer() const;
QRhiTexture *resolveTexture() const;
QRhiRenderBuffer *depthStencilBuffer() const;
QRhiTextureRenderTarget *renderTarget() const;
QRhiRenderTarget *renderTarget() const;
Q_SIGNALS:
void frameSubmitted();