summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarius Bugge Monsen <mmonsen@trolltech.com>2009-10-08 10:38:45 (GMT)
committerMarius Bugge Monsen <mmonsen@trolltech.com>2009-10-08 10:38:45 (GMT)
commit922cf20905d829d1a4ec9205beacbee27efe35f8 (patch)
tree7a6cb45c5cf99079de6a755b993a6157820ec76a /src
parentdf886d78631a8a7ea3aa8fdbb9da18d5a3387ed1 (diff)
parent6744bb7292c1a506e226d7ea214b7d86f6047e9d (diff)
downloadQt-922cf20905d829d1a4ec9205beacbee27efe35f8.zip
Qt-922cf20905d829d1a4ec9205beacbee27efe35f8.tar.gz
Qt-922cf20905d829d1a4ec9205beacbee27efe35f8.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/3rdparty/phonon/phonon/objectdescriptionmodel.h16
-rw-r--r--src/corelib/global/qnamespace.h4
-rw-r--r--src/corelib/global/qnamespace.qdoc8
-rw-r--r--src/corelib/tools/qdatetime.cpp32
-rw-r--r--src/gui/dialogs/qdialog.cpp22
-rw-r--r--src/gui/dialogs/qfiledialog_p.h2
-rw-r--r--src/gui/dialogs/qprintdialog_win.cpp7
-rw-r--r--src/gui/image/qicon.cpp5
-rw-r--r--src/gui/image/qiconloader.cpp88
-rw-r--r--src/gui/image/qpixmap_s60.cpp45
-rw-r--r--src/gui/image/qpixmap_s60_p.h4
-rw-r--r--src/gui/inputmethod/qwininputcontext_p.h13
-rw-r--r--src/gui/inputmethod/qwininputcontext_win.cpp2
-rw-r--r--src/gui/inputmethod/qximinputcontext_x11.cpp2
-rw-r--r--src/gui/itemviews/qfileiconprovider.cpp5
-rw-r--r--src/gui/kernel/qapplication_win.cpp5
-rw-r--r--src/gui/kernel/qguiplatformplugin.cpp68
-rw-r--r--src/gui/kernel/qguiplatformplugin_p.h8
-rw-r--r--src/gui/styles/qcommonstyle.cpp2
-rw-r--r--src/gui/util/qdesktopservices_win.cpp9
-rw-r--r--src/gui/widgets/qdialogbuttonbox.cpp18
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp37
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h5
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp75
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h1
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp21
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h2
-rw-r--r--src/s60installs/eabi/QtGuiu.def38
-rw-r--r--src/s60installs/eabi/QtScriptu.def1
-rw-r--r--src/s60installs/eabi/phononu.def20
-rw-r--r--src/script/api/qscriptengine_p.h16
-rw-r--r--src/script/api/qscriptvalue.cpp20
-rw-r--r--src/script/api/qscriptvalue_p.h6
33 files changed, 368 insertions, 239 deletions
diff --git a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h
index 9af2615..ba3cb42 100644
--- a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h
+++ b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h
@@ -175,18 +175,26 @@ namespace Phonon
* \author Matthias Kretz <kretz@kde.org>
*/
template<ObjectDescriptionType type>
- class PHONON_EXPORT ObjectDescriptionModel : public QAbstractListModel
+ class ObjectDescriptionModel : public QAbstractListModel
{
public:
Q_OBJECT_CHECK
+/* MinGW 3.4.x gives an ICE when trying to instantiate one of the
+ ObjectDescriptionModel<foo> classes because it can't handle
+ half exported classes correct. gcc 4.3.x has a fix for this but
+ we currently there's no official gcc 4.3 on windows available.
+ Because of this we need this little hack
+ */
+#if !defined(Q_CC_MINGW) || __MINGW32_MAJOR_VERSION >= 4
/** \internal */
- static const QMetaObject staticMetaObject;
+ static PHONON_EXPORT const QMetaObject staticMetaObject;
/** \internal */
- const QMetaObject *metaObject() const;
+ PHONON_EXPORT const QMetaObject *metaObject() const;
/** \internal */
- void *qt_metacast(const char *_clname);
+ PHONON_EXPORT void *qt_metacast(const char *_clname);
//int qt_metacall(QMetaObject::Call _c, int _id, void **_a);
+#endif
/**
* Returns the number of rows in the model. This value corresponds
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index 9d76dcc..4234a7e 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -71,8 +71,8 @@ Qt {
Q_ENUMS(ArrowType ToolButtonStyle PenStyle PenCapStyle PenJoinStyle BrushStyle)
Q_ENUMS(FillRule MaskMode BGMode ClipOperation SizeMode)
Q_ENUMS(BackgroundMode) // Qt3
- Q_ENUMS(Axis Corner LayoutDirection SizeHint Orientation)
- Q_FLAGS(Alignment Orientations)
+ Q_ENUMS(Axis Corner LayoutDirection SizeHint Orientation DropAction)
+ Q_FLAGS(Alignment Orientations DropActions)
Q_FLAGS(DockWidgetAreas ToolBarAreas)
Q_ENUMS(DockWidgetArea ToolBarArea)
Q_ENUMS(TextFormat)
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index b7775bd..ab232bf 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -713,7 +713,13 @@
\omitvalue Dither_Mask
\omitvalue AlphaDither_Mask
\omitvalue DitherMode_Mask
- \omitvalue NoOpaqueDetection
+
+ \value NoOpaqueDetection Do not check whether the image contains non-opaque
+ pixels. Use this if you know that the image is semi-transparent and
+ you want to avoid the overhead of checking the pixels in the image
+ until a non-opaque pixel is found, or if you want the pixmap to
+ retain an alpha channel for some other reason. If the image has no
+ alpha channel this flag has no effect.
*/
/*! \enum Qt::GUIStyle
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 1b559cf..1277623 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -54,7 +54,6 @@
#ifndef Q_WS_WIN
#include <locale.h>
#endif
-
#include <time.h>
#if defined(Q_OS_WINCE)
#include "qfunctions_wince.h"
@@ -69,6 +68,31 @@
# define QDTPDEBUGN if (false) qDebug
#endif
+#if defined(Q_OS_SYMBIAN)
+ // Workaround for OpenC bug.
+
+ // OpenC incorrectly caches DST information between localtime_r
+ // calls, i.e. if previous call to localtime_r has been called for DST
+ // affected date, also the second call will be affected by DST even
+ // the date is such that DST should not be applied.
+
+ // The workaround is to call mktime with non-DST affected date before
+ // calling localtime_r. mktime call resets the OpenC internal DST cache
+ // to right value and localtime_r will return correct values.
+#define FIX_OPENC_DSTCACHE \
+ tm localTM; \
+ localTM.tm_sec = 0; \
+ localTM.tm_min = 0; \
+ localTM.tm_hour = 12; \
+ localTM.tm_mday = 1; \
+ localTM.tm_mon = 1; \
+ localTM.tm_year = 2002 - 1900; \
+ localTM.tm_isdst = -1; \
+ time_t temp = mktime(&localTM);
+#else
+#define FIX_OPENC_DSTCACHE
+#endif
+
#if defined(Q_WS_MAC)
#include <private/qcore_mac_p.h>
#endif
@@ -1138,6 +1162,7 @@ QDate QDate::currentDate()
// use the reentrant version of localtime() where available
tzset();
tm res;
+ FIX_OPENC_DSTCACHE
t = localtime_r(&ltime, &res);
#else
t = localtime(&ltime);
@@ -1834,12 +1859,13 @@ QTime QTime::currentTime()
// use the reentrant version of localtime() where available
tzset();
tm res;
+ FIX_OPENC_DSTCACHE
t = localtime_r(&ltime, &res);
#else
t = localtime(&ltime);
#endif
Q_CHECK_PTR(t);
-
+
ct.mds = MSECS_PER_HOUR * t->tm_hour + MSECS_PER_MIN * t->tm_min + 1000 * t->tm_sec
+ tv.tv_usec / 1000;
#else
@@ -2887,6 +2913,7 @@ QDateTime QDateTime::currentDateTime()
// use the reentrant version of localtime() where available
tzset();
tm res;
+ FIX_OPENC_DSTCACHE
t = localtime_r(&ltime, &res);
#else
t = localtime(&ltime);
@@ -3704,6 +3731,7 @@ static QDateTimePrivate::Spec utcToLocal(QDate &date, QTime &time)
// use the reentrant version of localtime() where available
tzset();
tm res;
+ FIX_OPENC_DSTCACHE
brokenDown = localtime_r(&secsSince1Jan1970UTC, &res);
#elif defined(_MSC_VER) && _MSC_VER >= 1400
tm res;
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp
index 7df49fa..ed2d676 100644
--- a/src/gui/dialogs/qdialog.cpp
+++ b/src/gui/dialogs/qdialog.cpp
@@ -673,28 +673,6 @@ void QDialog::keyPressEvent(QKeyEvent *e)
case Qt::Key_Escape:
reject();
break;
- case Qt::Key_Up:
- case Qt::Key_Left:
- if (focusWidget() &&
- (focusWidget()->focusPolicy() == Qt::StrongFocus ||
- focusWidget()->focusPolicy() == Qt::WheelFocus)) {
- e->ignore();
- break;
- }
- // call ours, since c++ blocks us from calling the one
- // belonging to focusWidget().
- focusNextPrevChild(false);
- break;
- case Qt::Key_Down:
- case Qt::Key_Right:
- if (focusWidget() &&
- (focusWidget()->focusPolicy() == Qt::StrongFocus ||
- focusWidget()->focusPolicy() == Qt::WheelFocus)) {
- e->ignore();
- break;
- }
- focusNextPrevChild(true);
- break;
default:
e->ignore();
return;
diff --git a/src/gui/dialogs/qfiledialog_p.h b/src/gui/dialogs/qfiledialog_p.h
index 44289d9..32cd397 100644
--- a/src/gui/dialogs/qfiledialog_p.h
+++ b/src/gui/dialogs/qfiledialog_p.h
@@ -76,7 +76,7 @@
#include <qdebug.h>
#include "qsidebar_p.h"
#include "qfscompleter_p.h"
-#include "../kernel/qguiplatformplugin_p.h"
+#include "private/qguiplatformplugin_p.h"
#if defined (Q_OS_UNIX)
diff --git a/src/gui/dialogs/qprintdialog_win.cpp b/src/gui/dialogs/qprintdialog_win.cpp
index f66c27f..843c4e2 100644
--- a/src/gui/dialogs/qprintdialog_win.cpp
+++ b/src/gui/dialogs/qprintdialog_win.cpp
@@ -52,6 +52,13 @@
#include <private/qprintengine_win_p.h>
#include <private/qprinter_p.h>
+#if defined(Q_CC_MINGW) && !defined(PD_NOCURRENTPAGE)
+#define PD_NOCURRENTPAGE 0x00800000
+#define PD_RESULT_PRINT 1
+#define PD_RESULT_APPLY 2
+#define START_PAGE_GENERAL 0XFFFFFFFF
+#endif
+
QT_BEGIN_NAMESPACE
extern void qt_win_eatMouseMove();
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index 3448459..e0779a0 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -962,15 +962,10 @@ QString QIcon::themeName()
*/
QIcon QIcon::fromTheme(const QString &name, const QIcon &fallback)
{
-
static QCache <QString, QIcon> iconCache;
QIcon icon;
- icon = qt_guiPlatformPlugin()->loadIcon(name);
- if (!icon.isNull())
- return icon;
-
if (iconCache.contains(name)) {
icon = *iconCache.object(name);
} else {
diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
index adc2967..5412e11 100644
--- a/src/gui/image/qiconloader.cpp
+++ b/src/gui/image/qiconloader.cpp
@@ -43,7 +43,7 @@
#include <private/qapplication_p.h>
#include <private/qicon_p.h>
-#include <private/qkde_p.h>
+#include <private/qguiplatformplugin_p.h>
#include <QtGui/QIconEnginePlugin>
#include <QtGui/QPixmapCache>
@@ -68,47 +68,25 @@ QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QIconLoader, iconLoaderInstance)
+/* Theme to use in last resort, if the theme does not have the icon, neither the parents */
static QString fallbackTheme()
{
- QString defaultTheme;
-#ifdef Q_WS_X11
- if (X11->desktopEnvironment == DE_GNOME)
- defaultTheme = QLatin1String("gnome");
- else if (X11->desktopEnvironment == DE_KDE)
- defaultTheme = X11->desktopVersion >= 4 ?
- QString::fromLatin1("oxygen") :
- QString::fromLatin1("crystalsvg");
-#endif
- return defaultTheme;
-}
-
-static QString systemThemeName()
-{
- QString result = fallbackTheme();
#ifdef Q_WS_X11
if (X11->desktopEnvironment == DE_GNOME) {
-#ifndef QT_NO_STYLE_GTK
- result = QGtk::getGConfString(QLatin1String("/desktop/gnome/interface/icon_theme"),
- result);
-#endif
+ return QLatin1String("gnome");
} else if (X11->desktopEnvironment == DE_KDE) {
- QSettings settings(QKde::kdeHome() +
- QLatin1String("/share/config/kdeglobals"),
- QSettings::IniFormat);
-
- settings.beginGroup(QLatin1String("Icons"));
-
- result = settings.value(QLatin1String("Theme"), result).toString();
+ return X11->desktopVersion >= 4
+ ? QString::fromLatin1("oxygen")
+ : QString::fromLatin1("crystalsvg");
}
#endif
- return result;
+ return QString();
}
-
QIconLoader::QIconLoader() :
m_themeKey(1), m_supportsSvg(false)
{
- m_systemTheme = systemThemeName();
+ m_systemTheme = qt_guiPlatformPlugin()->systemIconThemeName();
QFactoryLoader iconFactoryLoader(QIconEngineFactoryInterfaceV2_iid,
QLatin1String("/iconengines"),
@@ -128,7 +106,7 @@ void QIconLoader::updateSystemTheme()
{
// Only change if this is not explicitly set by the user
if (m_userTheme.isEmpty()) {
- QString theme = systemThemeName();
+ QString theme = qt_guiPlatformPlugin()->systemIconThemeName();
if (theme != m_systemTheme) {
m_systemTheme = theme;
invalidateKey();
@@ -152,51 +130,7 @@ void QIconLoader::setThemeSearchPath(const QStringList &searchPaths)
QStringList QIconLoader::themeSearchPaths() const
{
if (m_iconDirs.isEmpty()) {
-
-#if defined(Q_WS_X11)
-
- QString xdgDirString = QFile::decodeName(getenv("XDG_DATA_DIRS"));
- if (xdgDirString.isEmpty())
- xdgDirString = QLatin1String("/usr/local/share/:/usr/share/");
-
- QStringList xdgDirs = xdgDirString.split(QLatin1Char(':'));
-
- for (int i = 0 ; i < xdgDirs.size() ; ++i) {
- QDir dir(xdgDirs[i]);
- if (dir.exists())
- m_iconDirs.append(dir.path() +
- QLatin1String("/icons"));
- }
-
- if (X11->desktopEnvironment == DE_KDE) {
-
- m_iconDirs << QLatin1Char(':') +
- QKde::kdeHome() +
- QLatin1String("/share/icons");
- QStringList kdeDirs =
- QFile::decodeName(getenv("KDEDIRS")).split(QLatin1Char(':'));
-
- for (int i = 0 ; i< kdeDirs.count() ; ++i) {
- QDir dir(QLatin1Char(':') + kdeDirs.at(i) +
- QLatin1String("/share/icons"));
- if (dir.exists())
- m_iconDirs.append(dir.path());
- }
- }
-
- // Add home directory first in search path
- QDir homeDir(QDir::homePath() + QLatin1String("/.icons"));
- if (homeDir.exists())
- m_iconDirs.prepend(homeDir.path());
-#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
+ m_iconDirs = qt_guiPlatformPlugin()->iconThemeSearchPaths();
// Allways add resource directory as search path
m_iconDirs.append(QLatin1String(":/icons"));
}
@@ -291,7 +225,7 @@ QThemeIconEntries QIconLoader::findIconHelper(const QString &themeName,
if (!theme.isValid()) {
theme = QIconTheme(themeName);
if (!theme.isValid())
- theme = fallbackTheme();
+ theme = QIconTheme(fallbackTheme());
themeList.insert(themeName, theme);
}
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index 37b6438..554c0f3 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -229,24 +229,15 @@ static CFbsBitmap* uncompress(CFbsBitmap* bitmap)
lock.relock();
- CBitmapContext *bitmapContext = 0;
CFbsBitmapDevice* bitmapDevice = 0;
+ CFbsBitGc *bitmapGc = 0;
QT_TRAP_THROWING(bitmapDevice = CFbsBitmapDevice::NewL(uncompressed));
- TInt err = bitmapDevice->CreateBitmapContext(bitmapContext);
- if (err != KErrNone) {
- delete bitmap;
- delete bitmapDevice;
- bitmap = 0;
- bitmapDevice = 0;
-
- lock.relock();
+ QT_TRAP_THROWING(bitmapGc = CFbsBitGc::NewL());
+ bitmapGc->Activate(bitmapDevice);
- return bitmap;
- }
+ bitmapGc->DrawBitmap(TPoint(), bitmap);
- bitmapContext->DrawBitmap(TPoint(), bitmap);
-
- delete bitmapContext;
+ delete bitmapGc;
delete bitmapDevice;
return uncompressed;
@@ -355,7 +346,7 @@ QS60PixmapData::QS60PixmapData(PixelType type) : QRasterPixmapData(type),
symbianBitmapDataAccess(new QSymbianBitmapDataAccess),
cfbsBitmap(0),
bitmapDevice(0),
- bitmapContext(0),
+ bitmapGc(0),
pengine(0),
bytes(0)
{
@@ -365,6 +356,7 @@ QS60PixmapData::QS60PixmapData(PixelType type) : QRasterPixmapData(type),
QS60PixmapData::~QS60PixmapData()
{
release();
+ delete symbianBitmapDataAccess;
}
void QS60PixmapData::resize(int width, int height)
@@ -391,6 +383,8 @@ void QS60PixmapData::resize(int width, int height)
if(cfbsBitmap->SizeInPixels() != newSize) {
cfbsBitmap->Resize(TSize(width, height));
+ bitmapDevice->Resize(TSize(width, height));
+ bitmapGc->Resized();
if(pengine) {
delete pengine;
pengine = 0;
@@ -404,12 +398,9 @@ void QS60PixmapData::resize(int width, int height)
bool QS60PixmapData::initSymbianBitmapContext()
{
QT_TRAP_THROWING(bitmapDevice = CFbsBitmapDevice::NewL(cfbsBitmap));
- TInt err = bitmapDevice->CreateBitmapContext(bitmapContext);
- if (err != KErrNone) {
- delete bitmapDevice;
- bitmapDevice = 0;
- return false;
- }
+ QT_TRAP_THROWING(bitmapGc = CFbsBitGc::NewL());
+ bitmapGc->Activate(bitmapDevice);
+
return true;
}
@@ -417,7 +408,7 @@ void QS60PixmapData::release()
{
if (cfbsBitmap) {
QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock);
- delete bitmapContext;
+ delete bitmapGc;
delete bitmapDevice;
delete cfbsBitmap;
lock.relock();
@@ -426,7 +417,7 @@ void QS60PixmapData::release()
delete pengine;
image = QImage();
cfbsBitmap = 0;
- bitmapContext = 0;
+ bitmapGc = 0;
bitmapDevice = 0;
pengine = 0;
bytes = 0;
@@ -559,13 +550,15 @@ void QS60PixmapData::copy(const QPixmapData *data, const QRect &rect)
resize(rect.width(), rect.height());
cfbsBitmap->SetDisplayMode(s60Data->cfbsBitmap->DisplayMode());
- bitmapContext->BitBlt(TPoint(0, 0), s60Data->cfbsBitmap, qt_QRect2TRect(rect));
+ bitmapGc->BitBlt(TPoint(0, 0), s60Data->cfbsBitmap, qt_QRect2TRect(rect));
}
bool QS60PixmapData::scroll(int dx, int dy, const QRect &rect)
{
- bitmapContext->CopyRect(TPoint(dx, dy), qt_QRect2TRect(rect));
- return true;
+ beginDataAccess();
+ bool res = QRasterPixmapData::scroll(dx, dy, rect);
+ endDataAccess();
+ return res;
}
int QS60PixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
diff --git a/src/gui/image/qpixmap_s60_p.h b/src/gui/image/qpixmap_s60_p.h
index 4498c05..b23961a 100644
--- a/src/gui/image/qpixmap_s60_p.h
+++ b/src/gui/image/qpixmap_s60_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
class CFbsBitmap;
class CFbsBitmapDevice;
-class CBitmapContext;
+class CFbsBitGc;
class QSymbianBitmapDataAccess;
@@ -114,7 +114,7 @@ private:
CFbsBitmap *cfbsBitmap;
CFbsBitmapDevice *bitmapDevice;
- CBitmapContext *bitmapContext;
+ CFbsBitGc *bitmapGc;
QPaintEngine *pengine;
uchar* bytes;
diff --git a/src/gui/inputmethod/qwininputcontext_p.h b/src/gui/inputmethod/qwininputcontext_p.h
index 39d50fd..dd0490d 100644
--- a/src/gui/inputmethod/qwininputcontext_p.h
+++ b/src/gui/inputmethod/qwininputcontext_p.h
@@ -56,6 +56,19 @@
#include "QtGui/qinputcontext.h"
#include "QtCore/qt_windows.h"
+#if defined(Q_CC_MINGW) && !defined(IMR_RECONVERTSTRING)
+typedef struct tagRECONVERTSTRING {
+ DWORD dwSize;
+ DWORD dwVersion;
+ DWORD dwStrLen;
+ DWORD dwStrOffset;
+ DWORD dwCompStrLen;
+ DWORD dwCompStrOffset;
+ DWORD dwTargetStrLen;
+ DWORD dwTargetStrOffset;
+} RECONVERTSTRING, *PRECONVERTSTRING;
+#endif
+
QT_BEGIN_NAMESPACE
class QWinInputContext : public QInputContext
diff --git a/src/gui/inputmethod/qwininputcontext_win.cpp b/src/gui/inputmethod/qwininputcontext_win.cpp
index 4a160d7..e9ab870 100644
--- a/src/gui/inputmethod/qwininputcontext_win.cpp
+++ b/src/gui/inputmethod/qwininputcontext_win.cpp
@@ -701,7 +701,7 @@ void QWinInputContext::updateImeStatus(QWidget *w, bool hasFocus)
if (!focusProxyWidget)
focusProxyWidget = w;
bool e = w->testAttribute(Qt::WA_InputMethodEnabled) && w->isEnabled()
- && !(focusProxyWidget->inputMethodHints() & Qt::ImhExclusiveInputMask);
+ && !(focusProxyWidget->inputMethodHints() & (Qt::ImhExclusiveInputMask | Qt::ImhHiddenText));
bool hasIme = e && hasFocus;
#ifdef Q_IME_DEBUG
qDebug("%s HasFocus = %d hasIme = %d e = %d ", w->className(), hasFocus, hasIme, e);
diff --git a/src/gui/inputmethod/qximinputcontext_x11.cpp b/src/gui/inputmethod/qximinputcontext_x11.cpp
index bee3ce8..b46b162 100644
--- a/src/gui/inputmethod/qximinputcontext_x11.cpp
+++ b/src/gui/inputmethod/qximinputcontext_x11.cpp
@@ -612,7 +612,7 @@ void QXIMInputContext::setFocusWidget(QWidget *w)
QInputContext::setFocusWidget(w);
- if (!w || w->inputMethodHints() & Qt::ImhExclusiveInputMask)
+ if (!w || w->inputMethodHints() & (Qt::ImhExclusiveInputMask | Qt::ImhHiddenText))
return;
ICData *data = ximData.value(w->effectiveWinId());
diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp
index c78a49b..e3d17ad 100644
--- a/src/gui/itemviews/qfileiconprovider.cpp
+++ b/src/gui/itemviews/qfileiconprovider.cpp
@@ -61,6 +61,7 @@
#endif
#include <private/qfunctions_p.h>
+#include <private/qguiplatformplugin_p.h>
#ifndef SHGFI_ADDOVERLAYS
#define SHGFI_ADDOVERLAYS 0x000000020
@@ -385,6 +386,10 @@ QIcon QFileIconProvider::icon(const QFileInfo &info) const
{
Q_D(const QFileIconProvider);
+ QIcon platformIcon = qt_guiPlatformPlugin()->fileSystemIcon(info);
+ if (!platformIcon.isNull())
+ return platformIcon;
+
#if defined(Q_WS_X11) && !defined(QT_NO_STYLE_GTK)
if (X11->desktopEnvironment == DE_GNOME) {
QIcon gtkIcon = QGtk::getFilesystemIcon(info);
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 44f82b6..270562f 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -171,10 +171,13 @@ typedef struct tagTOUCHINPUT
#include <mywinsock.h>
#endif
+#ifndef IMR_RECONVERTSTRING
+#define IMR_RECONVERTSTRING 4
+#endif
+
#ifndef IMR_CONFIRMRECONVERTSTRING
#define IMR_CONFIRMRECONVERTSTRING 0x0005
#endif
-
QT_BEGIN_NAMESPACE
#ifdef Q_WS_WINCE
diff --git a/src/gui/kernel/qguiplatformplugin.cpp b/src/gui/kernel/qguiplatformplugin.cpp
index c48b8f6..6e074a1 100644
--- a/src/gui/kernel/qguiplatformplugin.cpp
+++ b/src/gui/kernel/qguiplatformplugin.cpp
@@ -41,6 +41,9 @@
#include "qguiplatformplugin_p.h"
#include <qdebug.h>
+#include <qfile.h>
+#include <qdir.h>
+#include <qsettings.h>
#include "private/qfactoryloader_p.h"
#include "qstylefactory.h"
#include "qapplication.h"
@@ -58,6 +61,7 @@ extern bool qt_wince_is_pocket_pc(); //qguifunctions_wince.cpp
#if defined(Q_WS_X11)
#include "qkde_p.h"
#include "qt_x11_p.h"
+#include <private/gtksymbols_p.h>
#endif
@@ -194,8 +198,68 @@ QPalette QGuiPlatformPlugin::palette()
return QPalette();
}
-/* backend for QIcon::fromTheme. A null icon means it uses the default backend */
-QIcon QGuiPlatformPlugin::loadIcon(const QString &name)
+/* the default icon theme name for QIcon::fromTheme. */
+QString QGuiPlatformPlugin::systemIconThemeName()
+{
+ QString result;
+#ifdef Q_WS_X11
+ if (X11->desktopEnvironment == DE_GNOME) {
+ result = QString::fromLatin1("gnome");
+#ifndef QT_NO_STYLE_GTK
+ result = QGtk::getGConfString(QLatin1String("/desktop/gnome/interface/icon_theme"), result);
+#endif
+ } else if (X11->desktopEnvironment == DE_KDE) {
+ result = X11->desktopVersion >= 4 ? QString::fromLatin1("oxygen") : QString::fromLatin1("crystalsvg");
+ QSettings settings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);
+ settings.beginGroup(QLatin1String("Icons"));
+ result = settings.value(QLatin1String("Theme"), result).toString();
+ }
+#endif
+ return result;
+}
+
+
+QStringList QGuiPlatformPlugin::iconThemeSearchPaths()
+{
+ QStringList paths;
+#if defined(Q_WS_X11)
+ QString xdgDirString = QFile::decodeName(getenv("XDG_DATA_DIRS"));
+ if (xdgDirString.isEmpty())
+ xdgDirString = QLatin1String("/usr/local/share/:/usr/share/");
+
+ QStringList xdgDirs = xdgDirString.split(QLatin1Char(':'));
+
+ for (int i = 0 ; i < xdgDirs.size() ; ++i) {
+ QDir dir(xdgDirs[i]);
+ if (dir.exists())
+ paths.append(dir.path() + QLatin1String("/icons"));
+ }
+ if (X11->desktopEnvironment == DE_KDE) {
+ paths << QLatin1Char(':') + QKde::kdeHome() + QLatin1String("/share/icons");
+ QStringList kdeDirs = QFile::decodeName(getenv("KDEDIRS")).split(QLatin1Char(':'));
+ for (int i = 0 ; i< kdeDirs.count() ; ++i) {
+ QDir dir(QLatin1Char(':') + kdeDirs.at(i) + QLatin1String("/share/icons"));
+ if (dir.exists())
+ paths.append(dir.path());
+ }
+ }
+
+ // Add home directory first in search path
+ QDir homeDir(QDir::homePath() + QLatin1String("/.icons"));
+ if (homeDir.exists())
+ paths.prepend(homeDir.path());
+#endif
+
+#if defined(Q_WS_WIN)
+ paths.append(qApp->applicationDirPath() + QLatin1String("/icons"));
+#elif defined(Q_WS_MAC)
+ paths.append(qApp->applicationDirPath() + QLatin1String("/../Resources/icons"));
+#endif
+ return paths;
+}
+
+/* backend for QFileIconProvider, null icon means default */
+QIcon QGuiPlatformPlugin::fileSystemIcon(const QFileInfo &)
{
return QIcon();
}
diff --git a/src/gui/kernel/qguiplatformplugin_p.h b/src/gui/kernel/qguiplatformplugin_p.h
index 57ea8af..2a70ee7 100644
--- a/src/gui/kernel/qguiplatformplugin_p.h
+++ b/src/gui/kernel/qguiplatformplugin_p.h
@@ -68,6 +68,7 @@ class QPalette;
class QIcon;
class QFileDialog;
class QColorDialog;
+class QFileInfo;
struct Q_GUI_EXPORT QGuiPlatformPluginInterface : public QFactoryInterface
{
@@ -89,8 +90,11 @@ class Q_GUI_EXPORT QGuiPlatformPlugin : public QObject, public QGuiPlatformPlugi
virtual QString styleName();
virtual QPalette palette();
- virtual QIcon loadIcon(const QString &name);
- enum PlatformHint { PH_ToolButtonStyle, PH_ToolBarIconSize };
+ virtual QString systemIconThemeName();
+ virtual QStringList iconThemeSearchPaths();
+ virtual QIcon fileSystemIcon(const QFileInfo &);
+
+ enum PlatformHint { PH_ToolButtonStyle, PH_ToolBarIconSize, PH_ItemView_ActivateItemOnSingleClick };
virtual int platformHint(PlatformHint hint);
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index 612258a..5886512 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -5058,7 +5058,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
break;
case SH_ItemView_ActivateItemOnSingleClick:
- ret = false;
+ ret = qt_guiPlatformPlugin()->platformHint(QGuiPlatformPlugin::PH_ItemView_ActivateItemOnSingleClick);
break;
case SH_TitleBar_ModifyNotification:
diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp
index bf29870..c0bd5e7 100644
--- a/src/gui/util/qdesktopservices_win.cpp
+++ b/src/gui/util/qdesktopservices_win.cpp
@@ -59,6 +59,11 @@
# endif
#endif
+#if defined(Q_CC_MINGW) && !defined(CSIDL_MYMUSIC)
+#define CSIDL_MYMUSIC 13
+#define CSIDL_MYVIDEO 14
+#endif
+
#ifndef QT_NO_DESKTOPSERVICES
QT_BEGIN_NAMESPACE
@@ -186,7 +191,11 @@ QString QDesktopServices::storageLocation(StandardLocation type)
switch (type) {
case DataLocation:
+#if defined Q_WS_WINCE
+ if (SHGetSpecialFolderPath(0, path, CSIDL_APPDATA, FALSE))
+#else
if (SHGetSpecialFolderPath(0, path, CSIDL_LOCAL_APPDATA, FALSE))
+#endif
result = QString::fromWCharArray(path);
if (!QCoreApplication::organizationName().isEmpty())
result = result + QLatin1String("\\") + QCoreApplication::organizationName();
diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp
index 6cc720d..280ca63 100644
--- a/src/gui/widgets/qdialogbuttonbox.cpp
+++ b/src/gui/widgets/qdialogbuttonbox.cpp
@@ -468,18 +468,6 @@ void QDialogButtonBoxPrivate::layoutButtons()
if (center)
buttonLayout->addStretch();
-
-#ifdef QT_SOFTKEYS_ENABLED
- QWidget *dialog = 0;
- QWidget *p = q;
- while (p && !p->isWindow()) {
- p = p->parentWidget();
- if (dialog = qobject_cast<QDialog *>(p))
- break;
- }
- if (dialog)
- q->setFixedSize(0, 0);
-#endif
}
QPushButton *QDialogButtonBoxPrivate::createButton(QDialogButtonBox::StandardButton sbutton,
@@ -1196,10 +1184,12 @@ bool QDialogButtonBox::event(QEvent *event)
if (!hasDefault && firstAcceptButton)
firstAcceptButton->setDefault(true);
#ifdef QT_SOFTKEYS_ENABLED
- if (dialog)
+ if (dialog) {
+ setFixedSize(0,0);
dialog->addActions(d->softKeyActions.values());
- else
+ } else {
addActions(d->softKeyActions.values());
+ }
#endif
}else if (event->type() == QEvent::LanguageChange) {
d->retranslateStrings();
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
index 866d1a2..1fe3999 100644
--- a/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
+++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp
@@ -67,7 +67,30 @@ void QGL2PEXVertexArray::addRect(const QRectF &rect)
<< rect.bottomRight() << rect.bottomLeft() << rect.topLeft();
}
-void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseScale)
+void QGL2PEXVertexArray::addClosingLine(int index)
+{
+ if (QPointF(vertexArray.at(index)) != QPointF(vertexArray.last()))
+ vertexArray.add(vertexArray.at(index));
+}
+
+void QGL2PEXVertexArray::addCentroid(const QVectorPath &path, int subPathIndex)
+{
+ const QPointF *const points = reinterpret_cast<const QPointF *>(path.points());
+ const QPainterPath::ElementType *const elements = path.elements();
+
+ QPointF sum = points[subPathIndex];
+ int count = 1;
+
+ for (int i = subPathIndex + 1; i < path.elementCount() && (!elements || elements[i] != QPainterPath::MoveToElement); ++i) {
+ sum += points[i];
+ ++count;
+ }
+
+ const QPointF centroid = sum / qreal(count);
+ vertexArray.add(centroid);
+}
+
+void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseScale, bool outline)
{
const QPointF* const points = reinterpret_cast<const QPointF*>(path.points());
const QPainterPath::ElementType* const elements = path.elements();
@@ -78,6 +101,10 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc
boundingRectDirty = false;
}
+ if (!outline)
+ addCentroid(path, 0);
+
+ int lastMoveTo = vertexArray.size();
vertexArray.add(points[0]); // The first element is always a moveTo
do {
@@ -96,8 +123,14 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc
const QPainterPath::ElementType elementType = elements[i];
switch (elementType) {
case QPainterPath::MoveToElement:
+ if (!outline)
+ addClosingLine(lastMoveTo);
// qDebug("element[%d] is a MoveToElement", i);
vertexArrayStops.append(vertexArray.size());
+ if (!outline) {
+ addCentroid(path, i);
+ lastMoveTo = vertexArray.size();
+ }
lineToArray(points[i].x(), points[i].y()); // Add the moveTo as a new vertex
break;
case QPainterPath::LineToElement:
@@ -115,6 +148,8 @@ void QGL2PEXVertexArray::addPath(const QVectorPath &path, GLfloat curveInverseSc
}
} while (0);
+ if (!outline)
+ addClosingLine(lastMoveTo);
vertexArrayStops.append(vertexArray.size());
}
diff --git a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
index 08ce234..719904f 100644
--- a/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
+++ b/src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h
@@ -104,7 +104,7 @@ public:
boundingRectDirty(true) {}
void addRect(const QRectF &rect);
- void addPath(const QVectorPath &path, GLfloat curveInverseScale);
+ void addPath(const QVectorPath &path, GLfloat curveInverseScale, bool outline = true);
void clear();
QGLPoint* data() {return vertexArray.data();}
@@ -124,6 +124,9 @@ private:
bool boundingRectDirty;
inline void curveToArray(const QGLPoint &cp1, const QGLPoint &cp2, const QGLPoint &ep, GLfloat inverseScale);
+
+ void addClosingLine(int index);
+ void addCentroid(const QVectorPath &path, int subPathIndex);
};
QT_END_NAMESPACE
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 5875124..ab02c69 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -391,7 +391,6 @@ void QGL2PaintEngineExPrivate::setBrush(const QBrush* brush)
}
-// Unless this gets used elsewhere, it's probably best to merge it into fillStencilWithVertexArray
void QGL2PaintEngineExPrivate::useSimpleShader()
{
shaderManager->simpleProgram()->enable();
@@ -881,26 +880,36 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path)
|| path.shape() == QVectorPath::ConvexPolygonHint)
{
vertexCoordinateArray.clear();
- vertexCoordinateArray.addPath(path, inverseScale);
+ vertexCoordinateArray.addPath(path, inverseScale, false);
prepareForDraw(currentBrush->isOpaque());
drawVertexArrays(vertexCoordinateArray, GL_TRIANGLE_FAN);
} else {
// The path is too complicated & needs the stencil technique
vertexCoordinateArray.clear();
- vertexCoordinateArray.addPath(path, inverseScale);
+ vertexCoordinateArray.addPath(path, inverseScale, false);
fillStencilWithVertexArray(vertexCoordinateArray, path.hasWindingFill());
- // Stencil the brush onto the dest buffer
- glStencilFunc(GL_EQUAL, GL_STENCIL_HIGH_BIT, GL_STENCIL_HIGH_BIT); // Pass if stencil buff value != 0
- glStencilOp(GL_KEEP, GL_ZERO, GL_ZERO);
- glStencilMask(GL_STENCIL_HIGH_BIT);
+ glStencilMask(0xff);
+ glStencilOp(GL_KEEP, GL_REPLACE, GL_REPLACE);
+
+ if (q->state()->clipTestEnabled) {
+ // Pass when high bit is set, replace stencil value with current clip
+ glStencilFunc(GL_NOTEQUAL, q->state()->currentClip, GL_STENCIL_HIGH_BIT);
+ } else if (path.hasWindingFill()) {
+ // Pass when any bit is set, replace stencil value with 0
+ glStencilFunc(GL_NOTEQUAL, 0, 0xff);
+ } else {
+ // Pass when high bit is set, replace stencil value with 0
+ glStencilFunc(GL_NOTEQUAL, 0, GL_STENCIL_HIGH_BIT);
+ }
prepareForDraw(currentBrush->isOpaque());
if (inRenderText)
prepareDepthRangeForRenderText();
+ // Stencil the brush onto the dest buffer
composite(vertexCoordinateArray.boundingRect());
if (inRenderText)
@@ -916,7 +925,7 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path)
void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(QGL2PEXVertexArray& vertexArray, bool useWindingFill)
{
// qDebug("QGL2PaintEngineExPrivate::fillStencilWithVertexArray()");
- glStencilMask(0xffff); // Enable stencil writes
+ glStencilMask(0xff); // Enable stencil writes
if (dirtyStencilRegion.intersects(currentScissorBounds)) {
QVector<QRect> clearRegion = dirtyStencilRegion.intersected(currentScissorBounds).rects();
@@ -948,39 +957,30 @@ void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(QGL2PEXVertexArray& ve
if (useWindingFill) {
if (q->state()->clipTestEnabled) {
+ // Flatten clip values higher than current clip, and set high bit to match current clip
glStencilFunc(GL_LEQUAL, GL_STENCIL_HIGH_BIT | q->state()->currentClip, ~GL_STENCIL_HIGH_BIT);
glStencilOp(GL_KEEP, GL_REPLACE, GL_REPLACE);
composite(vertexArray.boundingRect());
glStencilFunc(GL_EQUAL, GL_STENCIL_HIGH_BIT, GL_STENCIL_HIGH_BIT);
- } else {
- glStencilFunc(GL_ALWAYS, 0, 0xffff);
+ } else if (!stencilClean) {
+ // Clear stencil buffer within bounding rect
+ glStencilFunc(GL_ALWAYS, 0, 0xff);
glStencilOp(GL_ZERO, GL_ZERO, GL_ZERO);
composite(vertexArray.boundingRect());
}
// Inc. for front-facing triangle
glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_INCR_WRAP, GL_INCR_WRAP);
- //Dec. for back-facing "holes"
+ // Dec. for back-facing "holes"
glStencilOpSeparate(GL_BACK, GL_KEEP, GL_DECR_WRAP, GL_DECR_WRAP);
glStencilMask(~GL_STENCIL_HIGH_BIT);
drawVertexArrays(vertexArray, GL_TRIANGLE_FAN);
if (q->state()->clipTestEnabled) {
- // clear high bit of stencil outside of path
- glStencilFunc(GL_EQUAL, GL_STENCIL_HIGH_BIT | q->state()->currentClip, ~GL_STENCIL_HIGH_BIT);
- glStencilOp(GL_KEEP, GL_INVERT, GL_INVERT);
- glStencilMask(GL_STENCIL_HIGH_BIT);
- composite(vertexArray.boundingRect());
- // reset lower bits of stencil inside path to current clip
- glStencilFunc(GL_EQUAL, GL_STENCIL_HIGH_BIT | q->state()->currentClip, GL_STENCIL_HIGH_BIT);
+ // Clear high bit of stencil outside of path
+ glStencilFunc(GL_EQUAL, q->state()->currentClip, ~GL_STENCIL_HIGH_BIT);
glStencilOp(GL_KEEP, GL_REPLACE, GL_REPLACE);
- glStencilMask(~GL_STENCIL_HIGH_BIT);
- composite(vertexArray.boundingRect());
- } else {
- // set high bit of stencil inside path
- glStencilFunc(GL_NOTEQUAL, 0, 0xffff);
- glStencilOp(GL_KEEP, GL_INVERT, GL_INVERT);
glStencilMask(GL_STENCIL_HIGH_BIT);
composite(vertexArray.boundingRect());
}
@@ -1020,7 +1020,7 @@ void QGL2PaintEngineExPrivate::resetClipIfNeeded()
QGLRect rect(bounds.left(), bounds.top(), bounds.right(), bounds.bottom());
// Set high bit on clip region
- glStencilFunc(GL_LEQUAL, q->state()->currentClip, 0xffff);
+ glStencilFunc(GL_LEQUAL, q->state()->currentClip, 0xff);
glStencilOp(GL_KEEP, GL_INVERT, GL_INVERT);
glStencilMask(GL_STENCIL_HIGH_BIT);
composite(rect);
@@ -1028,7 +1028,7 @@ void QGL2PaintEngineExPrivate::resetClipIfNeeded()
// Reset clipping to 1 and everything else to zero
glStencilFunc(GL_NOTEQUAL, 0x01, GL_STENCIL_HIGH_BIT);
glStencilOp(GL_ZERO, GL_REPLACE, GL_REPLACE);
- glStencilMask(0xFFFF);
+ glStencilMask(0xff);
composite(rect);
q->state()->currentClip = 1;
@@ -1636,6 +1636,7 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
d->use_system_clip = !systemClip().isEmpty();
d->dirtyStencilRegion = QRect(0, 0, d->width, d->height);
+ d->stencilClean = true;
// Calling begin paint should make the correct context current. So, any
// code which calls into GL or otherwise needs a current context *must*
@@ -1731,7 +1732,7 @@ void QGL2PaintEngineExPrivate::updateClipScissorTest()
glStencilFunc(GL_LEQUAL, q->state()->currentClip, ~GL_STENCIL_HIGH_BIT);
} else {
glDisable(GL_STENCIL_TEST);
- glStencilFunc(GL_ALWAYS, 0, 0xffff);
+ glStencilFunc(GL_ALWAYS, 0, 0xff);
}
#ifdef QT_GL_NO_SCISSOR_TEST
@@ -1787,7 +1788,7 @@ void QGL2PaintEngineExPrivate::clearClip(uint value)
{
dirtyStencilRegion -= currentScissorBounds;
- glStencilMask(0xffff);
+ glStencilMask(0xff);
glClearStencil(value);
glClear(GL_STENCIL_BUFFER_BIT);
glStencilMask(0x0);
@@ -1802,6 +1803,8 @@ void QGL2PaintEngineExPrivate::writeClip(const QVectorPath &path, uint value)
if (matrixDirty)
updateMatrix();
+ stencilClean = false;
+
const bool singlePass = !path.hasWindingFill()
&& (((q->state()->currentClip == maxClip - 1) && q->state()->clipTestEnabled)
|| q->state()->needsClipBufferClear);
@@ -1819,10 +1822,10 @@ void QGL2PaintEngineExPrivate::writeClip(const QVectorPath &path, uint value)
if (q->state()->clipTestEnabled)
glStencilFunc(GL_LEQUAL, q->state()->currentClip, ~GL_STENCIL_HIGH_BIT);
else
- glStencilFunc(GL_ALWAYS, 0, 0xffff);
+ glStencilFunc(GL_ALWAYS, 0, 0xff);
vertexCoordinateArray.clear();
- vertexCoordinateArray.addPath(path, inverseScale);
+ vertexCoordinateArray.addPath(path, inverseScale, false);
if (!singlePass)
fillStencilWithVertexArray(vertexCoordinateArray, path.hasWindingFill());
@@ -1841,9 +1844,17 @@ void QGL2PaintEngineExPrivate::writeClip(const QVectorPath &path, uint value)
drawVertexArrays(vertexCoordinateArray, GL_TRIANGLE_FAN);
} else {
- glStencilFunc(GL_NOTEQUAL, value, GL_STENCIL_HIGH_BIT);
glStencilOp(GL_KEEP, GL_REPLACE, GL_REPLACE);
- glStencilMask(0xffff);
+ glStencilMask(0xff);
+
+ if (!q->state()->clipTestEnabled && path.hasWindingFill()) {
+ // Pass when any clip bit is set, set high bit
+ glStencilFunc(GL_NOTEQUAL, GL_STENCIL_HIGH_BIT, ~GL_STENCIL_HIGH_BIT);
+ composite(vertexCoordinateArray.boundingRect());
+ }
+
+ // Pass when high bit is set, replace stencil value with new clip value
+ glStencilFunc(GL_NOTEQUAL, value, GL_STENCIL_HIGH_BIT);
composite(vertexCoordinateArray.boundingRect());
}
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 28c972e..46be398 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -223,6 +223,7 @@ public:
bool shaderMatrixUniformDirty;
bool opacityUniformDirty;
+ bool stencilClean; // Has the stencil not been used for clipping so far?
QRegion dirtyStencilRegion;
QRect currentScissorBounds;
uint maxClip;
diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp
index afee77e..09c0ace 100644
--- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp
@@ -149,6 +149,18 @@ void PvrEglWindowSurface::setPermanentState(const QByteArray &state)
Q_UNUSED(state);
}
+void PvrEglWindowSurface::flush
+ (QWidget *widget, const QRegion &region, const QPoint &offset)
+{
+ // The GL paint engine is responsible for the swapBuffers() call.
+ // If we were to call the base class's implementation of flush()
+ // then it would fetch the image() and manually blit it to the
+ // screeen instead of using the fast PVR2D blit.
+ Q_UNUSED(widget);
+ Q_UNUSED(region);
+ Q_UNUSED(offset);
+}
+
QImage PvrEglWindowSurface::image() const
{
if (drawable) {
@@ -165,14 +177,7 @@ QImage PvrEglWindowSurface::image() const
QPaintDevice *PvrEglWindowSurface::paintDevice()
{
- QGLWidget *glWidget = qobject_cast<QGLWidget *>(window());
- if (glWidget)
- return glWidget;
-
- // Should be a QGLWidget, but if not return a dummy paint device.
- if (!pdevice)
- pdevice = new QImage(50, 50, screen->pixelFormat());
- return pdevice;
+ return widget;
}
void PvrEglWindowSurface::setDirectRegion(const QRegion &r, int id)
diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h
index 80fc8f8..0da3653 100644
--- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h
+++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h
@@ -65,6 +65,8 @@ public:
QByteArray permanentState() const;
void setPermanentState(const QByteArray &state);
+ void flush(QWidget *widget, const QRegion &region, const QPoint &offset);
+
QImage image() const;
QPaintDevice *paintDevice();
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index 581d3bc..09ea6ab 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -10640,7 +10640,7 @@ EXPORTS
_ZTI17QTextFramePrivate @ 10639 NONAME ABSENT
_ZTI17QTextImageHandler @ 10640 NONAME ABSENT
_ZTI17QTextTablePrivate @ 10641 NONAME ABSENT
- _ZTI17QToolBarExtension @ 10642 NONAME ABSENT
+ _ZTI17QToolBarExtension @ 10642 NONAME
_ZTI17QToolBarSeparator @ 10643 NONAME ABSENT
_ZTI17QUpdateLaterEvent @ 10644 NONAME ABSENT
_ZTI17QWhatsThisPrivate @ 10645 NONAME ABSENT
@@ -11051,7 +11051,7 @@ EXPORTS
_ZTV17QTextFramePrivate @ 11050 NONAME ABSENT
_ZTV17QTextImageHandler @ 11051 NONAME ABSENT
_ZTV17QTextTablePrivate @ 11052 NONAME ABSENT
- _ZTV17QToolBarExtension @ 11053 NONAME ABSENT
+ _ZTV17QToolBarExtension @ 11053 NONAME
_ZTV17QToolBarSeparator @ 11054 NONAME ABSENT
_ZTV17QUpdateLaterEvent @ 11055 NONAME ABSENT
_ZTV17QWhatsThisPrivate @ 11056 NONAME ABSENT
@@ -13102,4 +13102,38 @@ EXPORTS
_ZTI28QGraphicsAnchorLayoutPrivate @ 13101 NONAME
_ZTV20QGraphicsBloomEffect @ 13102 NONAME
_ZTV28QGraphicsAnchorLayoutPrivate @ 13103 NONAME
+ _ZN17QToolBarExtension10paintEventEP11QPaintEvent @ 13104 NONAME
+ _ZN17QToolBarExtension11qt_metacallEN11QMetaObject4CallEiPPv @ 13105 NONAME
+ _ZN17QToolBarExtension11qt_metacastEPKc @ 13106 NONAME
+ _ZN17QToolBarExtension14setOrientationEN2Qt11OrientationE @ 13107 NONAME
+ _ZN17QToolBarExtension16staticMetaObjectE @ 13108 NONAME DATA 16
+ _ZN17QToolBarExtension19getStaticMetaObjectEv @ 13109 NONAME
+ _ZN17QToolBarExtensionC1EP7QWidget @ 13110 NONAME
+ _ZN17QToolBarExtensionC2EP7QWidget @ 13111 NONAME
+ _ZN18QGuiPlatformPlugin11qt_metacallEN11QMetaObject4CallEiPPv @ 13112 NONAME
+ _ZN18QGuiPlatformPlugin11qt_metacastEPKc @ 13113 NONAME
+ _ZN18QGuiPlatformPlugin12platformHintENS_12PlatformHintE @ 13114 NONAME
+ _ZN18QGuiPlatformPlugin14fileSystemIconERK9QFileInfo @ 13115 NONAME
+ _ZN18QGuiPlatformPlugin16staticMetaObjectE @ 13116 NONAME DATA 16
+ _ZN18QGuiPlatformPlugin19getStaticMetaObjectEv @ 13117 NONAME
+ _ZN18QGuiPlatformPlugin19systemIconThemeNameEv @ 13118 NONAME
+ _ZN18QGuiPlatformPlugin20iconThemeSearchPathsEv @ 13119 NONAME
+ _ZN18QGuiPlatformPlugin7paletteEv @ 13120 NONAME
+ _ZN18QGuiPlatformPlugin9styleNameEv @ 13121 NONAME
+ _ZN18QGuiPlatformPluginC1EP7QObject @ 13122 NONAME
+ _ZN18QGuiPlatformPluginC2EP7QObject @ 13123 NONAME
+ _ZN18QGuiPlatformPluginD0Ev @ 13124 NONAME
+ _ZN18QGuiPlatformPluginD1Ev @ 13125 NONAME
+ _ZN18QGuiPlatformPluginD2Ev @ 13126 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate14solveExpandingE5QListIP18QSimplexConstraintE @ 13127 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate21identifyNonFloatItemsE4QSetIP10AnchorDataENS_11OrientationE @ 13128 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate28identifyNonFloatItems_helperEPK10AnchorDataNS_11OrientationE @ 13129 NONAME
+ _ZNK17QToolBarExtension10metaObjectEv @ 13130 NONAME
+ _ZNK17QToolBarExtension8sizeHintEv @ 13131 NONAME
+ _ZNK18QGuiPlatformPlugin10metaObjectEv @ 13132 NONAME
+ _ZTI18QGuiPlatformPlugin @ 13133 NONAME
+ _ZTI27QGuiPlatformPluginInterface @ 13134 NONAME
+ _ZTV18QGuiPlatformPlugin @ 13135 NONAME
+ _ZThn8_N18QGuiPlatformPluginD0Ev @ 13136 NONAME
+ _ZThn8_N18QGuiPlatformPluginD1Ev @ 13137 NONAME
diff --git a/src/s60installs/eabi/QtScriptu.def b/src/s60installs/eabi/QtScriptu.def
index cca0a2a..1205c04 100644
--- a/src/s60installs/eabi/QtScriptu.def
+++ b/src/s60installs/eabi/QtScriptu.def
@@ -600,4 +600,5 @@ EXPORTS
_ZN25QScriptEngineAgentPrivate18didReachBreakpointERKN5QTJSC17DebuggerCallFrameEiii @ 599 NONAME
_ZN25QScriptEngineAgentPrivate6attachEv @ 600 NONAME
_ZN25QScriptEngineAgentPrivate6detachEv @ 601 NONAME
+ _Z5qHashRK13QScriptString @ 602 NONAME
diff --git a/src/s60installs/eabi/phononu.def b/src/s60installs/eabi/phononu.def
index d70942c..d407ba4 100644
--- a/src/s60installs/eabi/phononu.def
+++ b/src/s60installs/eabi/phononu.def
@@ -495,11 +495,11 @@ EXPORTS
_ZTIN6Phonon19AbstractVideoOutputE @ 494 NONAME
_ZTIN6Phonon19BackendCapabilities8NotifierE @ 495 NONAME ABSENT
_ZTIN6Phonon22MediaControllerPrivateE @ 496 NONAME ABSENT
- _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE0EEE @ 497 NONAME
- _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE1EEE @ 498 NONAME
- _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE2EEE @ 499 NONAME
- _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE3EEE @ 500 NONAME
- _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE4EEE @ 501 NONAME
+ _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE0EEE @ 497 NONAME ABSENT
+ _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE1EEE @ 498 NONAME ABSENT
+ _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE2EEE @ 499 NONAME ABSENT
+ _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE3EEE @ 500 NONAME ABSENT
+ _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE4EEE @ 501 NONAME ABSENT
_ZTIN6Phonon24VolumeFaderEffectPrivateE @ 502 NONAME ABSENT
_ZTIN6Phonon26AbstractAudioOutputPrivateE @ 503 NONAME ABSENT
_ZTIN6Phonon26AbstractMediaStreamPrivateE @ 504 NONAME
@@ -532,11 +532,11 @@ EXPORTS
_ZTVN6Phonon19AbstractVideoOutputE @ 531 NONAME
_ZTVN6Phonon19BackendCapabilities8NotifierE @ 532 NONAME ABSENT
_ZTVN6Phonon22MediaControllerPrivateE @ 533 NONAME ABSENT
- _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE0EEE @ 534 NONAME
- _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE1EEE @ 535 NONAME
- _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE2EEE @ 536 NONAME
- _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE3EEE @ 537 NONAME
- _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE4EEE @ 538 NONAME
+ _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE0EEE @ 534 NONAME ABSENT
+ _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE1EEE @ 535 NONAME ABSENT
+ _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE2EEE @ 536 NONAME ABSENT
+ _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE3EEE @ 537 NONAME ABSENT
+ _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE4EEE @ 538 NONAME ABSENT
_ZTVN6Phonon24VolumeFaderEffectPrivateE @ 539 NONAME ABSENT
_ZTVN6Phonon26AbstractAudioOutputPrivateE @ 540 NONAME ABSENT
_ZTVN6Phonon26AbstractMediaStreamPrivateE @ 541 NONAME
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index 5f31054..f1fc135 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -468,6 +468,22 @@ inline QScriptValue QScriptValuePrivate::property(const QString &name, int resol
return property(JSC::Identifier(exec, name), resolveMode);
}
+inline void* QScriptValuePrivate::operator new(size_t size, QScriptEnginePrivate *engine)
+{
+ if (engine)
+ return engine->allocateScriptValuePrivate(size);
+ return qMalloc(size);
+}
+
+inline void QScriptValuePrivate::operator delete(void *ptr)
+{
+ QScriptValuePrivate *d = reinterpret_cast<QScriptValuePrivate*>(ptr);
+ if (d->engine)
+ d->engine->freeScriptValuePrivate(d);
+ else
+ qFree(d);
+}
+
inline void QScriptEnginePrivate::registerScriptString(QScriptStringPrivate *value)
{
Q_ASSERT(value->type == QScriptStringPrivate::HeapAllocated);
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index 92c987c..b8340a7 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -280,7 +280,7 @@ QScriptValue QScriptValuePrivate::property(const JSC::Identifier &id, int resolv
{
Q_ASSERT(isObject());
JSC::ExecState *exec = engine->currentFrame;
- JSC::JSObject *object = jscValue.getObject();
+ JSC::JSObject *object = JSC::asObject(jscValue);
JSC::PropertySlot slot(const_cast<JSC::JSObject*>(object));
JSC::JSValue result;
if (const_cast<JSC::JSObject*>(object)->getOwnPropertySlot(exec, id, slot)) {
@@ -303,7 +303,7 @@ QScriptValue QScriptValuePrivate::property(quint32 index, int resolveMode) const
{
Q_ASSERT(isObject());
JSC::ExecState *exec = engine->currentFrame;
- JSC::JSObject *object = jscValue.getObject();
+ JSC::JSObject *object = JSC::asObject(jscValue);
JSC::PropertySlot slot(const_cast<JSC::JSObject*>(object));
JSC::JSValue result;
if (const_cast<JSC::JSObject*>(object)->getOwnPropertySlot(exec, index, slot)) {
@@ -466,22 +466,6 @@ void QScriptValuePrivate::detachFromEngine()
engine = 0;
}
-void* QScriptValuePrivate::operator new(size_t size, QScriptEnginePrivate *engine)
-{
- if (engine)
- return engine->allocateScriptValuePrivate(size);
- return qMalloc(size);
-}
-
-void QScriptValuePrivate::operator delete(void *ptr)
-{
- QScriptValuePrivate *d = reinterpret_cast<QScriptValuePrivate*>(ptr);
- if (d->engine)
- d->engine->freeScriptValuePrivate(d);
- else
- qFree(d);
-}
-
/*!
\internal
*/
diff --git a/src/script/api/qscriptvalue_p.h b/src/script/api/qscriptvalue_p.h
index 6cbda97..77b5084 100644
--- a/src/script/api/qscriptvalue_p.h
+++ b/src/script/api/qscriptvalue_p.h
@@ -66,10 +66,10 @@ class QScriptEnginePrivate;
class QScriptValue;
class QScriptValuePrivate
{
- Q_DISABLE_COPY(QScriptValuePrivate);
+ Q_DISABLE_COPY(QScriptValuePrivate)
public:
- void* operator new(size_t, QScriptEnginePrivate*);
- void operator delete(void*);
+ inline void* operator new(size_t, QScriptEnginePrivate*);
+ inline void operator delete(void*);
enum Type {
JavaScriptCore,