summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/phonon/mmf/audiooutput.cpp26
-rw-r--r--src/3rdparty/phonon/mmf/audiooutput.h13
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.cpp9
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.h5
-rw-r--r--src/3rdparty/phonon/mmf/backend.cpp18
-rw-r--r--src/3rdparty/phonon/phonon/objectdescriptionmodel.h23
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog12
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro3
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog13
-rw-r--r--src/corelib/global/qglobal.h4
-rw-r--r--src/corelib/global/qnamespace.h4
-rw-r--r--src/corelib/global/qnamespace.qdoc8
-rw-r--r--src/corelib/kernel/qeventdispatcher_unix.cpp2
-rw-r--r--src/corelib/thread/qthread_unix.cpp1
-rw-r--r--src/corelib/tools/qdatetime.cpp32
-rw-r--r--src/corelib/tools/qlocale_symbian.cpp10
-rw-r--r--src/corelib/tools/qstringlist.cpp1
-rw-r--r--src/corelib/tools/qstringlist.h1
-rw-r--r--src/dbus/dbus.pro1
-rw-r--r--src/dbus/qdbus_symbols_p.h3
-rw-r--r--src/dbus/qdbusintegrator.cpp3
-rw-r--r--src/dbus/qdbusthread.cpp171
-rw-r--r--src/gui/dialogs/qcolordialog.cpp21
-rw-r--r--src/gui/dialogs/qcolordialog_p.h1
-rw-r--r--src/gui/dialogs/qdialog.cpp22
-rw-r--r--src/gui/dialogs/qfiledialog_p.h24
-rw-r--r--src/gui/dialogs/qprintdialog_win.cpp7
-rw-r--r--src/gui/effects/qgraphicseffect.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.cpp595
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout_p.h59
-rw-r--r--src/gui/graphicsview/qsimplex_p.cpp24
-rw-r--r--src/gui/graphicsview/qsimplex_p.h26
-rw-r--r--src/gui/image/qicon.cpp10
-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/qabstractitemview.cpp6
-rw-r--r--src/gui/itemviews/qfileiconprovider.cpp5
-rw-r--r--src/gui/itemviews/qheaderview.cpp4
-rw-r--r--src/gui/kernel/kernel.pri6
-rw-r--r--src/gui/kernel/qapplication.cpp38
-rw-r--r--src/gui/kernel/qapplication_mac.mm26
-rw-r--r--src/gui/kernel/qapplication_p.h1
-rw-r--r--src/gui/kernel/qapplication_win.cpp5
-rw-r--r--src/gui/kernel/qapplication_x11.cpp42
-rw-r--r--src/gui/kernel/qguiplatformplugin.cpp296
-rw-r--r--src/gui/kernel/qguiplatformplugin_p.h126
-rw-r--r--src/gui/kernel/qkde.cpp33
-rw-r--r--src/gui/kernel/qkde_p.h9
-rw-r--r--src/gui/kernel/qkeymapper_win.cpp4
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp3
-rw-r--r--src/gui/kernel/qsoftkeymanager_p.h2
-rw-r--r--src/gui/kernel/qwidget_s60.cpp11
-rw-r--r--src/gui/painting/qdrawutil.cpp4
-rw-r--r--src/gui/painting/qpaintengineex.cpp2
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp5
-rw-r--r--src/gui/styles/qcommonstyle.cpp56
-rw-r--r--src/gui/styles/qcommonstyle_p.h1
-rw-r--r--src/gui/styles/qplastiquestyle.cpp2
-rw-r--r--src/gui/text/qfontengine.cpp2
-rw-r--r--src/gui/util/qdesktopservices_win.cpp75
-rw-r--r--src/gui/widgets/qabstractslider.cpp3
-rw-r--r--src/gui/widgets/qdialogbuttonbox.cpp18
-rw-r--r--src/gui/widgets/qmenu_symbian.cpp7
-rw-r--r--src/gui/widgets/qtoolbarextension_p.h2
-rw-r--r--src/multimedia/audio/qaudiooutput_win32_p.cpp7
-rw-r--r--src/network/kernel/qnetworkproxy.cpp4
-rw-r--r--src/network/kernel/qnetworkproxy.h2
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray.cpp37
-rw-r--r--src/opengl/gl2paintengineex/qgl2pexvertexarray_p.h5
-rw-r--r--src/opengl/gl2paintengineex/qglcustomshaderstage_p.h2
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp75
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h1
-rw-r--r--src/opengl/qpixmapdata_gl.cpp2
-rw-r--r--src/opengl/util/fragmentprograms_p.h8
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp21
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h2
-rw-r--r--src/qt3support/other/q3process_unix.cpp91
-rw-r--r--src/s60installs/eabi/QtCoreu.def60
-rw-r--r--src/s60installs/eabi/QtGuiu.def143
-rw-r--r--src/s60installs/eabi/QtNetworku.def4
-rw-r--r--src/s60installs/eabi/QtScriptu.def27
-rw-r--r--src/s60installs/eabi/QtSqlu.def2
-rw-r--r--src/s60installs/eabi/phononu.def20
-rw-r--r--src/s60installs/s60installs.pro5
-rw-r--r--src/script/api/qscriptengine_p.h16
-rw-r--r--src/script/api/qscriptstring.cpp14
-rw-r--r--src/script/api/qscriptstring.h2
-rw-r--r--src/script/api/qscriptstring_p.h7
-rw-r--r--src/script/api/qscriptvalue.cpp20
-rw-r--r--src/script/api/qscriptvalue_p.h6
-rw-r--r--src/xmlpatterns/data/qvaluefactory.cpp2
-rw-r--r--src/xmlpatterns/functions/qsequencefns_p.h1
-rw-r--r--src/xmlpatterns/schema/qxsdschemaparser.cpp1
98 files changed, 1727 insertions, 964 deletions
diff --git a/src/3rdparty/phonon/mmf/audiooutput.cpp b/src/3rdparty/phonon/mmf/audiooutput.cpp
index 58e2f5e..5a00f60 100644
--- a/src/3rdparty/phonon/mmf/audiooutput.cpp
+++ b/src/3rdparty/phonon/mmf/audiooutput.cpp
@@ -18,6 +18,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#include <e32debug.h>
+#include <QCoreApplication>
+
#include "audiooutput.h"
#include "defs.h"
#include "mediaobject.h"
@@ -74,16 +76,13 @@ void MMF::AudioOutput::setVolume(qreal volume)
int MMF::AudioOutput::outputDevice() const
{
- return 0;
-}
-
-bool MMF::AudioOutput::setOutputDevice(int)
-{
- return true;
+ return AudioOutputDeviceID;
}
-bool MMF::AudioOutput::setOutputDevice(const Phonon::AudioOutputDevice &)
+bool MMF::AudioOutput::setOutputDevice(int index)
{
+ Q_ASSERT_X(index == AudioOutputDeviceID, Q_FUNC_INFO,
+ "We only support one output device, with id 0");
return true;
}
@@ -101,4 +100,17 @@ bool MMF::AudioOutput::activateOnMediaObject(MediaObject *mo)
return true;
}
+QHash<QByteArray, QVariant> MMF::AudioOutput::audioOutputDescription(int index)
+{
+ if (index == AudioOutputDeviceID) {
+ QHash<QByteArray, QVariant> retval;
+
+ retval.insert("name", QCoreApplication::translate("Phonon::MMF", "Audio Output"));
+ retval.insert("description", QCoreApplication::translate("Phonon::MMF", "The audio output device"));
+ retval.insert("available", true);
+
+ return retval;
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/3rdparty/phonon/mmf/audiooutput.h b/src/3rdparty/phonon/mmf/audiooutput.h
index 0a962a9..d0ba086 100644
--- a/src/3rdparty/phonon/mmf/audiooutput.h
+++ b/src/3rdparty/phonon/mmf/audiooutput.h
@@ -19,6 +19,8 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
#ifndef PHONON_MMF_AUDIOOUTPUT_H
#define PHONON_MMF_AUDIOOUTPUT_H
+#include <QHash>
+
#include "mmf_medianode.h"
#include <phonon/audiooutputinterface.h>
@@ -65,10 +67,12 @@ public:
*/
virtual bool setOutputDevice(int);
- /**
- * Has no effect.
- */
- virtual bool setOutputDevice(const Phonon::AudioOutputDevice &);
+ static QHash<QByteArray, QVariant> audioOutputDescription(int index);
+
+ enum Constants
+ {
+ AudioOutputDeviceID = 0
+ };
protected:
virtual bool activateOnMediaObject(MediaObject *mo);
@@ -78,6 +82,7 @@ Q_SIGNALS:
void audioDeviceFailed();
private:
+
void setVolumeObserver(VolumeObserver* observer);
qreal m_volume;
diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp
index 6c1fc68..ceaf305 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.cpp
+++ b/src/3rdparty/phonon/mmf/audioplayer.cpp
@@ -34,14 +34,13 @@ using namespace Phonon::MMF;
// Constructor / destructor
//-----------------------------------------------------------------------------
-MMF::AudioPlayer::AudioPlayer() : m_player(0)
+MMF::AudioPlayer::AudioPlayer()
{
construct();
}
MMF::AudioPlayer::AudioPlayer(const AbstractPlayer& player)
: AbstractMediaPlayer(player)
- , m_player(0)
{
construct();
}
@@ -51,7 +50,7 @@ void MMF::AudioPlayer::construct()
TRACE_CONTEXT(AudioPlayer::AudioPlayer, EAudioApi);
TRACE_ENTRY_0();
- TRAPD(err, m_player = CPlayerType::NewL(*this, 0, EMdaPriorityPreferenceNone));
+ TRAPD(err, m_player.reset(CPlayerType::NewL(*this, 0, EMdaPriorityPreferenceNone)));
if (KErrNone != err) {
changeState(ErrorState);
}
@@ -64,8 +63,6 @@ MMF::AudioPlayer::~AudioPlayer()
TRACE_CONTEXT(AudioPlayer::~AudioPlayer, EAudioApi);
TRACE_ENTRY_0();
- delete m_player;
-
TRACE_EXIT_0();
}
@@ -237,7 +234,7 @@ void MMF::AudioPlayer::MapcPlayComplete(TInt aError)
CPlayerType *MMF::AudioPlayer::player() const
{
- return m_player;
+ return m_player.data();
}
diff --git a/src/3rdparty/phonon/mmf/audioplayer.h b/src/3rdparty/phonon/mmf/audioplayer.h
index f16de1d..60ef436 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.h
+++ b/src/3rdparty/phonon/mmf/audioplayer.h
@@ -86,6 +86,9 @@ public:
virtual void MapcPlayComplete(TInt aError);
#endif
+ /**
+ * This class owns the pointer.
+ */
CPlayerType *player() const;
private:
@@ -96,7 +99,7 @@ private:
* Using CPlayerType typedef in order to be able to easily switch between
* CMdaAudioPlayerUtility and CDrmPlayerUtility
*/
- CPlayerType* m_player;
+ QScopedPointer<CPlayerType> m_player;
};
}
}
diff --git a/src/3rdparty/phonon/mmf/backend.cpp b/src/3rdparty/phonon/mmf/backend.cpp
index be43f46..f542ec9 100644
--- a/src/3rdparty/phonon/mmf/backend.cpp
+++ b/src/3rdparty/phonon/mmf/backend.cpp
@@ -107,6 +107,12 @@ QList<int> Backend::objectDescriptionIndexes(ObjectDescriptionType type) const
{
case EffectType:
retval.append(EffectFactory::effectIndexes());
+ break;
+ case AudioOutputDeviceType:
+ // We only have one possible output device, but we need at least
+ // one.
+ retval.append(AudioOutput::AudioOutputDeviceID);
+ break;
default:
;
}
@@ -119,10 +125,14 @@ QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(ObjectDescripti
{
TRACE_CONTEXT(Backend::connectNodes, EBackend);
- if (type == EffectType)
- return EffectFactory::audioEffectDescriptions(AbstractAudioEffect::Type(index));
- else
- return QHash<QByteArray, QVariant>();
+ switch (type) {
+ case EffectType:
+ return EffectFactory::audioEffectDescriptions(AbstractAudioEffect::Type(index));
+ case AudioOutputDeviceType:
+ return AudioOutput::audioOutputDescription(index);
+ default:
+ return QHash<QByteArray, QVariant>();
+ }
}
bool Backend::startConnectionChange(QSet<QObject *>)
diff --git a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h
index ba3cb42..a3c72b2 100644
--- a/src/3rdparty/phonon/phonon/objectdescriptionmodel.h
+++ b/src/3rdparty/phonon/phonon/objectdescriptionmodel.h
@@ -139,6 +139,21 @@ namespace Phonon
ObjectDescriptionModelDataPrivate *const d;
};
+/* Required to ensure template class vtables are exported on both symbian
+and existing builds. */
+#if defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT)
+// RVCT compiler (2.2.686) requires the export declaration to be on the class to export vtables
+// MWC compiler works both ways
+// GCCE compiler is unknown (it can't compile QtCore yet)
+#define PHONON_TEMPLATE_CLASS_EXPORT PHONON_EXPORT
+#define PHONON_TEMPLATE_CLASS_MEMBER_EXPORT
+#else
+// Windows builds (at least) do not support export declaration on templated class
+// But if you export a member function, the vtable is implicitly exported
+#define PHONON_TEMPLATE_CLASS_EXPORT
+#define PHONON_TEMPLATE_CLASS_MEMBER_EXPORT PHONON_EXPORT
+#endif
+
/** \class ObjectDescriptionModel objectdescriptionmodel.h Phonon/ObjectDescriptionModel
* \short The ObjectDescriptionModel class provides a model from
* a list of ObjectDescription objects.
@@ -175,7 +190,7 @@ namespace Phonon
* \author Matthias Kretz <kretz@kde.org>
*/
template<ObjectDescriptionType type>
- class ObjectDescriptionModel : public QAbstractListModel
+ class PHONON_TEMPLATE_CLASS_EXPORT ObjectDescriptionModel : public QAbstractListModel
{
public:
Q_OBJECT_CHECK
@@ -188,11 +203,11 @@ namespace Phonon
*/
#if !defined(Q_CC_MINGW) || __MINGW32_MAJOR_VERSION >= 4
/** \internal */
- static PHONON_EXPORT const QMetaObject staticMetaObject;
+ static PHONON_TEMPLATE_CLASS_MEMBER_EXPORT const QMetaObject staticMetaObject;
/** \internal */
- PHONON_EXPORT const QMetaObject *metaObject() const;
+ PHONON_TEMPLATE_CLASS_MEMBER_EXPORT const QMetaObject *metaObject() const;
/** \internal */
- PHONON_EXPORT void *qt_metacast(const char *_clname);
+ PHONON_TEMPLATE_CLASS_MEMBER_EXPORT void *qt_metacast(const char *_clname);
//int qt_metacall(QMetaObject::Call _c, int _id, void **_a);
#endif
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index aacc3dc..4f7dd4f 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2009-10-07 Janne Koskinen <janne.p.koskinen@digia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Symbian SBSv2 .data segment adress fix
+ https://bugs.webkit.org/show_bug.cgi?id=30157
+
+ RO-section in qtwebkit.dll exceeds allocated space in SBSv2. Move RW-section
+ base address to start from 0x800000 instead of the toolchain default 0x400000
+
+ * WebCore.pro:
+
2009-09-29 Dave Hyatt <hyatt@apple.com>
Reviewed by Jon Honeycutt.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index bc22b7a..1c39bb8 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -13,6 +13,9 @@ symbian: {
TARGET.UID3 = 0x200267C2
}
+# RO-section in qtwebkit.dll exceeds allocated space in SBSv2. Move RW-section
+# base address to start from 0x800000 instead of the toolchain default 0x400000.
+symbian-sbsv2: MMP_RULES += "LINKEROPTION armcc --rw-base 0x800000"
include($$PWD/../WebKit.pri)
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
index 3c5f89f..882f3d7 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
@@ -198,7 +198,7 @@ QWebView::QWebView(QWidget *parent)
{
d = new QWebViewPrivate(this);
-#if !defined(Q_WS_QWS)
+#if !defined(Q_WS_QWS) && !defined(Q_OS_SYMBIAN)
setAttribute(Qt::WA_InputMethodEnabled);
#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index fd2768c..99ddaa5 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-06 Janne Koskinen <janne.p.koskinen@digia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] don't enable input methods on Symbian by default.
+ https://bugs.webkit.org/show_bug.cgi?id=30117
+
+ If input methods are enabled Symbian FEP will be launched on every
+ pointer event making webpage navigation impossible with QWebView.
+
+ * Api/qwebview.cpp:
+ (QWebView::QWebView):
+
2009-10-01 Simon Hausmann <simon.hausmann@nokia.com>
Reviewed by Tor Arne Vestbø.
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 5cac107..b11cfb4 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1615,11 +1615,11 @@ Q_CORE_EXPORT_INLINE QDebug qCritical();
inline QNoDebug qDebug();
#endif
-#define QT_NO_QDEBUG_MACRO if(1) {} else qDebug
+#define QT_NO_QDEBUG_MACRO while (false) qDebug
#ifdef QT_NO_DEBUG_OUTPUT
# define qDebug QT_NO_QDEBUG_MACRO
#endif
-#define QT_NO_QWARNING_MACRO if(1) {} else qWarning
+#define QT_NO_QWARNING_MACRO while (false) qWarning
#ifdef QT_NO_WARNING_OUTPUT
# define qWarning QT_NO_QWARNING_MACRO
#endif
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/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp
index 5a0afb8..5d206ed 100644
--- a/src/corelib/kernel/qeventdispatcher_unix.cpp
+++ b/src/corelib/kernel/qeventdispatcher_unix.cpp
@@ -939,7 +939,7 @@ void QEventDispatcherUNIX::wakeUp()
Q_D(QEventDispatcherUNIX);
if (d->wakeUps.testAndSetAcquire(0, 1)) {
char c = 0;
- ::write( d->thread_pipe[1], &c, 1 );
+ qt_safe_write( d->thread_pipe[1], &c, 1 );
}
}
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index c590553..21b5e65 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -624,6 +624,7 @@ void QThread::setTerminationEnabled(bool enabled)
Q_ASSERT_X(thr != 0, "QThread::setTerminationEnabled()",
"Current thread was not started with QThread.");
#ifndef Q_OS_SYMBIAN
+ Q_UNUSED(thr)
pthread_setcancelstate(enabled ? PTHREAD_CANCEL_ENABLE : PTHREAD_CANCEL_DISABLE, NULL);
if (enabled)
pthread_testcancel();
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/corelib/tools/qlocale_symbian.cpp b/src/corelib/tools/qlocale_symbian.cpp
index 931fbb4..1660e95 100644
--- a/src/corelib/tools/qlocale_symbian.cpp
+++ b/src/corelib/tools/qlocale_symbian.cpp
@@ -43,6 +43,7 @@
#include <QLocale>
#include <QTime>
#include <QVariant>
+#include <QThread>
#include <e32std.h>
#include "private/qcore_symbian_p.h"
@@ -773,8 +774,8 @@ static QLocale::MeasurementSystem symbianMeasurementSystem()
QLocale QSystemLocale::fallbackLocale() const
{
// load system data before query calls
- static bool initDone = false;
- if (!initDone) {
+ static QBasicAtomicInt initDone = Q_BASIC_ATOMIC_INITIALIZER(0);
+ if (initDone.testAndSetRelaxed(0, 1)) {
_s60Locale.LoadSystemSettings();
// Initialize platform version dependent function pointers
@@ -794,7 +795,12 @@ QLocale QSystemLocale::fallbackLocale() const
ptrGetLongDateFormatSpec = &defaultFormatSpec;
if (!ptrGetShortDateFormatSpec)
ptrGetShortDateFormatSpec = &defaultFormatSpec;
+ bool ret = initDone.testAndSetRelease(1, 2);
+ Q_ASSERT(ret);
+ Q_UNUSED(ret);
}
+ while(initDone != 2)
+ QThread::yieldCurrentThread();
TLanguage lang = User::Language();
QString locale = QLatin1String(qt_symbianLocaleName(lang));
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index f5b2a59..ce39b47 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -41,7 +41,6 @@
#include <qstringlist.h>
#include <qset.h>
-#include <qstringmatcher.h>
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h
index c959209..2a2a1d7 100644
--- a/src/corelib/tools/qstringlist.h
+++ b/src/corelib/tools/qstringlist.h
@@ -47,6 +47,7 @@
#include <QtCore/qlist.h>
#include <QtCore/qregexp.h>
#include <QtCore/qstring.h>
+#include <QtCore/qstringmatcher.h>
#ifdef QT_INCLUDE_COMPAT
#include <Qt3Support/q3valuelist.h>
#endif
diff --git a/src/dbus/dbus.pro b/src/dbus/dbus.pro
index dcd8418..57c6a58 100644
--- a/src/dbus/dbus.pro
+++ b/src/dbus/dbus.pro
@@ -61,7 +61,6 @@ SOURCES += qdbusconnection.cpp \
qdbusutil.cpp \
qdbusintrospection.cpp \
qdbusabstractadaptor.cpp \
- qdbusthread.cpp \
qdbusinternalfilters.cpp \
qdbusmetaobject.cpp \
qdbusxmlgenerator.cpp \
diff --git a/src/dbus/qdbus_symbols_p.h b/src/dbus/qdbus_symbols_p.h
index bc90328..69c6ee4 100644
--- a/src/dbus/qdbus_symbols_p.h
+++ b/src/dbus/qdbus_symbols_p.h
@@ -357,6 +357,9 @@ DEFINEFUNC(dbus_bool_t , dbus_type_is_basic, (int typecode),
DEFINEFUNC(dbus_bool_t , dbus_type_is_fixed, (int typecode),
(typecode), return)
+/* dbus-thread.h */
+DEFINEFUNC(dbus_bool_t , dbus_threads_init_default, (), (), return)
+
QT_END_NAMESPACE
#endif
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 6ff50ac..fb2dd77 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -920,9 +920,10 @@ QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p)
watchAndTimeoutLock(QMutex::Recursive),
rootNode(QString(QLatin1Char('/')))
{
- static const bool threads = qDBusInitThreads();
+ static const bool threads = q_dbus_threads_init_default();
static const int debugging = ::isDebugging = qgetenv("QDBUS_DEBUG").toInt();
Q_UNUSED(threads)
+ Q_UNUSED(debugging)
#ifdef QDBUS_THREAD_DEBUG
if (debugging > 1)
diff --git a/src/dbus/qdbusthread.cpp b/src/dbus/qdbusthread.cpp
deleted file mode 100644
index 6e180b1..0000000
--- a/src/dbus/qdbusthread.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDBus module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/qmutex.h>
-#include <QtCore/qwaitcondition.h>
-
-#include <stdlib.h>
-#include <qdbus_symbols_p.h>
-
-QT_USE_NAMESPACE
-
-static DBusMutex* mutex_new()
-{
- return reinterpret_cast<DBusMutex *>(new QMutex(QMutex::NonRecursive));
-}
-
-#if 0
-static DBusMutex* recursive_mutex_new()
-{
- return reinterpret_cast<DBusMutex *>(new QMutex(QMutex::Recursive));
-}
-#endif
-
-static void mutex_free(DBusMutex *mutex)
-{
- delete reinterpret_cast<QMutex *>(mutex);
-}
-
-static dbus_bool_t mutex_lock(DBusMutex *mutex)
-{
- reinterpret_cast<QMutex *>(mutex)->lock();
- return true;
-}
-
-static dbus_bool_t mutex_unlock(DBusMutex *mutex)
-{
- reinterpret_cast<QMutex *>(mutex)->unlock();
- return true;
-}
-
-static DBusCondVar* condvar_new()
-{
- return reinterpret_cast<DBusCondVar *>(new QWaitCondition);
-}
-
-static void condvar_free(DBusCondVar *cond)
-{
- delete reinterpret_cast<QWaitCondition *>(cond);
-}
-
-static void condvar_wait(DBusCondVar *cond, DBusMutex *mutex)
-{
- reinterpret_cast<QWaitCondition *>(cond)->wait(reinterpret_cast<QMutex *>(mutex));
-}
-
-static dbus_bool_t condvar_wait_timeout(DBusCondVar *cond, DBusMutex *mutex, int msec)
-{
- return reinterpret_cast<QWaitCondition *>(cond)->wait(reinterpret_cast<QMutex *>(mutex), msec);
-}
-
-static void condvar_wake_one(DBusCondVar *cond)
-{
- reinterpret_cast<QWaitCondition *>(cond)->wakeOne();
-}
-
-static void condvar_wake_all(DBusCondVar *cond)
-{
- reinterpret_cast<QWaitCondition *>(cond)->wakeAll();
-}
-
-QT_BEGIN_NAMESPACE
-
-bool qDBusInitThreads()
-{
- // ### Disable the recursive mutex functions.
- static DBusThreadFunctions fcn = {
- DBUS_THREAD_FUNCTIONS_MUTEX_NEW_MASK |
- DBUS_THREAD_FUNCTIONS_MUTEX_FREE_MASK |
- DBUS_THREAD_FUNCTIONS_MUTEX_LOCK_MASK |
- DBUS_THREAD_FUNCTIONS_MUTEX_UNLOCK_MASK |
- DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK |
- DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK |
- DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK |
- DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK |
- DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK |
- DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK,
-#if 0
- DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_NEW_MASK |
- DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_FREE_MASK |
- DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_LOCK_MASK |
- DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_UNLOCK_MASK,
-#endif
- mutex_new,
- mutex_free,
- mutex_lock,
- mutex_unlock,
- condvar_new,
- condvar_free,
- condvar_wait,
- condvar_wait_timeout,
- condvar_wake_one,
- condvar_wake_all,
-#if 0
- recursive_mutex_new,
- mutex_free,
- mutex_lock,
- mutex_unlock,
-#else
- 0, 0, 0, 0,
-#endif
- 0, 0, 0, 0
- };
-
-#if !defined QT_LINKED_LIBDBUS
- void (*threads_init_default)() = (void (*)())qdbus_resolve_conditionally("dbus_threads_init_default");
- void (*threads_init)(DBusThreadFunctions *) = (void (*)(DBusThreadFunctions*))qdbus_resolve_conditionally("dbus_threads_init");
-
- if (threads_init_default)
- threads_init_default();
- else if (threads_init)
- threads_init(&fcn);
- else
- return false;
-
- return true;
-#else
- dbus_threads_init(&fcn);
-
- return true;
-#endif
-}
-
-QT_END_NAMESPACE
diff --git a/src/gui/dialogs/qcolordialog.cpp b/src/gui/dialogs/qcolordialog.cpp
index a7df999..44a82ef 100644
--- a/src/gui/dialogs/qcolordialog.cpp
+++ b/src/gui/dialogs/qcolordialog.cpp
@@ -62,6 +62,7 @@
#include "qmime.h"
#include "qspinbox.h"
#include "qdialogbuttonbox.h"
+#include "private/qguiplatformplugin_p.h"
#ifdef Q_WS_S60
#include "private/qt_s60_p.h"
@@ -1454,6 +1455,8 @@ void QColorDialogPrivate::init(const QColor &initial)
q->setSizeGripEnabled(false);
q->setWindowTitle(QColorDialog::tr("Select Color"));
+ nativeDialogInUse = false;
+
nextCust = 0;
QVBoxLayout *mainLay = new QVBoxLayout(q);
// there's nothing in this dialog that benefits from sizing up
@@ -1719,6 +1722,8 @@ void QColorDialog::setCurrentColor(const QColor &color)
d->setCurrentQColor(color);
d->setCocoaPanelColor(color);
#endif
+ if (d->nativeDialogInUse)
+ qt_guiPlatformPlugin()->colorDialogSetCurrentColor(this, color);
}
QColor QColorDialog::currentColor() const
@@ -1871,6 +1876,17 @@ void QColorDialog::setVisible(bool visible)
setAttribute(Qt::WA_DontShowOnScreen, false);
}
}
+#else
+
+ if (!(d->opts & DontUseNativeDialog) && qt_guiPlatformPlugin()->colorDialogSetVisible(this, visible)) {
+ d->nativeDialogInUse = true;
+ // Set WA_DontShowOnScreen so that QDialog::setVisible(visible) below
+ // updates the state correctly, but skips showing the non-native version:
+ setAttribute(Qt::WA_DontShowOnScreen);
+ } else {
+ d->nativeDialogInUse = false;
+ setAttribute(Qt::WA_DontShowOnScreen, false);
+ }
#endif
QDialog::setVisible(visible);
@@ -1970,8 +1986,8 @@ QRgb QColorDialog::getRgba(QRgb initial, bool *ok, QWidget *parent)
QColorDialog::~QColorDialog()
{
-#if defined(Q_WS_MAC)
Q_D(QColorDialog);
+#if defined(Q_WS_MAC)
if (d->delegate) {
d->releaseCocoaColorPanelDelegate();
QColorDialogPrivate::sharedColorPanelAvailable = true;
@@ -1985,6 +2001,9 @@ QColorDialog::~QColorDialog()
settings.setValue(QLatin1String("Qt/customColors/") + QString::number(i), cusrgb[i]);
}
#endif
+ if (d->nativeDialogInUse)
+ qt_guiPlatformPlugin()->colorDialogDelete(this);
+
}
diff --git a/src/gui/dialogs/qcolordialog_p.h b/src/gui/dialogs/qcolordialog_p.h
index c7cabfb..81df503 100644
--- a/src/gui/dialogs/qcolordialog_p.h
+++ b/src/gui/dialogs/qcolordialog_p.h
@@ -114,6 +114,7 @@ public:
QColorDialog::ColorDialogOptions opts;
QPointer<QObject> receiverToDisconnectOnClose;
QByteArray memberToDisconnectOnClose;
+ bool nativeDialogInUse;
#ifdef Q_WS_MAC
void openCocoaColorPanel(const QColor &initial,
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 54fc0e0..32cd397 100644
--- a/src/gui/dialogs/qfiledialog_p.h
+++ b/src/gui/dialogs/qfiledialog_p.h
@@ -76,6 +76,8 @@
#include <qdebug.h>
#include "qsidebar_p.h"
#include "qfscompleter_p.h"
+#include "private/qguiplatformplugin_p.h"
+
#if defined (Q_OS_UNIX)
#include <unistd.h>
@@ -405,17 +407,17 @@ inline QString QFileDialogPrivate::rootPath() const {
#ifndef Q_WS_MAC
// Dummies for platforms that don't use native dialogs:
- inline void QFileDialogPrivate::deleteNativeDialog_sys() {}
- inline bool QFileDialogPrivate::setVisible_sys(bool) { return false; }
- inline QDialog::DialogCode QFileDialogPrivate::dialogResultCode_sys(){ return QDialog::Rejected; }
- inline void QFileDialogPrivate::setDirectory_sys(const QString &) {}
- inline QString QFileDialogPrivate::directory_sys() const { return QString(); }
- inline void QFileDialogPrivate::selectFile_sys(const QString &) {}
- inline QStringList QFileDialogPrivate::selectedFiles_sys() const { return QStringList(); }
- inline void QFileDialogPrivate::setFilter_sys() {}
- inline void QFileDialogPrivate::setNameFilters_sys(const QStringList &) {}
- inline void QFileDialogPrivate::selectNameFilter_sys(const QString &) {}
- inline QString QFileDialogPrivate::selectedNameFilter_sys() const { return QString(); }
+ inline void QFileDialogPrivate::deleteNativeDialog_sys() { qt_guiPlatformPlugin()->fileDialogDelete(q_func()); }
+ inline bool QFileDialogPrivate::setVisible_sys(bool visible) { return qt_guiPlatformPlugin()->fileDialogSetVisible(q_func(), visible); }
+ inline QDialog::DialogCode QFileDialogPrivate::dialogResultCode_sys(){ return qt_guiPlatformPlugin()->fileDialogResultCode(q_func()); }
+ inline void QFileDialogPrivate::setDirectory_sys(const QString &directory) { qt_guiPlatformPlugin()->fileDialogSetDirectory(q_func(), directory); }
+ inline QString QFileDialogPrivate::directory_sys() const { return qt_guiPlatformPlugin()->fileDialogDirectory(q_func()); }
+ inline void QFileDialogPrivate::selectFile_sys(const QString &filename) { qt_guiPlatformPlugin()->fileDialogSelectFile(q_func(), filename); }
+ inline QStringList QFileDialogPrivate::selectedFiles_sys() const { return qt_guiPlatformPlugin()->fileDialogSelectedFiles(q_func()); }
+ inline void QFileDialogPrivate::setFilter_sys() { qt_guiPlatformPlugin()->fileDialogSetFilter(q_func()); }
+ inline void QFileDialogPrivate::setNameFilters_sys(const QStringList &filters) { qt_guiPlatformPlugin()->fileDialogSetNameFilters(q_func(), filters); }
+ inline void QFileDialogPrivate::selectNameFilter_sys(const QString &filter) { qt_guiPlatformPlugin()->fileDialogSelectNameFilter(q_func(), filter); }
+ inline QString QFileDialogPrivate::selectedNameFilter_sys() const { return qt_guiPlatformPlugin()->fileDialogSelectedNameFilter(q_func()); }
#endif
QT_END_NAMESPACE
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/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index e971fd8..ee01fdc 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -566,7 +566,7 @@ QGraphicsColorizeEffect::~QGraphicsColorizeEffect()
\brief the color of the effect.
By default, the color is light blue (QColor(0, 0, 192)).
-*/;
+*/
QColor QGraphicsColorizeEffect::color() const
{
Q_D(const QGraphicsColorizeEffect);
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
index f75118b..e3cd4f9 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp
@@ -92,87 +92,118 @@ qreal QGraphicsAnchorPrivate::spacing() const
}
+static void sizeHintsFromItem(QGraphicsLayoutItem *item,
+ const QGraphicsAnchorLayoutPrivate::Orientation orient,
+ qreal *minSize, qreal *prefSize,
+ qreal *expSize, qreal *maxSize)
+{
+ QSizePolicy::Policy policy;
+ qreal minSizeHint;
+ qreal prefSizeHint;
+ qreal maxSizeHint;
+
+ if (orient == QGraphicsAnchorLayoutPrivate::Horizontal) {
+ policy = item->sizePolicy().horizontalPolicy();
+ minSizeHint = item->effectiveSizeHint(Qt::MinimumSize).width();
+ prefSizeHint = item->effectiveSizeHint(Qt::PreferredSize).width();
+ maxSizeHint = item->effectiveSizeHint(Qt::MaximumSize).width();
+ } else {
+ policy = item->sizePolicy().verticalPolicy();
+ minSizeHint = item->effectiveSizeHint(Qt::MinimumSize).height();
+ prefSizeHint = item->effectiveSizeHint(Qt::PreferredSize).height();
+ maxSizeHint = item->effectiveSizeHint(Qt::MaximumSize).height();
+ }
+
+ // minSize, prefSize and maxSize are initialized
+ // with item's preferred Size: this is QSizePolicy::Fixed.
+ //
+ // Then we check each flag to find the resultant QSizePolicy,
+ // according to the following table:
+ //
+ // constant value
+ // QSizePolicy::Fixed 0
+ // QSizePolicy::Minimum GrowFlag
+ // QSizePolicy::Maximum ShrinkFlag
+ // QSizePolicy::Preferred GrowFlag | ShrinkFlag
+ // QSizePolicy::Ignored GrowFlag | ShrinkFlag | IgnoreFlag
+
+ if (policy & QSizePolicy::ShrinkFlag)
+ *minSize = minSizeHint;
+ else
+ *minSize = prefSizeHint;
+
+ if (policy & QSizePolicy::GrowFlag)
+ *maxSize = maxSizeHint;
+ else
+ *maxSize = prefSizeHint;
+
+ // Note that these two initializations are affected by the previous flags
+ if (policy & QSizePolicy::IgnoreFlag)
+ *prefSize = *maxSize;
+ else
+ *prefSize = prefSizeHint;
+
+ if (policy & QSizePolicy::ExpandFlag)
+ *expSize = *maxSize;
+ else
+ *expSize = *prefSize;
+}
+
void AnchorData::refreshSizeHints(qreal effectiveSpacing)
{
- if (!isLayoutAnchor && from->m_item == to->m_item) {
- QGraphicsLayoutItem *item = from->m_item;
+ const bool isInternalAnchor = from->m_item == to->m_item;
- const QGraphicsAnchorLayoutPrivate::Orientation orient = QGraphicsAnchorLayoutPrivate::edgeOrientation(from->m_edge);
- const Qt::AnchorPoint centerEdge = QGraphicsAnchorLayoutPrivate::pickEdge(Qt::AnchorHorizontalCenter, orient);
+ if (isInternalAnchor) {
+ const QGraphicsAnchorLayoutPrivate::Orientation orient =
+ QGraphicsAnchorLayoutPrivate::edgeOrientation(from->m_edge);
- QSizePolicy::Policy policy;
- qreal minSizeHint, prefSizeHint, maxSizeHint;
- if (orient == QGraphicsAnchorLayoutPrivate::Horizontal) {
- policy = item->sizePolicy().horizontalPolicy();
- minSizeHint = item->effectiveSizeHint(Qt::MinimumSize).width();
- prefSizeHint = item->effectiveSizeHint(Qt::PreferredSize).width();
- maxSizeHint = item->effectiveSizeHint(Qt::MaximumSize).width();
+ if (isLayoutAnchor) {
+ minSize = 0;
+ prefSize = 0;
+ expSize = 0;
+ maxSize = QWIDGETSIZE_MAX;
} else {
- policy = item->sizePolicy().verticalPolicy();
- minSizeHint = item->effectiveSizeHint(Qt::MinimumSize).height();
- prefSizeHint = item->effectiveSizeHint(Qt::PreferredSize).height();
- maxSizeHint = item->effectiveSizeHint(Qt::MaximumSize).height();
+ QGraphicsLayoutItem *item = from->m_item;
+ sizeHintsFromItem(item, orient, &minSize, &prefSize, &expSize, &maxSize);
}
- // minSize, prefSize and maxSize are initialized
- // with item's preferred Size: this is QSizePolicy::Fixed.
- //
- // Then we check each flag to find the resultant QSizePolicy,
- // according to the following table:
- //
- // constant value
- // QSizePolicy::Fixed 0
- // QSizePolicy::Minimum GrowFlag
- // QSizePolicy::Maximum ShrinkFlag
- // QSizePolicy::Preferred GrowFlag | ShrinkFlag
- // QSizePolicy::Ignored GrowFlag | ShrinkFlag | IgnoreFlag
- prefSize = prefSizeHint;
- minSize = prefSize;
- maxSize = prefSize;
-
- if (policy & QSizePolicy::GrowFlag)
- maxSize = maxSizeHint;
-
- if (policy & QSizePolicy::ShrinkFlag)
- minSize = minSizeHint;
-
- if (policy & QSizePolicy::IgnoreFlag)
- prefSize = minSize;
+ const Qt::AnchorPoint centerEdge =
+ QGraphicsAnchorLayoutPrivate::pickEdge(Qt::AnchorHorizontalCenter, orient);
bool hasCenter = (from->m_edge == centerEdge || to->m_edge == centerEdge);
if (hasCenter) {
minSize /= 2;
prefSize /= 2;
+ expSize /= 2;
maxSize /= 2;
}
- // Set the anchor effective sizes to preferred.
- //
- // Note: The idea here is that all items should remain at their
- // preferred size unless where that's impossible. In cases where
- // the item is subject to restrictions (anchored to the layout
- // edges, for instance), the simplex solver will be run to
- // recalculate and override the values we set here.
- sizeAtMinimum = prefSize;
- sizeAtPreferred = prefSize;
- sizeAtMaximum = prefSize;
-
} else if (!hasSize) {
// Anchor has no size defined, use given default information
minSize = effectiveSpacing;
prefSize = effectiveSpacing;
+ expSize = effectiveSpacing;
maxSize = effectiveSpacing;
-
- sizeAtMinimum = prefSize;
- sizeAtPreferred = prefSize;
- sizeAtMaximum = prefSize;
}
+
+ // Set the anchor effective sizes to preferred.
+ //
+ // Note: The idea here is that all items should remain at their
+ // preferred size unless where that's impossible. In cases where
+ // the item is subject to restrictions (anchored to the layout
+ // edges, for instance), the simplex solver will be run to
+ // recalculate and override the values we set here.
+ sizeAtMinimum = prefSize;
+ sizeAtPreferred = prefSize;
+ sizeAtExpanding = prefSize;
+ sizeAtMaximum = prefSize;
}
void ParallelAnchorData::updateChildrenSizes()
{
firstEdge->sizeAtMinimum = secondEdge->sizeAtMinimum = sizeAtMinimum;
firstEdge->sizeAtPreferred = secondEdge->sizeAtPreferred = sizeAtPreferred;
+ firstEdge->sizeAtExpanding = secondEdge->sizeAtExpanding = sizeAtExpanding;
firstEdge->sizeAtMaximum = secondEdge->sizeAtMaximum = sizeAtMaximum;
firstEdge->updateChildrenSizes();
@@ -181,9 +212,16 @@ void ParallelAnchorData::updateChildrenSizes()
void ParallelAnchorData::refreshSizeHints(qreal effectiveSpacing)
{
- // First refresh children information
- firstEdge->refreshSizeHints(effectiveSpacing);
- secondEdge->refreshSizeHints(effectiveSpacing);
+ refreshSizeHints_helper(effectiveSpacing);
+}
+
+void ParallelAnchorData::refreshSizeHints_helper(qreal effectiveSpacing,
+ bool refreshChildren)
+{
+ if (refreshChildren) {
+ firstEdge->refreshSizeHints(effectiveSpacing);
+ secondEdge->refreshSizeHints(effectiveSpacing);
+ }
// ### should we warn if the parallel connection is invalid?
// e.g. 1-2-3 with 10-20-30, the minimum of the latter is
@@ -192,12 +230,16 @@ void ParallelAnchorData::refreshSizeHints(qreal effectiveSpacing)
minSize = qMax(firstEdge->minSize, secondEdge->minSize);
maxSize = qMin(firstEdge->maxSize, secondEdge->maxSize);
+ expSize = qMax(firstEdge->expSize, secondEdge->expSize);
+ expSize = qMin(expSize, maxSize);
+
prefSize = qMax(firstEdge->prefSize, secondEdge->prefSize);
- prefSize = qMin(prefSize, maxSize);
+ prefSize = qMin(prefSize, expSize);
// See comment in AnchorData::refreshSizeHints() about sizeAt* values
sizeAtMinimum = prefSize;
sizeAtPreferred = prefSize;
+ sizeAtExpanding = prefSize;
sizeAtMaximum = prefSize;
}
@@ -233,6 +275,21 @@ static qreal getFactor(qreal value, qreal min, qreal pref, qreal max)
}
}
+static qreal getExpandingFactor(qreal expSize, qreal sizeAtPreferred,
+ qreal sizeAtExpanding, qreal sizeAtMaximum)
+{
+ const qreal lower = qMin(sizeAtPreferred, sizeAtMaximum);
+ const qreal upper = qMax(sizeAtPreferred, sizeAtMaximum);
+ const qreal boundedExpSize = qBound(lower, expSize, upper);
+
+ const qreal bandSize = sizeAtMaximum - boundedExpSize;
+ if (bandSize == 0) {
+ return 0;
+ } else {
+ return (sizeAtExpanding - boundedExpSize) / bandSize;
+ }
+}
+
void SequentialAnchorData::updateChildrenSizes()
{
// ### REMOVE ME
@@ -242,15 +299,18 @@ void SequentialAnchorData::updateChildrenSizes()
Q_ASSERT(sizeAtMinimum < maxSize || qFuzzyCompare(sizeAtMinimum, maxSize));
Q_ASSERT(sizeAtPreferred > minSize || qFuzzyCompare(sizeAtPreferred, minSize));
Q_ASSERT(sizeAtPreferred < maxSize || qFuzzyCompare(sizeAtPreferred, maxSize));
+ Q_ASSERT(sizeAtExpanding > minSize || qFuzzyCompare(sizeAtExpanding, minSize));
+ Q_ASSERT(sizeAtExpanding < maxSize || qFuzzyCompare(sizeAtExpanding, maxSize));
Q_ASSERT(sizeAtMaximum > minSize || qFuzzyCompare(sizeAtMaximum, minSize));
Q_ASSERT(sizeAtMaximum < maxSize || qFuzzyCompare(sizeAtMaximum, maxSize));
// Band here refers if the value is in the Minimum To Preferred
// band (the lower band) or the Preferred To Maximum (the upper band).
- qreal minFactor = getFactor(sizeAtMinimum, minSize, prefSize, maxSize);
- qreal prefFactor = getFactor(sizeAtPreferred, minSize, prefSize, maxSize);
- qreal maxFactor = getFactor(sizeAtMaximum, minSize, prefSize, maxSize);
+ const qreal minFactor = getFactor(sizeAtMinimum, minSize, prefSize, maxSize);
+ const qreal prefFactor = getFactor(sizeAtPreferred, minSize, prefSize, maxSize);
+ const qreal maxFactor = getFactor(sizeAtMaximum, minSize, prefSize, maxSize);
+ const qreal expFactor = getExpandingFactor(expSize, sizeAtPreferred, sizeAtExpanding, sizeAtMaximum);
for (int i = 0; i < m_edges.count(); ++i) {
AnchorData *e = m_edges.at(i);
@@ -264,30 +324,45 @@ void SequentialAnchorData::updateChildrenSizes()
bandSize = maxFactor > 0 ? e->maxSize - e->prefSize : e->prefSize - e->minSize;
e->sizeAtMaximum = e->prefSize + bandSize * maxFactor;
+ const qreal lower = qMin(e->sizeAtPreferred, e->sizeAtMaximum);
+ const qreal upper = qMax(e->sizeAtPreferred, e->sizeAtMaximum);
+ const qreal edgeBoundedExpSize = qBound(lower, e->expSize, upper);
+ e->sizeAtExpanding = edgeBoundedExpSize + expFactor * (e->sizeAtMaximum - edgeBoundedExpSize);
+
e->updateChildrenSizes();
}
}
void SequentialAnchorData::refreshSizeHints(qreal effectiveSpacing)
{
+ refreshSizeHints_helper(effectiveSpacing);
+}
+
+void SequentialAnchorData::refreshSizeHints_helper(qreal effectiveSpacing,
+ bool refreshChildren)
+{
minSize = 0;
prefSize = 0;
+ expSize = 0;
maxSize = 0;
for (int i = 0; i < m_edges.count(); ++i) {
AnchorData *edge = m_edges.at(i);
- // First refresh children information
- edge->refreshSizeHints(effectiveSpacing);
+ // If it's the case refresh children information first
+ if (refreshChildren)
+ edge->refreshSizeHints(effectiveSpacing);
minSize += edge->minSize;
prefSize += edge->prefSize;
+ expSize += edge->expSize;
maxSize += edge->maxSize;
}
// See comment in AnchorData::refreshSizeHints() about sizeAt* values
sizeAtMinimum = prefSize;
sizeAtPreferred = prefSize;
+ sizeAtExpanding = prefSize;
sizeAtMaximum = prefSize;
}
@@ -357,6 +432,12 @@ QGraphicsAnchorLayoutPrivate::QGraphicsAnchorLayoutPrivate()
: calculateGraphCacheDirty(1)
{
for (int i = 0; i < NOrientations; ++i) {
+ for (int j = 0; j < 3; ++j) {
+ sizeHints[i][j] = -1;
+ }
+ sizeAtExpanding[i] = -1;
+ interpolationProgress[i] = -1;
+
spacings[i] = -1;
graphSimplified[i] = false;
graphHasConflicts[i] = false;
@@ -422,39 +503,21 @@ static bool simplifySequentialChunk(Graph<AnchorVertex, AnchorData> *graph,
qDebug("simplifying [%s] to [%s - %s]", qPrintable(strPath), qPrintable(before->toString()), qPrintable(after->toString()));
#endif
- qreal min = 0;
- qreal pref = 0;
- qreal max = 0;
-
SequentialAnchorData *sequence = new SequentialAnchorData;
AnchorVertex *prev = before;
AnchorData *data;
for (i = 0; i <= vertices.count(); ++i) {
AnchorVertex *next = (i < vertices.count()) ? vertices.at(i) : after;
data = graph->takeEdge(prev, next);
- min += data->minSize;
- pref += data->prefSize;
- max = checkAdd(max, data->maxSize);
sequence->m_edges.append(data);
prev = next;
}
-
- // insert new
- sequence->minSize = min;
- sequence->prefSize = pref;
- sequence->maxSize = max;
-
- // Unless these values are overhidden by the simplex solver later-on,
- // anchors will keep their own preferred size.
- sequence->sizeAtMinimum = pref;
- sequence->sizeAtPreferred = pref;
- sequence->sizeAtMaximum = pref;
-
sequence->setVertices(vertices);
-
sequence->from = before;
sequence->to = after;
+ sequence->refreshSizeHints_helper(0, false);
+
// data here is the last edge in the sequence
// ### this seems to be here for supporting reverse order sequences,
// but doesnt seem to be used right now
@@ -469,25 +532,11 @@ static bool simplifySequentialChunk(Graph<AnchorVertex, AnchorData> *graph,
AnchorData *newAnchor = sequence;
if (AnchorData *oldAnchor = graph->takeEdge(before, after)) {
- newAnchor = new ParallelAnchorData(oldAnchor, sequence);
-
- newAnchor->isLayoutAnchor = (oldAnchor->isLayoutAnchor
+ ParallelAnchorData *parallel = new ParallelAnchorData(oldAnchor, sequence);
+ parallel->isLayoutAnchor = (oldAnchor->isLayoutAnchor
|| sequence->isLayoutAnchor);
-
- min = qMax(oldAnchor->minSize, sequence->minSize);
- max = qMin(oldAnchor->maxSize, sequence->maxSize);
-
- pref = qMax(oldAnchor->prefSize, sequence->prefSize);
- pref = qMin(pref, max);
-
- newAnchor->minSize = min;
- newAnchor->prefSize = pref;
- newAnchor->maxSize = max;
-
- // Same as above, by default, keep preferred size.
- newAnchor->sizeAtMinimum = pref;
- newAnchor->sizeAtPreferred = pref;
- newAnchor->sizeAtMaximum = pref;
+ parallel->refreshSizeHints_helper(0, false);
+ newAnchor = parallel;
}
graph->createEdge(before, after, newAnchor);
@@ -817,9 +866,10 @@ void QGraphicsAnchorLayoutPrivate::createLayoutEdges()
QGraphicsLayoutItem *layout = q;
// Horizontal
- AnchorData *data = new AnchorData(0, 0, QWIDGETSIZE_MAX);
+ AnchorData *data = new AnchorData;
addAnchor_helper(layout, Qt::AnchorLeft, layout,
- Qt::AnchorRight, data);
+ Qt::AnchorRight, data);
+ data->maxSize = QWIDGETSIZE_MAX;
data->skipInPreferred = 1;
// Set the Layout Left edge as the root of the horizontal graph.
@@ -827,9 +877,10 @@ void QGraphicsAnchorLayoutPrivate::createLayoutEdges()
graph[Horizontal].setRootVertex(v);
// Vertical
- data = new AnchorData(0, 0, QWIDGETSIZE_MAX);
+ data = new AnchorData;
addAnchor_helper(layout, Qt::AnchorTop, layout,
- Qt::AnchorBottom, data);
+ Qt::AnchorBottom, data);
+ data->maxSize = QWIDGETSIZE_MAX;
data->skipInPreferred = 1;
// Set the Layout Top edge as the root of the vertical graph.
@@ -856,19 +907,15 @@ void QGraphicsAnchorLayoutPrivate::createItemEdges(QGraphicsLayoutItem *item)
items.append(item);
- QSizeF minSize = item->effectiveSizeHint(Qt::MinimumSize);
- QSizeF prefSize = item->effectiveSizeHint(Qt::PreferredSize);
- QSizeF maxSize = item->effectiveSizeHint(Qt::MaximumSize);
-
- // Horizontal
- AnchorData *data = new AnchorData(minSize.width(), prefSize.width(), maxSize.width());
- addAnchor_helper(item, Qt::AnchorLeft, item,
- Qt::AnchorRight, data);
+ // Create horizontal and vertical internal anchors for the item and
+ // refresh its size hint / policy values.
+ AnchorData *data = new AnchorData;
+ addAnchor_helper(item, Qt::AnchorLeft, item, Qt::AnchorRight, data);
+ data->refreshSizeHints(0); // 0 = effectiveSpacing, will not be used
- // Vertical
- data = new AnchorData(minSize.height(), prefSize.height(), maxSize.height());
- addAnchor_helper(item, Qt::AnchorTop, item,
- Qt::AnchorBottom, data);
+ data = new AnchorData;
+ addAnchor_helper(item, Qt::AnchorTop, item, Qt::AnchorBottom, data);
+ data->refreshSizeHints(0); // 0 = effectiveSpacing, will not be used
}
/*!
@@ -921,20 +968,17 @@ void QGraphicsAnchorLayoutPrivate::createCenterAnchors(
Q_ASSERT(first && last);
// Create new anchors
- AnchorData *oldData = graph[orientation].edgeData(first, last);
-
- qreal minimumSize = oldData->minSize / 2;
- qreal preferredSize = oldData->prefSize / 2;
- qreal maximumSize = oldData->maxSize / 2;
-
QSimplexConstraint *c = new QSimplexConstraint;
- AnchorData *data = new AnchorData(minimumSize, preferredSize, maximumSize);
+
+ AnchorData *data = new AnchorData;
c->variables.insert(data, 1.0);
addAnchor_helper(item, firstEdge, item, centerEdge, data);
+ data->refreshSizeHints(0);
- data = new AnchorData(minimumSize, preferredSize, maximumSize);
+ data = new AnchorData;
c->variables.insert(data, -1.0);
addAnchor_helper(item, centerEdge, item, lastEdge, data);
+ data->refreshSizeHints(0);
itemCenterConstraints[orientation].append(c);
@@ -995,14 +1039,9 @@ void QGraphicsAnchorLayoutPrivate::removeCenterAnchors(
if (substitute) {
// Create the new anchor that should substitute the left-center-right anchors.
- AnchorData *oldData = g.edgeData(first, center);
-
- qreal minimumSize = oldData->minSize * 2;
- qreal preferredSize = oldData->prefSize * 2;
- qreal maximumSize = oldData->maxSize * 2;
-
- AnchorData *data = new AnchorData(minimumSize, preferredSize, maximumSize);
+ AnchorData *data = new AnchorData;
addAnchor_helper(item, firstEdge, item, lastEdge, data);
+ data->refreshSizeHints(0);
// Remove old anchors
removeAnchor_helper(first, center);
@@ -1120,7 +1159,7 @@ QGraphicsAnchor *QGraphicsAnchorLayoutPrivate::addAnchor(QGraphicsLayoutItem *fi
// Use heuristics to find out what the user meant with this anchor.
correctEdgeDirection(firstItem, firstEdge, secondItem, secondEdge);
- AnchorData *data;
+ AnchorData *data = new AnchorData;
if (!spacing) {
// If firstItem or secondItem is the layout itself, the spacing will default to 0.
// Otherwise, the following matrix is used (questionmark means that the spacing
@@ -1130,22 +1169,25 @@ QGraphicsAnchor *QGraphicsAnchorLayoutPrivate::addAnchor(QGraphicsLayoutItem *fi
// Left 0 0 ?
// HCenter 0 0 0
// Right ? 0 0
- if (firstItem != q
- && secondItem != q
- && pickEdge(firstEdge, Horizontal) != Qt::AnchorHorizontalCenter
- && oppositeEdge(firstEdge) == secondEdge) {
- data = new AnchorData; // ask the style later
+ if (firstItem == q
+ || secondItem == q
+ || pickEdge(firstEdge, Horizontal) == Qt::AnchorHorizontalCenter
+ || oppositeEdge(firstEdge) != secondEdge) {
+ data->setFixedSize(0);
} else {
- data = new AnchorData(0); // spacing should be 0
+ data->unsetSize();
}
addAnchor_helper(firstItem, firstEdge, secondItem, secondEdge, data);
+
} else if (*spacing >= 0) {
- data = new AnchorData(*spacing);
+ data->setFixedSize(*spacing);
addAnchor_helper(firstItem, firstEdge, secondItem, secondEdge, data);
+
} else {
- data = new AnchorData(-*spacing);
+ data->setFixedSize(-*spacing);
addAnchor_helper(secondItem, secondEdge, firstItem, firstEdge, data);
}
+
return acquireGraphicsAnchor(data);
}
@@ -1622,11 +1664,18 @@ void QGraphicsAnchorLayoutPrivate::calculateGraphs(
qreal min, max;
feasible = solveMinMax(trunkConstraints, trunkPath, &min, &max);
- // Solve for preferred. The objective function is calculated from the constraints
- // and variables internally.
- feasible &= solvePreferred(trunkConstraints);
-
if (feasible) {
+ // Solve for preferred. The objective function is calculated from the constraints
+ // and variables internally.
+ solvePreferred(trunkConstraints);
+
+ // remove sizeHintConstraints from trunkConstraints
+ trunkConstraints = parts[0];
+
+ // Solve for expanding. The objective function and the constraints from items
+ // are calculated internally.
+ solveExpanding(trunkConstraints);
+
// Propagate the new sizes down the simplified graph, ie. tell the
// group anchors to set their children anchors sizes.
@@ -1636,19 +1685,23 @@ void QGraphicsAnchorLayoutPrivate::calculateGraphs(
for (int i = 0; i < trunkVariables.count(); ++i)
trunkVariables.at(i)->updateChildrenSizes();
- // Calculate and set the preferred size for the layout from the edge sizes that
- // were calculated above.
+ // Calculate and set the preferred and expanding sizes for the layout,
+ // from the edge sizes that were calculated above.
qreal pref(0.0);
+ qreal expanding(0.0);
foreach (const AnchorData *ad, trunkPath.positives) {
pref += ad->sizeAtPreferred;
+ expanding += ad->sizeAtExpanding;
}
foreach (const AnchorData *ad, trunkPath.negatives) {
pref -= ad->sizeAtPreferred;
+ expanding -= ad->sizeAtExpanding;
}
+
sizeHints[orientation][Qt::MinimumSize] = min;
sizeHints[orientation][Qt::PreferredSize] = pref;
sizeHints[orientation][Qt::MaximumSize] = max;
-
+ sizeAtExpanding[orientation] = expanding;
}
} else {
#if 0
@@ -1664,6 +1717,7 @@ void QGraphicsAnchorLayoutPrivate::calculateGraphs(
AnchorData *ad = trunkPath.positives.toList()[0];
ad->sizeAtMinimum = ad->minSize;
ad->sizeAtPreferred = ad->prefSize;
+ ad->sizeAtExpanding = ad->expSize;
ad->sizeAtMaximum = ad->maxSize;
// Propagate
@@ -1672,6 +1726,7 @@ void QGraphicsAnchorLayoutPrivate::calculateGraphs(
sizeHints[orientation][Qt::MinimumSize] = ad->sizeAtMinimum;
sizeHints[orientation][Qt::PreferredSize] = ad->sizeAtPreferred;
sizeHints[orientation][Qt::MaximumSize] = ad->sizeAtMaximum;
+ sizeAtExpanding[orientation] = ad->sizeAtExpanding;
}
// Delete the constraints, we won't use them anymore.
@@ -1701,6 +1756,7 @@ void QGraphicsAnchorLayoutPrivate::calculateGraphs(
AnchorData *ad = partVariables[j];
Q_ASSERT(ad);
ad->sizeAtMinimum = ad->sizeAtPreferred;
+ ad->sizeAtExpanding = ad->sizeAtPreferred;
ad->sizeAtMaximum = ad->sizeAtPreferred;
ad->updateChildrenSizes();
}
@@ -1785,6 +1841,11 @@ void QGraphicsAnchorLayoutPrivate::findPaths(Orientation orientation)
queue.enqueue(qMakePair(pair.second, v));
}
}
+
+ // We will walk through every reachable items (non-float) and mark them
+ // by keeping their references on m_nonFloatItems. With this we can easily
+ // identify non-float and float items.
+ identifyNonFloatItems(visited, orientation);
}
/*!
@@ -1943,6 +2004,46 @@ QGraphicsAnchorLayoutPrivate::getGraphParts(Orientation orientation)
}
/*!
+ \internal
+
+ Use all visited Anchors on findPaths() so we can identify non-float Items.
+*/
+void QGraphicsAnchorLayoutPrivate::identifyNonFloatItems(QSet<AnchorData *> visited, Orientation orientation)
+{
+ m_nonFloatItems[orientation].clear();
+
+ foreach (const AnchorData *ad, visited)
+ identifyNonFloatItems_helper(ad, orientation);
+}
+
+/*!
+ \internal
+
+ Given an anchor, if it is an internal anchor and Normal we must mark it's item as non-float.
+ If the anchor is Sequential or Parallel, we must iterate on its children recursively until we reach
+ internal anchors (items).
+*/
+void QGraphicsAnchorLayoutPrivate::identifyNonFloatItems_helper(const AnchorData *ad, Orientation orientation)
+{
+ Q_Q(QGraphicsAnchorLayout);
+
+ switch(ad->type) {
+ case AnchorData::Normal:
+ if (ad->from->m_item == ad->to->m_item && ad->to->m_item != q)
+ m_nonFloatItems[orientation].insert(ad->to->m_item);
+ break;
+ case AnchorData::Sequential:
+ foreach (const AnchorData *d, static_cast<const SequentialAnchorData *>(ad)->m_edges)
+ identifyNonFloatItems_helper(d, orientation);
+ break;
+ case AnchorData::Parallel:
+ identifyNonFloatItems_helper(static_cast<const ParallelAnchorData *>(ad)->firstEdge, orientation);
+ identifyNonFloatItems_helper(static_cast<const ParallelAnchorData *>(ad)->secondEdge, orientation);
+ break;
+ }
+}
+
+/*!
\internal
Use the current vertices distance to calculate and set the geometry of
@@ -1967,22 +2068,35 @@ void QGraphicsAnchorLayoutPrivate::setItemsGeometries(const QRectF &geom)
right = geom.right() - right;
foreach (QGraphicsLayoutItem *item, items) {
- firstH = internalVertex(item, Qt::AnchorLeft);
- secondH = internalVertex(item, Qt::AnchorRight);
- firstV = internalVertex(item, Qt::AnchorTop);
- secondV = internalVertex(item, Qt::AnchorBottom);
-
QRectF newGeom;
- newGeom.setTop(top + firstV->distance);
- newGeom.setBottom(top + secondV->distance);
+ QSizeF itemPreferredSize = item->effectiveSizeHint(Qt::PreferredSize);
+ if (m_nonFloatItems[Horizontal].contains(item)) {
+ firstH = internalVertex(item, Qt::AnchorLeft);
+ secondH = internalVertex(item, Qt::AnchorRight);
+
+ if (visualDir == Qt::LeftToRight) {
+ newGeom.setLeft(left + firstH->distance);
+ newGeom.setRight(left + secondH->distance);
+ } else {
+ newGeom.setLeft(right - secondH->distance);
+ newGeom.setRight(right - firstH->distance);
+ }
+ } else {
+ newGeom.setLeft(0);
+ newGeom.setRight(itemPreferredSize.width());
+ }
+
+ if (m_nonFloatItems[Vertical].contains(item)) {
+ firstV = internalVertex(item, Qt::AnchorTop);
+ secondV = internalVertex(item, Qt::AnchorBottom);
- if (visualDir == Qt::LeftToRight) {
- newGeom.setLeft(left + firstH->distance);
- newGeom.setRight(left + secondH->distance);
+ newGeom.setTop(top + firstV->distance);
+ newGeom.setBottom(top + secondV->distance);
} else {
- newGeom.setLeft(right - secondH->distance);
- newGeom.setRight(right - firstH->distance);
+ newGeom.setTop(0);
+ newGeom.setBottom(itemPreferredSize.height());
}
+
item->setGeometry(newGeom);
}
}
@@ -2058,9 +2172,13 @@ void QGraphicsAnchorLayoutPrivate::setupEdgesInterpolation(
interpolationInterval[orientation] = MinToPreferred;
lower = sizeHints[orientation][Qt::MinimumSize];
upper = sizeHints[orientation][Qt::PreferredSize];
- } else {
- interpolationInterval[orientation] = PreferredToMax;
+ } else if (current < sizeAtExpanding[orientation]) {
+ interpolationInterval[orientation] = PreferredToExpanding;
lower = sizeHints[orientation][Qt::PreferredSize];
+ upper = sizeAtExpanding[orientation];
+ } else {
+ interpolationInterval[orientation] = ExpandingToMax;
+ lower = sizeAtExpanding[orientation];
upper = sizeHints[orientation][Qt::MaximumSize];
}
@@ -2075,11 +2193,12 @@ void QGraphicsAnchorLayoutPrivate::setupEdgesInterpolation(
\internal
Calculate the current Edge size based on the current Layout size and the
- size the edge is supposed to have when:
+ size the edge is supposed to have when the layout is at its:
- - the layout is at its minimum size.
- - the layout is at its preferred size.
- - the layout is at its maximum size.
+ - minimum size,
+ - preferred size,
+ - size when all expanding anchors are expanded,
+ - maximum size.
These three key values are calculated in advance using linear
programming (more expensive) or the simplification algorithm, then
@@ -2099,8 +2218,11 @@ void QGraphicsAnchorLayoutPrivate::interpolateEdge(AnchorVertex *base,
if (interpolationInterval[orientation] == MinToPreferred) {
lower = edge->sizeAtMinimum;
upper = edge->sizeAtPreferred;
- } else {
+ } else if (interpolationInterval[orientation] == PreferredToExpanding) {
lower = edge->sizeAtPreferred;
+ upper = edge->sizeAtExpanding;
+ } else {
+ lower = edge->sizeAtExpanding;
upper = edge->sizeAtMaximum;
}
@@ -2289,6 +2411,139 @@ bool QGraphicsAnchorLayoutPrivate::solvePreferred(QList<QSimplexConstraint *> co
/*!
\internal
+ Calculate the "expanding" keyframe
+
+ This new keyframe sits between the already existing sizeAtPreferred and
+ sizeAtMaximum keyframes. Its goal is to modify the interpolation between
+ the latter as to respect the "expanding" size policy of some anchors.
+
+ Previously all items would be subject to a linear interpolation between
+ sizeAtPreferred and sizeAtMaximum values. This will change now, the
+ expanding anchors will change their size before the others. To calculate
+ this keyframe we use the following logic:
+
+ 1) Ask each anchor for their desired expanding size (ad->expSize), this
+ value depends on the anchor expanding property in the following way:
+
+ - Expanding normal anchors want to grow towards their maximum size
+ - Non-expanding normal anchors want to remain at their preferred size.
+ - Sequential anchors wants to grow towards a size that is calculated by:
+ summarizing it's child anchors, where it will use preferred size for non-expanding anchors
+ and maximum size for expanding anchors.
+ - Parallel anchors want to grow towards the smallest maximum size of all the expanding anchors.
+
+ 2) Clamp their desired values to the value they assume in the neighbour
+ keyframes (sizeAtPreferred and sizeAtExpanding)
+
+ 3) Run simplex with a setup that ensures the following:
+
+ a. Anchors will change their value from their sizeAtPreferred towards
+ their sizeAtMaximum as much as required to ensure that ALL anchors
+ reach their respective "desired" expanding sizes.
+
+ b. No anchors will change their value beyond what is NEEDED to satisfy
+ the requirement above.
+
+ The final result is that, at the "expanding" keyframe expanding anchors
+ will grow and take with them all anchors that are parallel to them.
+ However, non-expanding anchors will remain at their preferred size unless
+ they are forced to grow by a parallel expanding anchor.
+
+ Note: For anchors where the sizeAtPreferred is bigger than sizeAtMaximum,
+ the visual effect when the layout grows from its preferred size is
+ the following: Expanding anchors will keep their size while non
+ expanding ones will shrink. Only after non-expanding anchors have
+ shrinked all the way, the expanding anchors will start to shrink too.
+*/
+void QGraphicsAnchorLayoutPrivate::solveExpanding(QList<QSimplexConstraint *> constraints)
+{
+ QList<AnchorData *> variables = getVariables(constraints);
+ QList<QSimplexConstraint *> itemConstraints;
+ QSimplexConstraint *objective = new QSimplexConstraint;
+ bool hasExpanding = false;
+
+ // Construct the simplex constraints and objective
+ for (int i = 0; i < variables.size(); ++i) {
+ // For each anchor
+ AnchorData *ad = variables[i];
+
+ // Clamp the desired expanding size
+ qreal upperBoundary = qMax(ad->sizeAtPreferred, ad->sizeAtMaximum);
+ qreal lowerBoundary = qMin(ad->sizeAtPreferred, ad->sizeAtMaximum);
+ qreal boundedExpSize = qBound(lowerBoundary, ad->expSize, upperBoundary);
+
+ // Expanding anchors are those that want to move from their preferred size
+ if (boundedExpSize != ad->sizeAtPreferred)
+ hasExpanding = true;
+
+ // Lock anchor between boundedExpSize and sizeAtMaximum (ensure 3.a)
+ if (boundedExpSize == ad->sizeAtMaximum) {
+ // The interval has only one possible value, we can use an "Equal"
+ // constraint and don't need to add this variable to the objective.
+ QSimplexConstraint *itemC = new QSimplexConstraint;
+ itemC->ratio = QSimplexConstraint::Equal;
+ itemC->variables.insert(ad, 1.0);
+ itemC->constant = boundedExpSize;
+ itemConstraints << itemC;
+ } else {
+ // Add MoreOrEqual and LessOrEqual constraints.
+ QSimplexConstraint *itemC = new QSimplexConstraint;
+ itemC->ratio = QSimplexConstraint::MoreOrEqual;
+ itemC->variables.insert(ad, 1.0);
+ itemC->constant = qMin(boundedExpSize, ad->sizeAtMaximum);
+ itemConstraints << itemC;
+
+ itemC = new QSimplexConstraint;
+ itemC->ratio = QSimplexConstraint::LessOrEqual;
+ itemC->variables.insert(ad, 1.0);
+ itemC->constant = qMax(boundedExpSize, ad->sizeAtMaximum);
+ itemConstraints << itemC;
+
+ // Create objective to avoid the anchors from moving away from
+ // the preferred size more than the needed amount. (ensure 3.b)
+ // The objective function is the distance between sizeAtPreferred
+ // and sizeAtExpanding, it will be minimized.
+ if (ad->sizeAtExpanding < ad->sizeAtMaximum) {
+ // Try to shrink this variable towards its sizeAtPreferred value
+ objective->variables.insert(ad, 1.0);
+ } else {
+ // Try to grow this variable towards its sizeAtPreferred value
+ objective->variables.insert(ad, -1.0);
+ }
+ }
+ }
+
+ // Solve
+ if (hasExpanding == false) {
+ // If no anchors are expanding, we don't need to run the simplex
+ // Set all variables to their preferred size
+ for (int i = 0; i < variables.size(); ++i) {
+ variables[i]->sizeAtExpanding = variables[i]->sizeAtPreferred;
+ }
+ } else {
+ // Run simplex
+ QSimplex simplex;
+
+ // Satisfy expanding (3.a)
+ bool feasible = simplex.setConstraints(constraints + itemConstraints);
+ Q_ASSERT(feasible);
+
+ // Reduce damage (3.b)
+ simplex.setObjective(objective);
+ simplex.solveMin();
+
+ // Collect results
+ for (int i = 0; i < variables.size(); ++i) {
+ variables[i]->sizeAtExpanding = variables[i]->result;
+ }
+ }
+
+ delete objective;
+ qDeleteAll(itemConstraints);
+}
+
+/*!
+ \internal
Returns true if there are no arrangement that satisfies all constraints.
Otherwise returns false.
@@ -2298,7 +2553,11 @@ bool QGraphicsAnchorLayoutPrivate::hasConflicts() const
{
QGraphicsAnchorLayoutPrivate *that = const_cast<QGraphicsAnchorLayoutPrivate*>(this);
that->calculateGraphs();
- return graphHasConflicts[0] || graphHasConflicts[1];
+
+ bool floatConflict = (m_nonFloatItems[0].size() < items.size())
+ || (m_nonFloatItems[1].size() < items.size());
+
+ return graphHasConflicts[0] || graphHasConflicts[1] || floatConflict;
}
#ifdef QT_DEBUG
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.h b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
index c86bfa3..24b25de 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout_p.h
+++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.h
@@ -149,30 +149,14 @@ struct AnchorData : public QSimplexVariable {
Sequential,
Parallel
};
- AnchorData(qreal minimumSize, qreal preferredSize, qreal maximumSize)
- : QSimplexVariable(), from(0), to(0),
- minSize(minimumSize), prefSize(preferredSize),
- maxSize(maximumSize), sizeAtMinimum(preferredSize),
- sizeAtPreferred(preferredSize), sizeAtMaximum(preferredSize),
- graphicsAnchor(0),
- skipInPreferred(0), type(Normal), hasSize(true),
- isLayoutAnchor(false) {}
-
- AnchorData(qreal size)
- : QSimplexVariable(), from(0), to(0),
- minSize(size), prefSize(size), maxSize(size),
- sizeAtMinimum(size), sizeAtPreferred(size), sizeAtMaximum(size),
- graphicsAnchor(0),
- skipInPreferred(0), type(Normal), hasSize(true),
- isLayoutAnchor(false) {}
AnchorData()
: QSimplexVariable(), from(0), to(0),
- minSize(0), prefSize(0), maxSize(0),
- sizeAtMinimum(0), sizeAtPreferred(0), sizeAtMaximum(0),
- graphicsAnchor(0),
- skipInPreferred(0), type(Normal), hasSize(false),
- isLayoutAnchor(false) {}
+ minSize(0), prefSize(0), expSize(0), maxSize(0),
+ sizeAtMinimum(0), sizeAtPreferred(0),
+ sizeAtExpanding(0), sizeAtMaximum(0),
+ graphicsAnchor(0), skipInPreferred(0),
+ type(Normal), hasSize(true), isLayoutAnchor(false) {}
virtual void updateChildrenSizes() {}
virtual void refreshSizeHints(qreal effectiveSpacing);
@@ -189,9 +173,11 @@ struct AnchorData : public QSimplexVariable {
{
minSize = size;
prefSize = size;
+ expSize = size;
maxSize = size;
sizeAtMinimum = size;
sizeAtPreferred = size;
+ sizeAtExpanding = size;
sizeAtMaximum = size;
hasSize = true;
}
@@ -211,6 +197,7 @@ struct AnchorData : public QSimplexVariable {
// size.
qreal minSize;
qreal prefSize;
+ qreal expSize;
qreal maxSize;
// These attributes define which sizes should that anchor be in when the
@@ -218,6 +205,7 @@ struct AnchorData : public QSimplexVariable {
// calculated by the Simplex solver based on the current layout setup.
qreal sizeAtMinimum;
qreal sizeAtPreferred;
+ qreal sizeAtExpanding;
qreal sizeAtMaximum;
QGraphicsAnchor *graphicsAnchor;
@@ -225,15 +213,6 @@ struct AnchorData : public QSimplexVariable {
uint type : 2; // either Normal, Sequential or Parallel
uint hasSize : 1; // if false, get size from style.
uint isLayoutAnchor : 1; // if this anchor is connected to a layout 'edge'
-protected:
- AnchorData(Type type, qreal size = 0)
- : QSimplexVariable(), from(0), to(0),
- minSize(size), prefSize(size),
- maxSize(size), sizeAtMinimum(size),
- sizeAtPreferred(size), sizeAtMaximum(size),
- graphicsAnchor(0),
- skipInPreferred(0), type(type), hasSize(true),
- isLayoutAnchor(false) {}
};
#ifdef QT_DEBUG
@@ -245,8 +224,9 @@ inline QString AnchorData::toString() const
struct SequentialAnchorData : public AnchorData
{
- SequentialAnchorData() : AnchorData(AnchorData::Sequential)
+ SequentialAnchorData() : AnchorData()
{
+ type = AnchorData::Sequential;
#ifdef QT_DEBUG
name = QLatin1String("SequentialAnchorData");
#endif
@@ -255,6 +235,8 @@ struct SequentialAnchorData : public AnchorData
virtual void updateChildrenSizes();
virtual void refreshSizeHints(qreal effectiveSpacing);
+ void refreshSizeHints_helper(qreal effectiveSpacing, bool refreshChildren = true);
+
void setVertices(const QVector<AnchorVertex*> &vertices)
{
m_children = vertices;
@@ -270,9 +252,10 @@ struct SequentialAnchorData : public AnchorData
struct ParallelAnchorData : public AnchorData
{
ParallelAnchorData(AnchorData *first, AnchorData *second)
- : AnchorData(AnchorData::Parallel),
- firstEdge(first), secondEdge(second)
+ : AnchorData(), firstEdge(first), secondEdge(second)
{
+ type = AnchorData::Parallel;
+
// ### Those asserts force that both child anchors have the same direction,
// but can't we simplify a pair of anchors in opposite directions?
Q_ASSERT(first->from == second->from);
@@ -287,6 +270,8 @@ struct ParallelAnchorData : public AnchorData
virtual void updateChildrenSizes();
virtual void refreshSizeHints(qreal effectiveSpacing);
+ void refreshSizeHints_helper(qreal effectiveSpacing, bool refreshChildren = true);
+
AnchorData* firstEdge;
AnchorData* secondEdge;
};
@@ -355,7 +340,8 @@ public:
// Interval represents which interpolation interval are we operating in.
enum Interval {
MinToPreferred = 0,
- PreferredToMax
+ PreferredToExpanding,
+ ExpandingToMax
};
// Several structures internal to the layout are duplicated to handle
@@ -457,6 +443,8 @@ public:
void constraintsFromPaths(Orientation orientation);
QList<QSimplexConstraint *> constraintsFromSizeHints(const QList<AnchorData *> &anchors);
QList<QList<QSimplexConstraint *> > getGraphParts(Orientation orientation);
+ void identifyNonFloatItems(QSet<AnchorData *> visited, Orientation orientation);
+ void identifyNonFloatItems_helper(const AnchorData *ad, Orientation orientation);
inline AnchorVertex *internalVertex(const QPair<QGraphicsLayoutItem*, Qt::AnchorPoint> &itemEdge) const
{
@@ -486,6 +474,7 @@ public:
bool solveMinMax(QList<QSimplexConstraint *> constraints,
GraphPath path, qreal *min, qreal *max);
bool solvePreferred(QList<QSimplexConstraint *> constraints);
+ void solveExpanding(QList<QSimplexConstraint *> constraints);
bool hasConflicts() const;
#ifdef QT_DEBUG
@@ -496,6 +485,7 @@ public:
qreal spacings[NOrientations];
// Size hints from simplex engine
qreal sizeHints[2][3];
+ qreal sizeAtExpanding[2];
// Items
QVector<QGraphicsLayoutItem *> items;
@@ -521,6 +511,7 @@ public:
// ###
bool graphSimplified[2];
bool graphHasConflicts[2];
+ QSet<QGraphicsLayoutItem *> m_nonFloatItems[2];
uint calculateGraphCacheDirty : 1;
};
diff --git a/src/gui/graphicsview/qsimplex_p.cpp b/src/gui/graphicsview/qsimplex_p.cpp
index 00fc204..b8f8fb4 100644
--- a/src/gui/graphicsview/qsimplex_p.cpp
+++ b/src/gui/graphicsview/qsimplex_p.cpp
@@ -285,24 +285,6 @@ bool QSimplex::setConstraints(const QList<QSimplexConstraint *> newConstraints)
// anymore.
clearColumns(firstArtificial, columns - 2);
- #ifdef QT_DEBUG
- // Ensure that at the end of the simplex each row should either:
- // - Have a positive value on the column associated to its variable, or
- // - Have zero values in all columns.
- //
- // This avoids a regression where restrictions would be lost
- // due to randomness in the pivotRowForColumn method.
- for (int i = 1; i < rows; ++i) {
- int variableIndex = valueAt(i, 0);
- if (valueAt(i, variableIndex) > 0)
- continue;
-
- for (int j = 1; j < columns; ++j) {
- Q_ASSERT(valueAt(i, j) == 0);
- }
- }
- #endif
-
return true;
}
@@ -537,6 +519,12 @@ qreal QSimplex::solver(solverFactor factor)
solveMaxHelper();
collectResults();
+#ifdef QT_DEBUG
+ for (int i = 0; i < constraints.size(); ++i) {
+ Q_ASSERT(constraints[i]->isSatisfied());
+ }
+#endif
+
return factor * valueAt(0, columns - 1);
}
diff --git a/src/gui/graphicsview/qsimplex_p.h b/src/gui/graphicsview/qsimplex_p.h
index 54b080d..51991a9 100644
--- a/src/gui/graphicsview/qsimplex_p.h
+++ b/src/gui/graphicsview/qsimplex_p.h
@@ -94,8 +94,32 @@ struct QSimplexConstraint
QPair<QSimplexVariable *, qreal> helper;
QSimplexVariable * artificial;
-};
+#ifdef QT_DEBUG
+ bool isSatisfied() {
+ qreal leftHandSide(0);
+
+ QHash<QSimplexVariable *, qreal>::const_iterator iter;
+ for (iter = variables.constBegin(); iter != variables.constEnd(); ++iter) {
+ leftHandSide += iter.value() * iter.key()->result;
+ }
+
+ Q_ASSERT(constant > 0 || qFuzzyCompare(1, 1 + constant));
+
+ if (qFuzzyCompare(1000 + leftHandSide, 1000 + constant))
+ return true;
+
+ switch (ratio) {
+ case LessOrEqual:
+ return leftHandSide < constant;
+ case MoreOrEqual:
+ return leftHandSide > constant;
+ default:
+ return false;
+ }
+ }
+#endif
+};
class QSimplex
{
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index fce4508..e0779a0 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -54,6 +54,7 @@
#include "qvariant.h"
#include "qcache.h"
#include "qdebug.h"
+#include "private/qguiplatformplugin_p.h"
#ifdef Q_WS_MAC
#include <private/qt_mac_p.h>
@@ -961,19 +962,10 @@ QString QIcon::themeName()
*/
QIcon QIcon::fromTheme(const QString &name, const QIcon &fallback)
{
-
static QCache <QString, QIcon> iconCache;
QIcon icon;
-#ifdef Q_WS_X11
- if (X11->desktopEnvironment == DE_KDE) {
- icon = QKde::kdeIcon(name);
- if (!icon.isNull())
- return icon;
- }
-#endif
-
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/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 27528de..37f4184 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -761,7 +761,7 @@ void QAbstractItemView::setItemDelegate(QAbstractItemDelegate *delegate)
}
}
d->itemDelegate = delegate;
- update();
+ viewport()->update();
}
/*!
@@ -826,7 +826,7 @@ void QAbstractItemView::setItemDelegateForRow(int row, QAbstractItemDelegate *de
}
d->rowDelegates.insert(row, delegate);
}
- update();
+ viewport()->update();
}
/*!
@@ -883,7 +883,7 @@ void QAbstractItemView::setItemDelegateForColumn(int column, QAbstractItemDelega
}
d->columnDelegates.insert(column, delegate);
}
- update();
+ viewport()->update();
}
/*!
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/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index fc9820f..a754579 100644
--- a/src/gui/itemviews/qheaderview.cpp
+++ b/src/gui/itemviews/qheaderview.cpp
@@ -524,8 +524,10 @@ QSize QHeaderView::sizeHint() const
Q_D(const QHeaderView);
if (d->cachedSizeHint.isValid())
return d->cachedSizeHint;
- d->cachedSizeHint = QSize(0, 0); //reinitialize the cached size hint
+ int width = 0;
+ int height = 0;
const int sectionCount = count();
+ d->executePostedLayout();
// get size hint for the first n sections
int i = 0;
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index 7cde384..760d73c 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -47,7 +47,8 @@ HEADERS += \
kernel/qgesture_p.h \
kernel/qstandardgestures.h \
kernel/qstandardgestures_p.h \
- kernel/qsoftkeymanager_p.h
+ kernel/qsoftkeymanager_p.h \
+ kernel/qguiplatformplugin_p.h
SOURCES += \
kernel/qaction.cpp \
@@ -79,7 +80,8 @@ SOURCES += \
kernel/qkeymapper.cpp \
kernel/qgesture.cpp \
kernel/qstandardgestures.cpp \
- kernel/qsoftkeymanager.cpp
+ kernel/qsoftkeymanager.cpp \
+ kernel/qguiplatformplugin.cpp
win32 {
DEFINES += QT_NO_DIRECTDRAW
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 044fedd..43addb6 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -84,6 +84,8 @@
#include "qinputcontextfactory.h"
#endif
+#include "qguiplatformplugin_p.h"
+
#include <qthread.h>
#include <private/qthread_p.h>
@@ -788,6 +790,9 @@ void QApplicationPrivate::construct(
qCritical("Library qttestability load failed!");
}
}
+
+ //make sure the plugin is loaded
+ qt_guiPlatformPlugin();
#endif
}
@@ -1955,38 +1960,7 @@ void QApplicationPrivate::setSystemFont(const QFont &font)
*/
QString QApplicationPrivate::desktopStyleKey()
{
-QString desktopstyle;
-#if defined(Q_WS_WIN) && defined(Q_WS_WINCE)
- if (qt_wince_is_smartphone() || qt_wince_is_pocket_pc())
- desktopstyle = QLatin1String("WindowsMobile");
- else
- desktopstyle = QLatin1String("WindowsCE");
-
-#elif defined(Q_WS_WIN)
- if ((QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA
- && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based))
- desktopstyle = QLatin1String("WindowsVista");
- else if ((QSysInfo::WindowsVersion >= QSysInfo::WV_XP
- && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based))
- desktopstyle = QLatin1String("WindowsXP");
- else
- desktopstyle = QLatin1String("Windows"); // default styles for Windows
-#elif defined(Q_WS_X11) && defined(Q_OS_SOLARIS)
- desktopstyle = QLatin1String("CDE"); // default style for X11 on Solaris
-#elif defined(Q_WS_S60)
- desktopstyle = QLatin1String("S60"); // default style for Symbian with S60
-#elif defined(Q_OS_SYMBIAN)
- desktopstyle = QLatin1String("Windows"); // default style for Symbian without S60
-#elif defined(Q_WS_X11) && defined(Q_OS_IRIX)
- desktopstyle = QLatin1String("SGI"); // default style for X11 on IRIX
-#elif defined(Q_WS_QWS)
- desktopstyle = QLatin1String("Plastique"); // default style for X11 and small devices
-#elif defined(Q_WS_X11)
- desktopstyle = QApplicationPrivate::x11_desktop_style(); // default runtime dependant style for X11
-#elif defined(Q_WS_MAC)
- desktopstyle = QLatin1String("Macintosh"); // default style for all Mac's
-#endif
- return desktopstyle;
+ return qt_guiPlatformPlugin()->styleName();
}
/*!
diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm
index a95ae9d..f9c8aa3 100644
--- a/src/gui/kernel/qapplication_mac.mm
+++ b/src/gui/kernel/qapplication_mac.mm
@@ -1708,12 +1708,30 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event
sizeof(axis), 0, &axis);
// The 'new' event has acceleration applied by the OS, while the old (on
- // Carbon only), has not. So we introduce acceleration here to be consistent:
- int scrollFactor = 120 * qMin(5, qAbs(mdelt));
+ // Carbon only), has not. So we introduce acceleration here to be consistent.
+ // The acceleration is trying to respect both pixel based and line scrolling,
+ // which turns out to be rather difficult.
+ int linesToScroll = mdelt > 0 ? 1 : -1;
+ static QTime t;
+ int elapsed = t.elapsed();
+ t.restart();
+ if (elapsed < 20)
+ linesToScroll *= 120;
+ else if (elapsed < 30)
+ linesToScroll *= 60;
+ else if (elapsed < 50)
+ linesToScroll *= 30;
+ else if (elapsed < 100)
+ linesToScroll *= 6;
+ else if (elapsed < 200)
+ linesToScroll *= 3;
+ else if (elapsed < 300)
+ linesToScroll *= 2;
+
if (axis == kEventMouseWheelAxisX)
- wheel_deltaX = mdelt * scrollFactor;
+ wheel_deltaX = linesToScroll * 120;
else
- wheel_deltaY = mdelt * scrollFactor;
+ wheel_deltaY = linesToScroll * 120;
}
}
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index 6036196..95b6d28 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -305,7 +305,6 @@ public:
#if defined(Q_WS_X11)
#ifndef QT_NO_SETTINGS
- static QString x11_desktop_style();
static bool x11_apply_settings();
#endif
static void reset_instance_pointer();
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/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index e46a370..bf95684 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -85,6 +85,7 @@
#include "qtimer.h"
#include "qlibrary.h"
#include <private/qgraphicssystemfactory_p.h>
+#include "qguiplatformplugin_p.h"
#include "qkde_p.h"
#if !defined (QT_NO_TABLET)
@@ -919,7 +920,7 @@ bool QApplicationPrivate::x11_apply_settings()
QString stylename = settings.value(QLatin1String("style")).toString();
if (stylename.isEmpty() && QApplicationPrivate::styleOverride.isNull() && X11->use_xrender) {
- stylename = x11_desktop_style();
+ stylename = qt_guiPlatformPlugin()->styleName();
}
static QString currentStyleName = stylename;
@@ -1313,8 +1314,7 @@ static void qt_set_x11_resources(const char* font = 0, const char* fg = 0,
pal.setColor(QPalette::Disabled, QPalette::Highlight, Qt::darkBlue);
}
- if (kdeColors)
- pal = QKde::kdePalette().resolve(pal);
+ pal = qt_guiPlatformPlugin()->palette().resolve(pal);
QApplicationPrivate::setSystemPalette(pal);
QColor::setAllowX11ColorNames(allowX11ColorNames);
}
@@ -2560,42 +2560,6 @@ void qt_init(QApplicationPrivate *priv, int,
#endif
}
-
- // run-time search for default style
-/*!
- \internal
-*/
-QString QApplicationPrivate::x11_desktop_style()
-{
- QString stylename;
- switch(X11->desktopEnvironment) {
- case DE_KDE:
- stylename = QKde::kdeStyle();
- break;
- case DE_GNOME: {
- QStringList availableStyles = QStyleFactory::keys();
- // Set QGtkStyle for GNOME if available
- QString gtkStyleKey = QString::fromLatin1("GTK+");
- if (availableStyles.contains(gtkStyleKey)) {
- stylename = gtkStyleKey;
- break;
- }
- if (X11->use_xrender)
- stylename = QLatin1String("cleanlooks");
- else
- stylename = QLatin1String("windows");
- break;
- }
- case DE_CDE:
- stylename = QLatin1String("cde");
- break;
- default:
- // Don't do anything
- break;
- }
- return stylename;
-}
-
void QApplicationPrivate::initializeWidgetPaletteHash()
{
}
diff --git a/src/gui/kernel/qguiplatformplugin.cpp b/src/gui/kernel/qguiplatformplugin.cpp
new file mode 100644
index 0000000..6e074a1
--- /dev/null
+++ b/src/gui/kernel/qguiplatformplugin.cpp
@@ -0,0 +1,296 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#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"
+#include "qplatformdefs.h"
+#include "qicon.h"
+
+#ifdef Q_WS_WINCE
+#include "qguifunctions_wince.h"
+extern bool qt_wince_is_smartphone(); //qguifunctions_wince.cpp
+extern bool qt_wince_is_mobile(); //qguifunctions_wince.cpp
+extern bool qt_wince_is_pocket_pc(); //qguifunctions_wince.cpp
+#endif
+
+
+#if defined(Q_WS_X11)
+#include "qkde_p.h"
+#include "qt_x11_p.h"
+#include <private/gtksymbols_p.h>
+#endif
+
+
+QT_BEGIN_NAMESPACE
+
+
+/*! \internal
+ Return (an construct if necesseray) the Gui Platform plugin.
+
+ The plugin key to be loaded is inside the QT_PLATFORM_PLUGIN environment variable.
+ If it is not set, it will be the DESKTOP_SESSION on X11.
+
+ If no plugin can be loaded, the default one is returned.
+ */
+QGuiPlatformPlugin *qt_guiPlatformPlugin()
+{
+ static QGuiPlatformPlugin *plugin;
+ if (!plugin)
+ {
+#if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS)
+
+ QString key = QString::fromLocal8Bit(qgetenv("QT_PLATFORM_PLUGIN"));
+#ifdef Q_WS_X11
+ if (key.isEmpty()) {
+ switch(X11->desktopEnvironment) {
+ case DE_KDE:
+ key = QString::fromLatin1("kde");
+ break;
+ default:
+ key = QString::fromLocal8Bit(qgetenv("DESKTOP_SESSION"));
+ break;
+ }
+ }
+#endif
+
+ if (!key.isEmpty() && QApplication::desktopSettingsAware()) {
+ QFactoryLoader loader(QGuiPlatformPluginInterface_iid, QLatin1String("/gui_platform"));
+ plugin = qobject_cast<QGuiPlatformPlugin *>(loader.instance(key));
+ }
+#endif // QT_NO_LIBRARY
+
+ if(!plugin) {
+ static QGuiPlatformPlugin def;
+ plugin = &def;
+ }
+ }
+ return plugin;
+}
+
+
+/* \class QPlatformPlugin
+ QGuiPlatformPlugin can be used to integrate Qt applications in a platform built on top of Qt.
+ The application developer should not know or use the plugin, it is only used by Qt internaly.
+
+ But full platform that are built on top of Qt may provide a plugin so 3rd party Qt application
+ running in the platform are integrated.
+ */
+
+/*
+ The constructor can be used to install hooks in Qt
+ */
+QGuiPlatformPlugin::QGuiPlatformPlugin(QObject *parent) : QObject(parent) {}
+QGuiPlatformPlugin::~QGuiPlatformPlugin() {}
+
+
+/* return the string key to be used by default the application */
+QString QGuiPlatformPlugin::styleName()
+{
+#if defined(Q_WS_WIN) && defined(Q_WS_WINCE)
+ if (qt_wince_is_smartphone() || qt_wince_is_pocket_pc())
+ return QLatin1String("WindowsMobile");
+ else
+ return QLatin1String("WindowsCE");
+#elif defined(Q_WS_WIN)
+ if ((QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA
+ && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based))
+ return QLatin1String("WindowsVista");
+ else if ((QSysInfo::WindowsVersion >= QSysInfo::WV_XP
+ && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based))
+ return QLatin1String("WindowsXP");
+ else
+ return QLatin1String("Windows"); // default styles for Windows
+#elif defined(Q_WS_X11) && defined(Q_OS_SOLARIS)
+ return QLatin1String("CDE"); // default style for X11 on Solaris
+#elif defined(Q_WS_S60)
+ return QLatin1String("S60"); // default style for Symbian with S60
+#elif defined(Q_OS_SYMBIAN)
+ return QLatin1String("Windows"); // default style for Symbian without S60
+#elif defined(Q_WS_X11) && defined(Q_OS_IRIX)
+ return QLatin1String("SGI"); // default style for X11 on IRIX
+#elif defined(Q_WS_QWS)
+ return QLatin1String("Plastique"); // default style for X11 and small devices
+#elif defined(Q_WS_MAC)
+ return QLatin1String("Macintosh"); // default style for all Mac's
+#elif defined(Q_WS_X11)
+ QString stylename;
+ switch(X11->desktopEnvironment) {
+ case DE_KDE:
+ stylename = QKde::kdeStyle();
+ break;
+ case DE_GNOME: {
+ QStringList availableStyles = QStyleFactory::keys();
+ // Set QGtkStyle for GNOME if available
+ QString gtkStyleKey = QString::fromLatin1("GTK+");
+ if (availableStyles.contains(gtkStyleKey)) {
+ stylename = gtkStyleKey;
+ break;
+ }
+ if (X11->use_xrender)
+ stylename = QLatin1String("cleanlooks");
+ else
+ stylename = QLatin1String("windows");
+ break;
+ }
+ case DE_CDE:
+ stylename = QLatin1String("cde");
+ break;
+ default:
+ // Don't do anything
+ break;
+ }
+ return stylename;
+#endif
+}
+
+/* return an aditional default palette (only work on X11) */
+QPalette QGuiPlatformPlugin::palette()
+{
+#ifdef Q_WS_X11
+ if (QApplication::desktopSettingsAware() && X11->desktopEnvironment == DE_KDE)
+ return QKde::kdePalette();
+#endif
+
+ return QPalette();
+}
+
+/* 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();
+}
+
+/* Like QStyle::styleHint */
+int QGuiPlatformPlugin::platformHint(PlatformHint hint)
+{
+ int ret = 0;
+ switch(hint)
+ {
+ case PH_ToolButtonStyle:
+ ret = Qt::ToolButtonIconOnly;
+#ifdef Q_WS_X11
+ if (X11->desktopEnvironment == DE_KDE && X11->desktopVersion >= 4
+ && QApplication::desktopSettingsAware()) {
+ ret = QKde::kdeToolButtonStyle();
+ }
+#endif
+ break;
+ case PH_ToolBarIconSize:
+#ifdef Q_WS_X11
+ if (X11->desktopEnvironment == DE_KDE && X11->desktopVersion >= 4
+ && QApplication::desktopSettingsAware()) {
+ ret = QKde::kdeToolBarIconSize();
+ }
+#endif
+ //by default keep ret = 0 so QCommonStyle will use the style default
+ break;
+ }
+ return ret;
+}
+
+
+QT_END_NAMESPACE
diff --git a/src/gui/kernel/qguiplatformplugin_p.h b/src/gui/kernel/qguiplatformplugin_p.h
new file mode 100644
index 0000000..2a70ee7
--- /dev/null
+++ b/src/gui/kernel/qguiplatformplugin_p.h
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QGUIPLATFORM_P_H
+#define QGUIPLATFORM_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <QtCore/qplugin.h>
+#include <QtCore/qfactoryinterface.h>
+#include <QtGui/qdialog.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Gui)
+
+class QStyle;
+class QPalette;
+class QIcon;
+class QFileDialog;
+class QColorDialog;
+class QFileInfo;
+
+struct Q_GUI_EXPORT QGuiPlatformPluginInterface : public QFactoryInterface
+{
+};
+
+#define QGuiPlatformPluginInterface_iid "com.nokia.qt.QGuiPlatformPluginInterface"
+
+Q_DECLARE_INTERFACE(QGuiPlatformPluginInterface, QGuiPlatformPluginInterface_iid)
+
+class Q_GUI_EXPORT QGuiPlatformPlugin : public QObject, public QGuiPlatformPluginInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(QGuiPlatformPluginInterface:QFactoryInterface)
+ public:
+ explicit QGuiPlatformPlugin(QObject *parent = 0);
+ ~QGuiPlatformPlugin();
+
+ virtual QStringList keys() const { return QStringList() << QLatin1String("default"); };
+
+ virtual QString styleName();
+ virtual QPalette palette();
+ 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);
+
+
+ virtual void fileDialogDelete(QFileDialog *) {}
+ virtual bool fileDialogSetVisible(QFileDialog *, bool) { return false; }
+ virtual QDialog::DialogCode fileDialogResultCode(QFileDialog *) { return QDialog::Rejected; }
+ virtual void fileDialogSetDirectory(QFileDialog *, const QString &) {}
+ virtual QString fileDialogDirectory(const QFileDialog *) const { return QString(); }
+ virtual void fileDialogSelectFile(QFileDialog *, const QString &) {}
+ virtual QStringList fileDialogSelectedFiles(const QFileDialog *) const { return QStringList(); }
+ virtual void fileDialogSetFilter(QFileDialog *) {}
+ virtual void fileDialogSetNameFilters(QFileDialog *, const QStringList &) {}
+ virtual void fileDialogSelectNameFilter(QFileDialog *, const QString &) {}
+ virtual QString fileDialogSelectedNameFilter(const QFileDialog *) const { return QString(); }
+
+ virtual void colorDialogDelete(QColorDialog *) {}
+ virtual bool colorDialogSetVisible(QColorDialog *, bool) { return false; }
+ virtual void colorDialogSetCurrentColor(QColorDialog *, const QColor &) {}
+};
+
+//internal
+QGuiPlatformPlugin *qt_guiPlatformPlugin();
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+
+#endif // QGUIPLATFORMPLUGIN_H
diff --git a/src/gui/kernel/qkde.cpp b/src/gui/kernel/qkde.cpp
index 6c8909f..edc53ac 100644
--- a/src/gui/kernel/qkde.cpp
+++ b/src/gui/kernel/qkde.cpp
@@ -141,14 +141,33 @@ QString QKde::kdeStyle()
return QLatin1String("windows");
}
-/*!\internal
- placeholder to load icon from kde.
- to be implemented
- */
-QIcon QKde::kdeIcon(const QString &name)
+
+int QKde::kdeToolButtonStyle()
+{
+ QSettings settings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"),
+ QSettings::IniFormat);
+ settings.beginGroup(QLatin1String("Toolbar style"));
+ QString toolbarStyle = settings.value(QLatin1String("ToolButtonStyle"), QLatin1String("TextBesideIcon")).toString();
+ if (toolbarStyle == QLatin1String("TextBesideIcon"))
+ return Qt::ToolButtonTextBesideIcon;
+ else if (toolbarStyle == QLatin1String("TextOnly"))
+ return Qt::ToolButtonTextOnly;
+ else if (toolbarStyle == QLatin1String("TextUnderIcon"))
+ return Qt::ToolButtonTextUnderIcon;
+
+ return Qt::ToolButtonTextBesideIcon;
+}
+
+int QKde::kdeToolBarIconSize()
{
- //###todo
- return QIcon();
+ static int iconSize = -1;
+ if (iconSize == -1) {
+ QSettings settings(QKde::kdeHome() + QLatin1String("/share/config/kdeglobals"),
+ QSettings::IniFormat);
+ settings.beginGroup(QLatin1String("ToolbarIcons"));
+ iconSize = settings.value(QLatin1String("Size")).toInt();
+ }
+ return iconSize;
}
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qkde_p.h b/src/gui/kernel/qkde_p.h
index 4063f0e..c22a145 100644
--- a/src/gui/kernel/qkde_p.h
+++ b/src/gui/kernel/qkde_p.h
@@ -61,12 +61,17 @@
QT_BEGIN_NAMESPACE
-// This namespace contains helper function to help KDE integration
+/*!\internal
+ This namespace contains helper function to help KDE integration
+ They are only used if we detect the use of KDE and the KDE platform plugin is not found (old KDE version)
+ Or if the detected KDE version is KDE3
+*/
namespace QKde {
QString kdeHome();
QString kdeStyle();
QPalette kdePalette();
- QIcon kdeIcon(const QString &name);
+ int kdeToolButtonStyle();
+ int kdeToolBarIconSize();
}
diff --git a/src/gui/kernel/qkeymapper_win.cpp b/src/gui/kernel/qkeymapper_win.cpp
index 10958f3..be207df 100644
--- a/src/gui/kernel/qkeymapper_win.cpp
+++ b/src/gui/kernel/qkeymapper_win.cpp
@@ -905,8 +905,8 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, const MSG &msg, bool
if(msg.wParam == VK_PROCESSKEY)
return true;
- // Ignore invalid virtual keycode (see bug 127424)
- if (msg.wParam == 0xFF)
+ // Ignore invalid virtual keycodes (see bugs 127424, QTBUG-3630)
+ if (msg.wParam == 0 || msg.wParam == 0xFF)
return true;
// Translate VK_* (native) -> Key_* (Qt) keys
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 265f971..cd3ad22 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -112,7 +112,7 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act
{
const char* text = standardSoftKeyText(standardKey);
QAction *action = new QAction(QSoftKeyManager::tr(text), actionWidget);
- QAction::SoftKeyRole softKeyRole;
+ QAction::SoftKeyRole softKeyRole = QAction::NoSoftKey;
switch (standardKey) {
case OkSoftKey:
case SelectSoftKey:
@@ -121,7 +121,6 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act
softKeyRole = QAction::PositiveSoftKey;
break;
case CancelSoftKey:
- default:
softKeyRole = QAction::NegativeSoftKey;
break;
}
diff --git a/src/gui/kernel/qsoftkeymanager_p.h b/src/gui/kernel/qsoftkeymanager_p.h
index c4bb84d..b455445 100644
--- a/src/gui/kernel/qsoftkeymanager_p.h
+++ b/src/gui/kernel/qsoftkeymanager_p.h
@@ -74,7 +74,7 @@ public:
SelectSoftKey,
DoneSoftKey,
MenuSoftKey,
- CancelSoftKey,
+ CancelSoftKey
};
static void updateSoftKeys();
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 3328cee..b0d405a 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -434,7 +434,7 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
void QWidgetPrivate::show_sys()
{
Q_Q(QWidget);
-
+
if (q->testAttribute(Qt::WA_OutsideWSRange))
return;
@@ -490,7 +490,12 @@ void QWidgetPrivate::hide_sys()
QSymbianControl *id = static_cast<QSymbianControl *>(q->internalWinId());
if (id) {
- if(id->IsFocused()) // Avoid unnecessary calls to FocusChanged()
+ //Incorrect optimisation - for popup windows, Qt's focus is moved before
+ //hide_sys is called, resulting in the popup window keeping its elevated
+ //position in the CONE control stack.
+ //This can result in keyboard focus being in an invisible widget in some
+ //conditions - e.g. QTBUG-4733
+ //if(id->IsFocused()) // Avoid unnecessary calls to FocusChanged()
id->setFocusSafely(false);
id->MakeVisible(false);
if (QWidgetBackingStore *bs = maybeBackingStore())
@@ -1253,7 +1258,7 @@ void QWidget::grabMouse()
WId id = effectiveWinId();
id->SetPointerCapture(true);
QWidgetPrivate::mouseGrabber = this;
-
+
#ifndef QT_NO_CURSOR
QApplication::setOverrideCursor(cursor());
#endif
diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp
index c20d8d8..1182b9a 100644
--- a/src/gui/painting/qdrawutil.cpp
+++ b/src/gui/painting/qdrawutil.cpp
@@ -1147,8 +1147,8 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin
yTarget[rows - 1] = targetCenterBottom;
yTarget[rows] = targetRect.top() + targetRect.height();
- qreal dx;
- qreal dy;
+ qreal dx = targetCenterWidth;
+ qreal dy = targetCenterHeight;
switch (rules.horizontal) {
case Qt::StretchTile:
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index d712669..195be0a 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -932,7 +932,7 @@ void QPaintEngineEx::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, con
fill(path, brush);
}
-void QPaintEngineEx::drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints hints)
+void QPaintEngineEx::drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints /*hints*/)
{
qreal oldOpacity = state()->opacity;
QTransform oldTransform = state()->matrix;
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
index 664ad48..dc4e43b 100644
--- a/src/gui/painting/qwindowsurface_s60.cpp
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -85,7 +85,9 @@ QS60WindowSurface::~QS60WindowSurface()
void QS60WindowSurface::beginPaint(const QRegion &rgn)
{
if (!qt_widget_private(window())->isOpaque) {
- QImage image = static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data())->image;
+ QS60PixmapData *pixmapData = static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data());
+ pixmapData->beginDataAccess();
+ QImage &image = pixmapData->image;
QRgb *data = reinterpret_cast<QRgb *>(image.bits());
const int row_stride = image.bytesPerLine() / 4;
@@ -103,6 +105,7 @@ void QS60WindowSurface::beginPaint(const QRegion &rgn)
row += row_stride;
}
}
+ pixmapData->endDataAccess();
}
}
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index df4f866..5886512 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -63,7 +63,6 @@
#include <qtoolbar.h>
#include <qtoolbutton.h>
#include <qrubberband.h>
-#include <../kernel/qkde_p.h>
#include <private/qcommonstylepixmaps_p.h>
#include <private/qmath_p.h>
#include <private/qstylehelper_p.h>
@@ -75,6 +74,7 @@
#include <qdir.h>
#include <qsettings.h>
#include <qpixmapcache.h>
+#include <private/qguiplatformplugin_p.h>
#include <limits.h>
@@ -837,35 +837,6 @@ static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbut
}
#endif // QT_NO_TOOLBUTTON
-
-#ifdef Q_WS_X11 // These functions are used to parse the X11 freedesktop icon spec
-
-/*!internal
-
-Checks if you are running KDE and looks up the toolbar
-from the KDE configuration file
-
-*/
-int QCommonStylePrivate::lookupToolButtonStyle() const
-{
- int result = Qt::ToolButtonIconOnly;
- if (X11->desktopEnvironment == DE_KDE && X11->desktopVersion >= 4) {
- QSettings settings(QKde::kdeHome() +
- QLatin1String("/share/config/kdeglobals"), QSettings::IniFormat);
- settings.beginGroup(QLatin1String("Toolbar style"));
- QString toolbarStyle = settings.value(QLatin1String("ToolButtonStyle"), QLatin1String("TextBesideIcon")).toString();
- if (toolbarStyle == QLatin1String("TextBesideIcon"))
- result = Qt::ToolButtonTextBesideIcon;
- else if (toolbarStyle == QLatin1String("TextOnly"))
- result = Qt::ToolButtonTextOnly;
- else if (toolbarStyle == QLatin1String("TextUnderIcon"))
- result = Qt::ToolButtonTextUnderIcon;
- }
- return result;
-}
-
-#endif //Q_WS_X11
-
#ifndef QT_NO_ITEMVIEWS
QSize QCommonStylePrivate::viewItemSize(const QStyleOptionViewItemV4 *option, int role) const
@@ -4688,19 +4659,8 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
break;
case PM_ToolBarIconSize:
-#ifdef Q_WS_X11
- if (X11->desktopVersion >= 4) {
- static int iconSize = 0;
- if (!iconSize) {
- QSettings settings(QKde::kdeHome() +
- QLatin1String("/share/config/kdeglobals"),
- QSettings::IniFormat);
- settings.beginGroup(QLatin1String("ToolbarIcons"));
- iconSize = settings.value(QLatin1String("Size"), QLatin1String("22")).toInt();
- }
- ret = iconSize;
- } else
-#endif
+ ret = qt_guiPlatformPlugin()->platformHint(QGuiPlatformPlugin::PH_ToolBarIconSize);
+ if (!ret)
ret = proxy()->pixelMetric(PM_SmallIconSize, opt, widget);
break;
@@ -5098,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:
@@ -5192,13 +5152,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
ret = true;
break;
case SH_ToolButtonStyle:
- ret = Qt::ToolButtonIconOnly;
-#ifdef Q_WS_X11
- {
- static int buttonStyle = d_func()->lookupToolButtonStyle();
- return buttonStyle;
- }
-#endif
+ ret = qt_guiPlatformPlugin()->platformHint(QGuiPlatformPlugin::PH_ToolButtonStyle);
break;
case SH_RequestSoftwareInputPanel:
ret = RSIP_OnMouseClickAndAlreadyFocused;
diff --git a/src/gui/styles/qcommonstyle_p.h b/src/gui/styles/qcommonstyle_p.h
index 7162392..a905601 100644
--- a/src/gui/styles/qcommonstyle_p.h
+++ b/src/gui/styles/qcommonstyle_p.h
@@ -122,7 +122,6 @@ public:
}
#endif
mutable QIcon tabBarcloseButtonIcon;
- int lookupToolButtonStyle() const;
#ifndef QT_NO_TABBAR
void tabLayout(const QStyleOptionTabV3 *opt, const QWidget *widget, QRect *textRect, QRect *pixmapRect) const;
#endif
diff --git a/src/gui/styles/qplastiquestyle.cpp b/src/gui/styles/qplastiquestyle.cpp
index 5052755..ce2109a 100644
--- a/src/gui/styles/qplastiquestyle.cpp
+++ b/src/gui/styles/qplastiquestyle.cpp
@@ -3309,7 +3309,7 @@ void QPlastiqueStyle::drawControl(ControlElement element, const QStyleOption *op
// Draw the text centered
QFont font = painter->font();
- font.setPointSize(font.pointSize() - 1);
+ font.setPointSize(QFontInfo(font).pointSize() - 1);
painter->setFont(font);
painter->setPen(dockWidget->palette.windowText().color());
painter->drawText(titleRect,
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp
index e5a88fc..21b9cca 100644
--- a/src/gui/text/qfontengine.cpp
+++ b/src/gui/text/qfontengine.cpp
@@ -1160,7 +1160,7 @@ Q_GLOBAL_STATIC_WITH_INITIALIZER(QVector<QRgb>, qt_grayPalette, {
QRgb *it = x->data();
for (int i = 0; i < x->size(); ++i, ++it)
*it = 0xff000000 | i | (i<<8) | (i<<16);
-});
+})
const QVector<QRgb> &QFontEngine::grayPalette()
{
diff --git a/src/gui/util/qdesktopservices_win.cpp b/src/gui/util/qdesktopservices_win.cpp
index 9ae3a15..c0bd5e7 100644
--- a/src/gui/util/qdesktopservices_win.cpp
+++ b/src/gui/util/qdesktopservices_win.cpp
@@ -41,6 +41,7 @@
#include <qsettings.h>
#include <qdir.h>
+#include <qlibrary.h>
#include <qurl.h>
#include <qstringlist.h>
#include <qprocess.h>
@@ -58,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
@@ -168,50 +174,76 @@ static bool launchWebBrowser(const QUrl &url)
QString QDesktopServices::storageLocation(StandardLocation type)
{
-#if !defined(QT_NO_SETTINGS)
- QSettings settings(QSettings::UserScope, QLatin1String("Microsoft"), QLatin1String("Windows"));
- settings.beginGroup(QLatin1String("CurrentVersion/Explorer/Shell Folders"));
+ QString result;
+
+#ifndef Q_OS_WINCE
+ QLibrary library(QLatin1String("shell32"));
+#else
+ QLibrary library(QLatin1String("coredll"));
+#endif // Q_OS_WINCE
+ typedef BOOL (WINAPI*GetSpecialFolderPath)(HWND, LPWSTR, int, BOOL);
+ static GetSpecialFolderPath SHGetSpecialFolderPath =
+ (GetSpecialFolderPath)library.resolve("SHGetSpecialFolderPathW");
+ if (!SHGetSpecialFolderPath)
+ return QString();
+
+ wchar_t path[MAX_PATH];
+
switch (type) {
- case CacheLocation:
- // Although Microsoft has a Cache key it is a pointer to IE's cache, not a cache
- // location for everyone. Most applications seem to be using a
- // cache directory located in their AppData directory
- return storageLocation(DataLocation) + QLatin1String("\\cache");
case DataLocation:
- if (!settings.contains(QLatin1String("Local AppData")))
- break;
- return settings.value(QLatin1String("Local AppData")).toString()
- + QLatin1String("\\") + QCoreApplication::organizationName()
- + QLatin1String("\\") + QCoreApplication::applicationName();
+#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();
+ if (!QCoreApplication::applicationName().isEmpty())
+ result = result + QLatin1String("\\") + QCoreApplication::applicationName();
break;
+
case DesktopLocation:
- return settings.value(QLatin1String("Desktop")).toString();
+ if (SHGetSpecialFolderPath(0, path, CSIDL_DESKTOPDIRECTORY, FALSE))
+ result = QString::fromWCharArray(path);
break;
case DocumentsLocation:
- return settings.value(QLatin1String("Personal")).toString();
+ if (SHGetSpecialFolderPath(0, path, CSIDL_PERSONAL, FALSE))
+ result = QString::fromWCharArray(path);
break;
case FontsLocation:
- return settings.value(QLatin1String("Fonts")).toString();
+ if (SHGetSpecialFolderPath(0, path, CSIDL_FONTS, FALSE))
+ result = QString::fromWCharArray(path);
break;
case ApplicationsLocation:
- return settings.value(QLatin1String("Programs")).toString();
+ if (SHGetSpecialFolderPath(0, path, CSIDL_PROGRAMS, FALSE))
+ result = QString::fromWCharArray(path);
break;
case MusicLocation:
- return settings.value(QLatin1String("My Music")).toString();
+ if (SHGetSpecialFolderPath(0, path, CSIDL_MYMUSIC, FALSE))
+ result = QString::fromWCharArray(path);
break;
case MoviesLocation:
- return settings.value(QLatin1String("My Video")).toString();
+ if (SHGetSpecialFolderPath(0, path, CSIDL_MYVIDEO, FALSE))
+ result = QString::fromWCharArray(path);
break;
case PicturesLocation:
- return settings.value(QLatin1String("My Pictures")).toString();
+ if (SHGetSpecialFolderPath(0, path, CSIDL_MYPICTURES, FALSE))
+ result = QString::fromWCharArray(path);
break;
+ case CacheLocation:
+ // Although Microsoft has a Cache key it is a pointer to IE's cache, not a cache
+ // location for everyone. Most applications seem to be using a
+ // cache directory located in their AppData directory
+ return storageLocation(DataLocation) + QLatin1String("\\cache");
+
case QDesktopServices::HomeLocation:
return QDir::homePath(); break;
@@ -221,8 +253,7 @@ QString QDesktopServices::storageLocation(StandardLocation type)
default:
break;
}
-#endif
- return QString();
+ return result;
}
QString QDesktopServices::displayName(StandardLocation type)
diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp
index 19a8b63..588a48e 100644
--- a/src/gui/widgets/qabstractslider.cpp
+++ b/src/gui/widgets/qabstractslider.cpp
@@ -715,8 +715,7 @@ void QAbstractSlider::wheelEvent(QWheelEvent * e)
#else
stepsToScroll = int(d->offset_accumulated) * QApplication::wheelScrollLines() * d->singleStep;
#endif
- if (qAbs(stepsToScroll) > d->pageStep)
- stepsToScroll = currentOffset > 0 ? d->pageStep : -d->pageStep;
+ stepsToScroll = qBound(-d->pageStep, stepsToScroll, d->pageStep);
}
if (d->invertedControls)
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/gui/widgets/qmenu_symbian.cpp b/src/gui/widgets/qmenu_symbian.cpp
index c656ef8..d757f98 100644
--- a/src/gui/widgets/qmenu_symbian.cpp
+++ b/src/gui/widgets/qmenu_symbian.cpp
@@ -74,12 +74,13 @@ struct SymbianMenuItem
QAction* action;
};
+Q_GLOBAL_STATIC_WITH_ARGS(QAction, contextAction, (0))
+
static QList<SymbianMenuItem*> symbianMenus;
static QList<QMenuBar*> nativeMenuBars;
static uint qt_symbian_menu_static_cmd_id = QT_SYMBIAN_FIRST_MENU_ITEM;
static QPointer<QWidget> widgetWithContextMenu;
static QList<QAction*> contextMenuActionList;
-static QAction contextAction(0);
static int contexMenuCommand=0;
bool menuExists()
@@ -400,8 +401,8 @@ void QMenuBarPrivate::QSymbianMenuBarPrivate::rebuild()
contextMenuActionList.clear();
if (widgetWithContextMenu) {
contexMenuCommand = qt_symbian_menu_static_cmd_id; // Increased inside insertNativeMenuItems
- contextAction.setText(QMenuBar::tr("Actions"));
- contextMenuActionList.append(&contextAction);
+ contextAction()->setText(QMenuBar::tr("Actions"));
+ contextMenuActionList.append(contextAction());
insertNativeMenuItems(contextMenuActionList);
}
}
diff --git a/src/gui/widgets/qtoolbarextension_p.h b/src/gui/widgets/qtoolbarextension_p.h
index 5d622ec..5fe74a9 100644
--- a/src/gui/widgets/qtoolbarextension_p.h
+++ b/src/gui/widgets/qtoolbarextension_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_TOOLBUTTON
-class QToolBarExtension : public QToolButton
+class Q_AUTOTEST_EXPORT QToolBarExtension : public QToolButton
{
Q_OBJECT
Qt::Orientation orientation;
diff --git a/src/multimedia/audio/qaudiooutput_win32_p.cpp b/src/multimedia/audio/qaudiooutput_win32_p.cpp
index ef4bf0e..2c4a1c2 100644
--- a/src/multimedia/audio/qaudiooutput_win32_p.cpp
+++ b/src/multimedia/audio/qaudiooutput_win32_p.cpp
@@ -189,7 +189,6 @@ void QAudioOutputPrivate::stop()
{
if(deviceState == QAudio::StopState)
return;
- deviceState = QAudio::StopState;
close();
if(!pullMode && audioSource) {
delete audioSource;
@@ -465,13 +464,15 @@ bool QAudioOutputPrivate::deviceReady()
} else if(l == 0) {
bytesAvailable = bytesFree();
+ int check = 0;
EnterCriticalSection(&waveOutCriticalSection);
- if(waveFreeBlockCount == buffer_size/period_size) {
+ check = waveFreeBlockCount;
+ LeaveCriticalSection(&waveOutCriticalSection);
+ if(check == buffer_size/period_size) {
errorState = QAudio::UnderrunError;
deviceState = QAudio::IdleState;
emit stateChanged(deviceState);
}
- LeaveCriticalSection(&waveOutCriticalSection);
} else if(l < 0) {
bytesAvailable = bytesFree();
diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp
index 7f40134..2d5c74f 100644
--- a/src/network/kernel/qnetworkproxy.cpp
+++ b/src/network/kernel/qnetworkproxy.cpp
@@ -1166,12 +1166,12 @@ QNetworkProxyFactory::~QNetworkProxyFactory()
sets an application-wide proxy factory. For this reason, this method
is mutually exclusive with setApplicationProxyFactory: calling
setApplicationProxyFactory overrides the use of the system-wide proxy,
- and calling setUseSystemConfigurationEnabled overrides any
+ and calling setUseSystemConfiguration overrides any
application proxy or proxy factory that was previously set.
\since 4.6
*/
-void QNetworkProxyFactory::setUseSystemConfigurationEnabled(bool enable)
+void QNetworkProxyFactory::setUseSystemConfiguration(bool enable)
{
if (enable) {
setApplicationProxyFactory(new QSystemConfigurationProxyFactory);
diff --git a/src/network/kernel/qnetworkproxy.h b/src/network/kernel/qnetworkproxy.h
index 6357c64..68bd6fd 100644
--- a/src/network/kernel/qnetworkproxy.h
+++ b/src/network/kernel/qnetworkproxy.h
@@ -171,7 +171,7 @@ public:
virtual QList<QNetworkProxy> queryProxy(const QNetworkProxyQuery &query = QNetworkProxyQuery()) = 0;
- static void setUseSystemConfigurationEnabled(bool enable);
+ static void setUseSystemConfiguration(bool enable);
static void setApplicationProxyFactory(QNetworkProxyFactory *factory);
static QList<QNetworkProxy> proxyForQuery(const QNetworkProxyQuery &query);
static QList<QNetworkProxy> systemProxyForQuery(const QNetworkProxyQuery &query = QNetworkProxyQuery());
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/qglcustomshaderstage_p.h b/src/opengl/gl2paintengineex/qglcustomshaderstage_p.h
index 25f5c2f..f8c13c5 100644
--- a/src/opengl/gl2paintengineex/qglcustomshaderstage_p.h
+++ b/src/opengl/gl2paintengineex/qglcustomshaderstage_p.h
@@ -64,7 +64,7 @@ QT_MODULE(OpenGL)
class QGLCustomShaderStagePrivate;
class Q_OPENGL_EXPORT QGLCustomShaderStage
{
- Q_DECLARE_PRIVATE(QGLCustomShaderStage);
+ Q_DECLARE_PRIVATE(QGLCustomShaderStage)
public:
QGLCustomShaderStage();
virtual ~QGLCustomShaderStage();
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/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index ae4bed0..cbb310b 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -318,7 +318,7 @@ void QGLPixmapData::ensureCreated() const
}
void QGLPixmapData::fromImage(const QImage &image,
- Qt::ImageConversionFlags flags)
+ Qt::ImageConversionFlags /*flags*/)
{
if (image.size() == QSize(w, h))
setSerialNumber(++qt_gl_pixmap_serial);
diff --git a/src/opengl/util/fragmentprograms_p.h b/src/opengl/util/fragmentprograms_p.h
index 18da5c8..340023c 100644
--- a/src/opengl/util/fragmentprograms_p.h
+++ b/src/opengl/util/fragmentprograms_p.h
@@ -71,7 +71,7 @@ enum FragmentVariable {
VAR_FMP2_M_RADIUS2,
VAR_FMP,
VAR_INV_MATRIX_M0,
- VAR_ANGLE,
+ VAR_ANGLE
};
enum FragmentBrushType {
@@ -80,7 +80,7 @@ enum FragmentBrushType {
FRAGMENT_PROGRAM_BRUSH_CONICAL,
FRAGMENT_PROGRAM_BRUSH_LINEAR,
FRAGMENT_PROGRAM_BRUSH_TEXTURE,
- FRAGMENT_PROGRAM_BRUSH_PATTERN,
+ FRAGMENT_PROGRAM_BRUSH_PATTERN
};
enum FragmentCompositionModeType {
@@ -109,12 +109,12 @@ enum FragmentCompositionModeType {
COMPOSITION_MODES_DIFFERENCE_NOMASK,
COMPOSITION_MODES_EXCLUSION_NOMASK,
COMPOSITION_MODE_BLEND_MODE_MASK,
- COMPOSITION_MODE_BLEND_MODE_NOMASK,
+ COMPOSITION_MODE_BLEND_MODE_NOMASK
};
enum FragmentMaskType {
FRAGMENT_PROGRAM_MASK_TRAPEZOID_AA,
- FRAGMENT_PROGRAM_MASK_ELLIPSE_AA,
+ FRAGMENT_PROGRAM_MASK_ELLIPSE_AA
};
static const unsigned int num_fragment_variables = 19;
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/qt3support/other/q3process_unix.cpp b/src/qt3support/other/q3process_unix.cpp
index d42468b..955b65f 100644
--- a/src/qt3support/other/q3process_unix.cpp
+++ b/src/qt3support/other/q3process_unix.cpp
@@ -60,6 +60,7 @@
#include "qregexp.h"
#include "private/q3membuf_p.h"
#include "private/qobject_p.h"
+#include "private/qcore_unix_p.h"
#include <stdlib.h>
#include <errno.h>
@@ -160,11 +161,11 @@ public:
process->d->proc = 0;
}
if( socketStdin )
- ::close( socketStdin );
+ qt_safe_close( socketStdin );
if( socketStdout )
- ::close( socketStdout );
+ qt_safe_close( socketStdout );
if( socketStderr )
- ::close( socketStderr );
+ qt_safe_close( socketStderr );
}
pid_t pid;
@@ -213,7 +214,7 @@ static void q3process_cleanup()
}
#ifdef Q_OS_QNX6
-#define BAILOUT close(tmpSocket);close(socketFD[1]);return -1;
+#define BAILOUT qt_safe_close(tmpSocket);qt_safe_close(socketFD[1]);return -1;
int qnx6SocketPairReplacement (int socketFD[2]) {
int tmpSocket;
tmpSocket = socket (AF_INET, SOCK_STREAM, 0);
@@ -252,7 +253,7 @@ int qnx6SocketPairReplacement (int socketFD[2]) {
if(socketFD[0] == -1) { BAILOUT };
// We're done
- close(tmpSocket);
+ qt_safe_close(tmpSocket);
// Restore original flags , ie return to blocking
fcntl(socketFD[1], F_SETFL, originalFlags);
@@ -319,9 +320,9 @@ Q3ProcessManager::~Q3ProcessManager()
delete procList;
if ( sigchldFd[0] != 0 )
- ::close( sigchldFd[0] );
+ qt_safe_close( sigchldFd[0] );
if ( sigchldFd[1] != 0 )
- ::close( sigchldFd[1] );
+ qt_safe_close( sigchldFd[1] );
// restore SIGCHLD handler
#if defined(QT_Q3PROCESS_DEBUG)
@@ -384,7 +385,7 @@ void Q3ProcessManager::sigchldHnd( int fd )
}
char tmp;
- ::read( fd, &tmp, sizeof(tmp) );
+ qt_safe_read( fd, &tmp, sizeof(tmp) );
#if defined(QT_Q3PROCESS_DEBUG)
qDebug( "Q3ProcessManager::sigchldHnd()" );
#endif
@@ -434,13 +435,13 @@ void Q3ProcessManager::sigchldHnd( int fd )
// close filedescriptors if open, and disable the
// socket notifiers
if ( proc->socketStdout ) {
- ::close( proc->socketStdout );
+ qt_safe_close( proc->socketStdout );
proc->socketStdout = 0;
if (process->d->notifierStdout)
process->d->notifierStdout->setEnabled(false);
}
if ( proc->socketStderr ) {
- ::close( proc->socketStderr );
+ qt_safe_close( proc->socketStderr );
proc->socketStderr = 0;
if (process->d->notifierStderr)
process->d->notifierStderr->setEnabled(false);
@@ -509,7 +510,7 @@ Q3ProcessPrivate::~Q3ProcessPrivate()
if ( proc != 0 ) {
if ( proc->socketStdin != 0 ) {
- ::close( proc->socketStdin );
+ qt_safe_close( proc->socketStdin );
proc->socketStdin = 0;
}
proc->process = 0;
@@ -532,15 +533,15 @@ void Q3ProcessPrivate::closeOpenSocketsForChild()
{
if ( procManager != 0 ) {
if ( procManager->sigchldFd[0] != 0 )
- ::close( procManager->sigchldFd[0] );
+ qt_safe_close( procManager->sigchldFd[0] );
if ( procManager->sigchldFd[1] != 0 )
- ::close( procManager->sigchldFd[1] );
+ qt_safe_close( procManager->sigchldFd[1] );
// close also the sockets from other Q3Process instances
for ( QProc *p=procManager->procList->first(); p!=0; p=procManager->procList->next() ) {
- ::close( p->socketStdin );
- ::close( p->socketStdout );
- ::close( p->socketStderr );
+ qt_safe_close( p->socketStdin );
+ qt_safe_close( p->socketStdout );
+ qt_safe_close( p->socketStderr );
}
}
}
@@ -569,7 +570,7 @@ static QT_SIGNAL_RETTYPE qt_C_sigchldHnd(QT_SIGNAL_ARGS)
return;
char a = 1;
- ::write( Q3ProcessPrivate::procManager->sigchldFd[0], &a, sizeof(a) );
+ qt_safe_write( Q3ProcessPrivate::procManager->sigchldFd[0], &a, sizeof(a) );
}
@@ -682,8 +683,8 @@ bool Q3Process::start( QStringList *env )
if ( (comms & Stderr) && qnx6SocketPairReplacement(sStderr) == -1 ) {
#endif
if ( comms & Stdin ) {
- ::close( sStdin[0] );
- ::close( sStdin[1] );
+ qt_safe_close( sStdin[0] );
+ qt_safe_close( sStdin[1] );
}
return false;
}
@@ -693,12 +694,12 @@ bool Q3Process::start( QStringList *env )
if ( (comms & Stdout) && qnx6SocketPairReplacement(sStdout) == -1 ) {
#endif
if ( comms & Stdin ) {
- ::close( sStdin[0] );
- ::close( sStdin[1] );
+ qt_safe_close( sStdin[0] );
+ qt_safe_close( sStdin[1] );
}
if ( comms & Stderr ) {
- ::close( sStderr[0] );
- ::close( sStderr[1] );
+ qt_safe_close( sStderr[0] );
+ qt_safe_close( sStderr[1] );
}
return false;
}
@@ -758,15 +759,15 @@ bool Q3Process::start( QStringList *env )
// child
d->closeOpenSocketsForChild();
if ( comms & Stdin ) {
- ::close( sStdin[1] );
+ qt_safe_close( sStdin[1] );
::dup2( sStdin[0], STDIN_FILENO );
}
if ( comms & Stdout ) {
- ::close( sStdout[0] );
+ qt_safe_close( sStdout[0] );
::dup2( sStdout[1], STDOUT_FILENO );
}
if ( comms & Stderr ) {
- ::close( sStderr[0] );
+ qt_safe_close( sStderr[0] );
::dup2( sStderr[1], STDERR_FILENO );
}
if ( comms & DupStderr ) {
@@ -776,7 +777,7 @@ bool Q3Process::start( QStringList *env )
::chdir( workingDir.absPath().latin1() );
#endif
if ( fd[0] )
- ::close( fd[0] );
+ qt_safe_close( fd[0] );
if ( fd[1] )
::fcntl( fd[1], F_SETFD, FD_CLOEXEC ); // close on exec shows success
@@ -850,8 +851,8 @@ bool Q3Process::start( QStringList *env )
}
if ( fd[1] ) {
char buf = 0;
- ::write( fd[1], &buf, 1 );
- ::close( fd[1] );
+ qt_safe_write( fd[1], &buf, 1 );
+ qt_safe_close( fd[1] );
}
::_exit( -1 );
} else if ( pid == -1 ) {
@@ -861,7 +862,7 @@ bool Q3Process::start( QStringList *env )
// test if exec was successful
if ( fd[1] )
- ::close( fd[1] );
+ qt_safe_close( fd[1] );
if ( fd[0] ) {
char buf;
for ( ;; ) {
@@ -882,13 +883,13 @@ bool Q3Process::start( QStringList *env )
}
break;
}
- ::close( fd[0] );
+ qt_safe_close( fd[0] );
}
d->newProc( pid, this );
if ( comms & Stdin ) {
- ::close( sStdin[0] );
+ qt_safe_close( sStdin[0] );
d->proc->socketStdin = sStdin[1];
// Select non-blocking mode
@@ -904,7 +905,7 @@ bool Q3Process::start( QStringList *env )
}
}
if ( comms & Stdout ) {
- ::close( sStdout[1] );
+ qt_safe_close( sStdout[1] );
d->proc->socketStdout = sStdout[0];
d->notifierStdout = new QSocketNotifier( sStdout[0], QSocketNotifier::Read );
connect( d->notifierStdout, SIGNAL(activated(int)),
@@ -913,7 +914,7 @@ bool Q3Process::start( QStringList *env )
d->notifierStdout->setEnabled( true );
}
if ( comms & Stderr ) {
- ::close( sStderr[1] );
+ qt_safe_close( sStderr[1] );
d->proc->socketStderr = sStderr[0];
d->notifierStderr = new QSocketNotifier( sStderr[0], QSocketNotifier::Read );
connect( d->notifierStderr, SIGNAL(activated(int)),
@@ -934,19 +935,19 @@ error:
if ( d->procManager )
d->procManager->cleanup();
if ( comms & Stdin ) {
- ::close( sStdin[1] );
- ::close( sStdin[0] );
+ qt_safe_close( sStdin[1] );
+ qt_safe_close( sStdin[0] );
}
if ( comms & Stdout ) {
- ::close( sStdout[0] );
- ::close( sStdout[1] );
+ qt_safe_close( sStdout[0] );
+ qt_safe_close( sStdout[1] );
}
if ( comms & Stderr ) {
- ::close( sStderr[0] );
- ::close( sStderr[1] );
+ qt_safe_close( sStderr[0] );
+ qt_safe_close( sStderr[1] );
}
- ::close( fd[0] );
- ::close( fd[1] );
+ qt_safe_close( fd[0] );
+ qt_safe_close( fd[1] );
delete[] arglistQ;
delete[] arglist;
return false;
@@ -1049,7 +1050,7 @@ void Q3Process::closeStdin()
d->notifierStdin->setEnabled(false);
qDeleteInEventHandler(d->notifierStdin);
d->notifierStdin = 0;
- if ( ::close( d->proc->socketStdin ) != 0 ) {
+ if ( qt_safe_close( d->proc->socketStdin ) != 0 ) {
qWarning( "Could not close stdin of child process" );
}
#if defined(QT_Q3PROCESS_DEBUG)
@@ -1115,7 +1116,7 @@ void Q3Process::socketRead( int fd )
d->notifierStdout->setEnabled( false );
qDeleteInEventHandler(d->notifierStdout);
d->notifierStdout = 0;
- ::close( d->proc->socketStdout );
+ qt_safe_close( d->proc->socketStdout );
d->proc->socketStdout = 0;
return;
} else if ( fd == d->proc->socketStderr ) {
@@ -1125,7 +1126,7 @@ void Q3Process::socketRead( int fd )
d->notifierStderr->setEnabled( false );
qDeleteInEventHandler(d->notifierStderr);
d->notifierStderr = 0;
- ::close( d->proc->socketStderr );
+ qt_safe_close( d->proc->socketStderr );
d->proc->socketStderr = 0;
return;
}
diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def
index d795a62..dda89fd 100644
--- a/src/s60installs/eabi/QtCoreu.def
+++ b/src/s60installs/eabi/QtCoreu.def
@@ -3206,11 +3206,11 @@ EXPORTS
_ZN12QEasingCurveD1Ev @ 3205 NONAME
_ZN12QEasingCurveD2Ev @ 3206 NONAME
_ZN12QEasingCurveaSERKS_ @ 3207 NONAME
- _ZN12QSignalEventC1EP7QObjectiRK5QListI8QVariantE @ 3208 NONAME
- _ZN12QSignalEventC2EP7QObjectiRK5QListI8QVariantE @ 3209 NONAME
- _ZN12QSignalEventD0Ev @ 3210 NONAME
- _ZN12QSignalEventD1Ev @ 3211 NONAME
- _ZN12QSignalEventD2Ev @ 3212 NONAME
+ _ZN12QSignalEventC1EP7QObjectiRK5QListI8QVariantE @ 3208 NONAME ABSENT
+ _ZN12QSignalEventC2EP7QObjectiRK5QListI8QVariantE @ 3209 NONAME ABSENT
+ _ZN12QSignalEventD0Ev @ 3210 NONAME ABSENT
+ _ZN12QSignalEventD1Ev @ 3211 NONAME ABSENT
+ _ZN12QSignalEventD2Ev @ 3212 NONAME ABSENT
_ZN13QHistoryState11qt_metacallEN11QMetaObject4CallEiPPv @ 3213 NONAME
_ZN13QHistoryState11qt_metacastEPKc @ 3214 NONAME
_ZN13QHistoryState14setHistoryTypeENS_11HistoryTypeE @ 3215 NONAME
@@ -3234,7 +3234,7 @@ EXPORTS
_ZN13QStateMachine12endMicrostepEP6QEvent @ 3233 NONAME
_ZN13QStateMachine14beginMicrostepEP6QEvent @ 3234 NONAME
_ZN13QStateMachine16staticMetaObjectE @ 3235 NONAME DATA 16
- _ZN13QStateMachine17postInternalEventEP6QEvent @ 3236 NONAME
+ _ZN13QStateMachine17postInternalEventEP6QEvent @ 3236 NONAME ABSENT
_ZN13QStateMachine19addDefaultAnimationEP18QAbstractAnimation @ 3237 NONAME
_ZN13QStateMachine20endSelectTransitionsEP6QEvent @ 3238 NONAME
_ZN13QStateMachine20setAnimationsEnabledEb @ 3239 NONAME
@@ -3249,7 +3249,7 @@ EXPORTS
_ZN13QStateMachine7startedEv @ 3248 NONAME
_ZN13QStateMachine7stoppedEv @ 3249 NONAME
_ZN13QStateMachine8addStateEP14QAbstractState @ 3250 NONAME
- _ZN13QStateMachine9postEventEP6QEventi @ 3251 NONAME
+ _ZN13QStateMachine9postEventEP6QEventi @ 3251 NONAME ABSENT
_ZN13QStateMachineC1EP7QObject @ 3252 NONAME
_ZN13QStateMachineC1ER20QStateMachinePrivateP7QObject @ 3253 NONAME
_ZN13QStateMachineC2EP7QObject @ 3254 NONAME
@@ -3265,11 +3265,11 @@ EXPORTS
_ZN13QStatePrivateD1Ev @ 3264 NONAME
_ZN13QStatePrivateD2Ev @ 3265 NONAME
_ZN13QUnifiedTimer8instanceEv @ 3266 NONAME
- _ZN13QWrappedEventC1EP7QObjectP6QEvent @ 3267 NONAME
- _ZN13QWrappedEventC2EP7QObjectP6QEvent @ 3268 NONAME
- _ZN13QWrappedEventD0Ev @ 3269 NONAME
- _ZN13QWrappedEventD1Ev @ 3270 NONAME
- _ZN13QWrappedEventD2Ev @ 3271 NONAME
+ _ZN13QWrappedEventC1EP7QObjectP6QEvent @ 3267 NONAME ABSENT
+ _ZN13QWrappedEventC2EP7QObjectP6QEvent @ 3268 NONAME ABSENT
+ _ZN13QWrappedEventD0Ev @ 3269 NONAME ABSENT
+ _ZN13QWrappedEventD1Ev @ 3270 NONAME ABSENT
+ _ZN13QWrappedEventD2Ev @ 3271 NONAME ABSENT
_ZN14QAbstractState11qt_metacallEN11QMetaObject4CallEiPPv @ 3272 NONAME
_ZN14QAbstractState11qt_metacastEPKc @ 3273 NONAME
_ZN14QAbstractState16staticMetaObjectE @ 3274 NONAME DATA 16
@@ -3299,7 +3299,7 @@ EXPORTS
_ZN15QPauseAnimation11qt_metacastEPKc @ 3298 NONAME
_ZN15QPauseAnimation11setDurationEi @ 3299 NONAME
_ZN15QPauseAnimation16staticMetaObjectE @ 3300 NONAME DATA 16
- _ZN15QPauseAnimation17updateCurrentTimeEi @ 3301 NONAME ABSENT
+ _ZN15QPauseAnimation17updateCurrentTimeEi @ 3301 NONAME
_ZN15QPauseAnimation5eventEP6QEvent @ 3302 NONAME
_ZN15QPauseAnimationC1EP7QObject @ 3303 NONAME
_ZN15QPauseAnimationC1EiP7QObject @ 3304 NONAME
@@ -3361,7 +3361,7 @@ EXPORTS
_ZN17QVariantAnimation13setStartValueERK8QVariant @ 3360 NONAME
_ZN17QVariantAnimation14setEasingCurveERK12QEasingCurve @ 3361 NONAME
_ZN17QVariantAnimation16staticMetaObjectE @ 3362 NONAME DATA 16
- _ZN17QVariantAnimation17updateCurrentTimeEi @ 3363 NONAME ABSENT
+ _ZN17QVariantAnimation17updateCurrentTimeEi @ 3363 NONAME
_ZN17QVariantAnimation20registerInterpolatorEPF8QVariantPKvS2_fEi @ 3364 NONAME
_ZN17QVariantAnimation5eventEP6QEvent @ 3365 NONAME
_ZN17QVariantAnimationC2EP7QObject @ 3366 NONAME
@@ -3430,7 +3430,7 @@ EXPORTS
_ZN20QStateMachinePrivate14isDescendantOfEPK14QAbstractStateS2_ @ 3429 NONAME
_ZN20QStateMachinePrivate15applyPropertiesERK5QListIP19QAbstractTransitionERKS0_IP14QAbstractStateESA_ @ 3430 NONAME
_ZN20QStateMachinePrivate15properAncestorsEPK14QAbstractStatePK6QState @ 3431 NONAME
- _ZN20QStateMachinePrivate15scheduleProcessEv @ 3432 NONAME
+ _ZN20QStateMachinePrivate15scheduleProcessEv @ 3432 NONAME ABSENT
_ZN20QStateMachinePrivate16addStatesToEnterEP14QAbstractStateP6QStateR4QSetIS1_ES6_ @ 3433 NONAME
_ZN20QStateMachinePrivate16removeStartStateEv @ 3434 NONAME
_ZN20QStateMachinePrivate17stateExitLessThanEP14QAbstractStateS1_ @ 3435 NONAME
@@ -3470,7 +3470,7 @@ EXPORTS
_ZN23QParallelAnimationGroup11updateStateEN18QAbstractAnimation5StateES1_ @ 3469 NONAME
_ZN23QParallelAnimationGroup15updateDirectionEN18QAbstractAnimation9DirectionE @ 3470 NONAME
_ZN23QParallelAnimationGroup16staticMetaObjectE @ 3471 NONAME DATA 16
- _ZN23QParallelAnimationGroup17updateCurrentTimeEi @ 3472 NONAME ABSENT
+ _ZN23QParallelAnimationGroup17updateCurrentTimeEi @ 3472 NONAME
_ZN23QParallelAnimationGroup5eventEP6QEvent @ 3473 NONAME
_ZN23QParallelAnimationGroupC1EP7QObject @ 3474 NONAME
_ZN23QParallelAnimationGroupC1ER30QParallelAnimationGroupPrivateP7QObject @ 3475 NONAME
@@ -3498,7 +3498,7 @@ EXPORTS
_ZN25QSequentialAnimationGroup13insertPauseAtEii @ 3497 NONAME
_ZN25QSequentialAnimationGroup15updateDirectionEN18QAbstractAnimation9DirectionE @ 3498 NONAME
_ZN25QSequentialAnimationGroup16staticMetaObjectE @ 3499 NONAME DATA 16
- _ZN25QSequentialAnimationGroup17updateCurrentTimeEi @ 3500 NONAME ABSENT
+ _ZN25QSequentialAnimationGroup17updateCurrentTimeEi @ 3500 NONAME
_ZN25QSequentialAnimationGroup23currentAnimationChangedEP18QAbstractAnimation @ 3501 NONAME
_ZN25QSequentialAnimationGroup5eventEP6QEvent @ 3502 NONAME
_ZN25QSequentialAnimationGroup8addPauseEi @ 3503 NONAME
@@ -3648,11 +3648,11 @@ EXPORTS
_ZNK8QVariant7toFloatEPb @ 3647 NONAME
_ZNK9QTimeLine11easingCurveEv @ 3648 NONAME
_ZTI11QFinalState @ 3649 NONAME
- _ZTI12QSignalEvent @ 3650 NONAME
+ _ZTI12QSignalEvent @ 3650 NONAME ABSENT
_ZTI13QHistoryState @ 3651 NONAME
_ZTI13QStateMachine @ 3652 NONAME
_ZTI13QStatePrivate @ 3653 NONAME
- _ZTI13QWrappedEvent @ 3654 NONAME
+ _ZTI13QWrappedEvent @ 3654 NONAME ABSENT
_ZTI14QAbstractState @ 3655 NONAME
_ZTI15QAnimationGroup @ 3656 NONAME
_ZTI15QPauseAnimation @ 3657 NONAME
@@ -3671,11 +3671,11 @@ EXPORTS
_ZTI26QAbstractTransitionPrivate @ 3670 NONAME
_ZTI6QState @ 3671 NONAME
_ZTV11QFinalState @ 3672 NONAME
- _ZTV12QSignalEvent @ 3673 NONAME
+ _ZTV12QSignalEvent @ 3673 NONAME ABSENT
_ZTV13QHistoryState @ 3674 NONAME
_ZTV13QStateMachine @ 3675 NONAME
_ZTV13QStatePrivate @ 3676 NONAME
- _ZTV13QWrappedEvent @ 3677 NONAME
+ _ZTV13QWrappedEvent @ 3677 NONAME ABSENT
_ZTV14QAbstractState @ 3678 NONAME
_ZTV15QAnimationGroup @ 3679 NONAME
_ZTV15QPauseAnimation @ 3680 NONAME
@@ -3820,8 +3820,18 @@ EXPORTS
_ZTV37QNonContiguousByteDeviceByteArrayImpl @ 3819 NONAME ABSENT ; #<VT>#
_ZTV38QNonContiguousByteDeviceRingBufferImpl @ 3820 NONAME ABSENT ; #<VT>#
_Zls6QDebugRK8QMargins @ 3821 NONAME
- _ZN15QPauseAnimation17updateCurrentTimeEv @ 3822 NONAME
- _ZN17QVariantAnimation17updateCurrentTimeEv @ 3823 NONAME
- _ZN23QParallelAnimationGroup17updateCurrentTimeEv @ 3824 NONAME
- _ZN25QSequentialAnimationGroup17updateCurrentTimeEv @ 3825 NONAME
+ _ZN15QPauseAnimation17updateCurrentTimeEv @ 3822 NONAME ABSENT
+ _ZN17QVariantAnimation17updateCurrentTimeEv @ 3823 NONAME ABSENT
+ _ZN23QParallelAnimationGroup17updateCurrentTimeEv @ 3824 NONAME ABSENT
+ _ZN25QSequentialAnimationGroup17updateCurrentTimeEv @ 3825 NONAME ABSENT
+ _ZN11QDataStream25setFloatingPointPrecisionENS_22FloatingPointPrecisionE @ 3826 NONAME
+ _ZN13QStateMachine16postDelayedEventEP6QEventi @ 3827 NONAME
+ _ZN13QStateMachine18cancelDelayedEventEi @ 3828 NONAME
+ _ZN13QStateMachine9postEventEP6QEventNS_13EventPriorityE @ 3829 NONAME
+ _ZN20QStateMachinePrivate13processEventsENS_19EventProcessingModeE @ 3830 NONAME
+ _ZN20QStateMachinePrivate19handleFilteredEventEP7QObjectP6QEvent @ 3831 NONAME
+ _ZN20QStateMachinePrivate22cancelAllDelayedEventsEv @ 3832 NONAME
+ _ZN4QUrl13fromUserInputERK7QString @ 3833 NONAME
+ _ZNK11QDataStream22floatingPointPrecisionEv @ 3834 NONAME
+ qt_sine_table @ 3835 NONAME DATA 1024
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index aad8b68..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
@@ -11631,7 +11631,7 @@ EXPORTS
qt_pixmap_cleanup_hook @ 11630 NONAME DATA 4
qt_pixmap_cleanup_hook_64 @ 11631 NONAME DATA 4
qt_tab_all_widgets @ 11632 NONAME DATA 1
- _Z17qDrawBorderPixmapP8QPainterRK5QRectRK8QMarginsRK7QPixmapS3_S6_RK10QTileRules @ 11633 NONAME
+ _Z17qDrawBorderPixmapP8QPainterRK5QRectRK8QMarginsRK7QPixmapS3_S6_RK10QTileRules @ 11633 NONAME ABSENT
_Z17qHasPixmapTextureRK6QBrush @ 11634 NONAME
_Z22qt_setQtEnableTestFontb @ 11635 NONAME
_Z25qt_translateRawTouchEventP7QWidgetN11QTouchEvent10DeviceTypeERK5QListINS1_10TouchPointEE @ 11636 NONAME
@@ -11824,7 +11824,7 @@ EXPORTS
_ZN14QPaintEngineExC2Ev @ 11823 NONAME
_ZN14QWidgetPrivate10allWidgetsE @ 11824 NONAME DATA 4
_ZN14QWidgetPrivate13setWSGeometryEbRK5QRect @ 11825 NONAME
- _ZN14QWidgetPrivate33handleSymbianDeferredFocusChangedEv @ 11826 NONAME
+ _ZN14QWidgetPrivate33handleSymbianDeferredFocusChangedEv @ 11826 NONAME ABSENT
_ZN15QDockAreaLayout13separatorMoveERK5QListIiERK6QPointS6_ @ 11827 NONAME
_ZN15QDockAreaLayout4infoERK5QListIiE @ 11828 NONAME
_ZN15QDockAreaLayout4itemERK5QListIiE @ 11829 NONAME
@@ -12984,9 +12984,9 @@ EXPORTS
_ZN16QS60MainDocumentD0Ev @ 12983 NONAME
_ZN16QS60MainDocumentD1Ev @ 12984 NONAME
_ZN16QS60MainDocumentD2Ev @ 12985 NONAME
- _ZN17QPixmapBlurFilter11setBlurHintENS_8BlurHintE @ 12986 NONAME
- _ZN19QGraphicsBlurEffect11setBlurHintENS_8BlurHintE @ 12987 NONAME
- _ZN19QGraphicsBlurEffect15blurHintChangedENS_8BlurHintE @ 12988 NONAME
+ _ZN17QPixmapBlurFilter11setBlurHintENS_8BlurHintE @ 12986 NONAME ABSENT
+ _ZN19QGraphicsBlurEffect11setBlurHintENS_8BlurHintE @ 12987 NONAME ABSENT
+ _ZN19QGraphicsBlurEffect15blurHintChangedENS_8BlurHintE @ 12988 NONAME ABSENT
_ZN19QS60MainApplication15CreateDocumentLEv @ 12989 NONAME
_ZN19QS60MainApplicationC1Ev @ 12990 NONAME
_ZN19QS60MainApplicationC2Ev @ 12991 NONAME
@@ -13001,7 +13001,7 @@ EXPORTS
_ZNK19QGraphicsBlurEffect8blurHintEv @ 13000 NONAME
_ZNK19QS60MainApplication16ResourceFileNameEv @ 13001 NONAME
_ZNK19QS60MainApplication9AppDllUidEv @ 13002 NONAME
- _ZNK21QGraphicsAnchorLayout12hasConflictsEv @ 13003 NONAME
+ _ZNK21QGraphicsAnchorLayout12hasConflictsEv @ 13003 NONAME ABSENT
_ZNK7QPixmap17toSymbianRSgImageEv @ 13004 NONAME
_ZTI15QSoftKeyManager @ 13005 NONAME
_ZTV15QSoftKeyManager @ 13006 NONAME
@@ -13009,4 +13009,131 @@ EXPORTS
_ZThn24_N13QS60MainAppUi15DynInitMenuBarLEiP11CEikMenuBar @ 13008 NONAME
_ZThn24_N13QS60MainAppUi16DynInitMenuPaneLEiP12CEikMenuPane @ 13009 NONAME
_ZThn88_N13QS60MainAppUi26HandleStatusPaneSizeChangeEv @ 13010 NONAME
+ _Z12qDrawPixmapsP8QPainterPKN12QDrawPixmaps4DataEiRK7QPixmap6QFlagsINS1_11DrawingHintEE @ 13011 NONAME
+ _Z17qDrawBorderPixmapP8QPainterRK5QRectRK8QMarginsRK7QPixmapS3_S6_RK10QTileRules6QFlagsIN17QDrawBorderPixmap11DrawingHintEE @ 13012 NONAME
+ _ZN10QImageData6createEPhiiiN6QImage6FormatEb @ 13013 NONAME
+ _ZN10QImageData6createERK5QSizeN6QImage6FormatEi @ 13014 NONAME
+ _ZN10QImageDataC1Ev @ 13015 NONAME
+ _ZN10QImageDataC2Ev @ 13016 NONAME
+ _ZN10QImageDataD1Ev @ 13017 NONAME
+ _ZN10QImageDataD2Ev @ 13018 NONAME
+ _ZN13QGraphicsItem11stackBeforeEPKS_ @ 13019 NONAME
+ _ZN13QGraphicsItem16setPanelModalityENS_13PanelModalityE @ 13020 NONAME
+ _ZN14QPaintEngineEx11drawPixmapsEPKN12QDrawPixmaps4DataEiRK7QPixmap6QFlagsINS0_11DrawingHintEE @ 13021 NONAME
+ _ZN14QWidgetPrivate21activateSymbianWindowEv @ 13022 NONAME
+ _ZN17QAbstractItemView20setDefaultDropActionEN2Qt10DropActionE @ 13023 NONAME
+ _ZN17QPixmapBlurFilter11setBlurHintEN2Qt10RenderHintE @ 13024 NONAME
+ _ZN19QApplicationPrivate16load_testabilityE @ 13025 NONAME DATA 1
+ _ZN19QGraphicsBlurEffect11setBlurHintEN2Qt10RenderHintE @ 13026 NONAME
+ _ZN19QGraphicsBlurEffect15blurHintChangedEN2Qt10RenderHintE @ 13027 NONAME
+ _ZN20QGraphicsBloomEffect11qt_metacallEN11QMetaObject4CallEiPPv @ 13028 NONAME
+ _ZN20QGraphicsBloomEffect11qt_metacastEPKc @ 13029 NONAME
+ _ZN20QGraphicsBloomEffect11setBlurHintEN2Qt10RenderHintE @ 13030 NONAME
+ _ZN20QGraphicsBloomEffect11setStrengthEf @ 13031 NONAME
+ _ZN20QGraphicsBloomEffect13setBlurRadiusEi @ 13032 NONAME
+ _ZN20QGraphicsBloomEffect13setBrightnessEi @ 13033 NONAME
+ _ZN20QGraphicsBloomEffect15blurHintChangedEN2Qt10RenderHintE @ 13034 NONAME
+ _ZN20QGraphicsBloomEffect15strengthChangedEf @ 13035 NONAME
+ _ZN20QGraphicsBloomEffect16staticMetaObjectE @ 13036 NONAME DATA 16
+ _ZN20QGraphicsBloomEffect17blurRadiusChangedEi @ 13037 NONAME
+ _ZN20QGraphicsBloomEffect17brightnessChangedEi @ 13038 NONAME
+ _ZN20QGraphicsBloomEffect19getStaticMetaObjectEv @ 13039 NONAME
+ _ZN20QGraphicsBloomEffect4drawEP8QPainterP21QGraphicsEffectSource @ 13040 NONAME
+ _ZN20QGraphicsBloomEffectC1EP7QObject @ 13041 NONAME
+ _ZN20QGraphicsBloomEffectC2EP7QObject @ 13042 NONAME
+ _ZN20QGraphicsBloomEffectD0Ev @ 13043 NONAME
+ _ZN20QGraphicsBloomEffectD1Ev @ 13044 NONAME
+ _ZN20QGraphicsBloomEffectD2Ev @ 13045 NONAME
+ _ZN20QGraphicsItemPrivate28ensureSequentialSiblingIndexEv @ 13046 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate11solveMinMaxE5QListIP18QSimplexConstraintE9GraphPathPfS5_ @ 13047 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate12oppositeEdgeEN2Qt11AnchorPointE @ 13048 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate12removeAnchorEP12AnchorVertexS1_ @ 13049 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate12removeVertexEP19QGraphicsLayoutItemN2Qt11AnchorPointE @ 13050 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate13getGraphPartsENS_11OrientationE @ 13051 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate13removeAnchorsEP19QGraphicsLayoutItem @ 13052 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate13setAnchorSizeEP10AnchorDataPKf @ 13053 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate13simplifyGraphENS_11OrientationE @ 13054 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate14solvePreferredE5QListIP18QSimplexConstraintE @ 13055 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate15calculateGraphsENS_11OrientationE @ 13056 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate15calculateGraphsEv @ 13057 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate15createItemEdgesEP19QGraphicsLayoutItem @ 13058 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate15edgeOrientationEN2Qt11AnchorPointE @ 13059 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate15interpolateEdgeEP12AnchorVertexP10AnchorDataNS_11OrientationE @ 13060 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate16addAnchor_helperEP19QGraphicsLayoutItemN2Qt11AnchorPointES1_S3_P10AnchorData @ 13061 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate17addInternalVertexEP19QGraphicsLayoutItemN2Qt11AnchorPointE @ 13062 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate17createLayoutEdgesEv @ 13063 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate17deleteLayoutEdgesEv @ 13064 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate18setItemsGeometriesERK6QRectF @ 13065 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate19createCenterAnchorsEP19QGraphicsLayoutItemN2Qt11AnchorPointE @ 13066 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate19removeAnchor_helperEP12AnchorVertexS1_ @ 13067 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate19removeCenterAnchorsEP19QGraphicsLayoutItemN2Qt11AnchorPointEb @ 13068 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate20constraintsFromPathsENS_11OrientationE @ 13069 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate20correctEdgeDirectionERP19QGraphicsLayoutItemRN2Qt11AnchorPointES2_S5_ @ 13070 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate20removeInternalVertexEP19QGraphicsLayoutItemN2Qt11AnchorPointE @ 13071 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate22restoreSimplifiedGraphENS_11OrientationE @ 13072 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate22simplifyGraphIterationENS_11OrientationE @ 13073 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate23removeCenterConstraintsEP19QGraphicsLayoutItemNS_11OrientationE @ 13074 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate23setupEdgesInterpolationENS_11OrientationE @ 13075 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate24calculateVertexPositionsENS_11OrientationE @ 13076 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate24constraintsFromSizeHintsERK5QListIP10AnchorDataE @ 13077 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate24interpolateParallelEdgesEP12AnchorVertexP18ParallelAnchorDataNS_11OrientationE @ 13078 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate26interpolateSequentialEdgesEP12AnchorVertexP20SequentialAnchorDataNS_11OrientationE @ 13079 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate27setAnchorSizeHintsFromItemsENS_11OrientationE @ 13080 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate9addAnchorEP19QGraphicsLayoutItemN2Qt11AnchorPointES1_S3_Pf @ 13081 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate9findPathsENS_11OrientationE @ 13082 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivate9getAnchorEP19QGraphicsLayoutItemN2Qt11AnchorPointES1_S3_ @ 13083 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivateC1Ev @ 13084 NONAME
+ _ZN28QGraphicsAnchorLayoutPrivateC2Ev @ 13085 NONAME
+ _ZNK10QImageData19checkForAlphaPixelsEv @ 13086 NONAME
+ _ZNK10QImageData9doImageIOEPK6QImageP12QImageWriteri @ 13087 NONAME
+ _ZNK13QGraphicsItem13panelModalityEv @ 13088 NONAME
+ _ZNK13QGraphicsItem21isBlockedByModalPanelEPPS_ @ 13089 NONAME
+ _ZNK17QAbstractItemView17defaultDropActionEv @ 13090 NONAME
+ _ZNK20QGraphicsBloomEffect10blurRadiusEv @ 13091 NONAME
+ _ZNK20QGraphicsBloomEffect10brightnessEv @ 13092 NONAME
+ _ZNK20QGraphicsBloomEffect10metaObjectEv @ 13093 NONAME
+ _ZNK20QGraphicsBloomEffect15boundingRectForERK6QRectF @ 13094 NONAME
+ _ZNK20QGraphicsBloomEffect8blurHintEv @ 13095 NONAME
+ _ZNK20QGraphicsBloomEffect8strengthEv @ 13096 NONAME
+ _ZNK28QGraphicsAnchorLayoutPrivate10anchorSizeEPK10AnchorDataPfS3_S3_ @ 13097 NONAME
+ _ZNK28QGraphicsAnchorLayoutPrivate12hasConflictsEv @ 13098 NONAME
+ _ZNK28QGraphicsAnchorLayoutPrivate16effectiveSpacingENS_11OrientationE @ 13099 NONAME
+ _ZTI20QGraphicsBloomEffect @ 13100 NONAME
+ _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/QtNetworku.def b/src/s60installs/eabi/QtNetworku.def
index 5188872..ab4562c 100644
--- a/src/s60installs/eabi/QtNetworku.def
+++ b/src/s60installs/eabi/QtNetworku.def
@@ -1353,7 +1353,7 @@ EXPORTS
_ZN10QSslSocket22connectToHostEncryptedERK7QStringtS2_6QFlagsIN9QIODevice12OpenModeFlagEE @ 1352 NONAME
_ZN13QNetworkReply15ignoreSslErrorsERK5QListI9QSslErrorE @ 1353 NONAME
_ZN15QAbstractSocket12socketOptionENS_12SocketOptionE @ 1354 NONAME
- _ZN15QAbstractSocket15setSocketOptionENS_12SocketOptionE8QVariant @ 1355 NONAME
+ _ZN15QAbstractSocket15setSocketOptionENS_12SocketOptionERK8QVariant @ 1355 NONAME
_ZN17QHttpNetworkReply15ignoreSslErrorsERK5QListI9QSslErrorE @ 1356 NONAME
_ZN17QHttpNetworkReply16dataSendProgressExx @ 1357 NONAME
_ZN17QHttpNetworkReply7readAnyEv @ 1358 NONAME
@@ -1379,7 +1379,7 @@ EXPORTS
_ZN19QHttpNetworkRequest20setPipeliningAllowedEb @ 1378 NONAME
_ZN19QNativeSocketEngine19getStaticMetaObjectEv @ 1379 NONAME
_ZN19QSocks5SocketEngine19getStaticMetaObjectEv @ 1380 NONAME
- _ZN20QNetworkProxyFactory32setUseSystemConfigurationEnabledEb @ 1381 NONAME
+ _ZN20QNetworkProxyFactory25setUseSystemConfigurationEb @ 1381 NONAME
_ZN21QAbstractNetworkCache19getStaticMetaObjectEv @ 1382 NONAME
_ZN21QAbstractSocketEngine19getStaticMetaObjectEv @ 1383 NONAME
_ZN21QNetworkAccessManager19getStaticMetaObjectEv @ 1384 NONAME
diff --git a/src/s60installs/eabi/QtScriptu.def b/src/s60installs/eabi/QtScriptu.def
index 40d3577..1205c04 100644
--- a/src/s60installs/eabi/QtScriptu.def
+++ b/src/s60installs/eabi/QtScriptu.def
@@ -1,6 +1,6 @@
EXPORTS
_Z14qScriptConnectP7QObjectPKcRK12QScriptValueS5_ @ 1 NONAME
- _Z14qt_scriptToXmlRK7QStringi @ 2 NONAME
+ _Z14qt_scriptToXmlRK7QStringi @ 2 NONAME ABSENT
_Z17qScriptDisconnectP7QObjectPKcRK12QScriptValueS5_ @ 3 NONAME
_ZN11QScriptableC1Ev @ 4 NONAME
_ZN11QScriptableC2Ev @ 5 NONAME
@@ -189,11 +189,11 @@ EXPORTS
_ZN24QScriptSyntaxCheckResultD1Ev @ 188 NONAME
_ZN24QScriptSyntaxCheckResultD2Ev @ 189 NONAME
_ZN24QScriptSyntaxCheckResultaSERKS_ @ 190 NONAME
- _ZN25QScriptEngineAgentPrivateC1Ev @ 191 NONAME
- _ZN25QScriptEngineAgentPrivateC2Ev @ 192 NONAME
- _ZN25QScriptEngineAgentPrivateD0Ev @ 193 NONAME
- _ZN25QScriptEngineAgentPrivateD1Ev @ 194 NONAME
- _ZN25QScriptEngineAgentPrivateD2Ev @ 195 NONAME
+ _ZN25QScriptEngineAgentPrivateC1Ev @ 191 NONAME ABSENT
+ _ZN25QScriptEngineAgentPrivateC2Ev @ 192 NONAME ABSENT
+ _ZN25QScriptEngineAgentPrivateD0Ev @ 193 NONAME ABSENT
+ _ZN25QScriptEngineAgentPrivateD1Ev @ 194 NONAME ABSENT
+ _ZN25QScriptEngineAgentPrivateD2Ev @ 195 NONAME ABSENT
_ZN28QScriptClassPropertyIteratorC2ERK12QScriptValue @ 196 NONAME
_ZN28QScriptClassPropertyIteratorC2ERK12QScriptValueR35QScriptClassPropertyIteratorPrivate @ 197 NONAME
_ZN28QScriptClassPropertyIteratorD0Ev @ 198 NONAME
@@ -586,4 +586,19 @@ EXPORTS
_ZThn8_N22QScriptExtensionPluginD1Ev @ 585 NONAME
_ZlsR11QDataStreamRK18QScriptContextInfo @ 586 NONAME
_ZrsR11QDataStreamR18QScriptContextInfo @ 587 NONAME
+ _Z22qt_script_isJITEnabledv @ 588 NONAME
+ _ZN12QScriptValueC1EP19QScriptValuePrivate @ 589 NONAME
+ _ZN12QScriptValueC2EP19QScriptValuePrivate @ 590 NONAME
+ _ZN13QScriptEngine19getStaticMetaObjectEv @ 591 NONAME
+ _ZN22QScriptExtensionPlugin19getStaticMetaObjectEv @ 592 NONAME
+ _ZN25QScriptEngineAgentPrivate11atStatementERKN5QTJSC17DebuggerCallFrameEiii @ 593 NONAME
+ _ZN25QScriptEngineAgentPrivate11returnEventERKN5QTJSC17DebuggerCallFrameEii @ 594 NONAME
+ _ZN25QScriptEngineAgentPrivate12evaluateStopERKN5QTJSC7JSValueEi @ 595 NONAME
+ _ZN25QScriptEngineAgentPrivate12functionExitERKN5QTJSC7JSValueEi @ 596 NONAME
+ _ZN25QScriptEngineAgentPrivate14exceptionCatchERKN5QTJSC17DebuggerCallFrameEi @ 597 NONAME
+ _ZN25QScriptEngineAgentPrivate14exceptionThrowERKN5QTJSC17DebuggerCallFrameEib @ 598 NONAME
+ _ZN25QScriptEngineAgentPrivate18didReachBreakpointERKN5QTJSC17DebuggerCallFrameEiii @ 599 NONAME
+ _ZN25QScriptEngineAgentPrivate6attachEv @ 600 NONAME
+ _ZN25QScriptEngineAgentPrivate6detachEv @ 601 NONAME
+ _Z5qHashRK13QScriptString @ 602 NONAME
diff --git a/src/s60installs/eabi/QtSqlu.def b/src/s60installs/eabi/QtSqlu.def
index 99f0d00..4d4791a 100644
--- a/src/s60installs/eabi/QtSqlu.def
+++ b/src/s60installs/eabi/QtSqlu.def
@@ -236,7 +236,7 @@ EXPORTS
_ZN9QSqlFieldC1ERKS_ @ 235 NONAME
_ZN9QSqlFieldC1Ev @ 236 NONAME ABSENT
_ZN9QSqlFieldC2ERK7QString @ 237 NONAME ABSENT
- _ZN9QSqlFieldC2ERK7QStringN8QVariant4TypeE @ 238 NONAME ABSENT
+ _ZN9QSqlFieldC2ERK7QStringN8QVariant4TypeE @ 238 NONAME
_ZN9QSqlFieldC2ERKS_ @ 239 NONAME
_ZN9QSqlFieldC2Ev @ 240 NONAME ABSENT
_ZN9QSqlFieldD1Ev @ 241 NONAME
diff --git a/src/s60installs/eabi/phononu.def b/src/s60installs/eabi/phononu.def
index d407ba4..d70942c 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 ABSENT
- _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE1EEE @ 498 NONAME ABSENT
- _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE2EEE @ 499 NONAME ABSENT
- _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE3EEE @ 500 NONAME ABSENT
- _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE4EEE @ 501 NONAME ABSENT
+ _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE0EEE @ 497 NONAME
+ _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE1EEE @ 498 NONAME
+ _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE2EEE @ 499 NONAME
+ _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE3EEE @ 500 NONAME
+ _ZTIN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE4EEE @ 501 NONAME
_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 ABSENT
- _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE1EEE @ 535 NONAME ABSENT
- _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE2EEE @ 536 NONAME ABSENT
- _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE3EEE @ 537 NONAME ABSENT
- _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE4EEE @ 538 NONAME ABSENT
+ _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE0EEE @ 534 NONAME
+ _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE1EEE @ 535 NONAME
+ _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE2EEE @ 536 NONAME
+ _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE3EEE @ 537 NONAME
+ _ZTVN6Phonon22ObjectDescriptionModelILNS_21ObjectDescriptionTypeE4EEE @ 538 NONAME
_ZTVN6Phonon24VolumeFaderEffectPrivateE @ 539 NONAME ABSENT
_ZTVN6Phonon26AbstractAudioOutputPrivateE @ 540 NONAME ABSENT
_ZTVN6Phonon26AbstractMediaStreamPrivateE @ 541 NONAME
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index 3aef05e..7233e8a 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -19,7 +19,6 @@ symbian: {
QtXml.dll \
QtGui.dll \
QtNetwork.dll \
- QtScript.dll \
QtTest.dll \
QtSql.dll
@@ -94,6 +93,10 @@ symbian: {
qtlibraries.sources += Phonon.dll
}
+ contains(QT_CONFIG, script): {
+ qtlibraries.sources += QtScript.dll
+ }
+
contains(QT_CONFIG, webkit): {
qtlibraries.sources += QtWebKit.dll
}
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/qscriptstring.cpp b/src/script/api/qscriptstring.cpp
index 65bd818..2fb157f 100644
--- a/src/script/api/qscriptstring.cpp
+++ b/src/script/api/qscriptstring.cpp
@@ -150,14 +150,8 @@ bool QScriptString::isValid() const
bool QScriptString::operator==(const QScriptString &other) const
{
Q_D(const QScriptString);
- if (d == other.d_func())
- return true;
if (!d || !other.d_func())
return d == other.d_func();
- if (d->engine != other.d_func()->engine)
- return false;
- if (!d->engine)
- return true;
return d->identifier == other.d_func()->identifier;
}
@@ -195,4 +189,12 @@ QScriptString::operator QString() const
return toString();
}
+uint qHash(const QScriptString &key)
+{
+ QScriptStringPrivate *d = QScriptStringPrivate::get(key);
+ if (!d)
+ return 0;
+ return qHash(d->identifier.ustring().rep());
+}
+
QT_END_NAMESPACE
diff --git a/src/script/api/qscriptstring.h b/src/script/api/qscriptstring.h
index e0a808e..40d156c 100644
--- a/src/script/api/qscriptstring.h
+++ b/src/script/api/qscriptstring.h
@@ -76,6 +76,8 @@ private:
Q_DECLARE_PRIVATE(QScriptString)
};
+Q_SCRIPT_EXPORT uint qHash(const QScriptString &key);
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/script/api/qscriptstring_p.h b/src/script/api/qscriptstring_p.h
index 25ce702..d3bb47d 100644
--- a/src/script/api/qscriptstring_p.h
+++ b/src/script/api/qscriptstring_p.h
@@ -73,6 +73,8 @@ public:
inline ~QScriptStringPrivate();
static inline void init(QScriptString &q, QScriptStringPrivate *d);
+ static inline QScriptStringPrivate *get(const QScriptString &q);
+
inline void detachFromEngine();
QBasicAtomicInt ref;
@@ -101,6 +103,11 @@ inline void QScriptStringPrivate::init(QScriptString &q, QScriptStringPrivate *d
q.d_ptr = d;
}
+inline QScriptStringPrivate *QScriptStringPrivate::get(const QScriptString &q)
+{
+ return const_cast<QScriptStringPrivate*>(q.d_func());
+}
+
inline void QScriptStringPrivate::detachFromEngine()
{
engine = 0;
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,
diff --git a/src/xmlpatterns/data/qvaluefactory.cpp b/src/xmlpatterns/data/qvaluefactory.cpp
index bac53b2..8f7e5a3 100644
--- a/src/xmlpatterns/data/qvaluefactory.cpp
+++ b/src/xmlpatterns/data/qvaluefactory.cpp
@@ -66,7 +66,7 @@ public:
}
AtomicValue::Ptr operator()(const AtomicValue::Ptr &lexicalValue,
- const SchemaType::Ptr &type,
+ const SchemaType::Ptr & /*type*/,
const ReportContext::Ptr &context)
{
prepareCasting(context, BuiltinTypes::xsString);
diff --git a/src/xmlpatterns/functions/qsequencefns_p.h b/src/xmlpatterns/functions/qsequencefns_p.h
index e406b95..fa799d3 100644
--- a/src/xmlpatterns/functions/qsequencefns_p.h
+++ b/src/xmlpatterns/functions/qsequencefns_p.h
@@ -149,7 +149,6 @@ namespace QPatternist
// RVCT doesn't like using template parameter in trinary operator when the trinary operator result is
// passed directly into another constructor.
Q_ASSERT(Id == IDExistsFN || Id == IDEmptyFN);
-
const Expression::Ptr me(FunctionCall::compress(context));
diff --git a/src/xmlpatterns/schema/qxsdschemaparser.cpp b/src/xmlpatterns/schema/qxsdschemaparser.cpp
index 8f7b6af..41c6b82 100644
--- a/src/xmlpatterns/schema/qxsdschemaparser.cpp
+++ b/src/xmlpatterns/schema/qxsdschemaparser.cpp
@@ -123,6 +123,7 @@ class ElementNamespaceHandler
: m_parser(parser)
{
Q_ASSERT(m_parser->isStartElement() && (XsdSchemaToken::toToken(m_parser->name()) == tag) && (XsdSchemaToken::toToken(m_parser->namespaceUri()) == XsdSchemaToken::XML_NS_SCHEMA_URI));
+ Q_UNUSED(tag)
m_parser->m_namespaceSupport.pushContext();
m_parser->m_namespaceSupport.setPrefixes(m_parser->namespaceDeclarations());
}