From d469d5e12635a6bad54fe8bc9404c1fdf209635c Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 7 Aug 2009 09:25:03 +1000 Subject: Fix warnings. --- src/declarative/fx/qfxlayoutitem.cpp | 3 ++- src/declarative/fx/qfxscalegrid.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/declarative/fx/qfxlayoutitem.cpp b/src/declarative/fx/qfxlayoutitem.cpp index 446a8d7..1f814e8 100644 --- a/src/declarative/fx/qfxlayoutitem.cpp +++ b/src/declarative/fx/qfxlayoutitem.cpp @@ -78,7 +78,7 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,LayoutItem,QFxLayoutItem) */ QFxLayoutItem::QFxLayoutItem(QFxItem* parent) - : QFxItem(parent), m_maximumSize(INT_MAX,INT_MAX), m_preferredSize(100,100), m_minimumSize(0,0) + : QFxItem(parent), m_maximumSize(INT_MAX,INT_MAX), m_minimumSize(0,0), m_preferredSize(100,100) { setGraphicsItem(this); } @@ -93,6 +93,7 @@ void QFxLayoutItem::setGeometry(const QRectF & rect) QSizeF QFxLayoutItem::sizeHint(Qt::SizeHint w, const QSizeF &constraint) const { + Q_UNUSED(constraint); if(w == Qt::MinimumSize){ return m_minimumSize; }else if(w == Qt::MaximumSize){ diff --git a/src/declarative/fx/qfxscalegrid.cpp b/src/declarative/fx/qfxscalegrid.cpp index 198ac6d..da3b4a3 100644 --- a/src/declarative/fx/qfxscalegrid.cpp +++ b/src/declarative/fx/qfxscalegrid.cpp @@ -41,6 +41,7 @@ #include #include +#include #include "qfxscalegrid_p.h" @@ -210,6 +211,9 @@ QFxScaleGrid::TileRule QFxGridScaledImage::stringToRule(const QString &s) const return QFxScaleGrid::Repeat; if (s == QLatin1String("Round")) return QFxScaleGrid::Round; + + qWarning() << "Unknown tile rule specified. Using Stretch"; + return QFxScaleGrid::Stretch; } bool QFxGridScaledImage::isValid() const -- cgit v0.12 From f0ec53447574e7d4bf2db426d9409e918f5acd69 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 7 Aug 2009 10:01:56 +1000 Subject: Make Flickr smooth again. --- demos/declarative/flickr/content/Progress.qml | 4 ++-- demos/declarative/flickr/content/Slider.qml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/demos/declarative/flickr/content/Progress.qml b/demos/declarative/flickr/content/Progress.qml index ae6bb18..4268963 100644 --- a/demos/declarative/flickr/content/Progress.qml +++ b/demos/declarative/flickr/content/Progress.qml @@ -6,7 +6,7 @@ Item { property var progress: 0 Rect { - id: Container; anchors.fill: parent + id: Container; anchors.fill: parent; smooth: true border.color: "white"; border.width: 0; radius: height/2 - 2 gradient: Gradient { GradientStop { position: 0; color: "#66343434" } @@ -18,7 +18,7 @@ Item { id: Fill y: 2; height: parent.height-4; x: 2; width: Math.max(parent.width * progress - 4, 0); - opacity: width < 1 ? 0 : 1 + opacity: width < 1 ? 0 : 1; smooth: true gradient: Gradient { GradientStop { position: 0; color: "lightsteelblue" } GradientStop { position: 1.0; color: "steelblue" } diff --git a/demos/declarative/flickr/content/Slider.qml b/demos/declarative/flickr/content/Slider.qml index 0c15ec6..51385bc 100644 --- a/demos/declarative/flickr/content/Slider.qml +++ b/demos/declarative/flickr/content/Slider.qml @@ -16,16 +16,16 @@ Item { gradient: Gradient { GradientStop { position: 0.0; color: "#66343434" } GradientStop { position: 1.0; color: "#66000000" } - } + } } Rect { - id: Handle + id: Handle; smooth: true x: Slider.width / 2 - Handle.width / 2; y: 2; width: 30; height: Slider.height-4; radius: 6 gradient: Gradient { GradientStop { position: 0.0; color: "lightgray" } GradientStop { position: 1.0; color: "gray" } - } + } MouseRegion { anchors.fill: parent; drag.target: parent -- cgit v0.12 From 2f298c32e13419d8942fa3ed6b561fa8c0cde24b Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 7 Aug 2009 10:02:41 +1000 Subject: Should be static --- src/declarative/fx/qfxscalegrid.cpp | 11 ++++++++--- src/declarative/fx/qfxscalegrid_p.h | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/declarative/fx/qfxscalegrid.cpp b/src/declarative/fx/qfxscalegrid.cpp index 198ac6d..6ea909d 100644 --- a/src/declarative/fx/qfxscalegrid.cpp +++ b/src/declarative/fx/qfxscalegrid.cpp @@ -41,6 +41,7 @@ #include #include +#include #include "qfxscalegrid_p.h" @@ -202,14 +203,18 @@ QFxGridScaledImage::QFxGridScaledImage(QIODevice *data) _pix = imgFile; } -QFxScaleGrid::TileRule QFxGridScaledImage::stringToRule(const QString &s) const +QFxScaleGrid::TileRule QFxGridScaledImage::stringToRule(const QString &s) { if (s == QLatin1String("Stretch")) return QFxScaleGrid::Stretch; - if (s == QLatin1String("Repeat")) + else if (s == QLatin1String("Repeat")) return QFxScaleGrid::Repeat; - if (s == QLatin1String("Round")) + else if (s == QLatin1String("Round")) return QFxScaleGrid::Round; + else { + qWarning() << "TileRule not supported:" << s; + return QFxScaleGrid::Stretch; + } } bool QFxGridScaledImage::isValid() const diff --git a/src/declarative/fx/qfxscalegrid_p.h b/src/declarative/fx/qfxscalegrid_p.h index a8df3c1..483ade1 100644 --- a/src/declarative/fx/qfxscalegrid_p.h +++ b/src/declarative/fx/qfxscalegrid_p.h @@ -119,7 +119,7 @@ public: QString pixmapUrl() const; private: - QFxScaleGrid::TileRule stringToRule(const QString &) const; + static QFxScaleGrid::TileRule stringToRule(const QString &); private: int _l; -- cgit v0.12