diff options
Diffstat (limited to 'examples/quick')
4 files changed, 14 insertions, 13 deletions
diff --git a/examples/quick/customitems/painteditem/textballoon.cpp b/examples/quick/customitems/painteditem/textballoon.cpp index 1713cc762f..bd8248e65e 100644 --- a/examples/quick/customitems/painteditem/textballoon.cpp +++ b/examples/quick/customitems/painteditem/textballoon.cpp @@ -67,23 +67,24 @@ void TextBalloon::paint(QPainter *painter) painter->setPen(Qt::NoPen); painter->setRenderHint(QPainter::Antialiasing); - painter->drawRoundedRect(0, 0, boundingRect().width(), boundingRect().height() - 10, 10, 10); + QSizeF itemSize = size(); + painter->drawRoundedRect(0, 0, itemSize.width(), itemSize.height() - 10, 10, 10); if (rightAligned) { const QPointF points[3] = { - QPointF(boundingRect().width() - 10.0, boundingRect().height() - 10.0), - QPointF(boundingRect().width() - 20.0, boundingRect().height()), - QPointF(boundingRect().width() - 30.0, boundingRect().height() - 10.0), + QPointF(itemSize.width() - 10.0, itemSize.height() - 10.0), + QPointF(itemSize.width() - 20.0, itemSize.height()), + QPointF(itemSize.width() - 30.0, itemSize.height() - 10.0), }; painter->drawConvexPolygon(points, 3); } else { const QPointF points[3] = { - QPointF(10.0, boundingRect().height() - 10.0), - QPointF(20.0, boundingRect().height()), - QPointF(30.0, boundingRect().height() - 10.0), + QPointF(10.0, itemSize.height() - 10.0), + QPointF(20.0, itemSize.height()), + QPointF(30.0, itemSize.height() - 10.0), }; painter->drawConvexPolygon(points, 3); } diff --git a/examples/quick/demos/photoviewer/main.cpp b/examples/quick/demos/photoviewer/main.cpp index 172d14307e..a269a61dcb 100644 --- a/examples/quick/demos/photoviewer/main.cpp +++ b/examples/quick/demos/photoviewer/main.cpp @@ -48,14 +48,14 @@ ** ****************************************************************************/ -#include <QApplication> +#include <QGuiApplication> #include <QQmlApplicationEngine> #include <QTranslator> #include <QDebug> int main(int argc, char *argv[]) { - QApplication app(argc, argv); + QGuiApplication app(argc, argv); QTranslator qtTranslator; qtTranslator.load("qml_" + QLocale::system().name(), ":/i18n/"); diff --git a/examples/quick/demos/photoviewer/photoviewer.pro b/examples/quick/demos/photoviewer/photoviewer.pro index 4bfdb86f31..68e43e13f9 100644 --- a/examples/quick/demos/photoviewer/photoviewer.pro +++ b/examples/quick/demos/photoviewer/photoviewer.pro @@ -1,6 +1,6 @@ TEMPLATE = app -QT += qml quick widgets xmlpatterns +QT += qml quick xmlpatterns SOURCES += main.cpp diff --git a/examples/quick/scenegraph/customgeometry/beziercurve.cpp b/examples/quick/scenegraph/customgeometry/beziercurve.cpp index ca3c6f524b..750ff6aa3b 100644 --- a/examples/quick/scenegraph/customgeometry/beziercurve.cpp +++ b/examples/quick/scenegraph/customgeometry/beziercurve.cpp @@ -152,7 +152,7 @@ QSGNode *BezierCurve::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) //! [7] //! [8] - QRectF bounds = boundingRect(); + QSizeF itemSize = size(); QSGGeometry::Point2D *vertices = geometry->vertexDataAsPoint2D(); for (int i = 0; i < m_segmentCount; ++i) { qreal t = i / qreal(m_segmentCount - 1); @@ -163,8 +163,8 @@ QSGNode *BezierCurve::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) + 3 * invt * t * t * m_p3 + t * t * t * m_p4; - float x = bounds.x() + pos.x() * bounds.width(); - float y = bounds.y() + pos.y() * bounds.height(); + float x = pos.x() * itemSize.width(); + float y = pos.y() * itemSize.height(); vertices[i].set(x, y); } |