Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qrhiwidget.cpp
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qrhiwidget_p.h"
5#include <private/qguiapplication_p.h>
6#include <qpa/qplatformintegration.h>
7#include <private/qwidgetrepaintmanager_p.h>
8
10
173QRhiWidget::QRhiWidget(QWidget *parent, Qt::WindowFlags f)
174 : QWidget(*(new QRhiWidgetPrivate), parent, f)
175{
176 Q_D(QRhiWidget);
178 qWarning("QRhiWidget: QRhi is not supported on this platform.");
179 else
180 d->setRenderToTexture();
181
182 d->config.setEnabled(true);
183#if defined(Q_OS_DARWIN)
185#elif defined(Q_OS_WIN)
187#else
189#endif
190}
191
196{
197 Q_D(QRhiWidget);
198
199 if (d->rhi) {
200 d->rhi->removeCleanupCallback(this);
201 // rhi resources must be destroyed here, due to how QWidget teardown works;
202 // it should not be left to the private object's destruction.
203 d->resetRenderTargetObjects();
204 d->resetColorBufferObjects();
205 qDeleteAll(d->pendingDeletes);
206 }
207
208 d->offscreenRenderer.reset();
209}
210
221{
222 Q_D(QRhiWidget);
223
224 if (e->size().isEmpty()) {
225 d->noSize = true;
226 return;
227 }
228 d->noSize = false;
229
230 d->sendPaintEvent(QRect(QPoint(0, 0), size()));
231}
232
244{
245 Q_D(QRhiWidget);
246 if (!updatesEnabled() || d->noSize)
247 return;
248
249 d->ensureRhi();
250 if (!d->rhi) {
251 qWarning("QRhiWidget: No QRhi");
253 return;
254 }
255
256 QRhiCommandBuffer *cb = nullptr;
257 if (d->rhi->beginOffscreenFrame(&cb) != QRhi::FrameOpSuccess)
258 return;
259
260 bool needsInit = false;
261 d->ensureTexture(&needsInit);
262 if (d->colorTexture || d->msaaColorBuffer) {
263 bool canRender = true;
264 if (needsInit)
265 canRender = d->invokeInitialize(cb);
266 if (canRender)
267 render(cb);
268 }
269
270 d->rhi->endOffscreenFrame();
271}
272
277{
278 Q_D(QRhiWidget);
279 switch (e->type()) {
281 // The QRhi will almost certainly change, prevent texture() from
282 // returning the existing QRhiTexture in the meantime.
283 d->textureInvalid = true;
284
285 if (d->rhi && d->rhi != d->offscreenRenderer.rhi()) {
286 // Drop the cleanup callback registered to the toplevel's rhi and
287 // do the early-release, there may not be another chance to do
288 // this, and the QRhi we have currently set may be destroyed by the
289 // time we get to ensureRhi() again.
290 d->rhi->removeCleanupCallback(this);
291 releaseResources(); // notify the user code about the early-release
292 d->releaseResources();
293 // must _not_ null out d->rhi here, for proper interaction with ensureRhi()
294 }
295
296 break;
297
298 case QEvent::Show:
299 if (isVisible())
300 d->sendPaintEvent(QRect(QPoint(0, 0), size()));
301 break;
302 default:
303 break;
304 }
305 return QWidget::event(e);
306}
307
309{
310 // This is the only safe place to clear pendingDeletes, due to the
311 // possibility of the texture returned in the previous invocation of this
312 // function having been added to pendingDeletes, meaning the object then
313 // needs to be valid until the next (this) invocation of this function.
314 // (the exact object lifetime requirements depend on the
315 // QWidget/RepaintManager internal implementation; for now avoid relying on
316 // such details by clearing pendingDeletes only here, not in endCompose())
318 pendingDeletes.clear();
319
320 TextureData td;
321 if (!textureInvalid)
323 return td;
324}
325
326QPlatformTextureList::Flags QRhiWidgetPrivate::textureListFlags()
327{
328 QPlatformTextureList::Flags flags = QWidgetPrivate::textureListFlags();
331 return flags;
332}
333
338
340{
341 // This function is called by QWidgetRepaintManager right after the
342 // backingstore's QRhi-based flush returns. In practice that means after
343 // the begin-endFrame() on the top-level window's swapchain.
344
345 if (rhi) {
346 Q_Q(QRhiWidget);
347 emit q->frameSubmitted();
348 }
349}
350
351// This is reimplemented to enable calling QWidget::grab() on the widget or an
352// ancestor of it. At the same time, QRhiWidget provides its own
353// grabFramebuffer() as well, mirroring QQuickWidget and QOpenGLWidget for
354// consistency. In both types of grabs we end up in here.
356{
357 Q_Q(QRhiWidget);
358 if (noSize)
359 return QImage();
360
361 ensureRhi();
362 if (!rhi) {
363 // The widget (and its parent chain, if any) may not be shown at
364 // all, yet one may still want to use it for grabs. This is
365 // ridiculous of course because the rendering infrastructure is
366 // tied to the top-level widget that initializes upon expose, but
367 // it has to be supported.
369 // no window passed in, so no swapchain, but we get a functional QRhi which we own
372 if (!rhi) {
373 qWarning("QRhiWidget: Failed to create dedicated QRhi for grabbing");
374 emit q->renderFailed();
375 return QImage();
376 }
377 }
378
379 QRhiCommandBuffer *cb = nullptr;
381 return QImage();
382
383 QRhiReadbackResult readResult;
384 bool readCompleted = false;
385 bool needsInit = false;
386 ensureTexture(&needsInit);
387
389 bool canRender = true;
390 if (needsInit)
391 canRender = invokeInitialize(cb);
392 if (canRender)
393 q->render(cb);
394
396 readResult.completed = [&readCompleted] { readCompleted = true; };
397 readbackBatch->readBackTexture(resolveTexture ? resolveTexture : colorTexture, &readResult);
398 cb->resourceUpdate(readbackBatch);
399 }
400
402
403 if (readCompleted) {
405 switch (widgetTextureFormat) {
407 break;
409 imageFormat = QImage::Format_RGBA16FPx4;
410 break;
412 imageFormat = QImage::Format_RGBA32FPx4;
413 break;
415 imageFormat = QImage::Format_BGR30;
416 break;
417 }
418 QImage wrapperImage(reinterpret_cast<const uchar *>(readResult.data.constData()),
419 readResult.pixelSize.width(), readResult.pixelSize.height(),
420 imageFormat);
422 if (rhi->isYUpInFramebuffer())
423 result = wrapperImage.mirrored();
424 else
425 result = wrapperImage.copy();
426 result.setDevicePixelRatio(q->devicePixelRatio());
427 return result;
428 } else {
429 Q_UNREACHABLE();
430 }
431
432 return QImage();
433}
434
436{
437 if (colorTexture) {
439 colorTexture = nullptr;
440 }
441 if (msaaColorBuffer) {
443 msaaColorBuffer = nullptr;
444 }
445 if (resolveTexture) {
447 resolveTexture = nullptr;
448 }
449}
450
466
474
476{
477 Q_Q(QRhiWidget);
478 QRhi *currentRhi = QWidgetPrivate::rhi();
479 if (currentRhi && currentRhi->backend() != QBackingStoreRhiSupport::apiToRhiBackend(config.api())) {
480 qWarning("The top-level window is already using another graphics API for composition, "
481 "'%s' is not compatible with this widget",
482 currentRhi->backendName());
483 return;
484 }
485
486 // NB the rhi member may be an invalid object, the pointer can be used, but no deref
487 if (currentRhi && rhi != currentRhi) {
488 if (rhi) {
489 // if previously we created our own but now get a QRhi from the
490 // top-level, then drop what we have and start using the top-level's
491 if (rhi == offscreenRenderer.rhi()) {
492 q->releaseResources(); // notify the user code about the early-release
495 } else {
496 // rhi resources created by us all belong to the old rhi, drop them;
497 // due to nulling out colorTexture this is also what ensures that
498 // initialize() is going to be called again eventually
501 }
502 }
503
504 // Normally the widget gets destroyed before the QRhi (which is managed by
505 // the top-level's backingstore). When reparenting between top-levels is
506 // involved, that is not always the case. Therefore we use a per-widget rhi
507 // cleanup callback to get notified when the QRhi is about to be destroyed
508 // while the QRhiWidget is still around.
509 currentRhi->addCleanupCallback(q, [q, this](QRhi *regRhi) {
510 if (!QWidgetPrivate::get(q)->data.in_destructor && this->rhi == regRhi) {
511 q->releaseResources(); // notify the user code about the early-release
512 releaseResources();
513 // must null out our ref, the QRhi object is going to be invalid
514 this->rhi = nullptr;
515 }
516 });
517 }
518
519 rhi = currentRhi;
520}
521
523{
524 Q_Q(QRhiWidget);
525
526 QSize newSize = fixedSize;
527 if (newSize.isEmpty())
528 newSize = q->size() * q->devicePixelRatio();
529
530 const int minTexSize = rhi->resourceLimit(QRhi::TextureSizeMin);
531 const int maxTexSize = rhi->resourceLimit(QRhi::TextureSizeMax);
532 newSize.setWidth(qMin(maxTexSize, qMax(minTexSize, newSize.width())));
533 newSize.setHeight(qMin(maxTexSize, qMax(minTexSize, newSize.height())));
534
535 if (colorTexture) {
538 // sample count change needs new depth-stencil, possibly a new
539 // render target; format change needs new renderpassdescriptor;
540 // therefore must drop the rest too
542 }
543 }
544
545 if (msaaColorBuffer) {
548 // sample count change needs new depth-stencil, possibly a new
549 // render target; format change needs new renderpassdescriptor;
550 // therefore must drop the rest too
552 }
553 }
554
555 if (!colorTexture && samples <= 1) {
556 if (changed)
557 *changed = true;
559 qWarning("QRhiWidget: The requested texture format (%d) is not supported by the "
560 "underlying 3D graphics API implementation", int(rhiTextureFormat));
561 }
563 if (!colorTexture->create()) {
564 qWarning("Failed to create backing texture for QRhiWidget");
565 delete colorTexture;
566 colorTexture = nullptr;
567 return;
568 }
569 }
570
571 if (samples > 1) {
572 if (!msaaColorBuffer) {
573 if (changed)
574 *changed = true;
576 qWarning("QRhiWidget: Multisample renderbuffers are reported as unsupported; "
577 "sample count %d will not work as expected", samples);
578 }
580 qWarning("QRhiWidget: The requested texture format (%d) is not supported by the "
581 "underlying 3D graphics API implementation", int(rhiTextureFormat));
582 }
584 if (!msaaColorBuffer->create()) {
585 qWarning("Failed to create multisample color buffer for QRhiWidget");
586 delete msaaColorBuffer;
587 msaaColorBuffer = nullptr;
588 return;
589 }
590 }
591 if (!resolveTexture) {
592 if (changed)
593 *changed = true;
595 if (!resolveTexture->create()) {
596 qWarning("Failed to create resolve texture for QRhiWidget");
597 delete resolveTexture;
598 resolveTexture = nullptr;
599 return;
600 }
601 }
602 } else if (resolveTexture) {
604 resolveTexture = nullptr;
605 }
606
607 if (colorTexture && colorTexture->pixelSize() != newSize) {
608 if (changed)
609 *changed = true;
610 colorTexture->setPixelSize(newSize);
611 if (!colorTexture->create())
612 qWarning("Failed to rebuild texture for QRhiWidget after resizing");
613 }
614
615 if (msaaColorBuffer && msaaColorBuffer->pixelSize() != newSize) {
616 if (changed)
617 *changed = true;
619 if (!msaaColorBuffer->create())
620 qWarning("Failed to rebuild multisample color buffer for QRhiWidget after resizing");
621 }
622
623 if (resolveTexture && resolveTexture->pixelSize() != newSize) {
624 if (changed)
625 *changed = true;
627 if (!resolveTexture->create())
628 qWarning("Failed to rebuild resolve texture for QRhiWidget after resizing");
629 }
630
631 textureInvalid = false;
632}
633
635{
636 Q_Q(QRhiWidget);
638 return false;
639
640 if (autoRenderTarget) {
642 if (!depthStencilBuffer) {
644 if (!depthStencilBuffer->create()) {
645 qWarning("Failed to create depth-stencil buffer for QRhiWidget");
647 return false;
648 }
649 } else if (depthStencilBuffer->pixelSize() != pixelSize) {
651 if (!depthStencilBuffer->create()) {
652 qWarning("Failed to rebuild depth-stencil buffer for QRhiWidget with new size");
653 return false;
654 }
655 }
656
657 if (!renderTarget) {
658 QRhiColorAttachment color0;
659 if (colorTexture)
660 color0.setTexture(colorTexture);
661 else
662 color0.setRenderBuffer(msaaColorBuffer);
663 if (samples > 1)
664 color0.setResolveTexture(resolveTexture);
669 if (!renderTarget->create()) {
670 qWarning("Failed to create render target for QRhiWidget");
672 return false;
673 }
674 }
675 } else {
677 }
678
679 q->initialize(cb);
680
681 return true;
682}
683
690{
691 Q_D(const QRhiWidget);
692 switch (d->config.api()) {
694 return Api::OpenGL;
696 return Api::Metal;
698 return Api::Vulkan;
700 return Api::Direct3D11;
702 return Api::Direct3D12;
704 return Api::Null;
705 }
706 Q_UNREACHABLE_RETURN(Api::Null);
707}
708
728{
729 Q_D(QRhiWidget);
730 switch (api) {
731 case Api::OpenGL:
733 break;
734 case Api::Metal:
736 break;
737 case Api::Vulkan:
739 break;
740 case Api::Direct3D11:
742 break;
743 case Api::Direct3D12:
745 break;
746 case Api::Null:
748 break;
749 }
750}
751
759{
760 Q_D(const QRhiWidget);
761 return d->config.isDebugLayerEnabled();
762}
763
780{
781 Q_D(QRhiWidget);
782 d->config.setDebugLayer(enable);
783}
784
805{
806 Q_D(const QRhiWidget);
807 return d->widgetTextureFormat;
808}
809
811{
812 Q_D(QRhiWidget);
813 if (d->widgetTextureFormat != format) {
814 d->widgetTextureFormat = format;
815 switch (format) {
817 d->rhiTextureFormat = QRhiTexture::RGBA8;
818 break;
820 d->rhiTextureFormat = QRhiTexture::RGBA16F;
821 break;
823 d->rhiTextureFormat = QRhiTexture::RGBA32F;
824 break;
826 d->rhiTextureFormat = QRhiTexture::RGB10A2;
827 break;
828 }
830 update();
831 }
832}
833
867{
868 Q_D(const QRhiWidget);
869 return d->samples;
870}
871
873{
874 Q_D(QRhiWidget);
875 if (d->samples != samples) {
876 d->samples = samples;
878 update();
879 }
880}
881
902{
903 Q_D(const QRhiWidget);
904 return d->fixedSize;
905}
906
908{
909 Q_D(QRhiWidget);
910 if (d->fixedSize != pixelSize) {
911 d->fixedSize = pixelSize;
913 update();
914 }
915}
916
928{
929 Q_D(const QRhiWidget);
930 return d->mirrorVertically;
931}
932
934{
935 Q_D(QRhiWidget);
936 if (d->mirrorVertically != enabled) {
937 d->mirrorVertically = enabled;
939 update();
940 }
941}
942
952{
953 Q_D(const QRhiWidget);
954 return d->autoRenderTarget;
955}
956
972{
973 Q_D(QRhiWidget);
974 if (d->autoRenderTarget != enabled) {
975 d->autoRenderTarget = enabled;
976 update();
977 }
978}
979
1013{
1014 return const_cast<QRhiWidgetPrivate *>(d_func())->grabFramebuffer();
1015}
1016
1078
1099
1143
1150{
1151 Q_D(const QRhiWidget);
1152 return d->rhi;
1153}
1154
1176{
1177 Q_D(const QRhiWidget);
1178 return d->colorTexture;
1179}
1180
1218{
1219 Q_D(const QRhiWidget);
1220 return d->msaaColorBuffer;
1221}
1222
1242{
1243 Q_D(const QRhiWidget);
1244 return d->resolveTexture;
1245}
1246
1260{
1261 Q_D(const QRhiWidget);
1262 return d->depthStencilBuffer;
1263}
1264
1284{
1285 Q_D(const QRhiWidget);
1286 return d->renderTarget;
1287}
1288
void setConfig(const QPlatformBackingStoreRhiConfig &config)
static QRhi::Implementation apiToRhiBackend(QPlatformBackingStoreRhiConfig::Api api)
\inmodule QtCore
Definition qcoreevent.h:45
@ WindowAboutToChangeInternal
Definition qcoreevent.h:285
Type type() const
Returns the event type.
Definition qcoreevent.h:304
static QPlatformIntegration * platformIntegration()
\inmodule QtGui
Definition qimage.h:37
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
Format
The following image formats are available in Qt.
Definition qimage.h:41
@ Format_RGBA8888
Definition qimage.h:59
@ Format_RGBA16FPx4
Definition qimage.h:73
@ Format_RGBA32FPx4
Definition qimage.h:76
@ Format_BGR30
Definition qimage.h:61
QImage mirrored(bool horizontally=false, bool vertically=true) const &
Definition qimage.h:219
void setDevicePixelRatio(qreal scaleFactor)
Sets the device pixel ratio for the image.
Definition qimage.cpp:1510
The QPaintEvent class contains event parameters for paint events.
Definition qevent.h:486
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore\reentrant
Definition qrect.h:30
The QResizeEvent class contains event parameters for resize events.
Definition qevent.h:548
const QSize & size() const
Returns the new size of the widget.
Definition qevent.h:553
\inmodule QtGui
Definition qrhi.h:576
\inmodule QtGui
Definition qrhi.h:1651
\inmodule QtGui
Definition qrhi.h:1094
void setPixelSize(const QSize &sz)
Sets the size (in pixels) to sz.
Definition qrhi.h:1116
QSize pixelSize() const
Definition qrhi.h:1115
virtual QRhiTexture::Format backingFormat() const =0
int sampleCount() const
Definition qrhi.h:1118
virtual bool create()=0
Creates the corresponding native graphics resources.
\inmodule QtGui
Definition qrhi.h:1158
void setRenderPassDescriptor(QRhiRenderPassDescriptor *desc)
Sets the QRhiRenderPassDescriptor desc for use with this render target.
Definition qrhi.h:1165
\inmodule QtGui
Definition qrhi.h:1731
void readBackTexture(const QRhiReadbackDescription &rb, QRhiReadbackResult *result)
Enqueues a texture-to-host copy operation as described by rb.
Definition qrhi.cpp:9186
void deleteLater()
When called without a frame being recorded, this function is equivalent to deleting the object.
Definition qrhi.cpp:3545
virtual QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor()=0
virtual bool create()=0
Creates the corresponding native graphics resources.
\inmodule QtGui
Definition qrhi.h:895
Format format() const
Definition qrhi.h:972
@ UsedAsTransferSource
Definition qrhi.h:902
@ RenderTarget
Definition qrhi.h:898
int sampleCount() const
Definition qrhi.h:995
virtual bool create()=0
Creates the corresponding native graphics resources.
@ RGBA32F
Definition qrhi.h:926
@ RGBA16F
Definition qrhi.h:925
@ RGB10A2
Definition qrhi.h:930
QSize pixelSize() const
Definition qrhi.h:975
void setPixelSize(const QSize &sz)
Sets the texture size, specified in pixels, to sz.
Definition qrhi.h:976
QRhiRenderPassDescriptor * renderPassDescriptor
QRhiWidget::TextureFormat widgetTextureFormat
QRhiTexture * colorTexture
bool invokeInitialize(QRhiCommandBuffer *cb)
QVector< QRhiResource * > pendingDeletes
QRhiTextureRenderTarget * renderTarget
QImage grabFramebuffer() override
QRhiRenderBuffer * msaaColorBuffer
QRhiTexture * resolveTexture
QBackingStoreRhiSupport offscreenRenderer
void resetRenderTargetObjects()
QRhiTexture::Format rhiTextureFormat
QPlatformBackingStoreRhiConfig rhiConfig() const override
QPlatformTextureList::Flags textureListFlags() override
void ensureTexture(bool *changed)
QRhiRenderBuffer * depthStencilBuffer
QPlatformBackingStoreRhiConfig config
TextureData texture() const override
void endCompose() override
void resetColorBufferObjects()
\inmodule QtWidgets
Definition qrhiwidget.h:19
int sampleCount
This property controls for sample count for multisample antialiasing.
Definition qrhiwidget.h:22
QRhi * rhi() const
void setMirrorVertically(bool enabled)
void setSampleCount(int samples)
void sampleCountChanged(int samples)
void setColorBufferFormat(TextureFormat format)
void setFixedColorBufferSize(QSize pixelSize)
virtual void initialize(QRhiCommandBuffer *cb)
Called when the widget is initialized for the first time, when the associated texture's size,...
void renderFailed()
This signal is emitted whenever the widget is supposed to render to its backing texture (either due t...
QImage grabFramebuffer() const
Renders a new frame, reads the contents of the texture back, and returns it as a QImage.
void resizeEvent(QResizeEvent *e) override
Handles resize events that are passed in the e event parameter.
QRhiTexture * resolveTexture() const
void mirrorVerticallyChanged(bool enabled)
QRhiWidget(QWidget *parent=nullptr, Qt::WindowFlags f={})
Constructs a widget which is a child of parent, with widget flags set to f.
void fixedColorBufferSizeChanged(const QSize &pixelSize)
QRhiRenderBuffer * depthStencilBuffer() const
TextureFormat colorBufferFormat
This property controls the texture format of the texture (or renderbuffer) used as the color buffer.
Definition qrhiwidget.h:23
bool isDebugLayerEnabled() const
void colorBufferFormatChanged(TextureFormat format)
~QRhiWidget() override
Destructor.
void setDebugLayerEnabled(bool enable)
Requests the debug or validation layer of the underlying graphics API when enable is true.
void setApi(Api api)
Sets the graphics API and QRhi backend to use to api.
bool event(QEvent *e) override
\reimp
virtual void render(QRhiCommandBuffer *cb)
Called when the widget contents (i.e.
Api
Specifies the 3D API and QRhi backend to use.
Definition qrhiwidget.h:32
virtual void releaseResources()
Called when the need to early-release the graphics resources arises.
QRhiTexture * colorTexture() const
TextureFormat
Specifies the format of the texture to which the QRhiWidget renders.
Definition qrhiwidget.h:42
bool isMirrorVerticallyEnabled() const
void paintEvent(QPaintEvent *e) override
Handles paint events.
QRhiRenderTarget * renderTarget() const
void setAutoRenderTarget(bool enabled)
Controls if a depth-stencil QRhiRenderBuffer and a QRhiTextureRenderTarget is created and maintained ...
bool isAutoRenderTargetEnabled() const
Api api() const
QSize fixedColorBufferSize
The fixed size, in pixels, of the QRhiWidget's associated texture.
Definition qrhiwidget.h:24
QRhiRenderBuffer * msaaColorBuffer() const
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
FrameOpResult endOffscreenFrame(EndFrameFlags flags={})
Ends, submits, and waits for the offscreen frame.
Definition qrhi.cpp:10912
bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags={}) const
Definition qrhi.cpp:10102
int resourceLimit(ResourceLimit limit) const
Definition qrhi.cpp:10121
bool isYUpInFramebuffer() const
Definition qrhi.cpp:10030
bool isFeatureSupported(QRhi::Feature feature) const
Definition qrhi.cpp:10110
QRhiRenderBuffer * newRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount=1, QRhiRenderBuffer::Flags flags={}, QRhiTexture::Format backingFormatHint=QRhiTexture::UnknownFormat)
Definition qrhi.cpp:10535
Implementation backend() const
Definition qrhi.cpp:8651
FrameOpResult beginOffscreenFrame(QRhiCommandBuffer **cb, BeginFrameFlags flags={})
Starts a new offscreen frame.
Definition qrhi.cpp:10893
QRhiTextureRenderTarget * newTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags={})
Definition qrhi.cpp:10682
const char * backendName() const
Definition qrhi.cpp:8683
void addCleanupCallback(const CleanupCallback &callback)
Registers a callback that is invoked either when the QRhi is destroyed, or when runCleanup() is calle...
Definition qrhi.cpp:8809
@ TextureSizeMin
Definition qrhi.h:1887
@ TextureSizeMax
Definition qrhi.h:1888
QRhiTexture * newTexture(QRhiTexture::Format format, const QSize &pixelSize, int sampleCount=1, QRhiTexture::Flags flags={})
Definition qrhi.cpp:10562
@ MultisampleRenderBuffer
Definition qrhi.h:1833
QRhiResourceUpdateBatch * nextResourceUpdateBatch()
Definition qrhi.cpp:9252
@ FrameOpSuccess
Definition qrhi.h:1825
\inmodule QtCore
Definition qsize.h:25
constexpr int height() const noexcept
Returns the height.
Definition qsize.h:133
constexpr int width() const noexcept
Returns the width.
Definition qsize.h:130
constexpr void setWidth(int w) noexcept
Sets the width to the given width.
Definition qsize.h:136
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
Definition qsize.h:124
constexpr void setHeight(int h) noexcept
Sets the height to the given height.
Definition qsize.h:139
static QWidgetPrivate * get(QWidget *w)
Definition qwidget_p.h:212
QRhi * rhi() const
Definition qwidget.cpp:1030
virtual QPlatformTextureList::Flags textureListFlags()
Definition qwidget_p.h:599
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QSize size
the size of the widget excluding any window frame
Definition qwidget.h:113
bool updatesEnabled
whether updates are enabled
Definition qwidget.h:143
void update()
Updates the widget unless updates are disabled or the widget is hidden.
bool enabled
whether the widget is enabled
Definition qwidget.h:105
bool event(QEvent *event) override
This is the main event handler; it handles event event.
Definition qwidget.cpp:8866
bool isVisible() const
Definition qwidget.h:874
#define this
Definition dialogs.cpp:9
qDeleteAll(list.begin(), list.end())
Combined button and popup list for selecting options.
#define Q_UNLIKELY(x)
EGLConfig config
#define qWarning
Definition qlogging.h:166
constexpr const T & qMin(const T &a, const T &b)
Definition qminmax.h:40
constexpr const T & qMax(const T &a, const T &b)
Definition qminmax.h:42
GLsizei samples
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLfloat GLfloat f
GLbitfield flags
GLboolean enable
GLint GLsizei GLsizei GLenum format
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLuint64EXT * result
[6]
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
#define emit
#define Q_UNUSED(x)
unsigned char uchar
Definition qtypes.h:32
QNetworkRequestFactory api
[0]
\inmodule QtGui
Definition qrhi.h:1723