7#include <QtQml/qqmlinfo.h>
8#include <QtQml/qqmlfile.h>
9#include <QtQml/qqmlengine.h>
10#if QT_CONFIG(qml_network)
11#include <QtNetwork/qnetworkreply.h>
13#include <QtCore/qfile.h>
14#include <QtCore/qmath.h>
15#include <QtGui/qguiapplication.h>
17#include <private/qqmlglobal_p.h>
18#include <private/qsgadaptationlayer_p.h>
150#if QT_CONFIG(qml_network)
153 d->sciReply->deleteLater();
251#if QT_CONFIG(qml_network)
253 d->sciReply->deleteLater();
254 d->sciReply =
nullptr;
270 if (
d->url.isEmpty()) {
282#if QT_CONFIG(qml_network)
287 d->sciReply =
qmlEngine(
this)->networkAccessManager()->get(req);
331 return d->getScaleGrid();
349 return d->horizontalTileMode;
355 if (
t !=
d->horizontalTileMode) {
356 d->horizontalTileMode =
t;
365 return d->verticalTileMode;
371 if (
t !=
d->verticalTileMode) {
372 d->verticalTileMode =
t;
401 QSize impsize =
d->pix.implicitSize();
402 if (
d->pix.isError()) {
417 if (
d->frameCount !=
d->pix.frameCount()) {
418 d->frameCount =
d->pix.frameCount();
419 emit frameCountChanged();
425#if QT_CONFIG(qml_network)
426void QQuickBorderImage::sciRequestFinished()
432 d->sciReply->deleteLater();
433 d->sciReply =
nullptr;
436 d->sciReply->deleteLater();
437 d->sciReply =
nullptr;
438 setGridScaledImage(sci);
443void QQuickBorderImage::doUpdate()
449 const QSize &sourceSize,
451 int horizontalTileMode,
452 int verticalTileMode,
453 qreal devicePixelRatio,
459 *innerSourceRect =
QRectF(0, 0, 1, 1);
461 *innerTargetRect = *targetRect;
468 if (borderLeft + borderRight > sourceSize.
width() && borderLeft < sourceSize.
width())
469 borderRight = sourceSize.
width() - borderLeft;
470 if (borderTop + borderBottom > sourceSize.
height() && borderTop < sourceSize.
height())
471 borderBottom = sourceSize.
height() - borderTop;
485 if (innerSourceRect->
width() <= 0)
490 hTiles =
qCeil(hTiles);
492 if (innerSourceRect->
height() <= 0)
497 vTiles =
qCeil(vTiles);
500 *subSourceRect =
QRectF(0, 0, hTiles, vTiles);
517 bool updatePixmap =
d->pixmapChanged;
518 d->pixmapChanged =
false;
520 node =
d->sceneGraphContext()->createInternalImageNode(
d->sceneGraphRenderContext());
532 d->calculateRects(
d->border,
534 d->horizontalTileMode,
d->verticalTileMode,
d->devicePixelRatio,
535 &targetRect, &innerTargetRect,
536 &innerSourceRect, &subSourceRect);
542 node->
setMirror(
d->mirrorHorizontally,
d->mirrorVertically);
546 if (innerSourceRect ==
QRectF(0, 0, 1, 1) && (subSourceRect.
width() > 1 || subSourceRect.
height() > 1)) {
562 d->pixmapChanged =
true;
580#include "moc_qquickborderimage_p.cpp"
bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
The QNetworkReply class contains the data and headers for a request sent with QNetworkAccessManager.
The QNetworkRequest class holds a request to be sent with QNetworkAccessManager.
\inmodule QtCore\reentrant
The QQmlContext class defines a context within a QML engine.
static QString urlToLocalFileOrQrc(const QString &)
If url is a local file returns a path suitable for passing to QFile.
QQuickBorderImage::TileMode verticalTileMode
static void calculateRects(const QQuickScaleGrid *border, const QSize &sourceSize, const QSizeF &targetSize, int horizontalTileMode, int verticalTileMode, qreal devicePixelRatio, QRectF *targetRect, QRectF *innerTargetRect, QRectF *innerSourceRect, QRectF *subSourceRect)
QQuickBorderImage::TileMode horizontalTileMode
void setHorizontalTileMode(TileMode)
void verticalTileModeChanged()
QQuickBorderImage(QQuickItem *parent=nullptr)
\qmltype BorderImage \instantiates QQuickBorderImage \inqmlmodule QtQuick
QSGNode * updatePaintNode(QSGNode *, UpdatePaintNodeData *) override
Called on the render thread when it is time to sync the state of the item with the scene graph.
void pixmapChange() override
void setSource(const QUrl &url) override
\qmlproperty enumeration QtQuick::BorderImage::status
void requestFinished() override
void horizontalTileModeChanged()
void setVerticalTileMode(TileMode)
TileMode verticalTileMode
TileMode horizontalTileMode
QQuickBorderImage::TileMode horizontalTileRule() const
QString pixmapUrl() const
QQuickBorderImage::TileMode verticalTileRule() const
void loadPixmap(const QUrl &url, LoadPixmapOptions loadOptions=NoOption)
void sourceChanged(const QUrl &)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
QQuickWindow * window() const
Returns the window in which this item is rendered.
qreal width
This property holds the width of this item.
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
qreal height
This property holds the height of this item.
void update()
Schedules a call to updatePaintNode() for this item.
void setImplicitSize(qreal, qreal)
The QQuickScaleGrid class allows you to specify a 3x3 grid to use in scaling an image.
\inmodule QtCore\reentrant
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
virtual void setHorizontalWrapMode(QSGTexture::WrapMode wrapMode)=0
virtual void setTexture(QSGTexture *texture)=0
virtual void setTargetRect(const QRectF &rect)=0
virtual void setFiltering(QSGTexture::Filtering filtering)=0
virtual void setInnerSourceRect(const QRectF &rect)=0
virtual void setSubSourceRect(const QRectF &rect)=0
virtual void setInnerTargetRect(const QRectF &rect)=0
virtual void setAntialiasing(bool antialiasing)
virtual void setMipmapFiltering(QSGTexture::Filtering filtering)=0
virtual void setMirror(bool horizontally, bool vertically)=0
virtual void setVerticalWrapMode(QSGTexture::WrapMode wrapMode)=0
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
constexpr qreal width() const noexcept
Returns the width.
constexpr qreal height() const noexcept
Returns the height.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Combined button and popup list for selecting options.
GLint GLenum GLsizei GLsizei GLsizei GLint border
QQmlEngine * qmlEngine(const QObject *obj)
QQmlContext * qmlContext(const QObject *obj)
#define qmlobject_connect(Sender, SenderType, Signal, Receiver, ReceiverType, Method)
Connect Signal of Sender to Method of Receiver.
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
QUrl url("example.com")
[constructor-url-reference]
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent