diff options
author | David Boddie <dboddie@trolltech.com> | 2009-09-01 14:13:44 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-09-01 14:13:44 (GMT) |
commit | 32619ba293c4d7f186ace3a4af3df6ab039ea135 (patch) | |
tree | e52edb7a0920fbd8a550ec3103d9bf40712f0d5b /src/gui | |
parent | 5e6934fc40186914ed37a3cdedc81e3cbee6d729 (diff) | |
parent | 500de752ac6af943ced98cd685ed460457b3166d (diff) | |
download | Qt-32619ba293c4d7f186ace3a4af3df6ab039ea135.zip Qt-32619ba293c4d7f186ace3a4af3df6ab039ea135.tar.gz Qt-32619ba293c4d7f186ace3a4af3df6ab039ea135.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/effects/qgraphicseffect.cpp | 13 | ||||
-rw-r--r-- | src/gui/effects/qgraphicseffect_p.h | 1 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem_p.h | 3 | ||||
-rw-r--r-- | src/gui/image/qicon.cpp | 13 | ||||
-rw-r--r-- | src/gui/image/qiconloader.cpp | 7 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_p.h | 10 | ||||
-rw-r--r-- | src/gui/styles/qwindowsvistastyle.cpp | 2 |
7 files changed, 31 insertions, 18 deletions
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp index 2be6a49..f60e80e 100644 --- a/src/gui/effects/qgraphicseffect.cpp +++ b/src/gui/effects/qgraphicseffect.cpp @@ -335,7 +335,7 @@ void QGraphicsEffect::setEnabled(bool enable) d->isEnabled = enable; if (d->source) - d->source->update(); + d->source->d_func()->effectBoundingRectChanged(); emit enabledChanged(enable); } @@ -390,7 +390,7 @@ void QGraphicsEffect::updateBoundingRect() { Q_D(QGraphicsEffect); if (d->source) - d->source->update(); + d->source->d_func()->effectBoundingRectChanged(); } /*! @@ -1129,19 +1129,20 @@ void QGraphicsOpacityEffect::draw(QPainter *painter, QGraphicsEffectSource *sour const QPixmap pixmap = source->pixmap(Qt::LogicalCoordinates, &offset); painter->drawPixmap(offset, pixmap); } else { - QRectF srcBrect = source->boundingRect(); - QPixmap pixmap(srcBrect.size().toSize()); + QRect srcBrect = source->boundingRect().toAlignedRect(); + offset = srcBrect.topLeft(); + QPixmap pixmap(srcBrect.size()); pixmap.fill(Qt::transparent); QPainter pixmapPainter(&pixmap); pixmapPainter.setRenderHints(painter->renderHints()); - pixmapPainter.translate(-srcBrect.topLeft()); + pixmapPainter.translate(-offset); source->draw(&pixmapPainter); pixmapPainter.setCompositionMode(QPainter::CompositionMode_DestinationIn); pixmapPainter.fillRect(srcBrect, d->opacityMask); pixmapPainter.end(); - painter->drawPixmap(srcBrect.topLeft(), pixmap); + painter->drawPixmap(offset, pixmap); } } else { // Draw pixmap in device coordinates to avoid pixmap scaling; diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h index bfabfc0..24b605f 100644 --- a/src/gui/effects/qgraphicseffect_p.h +++ b/src/gui/effects/qgraphicseffect_p.h @@ -76,6 +76,7 @@ public: virtual void update() = 0; virtual bool isPixmap() const = 0; virtual QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset = 0) const = 0; + virtual void effectBoundingRectChanged() = 0; friend class QGraphicsScenePrivate; friend class QGraphicsItem; friend class QGraphicsItemPrivate; diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index 1090620..49361cf 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -572,6 +572,9 @@ public: inline void update() { item->update(); } + inline void effectBoundingRectChanged() + { item->prepareGeometryChange(); } + inline bool isPixmap() const { return (item->type() == QGraphicsPixmapItem::Type); diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index a4ea6af..e23677f 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -888,10 +888,9 @@ void QIcon::setThemeSearchPaths(const QStringList &paths) On X11, the search path will use the XDG_DATA_DIRS environment variable if available. - On Windows the search path defaults to [Application Directory]/icons - - On Mac the default search path will search in the - [Contents/Resources/icons] part of the application bundle. + By default all platforms will have the resource directory + ":\icons" as their fallback. You can use "rcc -project" + to generate a resource file from your icon theme. \sa setThemeSearchPaths(), fromTheme(), setThemeName() */ @@ -906,7 +905,7 @@ QStringList QIcon::themeSearchPaths() Sets the current icon theme to \a name. The \a name should correspond to a directory name in the - current themeSearchPath() containing an index.theme + themeSearchPath() containing an index.theme file describing it's contents. \sa themeSearchPaths(), themeName() @@ -939,10 +938,6 @@ QString QIcon::themeName() icon theme. If no such icon is found in the current theme \a fallback is return instead. - To use an icon theme on Windows or Mac, you will need to - bundle a compliant theme with your application and make sure - it is located in your themeSarchPaths. - The lastest version of the freedesktop icon specification and naming spesification can be obtained here: http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index 279703c..cb1cc61 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -187,14 +187,17 @@ QStringList QIconLoader::themeSearchPaths() const QDir homeDir(QDir::homePath() + QLatin1String("/.icons")); if (homeDir.exists()) m_iconDirs.prepend(homeDir.path()); - -#elif defined(Q_WS_WIN) +#endif + +#if defined(Q_WS_WIN) m_iconDirs.append(qApp->applicationDirPath() + QLatin1String("/icons")); #elif defined(Q_WS_MAC) m_iconDirs.append(qApp->applicationDirPath() + QLatin1String("/../Resources/icons")); #endif + // Allways add resource directory as search path + m_iconDirs.append(QLatin1String(":/icons")); } return m_iconDirs; } diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index ff0c453..f69c3a7 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -727,6 +727,16 @@ public: inline bool isPixmap() const { return false; } + inline void effectBoundingRectChanged() + { + // ### This function should take a rect parameter; then we can avoid + // updating too much on the parent widget. + if (QWidget *parent = m_widget->parentWidget()) + parent->update(); + else + m_widget->update(); + } + inline const QStyleOption *styleOption() const { return 0; } diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp index a54c701..3789854 100644 --- a/src/gui/styles/qwindowsvistastyle.cpp +++ b/src/gui/styles/qwindowsvistastyle.cpp @@ -1094,7 +1094,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption XPThemeData theme(widget, painter, QLatin1String("PROGRESS"), vertical ? PP_FILLVERT : PP_FILL); theme.rect = option->rect; - bool reverse = bar->direction == (Qt::LeftToRight && inverted) || (bar->direction == Qt::RightToLeft && !inverted); + bool reverse = (bar->direction == Qt::LeftToRight && inverted) || (bar->direction == Qt::RightToLeft && !inverted); QTime current = QTime::currentTime(); if (isIndeterminate) { |