42 #include "private/qdeclarativeborderimage_p.h" 43 #include "private/qdeclarativeborderimage_p_p.h" 46 #include <private/qdeclarativeengine_p.h> 48 #include <QNetworkRequest> 49 #include <QNetworkReply> 181 d->sciReply->deleteLater();
303 if ((
d->url.isEmpty() == url.
isEmpty()) && url ==
d->url)
307 d->sciReply->deleteLater();
322 qmlInfo(
this) <<
"Setting sourceSize for borderImage not supported";
328 if (
d->progress != 0.0) {
333 if (
d->url.isEmpty()) {
343 #ifndef QT_NO_LOCALFILE_OPTIMIZED_QML 355 static int sciReplyFinished = -1;
356 static int thisSciRequestFinished = -1;
357 if (sciReplyFinished == -1) {
360 thisSciRequestFinished =
369 QDeclarativePixmap::Options options;
377 if (
d->pix.isLoading()) {
381 QSize impsize =
d->pix.implicitSize();
385 if (
d->pix.isReady()) {
439 return d->getScaleGrid();
462 return d->horizontalTileMode;
468 if (t !=
d->horizontalTileMode) {
469 d->horizontalTileMode = t;
478 return d->verticalTileMode;
484 if (t !=
d->verticalTileMode) {
485 d->verticalTileMode = t;
508 QDeclarativePixmap::Options options;
516 if (
d->pix.isLoading()) {
517 static int thisRequestProgress = -1;
518 static int thisRequestFinished = -1;
519 if (thisRequestProgress == -1) {
520 thisRequestProgress =
522 thisRequestFinished =
526 d->pix.connectFinished(
this, thisRequestFinished);
527 d->pix.connectDownloadProgress(
this, thisRequestProgress);
531 QSize impsize =
d->pix.implicitSize();
535 if (
d->pix.isReady()) {
555 QSize impsize =
d->pix.implicitSize();
556 if (
d->pix.isError()) {
566 if (
d->sourcesize.width() !=
d->pix.width() ||
d->sourcesize.height() !=
d->pix.height())
575 #define BORDERIMAGE_MAX_REDIRECT 16 585 QUrl url =
d->sciReply->url().resolved(redirect.
toUrl());
594 d->sciReply->deleteLater();
599 d->sciReply->deleteLater();
613 if (
d->pix.isNull() ||
d->width() <= 0.0 ||
d->height() <= 0.0)
632 if (borderWidth > 0.0 &&
d->width() < borderWidth) {
635 right -=
qRound(diff *
qreal(right) / borderWidth);
637 int top = border->
top();
638 int bottom = border->
bottom();
639 qreal borderHeight = top + bottom;
640 if (borderHeight > 0.0 &&
d->height() < borderHeight) {
643 bottom -=
qRound(diff *
qreal(bottom) / borderHeight);
645 QMargins margins(left, top, right, bottom);
The QVariant class acts like a union for the most common Qt data types.
static QString urlToLocalFileOrQrc(const QUrl &url)
The QPainter class performs low-level painting on widgets and other paint devices.
QDeclarativeBorderImage::TileMode horizontalTileRule() const
QDeclarativeBorderImage(QDeclarativeItem *parent=0)
void sciRequestFinished()
const QTransform & transform() const
Returns the world transformation matrix.
#define QT_END_NAMESPACE
This macro expands to.
QDeclarativeParserStatus ** d
bool open(OpenMode flags)
Opens the file using OpenMode mode, returning true if successful; otherwise false.
bool isComponentComplete() const
Returns true if construction of the QML component is complete; otherwise returns false.
bool isEmpty() const
Returns true if the URL has no data; otherwise returns false.
TileMode horizontalTileMode() const
static const QMetaObject staticMetaObject
This variable stores the meta-object for the class.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool testRenderHint(RenderHint hint) const
Returns true if hint is set; otherwise returns false.
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
void setHorizontalTileMode(TileMode)
QDeclarativeScaleGrid * border()
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *)
qreal scale() const
Returns the scale factor of the item.
void statusChanged(QDeclarativeImageBase::Status)
int width() const
Returns the width.
void setRenderHint(RenderHint hint, bool on=true)
Sets the given render hint on the painter if on is true; otherwise clears the render hint...
TileMode verticalTileMode() const
#define QT_BEGIN_NAMESPACE
This macro expands to.
void setSourceSize(const QSize &)
The QDeclarativeItem class provides the most basic of all visual items in QML.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
void sourceChanged(const QUrl &)
void setImplicitWidth(qreal)
Sets the implied width of the item to w.
void setVerticalTileMode(TileMode)
QNetworkReply * get(const QNetworkRequest &request)
Posts a request to obtain the contents of the target request and returns a new QNetworkReply object o...
QUrl toUrl() const
Returns the variant as a QUrl if the variant has type() Url ; otherwise returns an invalid QUrl...
void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargins &targetMargins, const QPixmap &pixmap, const QRect &sourceRect, const QMargins &sourceMargins, const QTileRules &rules, QDrawBorderPixmap::DrawingHints hints)
Draws the indicated sourceRect rectangle from the given pixmap into the given targetRect rectangle...
The QDeclarativeScaleGrid class allows you to specify a 3x3 grid to use in scaling an image...
void setRenderHints(RenderHints hints, bool on=true)
Sets the given render hints on the painter if on is true; otherwise clears the render hints...
The QFile class provides an interface for reading from and writing to files.
void progressChanged(qreal progress)
Q_DECLARATIVE_EXPORT QDeclarativeEngine * qmlEngine(const QObject *)
Holds the rules used to draw a pixmap or image split into nine segments, similar to [CSS3 border-imag...
QDeclarativeBorderImage::TileMode verticalTileRule() const
void horizontalTileModeChanged()
int height() const
Returns the height.
The QRect class defines a rectangle in the plane using integer precision.
void setSource(const QUrl &url)
void setWorldTransform(const QTransform &matrix, bool combine=false)
Sets the world transformation matrix.
The QNetworkRequest class holds a request to be sent with QNetworkAccessManager.
void setGridScaledImage(const QDeclarativeGridScaledImage &sci)
void verticalTileModeChanged()
The QSize class defines the size of a two-dimensional object using integer point precision.
~QDeclarativeBorderImage()
The QMargins class defines the four margins of a rectangle.
QDeclarativeInfo qmlInfo(const QObject *me)
void setImplicitHeight(qreal)
Sets the implied height of the item to h.
QNetworkAccessManager * networkAccessManager() const
Returns a common QNetworkAccessManager which can be used by any QML element instantiated by this engi...
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
#define BORDERIMAGE_MAX_REDIRECT
Q_DECL_CONSTEXPR int qRound(qreal d)
void requestProgress(qint64, qint64)
QString pixmapUrl() const