summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWieland Hagen <wieland.hagen@kdab.com>2017-01-09 20:17:22 +0700
committerSimon Hausmann <simon.hausmann@qt.io>2017-01-10 21:06:50 +0000
commitb54eb8dbb89335f24ac0cb7b7d3cdb9e3aa890f9 (patch)
treed6c124e93a597e88889c152d83e7fc7882f777ca
parent4b9238ec1f96836dc386901e3126758755ce5559 (diff)
QPaintedTextureImage: documentation
Change-Id: If2bf137d971d9d208fb70d30c7ff018bab4fe7d0 Task-number: QTBUG-58020 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/render/texture/qpaintedtextureimage.cpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/render/texture/qpaintedtextureimage.cpp b/src/render/texture/qpaintedtextureimage.cpp
index 6de253128..9ae43378a 100644
--- a/src/render/texture/qpaintedtextureimage.cpp
+++ b/src/render/texture/qpaintedtextureimage.cpp
@@ -47,6 +47,26 @@ QT_BEGIN_NAMESPACE
namespace Qt3DRender {
+/*!
+ \class Qt3DRender::QPaintedTextureImage
+ \inmodule Qt3DRender
+ \since 5.8
+ \brief A QAbstractTextureImage that can be written through a QPainter
+
+ A QPaintedTextureImage provides a way to specify a texture image
+ (and thus an OpenGL texture) through a QPainter. The width and height of the
+ texture image can be specified through the width and height or size
+ properties.
+
+ A QPaintedTextureImage must be subclassed and the virtual paint() function
+ implemented. Each time update() is called on the QPaintedTextureImage,
+ the paint() function is invoked and the resulting image is uploaded.
+
+ The QPaintedTextureImage must be attached to some QAbstractTexture.
+ */
+
+
+
QPaintedTextureImagePrivate::QPaintedTextureImagePrivate()
: m_imageSize(256,256)
, m_generation(0)
@@ -81,24 +101,60 @@ QPaintedTextureImage::~QPaintedTextureImage()
{
}
+/*!
+ \property QPaintedTextureImage::width
+
+ Holds the width of the texture image
+ */
+
+/*!
+ \property QPaintedTextureImage::width
+
+ \return the width of the texture image.
+ */
int QPaintedTextureImage::width() const
{
Q_D(const QPaintedTextureImage);
return d->m_imageSize.width();
}
+/*!
+ \property QPaintedTextureImage::height
+
+ Holds the height of the texture image
+ */
+
+/*!
+ \property QPaintedTextureImage::height
+
+ \return the height of the texture image.
+ */
int QPaintedTextureImage::height() const
{
Q_D(const QPaintedTextureImage);
return d->m_imageSize.height();
}
+/*!
+ \property QPaintedTextureImage::size
+
+ Holds the width and height of the texture image
+ */
+
+/*!
+ \property QPaintedTextureImage::size
+
+ \return the size of the texture image.
+ */
QSize QPaintedTextureImage::size() const
{
Q_D(const QPaintedTextureImage);
return d->m_imageSize;
}
+/*!
+ Sets the width of the texture image. Triggers an update, if the size changes.
+ */
void QPaintedTextureImage::setWidth(int w)
{
if (w < 1) {
@@ -108,6 +164,9 @@ void QPaintedTextureImage::setWidth(int w)
setSize(QSize(w, height()));
}
+/*!
+ Sets the height of the texture image. Triggers an update, if the size changes.
+ */
void QPaintedTextureImage::setHeight(int h)
{
if (h < 1) {
@@ -117,6 +176,9 @@ void QPaintedTextureImage::setHeight(int h)
setSize(QSize(width(), h));
}
+/*!
+ Sets the width and height of the texture image. Triggers an update, if the size changes.
+ */
void QPaintedTextureImage::setSize(QSize size)
{
Q_D(QPaintedTextureImage);
@@ -143,6 +205,10 @@ void QPaintedTextureImage::setSize(QSize size)
}
}
+/*!
+ Will trigger an update of the texture image, meaning the paint() method will
+ be invoked.
+ */
void QPaintedTextureImage::update(const QRect &rect)
{
Q_UNUSED(rect)