summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2009-09-23 11:02:38 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-09-23 11:02:38 (GMT)
commita0b0a7b666714615109ae8698388e20966bb5e27 (patch)
tree6da7a469edf63767325088295e61d843d87ce4ff /src
parenta5f3e301a2026649704c71e0039fbddf0cda96fe (diff)
parentd1d65ed17d0f21e979a98ab695aa9e50c6ee078c (diff)
downloadQt-a0b0a7b666714615109ae8698388e20966bb5e27.zip
Qt-a0b0a7b666714615109ae8698388e20966bb5e27.tar.gz
Qt-a0b0a7b666714615109ae8698388e20966bb5e27.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src')
-rw-r--r--src/gui/graphicsview/qgraphicslayout.cpp18
-rw-r--r--src/gui/graphicsview/qgraphicslayout.h1
-rw-r--r--src/gui/styles/gtksymbols.cpp3
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp2
-rw-r--r--src/plugins/imageformats/jpeg/qjpeghandler.cpp6
5 files changed, 27 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicslayout.cpp b/src/gui/graphicsview/qgraphicslayout.cpp
index 0e4df71..f9800bc 100644
--- a/src/gui/graphicsview/qgraphicslayout.cpp
+++ b/src/gui/graphicsview/qgraphicslayout.cpp
@@ -419,6 +419,24 @@ void QGraphicsLayout::widgetEvent(QEvent *e)
\sa itemAt(), count()
*/
+/*!
+ This function is a convenience function provided for custom layouts, and will go through
+ all items in the layout and reparent their graphics items to the closest QGraphicsWidget
+ ancestor of the layout.
+
+ If \a layoutItem is already in a different layout, it will be removed from that layout.
+
+ If custom layouts want special behaviour they can ignore to use this function, and implement
+ their own behaviour.
+
+ \sa graphicsItem()
+ */
+void QGraphicsLayout::addChildLayoutItem(QGraphicsLayoutItem *layoutItem)
+{
+ Q_D(QGraphicsLayout);
+ d->addChildLayoutItem(layoutItem);
+}
+
QT_END_NAMESPACE
#endif //QT_NO_GRAPHICSVIEW
diff --git a/src/gui/graphicsview/qgraphicslayout.h b/src/gui/graphicsview/qgraphicslayout.h
index e872980..e214a62 100644
--- a/src/gui/graphicsview/qgraphicslayout.h
+++ b/src/gui/graphicsview/qgraphicslayout.h
@@ -78,6 +78,7 @@ public:
protected:
QGraphicsLayout(QGraphicsLayoutPrivate &, QGraphicsLayoutItem *);
+ void addChildLayoutItem(QGraphicsLayoutItem *layoutItem);
private:
Q_DISABLE_COPY(QGraphicsLayout)
diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp
index 23d25bd..1cb0ca4 100644
--- a/src/gui/styles/gtksymbols.cpp
+++ b/src/gui/styles/gtksymbols.cpp
@@ -211,7 +211,8 @@ static QString classPath(GtkWidget *widget)
static void resolveGtk()
{
- QLibrary libgtk(QLS("gtk-x11-2.0"));
+ // enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
+ QLibrary libgtk(QLS("gtk-x11-2.0"), 0, 0);
QGtk::gtk_init = (Ptr_gtk_init)libgtk.resolve("gtk_init");
QGtk::gtk_window_new = (Ptr_gtk_window_new)libgtk.resolve("gtk_window_new");
QGtk::gtk_style_attach = (Ptr_gtk_style_attach)libgtk.resolve("gtk_style_attach");
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 25f4184..9db1de8 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -297,7 +297,7 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph)
for (int y = 0; y < maskHeight; ++y) {
uchar *src = (uchar *) mask.scanLine(y);
for (int x = 0; x < maskWidth; ++x)
- src[x] = -src[x];
+ src[x] = -src[x]; // convert 0 and 1 into 0 and 255
}
}
diff --git a/src/plugins/imageformats/jpeg/qjpeghandler.cpp b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
index 5fcbb5f..3b23e56 100644
--- a/src/plugins/imageformats/jpeg/qjpeghandler.cpp
+++ b/src/plugins/imageformats/jpeg/qjpeghandler.cpp
@@ -895,7 +895,8 @@ static bool read_jpeg_image(QIODevice *device, QImage *outImage,
(void) jpeg_finish_decompress(&cinfo);
}
#ifndef QT_NO_IMAGE_SMOOTHSCALE
- } else if (scaledSize.isValid()) {
+ } else if (scaledSize.isValid() && scaledSize != QSize(cinfo.output_width, cinfo.output_height)
+ && quality >= HIGH_QUALITY_THRESHOLD) {
jpegSmoothScaler scaler(&cinfo, QString().sprintf("Scale( %d, %d, ScaleFree )",
scaledSize.width(),
@@ -946,6 +947,9 @@ static bool read_jpeg_image(QIODevice *device, QImage *outImage,
outImage->setDotsPerMeterX(int(100. * cinfo.X_density));
outImage->setDotsPerMeterY(int(100. * cinfo.Y_density));
}
+
+ if (scaledSize.isValid() && scaledSize != QSize(cinfo.output_width, cinfo.output_height))
+ *outImage = outImage->scaled(scaledSize, Qt::IgnoreAspectRatio, Qt::FastTransformation);
}
}