summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri3
-rw-r--r--src/3rdparty/javascriptcore/WebKit.pri4
-rw-r--r--src/3rdparty/phonon/mmf/TODO.txt29
-rw-r--r--src/3rdparty/phonon/mmf/audioplayer.cpp2
-rw-r--r--src/3rdparty/phonon/mmf/mmf_medianode.cpp2
-rw-r--r--src/3rdparty/phonon/mmf/mmf_videoplayer.cpp109
-rw-r--r--src/3rdparty/phonon/mmf/mmf_videoplayer.h2
-rw-r--r--src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp11
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri2
-rw-r--r--src/3rdparty/webkit/WebCore/bridge/qt/qt_class.h2
-rw-r--r--src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp4
-rw-r--r--src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp4
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp9
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/IconQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp4
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/graphics/qt/StillImageQt.h2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/ContextMenuQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/DragDataQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp13
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/SearchPopupMenuQt.cpp4
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/WidgetQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp4
-rw-r--r--src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp4
-rw-r--r--src/3rdparty/webkit/WebKit.pri4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp12
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp13
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebview.h1
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp2
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp22
-rw-r--r--src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp6
-rw-r--r--src/corelib/animation/qabstractanimation.cpp17
-rw-r--r--src/corelib/animation/qabstractanimation_p.h8
-rw-r--r--src/corelib/global/qnamespace.h6
-rw-r--r--src/corelib/global/qnamespace.qdoc26
-rw-r--r--src/corelib/io/qdatastream.cpp2
-rw-r--r--src/corelib/kernel/kernel.pri6
-rw-r--r--src/corelib/kernel/qcoreevent.cpp4
-rw-r--r--src/corelib/kernel/qcoreevent.h4
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp2
-rw-r--r--src/corelib/kernel/qmath.cpp305
-rw-r--r--src/corelib/kernel/qmath.h24
-rw-r--r--src/corelib/statemachine/qeventtransition.cpp2
-rw-r--r--src/corelib/statemachine/qsignaltransition.cpp4
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp4
-rw-r--r--src/gui/dialogs/qfiledialog.cpp22
-rw-r--r--src/gui/embedded/qvfbhdr.h18
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout.cpp19
-rw-r--r--src/gui/graphicsview/qgraphicsanchorlayout.h2
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp1
-rw-r--r--src/gui/image/qimage_p.h2
-rw-r--r--src/gui/image/qpixmap_s60.cpp4
-rw-r--r--src/gui/image/qpixmap_x11.cpp33
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp27
-rw-r--r--src/gui/itemviews/qabstractitemview.h5
-rw-r--r--src/gui/itemviews/qabstractitemview_p.h9
-rw-r--r--src/gui/kernel/qapplication_qws.cpp2
-rw-r--r--src/gui/kernel/qapplication_s60.cpp16
-rw-r--r--src/gui/kernel/qgesture.cpp1
-rw-r--r--src/gui/kernel/qstandardgestures.cpp3
-rw-r--r--src/gui/kernel/qwidget.cpp21
-rw-r--r--src/gui/kernel/qwidget_p.h1
-rw-r--r--src/gui/kernel/qwidget_s60.cpp42
-rw-r--r--src/gui/painting/qdrawutil.cpp457
-rw-r--r--src/gui/painting/qdrawutil.h75
-rw-r--r--src/gui/painting/qpaintengineex.cpp25
-rw-r--r--src/gui/painting/qpaintengineex_p.h9
-rw-r--r--src/gui/s60framework/qs60mainapplication.cpp4
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp2
-rw-r--r--src/gui/widgets/qabstractslider.cpp30
-rw-r--r--src/gui/widgets/qlabel.cpp13
-rw-r--r--src/gui/widgets/qtextedit.cpp5
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp10
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp59
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager_p.h14
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadersource_p.h20
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp145
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h8
-rw-r--r--src/opengl/qgl.cpp28
-rw-r--r--src/opengl/qgl_x11egl.cpp12
-rw-r--r--src/opengl/qpixmapdata_gl.cpp21
-rw-r--r--src/opengl/qwindowsurface_gl.cpp6
-rw-r--r--src/qt3support/widgets/q3toolbar.cpp2
-rw-r--r--src/s60installs/qt.svg17
-rw-r--r--src/testlib/qtestcase.cpp4
97 files changed, 1371 insertions, 548 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri
index 8483469..965f3d6 100644
--- a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri
@@ -37,6 +37,9 @@ win32-* {
LIBS += -lwinmm
}
+contains(JAVASCRIPTCORE_JIT,yes): DEFINES+=ENABLE_JIT=1
+contains(JAVASCRIPTCORE_JIT,no): DEFINES+=ENABLE_JIT=0
+
# In debug mode JIT disabled until crash fixed
win32-* {
CONFIG(debug):!contains(DEFINES, ENABLE_JIT=1): DEFINES+=ENABLE_JIT=0
diff --git a/src/3rdparty/javascriptcore/WebKit.pri b/src/3rdparty/javascriptcore/WebKit.pri
index ded4701..fd918c9 100644
--- a/src/3rdparty/javascriptcore/WebKit.pri
+++ b/src/3rdparty/javascriptcore/WebKit.pri
@@ -48,7 +48,7 @@ symbian|*-armcc {
RVCT_COMMON_CFLAGS = --gnu --diag_suppress 68,111,177,368,830,1293
RVCT_COMMON_CXXFLAGS = $$RVCT_COMMON_CFLAGS --no_parse_templates
DEFINES *= QT_NO_UITOOLS
-}
+}
*-armcc {
QMAKE_CFLAGS += $$RVCT_COMMON_CFLAGS
@@ -63,7 +63,7 @@ contains(DEFINES, QT_NO_UITOOLS): CONFIG -= uitools
# Disable a few warnings on Windows. The warnings are also
# disabled in WebKitLibraries/win/tools/vsprops/common.vsprops
-win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4503 -wd4800 -wd4819 -wd4996
+win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996
#
# For builds inside Qt we interpret the output rule and the input of each extra compiler manually
diff --git a/src/3rdparty/phonon/mmf/TODO.txt b/src/3rdparty/phonon/mmf/TODO.txt
deleted file mode 100644
index a2b1865..0000000
--- a/src/3rdparty/phonon/mmf/TODO.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-TODO list for MMF Phonon backend
---------------------------------
-
-The following items are in rough order of priority.
-
-* Activating full-screen video playback in qmediaplayer causes the app to crash
-This may be symptomatic of more general problems with re-sizing / re-positioning video while playing.
-
-* Implement audio effects
-
-* Support for playing "file:" URLs
-
-* Support for network streaming playback
-The main question here is how best to implement the MIME type detection for streams. The OpenUrlL functions only take a URL, whereas the corresponding OpenFileL functions have overloads for filenames and for open RFile handles. This is because files support random access whereas streams do not. A naieve approach to MIME type detection for streams is as follows; is there a more efficient approach?
- 1. Open network connection
- 2. Download header
- 3. Detect MIME type and create AbstractMediaPlayer instance
- 4. Close network connection
- 5. Pass URL to MMF client utility, which will then re-open the stream
-An alternative approach is to always create a VideoPlayer when passed an RTSP URL, and then modify VideoPlayer::hasVideo to check CVideoPlayerUtility::VideoMimeTypeL before returning. This way, we would always use CVideoPlayerUtility for RTSP streaming, whether the source is audio or video. Well-behaved client apps, however, should check MediaObject::hasVideo before creating the UI - and therefore the VideoWidget would only be connected if the source is actually a video stream.
-
-* Performance analysis
-Compare video frame rate obtained using default S60 media player and Qt demo apps
-
-* Implement MMF::Backend::disconnectNodes
-This should probably be left for now, particularly until audio effects have been implemented. This is because the node connection mechanism may need to be refactored slightly once we start building up longer graphs (e.g. MediaObject -> Effect -> Effect -> AudioOutput).
-
-* Metadata is not implemented.
-
diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp
index aa2a94b..6c1fc68 100644
--- a/src/3rdparty/phonon/mmf/audioplayer.cpp
+++ b/src/3rdparty/phonon/mmf/audioplayer.cpp
@@ -101,7 +101,7 @@ int MMF::AudioPlayer::setDeviceVolume(int mmfVolume)
* stack by doing a runtime check of the SDK version. */
#if !defined(__SERIES60_31__)
const int err = m_player->SetVolume(mmfVolume);
- if (QSysInfo::s60Version() > QSysInfo::SV_S60_3_1)
+ if (QSysInfo::s60Version() >= QSysInfo::SV_S60_5_0)
return err;
else
return KErrNone;
diff --git a/src/3rdparty/phonon/mmf/mmf_medianode.cpp b/src/3rdparty/phonon/mmf/mmf_medianode.cpp
index b5ea91a..b60d6f4 100644
--- a/src/3rdparty/phonon/mmf/mmf_medianode.cpp
+++ b/src/3rdparty/phonon/mmf/mmf_medianode.cpp
@@ -49,7 +49,7 @@ bool MMF::MediaNode::disconnectMediaNode(MediaNode *target)
Q_UNUSED(target);
m_target = 0;
m_isApplied = false;
- return false;
+ return true;
}
void MMF::MediaNode::setSource(MediaNode *source)
diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
index 83d715d..c7fa791 100644
--- a/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
+++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.cpp
@@ -16,11 +16,12 @@ along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <QApplication> // for QApplication::activeWindow
#include <QUrl>
#include <QTimer>
#include <QWidget>
-#include <coemain.h> // For CCoeEnv
+#include <coemain.h> // for CCoeEnv
#include <coecntrl.h>
#include "mmf_videoplayer.h"
@@ -69,11 +70,8 @@ void MMF::VideoPlayer::construct()
TRACE_CONTEXT(VideoPlayer::VideoPlayer, EVideoApi);
TRACE_ENTRY_0();
- if (!m_videoOutput) {
- m_dummyVideoOutput.reset(new VideoOutput(0));
- }
-
- videoOutput().setObserver(this);
+ if(m_videoOutput)
+ m_videoOutput->setObserver(this);
const TInt priority = 0;
const TMdaPriorityPreference preference = EMdaPriorityPreferenceNone;
@@ -253,7 +251,8 @@ void MMF::VideoPlayer::MvpuoPrepareComplete(TInt aError)
if (KErrNone == err) {
maxVolumeChanged(m_player->MaxVolume());
- videoOutput().setFrameSize(m_frameSize);
+ if(m_videoOutput)
+ m_videoOutput->setFrameSize(m_frameSize);
// See comment in updateMmfOutput
if(m_mmfOutputChangePending) {
@@ -339,6 +338,38 @@ void MMF::VideoPlayer::videoOutputRegionChanged()
TRACE_EXIT_0();
}
+// DEBUGGING *** DO NOT INTEGRATE ***
+class CDummyAO : public CActive
+{
+public:
+ CDummyAO() : CActive(CActive::EPriorityStandard) { CActiveScheduler::Add(this); }
+ void RunL() { }
+ void DoCancel() { }
+ TRequestStatus& Status() { return iStatus; }
+ void SetActive() { CActive::SetActive(); }
+};
+
+// DEBUGGING *** DO NOT INTEGRATE ***
+void getDsaRegion(RWsSession &session, const RWindowBase &window)
+{
+ RDirectScreenAccess dsa(session);
+ TInt err = dsa.Construct();
+ CDummyAO ao;
+ RRegion* region;
+ err = dsa.Request(region, ao.Status(), window);
+ ao.SetActive();
+ dsa.Close();
+ ao.Cancel();
+ if(region) {
+ qDebug() << "Phonon::MMF::getDsaRegion count" << region->Count();
+ for(int i=0; i<region->Count(); ++i) {
+ const TRect& rect = region->RectangleList()[i];
+ qDebug() << "Phonon::MMF::getDsaRegion rect" << rect.iTl.iX << rect.iTl.iY << rect.iBr.iX << rect.iBr.iY;
+ }
+ region->Close();
+ }
+}
+
void MMF::VideoPlayer::updateMmfOutput()
{
TRACE_CONTEXT(VideoPlayer::updateMmfOutput, EVideoInternal);
@@ -351,13 +382,10 @@ void MMF::VideoPlayer::updateMmfOutput()
// MvpuoPrepareComplete, at which point the MMF controller has been
// loaded.
- // TODO: check whether videoOutput is visible? If not, then the
- // corresponding window will not be active, meaning that the
- // clipping region will be set to empty and the video will not be
- // visible. If this is the case, we should set m_mmfOutputChangePending
- // and respond to future showEvents from the videoOutput widget.
-
getNativeWindowSystemHandles();
+
+// DEBUGGING *** DO NOT INTEGRATE ***
+getDsaRegion(*m_wsSession, *m_window);
TRAPD(err,
m_player->SetDisplayWindowL
@@ -383,28 +411,16 @@ void MMF::VideoPlayer::updateMmfOutput()
// Private functions
//-----------------------------------------------------------------------------
-VideoOutput& MMF::VideoPlayer::videoOutput()
-{
- TRACE_CONTEXT(VideoPlayer::videoOutput, EVideoInternal);
- TRACE("videoOutput 0x%08x dummy 0x%08x", m_videoOutput, m_dummyVideoOutput.data());
-
- return m_videoOutput ? *m_videoOutput : *m_dummyVideoOutput;
-}
-
void MMF::VideoPlayer::videoOutputChanged()
{
TRACE_CONTEXT(VideoPlayer::videoOutputChanged, EVideoInternal);
TRACE_ENTRY_0();
- // Lazily construct a dummy output if needed here
- if (!m_videoOutput and m_dummyVideoOutput.isNull()) {
- m_dummyVideoOutput.reset(new VideoOutput(0));
+ if(m_videoOutput) {
+ m_videoOutput->setObserver(this);
+ m_videoOutput->setFrameSize(m_frameSize);
}
- videoOutput().setObserver(this);
-
- videoOutput().setFrameSize(m_frameSize);
-
videoOutputRegionChanged();
TRACE_EXIT_0();
@@ -414,9 +430,15 @@ void MMF::VideoPlayer::getNativeWindowSystemHandles()
{
TRACE_CONTEXT(VideoPlayer::getNativeWindowSystemHandles, EVideoInternal);
TRACE_ENTRY_0();
-
- VideoOutput& output = videoOutput();
- CCoeControl* const control = output.winId();
+
+ CCoeControl *control = 0;
+
+ if(m_videoOutput)
+ // Create native window
+ control = m_videoOutput->winId();
+ else
+ // Get top-level window
+ control = QApplication::activeWindow()->effectiveWinId();
CCoeEnv* const coeEnv = control->ControlEnv();
m_wsSession = &(coeEnv->WsSession());
@@ -424,18 +446,29 @@ void MMF::VideoPlayer::getNativeWindowSystemHandles()
m_window = control->DrawableWindow();
#ifdef _DEBUG
- QScopedPointer<ObjectDump::QDumper> dumper(new ObjectDump::QDumper);
- dumper->setPrefix("Phonon::MMF"); // to aid searchability of logs
- ObjectDump::addDefaultAnnotators(*dumper);
- TRACE_0("Dumping VideoOutput:");
- dumper->dumpObject(output);
+ if(m_videoOutput) {
+ QScopedPointer<ObjectDump::QDumper> dumper(new ObjectDump::QDumper);
+ dumper->setPrefix("Phonon::MMF"); // to aid searchability of logs
+ ObjectDump::addDefaultAnnotators(*dumper);
+ TRACE_0("Dumping VideoOutput:");
+ dumper->dumpObject(*m_videoOutput);
+ }
+ else {
+ TRACE_0("m_videoOutput is null - dumping top-level control info:");
+ TRACE("control %08x", control);
+ TRACE("control.parent %08x", control->Parent());
+ TRACE("control.isVisible %d", control->IsVisible());
+ TRACE("control.rect %d,%d %dx%d",
+ control->Position().iX, control->Position().iY,
+ control->Size().iWidth, control->Size().iHeight);
+ TRACE("control.ownsWindow %d", control->OwnsWindow());
+ }
#endif
m_windowRect = TRect(
control->DrawableWindow()->AbsPosition(),
control->DrawableWindow()->Size());
-
- m_clipRect = m_windowRect;
+ m_clipRect = m_windowRect;
TRACE("windowRect %d %d - %d %d",
m_windowRect.iTl.iX, m_windowRect.iTl.iY,
diff --git a/src/3rdparty/phonon/mmf/mmf_videoplayer.h b/src/3rdparty/phonon/mmf/mmf_videoplayer.h
index a805135..ee3650a 100644
--- a/src/3rdparty/phonon/mmf/mmf_videoplayer.h
+++ b/src/3rdparty/phonon/mmf/mmf_videoplayer.h
@@ -75,7 +75,6 @@ public:
private:
void construct();
- VideoOutput& videoOutput();
void doPrepareCompleteL(TInt aError);
@@ -87,7 +86,6 @@ private:
private:
QScopedPointer<CVideoPlayerUtility> m_player;
- QScopedPointer<VideoOutput> m_dummyVideoOutput;
// Not owned
RWsSession* m_wsSession;
diff --git a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp
index f8adcd5..5ae10f9 100644
--- a/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp
+++ b/src/3rdparty/phonon/mmf/mmfphonondebug/objectdump_symbian.cpp
@@ -82,9 +82,10 @@ QList<QByteArray> QAnnotatorWindow::annotation(const QObject& object)
// ClientHandle() is available first in 5.0.
#if !defined(__SERIES60_31__) && !defined(__S60_32__)
- // Client-side window handle
- // Cast to a void pointer so that log output is in hexadecimal format.
- stream << "cli " << reinterpret_cast<const void*>(window.ClientHandle()) << ' ';
+ if (QSysInfo::s60Version() > QSysInfo::SV_S60_3_2)
+ // Client-side window handle
+ // Cast to a void pointer so that log output is in hexadecimal format.
+ stream << "cli " << reinterpret_cast<const void*>(window.ClientHandle()) << ' ';
#endif
// Server-side address of CWsWindow object
@@ -104,7 +105,9 @@ QList<QByteArray> QAnnotatorWindow::annotation(const QObject& object)
stream << window.Size().iWidth << 'x' << window.Size().iHeight << ' ';
const TDisplayMode displayMode = window.DisplayMode();
- stream << "mode " << displayMode;
+ stream << "mode " << displayMode << ' ';
+
+ stream << "ord " << window.OrdinalPosition();
stream.flush();
result.append(array);
diff --git a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
index 73791e0..d8b6f4b 100644
--- a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
+++ b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri
@@ -36,6 +36,8 @@ GENERATED_SOURCES_DIR_SLASH = $${GENERATED_SOURCES_DIR}$${QMAKE_DIR_SEP}
win32-* {
LIBS += -lwinmm
}
+contains(JAVASCRIPTCORE_JIT,yes): DEFINES+=ENABLE_JIT=1
+contains(JAVASCRIPTCORE_JIT,no): DEFINES+=ENABLE_JIT=0
# In debug mode JIT disabled until crash fixed
win32-* {
diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_class.h b/src/3rdparty/webkit/WebCore/bridge/qt/qt_class.h
index 19d4207..dc6b130 100644
--- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_class.h
+++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_class.h
@@ -26,7 +26,7 @@
QT_BEGIN_NAMESPACE
class QObject;
-class QMetaObject;
+struct QMetaObject;
QT_END_NAMESPACE
namespace JSC {
diff --git a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp
index 23eef11..3cb2156 100644
--- a/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp
+++ b/src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.cpp
@@ -1339,7 +1339,7 @@ void QtRuntimeMetaMethod::markChildren(MarkStack& markStack)
markStack.append(d->m_disconnect);
}
-JSValue QtRuntimeMetaMethod::call(ExecState* exec, JSObject* functionObject, JSValue thisValue, const ArgList& args)
+JSValue QtRuntimeMetaMethod::call(ExecState* exec, JSObject* functionObject, JSValue, const ArgList& args)
{
QtRuntimeMetaMethodData* d = static_cast<QtRuntimeMetaMethod *>(functionObject)->d_func();
@@ -1437,7 +1437,7 @@ QtRuntimeConnectionMethod::QtRuntimeConnectionMethod(ExecState* exec, const Iden
d->m_isConnect = isConnect;
}
-JSValue QtRuntimeConnectionMethod::call(ExecState* exec, JSObject* functionObject, JSValue thisValue, const ArgList& args)
+JSValue QtRuntimeConnectionMethod::call(ExecState* exec, JSObject* functionObject, JSValue, const ArgList& args)
{
QtRuntimeConnectionMethodData* d = static_cast<QtRuntimeConnectionMethod *>(functionObject)->d_func();
diff --git a/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp b/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp
index f745830..04405d6 100644
--- a/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp
+++ b/src/3rdparty/webkit/WebCore/dom/XMLTokenizerQt.cpp
@@ -238,7 +238,7 @@ void XMLTokenizer::doWrite(const String& parseString)
return;
}
-void XMLTokenizer::initializeParserContext(const char* chunk)
+void XMLTokenizer::initializeParserContext(const char*)
{
m_parserStopped = false;
m_sawError = false;
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp
index aa79cb9..1113eae 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontCacheQt.cpp
@@ -48,7 +48,7 @@ FontCache::FontCache()
{
}
-void FontCache::getTraitsInFamily(const AtomicString& familyName, Vector<unsigned>& traitsMasks)
+void FontCache::getTraitsInFamily(const AtomicString&, Vector<unsigned>&)
{
}
@@ -177,7 +177,7 @@ typedef HashMap<FontPlatformDataCacheKey, FontPlatformData*, FontPlatformDataCac
// using Q_GLOBAL_STATIC leads to crash. TODO investigate the way to fix this.
static FontPlatformDataCache* gFontPlatformDataCache = 0;
-FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& description, const AtomicString& family, bool checkingAlternateName)
+FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& description, const AtomicString&, bool)
{
if (!gFontPlatformDataCache)
gFontPlatformDataCache = new FontPlatformDataCache;
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp
index c29fd56..8e1e4f6 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontFallbackListQt.cpp
@@ -130,7 +130,7 @@ const FontData* FontFallbackList::fontDataForCharacters(const WebCore::Font* fon
return primaryFontData(font);
}
-void FontFallbackList::setPlatformFont(const WebCore::FontPlatformData& platformData)
+void FontFallbackList::setPlatformFont(const WebCore::FontPlatformData&)
{
m_familyIndex = cAllFamiliesScanned;
}
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt.cpp
index e8eb923..c5960ac 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/FontQt.cpp
@@ -197,7 +197,7 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon
return w + run.padding();
}
-int Font::offsetForPositionForComplexText(const TextRun& run, int position, bool includePartialGlyphs) const
+int Font::offsetForPositionForComplexText(const TextRun& run, int position, bool) const
{
const QString string = fixSpacing(qstring(run));
QTextLayout layout(string, font());
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 2f367fa..094054b 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -860,7 +860,7 @@ void GraphicsContext::drawFocusRing(const Color& color)
p->setRenderHint(QPainter::Antialiasing, antiAlias);
}
-void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool printing)
+void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool)
{
if (paintingDisabled())
return;
@@ -869,8 +869,7 @@ void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool pr
drawLine(origin, endPoint);
}
-void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint&,
- int width, bool grammar)
+void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint&, int, bool)
{
if (paintingDisabled())
return;
@@ -887,7 +886,7 @@ FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& frect)
return FloatRect(QRectF(result));
}
-void GraphicsContext::setPlatformShadow(const IntSize& size, int blur, const Color &color)
+void GraphicsContext::setPlatformShadow(const IntSize& size, int, const Color&)
{
// Qt doesn't support shadows natively, they are drawn manually in the draw*
// functions
@@ -1198,7 +1197,7 @@ void GraphicsContext::concatCTM(const TransformationMatrix& transform)
}
}
-void GraphicsContext::setURLForRect(const KURL& link, const IntRect& destRect)
+void GraphicsContext::setURLForRect(const KURL&, const IntRect&)
{
notImplemented();
}
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/IconQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/IconQt.cpp
index 34c3c47..98f4606 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/IconQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/IconQt.cpp
@@ -47,7 +47,7 @@ PassRefPtr<Icon> Icon::createIconForFile(const String& filename)
return i.release();
}
-PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>& filenames)
+PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>&)
{
//FIXME: Implement this
return 0;
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp
index be32797..5255428 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageBufferQt.cpp
@@ -68,7 +68,7 @@ ImageBufferData::ImageBufferData(const IntSize& size)
painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
}
-ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace imageColorSpace, bool& success)
+ImageBuffer::ImageBuffer(const IntSize& size, ImageColorSpace, bool& success)
: m_data(size)
, m_size(size)
{
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
index bf6210b..8851984 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
@@ -301,7 +301,7 @@ String ImageDecoderQt::filenameExtension() const
return m_imageFormat;
};
-RGBA32Buffer* ImageDecoderQt::frameBufferAtIndex(size_t index)
+RGBA32Buffer* ImageDecoderQt::frameBufferAtIndex(size_t)
{
Q_ASSERT("use imageAtIndex instead");
return 0;
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
index 71c5cd4..f0d513c 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
@@ -150,7 +150,7 @@ void MediaPlayerPrivate::getSupportedTypes(HashSet<String>&)
notImplemented();
}
-MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String& type, const String& codecs)
+MediaPlayer::SupportsType MediaPlayerPrivate::supportsType(const String&, const String&)
{
// FIXME: do the real thing
notImplemented();
@@ -259,7 +259,7 @@ float MediaPlayerPrivate::currentTime() const
return currentTime;
}
-void MediaPlayerPrivate::setEndTime(float endTime)
+void MediaPlayerPrivate::setEndTime(float)
{
notImplemented();
}
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
index f823f84..f093d7d 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
@@ -33,7 +33,7 @@ void SimpleFontData::determinePitch()
m_treatAsFixedPitch = m_platformData.font().fixedPitch();
}
-bool SimpleFontData::containsCharacters(const UChar*, int length) const
+bool SimpleFontData::containsCharacters(const UChar*, int) const
{
return true;
}
diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/qt/StillImageQt.h b/src/3rdparty/webkit/WebCore/platform/graphics/qt/StillImageQt.h
index 2b2c1f7..6c417b1 100644
--- a/src/3rdparty/webkit/WebCore/platform/graphics/qt/StillImageQt.h
+++ b/src/3rdparty/webkit/WebCore/platform/graphics/qt/StillImageQt.h
@@ -41,7 +41,7 @@ namespace WebCore {
// FIXME: StillImages are underreporting decoded sizes and will be unable
// to prune because these functions are not implemented yet.
- virtual void destroyDecodedData(bool destroyAll = true) { }
+ virtual void destroyDecodedData(bool destroyAll = true) { Q_UNUSED(destroyAll); }
virtual unsigned decodedSize() const { return 0; }
virtual IntSize size() const;
diff --git a/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h b/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h
index e85d2dc..0d98fcb 100644
--- a/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h
+++ b/src/3rdparty/webkit/WebCore/platform/network/qt/DnsPrefetchHelper.h
@@ -56,7 +56,7 @@ namespace WebCore {
}
}
- void lookedUp(const QHostInfo &host)
+ void lookedUp(const QHostInfo&)
{
// we do not cache the result, we throw it away.
// we currently rely on the OS to cache the results. If it does not do that
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/ContextMenuQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/ContextMenuQt.cpp
index 063a46b..9b1a054 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/ContextMenuQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/ContextMenuQt.cpp
@@ -61,7 +61,7 @@ void ContextMenu::insertItem(unsigned position, ContextMenuItem& item)
m_items.insert(position, item);
}
-void ContextMenu::setPlatformDescription(PlatformMenuDescription menu)
+void ContextMenu::setPlatformDescription(PlatformMenuDescription)
{
// doesn't make sense
}
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/DragDataQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/DragDataQt.cpp
index c8c0be1..b0611e6 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/DragDataQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/DragDataQt.cpp
@@ -119,7 +119,7 @@ bool DragData::containsURL() const
return m_platformDragData->hasUrls();
}
-String DragData::asURL(String* title) const
+String DragData::asURL(String*) const
{
if (!m_platformDragData)
return String();
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp
index 9ce5838..b44f2ec 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp
@@ -60,7 +60,7 @@ void PopupMenu::clear()
m_popup->clear();
}
-void PopupMenu::populate(const IntRect& r)
+void PopupMenu::populate(const IntRect&)
{
clear();
Q_ASSERT(client());
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
index f250047..f505d0c 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/RenderThemeQt.cpp
@@ -172,7 +172,7 @@ bool RenderThemeQt::supportsHover(const RenderStyle*) const
return true;
}
-bool RenderThemeQt::supportsFocusRing(const RenderStyle* style) const
+bool RenderThemeQt::supportsFocusRing(const RenderStyle*) const
{
return true; // Qt provides this through the style
}
@@ -274,7 +274,7 @@ Color RenderThemeQt::platformInactiveSelectionForegroundColor() const
return pal.brush(QPalette::Inactive, QPalette::HighlightedText).color();
}
-void RenderThemeQt::systemFont(int propId, FontDescription& fontDescription) const
+void RenderThemeQt::systemFont(int, FontDescription&) const
{
// no-op
}
@@ -387,7 +387,7 @@ bool RenderThemeQt::paintRadio(RenderObject* o, const RenderObject::PaintInfo& i
return paintButton(o, i, r);
}
-void RenderThemeQt::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element* e) const
+void RenderThemeQt::adjustButtonStyle(CSSStyleSelector* selector, RenderStyle* style, Element*) const
{
// Ditch the border.
style->resetBorder();
@@ -584,8 +584,7 @@ bool RenderThemeQt::paintMenuList(RenderObject* o, const RenderObject::PaintInfo
return false;
}
-void RenderThemeQt::adjustMenuListButtonStyle(CSSStyleSelector* selector, RenderStyle* style,
- Element* e) const
+void RenderThemeQt::adjustMenuListButtonStyle(CSSStyleSelector*, RenderStyle* style, Element*) const
{
// WORKAROUND because html.css specifies -webkit-border-radius for <select> so we override it here
// see also http://bugs.webkit.org/show_bug.cgi?id=18399
@@ -887,13 +886,13 @@ bool RenderThemeQt::paintMediaPlayButton(RenderObject* o, const RenderObject::Pa
return false;
}
-bool RenderThemeQt::paintMediaSeekBackButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeQt::paintMediaSeekBackButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&)
{
// We don't want to paint this at the moment.
return false;
}
-bool RenderThemeQt::paintMediaSeekForwardButton(RenderObject* o, const RenderObject::PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeQt::paintMediaSeekForwardButton(RenderObject*, const RenderObject::PaintInfo&, const IntRect&)
{
// We don't want to paint this at the moment.
return false;
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp
index 48885d3..ccbd751 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/ScrollViewQt.cpp
@@ -53,7 +53,7 @@ void ScrollView::adjustWidgetsPreventingBlittingCount(int delta)
parent()->adjustWidgetsPreventingBlittingCount(delta);
}
-void ScrollView::platformAddChild(Widget* child)
+void ScrollView::platformAddChild(Widget*)
{
adjustWidgetsPreventingBlittingCount(1);
}
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/SearchPopupMenuQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/SearchPopupMenuQt.cpp
index 7822b2c..187a5de 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/SearchPopupMenuQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/SearchPopupMenuQt.cpp
@@ -29,11 +29,11 @@ SearchPopupMenu::SearchPopupMenu(PopupMenuClient* client)
{
}
-void SearchPopupMenu::saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems)
+void SearchPopupMenu::saveRecentSearches(const AtomicString&, const Vector<String>&)
{
}
-void SearchPopupMenu::loadRecentSearches(const AtomicString& name, Vector<String>& searchItems)
+void SearchPopupMenu::loadRecentSearches(const AtomicString&, Vector<String>&)
{
}
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp b/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp
index d37d412..814f961 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/TemporaryLinkStubs.cpp
@@ -100,7 +100,7 @@ void getSupportedKeySizes(Vector<String>&)
notImplemented();
}
-String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url)
+String signedPublicKeyAndChallengeString(unsigned, const String&, const KURL&)
{
return String();
}
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/WidgetQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/WidgetQt.cpp
index 4e82080..e9c99a4 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/WidgetQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/WidgetQt.cpp
@@ -101,7 +101,7 @@ void Widget::hide()
platformWidget()->hide();
}
-void Widget::paint(GraphicsContext *, const IntRect &rect)
+void Widget::paint(GraphicsContext*, const IntRect&)
{
}
diff --git a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp
index 9fada0e..6d27e20 100644
--- a/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp
+++ b/src/3rdparty/webkit/WebCore/xml/XSLStyleSheetQt.cpp
@@ -83,12 +83,12 @@ void XSLStyleSheet::loadChildSheets()
notImplemented();
}
-void XSLStyleSheet::loadChildSheet(const String& href)
+void XSLStyleSheet::loadChildSheet(const String&)
{
notImplemented();
}
-void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet* parent)
+void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet*)
{
notImplemented();
}
diff --git a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp
index 523306a..50ee427 100644
--- a/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp
+++ b/src/3rdparty/webkit/WebCore/xml/XSLTProcessorQt.cpp
@@ -60,7 +60,7 @@ XSLTMessageHandler::XSLTMessageHandler(Document* document)
}
void XSLTMessageHandler::handleMessage(QtMsgType type, const QString& description,
- const QUrl& identifier, const QSourceLocation& sourceLocation)
+ const QUrl&, const QSourceLocation& sourceLocation)
{
if (!m_document->frame())
return;
@@ -87,7 +87,7 @@ void XSLTMessageHandler::handleMessage(QtMsgType type, const QString& descriptio
sourceLocation.line(), sourceLocation.uri().toString());
}
-bool XSLTProcessor::transformToString(Node* sourceNode, String& mimeType, String& resultString, String& resultEncoding)
+bool XSLTProcessor::transformToString(Node* sourceNode, String&, String& resultString, String&)
{
bool success = false;
diff --git a/src/3rdparty/webkit/WebKit.pri b/src/3rdparty/webkit/WebKit.pri
index ded4701..fd918c9 100644
--- a/src/3rdparty/webkit/WebKit.pri
+++ b/src/3rdparty/webkit/WebKit.pri
@@ -48,7 +48,7 @@ symbian|*-armcc {
RVCT_COMMON_CFLAGS = --gnu --diag_suppress 68,111,177,368,830,1293
RVCT_COMMON_CXXFLAGS = $$RVCT_COMMON_CFLAGS --no_parse_templates
DEFINES *= QT_NO_UITOOLS
-}
+}
*-armcc {
QMAKE_CFLAGS += $$RVCT_COMMON_CFLAGS
@@ -63,7 +63,7 @@ contains(DEFINES, QT_NO_UITOOLS): CONFIG -= uitools
# Disable a few warnings on Windows. The warnings are also
# disabled in WebKitLibraries/win/tools/vsprops/common.vsprops
-win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4503 -wd4800 -wd4819 -wd4996
+win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4396 -wd4503 -wd4800 -wd4819 -wd4996
#
# For builds inside Qt we interpret the output rule and the input of each extra compiler manually
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
index d8d9d64..2a0ee20 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qgraphicswebview.cpp
@@ -392,7 +392,8 @@ void QGraphicsWebView::setGeometry(const QRectF& rect)
}
/*!
- \brief The load status message associated to the web graphicsitem
+ \property QGraphicsWebView::status
+ \brief the load status message.
Provides the latest status message set during the load of a URL.
Commonly shown by Status Bar widgets.
@@ -492,14 +493,15 @@ void QGraphicsWebView::load(const QNetworkRequest& request,
}
/*!
- Sets the content of the web graphicsitem to the specified \a html.
+ \property QGraphicsWebView::html
+ This property provides an HTML interface to the text in the webview.
- External objects such as stylesheets or images referenced in the HTML
- document are located relative to \a baseUrl.
+ When setting this property, external objects such as stylesheets or images
+ referenced in the HTML document are located relative to \a baseUrl.
The \a html is loaded immediately; external objects are loaded asynchronously.
- When using this method, WebKit assumes that external resources such as
+ When using these methods, WebKit assumes that external resources such as
JavaScript programs or style sheets are encoded in UTF-8 unless otherwise
specified. For example, the encoding of an external script can be specified
through the charset attribute of the HTML script tag. Alternatively, the
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
index fe813b8..780f862 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp
@@ -873,6 +873,7 @@ int QWebFrame::scrollBarMaximum(Qt::Orientation orientation) const
*/
int QWebFrame::scrollBarMinimum(Qt::Orientation orientation) const
{
+ Q_UNUSED(orientation)
return 0;
}
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 942c3ea..655fd0e 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -967,7 +967,7 @@ void QWebPagePrivate::keyReleaseEvent(QKeyEvent *ev)
ev->setAccepted(handled);
}
-void QWebPagePrivate::focusInEvent(QFocusEvent *ev)
+void QWebPagePrivate::focusInEvent(QFocusEvent*)
{
FocusController *focusController = page->focusController();
Frame *frame = focusController->focusedFrame();
@@ -978,7 +978,7 @@ void QWebPagePrivate::focusInEvent(QFocusEvent *ev)
focusController->setFocusedFrame(QWebFramePrivate::core(mainFrame));
}
-void QWebPagePrivate::focusOutEvent(QFocusEvent *ev)
+void QWebPagePrivate::focusOutEvent(QFocusEvent*)
{
// only set the focused frame inactive so that we stop painting the caret
// and the focus frame. But don't tell the focus controller so that upon
@@ -1082,7 +1082,7 @@ void QWebPagePrivate::dropEvent(QDropEvent* ev)
#endif
}
-void QWebPagePrivate::leaveEvent(QEvent *ev)
+void QWebPagePrivate::leaveEvent(QEvent*)
{
// Fake a mouse move event just outside of the widget, since all
// the interesting mouse-out behavior like invalidating scrollbars
@@ -1722,6 +1722,7 @@ void QWebPage::javaScriptConsoleMessage(const QString& message, int lineNumber,
*/
void QWebPage::javaScriptAlert(QWebFrame *frame, const QString& msg)
{
+ Q_UNUSED(frame)
#ifndef QT_NO_MESSAGEBOX
QMessageBox::information(d->view, tr("JavaScript Alert - %1").arg(mainFrame()->url().host()), msg, QMessageBox::Ok);
#endif
@@ -1735,6 +1736,7 @@ void QWebPage::javaScriptAlert(QWebFrame *frame, const QString& msg)
*/
bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg)
{
+ Q_UNUSED(frame)
#ifdef QT_NO_MESSAGEBOX
return true;
#else
@@ -1753,6 +1755,7 @@ bool QWebPage::javaScriptConfirm(QWebFrame *frame, const QString& msg)
*/
bool QWebPage::javaScriptPrompt(QWebFrame *frame, const QString& msg, const QString& defaultValue, QString* result)
{
+ Q_UNUSED(frame)
bool ok = false;
#ifndef QT_NO_INPUTDIALOG
QString x = QInputDialog::getText(d->view, tr("JavaScript Prompt - %1").arg(mainFrame()->url().host()), msg, QLineEdit::Normal, defaultValue, &ok);
@@ -1846,7 +1849,7 @@ static void openNewWindow(const QUrl& url, WebCore::Frame* frame)
\sa action()
*/
-void QWebPage::triggerAction(WebAction action, bool checked)
+void QWebPage::triggerAction(WebAction action, bool)
{
WebCore::Frame *frame = d->page->focusController()->focusedOrMainFrame();
if (!frame)
@@ -2032,6 +2035,7 @@ bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &
bool QWebPage::acceptNavigationRequest(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type)
#endif
{
+ Q_UNUSED(frame)
if (type == NavigationTypeLinkClicked) {
switch (d->linkPolicy) {
case DontDelegateLinks:
@@ -2805,6 +2809,7 @@ QWebSettings *QWebPage::settings() const
*/
QString QWebPage::chooseFile(QWebFrame *parentFrame, const QString& suggestedFile)
{
+ Q_UNUSED(parentFrame)
#ifndef QT_NO_FILEDIALOG
return QFileDialog::getOpenFileName(d->view, QString::null, suggestedFile);
#else
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
index c7515ab..3c5f89f 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.cpp
@@ -650,6 +650,7 @@ qreal QWebView::textSizeMultiplier() const
return page()->mainFrame()->textSizeMultiplier();
}
+#if !defined(Q_OS_SYMBIAN)
/*!
\property QWebView::renderHints
\since 4.6
@@ -661,6 +662,7 @@ qreal QWebView::textSizeMultiplier() const
\sa QPainter::renderHints()
*/
+#endif
QPainter::RenderHints QWebView::renderHints() const
{
return d->renderHints;
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
index 0f2649d..15b5836 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebview.h
@@ -53,6 +53,7 @@ class QWEBKIT_EXPORT QWebView : public QWidget {
// FIXME: temporary work around for elftran issue that it couldn't find the QPainter::staticMetaObject
// symbol from Qt lib; it should be reverted after the right symbol is exported.
+// remember to revert the qdoc \property comment as well.
// See bug: http://qt.nokia.com/developer/task-tracker/index_html?method=entry&id=258893
#if !defined(Q_OS_SYMBIAN)
Q_PROPERTY(QPainter::RenderHints renderHints READ renderHints WRITE setRenderHints)
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index 5c65112..26cf6f6 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -305,7 +305,7 @@ IntRect ChromeClientQt::windowResizerRect() const
return IntRect();
}
-void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, bool immediate, bool repaintContentOnly)
+void ChromeClientQt::repaint(const IntRect& windowRect, bool contentChanged, bool, bool)
{
// No double buffer, so only update the QWidget if content changed.
if (contentChanged) {
@@ -351,7 +351,7 @@ void ChromeClientQt::contentsSizeChanged(Frame* frame, const IntSize& size) cons
emit QWebFramePrivate::kit(frame)->contentsSizeChanged(size);
}
-void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsigned modifierFlags)
+void ChromeClientQt::mouseDidMoveOverElement(const HitTestResult& result, unsigned)
{
TextDirection dir;
if (result.absoluteLinkURL() != lastHoverURL
@@ -402,7 +402,7 @@ void ChromeClientQt::exceededDatabaseQuota(Frame* frame, const String& databaseN
#endif
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
-void ChromeClientQt::reachedMaxAppCacheSize(int64_t spaceNeeded)
+void ChromeClientQt::reachedMaxAppCacheSize(int64_t)
{
// FIXME: Free some space.
notImplemented();
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp
index ed79946..b4400ff 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/ContextMenuClientQt.cpp
@@ -52,7 +52,7 @@ void ContextMenuClientQt::contextMenuItemSelected(ContextMenuItem*, const Contex
notImplemented();
}
-void ContextMenuClientQt::downloadURL(const KURL& url)
+void ContextMenuClientQt::downloadURL(const KURL&)
{
notImplemented();
}
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index 67d974c..905e11d 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -282,9 +282,7 @@ void FrameLoaderClientQt::dispatchDidCancelClientRedirect()
}
-void FrameLoaderClientQt::dispatchWillPerformClientRedirect(const KURL& url,
- double interval,
- double fireDate)
+void FrameLoaderClientQt::dispatchWillPerformClientRedirect(const KURL& url, double, double)
{
if (dumpFrameLoaderCallbacks)
printf("%s - willPerformClientRedirectToURL: %s \n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), qPrintable(drtDescriptionSuitableForTestResult(url)));
@@ -464,7 +462,7 @@ void FrameLoaderClientQt::postProgressFinishedNotification()
emit loadFinished(m_loadError.isNull());
}
-void FrameLoaderClientQt::setMainFrameDocumentReady(bool b)
+void FrameLoaderClientQt::setMainFrameDocumentReady(bool)
{
// this is only interesting once we provide an external API for the DOM
}
@@ -514,13 +512,13 @@ bool FrameLoaderClientQt::canShowMIMEType(const String& MIMEType) const
return false;
}
-bool FrameLoaderClientQt::representationExistsForURLScheme(const String& URLScheme) const
+bool FrameLoaderClientQt::representationExistsForURLScheme(const String&) const
{
return false;
}
-String FrameLoaderClientQt::generatedMIMETypeForURLScheme(const String& URLScheme) const
+String FrameLoaderClientQt::generatedMIMETypeForURLScheme(const String&) const
{
notImplemented();
return String();
@@ -632,7 +630,7 @@ void FrameLoaderClientQt::updateGlobalHistoryRedirectLinks()
{
}
-bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *item) const
+bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *) const
{
return true;
}
@@ -750,7 +748,7 @@ WebCore::ResourceError FrameLoaderClientQt::fileDoesNotExistError(const WebCore:
QCoreApplication::translate("QWebFrame", "File does not exist", 0, QCoreApplication::UnicodeUTF8));
}
-WebCore::ResourceError FrameLoaderClientQt::pluginWillHandleLoadError(const WebCore::ResourceResponse& response)
+WebCore::ResourceError FrameLoaderClientQt::pluginWillHandleLoadError(const WebCore::ResourceResponse&)
{
notImplemented();
return ResourceError();
@@ -788,7 +786,7 @@ void FrameLoaderClientQt::download(WebCore::ResourceHandle* handle, const WebCor
#endif
}
-void FrameLoaderClientQt::assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader* loader, const WebCore::ResourceRequest& request)
+void FrameLoaderClientQt::assignIdentifierToInitialRequest(unsigned long identifier, WebCore::DocumentLoader*, const WebCore::ResourceRequest& request)
{
if (dumpResourceLoadCallbacks)
dumpAssignedUrls[identifier] = drtDescriptionSuitableForTestResult(request.url());
@@ -835,7 +833,7 @@ void FrameLoaderClientQt::dispatchDidReceiveContentLength(WebCore::DocumentLoade
{
}
-void FrameLoaderClientQt::dispatchDidFinishLoading(WebCore::DocumentLoader* loader, unsigned long)
+void FrameLoaderClientQt::dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long)
{
}
@@ -1206,8 +1204,8 @@ void FrameLoaderClientQt::redirectDataToPlugin(Widget* pluginWidget)
m_hasSentResponseToPlugin = false;
}
-PassRefPtr<Widget> FrameLoaderClientQt::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL,
- const Vector<String>& paramNames, const Vector<String>& paramValues)
+PassRefPtr<Widget> FrameLoaderClientQt::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL&,
+ const Vector<String>&, const Vector<String>&)
{
notImplemented();
return 0;
diff --git a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
index 340325e..3931a85 100644
--- a/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp
@@ -138,12 +138,12 @@ void InspectorClientQt::detachWindow()
notImplemented();
}
-void InspectorClientQt::setAttachedWindowHeight(unsigned height)
+void InspectorClientQt::setAttachedWindowHeight(unsigned)
{
notImplemented();
}
-void InspectorClientQt::highlight(Node* node)
+void InspectorClientQt::highlight(Node*)
{
notImplemented();
}
@@ -205,7 +205,7 @@ void InspectorClientQt::storeSetting(const String& key, const InspectorControlle
qsettings.setValue(settingKey + settingStorageTypeSuffix, QVariant::typeToName(valueToStore.type()));
}
-void InspectorClientQt::removeSetting(const String& key)
+void InspectorClientQt::removeSetting(const String&)
{
notImplemented();
}
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index f92c22d..6bbd801 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -83,7 +83,7 @@
updateCurrentTime(). The duration() function lets you report a
duration for the animation (as discussed above). The animation
framework calls updateCurrentTime() when current time has changed.
- By reimplementing this function, you can track the animation
+ By reimplementing this function, you can track the animation
progress. Note that neither the interval between calls nor the
number of calls to this function are defined; though, it will
normally be 60 updates per second.
@@ -228,15 +228,16 @@ void QUnifiedTimer::timerEvent(QTimerEvent *event)
void QUnifiedTimer::registerAnimation(QAbstractAnimation *animation)
{
- if (animations.contains(animation) || animationsToStart.contains(animation))
- return;
+ Q_ASSERT(!QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer);
+ QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer = true;
animationsToStart << animation;
- startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, this); // we delay the check if we should start/stop the global timer
+ startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, this);
}
void QUnifiedTimer::unregisterAnimation(QAbstractAnimation *animation)
{
- Q_ASSERT(animations.count(animation) + animationsToStart.count(animation) <= 1);
+ if (!QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer)
+ return;
int idx = animations.indexOf(animation);
if (idx != -1) {
@@ -244,13 +245,14 @@ void QUnifiedTimer::unregisterAnimation(QAbstractAnimation *animation)
// this is needed if we unregister an animation while its running
if (idx <= currentAnimationIdx)
--currentAnimationIdx;
+ if (animations.isEmpty())
+ startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, this);
} else {
animationsToStart.removeOne(animation);
}
- startStopAnimationTimer.start(STARTSTOP_TIMER_DELAY, this); // we delay the check if we should start/stop the global timer
+ QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer = false;
}
-
void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
{
Q_Q(QAbstractAnimation);
@@ -326,7 +328,6 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState)
}
break;
}
-
}
/*!
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index 20868f9..1a79f40 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -75,6 +75,7 @@ public:
currentTime(0),
loopCount(1),
currentLoop(0),
+ hasRegisteredTimer(false),
group(0)
{
}
@@ -96,6 +97,8 @@ public:
int loopCount;
int currentLoop;
+ bool hasRegisteredTimer;
+
QAnimationGroup *group;
private:
@@ -137,7 +140,10 @@ protected:
void timerEvent(QTimerEvent *);
private:
- QBasicTimer animationTimer, startStopAnimationTimer;
+ // timer used for all active animations
+ QBasicTimer animationTimer;
+ // timer used to delay the check if we should start/stop the global timer
+ QBasicTimer startStopAnimationTimer;
QTime time;
int lastTick;
int timingInterval;
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h
index a440606..9d76dcc 100644
--- a/src/corelib/global/qnamespace.h
+++ b/src/corelib/global/qnamespace.h
@@ -194,9 +194,9 @@ public:
};
enum TileRule {
- Stretch,
- Repeat,
- Round
+ StretchTile,
+ RepeatTile,
+ RoundTile
};
// Text formatting flags for QPainter::drawText and QLabel.
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 9106fa8..6f0b0ee 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -612,12 +612,6 @@
*/
/*!
- \enum Qt::CoordinateSystem
- \value DeviceCoordinates
- \value LogicalCoordinates
- */
-
-/*!
\enum Qt::CaseSensitivity
\value CaseInsensitive
@@ -1220,7 +1214,7 @@
touch device will be sent as mouse events.
\value WA_TouchPadAcceptSingleTouchEvents Allows touchpad single
- touch events to be sent to the widget.
+ touch events to be sent to the widget.
\value WA_DontUseStandardGestures Disables standard gestures on Qt widgets.
@@ -1241,7 +1235,7 @@
\omitvalue WA_PendingUpdate
\omitvalue WA_LaidOut
\omitvalue WA_GrabbedShortcut
- \omitvalue WA_DontShowOnScreen
+ \omitvalue WA_DontShowOnScreen
\omitvalue WA_InvalidSize
\omitvalue WA_ForceUpdatesDisabled
\omitvalue WA_NoX11EventCompression
@@ -1259,7 +1253,7 @@
/*! \typedef Qt::HANDLE
Platform-specific handle type for system objects. This is
- equivalent to \c{void *} on Mac OS X and embedded Linux,
+ equivalent to \c{void *} on Mac OS X and embedded Linux,
and to \c{unsigned long} on X11. On Windows it is the
DWORD returned by the Win32 function getCurrentThreadId().
@@ -2762,13 +2756,13 @@
This enum describes how to repeat or stretch the parts of an image
when drawing.
- \value Stretch Scale the image to fit to the available area.
+ \value StretchTile Scale the image to fit to the available area.
- \value Repeat Tile the image until there is no more space. May crop
- the last image.
+ \value RepeatTile Repeat the image until there is no more space. May
+ crop the last image.
- \value Round Like Repeat, but scales the images down to ensure that
- the last image is not cropped.
+ \value RoundTile Similar to Repeat, but scales the image down to
+ ensure that the last tile is not cropped.
*/
/*!
@@ -2812,13 +2806,13 @@
\value NavigationModeNone Only the touch screen is used.
\value NavigationModeKeypadTabOrder Qt::Key_Up and Qt::Key_Down are used to change focus.
\value NavigationModeKeypadDirectional Qt::Key_Up, Qt::Key_Down, Qt::Key_Left and Qt::Key_Right are used to change focus.
- \value NavigationModeCursorAuto The mouse cursor is used to change focus,
+ \value NavigationModeCursorAuto The mouse cursor is used to change focus,
it is displayed only on non touchscreen devices.
The keypad is used to implement a virtual cursor, unless
the device has an analog mouse type of input device (e.g. touchpad).
This is the recommended setting for an application such as a web browser that
needs pointer control on both touch and non-touch devices.
- \value NavigationModeCursorForceVisible The mouse cursor is used to change focus,
+ \value NavigationModeCursorForceVisible The mouse cursor is used to change focus,
it is displayed regardless of device type.
The keypad is used to implement a virtual cursor, unless
the device has an analog mouse type of input device (e.g. touchpad)
diff --git a/src/corelib/io/qdatastream.cpp b/src/corelib/io/qdatastream.cpp
index cc62201..19e86a6 100644
--- a/src/corelib/io/qdatastream.cpp
+++ b/src/corelib/io/qdatastream.cpp
@@ -442,7 +442,7 @@ QDataStream::FloatingPointPrecision QDataStream::floatingPointPrecision() const
}
/*!
- Sets the floating point precision of the data stream. If the floating point precision is
+ Sets the floating point precision of the data stream to \a precision. If the floating point precision is
DoublePrecision and the version of the data stream is Qt_4_6 or higher, all floating point
numbers will be written and read with 64-bit precision. If the floating point precision is
SinglePrecision and the version is Qt_4_6 or higher, all floating point numbers will be written
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 003693b..d0dad49 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -33,7 +33,8 @@ HEADERS += \
kernel/qsystemsemaphore.h \
kernel/qsystemsemaphore_p.h \
kernel/qfunctions_p.h \
- kernel/qguard_p.h
+ kernel/qguard_p.h \
+ kernel/qmath.h
SOURCES += \
kernel/qabstracteventdispatcher.cpp \
@@ -55,7 +56,8 @@ SOURCES += \
kernel/qcoreglobaldata.cpp \
kernel/qsharedmemory.cpp \
kernel/qsystemsemaphore.cpp \
- kernel/qpointer.cpp
+ kernel/qpointer.cpp \
+ kernel/qmath.cpp
win32 {
SOURCES += \
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 3bef0d4..744e6a9 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -192,8 +192,9 @@ QT_BEGIN_NAMESPACE
\value ShortcutOverride Key press in child, for overriding shortcut key handling (QKeyEvent).
\value Show Widget was shown on screen (QShowEvent).
\value ShowToParent A child widget has been shown.
- \value Signal A signal delivered to a state machine (QStateMachine::SignalEvent).
\value SockAct Socket activated, used to implement QSocketNotifier.
+ \value StateMachineSignal A signal delivered to a state machine (QStateMachine::SignalEvent).
+ \value StateMachineWrapped The event is a wrapper for, i.e., contains, another event (QStateMachine::WrappedEvent).
\value StatusTip A status tip is requested (QStatusTipEvent).
\value StyleChange Widget's style has been changed.
\value TabletMove Wacom tablet move (QTabletEvent).
@@ -221,7 +222,6 @@ QT_BEGIN_NAMESPACE
\value WindowStateChange The \l{QWidget::windowState()}{window's state} (minimized, maximized or full-screen) has changed (QWindowStateChangeEvent).
\value WindowTitleChange The window title has changed.
\value WindowUnblocked The window is unblocked after a modal dialog exited.
- \value Wrapped The event is a wrapper for, i.e., contains, another event (QStateMachine::WrappedEvent).
\value ZOrderChange The widget's z-order has changed. This event is never sent to top level windows.
\value KeyboardLayoutChange The keyboard layout has changed.
\value DynamicPropertyChange A dynamic property was added, changed or removed from the object.
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index be25b41..a039d32 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -269,8 +269,8 @@ public:
CocoaRequestModal = 190, // Internal for requesting an application modal Cocoa Window
MacGLClearDrawable = 191, // Internal Cocoa, the window has changed, so we must clear
- Signal = 192,
- Wrapped = 193,
+ StateMachineSignal = 192,
+ StateMachineWrapped = 193,
TouchBegin = 194,
TouchUpdate = 195,
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 0474bf3..aae351c 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -539,7 +539,7 @@ void QEventDispatcherWin32Private::registerTimer(WinTimerInfo *t)
int ok = 0;
- if (t->interval > 10 || !t->interval || !qtimeSetEvent) {
+ if (t->interval > 15 || !t->interval || !qtimeSetEvent) {
ok = 1;
if (!t->interval) // optimization for single-shot-zero-timer
QCoreApplication::postEvent(q, new QZeroTimerEvent(t->timerId));
diff --git a/src/corelib/kernel/qmath.cpp b/src/corelib/kernel/qmath.cpp
new file mode 100644
index 0000000..24bec4a
--- /dev/null
+++ b/src/corelib/kernel/qmath.cpp
@@ -0,0 +1,305 @@
+/****************************************************************************
+**
+** 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 QtCore 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/qmath.h>
+
+QT_BEGIN_NAMESPACE
+
+Q_CORE_EXPORT const qreal qt_sine_table[QT_SINE_TABLE_SIZE] = {
+ 0.0,
+ 0.024541228522912288,
+ 0.049067674327418015,
+ 0.073564563599667426,
+ 0.098017140329560604,
+ 0.1224106751992162,
+ 0.14673047445536175,
+ 0.17096188876030122,
+ 0.19509032201612825,
+ 0.2191012401568698,
+ 0.24298017990326387,
+ 0.26671275747489837,
+ 0.29028467725446233,
+ 0.31368174039889152,
+ 0.33688985339222005,
+ 0.35989503653498811,
+ 0.38268343236508978,
+ 0.40524131400498986,
+ 0.42755509343028208,
+ 0.44961132965460654,
+ 0.47139673682599764,
+ 0.49289819222978404,
+ 0.51410274419322166,
+ 0.53499761988709715,
+ 0.55557023301960218,
+ 0.57580819141784534,
+ 0.59569930449243336,
+ 0.61523159058062682,
+ 0.63439328416364549,
+ 0.65317284295377676,
+ 0.67155895484701833,
+ 0.68954054473706683,
+ 0.70710678118654746,
+ 0.72424708295146689,
+ 0.74095112535495911,
+ 0.75720884650648446,
+ 0.77301045336273699,
+ 0.78834642762660623,
+ 0.80320753148064483,
+ 0.81758481315158371,
+ 0.83146961230254524,
+ 0.84485356524970701,
+ 0.85772861000027212,
+ 0.87008699110871135,
+ 0.88192126434835494,
+ 0.89322430119551532,
+ 0.90398929312344334,
+ 0.91420975570353069,
+ 0.92387953251128674,
+ 0.93299279883473885,
+ 0.94154406518302081,
+ 0.94952818059303667,
+ 0.95694033573220894,
+ 0.96377606579543984,
+ 0.97003125319454397,
+ 0.97570213003852857,
+ 0.98078528040323043,
+ 0.98527764238894122,
+ 0.98917650996478101,
+ 0.99247953459870997,
+ 0.99518472667219682,
+ 0.99729045667869021,
+ 0.99879545620517241,
+ 0.99969881869620425,
+ 1.0,
+ 0.99969881869620425,
+ 0.99879545620517241,
+ 0.99729045667869021,
+ 0.99518472667219693,
+ 0.99247953459870997,
+ 0.98917650996478101,
+ 0.98527764238894122,
+ 0.98078528040323043,
+ 0.97570213003852857,
+ 0.97003125319454397,
+ 0.96377606579543984,
+ 0.95694033573220894,
+ 0.94952818059303667,
+ 0.94154406518302081,
+ 0.93299279883473885,
+ 0.92387953251128674,
+ 0.91420975570353069,
+ 0.90398929312344345,
+ 0.89322430119551521,
+ 0.88192126434835505,
+ 0.87008699110871146,
+ 0.85772861000027212,
+ 0.84485356524970723,
+ 0.83146961230254546,
+ 0.81758481315158371,
+ 0.80320753148064494,
+ 0.78834642762660634,
+ 0.7730104533627371,
+ 0.75720884650648468,
+ 0.74095112535495899,
+ 0.72424708295146689,
+ 0.70710678118654757,
+ 0.68954054473706705,
+ 0.67155895484701855,
+ 0.65317284295377664,
+ 0.63439328416364549,
+ 0.61523159058062693,
+ 0.59569930449243347,
+ 0.57580819141784545,
+ 0.55557023301960218,
+ 0.53499761988709715,
+ 0.51410274419322177,
+ 0.49289819222978415,
+ 0.47139673682599786,
+ 0.44961132965460687,
+ 0.42755509343028203,
+ 0.40524131400498992,
+ 0.38268343236508989,
+ 0.35989503653498833,
+ 0.33688985339222033,
+ 0.31368174039889141,
+ 0.29028467725446239,
+ 0.26671275747489848,
+ 0.24298017990326407,
+ 0.21910124015687005,
+ 0.19509032201612861,
+ 0.17096188876030122,
+ 0.1467304744553618,
+ 0.12241067519921635,
+ 0.098017140329560826,
+ 0.073564563599667732,
+ 0.049067674327417966,
+ 0.024541228522912326,
+ 0.0,
+ -0.02454122852291208,
+ -0.049067674327417724,
+ -0.073564563599667496,
+ -0.09801714032956059,
+ -0.1224106751992161,
+ -0.14673047445536158,
+ -0.17096188876030097,
+ -0.19509032201612836,
+ -0.2191012401568698,
+ -0.24298017990326382,
+ -0.26671275747489825,
+ -0.29028467725446211,
+ -0.31368174039889118,
+ -0.33688985339222011,
+ -0.35989503653498811,
+ -0.38268343236508967,
+ -0.40524131400498969,
+ -0.42755509343028181,
+ -0.44961132965460665,
+ -0.47139673682599764,
+ -0.49289819222978393,
+ -0.51410274419322155,
+ -0.53499761988709693,
+ -0.55557023301960196,
+ -0.57580819141784534,
+ -0.59569930449243325,
+ -0.61523159058062671,
+ -0.63439328416364527,
+ -0.65317284295377653,
+ -0.67155895484701844,
+ -0.68954054473706683,
+ -0.70710678118654746,
+ -0.72424708295146678,
+ -0.74095112535495888,
+ -0.75720884650648423,
+ -0.77301045336273666,
+ -0.78834642762660589,
+ -0.80320753148064505,
+ -0.81758481315158382,
+ -0.83146961230254524,
+ -0.84485356524970701,
+ -0.85772861000027201,
+ -0.87008699110871135,
+ -0.88192126434835494,
+ -0.89322430119551521,
+ -0.90398929312344312,
+ -0.91420975570353047,
+ -0.92387953251128652,
+ -0.93299279883473896,
+ -0.94154406518302081,
+ -0.94952818059303667,
+ -0.95694033573220882,
+ -0.96377606579543984,
+ -0.97003125319454397,
+ -0.97570213003852846,
+ -0.98078528040323032,
+ -0.98527764238894111,
+ -0.9891765099647809,
+ -0.99247953459871008,
+ -0.99518472667219693,
+ -0.99729045667869021,
+ -0.99879545620517241,
+ -0.99969881869620425,
+ -1.0,
+ -0.99969881869620425,
+ -0.99879545620517241,
+ -0.99729045667869021,
+ -0.99518472667219693,
+ -0.99247953459871008,
+ -0.9891765099647809,
+ -0.98527764238894122,
+ -0.98078528040323043,
+ -0.97570213003852857,
+ -0.97003125319454397,
+ -0.96377606579543995,
+ -0.95694033573220894,
+ -0.94952818059303679,
+ -0.94154406518302092,
+ -0.93299279883473907,
+ -0.92387953251128663,
+ -0.91420975570353058,
+ -0.90398929312344334,
+ -0.89322430119551532,
+ -0.88192126434835505,
+ -0.87008699110871146,
+ -0.85772861000027223,
+ -0.84485356524970723,
+ -0.83146961230254546,
+ -0.81758481315158404,
+ -0.80320753148064528,
+ -0.78834642762660612,
+ -0.77301045336273688,
+ -0.75720884650648457,
+ -0.74095112535495911,
+ -0.724247082951467,
+ -0.70710678118654768,
+ -0.68954054473706716,
+ -0.67155895484701866,
+ -0.65317284295377709,
+ -0.63439328416364593,
+ -0.61523159058062737,
+ -0.59569930449243325,
+ -0.57580819141784523,
+ -0.55557023301960218,
+ -0.53499761988709726,
+ -0.51410274419322188,
+ -0.49289819222978426,
+ -0.47139673682599792,
+ -0.44961132965460698,
+ -0.42755509343028253,
+ -0.40524131400499042,
+ -0.38268343236509039,
+ -0.359895036534988,
+ -0.33688985339222,
+ -0.31368174039889152,
+ -0.2902846772544625,
+ -0.26671275747489859,
+ -0.24298017990326418,
+ -0.21910124015687016,
+ -0.19509032201612872,
+ -0.17096188876030177,
+ -0.14673047445536239,
+ -0.12241067519921603,
+ -0.098017140329560506,
+ -0.073564563599667412,
+ -0.049067674327418091,
+ -0.024541228522912448
+};
+
+QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qmath.h b/src/corelib/kernel/qmath.h
index b521323..a9e4378 100644
--- a/src/corelib/kernel/qmath.h
+++ b/src/corelib/kernel/qmath.h
@@ -52,6 +52,10 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Core)
+#define QT_SINE_TABLE_SIZE 256
+
+extern Q_CORE_EXPORT const qreal qt_sine_table[QT_SINE_TABLE_SIZE];
+
inline int qCeil(qreal v)
{
#ifdef QT_USE_MATH_H_FLOATS
@@ -136,6 +140,26 @@ inline qreal qPow(qreal x, qreal y)
#define M_PI (3.14159265358979323846)
#endif
+inline qreal qFastSin(qreal x)
+{
+ int si = int(x * (0.5 * QT_SINE_TABLE_SIZE / M_PI)); // Would be more accurate with qRound, but slower.
+ qreal d = x - si * (2.0 * M_PI / QT_SINE_TABLE_SIZE);
+ int ci = si + QT_SINE_TABLE_SIZE / 4;
+ si &= QT_SINE_TABLE_SIZE - 1;
+ ci &= QT_SINE_TABLE_SIZE - 1;
+ return qt_sine_table[si] + (qt_sine_table[ci] - 0.5 * qt_sine_table[si] * d) * d;
+}
+
+inline qreal qFastCos(qreal x)
+{
+ int ci = int(x * (0.5 * QT_SINE_TABLE_SIZE / M_PI)); // Would be more accurate with qRound, but slower.
+ qreal d = x - ci * (2.0 * M_PI / QT_SINE_TABLE_SIZE);
+ int si = ci + QT_SINE_TABLE_SIZE / 4;
+ si &= QT_SINE_TABLE_SIZE - 1;
+ ci &= QT_SINE_TABLE_SIZE - 1;
+ return qt_sine_table[si] - (qt_sine_table[ci] + 0.5 * qt_sine_table[si] * d) * d;
+}
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/corelib/statemachine/qeventtransition.cpp b/src/corelib/statemachine/qeventtransition.cpp
index f278371..949f39e 100644
--- a/src/corelib/statemachine/qeventtransition.cpp
+++ b/src/corelib/statemachine/qeventtransition.cpp
@@ -231,7 +231,7 @@ void QEventTransition::setEventSource(QObject *object)
bool QEventTransition::eventTest(QEvent *event)
{
Q_D(const QEventTransition);
- if (event->type() == QEvent::Wrapped) {
+ if (event->type() == QEvent::StateMachineWrapped) {
QStateMachine::WrappedEvent *we = static_cast<QStateMachine::WrappedEvent*>(event);
return (we->object() == d->object)
&& (we->event()->type() == d->eventType);
diff --git a/src/corelib/statemachine/qsignaltransition.cpp b/src/corelib/statemachine/qsignaltransition.cpp
index 9811725..f55f634 100644
--- a/src/corelib/statemachine/qsignaltransition.cpp
+++ b/src/corelib/statemachine/qsignaltransition.cpp
@@ -218,7 +218,7 @@ void QSignalTransition::setSignal(const QByteArray &signal)
bool QSignalTransition::eventTest(QEvent *event)
{
Q_D(const QSignalTransition);
- if (event->type() == QEvent::Signal) {
+ if (event->type() == QEvent::StateMachineSignal) {
if (d->signalIndex == -1)
return false;
QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(event);
@@ -248,7 +248,7 @@ void QSignalTransitionPrivate::callOnTransition(QEvent *e)
{
Q_Q(QSignalTransition);
- if (e->type() == QEvent::Signal) {
+ if (e->type() == QEvent::StateMachineSignal) {
QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent *>(e);
int savedSignalIndex = se->m_signalIndex;
se->m_signalIndex = originalSignalIndex;
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index c7144e4..e182c88 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -2206,7 +2206,7 @@ QSignalEventGenerator::QSignalEventGenerator(QStateMachine *parent)
*/
QStateMachine::SignalEvent::SignalEvent(QObject *sender, int signalIndex,
const QList<QVariant> &arguments)
- : QEvent(QEvent::Signal), m_sender(sender),
+ : QEvent(QEvent::StateMachineSignal), m_sender(sender),
m_signalIndex(signalIndex), m_arguments(arguments)
{
}
@@ -2269,7 +2269,7 @@ QStateMachine::SignalEvent::~SignalEvent()
The WrappedEvent object takes ownership of \a event.
*/
QStateMachine::WrappedEvent::WrappedEvent(QObject *object, QEvent *event)
- : QEvent(QEvent::Wrapped), m_object(object), m_event(event)
+ : QEvent(QEvent::StateMachineWrapped), m_object(object), m_event(event)
{
}
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp
index 297c900..eb5fed0 100644
--- a/src/gui/dialogs/qfiledialog.cpp
+++ b/src/gui/dialogs/qfiledialog.cpp
@@ -3022,6 +3022,12 @@ bool QFileDialogPrivate::itemViewKeyboardEvent(QKeyEvent *event) {
case Qt::Key_Escape:
q->hide();
return true;
+#ifdef QT_KEYPAD_NAVIGATION
+ case Qt::Key_Down:
+ case Qt::Key_Up:
+ return (QApplication::navigationMode() != Qt::NavigationModeKeypadTabOrder
+ && QApplication::navigationMode() != Qt::NavigationModeKeypadDirectional);
+#endif
default:
break;
}
@@ -3142,7 +3148,17 @@ void QFileDialogListView::keyPressEvent(QKeyEvent *e)
if (!d_ptr->itemViewKeyboardEvent(e)) {
QListView::keyPressEvent(e);
}
+#ifdef QT_KEYPAD_NAVIGATION
+ if ((QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder
+ || QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional)
+ && !hasEditFocus()) {
+ e->ignore();
+ } else {
+ e->accept();
+ }
+#else
e->accept();
+#endif
}
QFileDialogTreeView::QFileDialogTreeView(QWidget *parent) : QTreeView(parent)
@@ -3189,7 +3205,11 @@ void QFileDialogLineEdit::keyPressEvent(QKeyEvent *e)
{
int key = e->key();
QLineEdit::keyPressEvent(e);
- if (key != Qt::Key_Escape)
+ if (key != Qt::Key_Escape
+#ifdef QT_KEYPAD_NAVIGATION
+ && QApplication::navigationMode() == Qt::NavigationModeNone
+#endif
+ )
e->accept();
if (hideOnEsc && (key == Qt::Key_Escape || key == Qt::Key_Return || key == Qt::Key_Enter)) {
e->accept();
diff --git a/src/gui/embedded/qvfbhdr.h b/src/gui/embedded/qvfbhdr.h
index f02286e..eff5fc2 100644
--- a/src/gui/embedded/qvfbhdr.h
+++ b/src/gui/embedded/qvfbhdr.h
@@ -56,6 +56,7 @@ QT_MODULE(Gui)
#define QT_QWS_TEMP_DIR "/tmp"
#endif
+#ifdef QT_PRIVATE_QWS
#define QT_VFB_DATADIR(DISPLAY) QString("%1/qtembedded-%2-%3") \
.arg(QT_QWS_TEMP_DIR).arg(getuid()).arg(DISPLAY)
@@ -67,7 +68,22 @@ QT_MODULE(Gui)
.append("/qtvfb_map")
#define QT_VFB_SOUND_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \
.append("/qt_soundserver")
-#define QTE_PIPE "QtEmbedded"
+#define QTE_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \
+ .append("/QtEmbedded")
+#define QTE_PIPE_QVFB QTE_PIPE
+#else
+#define QT_VFB_DATADIR(DISPLAY) QString("%1/qtembedded-%2") \
+ .arg(QT_QWS_TEMP_DIR).arg(DISPLAY)
+#define QT_VFB_MOUSE_PIPE(DISPLAY) QString("/tmp/.qtvfb_mouse-%1").arg(DISPLAY)
+#define QT_VFB_KEYBOARD_PIPE(DISPLAY) QString("/tmp/.qtvfb_keyboard-%1").arg(DISPLAY)
+#define QT_VFB_MAP(DISPLAY) QString("/tmp/.qtvfb_map-%1").arg(DISPLAY)
+#define QT_VFB_SOUND_PIPE(DISPLAY) QString("/tmp/.qt_soundserver-%1").arg(DISPLAY)
+#define QTE_PIPE(DISPLAY) QT_VFB_DATADIR(DISPLAY) \
+ .append("/QtEmbedded-%1") \
+ .arg(DISPLAY)
+#define QTE_PIPE_QVFB(DISPLAY) QString("/tmp/qtembedded-%1/QtEmbedded-%1") \
+ .arg(DISPLAY)
+#endif
struct QVFbHeader
{
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp
index fdb1708..ffbb67c 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp
+++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp
@@ -118,9 +118,13 @@ QGraphicsAnchor::~QGraphicsAnchor()
}
/*!
- Set the spacing for the anchor to \a spacing.
+ \property QGraphicsAnchor::spacing
+ \brief the space between items in the QGraphicsAnchorLayout.
- \sa spacing(), unsetSpacing()
+ Depending on the anchor type, the default spacing is either
+ 0 or a value returned from the style.
+
+ \sa QGraphicsAnchorLayout::anchor()
*/
void QGraphicsAnchor::setSpacing(qreal spacing)
{
@@ -128,23 +132,12 @@ void QGraphicsAnchor::setSpacing(qreal spacing)
d->setSpacing(spacing);
}
-/*!
- Returns the spacing for the anchor
-
- \sa setSpacing()
-*/
qreal QGraphicsAnchor::spacing() const
{
Q_D(const QGraphicsAnchor);
return d->spacing();
}
-/*!
- Resets the spacing of the anchor point to be the default spacing. Depending on the anchor type,
- the default spacing is either 0 or a value returned from the style.
-
- \sa setSpacing(), spacing(), QGraphicsAnchorLayout::anchor()
-*/
void QGraphicsAnchor::unsetSpacing()
{
Q_D(QGraphicsAnchor);
diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.h b/src/gui/graphicsview/qgraphicsanchorlayout.h
index d9a87ba..99dbf92 100644
--- a/src/gui/graphicsview/qgraphicsanchorlayout.h
+++ b/src/gui/graphicsview/qgraphicsanchorlayout.h
@@ -61,7 +61,7 @@ class QGraphicsAnchorLayoutPrivate;
class Q_GUI_EXPORT QGraphicsAnchor : public QObject
{
Q_OBJECT
- Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing)
+ Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing RESET unsetSpacing)
public:
void setSpacing(qreal spacing);
void unsetSpacing();
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 912cfb6..d766acc 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -609,6 +609,7 @@
/*!
\enum QGraphicsItem::PanelModality
+ \since 4.6
This enum specifies the behavior of a modal panel. A modal panel
is one that blocks input to other panels. Note that items that
diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h
index 4f44109..bea1e8d 100644
--- a/src/gui/image/qimage_p.h
+++ b/src/gui/image/qimage_p.h
@@ -63,7 +63,7 @@
QT_BEGIN_NAMESPACE
-struct QImageData { // internal image data
+struct Q_GUI_EXPORT QImageData { // internal image data
QImageData();
~QImageData();
static QImageData *create(const QSize &size, QImage::Format format, int numColors = 0);
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index 4938442..326dd10 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -64,7 +64,7 @@ const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08,
0x10, 0x20, 0x40, 0x80 };
-/*!
+/*
\class QSymbianFbsClient
\since 4.6
\internal
@@ -145,7 +145,7 @@ void QSymbianFbsHeapLock::relock()
qt_symbianFbsClient()->lockHeap();
}
-/*!
+/*
\class QSymbianBitmapDataAccess
\since 4.6
\internal
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index f77d200..6cde898 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -67,6 +67,7 @@
#include <private/qt_x11_p.h>
#include "qx11info_x11.h"
#include <private/qdrawhelper_p.h>
+#include <private/qimage_p.h>
#include <stdlib.h>
@@ -369,6 +370,30 @@ void QX11PixmapData::resize(int width, int height)
#endif // QT_NO_XRENDER
}
+struct QX11AlphaDetector
+{
+ bool hasAlpha() const {
+ if (checked)
+ return has;
+ // Will implicitly also check format and return quickly for opaque types...
+ checked = true;
+ has = const_cast<QImage *>(image)->data_ptr()->checkForAlphaPixels();
+ return has;
+ }
+
+ bool hasXRenderAndAlpha() const {
+ if (!X11->use_xrender)
+ return false;
+ return hasAlpha();
+ }
+
+ QX11AlphaDetector(const QImage *i) : image(i), checked(false), has(false) { }
+
+ const QImage *image;
+ mutable bool checked;
+ mutable bool has;
+};
+
void QX11PixmapData::fromImage(const QImage &img,
Qt::ImageConversionFlags flags)
{
@@ -402,7 +427,9 @@ void QX11PixmapData::fromImage(const QImage &img,
return;
}
- int dd = X11->use_xrender && img.hasAlphaChannel() ? 32 : xinfo.depth();
+ QX11AlphaDetector alphaCheck(&img);
+ int dd = alphaCheck.hasXRenderAndAlpha() ? 32 : xinfo.depth();
+
if (qt_x11_preferred_pixmap_depth)
dd = qt_x11_preferred_pixmap_depth;
@@ -454,7 +481,7 @@ void QX11PixmapData::fromImage(const QImage &img,
uchar *newbits= 0;
#ifndef QT_NO_XRENDER
- if (X11->use_xrender && image.hasAlphaChannel()) {
+ if (alphaCheck.hasXRenderAndAlpha()) {
const QImage &cimage = image;
d = 32;
@@ -1091,7 +1118,7 @@ void QX11PixmapData::fromImage(const QImage &img,
}
#endif
- if (image.hasAlphaChannel()) {
+ if (alphaCheck.hasAlpha()) {
QBitmap m = QBitmap::fromImage(image.createAlphaMask(flags));
setMask(m);
}
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 0fae959..18cab13 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -87,6 +87,7 @@ QAbstractItemViewPrivate::QAbstractItemViewPrivate()
dragDropMode(QAbstractItemView::NoDragDrop),
overwrite(false),
dropIndicatorPosition(QAbstractItemView::OnItem),
+ defaultDropAction(Qt::IgnoreAction),
#endif
#ifdef QT_SOFTKEYS_ENABLED
doneSoftKey(0),
@@ -1371,6 +1372,28 @@ QAbstractItemView::DragDropMode QAbstractItemView::dragDropMode() const
return NoDragDrop;
}
+/*!
+ \property QAbstractItemView::defaultDropAction
+ \brief the drop action that will be used by default in QAbstractItemView::drag()
+
+ If the property is not set, the drop action is CopyAction when the supported
+ actions support CopyAction.
+
+ \since 4.6
+ \sa showDropIndicator dragDropOverwriteMode
+*/
+void QAbstractItemView::setDefaultDropAction(Qt::DropAction dropAction)
+{
+ Q_D(QAbstractItemView);
+ d->defaultDropAction = dropAction;
+}
+
+Qt::DropAction QAbstractItemView::defaultDropAction() const
+{
+ Q_D(const QAbstractItemView);
+ return d->defaultDropAction;
+}
+
#endif // QT_NO_DRAGANDDROP
/*!
@@ -3297,7 +3320,9 @@ void QAbstractItemView::startDrag(Qt::DropActions supportedActions)
drag->setMimeData(data);
drag->setHotSpot(d->pressedPosition - rect.topLeft());
Qt::DropAction defaultDropAction = Qt::IgnoreAction;
- if (supportedActions & Qt::CopyAction && dragDropMode() != QAbstractItemView::InternalMove)
+ if (d->defaultDropAction != Qt::IgnoreAction && (supportedActions & d->defaultDropAction))
+ defaultDropAction = d->defaultDropAction;
+ else if (supportedActions & Qt::CopyAction && dragDropMode() != QAbstractItemView::InternalMove)
defaultDropAction = Qt::CopyAction;
if (drag->exec(supportedActions, defaultDropAction) == Qt::MoveAction)
d->clearOrRemove();
diff --git a/src/gui/itemviews/qabstractitemview.h b/src/gui/itemviews/qabstractitemview.h
index 7d5c765..b4f0957 100644
--- a/src/gui/itemviews/qabstractitemview.h
+++ b/src/gui/itemviews/qabstractitemview.h
@@ -74,6 +74,7 @@ class Q_GUI_EXPORT QAbstractItemView : public QAbstractScrollArea
Q_PROPERTY(bool dragEnabled READ dragEnabled WRITE setDragEnabled)
Q_PROPERTY(bool dragDropOverwriteMode READ dragDropOverwriteMode WRITE setDragDropOverwriteMode)
Q_PROPERTY(DragDropMode dragDropMode READ dragDropMode WRITE setDragDropMode)
+ Q_PROPERTY(Qt::DropAction defaultDropAction READ defaultDropAction WRITE setDefaultDropAction)
#endif
Q_PROPERTY(bool alternatingRowColors READ alternatingRowColors WRITE setAlternatingRowColors)
Q_PROPERTY(SelectionMode selectionMode READ selectionMode WRITE setSelectionMode)
@@ -181,7 +182,11 @@ public:
void setDragDropMode(DragDropMode behavior);
DragDropMode dragDropMode() const;
+
+ void setDefaultDropAction(Qt::DropAction dropAction);
+ Qt::DropAction defaultDropAction() const;
#endif
+
void setAlternatingRowColors(bool enable);
bool alternatingRowColors() const;
diff --git a/src/gui/itemviews/qabstractitemview_p.h b/src/gui/itemviews/qabstractitemview_p.h
index 84c0892..fcf381a 100644
--- a/src/gui/itemviews/qabstractitemview_p.h
+++ b/src/gui/itemviews/qabstractitemview_p.h
@@ -117,7 +117,7 @@ public:
virtual void _q_columnsInserted(const QModelIndex &parent, int start, int end);
virtual void _q_modelDestroyed();
virtual void _q_layoutChanged();
-
+
void fetchMore();
bool shouldEdit(QAbstractItemView::EditTrigger trigger, const QModelIndex &index) const;
@@ -315,7 +315,7 @@ public:
}
return ref;
}
-
+
/**
* return true if the index is registered as a QPersistentModelIndex
*/
@@ -356,8 +356,8 @@ public:
Qt::KeyboardModifiers pressedModifiers;
QPoint pressedPosition;
bool pressedAlreadySelected;
-
- //forces the next mouseMoveEvent to send the viewportEntered signal
+
+ //forces the next mouseMoveEvent to send the viewportEntered signal
//if the mouse is over the viewport and not over an item
bool viewportEnteredNeeded;
@@ -377,6 +377,7 @@ public:
QAbstractItemView::DragDropMode dragDropMode;
bool overwrite;
QAbstractItemView::DropIndicatorPosition dropIndicatorPosition;
+ Qt::DropAction defaultDropAction;
#endif
#ifdef QT_SOFTKEYS_ENABLED
diff --git a/src/gui/kernel/qapplication_qws.cpp b/src/gui/kernel/qapplication_qws.cpp
index 01c64f1..634f23a 100644
--- a/src/gui/kernel/qapplication_qws.cpp
+++ b/src/gui/kernel/qapplication_qws.cpp
@@ -232,7 +232,7 @@ QString qws_dataDir()
// Get the filename of the pipe Qt for Embedded Linux uses for server/client comms
Q_GUI_EXPORT QString qws_qtePipeFilename()
{
- return (qws_dataDir().append(QTE_PIPE));
+ return QTE_PIPE(qws_display_id);
}
static void setMaxWindowRect(const QRect &rect)
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index d50e7e1..807a17f 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -780,7 +780,7 @@ TCoeInputCapabilities QSymbianControl::InputCapabilities() const
}
#endif
-void QSymbianControl::Draw(const TRect& r) const
+void QSymbianControl::Draw(const TRect& controlRect) const
{
QWindowSurface *surface = qwidget->windowSurface();
QPaintEngine *engine = surface ? surface->paintDevice()->paintEngine() : NULL;
@@ -788,6 +788,11 @@ void QSymbianControl::Draw(const TRect& r) const
if (!engine)
return;
+ // Map source rectangle into coordinates of the backing store.
+ const QPoint controlBase(controlRect.iTl.iX, controlRect.iTl.iY);
+ const QPoint backingStoreBase = qwidget->mapTo(qwidget->window(), controlBase);
+ const TRect backingStoreRect(TPoint(backingStoreBase.x(), backingStoreBase.y()), controlRect.Size());
+
if (engine->type() == QPaintEngine::Raster) {
QS60WindowSurface *s60Surface = static_cast<QS60WindowSurface *>(qwidget->windowSurface());
CFbsBitmap *bitmap = s60Surface->symbianBitmap();
@@ -796,10 +801,10 @@ void QSymbianControl::Draw(const TRect& r) const
if(!qwidget->d_func()->extraData()->disableBlit) {
if (qwidget->d_func()->isOpaque)
gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
- gc.BitBlt(r.iTl, bitmap, r);
- }
+ gc.BitBlt(controlRect.iTl, bitmap, backingStoreRect);
+ }
} else {
- surface->flush(qwidget, QRegion(qt_TRect2QRect(r)), QPoint());
+ surface->flush(qwidget, QRegion(qt_TRect2QRect(backingStoreRect)), QPoint());
}
}
@@ -950,13 +955,14 @@ void QSymbianControl::setFocusSafely(bool focus)
/*!
\typedef QApplication::QS60MainApplicationFactory
+ \since 4.6
This is a typedef for a pointer to a function with the following
signature:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 47
- \sa QApplication::QApplication(QApplication::QS60MainApplicationFactory, int &, char **)
+ \sa QApplication::QApplication()
*/
/*!
diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp
index 00839d1..237ce46 100644
--- a/src/gui/kernel/qgesture.cpp
+++ b/src/gui/kernel/qgesture.cpp
@@ -67,6 +67,7 @@ private:
/*!
\class QGesture
\since 4.6
+ \preliminary
\brief The QGesture class is the base class for implementing custom
gestures.
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index bcc411a..3cfb987 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -57,6 +57,7 @@ QWidgetPrivate *qt_widget_private(QWidget *widget);
/*!
\class QPanGesture
+ \preliminary
\since 4.6
\brief The QPanGesture class represents a Pan gesture,
@@ -339,6 +340,7 @@ QSizeF QPanGesture::offset() const
/*!
\class QPinchGesture
+ \preliminary
\since 4.6
\brief The QPinchGesture class represents a Pinch gesture,
@@ -667,6 +669,7 @@ QPointF QPinchGesture::startCenterPoint() const
/*!
\class QSwipeGesture
+ \preliminary
\since 4.6
\brief The QSwipeGesture class represents a swipe gesture,
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 0b75b06..2359812 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -923,7 +923,7 @@ void QWidget::setAutoFillBackground(bool enabled)
Note: Currently softkeys are only supported on the Symbian Platform.
- \sa addAction, QAction, QMenuBar
+ \sa addAction(), QAction, QMenuBar
*/
@@ -11444,19 +11444,32 @@ QWidget *QWidgetPrivate::widgetInNavigationDirection(Direction direction)
QWidget *targetWidget = 0;
int shortestDistance = INT_MAX;
foreach(QWidget *targetCandidate, QApplication::allWidgets()) {
-
- if (targetCandidate->focusProxy()) //skip if focus proxy set
- continue;
const QRect targetCandidateRect = targetCandidate->rect().translated(targetCandidate->mapToGlobal(QPoint()));
+
+ // For focus proxies, the child widget handling the focus can have keypad navigation focus,
+ // but the owner of the proxy cannot.
+ // Additionally, empty widgets should be ignored.
+ if (targetCandidate->focusProxy() || targetCandidateRect.isEmpty())
+ continue;
+
+ // Only navigate to a target widget that...
if ( targetCandidate != sourceWidget
+ // ...takes the focus,
&& targetCandidate->focusPolicy() & Qt::TabFocus
+ // ...is above if DirectionNorth,
&& !(direction == DirectionNorth && targetCandidateRect.bottom() > sourceRect.top())
+ // ...is on the right if DirectionEast,
&& !(direction == DirectionEast && targetCandidateRect.left() < sourceRect.right())
+ // ...is below if DirectionSouth,
&& !(direction == DirectionSouth && targetCandidateRect.top() < sourceRect.bottom())
+ // ...is on the left if DirectionWest,
&& !(direction == DirectionWest && targetCandidateRect.right() > sourceRect.left())
+ // ...is enabled,
&& targetCandidate->isEnabled()
+ // ...is visible,
&& targetCandidate->isVisible()
+ // ...is in the same window,
&& targetCandidate->window() == sourceWindow) {
const int targetCandidateDistance = pointToRect(sourcePoint, targetCandidateRect);
if (targetCandidateDistance < shortestDistance) {
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index 6c879be..c06ef73 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -294,6 +294,7 @@ public:
void setMask_sys(const QRegion &);
#ifdef Q_OS_SYMBIAN
void setSoftKeys_sys(const QList<QAction*> &softkeys);
+ void activateSymbianWindow();
#endif
void raise_sys();
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 05db8ca..3328cee 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -194,8 +194,8 @@ void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &)
}
if (jump && data.winid) {
- RWindow *const window = static_cast<RWindow *>(data.winid->DrawableWindow());
- window->Invalidate(TRect(0, 0, wrect.width(), wrect.height()));
+ RWindow *const window = static_cast<RWindow *>(data.winid->DrawableWindow());
+ window->Invalidate(TRect(0, 0, wrect.width(), wrect.height()));
}
}
@@ -411,6 +411,14 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
int x, y, w, h;
data.crect.getRect(&x, &y, &w, &h);
control->SetRect(TRect(TPoint(x, y), TSize(w, h)));
+
+ RDrawableWindow *const drawableWindow = control->DrawableWindow();
+ // Request mouse move events.
+ drawableWindow->PointerFilter(EPointerFilterEnterExit
+ | EPointerFilterMove | EPointerFilterDrag, 0);
+
+ if (q->isVisible() && q->testAttribute(Qt::WA_Mapped))
+ activateSymbianWindow();
}
if (destroyw) {
@@ -440,12 +448,11 @@ void QWidgetPrivate::show_sys()
}
if (q->internalWinId()) {
-
- QSymbianControl *id = static_cast<QSymbianControl *>(q->internalWinId());
- if (!extra->activated) {
- QT_TRAP_THROWING(id->ActivateL());
- extra->activated = 1;
- }
+ if (!extra->activated)
+ activateSymbianWindow();
+
+ QSymbianControl *id = static_cast<QSymbianControl *>(q->internalWinId());
+
id->MakeVisible(true);
if(q->isWindow())
@@ -461,6 +468,19 @@ void QWidgetPrivate::show_sys()
invalidateBuffer(q->rect());
}
+void QWidgetPrivate::activateSymbianWindow()
+{
+ Q_Q(QWidget);
+
+ Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
+ Q_ASSERT(q->testAttribute(Qt::WA_Mapped));
+ Q_ASSERT(!extra->activated);
+
+ WId id = q->internalWinId();
+ QT_TRAP_THROWING(id->ActivateL());
+ extra->activated = 1;
+}
+
void QWidgetPrivate::hide_sys()
{
Q_Q(QWidget);
@@ -1016,9 +1036,9 @@ QPoint QWidget::mapFromGlobal(const QPoint &pos) const
}
// Native window case
- const TPoint widgetScreenOffset = internalWinId()->PositionRelativeToScreen();
- const QPoint widgetPos = pos - QPoint(widgetScreenOffset.iX, widgetScreenOffset.iY);
- return widgetPos;
+ const TPoint widgetScreenOffset = internalWinId()->PositionRelativeToScreen();
+ const QPoint widgetPos = pos - QPoint(widgetScreenOffset.iX, widgetScreenOffset.iY);
+ return widgetPos;
}
void QWidget::setWindowState(Qt::WindowStates newstate)
diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp
index 716300e..c20d8d8 100644
--- a/src/gui/painting/qdrawutil.cpp
+++ b/src/gui/painting/qdrawutil.cpp
@@ -45,6 +45,9 @@
#include "qapplication.h"
#include "qpainter.h"
#include "qpalette.h"
+#include <private/qpaintengineex_p.h>
+#include <qvarlengtharray.h>
+#include <qmath.h>
QT_BEGIN_NAMESPACE
@@ -1078,91 +1081,7 @@ void qDrawItem(QPainter *p, Qt::GUIStyle gs,
according to the \a margins structure.
*/
-static inline void qVerticalRepeat(QPainter *painter,
- const QRect &target,
- const QPixmap &pixmap,
- const QRect &source,
- void (*drawPixmap)(QPainter*,
- const QRect&,
- const QPixmap&,
- const QRect&))
-{
- const int x = target.x();
- const int width = target.width();
- const int height = source.height();
- const int bottom = target.bottom() - height;
- int y = target.y();
- for (; y < bottom; y += height)
- (*drawPixmap)(painter, QRect(x, y, width, height), pixmap, source);
- const QRect remaining(source.x(), source.y(), source.width(), target.bottom() - y + 1);
- (*drawPixmap)(painter, QRect(x, y, width, remaining.height()), pixmap, remaining);
-}
-
-static inline void qHorizontalRepeat(QPainter *painter, const QRect &target, const QPixmap &pixmap, const QRect &source,
- void (*drawPixmap)(QPainter*, const QRect&, const QPixmap&, const QRect&))
-{
- const int y = target.y();
- const int width = source.width();
- const int height = target.height();
- const int right = target.right() - width;
- int x = target.x();
- for (; x < right; x += width)
- (*drawPixmap)(painter, QRect(x, y, width, height), pixmap, source);
- const QRect remaining(source.x(), source.y(), target.right() - x + 1, source.height());
- (*drawPixmap)(painter, QRect(x, y, remaining.width(), height), pixmap, remaining);
-}
-
-static inline void qVerticalRound(QPainter *painter, const QRect &target, const QPixmap &pixmap, const QRect &source,
- void (*drawPixmap)(QPainter*, const QRect&, const QPixmap&, const QRect&))
-{
- // qreal based - slow on non-fpu devices
- const qreal x = target.x();
- const qreal width = target.width();
- const qreal verticalFactor = static_cast<qreal>(target.height()) / static_cast<qreal>(source.height());
- const qreal verticalIncrement = static_cast<qreal>(target.height()) / static_cast<int>(verticalFactor + 0.5);
- const qreal bottom = target.bottom();
- for (qreal y = static_cast<qreal>(target.y()); y < bottom; y += verticalIncrement)
- (*drawPixmap)(painter, QRectF(x, y, width, verticalIncrement).toRect(), pixmap, source);
-
-}
-
-static inline void qHorizontalRound(QPainter *painter, const QRect &target, const QPixmap &pixmap, const QRect &source,
- void (*drawPixmap)(QPainter*, const QRect&, const QPixmap&, const QRect&))
-{
- // qreal based - slow on non-fpu devices
- const qreal y = target.y();
- const qreal height = target.height();
- const qreal horizontalFactor = static_cast<qreal>(target.width()) / static_cast<qreal>(source.width());
- const qreal horizontalIncrement = static_cast<qreal>(target.width()) / static_cast<int>(horizontalFactor + 0.5);
- const qreal right = target.right();
- for (qreal x = target.x(); x < right; x += horizontalIncrement)
- (*drawPixmap)(painter, QRectF(x, y, horizontalIncrement, height).toRect(), pixmap, source);
-}
-
-static inline void qDrawPixmap(QPainter *painter, const QRect &target, const QPixmap &pixmap, const QRect &source)
-{
- painter->drawPixmap(target, pixmap, source);
-}
-
-static inline void qDrawVerticallyRepeatedPixmap(QPainter *painter, const QRect &target, const QPixmap &pixmap, const QRect &source)
-{
- qVerticalRepeat(painter, target, pixmap, source, qDrawPixmap);
-}
-
-static inline void qDrawHorizontallyRepeatedPixmap(QPainter *painter, const QRect &target, const QPixmap &pixmap, const QRect &source)
-{
- qHorizontalRepeat(painter, target, pixmap, source, qDrawPixmap);
-}
-
-static inline void qDrawVerticallyRoundedPixmap(QPainter *painter, const QRect &target, const QPixmap &pixmap, const QRect &source)
-{
- qVerticalRound(painter, target, pixmap, source, qDrawPixmap);
-}
-
-static inline void qDrawHorizontallyRoundedPixmap(QPainter *painter, const QRect &target, const QPixmap &pixmap, const QRect &source)
-{
- qHorizontalRound(painter, target, pixmap, source, qDrawPixmap);
-}
+typedef QVarLengthArray<QDrawPixmaps::Data, 16> QDrawPixmapsDataArray;
/*!
\since 4.6
@@ -1179,176 +1098,282 @@ static inline void qDrawHorizontallyRoundedPixmap(QPainter *painter, const QRect
\sa Qt::TileRule, QTileRules, QMargins
*/
-void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargins &targetMargins, const QPixmap &pixmap,
- const QRect &sourceRect, const QMargins &sourceMargins, const QTileRules &rules)
+void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargins &targetMargins,
+ const QPixmap &pixmap, const QRect &sourceRect,const QMargins &sourceMargins,
+ const QTileRules &rules, QDrawBorderPixmap::DrawingHints hints)
{
+ QDrawPixmaps::Data d;
+ d.opacity = 1.0;
+ d.rotation = 0.0;
+
+ QDrawPixmapsDataArray opaqueData;
+ QDrawPixmapsDataArray translucentData;
+
// source center
- const int sourceTop = sourceRect.top();
- const int sourceLeft = sourceRect.left();
- const int sourceCenterTop = sourceTop + sourceMargins.top();
- const int sourceCenterLeft = sourceLeft + sourceMargins.left();
+ const int sourceCenterTop = sourceRect.top() + sourceMargins.top();
+ const int sourceCenterLeft = sourceRect.left() + sourceMargins.left();
const int sourceCenterBottom = sourceRect.bottom() - sourceMargins.bottom() + 1;
const int sourceCenterRight = sourceRect.right() - sourceMargins.right() + 1;
- const int sourceCenterWidth = sourceCenterRight - sourceMargins.left();
- const int sourceCenterHeight = sourceCenterBottom - sourceMargins.top();
+ const int sourceCenterWidth = sourceCenterRight - sourceCenterLeft;
+ const int sourceCenterHeight = sourceCenterBottom - sourceCenterTop;
// target center
- const int targetTop = targetRect.top();
- const int targetLeft = targetRect.left();
- const int targetCenterTop = targetTop + targetMargins.top();
- const int targetCenterLeft = targetLeft + targetMargins.left();
+ const int targetCenterTop = targetRect.top() + targetMargins.top();
+ const int targetCenterLeft = targetRect.left() + targetMargins.left();
const int targetCenterBottom = targetRect.bottom() - targetMargins.bottom() + 1;
const int targetCenterRight = targetRect.right() - targetMargins.right() + 1;
const int targetCenterWidth = targetCenterRight - targetCenterLeft;
const int targetCenterHeight = targetCenterBottom - targetCenterTop;
+ QVarLengthArray<qreal, 16> xTarget; // x-coordinates of target rectangles
+ QVarLengthArray<qreal, 16> yTarget; // y-coordinates of target rectangles
+
+ int columns = 3;
+ int rows = 3;
+ if (rules.horizontal != Qt::StretchTile && sourceCenterWidth != 0)
+ columns = qMax(3, 2 + qCeil(targetCenterWidth / qreal(sourceCenterWidth)));
+ if (rules.vertical != Qt::StretchTile && sourceCenterHeight != 0)
+ rows = qMax(3, 2 + qCeil(targetCenterHeight / qreal(sourceCenterHeight)));
+
+ xTarget.resize(columns + 1);
+ yTarget.resize(rows + 1);
+
+ xTarget[0] = targetRect.left();
+ xTarget[1] = targetCenterLeft;
+ xTarget[columns - 1] = targetCenterRight;
+ xTarget[columns] = targetRect.left() + targetRect.width();
+
+ yTarget[0] = targetRect.top();
+ yTarget[1] = targetCenterTop;
+ yTarget[rows - 1] = targetCenterBottom;
+ yTarget[rows] = targetRect.top() + targetRect.height();
+
+ qreal dx;
+ qreal dy;
+
+ switch (rules.horizontal) {
+ case Qt::StretchTile:
+ dx = targetCenterWidth;
+ break;
+ case Qt::RepeatTile:
+ dx = sourceCenterWidth;
+ break;
+ case Qt::RoundTile:
+ dx = targetCenterWidth / qreal(columns - 2);
+ break;
+ }
+
+ for (int i = 2; i < columns - 1; ++i)
+ xTarget[i] = xTarget[i - 1] + dx;
+
+ switch (rules.vertical) {
+ case Qt::StretchTile:
+ dy = targetCenterHeight;
+ break;
+ case Qt::RepeatTile:
+ dy = sourceCenterHeight;
+ break;
+ case Qt::RoundTile:
+ dy = targetCenterHeight / qreal(rows - 2);
+ break;
+ }
+
+ for (int i = 2; i < rows - 1; ++i)
+ yTarget[i] = yTarget[i - 1] + dy;
+
// corners
if (targetMargins.top() > 0 && targetMargins.left() > 0 && sourceMargins.top() > 0 && sourceMargins.left() > 0) { // top left
- const QRect targetTopLeftRect(targetLeft, targetTop, targetMargins.left(), targetMargins.top());
- const QRect sourceTopLeftRect(sourceLeft, sourceTop, sourceMargins.left(), sourceMargins.top());
- qDrawPixmap(painter, targetTopLeftRect, pixmap, sourceTopLeftRect);
+ d.point.setX(0.5 * (xTarget[1] + xTarget[0]));
+ d.point.setY(0.5 * (yTarget[1] + yTarget[0]));
+ d.source = QRectF(sourceRect.left(), sourceRect.top(), sourceMargins.left(), sourceMargins.top());
+ d.scaleX = qreal(xTarget[1] - xTarget[0]) / d.source.width();
+ d.scaleY = qreal(yTarget[1] - yTarget[0]) / d.source.height();
+ if (hints & QDrawBorderPixmap::OpaqueTopLeft)
+ opaqueData.append(d);
+ else
+ translucentData.append(d);
}
if (targetMargins.top() > 0 && targetMargins.right() > 0 && sourceMargins.top() > 0 && sourceMargins.right() > 0) { // top right
- const QRect targetTopRightRect(targetCenterRight, targetTop, targetMargins.right(), targetMargins.top());
- const QRect sourceTopRightRect(sourceCenterRight, sourceTop, sourceMargins.right(), sourceMargins.top());
- qDrawPixmap(painter, targetTopRightRect, pixmap, sourceTopRightRect);
+ d.point.setX(0.5 * (xTarget[columns] + xTarget[columns - 1]));
+ d.point.setY(0.5 * (yTarget[1] + yTarget[0]));
+ d.source = QRectF(sourceCenterRight, sourceRect.top(), sourceMargins.right(), sourceMargins.top());
+ d.scaleX = qreal(xTarget[columns] - xTarget[columns - 1]) / d.source.width();
+ d.scaleY = qreal(yTarget[1] - yTarget[0]) / d.source.height();
+ if (hints & QDrawBorderPixmap::OpaqueTopRight)
+ opaqueData.append(d);
+ else
+ translucentData.append(d);
}
if (targetMargins.bottom() > 0 && targetMargins.left() > 0 && sourceMargins.bottom() > 0 && sourceMargins.left() > 0) { // bottom left
- const QRect targetBottomLeftRect(targetLeft, targetCenterBottom, targetMargins.left(), targetMargins.bottom());
- const QRect sourceBottomLeftRect(sourceLeft, sourceCenterBottom, sourceMargins.left(), sourceMargins.bottom());
- qDrawPixmap(painter, targetBottomLeftRect, pixmap, sourceBottomLeftRect);
+ d.point.setX(0.5 * (xTarget[1] + xTarget[0]));
+ d.point.setY(0.5 * (yTarget[rows] + yTarget[rows - 1]));
+ d.source = QRectF(sourceRect.left(), sourceCenterBottom, sourceMargins.left(), sourceMargins.bottom());
+ d.scaleX = qreal(xTarget[1] - xTarget[0]) / d.source.width();
+ d.scaleY = qreal(yTarget[rows] - yTarget[rows - 1]) / d.source.height();
+ if (hints & QDrawBorderPixmap::OpaqueBottomLeft)
+ opaqueData.append(d);
+ else
+ translucentData.append(d);
}
if (targetMargins.bottom() > 0 && targetMargins.right() > 0 && sourceMargins.bottom() > 0 && sourceMargins.right() > 0) { // bottom right
- const QRect targetBottomRightRect(targetCenterRight, targetCenterBottom, targetMargins.right(), targetMargins.bottom());
- const QRect sourceBottomRightRect(sourceCenterRight, sourceCenterBottom, sourceMargins.right(), sourceMargins.bottom());
- qDrawPixmap(painter, targetBottomRightRect, pixmap, sourceBottomRightRect);
+ d.point.setX(0.5 * (xTarget[columns] + xTarget[columns - 1]));
+ d.point.setY(0.5 * (yTarget[rows] + yTarget[rows - 1]));
+ d.source = QRectF(sourceCenterRight, sourceCenterBottom, sourceMargins.right(), sourceMargins.bottom());
+ d.scaleX = qreal(xTarget[columns] - xTarget[columns - 1]) / d.source.width();
+ d.scaleY = qreal(yTarget[rows] - yTarget[rows - 1]) / d.source.height();
+ if (hints & QDrawBorderPixmap::OpaqueBottomRight)
+ opaqueData.append(d);
+ else
+ translucentData.append(d);
}
// horizontal edges
- switch (rules.horizontal) {
- case Qt::Stretch:
- if (targetMargins.top() > 0 && sourceMargins.top() > 0) { // top
- const QRect targetTopRect(targetCenterLeft, targetTop, targetCenterWidth, targetMargins.top());
- const QRect sourceTopRect(sourceCenterLeft, sourceTop, sourceCenterWidth, sourceMargins.top());
- qDrawPixmap(painter, targetTopRect, pixmap, sourceTopRect);
- }
- if (targetMargins.bottom() > 0 && sourceMargins.bottom() > 0) { // bottom
- const QRect targetBottomRect(targetCenterLeft, targetCenterBottom, targetCenterWidth, targetMargins.bottom());
- const QRect sourceBottomRect(sourceCenterLeft, sourceCenterBottom, sourceCenterWidth, sourceMargins.bottom());
- qDrawPixmap(painter, targetBottomRect, pixmap, sourceBottomRect);
- }
- break;
- case Qt::Repeat:
- if (targetMargins.top() > 0 && sourceMargins.top() > 0) { // top
- const QRect targetTopRect(targetCenterLeft, targetTop, targetCenterWidth, targetMargins.top());
- const QRect sourceTopRect(sourceCenterLeft, sourceTop, sourceCenterWidth, sourceMargins.top());
- qDrawHorizontallyRepeatedPixmap(painter, targetTopRect, pixmap, sourceTopRect);
- }
- if (targetMargins.bottom() > 0 && sourceMargins.bottom() > 0) { // bottom
- const QRect targetBottomRect(targetCenterLeft, targetCenterBottom, targetCenterWidth, targetMargins.bottom());
- const QRect sourceBottomRect(sourceCenterLeft, sourceCenterBottom, sourceCenterWidth, sourceMargins.bottom());
- qDrawHorizontallyRepeatedPixmap(painter, targetBottomRect, pixmap, sourceBottomRect);
- }
- break;
- case Qt::Round:
+ if (targetCenterWidth > 0 && sourceCenterWidth > 0) {
if (targetMargins.top() > 0 && sourceMargins.top() > 0) { // top
- const QRect targetTopRect(targetCenterLeft, targetTop, targetCenterWidth, targetMargins.top());
- const QRect sourceTopRect(sourceCenterLeft, sourceTop, sourceCenterWidth, sourceMargins.top());
- qDrawHorizontallyRoundedPixmap(painter, targetTopRect, pixmap, sourceTopRect);
+ QDrawPixmapsDataArray &data = hints & QDrawBorderPixmap::OpaqueTop ? opaqueData : translucentData;
+ d.source = QRectF(sourceCenterLeft, sourceRect.top(), sourceCenterWidth, sourceMargins.top());
+ d.point.setY(0.5 * (yTarget[1] + yTarget[0]));
+ d.scaleX = dx / d.source.width();
+ d.scaleY = qreal(yTarget[1] - yTarget[0]) / d.source.height();
+ for (int i = 1; i < columns - 1; ++i) {
+ d.point.setX(0.5 * (xTarget[i + 1] + xTarget[i]));
+ data.append(d);
+ }
+ if (rules.horizontal == Qt::RepeatTile)
+ data[data.size() - 1].source.setWidth((xTarget[columns - 1] - xTarget[columns - 2]) / d.scaleX);
}
if (targetMargins.bottom() > 0 && sourceMargins.bottom() > 0) { // bottom
- const QRect targetBottomRect(targetCenterLeft, targetCenterBottom, targetCenterWidth, targetMargins.bottom());
- const QRect sourceBottomRect(sourceCenterLeft, sourceCenterBottom, sourceCenterWidth, sourceMargins.bottom());
- qDrawHorizontallyRoundedPixmap(painter, targetBottomRect, pixmap, sourceBottomRect);
+ QDrawPixmapsDataArray &data = hints & QDrawBorderPixmap::OpaqueBottom ? opaqueData : translucentData;
+ d.source = QRectF(sourceCenterLeft, sourceCenterBottom, sourceCenterWidth, sourceMargins.bottom());;
+ d.point.setY(0.5 * (yTarget[rows] + yTarget[rows - 1]));
+ d.scaleX = dx / d.source.width();
+ d.scaleY = qreal(yTarget[rows] - yTarget[rows - 1]) / d.source.height();
+ for (int i = 1; i < columns - 1; ++i) {
+ d.point.setX(0.5 * (xTarget[i + 1] + xTarget[i]));
+ data.append(d);
+ }
+ if (rules.horizontal == Qt::RepeatTile)
+ data[data.size() - 1].source.setWidth((xTarget[columns - 1] - xTarget[columns - 2]) / d.scaleX);
}
- break;
}
// vertical edges
- switch (rules.vertical) {
- case Qt::Stretch:
- if (targetMargins.left() > 0 && sourceMargins.left() > 0) { // left
- const QRect targetLeftRect(targetLeft, targetCenterTop, targetMargins.left(), targetCenterHeight);
- const QRect sourceLeftRect(sourceLeft, sourceCenterTop, sourceMargins.left(), sourceCenterHeight);
- qDrawPixmap(painter, targetLeftRect, pixmap, sourceLeftRect);
- }
- if (targetMargins.right() > 0 && sourceMargins.right() > 0) { // right
- const QRect targetRightRect(targetCenterRight, targetCenterTop, targetMargins.right(), targetCenterHeight);
- const QRect sourceRightRect(sourceCenterRight, sourceCenterTop, sourceMargins.right(), sourceCenterHeight);
- qDrawPixmap(painter, targetRightRect, pixmap, sourceRightRect);
- }
- break;
- case Qt::Repeat:
- if (targetMargins.left() > 0 && sourceMargins.left() > 0) { // left
- const QRect targetLeftRect(targetLeft, targetCenterTop, targetMargins.left(), targetCenterHeight);
- const QRect sourceLeftRect(sourceLeft, sourceCenterTop, sourceMargins.left(), sourceCenterHeight);
- qDrawVerticallyRepeatedPixmap(painter, targetLeftRect, pixmap, sourceLeftRect);
- }
- if (targetMargins.right() > 0 && sourceMargins.right() > 0) { // right
- const QRect targetRightRect(targetCenterRight, targetCenterTop, targetMargins.right(), targetCenterHeight);
- const QRect sourceRightRect(sourceCenterRight, sourceCenterTop, sourceMargins.right(), sourceCenterHeight);
- qDrawVerticallyRepeatedPixmap(painter, targetRightRect, pixmap, sourceRightRect);
- }
- break;
- case Qt::Round:
+ if (targetCenterHeight > 0 && sourceCenterHeight > 0) {
if (targetMargins.left() > 0 && sourceMargins.left() > 0) { // left
- const QRect targetLeftRect(targetLeft, targetCenterTop, targetMargins.left(), targetCenterHeight);
- const QRect sourceLeftRect(sourceLeft, sourceCenterTop, sourceMargins.left(), sourceCenterHeight);
- qDrawVerticallyRoundedPixmap(painter, targetLeftRect, pixmap, sourceLeftRect);
+ QDrawPixmapsDataArray &data = hints & QDrawBorderPixmap::OpaqueLeft ? opaqueData : translucentData;
+ d.source = QRectF(sourceRect.left(), sourceCenterTop, sourceMargins.left(), sourceCenterHeight);
+ d.point.setX(0.5 * (xTarget[1] + xTarget[0]));
+ d.scaleX = qreal(xTarget[1] - xTarget[0]) / d.source.width();
+ d.scaleY = dy / d.source.height();
+ for (int i = 1; i < rows - 1; ++i) {
+ d.point.setY(0.5 * (yTarget[i + 1] + yTarget[i]));
+ data.append(d);
+ }
+ if (rules.vertical == Qt::RepeatTile)
+ data[data.size() - 1].source.setHeight((yTarget[rows - 1] - yTarget[rows - 2]) / d.scaleY);
}
if (targetMargins.right() > 0 && sourceMargins.right() > 0) { // right
- const QRect targetRightRect(targetCenterRight, targetCenterTop, targetMargins.right(), targetCenterHeight);
- const QRect sourceRightRect(sourceCenterRight, sourceCenterTop, sourceMargins.right(), sourceCenterHeight);
- qDrawVerticallyRoundedPixmap(painter, targetRightRect, pixmap, sourceRightRect);
+ QDrawPixmapsDataArray &data = hints & QDrawBorderPixmap::OpaqueRight ? opaqueData : translucentData;
+ d.source = QRectF(sourceCenterRight, sourceCenterTop, sourceMargins.right(), sourceCenterHeight);
+ d.point.setX(0.5 * (xTarget[columns] + xTarget[columns - 1]));
+ d.scaleX = qreal(xTarget[columns] - xTarget[columns - 1]) / d.source.width();
+ d.scaleY = dy / d.source.height();
+ for (int i = 1; i < rows - 1; ++i) {
+ d.point.setY(0.5 * (yTarget[i + 1] + yTarget[i]));
+ data.append(d);
+ }
+ if (rules.vertical == Qt::RepeatTile)
+ data[data.size() - 1].source.setHeight((yTarget[rows - 1] - yTarget[rows - 2]) / d.scaleY);
}
- break;
}
// center
if (targetCenterWidth > 0 && targetCenterHeight > 0 && sourceCenterWidth > 0 && sourceCenterHeight > 0) {
- const QRect targetCenterRect(targetCenterLeft, targetCenterTop, targetCenterWidth, targetCenterHeight);
- const QRect sourceCenterRect(sourceCenterLeft, sourceCenterTop, sourceCenterWidth, sourceCenterHeight);
- switch (rules.horizontal) {
- case Qt::Stretch:
- switch (rules.vertical) {
- case Qt::Stretch: // stretch stretch
- qDrawPixmap(painter, targetCenterRect, pixmap, sourceCenterRect);
- break;
- case Qt::Repeat: // stretch repeat
- qVerticalRepeat(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap);
- break;
- case Qt::Round: // stretch round
- qVerticalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap);
- break;
- }
- break;
- case Qt::Repeat:
- switch (rules.vertical) {
- case Qt::Stretch: // repeat stretch
- qHorizontalRepeat(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap);
- break;
- case Qt::Repeat: // repeat repeat
- qVerticalRepeat(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawHorizontallyRepeatedPixmap);
- break;
- case Qt::Round: // repeat round
- qVerticalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawHorizontallyRepeatedPixmap);
- break;
+ QDrawPixmapsDataArray &data = hints & QDrawBorderPixmap::OpaqueCenter ? opaqueData : translucentData;
+ d.source = QRectF(sourceCenterLeft, sourceCenterTop, sourceCenterWidth, sourceCenterHeight);
+ d.scaleX = dx / d.source.width();
+ d.scaleY = dy / d.source.height();
+
+ qreal repeatWidth = (xTarget[columns - 1] - xTarget[columns - 2]) / d.scaleX;
+ qreal repeatHeight = (yTarget[rows - 1] - yTarget[rows - 2]) / d.scaleY;
+
+ for (int j = 1; j < rows - 1; ++j) {
+ d.point.setY(0.5 * (yTarget[j + 1] + yTarget[j]));
+ for (int i = 1; i < columns - 1; ++i) {
+ d.point.setX(0.5 * (xTarget[i + 1] + xTarget[i]));
+ data.append(d);
}
- break;
- case Qt::Round:
- switch (rules.vertical) {
- case Qt::Stretch: // round stretch
- qHorizontalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawPixmap);
- break;
- case Qt::Repeat: // round repeat
- qHorizontalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawVerticallyRepeatedPixmap);
- break;
- case Qt::Round: // round round
- qHorizontalRound(painter, targetCenterRect, pixmap, sourceCenterRect, qDrawVerticallyRoundedPixmap);
- break;
- }
- break;
+ if (rules.horizontal == Qt::RepeatTile)
+ data[data.size() - 1].source.setWidth(repeatWidth);
+ }
+ if (rules.vertical == Qt::RepeatTile) {
+ for (int i = 1; i < columns - 1; ++i)
+ data[data.size() - i].source.setHeight(repeatHeight);
}
}
+
+ if (opaqueData.size())
+ qDrawPixmaps(painter, opaqueData.data(), opaqueData.size(), pixmap, QDrawPixmaps::OpaqueHint);
+ if (translucentData.size())
+ qDrawPixmaps(painter, translucentData.data(), translucentData.size(), pixmap);
+}
+
+/*!
+ \class QDrawPixmaps::Data
+ \since 4.6
+ \internal
+
+ This structure is used with the qDrawPixmaps() function.
+
+ QPointF point: Specifies the center of the target rectangle.
+ QRectF source: Specifies the source rectangle in the pixmap passed into the qDrawPixmaps() call.
+ qreal scaleX: Specifies the horizontal scale of the target rectangle.
+ qreal scaleY: Specifies the vertical scale of the target rectangle.
+ qreal rotation: Specifies the rotation of the target rectangle in degrees.
+ The target rectangle is rotated after scaling.
+ qreal opacity: Specifies the opacity of the rectangle.
+*/
+
+/*!
+ \enum QDrawPixmaps::DrawingHint
+ \internal
+*/
+
+/*!
+ \internal
+ \since 4.6
+
+ This function is used to draw \a pixmap, or a sub-rectangle of \a pixmap, at multiple positions
+ with different scale, rotation and opacity on \a painter. \a drawingData is an array of \a
+ dataCount elements specifying the parameters used to draw each pixmap instance.
+ This can be used for example to implement a particle system.
+*/
+void qDrawPixmaps(QPainter *painter, const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints hints)
+{
+ QPaintEngine *engine = painter->paintEngine();
+ if (!engine)
+ return;
+
+ if (engine->isExtended()) {
+ static_cast<QPaintEngineEx *>(engine)->drawPixmaps(drawingData, dataCount, pixmap, hints);
+ } else {
+ qreal oldOpacity = painter->opacity();
+ QTransform oldTransform = painter->transform();
+
+ for (int i = 0; i < dataCount; ++i) {
+ QTransform transform = oldTransform;
+ transform.translate(drawingData[i].point.x(), drawingData[i].point.y());
+ transform.rotate(drawingData[i].rotation);
+ painter->setOpacity(oldOpacity * drawingData[i].opacity);
+ painter->setTransform(transform);
+
+ qreal w = drawingData[i].scaleX * drawingData[i].source.width();
+ qreal h = drawingData[i].scaleY * drawingData[i].source.height();
+ painter->drawPixmap(QRectF(-0.5 * w, -0.5 * h, w, h), pixmap, drawingData[i].source);
+ }
+
+ painter->setOpacity(oldOpacity);
+ painter->setTransform(oldTransform);
+ }
}
QT_END_NAMESPACE
diff --git a/src/gui/painting/qdrawutil.h b/src/gui/painting/qdrawutil.h
index 3a2dd0e..fff1cc1 100644
--- a/src/gui/painting/qdrawutil.h
+++ b/src/gui/painting/qdrawutil.h
@@ -137,27 +137,82 @@ struct QTileRules
{
inline QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule)
: horizontal(horizontalRule), vertical(verticalRule) {}
- inline QTileRules(Qt::TileRule rule = Qt::Stretch)
+ inline QTileRules(Qt::TileRule rule = Qt::StretchTile)
: horizontal(rule), vertical(rule) {}
Qt::TileRule horizontal;
Qt::TileRule vertical;
};
-Q_GUI_EXPORT void qDrawBorderPixmap(QPainter *painter,
- const QRect &targetRect,
- const QMargins &targetMargins,
+#ifndef Q_QDOC
+// For internal use only.
+namespace QDrawBorderPixmap
+{
+ enum DrawingHint
+ {
+ OpaqueTopLeft = 0x0001,
+ OpaqueTop = 0x0002,
+ OpaqueTopRight = 0x0004,
+ OpaqueLeft = 0x0008,
+ OpaqueCenter = 0x0010,
+ OpaqueRight = 0x0020,
+ OpaqueBottomLeft = 0x0040,
+ OpaqueBottom = 0x0080,
+ OpaqueBottomRight = 0x0100,
+ OpaqueCorners = OpaqueTopLeft | OpaqueTopRight | OpaqueBottomLeft | OpaqueBottomRight,
+ OpaqueEdges = OpaqueTop | OpaqueLeft | OpaqueRight | OpaqueBottom,
+ OpaqueFrame = OpaqueCorners | OpaqueEdges,
+ OpaqueAll = OpaqueCenter | OpaqueFrame
+ };
+
+ Q_DECLARE_FLAGS(DrawingHints, DrawingHint)
+}
+#endif
+
+Q_GUI_EXPORT void qDrawBorderPixmap(QPainter *painter,
+ const QRect &targetRect,
+ const QMargins &targetMargins,
const QPixmap &pixmap,
- const QRect &sourceRect,
- const QMargins &sourceMargins,
- const QTileRules &rules = QTileRules());
-inline void qDrawBorderPixmap(QPainter *painter,
- const QRect &target,
- const QMargins &margins,
+ const QRect &sourceRect,
+ const QMargins &sourceMargins,
+ const QTileRules &rules = QTileRules()
+#ifndef Q_QDOC
+ , QDrawBorderPixmap::DrawingHints hints = 0
+#endif
+ );
+
+inline void qDrawBorderPixmap(QPainter *painter,
+ const QRect &target,
+ const QMargins &margins,
const QPixmap &pixmap)
{
qDrawBorderPixmap(painter, target, margins, pixmap, pixmap.rect(), margins);
}
+// For internal use only.
+namespace QDrawPixmaps
+{
+ struct Data
+ {
+ QPointF point;
+ QRectF source;
+ qreal scaleX;
+ qreal scaleY;
+ qreal rotation;
+ qreal opacity;
+ };
+
+ enum DrawingHint
+ {
+ OpaqueHint = 0x01
+ };
+
+ Q_DECLARE_FLAGS(DrawingHints, DrawingHint)
+}
+
+// This function is private and may change without notice. Do not use outside Qt!!!
+Q_GUI_EXPORT void qDrawPixmaps(QPainter *painter, const QDrawPixmaps::Data *drawingData,
+ int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints hints = 0);
+
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 60e4df6..d712669 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -932,6 +932,31 @@ 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)
+{
+ qreal oldOpacity = state()->opacity;
+ QTransform oldTransform = state()->matrix;
+
+ for (int i = 0; i < dataCount; ++i) {
+ QTransform transform = oldTransform;
+ transform.translate(drawingData[i].point.x(), drawingData[i].point.y());
+ transform.rotate(drawingData[i].rotation);
+ state()->opacity = oldOpacity * drawingData[i].opacity;
+ state()->matrix = transform;
+ opacityChanged();
+ transformChanged();
+
+ qreal w = drawingData[i].scaleX * drawingData[i].source.width();
+ qreal h = drawingData[i].scaleY * drawingData[i].source.height();
+ drawPixmap(QRectF(-0.5 * w, -0.5 * h, w, h), pixmap, drawingData[i].source);
+ }
+
+ state()->opacity = oldOpacity;
+ state()->matrix = oldTransform;
+ opacityChanged();
+ transformChanged();
+}
+
void QPaintEngineEx::setState(QPainterState *s)
{
QPaintEngine::state = s;
diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h
index 814a0f0..81ed06b 100644
--- a/src/gui/painting/qpaintengineex_p.h
+++ b/src/gui/painting/qpaintengineex_p.h
@@ -71,6 +71,11 @@ class QPainterState;
class QPaintEngineExPrivate;
struct StrokeHandler;
+namespace QDrawPixmaps
+{
+ struct Data;
+ enum DrawingHint;
+}
struct QIntRect {
int x1, y1, x2, y2;
@@ -133,8 +138,6 @@ public:
qreal pts[8];
};
-
-
#ifndef QT_NO_DEBUG_STREAM
QDebug Q_GUI_EXPORT &operator<<(QDebug &, const QVectorPath &path);
#endif
@@ -198,6 +201,8 @@ public:
virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s);
+ virtual void drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QFlags<QDrawPixmaps::DrawingHint> hints);
+
virtual void updateState(const QPaintEngineState &state);
virtual void setState(QPainterState *s);
diff --git a/src/gui/s60framework/qs60mainapplication.cpp b/src/gui/s60framework/qs60mainapplication.cpp
index 54fb3b1..2973c97 100644
--- a/src/gui/s60framework/qs60mainapplication.cpp
+++ b/src/gui/s60framework/qs60mainapplication.cpp
@@ -63,7 +63,7 @@ _LIT(KQtWrapperResourceFile, "\\resource\\apps\\s60main.rsc");
* \class QS60MainApplication
* \obsolete
* \since 4.6
- * \brief Helper class for S60 migration
+ * \brief The QS60MainApplication class provides support for migration from S60.
*
* The QS60MainApplication provides a helper class for use in migrating from existing S60 based
* applications to Qt based applications. It is used in the exact same way as the
@@ -80,7 +80,7 @@ _LIT(KQtWrapperResourceFile, "\\resource\\apps\\s60main.rsc");
* Unlike other Qt classes, QS60MainApplication behaves like an S60 class, and can throw Symbian
* leaves.
*
- * \sa QS60MainDocument, QS60MainAppUi, QApplication::QApplication(QApplication::QS60MainApplicationFactory, int &, char **)
+ * \sa QS60MainDocument, QS60MainAppUi, QApplication::QS60MainApplicationFactory
*/
/*!
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp
index 0f3a88b..707b05e 100644
--- a/src/gui/styles/qstylesheetstyle.cpp
+++ b/src/gui/styles/qstylesheetstyle.cpp
@@ -1126,7 +1126,7 @@ void QRenderRule::fixupBorder(int nativeWidth)
void QRenderRule::drawBorderImage(QPainter *p, const QRect& rect)
{
static const Qt::TileRule tileMode2TileRule[] = {
- Qt::Stretch, Qt::Round, Qt::Stretch, Qt::Repeat, Qt::Stretch };
+ Qt::StretchTile, Qt::RoundTile, Qt::StretchTile, Qt::RepeatTile, Qt::StretchTile };
const QStyleSheetBorderImageData *borderImageData = border()->borderImage();
const int *targetBorders = border()->borders;
diff --git a/src/gui/widgets/qabstractslider.cpp b/src/gui/widgets/qabstractslider.cpp
index c3289b4..19a8b63 100644
--- a/src/gui/widgets/qabstractslider.cpp
+++ b/src/gui/widgets/qabstractslider.cpp
@@ -693,13 +693,8 @@ void QAbstractSlider::wheelEvent(QWheelEvent * e)
if (e->orientation() != d->orientation && !rect().contains(e->pos()))
return;
- int step = qMin(QApplication::wheelScrollLines() * d->singleStep, d->pageStep);
- if ((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & Qt::ShiftModifier))
- step = d->pageStep;
-
- qreal currentOffset = qreal(e->delta()) * step / 120;
- d->offset_accumulated += d->invertedControls ? -currentOffset : currentOffset;
-
+ qreal currentOffset = qreal(e->delta()) / 120;
+ d->offset_accumulated += currentOffset;
if (int(d->offset_accumulated) == 0) {
// QAbstractSlider works on integer values. So if the accumulated
// offset is less than +/- 1, we need to wait until we get more
@@ -708,8 +703,27 @@ void QAbstractSlider::wheelEvent(QWheelEvent * e)
return;
}
+ int stepsToScroll;
+ if ((e->modifiers() & Qt::ControlModifier) || (e->modifiers() & Qt::ShiftModifier)) {
+ stepsToScroll = currentOffset > 0 ? d->pageStep : -d->pageStep;
+ } else {
+ // Calculate the number of steps to scroll (per 15 degrees of rotate):
+#ifdef Q_OS_MAC
+ // On mac, since mouse wheel scrolling is accelerated and
+ // fine tuned by the OS, we skip applying acceleration:
+ stepsToScroll = int(d->offset_accumulated);
+#else
+ stepsToScroll = int(d->offset_accumulated) * QApplication::wheelScrollLines() * d->singleStep;
+#endif
+ if (qAbs(stepsToScroll) > d->pageStep)
+ stepsToScroll = currentOffset > 0 ? d->pageStep : -d->pageStep;
+ }
+
+ if (d->invertedControls)
+ stepsToScroll = -stepsToScroll;
+
int prevValue = d->value;
- d->position = d->overflowSafeAdd(int(d->offset_accumulated)); // value will be updated by triggerAction()
+ d->position = d->overflowSafeAdd(stepsToScroll); // value will be updated by triggerAction()
triggerAction(SliderMove);
if (prevValue == d->value) {
diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp
index 5ff323a..5ba0571 100644
--- a/src/gui/widgets/qlabel.cpp
+++ b/src/gui/widgets/qlabel.cpp
@@ -886,7 +886,18 @@ void QLabel::focusInEvent(QFocusEvent *ev)
void QLabel::focusOutEvent(QFocusEvent *ev)
{
Q_D(QLabel);
- d->sendControlEvent(ev);
+ if (d->control) {
+ d->sendControlEvent(ev);
+ QTextCursor cursor = d->control->textCursor();
+ Qt::FocusReason reason = ev->reason();
+ if (reason != Qt::ActiveWindowFocusReason
+ && reason != Qt::PopupFocusReason
+ && cursor.hasSelection()) {
+ cursor.clearSelection();
+ d->control->setTextCursor(cursor);
+ }
+ }
+
QFrame::focusOutEvent(ev);
}
diff --git a/src/gui/widgets/qtextedit.cpp b/src/gui/widgets/qtextedit.cpp
index 3fe9bb4..dc78fd5 100644
--- a/src/gui/widgets/qtextedit.cpp
+++ b/src/gui/widgets/qtextedit.cpp
@@ -174,13 +174,8 @@ void QTextEditPrivate::init(const QString &html)
if (!html.isEmpty())
control->setHtml(html);
-#ifdef Q_OS_MAC
- hbar->setSingleStep(1);
- vbar->setSingleStep(1);
-#else
hbar->setSingleStep(20);
vbar->setSingleStep(20);
-#endif
viewport->setBackgroundRole(QPalette::Base);
q->setAcceptDrops(true);
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index 84224ec..f890d12 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -312,7 +312,7 @@ bool QNativeSocketEnginePrivate::setOption(QNativeSocketEngine::SocketOption opt
return true;
}
case QNativeSocketEngine::AddressReusable:
-#ifdef SO_REUSEPORT
+#if defined(SO_REUSEPORT) && !defined(Q_OS_SYMBIAN)
n = SO_REUSEPORT;
#else
n = SO_REUSEADDR;
@@ -1018,10 +1018,12 @@ int QNativeSocketEnginePrivate::nativeSelect(int timeout, bool checkRead, bool c
if(selectForExec) {
qWarning("nativeSelect (checkRead %d, checkWrite %d, ret %d, errno %d): Unexpected expectfds ready in fd %d",
checkRead, checkWrite, ret, errno, socketDescriptor);
- if (checkRead)
- FD_SET(socketDescriptor, &fdread);
- if (checkWrite)
+ if (checkWrite){
+ FD_CLR(socketDescriptor, &fdread);
FD_SET(socketDescriptor, &fdwrite);
+ } else if (checkRead)
+ FD_SET(socketDescriptor, &fdread);
+
if ((ret == -1) && ( errno == ECONNREFUSED || errno == EPIPE ))
ret = 1;
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
index fcb20b4..59c50aa 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -97,6 +97,7 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context)
code[MainVertexShader] = qglslMainVertexShader;
code[MainWithTexCoordsVertexShader] = qglslMainWithTexCoordsVertexShader;
+ code[MainWithTexCoordsAndOpacityVertexShader] = qglslMainWithTexCoordsAndOpacityVertexShader;
code[UntransformedPositionVertexShader] = qglslUntransformedPositionVertexShader;
code[PositionOnlyVertexShader] = qglslPositionOnlyVertexShader;
@@ -119,6 +120,7 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context)
code[MainFragmentShader_C] = qglslMainFragmentShader_C;
code[MainFragmentShader_O] = qglslMainFragmentShader_O;
code[MainFragmentShader] = qglslMainFragmentShader;
+ code[MainFragmentShader_ImageArrays] = qglslMainFragmentShader_ImageArrays;
code[ImageSrcFragmentShader] = qglslImageSrcFragmentShader;
code[ImageSrcWithPatternFragmentShader] = qglslImageSrcWithPatternFragmentShader;
@@ -285,6 +287,8 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS
cached.program->bindAttributeLocation("vertexCoordsArray", QT_VERTEX_COORDS_ATTR);
if (cached.useTextureCoords)
cached.program->bindAttributeLocation("textureCoordArray", QT_TEXTURE_COORDS_ATTR);
+ if (cached.useOpacityAttribute)
+ cached.program->bindAttributeLocation("opacityArray", QT_OPACITY_ATTR);
cached.program->link();
if (!cached.program->isLinked()) {
@@ -331,7 +335,7 @@ QGLEngineShaderManager::QGLEngineShaderManager(QGLContext* context)
: ctx(context),
shaderProgNeedsChanging(true),
srcPixelType(Qt::NoBrush),
- useGlobalOpacity(false),
+ opacityMode(NoOpacity),
maskType(NoMask),
compositionMode(QPainter::CompositionMode_SourceOver),
customSrcStage(0),
@@ -407,12 +411,12 @@ void QGLEngineShaderManager::setSrcPixelType(PixelSrcType type)
shaderProgNeedsChanging = true; //###
}
-void QGLEngineShaderManager::setUseGlobalOpacity(bool useOpacity)
+void QGLEngineShaderManager::setOpacityMode(OpacityMode mode)
{
- if (useGlobalOpacity == useOpacity)
+ if (opacityMode == mode)
return;
- useGlobalOpacity = useOpacity;
+ opacityMode = mode;
shaderProgNeedsChanging = true; //###
}
@@ -564,22 +568,28 @@ bool QGLEngineShaderManager::useCorrectShaderProg()
// Choose fragment shader main function:
QGLEngineSharedShaders::ShaderName mainFragShaderName;
- if (hasCompose && hasMask && useGlobalOpacity)
- mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_CMO;
- if (hasCompose && hasMask && !useGlobalOpacity)
- mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_CM;
- if (!hasCompose && hasMask && useGlobalOpacity)
- mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_MO;
- if (!hasCompose && hasMask && !useGlobalOpacity)
- mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_M;
- if (hasCompose && !hasMask && useGlobalOpacity)
- mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_CO;
- if (hasCompose && !hasMask && !useGlobalOpacity)
- mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_C;
- if (!hasCompose && !hasMask && useGlobalOpacity)
- mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_O;
- if (!hasCompose && !hasMask && !useGlobalOpacity)
- mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader;
+ if (opacityMode == AttributeOpacity) {
+ Q_ASSERT(!hasCompose && !hasMask);
+ mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_ImageArrays;
+ } else {
+ bool useGlobalOpacity = (opacityMode == UniformOpacity);
+ if (hasCompose && hasMask && useGlobalOpacity)
+ mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_CMO;
+ if (hasCompose && hasMask && !useGlobalOpacity)
+ mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_CM;
+ if (!hasCompose && hasMask && useGlobalOpacity)
+ mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_MO;
+ if (!hasCompose && hasMask && !useGlobalOpacity)
+ mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_M;
+ if (hasCompose && !hasMask && useGlobalOpacity)
+ mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_CO;
+ if (hasCompose && !hasMask && !useGlobalOpacity)
+ mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_C;
+ if (!hasCompose && !hasMask && useGlobalOpacity)
+ mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader_O;
+ if (!hasCompose && !hasMask && !useGlobalOpacity)
+ mainFragShaderName = QGLEngineSharedShaders::MainFragmentShader;
+ }
requiredProgram.mainFragShader = sharedShaders->compileNamedShader(mainFragShaderName, QGLShader::PartialFragmentShader);
@@ -652,12 +662,17 @@ bool QGLEngineShaderManager::useCorrectShaderProg()
// Choose vertex shader main function
QGLEngineSharedShaders::ShaderName mainVertexShaderName = QGLEngineSharedShaders::InvalidShaderName;
- if (texCoords)
+ if (opacityMode == AttributeOpacity) {
+ Q_ASSERT(texCoords);
+ mainVertexShaderName = QGLEngineSharedShaders::MainWithTexCoordsAndOpacityVertexShader;
+ } else if (texCoords) {
mainVertexShaderName = QGLEngineSharedShaders::MainWithTexCoordsVertexShader;
- else
+ } else {
mainVertexShaderName = QGLEngineSharedShaders::MainVertexShader;
+ }
requiredProgram.mainVertexShader = sharedShaders->compileNamedShader(mainVertexShaderName, QGLShader::PartialVertexShader);
requiredProgram.useTextureCoords = texCoords;
+ requiredProgram.useOpacityAttribute = (opacityMode == AttributeOpacity);
// At this point, requiredProgram is fully populated so try to find the program in the cache
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
index fbb6d9c..291d24c 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
@@ -247,6 +247,7 @@ struct QGLEngineShaderProg
QVector<uint> uniformLocations;
bool useTextureCoords;
+ bool useOpacityAttribute;
bool operator==(const QGLEngineShaderProg& other) {
// We don't care about the program
@@ -277,6 +278,7 @@ struct QGLEngineCachedShaderProg
static const GLuint QT_VERTEX_COORDS_ATTR = 0;
static const GLuint QT_TEXTURE_COORDS_ATTR = 1;
+static const GLuint QT_OPACITY_ATTR = 2;
class QGLEngineSharedShaders : public QObject
{
@@ -285,6 +287,7 @@ public:
enum ShaderName {
MainVertexShader,
MainWithTexCoordsVertexShader,
+ MainWithTexCoordsAndOpacityVertexShader,
UntransformedPositionVertexShader,
PositionOnlyVertexShader,
@@ -307,6 +310,7 @@ public:
MainFragmentShader_C,
MainFragmentShader_O,
MainFragmentShader,
+ MainFragmentShader_ImageArrays,
ImageSrcFragmentShader,
ImageSrcWithPatternFragmentShader,
@@ -406,13 +410,19 @@ public:
NumUniforms
};
+ enum OpacityMode {
+ NoOpacity,
+ UniformOpacity,
+ AttributeOpacity
+ };
+
// There are optimisations we can do, depending on the brush transform:
// 1) May not have to apply perspective-correction
// 2) Can use lower precision for matrix
void optimiseForBrushTransform(const QTransform &transform);
void setSrcPixelType(Qt::BrushStyle);
void setSrcPixelType(PixelSrcType); // For non-brush sources, like pixmaps & images
- void setUseGlobalOpacity(bool);
+ void setOpacityMode(OpacityMode);
void setMaskType(MaskType);
void setCompositionMode(QPainter::CompositionMode);
void setCustomStage(QGLCustomShaderStage* stage);
@@ -451,7 +461,7 @@ private:
// Current state variables which influence the choice of shader:
QTransform brushTransform;
int srcPixelType;
- bool useGlobalOpacity;
+ OpacityMode opacityMode;
MaskType maskType;
QPainter::CompositionMode compositionMode;
QGLCustomShaderStage* customSrcStage;
diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
index 8ae86d3..6712bf6 100644
--- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
@@ -84,6 +84,20 @@ static const char* const qglslMainWithTexCoordsVertexShader = "\
textureCoords = textureCoordArray; \
}";
+static const char* const qglslMainWithTexCoordsAndOpacityVertexShader = "\
+ attribute highp vec2 textureCoordArray; \
+ attribute lowp float opacityArray; \
+ varying highp vec2 textureCoords; \
+ varying lowp float opacity; \
+ uniform highp float depth; \
+ void setPosition(); \
+ void main(void) \
+ { \
+ setPosition(); \
+ gl_Position.z = depth * gl_Position.w; \
+ textureCoords = textureCoordArray; \
+ opacity = opacityArray; \
+ }";
static const char* const qglslPositionOnlyVertexShader = "\
attribute highp vec4 vertexCoordsArray;\
@@ -331,6 +345,12 @@ static const char* const qglslShockingPinkSrcFragmentShader = "\
return vec4(0.98, 0.06, 0.75, 1.0); \
}";
+static const char* const qglslMainFragmentShader_ImageArrays = "\
+ varying lowp float opacity; \
+ lowp vec4 srcPixel(); \
+ void main() { \
+ gl_FragColor = srcPixel() * opacity; \
+ }";
static const char* const qglslMainFragmentShader_CMO = "\
uniform lowp float globalOpacity; \
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index f612bc0..992d47d 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -366,7 +366,7 @@ void QGL2PaintEngineExPrivate::updateTextureFilter(GLenum target, GLenum wrapMod
}
-QColor QGL2PaintEngineExPrivate::premultiplyColor(QColor c, GLfloat opacity)
+inline QColor qt_premultiplyColor(QColor c, GLfloat opacity)
{
qreal alpha = c.alphaF() * opacity;
c.setAlphaF(alpha);
@@ -469,7 +469,7 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms()
QTransform brushQTransform = currentBrush->transform();
if (style == Qt::SolidPattern) {
- QColor col = premultiplyColor(currentBrush->color(), (GLfloat)q->state()->opacity);
+ QColor col = qt_premultiplyColor(currentBrush->color(), (GLfloat)q->state()->opacity);
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::FragmentColor), col);
}
else {
@@ -479,7 +479,7 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms()
if (style <= Qt::DiagCrossPattern) {
translationPoint = q->state()->brushOrigin;
- QColor col = premultiplyColor(currentBrush->color(), (GLfloat)q->state()->opacity);
+ QColor col = qt_premultiplyColor(currentBrush->color(), (GLfloat)q->state()->opacity);
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::PatternColor), col);
@@ -541,7 +541,7 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms()
const QPixmap& texPixmap = currentBrush->texture();
if (qHasPixmapTexture(*currentBrush) && currentBrush->texture().isQBitmap()) {
- QColor col = premultiplyColor(currentBrush->color(), (GLfloat)q->state()->opacity);
+ QColor col = qt_premultiplyColor(currentBrush->color(), (GLfloat)q->state()->opacity);
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::PatternColor), col);
}
@@ -712,7 +712,7 @@ void QGL2PaintEngineExPrivate::drawTexture(const QGLRect& dest, const QGLRect& s
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::ImageTexture), QT_IMAGE_TEXTURE_UNIT);
if (pattern) {
- QColor col = premultiplyColor(q->state()->pen.color(), (GLfloat)q->state()->opacity);
+ QColor col = qt_premultiplyColor(q->state()->pen.color(), (GLfloat)q->state()->opacity);
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::PatternColor), col);
}
@@ -796,9 +796,10 @@ void QGL2PaintEngineExPrivate::transferMode(EngineMode newMode)
if (newMode == mode)
return;
- if (mode == TextDrawingMode || mode == ImageDrawingMode) {
+ if (mode == TextDrawingMode || mode == ImageDrawingMode || mode == ImageArrayDrawingMode) {
glDisableVertexAttribArray(QT_TEXTURE_COORDS_ATTR);
glDisableVertexAttribArray(QT_VERTEX_COORDS_ATTR);
+ glDisableVertexAttribArray(QT_OPACITY_ATTR);
lastTexture = GLuint(-1);
}
@@ -824,6 +825,16 @@ void QGL2PaintEngineExPrivate::transferMode(EngineMode newMode)
glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, staticTextureCoordinateArray);
}
+ if (newMode == ImageArrayDrawingMode) {
+ glEnableVertexAttribArray(QT_VERTEX_COORDS_ATTR);
+ glEnableVertexAttribArray(QT_TEXTURE_COORDS_ATTR);
+ glEnableVertexAttribArray(QT_OPACITY_ATTR);
+
+ glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray.data());
+ glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray.data());
+ glVertexAttribPointer(QT_OPACITY_ATTR, 1, GL_FLOAT, GL_FALSE, 0, opacityArray.data());
+ }
+
// This needs to change when we implement high-quality anti-aliasing...
if (newMode != TextDrawingMode)
shaderManager->setMaskType(QGLEngineShaderManager::NoMask);
@@ -953,7 +964,7 @@ void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(QGL2PEXVertexArray& ve
bool QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque)
{
- if (brushTextureDirty && mode != ImageDrawingMode)
+ if (brushTextureDirty && mode != ImageDrawingMode && mode != ImageArrayDrawingMode)
updateBrushTexture();
if (compositionModeDirty)
@@ -972,16 +983,22 @@ bool QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque)
glEnable(GL_BLEND);
}
- bool useGlobalOpacityUniform = stateHasOpacity;
- if (stateHasOpacity && (mode != ImageDrawingMode)) {
- // Using a brush
- bool brushIsPattern = (currentBrush->style() >= Qt::Dense1Pattern) &&
- (currentBrush->style() <= Qt::DiagCrossPattern);
-
- if ((currentBrush->style() == Qt::SolidPattern) || brushIsPattern)
- useGlobalOpacityUniform = false; // Global opacity handled by srcPixel shader
+ QGLEngineShaderManager::OpacityMode opacityMode;
+ if (mode == ImageArrayDrawingMode) {
+ opacityMode = QGLEngineShaderManager::AttributeOpacity;
+ } else {
+ opacityMode = stateHasOpacity ? QGLEngineShaderManager::UniformOpacity
+ : QGLEngineShaderManager::NoOpacity;
+ if (stateHasOpacity && (mode != ImageDrawingMode)) {
+ // Using a brush
+ bool brushIsPattern = (currentBrush->style() >= Qt::Dense1Pattern) &&
+ (currentBrush->style() <= Qt::DiagCrossPattern);
+
+ if ((currentBrush->style() == Qt::SolidPattern) || brushIsPattern)
+ opacityMode = QGLEngineShaderManager::NoOpacity; // Global opacity handled by srcPixel shader
+ }
}
- shaderManager->setUseGlobalOpacity(useGlobalOpacityUniform);
+ shaderManager->setOpacityMode(opacityMode);
bool changed = shaderManager->useCorrectShaderProg();
// If the shader program needs changing, we change it and mark all uniforms as dirty
@@ -993,7 +1010,7 @@ bool QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque)
opacityUniformDirty = true;
}
- if (brushUniformsDirty && mode != ImageDrawingMode)
+ if (brushUniformsDirty && mode != ImageDrawingMode && mode != ImageArrayDrawingMode)
updateBrushUniforms();
if (shaderMatrixUniformDirty) {
@@ -1006,7 +1023,7 @@ bool QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque)
depthUniformDirty = false;
}
- if (useGlobalOpacityUniform && opacityUniformDirty) {
+ if (opacityMode == QGLEngineShaderManager::UniformOpacity && opacityUniformDirty) {
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::GlobalOpacity), (GLfloat)q->state()->opacity);
opacityUniformDirty = false;
}
@@ -1332,7 +1349,7 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, QFontEngineGly
QColor c = pensBrush.color();
qreal oldOpacity = q->state()->opacity;
if (compMode == QPainter::CompositionMode_Source) {
- c = premultiplyColor(c, q->state()->opacity);
+ c = qt_premultiplyColor(c, q->state()->opacity);
q->state()->opacity = 1;
opacityUniformDirty = true;
}
@@ -1411,6 +1428,96 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(const QPointF &p, QFontEngineGly
glDrawArrays(GL_TRIANGLES, 0, 6 * glyphs.size());
}
+void QGL2PaintEngineEx::drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints hints)
+{
+ // Use fallback for extended composition modes.
+ if (state()->composition_mode > QPainter::CompositionMode_Plus) {
+ QPaintEngineEx::drawPixmaps(drawingData, dataCount, pixmap, hints);
+ return;
+ }
+
+ Q_D(QGL2PaintEngineEx);
+
+ GLfloat dx = 1.0f / pixmap.size().width();
+ GLfloat dy = 1.0f / pixmap.size().height();
+
+ d->vertexCoordinateArray.clear();
+ d->textureCoordinateArray.clear();
+ d->opacityArray.reset();
+
+ bool allOpaque = true;
+
+ for (int i = 0; i < dataCount; ++i) {
+ qreal s = 0;
+ qreal c = 1;
+ if (drawingData[i].rotation != 0) {
+ s = qFastSin(drawingData[i].rotation * Q_PI / 180);
+ c = qFastCos(drawingData[i].rotation * Q_PI / 180);
+ }
+
+ qreal right = 0.5 * drawingData[i].scaleX * drawingData[i].source.width();
+ qreal bottom = 0.5 * drawingData[i].scaleY * drawingData[i].source.height();
+ QGLPoint bottomRight(right * c - bottom * s, right * s + bottom * c);
+ QGLPoint bottomLeft(-right * c - bottom * s, -right * s + bottom * c);
+
+ d->vertexCoordinateArray.lineToArray(bottomRight.x + drawingData[i].point.x(), bottomRight.y + drawingData[i].point.y());
+ d->vertexCoordinateArray.lineToArray(-bottomLeft.x + drawingData[i].point.x(), -bottomLeft.y + drawingData[i].point.y());
+ d->vertexCoordinateArray.lineToArray(-bottomRight.x + drawingData[i].point.x(), -bottomRight.y + drawingData[i].point.y());
+ d->vertexCoordinateArray.lineToArray(-bottomRight.x + drawingData[i].point.x(), -bottomRight.y + drawingData[i].point.y());
+ d->vertexCoordinateArray.lineToArray(bottomLeft.x + drawingData[i].point.x(), bottomLeft.y + drawingData[i].point.y());
+ d->vertexCoordinateArray.lineToArray(bottomRight.x + drawingData[i].point.x(), bottomRight.y + drawingData[i].point.y());
+
+ QGLRect src(drawingData[i].source.left() * dx, drawingData[i].source.top() * dy,
+ drawingData[i].source.right() * dx, drawingData[i].source.bottom() * dy);
+
+ d->textureCoordinateArray.lineToArray(src.right, src.bottom);
+ d->textureCoordinateArray.lineToArray(src.right, src.top);
+ d->textureCoordinateArray.lineToArray(src.left, src.top);
+ d->textureCoordinateArray.lineToArray(src.left, src.top);
+ d->textureCoordinateArray.lineToArray(src.left, src.bottom);
+ d->textureCoordinateArray.lineToArray(src.right, src.bottom);
+
+ qreal opacity = drawingData[i].opacity * state()->opacity;
+ d->opacityArray << opacity << opacity << opacity << opacity << opacity << opacity;
+ allOpaque &= (opacity >= 0.99f);
+ }
+
+ ensureActive();
+
+ QGLContext *ctx = d->ctx;
+ glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT);
+ QGLTexture *texture = ctx->d_func()->bindTexture(pixmap, GL_TEXTURE_2D, GL_RGBA,
+ QGLContext::InternalBindOption
+ | QGLContext::CanFlipNativePixmapBindOption);
+
+ if (texture->options & QGLContext::InvertedYBindOption) {
+ // Flip texture y-coordinate.
+ QGLPoint *data = d->textureCoordinateArray.data();
+ for (int i = 0; i < 6 * dataCount; ++i)
+ data[i].y = 1 - data[i].y;
+ }
+
+ d->transferMode(ImageArrayDrawingMode);
+
+ bool isBitmap = pixmap.isQBitmap();
+ bool isOpaque = !isBitmap && (!pixmap.hasAlphaChannel() || (hints & QDrawPixmaps::OpaqueHint)) && allOpaque;
+
+ d->updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE,
+ state()->renderHints & QPainter::SmoothPixmapTransform, texture->id);
+
+ // Setup for texture drawing
+ d->shaderManager->setSrcPixelType(isBitmap ? QGLEngineShaderManager::PatternSrc : QGLEngineShaderManager::ImageSrc);
+ if (d->prepareForDraw(isOpaque))
+ d->shaderManager->currentProgram()->setUniformValue(d->location(QGLEngineShaderManager::ImageTexture), QT_IMAGE_TEXTURE_UNIT);
+
+ if (isBitmap) {
+ QColor col = qt_premultiplyColor(state()->pen.color(), (GLfloat)state()->opacity);
+ d->shaderManager->currentProgram()->setUniformValue(d->location(QGLEngineShaderManager::PatternColor), col);
+ }
+
+ glDrawArrays(GL_TRIANGLES, 0, 6 * dataCount);
+}
+
bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
{
Q_D(QGL2PaintEngineEx);
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index f245945..4f42082 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -61,11 +61,13 @@
#include <private/qglpaintdevice_p.h>
#include <private/qglpixmapfilter_p.h>
#include <private/qfontengine_p.h>
+#include <private/qdatabuffer_p.h>
enum EngineMode {
ImageDrawingMode,
TextDrawingMode,
- BrushDrawingMode
+ BrushDrawingMode,
+ ImageArrayDrawingMode
};
QT_BEGIN_NAMESPACE
@@ -126,6 +128,8 @@ public:
virtual void drawTextItem(const QPointF &p, const QTextItem &textItem);
+ virtual void drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints hints);
+
Type type() const { return OpenGL2; }
void setState(QPainterState *s);
@@ -195,7 +199,6 @@ public:
// ^ returns whether the current program changed or not
inline void useSimpleShader();
- inline QColor premultiplyColor(QColor c, GLfloat opacity);
float zValueForRenderText() const;
@@ -230,6 +233,7 @@ public:
QGL2PEXVertexArray vertexCoordinateArray;
QGL2PEXVertexArray textureCoordinateArray;
+ QDataBuffer<GLfloat> opacityArray;
GLfloat staticVertexCoordinateArray[8];
GLfloat staticTextureCoordinateArray[8];
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 0402268..2327d7a 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -59,6 +59,8 @@
# include <private/qt_mac_p.h>
#endif
+#include <qdatetime.h>
+
#include <stdlib.h> // malloc
#include "qpixmap.h"
@@ -2077,6 +2079,8 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
#ifdef QGL_BIND_TEXTURE_DEBUG
printf("QGLContextPrivate::bindTexture(), imageSize=(%d,%d), internalFormat =0x%x, options=%x\n",
image.width(), image.height(), internalFormat, int(options));
+ QTime time;
+ time.start();
#endif
// Scale the pixmap if needed. GL textures needs to have the
@@ -2092,7 +2096,8 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
{
img = img.scaled(tx_w, tx_h);
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - upscaled to %dx%d\n", tx_w, tx_h);
+ printf(" - upscaled to %dx%d (%d ms)\n", tx_w, tx_h, time.elapsed());
+
#endif
}
@@ -2112,7 +2117,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
&& options & QGLContext::MipmapBindOption)
{
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - generating mipmaps\n");
+ printf(" - generating mipmaps (%d ms)\n", time.elapsed());
#endif
#if !defined(QT_OPENGL_ES_2)
glHint(GL_GENERATE_MIPMAP_HINT_SGIS, GL_NICEST);
@@ -2148,7 +2153,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
if (premul) {
img = img.convertToFormat(target_format = QImage::Format_ARGB32_Premultiplied);
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting ARGB32 -> ARGB32_Premultiplied \n");
+ printf(" - converting ARGB32 -> ARGB32_Premultiplied (%d ms) \n", time.elapsed());
#endif
}
break;
@@ -2156,7 +2161,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
if (!premul) {
img = img.convertToFormat(target_format = QImage::Format_ARGB32);
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting ARGB32_Premultiplied -> ARGB32\n");
+ printf(" - converting ARGB32_Premultiplied -> ARGB32 (%d ms)\n", time.elapsed());
#endif
}
break;
@@ -2173,19 +2178,19 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
? QImage::Format_ARGB32_Premultiplied
: QImage::Format_ARGB32);
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting to 32-bit alpha format\n");
+ printf(" - converting to 32-bit alpha format (%d ms)\n", time.elapsed());
#endif
} else {
img = img.convertToFormat(QImage::Format_RGB32);
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - converting to 32-bit\n");
+ printf(" - converting to 32-bit (%d ms)\n", time.elapsed());
#endif
}
}
if (options & QGLContext::InvertedYBindOption) {
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - flipping bits over y\n");
+ printf(" - flipping bits over y (%d ms)\n", time.elapsed());
#endif
int ipl = img.bytesPerLine() / 4;
int h = img.height();
@@ -2199,7 +2204,7 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
if (externalFormat == GL_RGBA) {
#ifdef QGL_BIND_TEXTURE_DEBUG
- printf(" - doing byte swapping\n");
+ printf(" - doing byte swapping (%d ms)\n", time.elapsed());
#endif
// The only case where we end up with a depth different from
// 32 in the switch above is for the RGB16 case, where we set
@@ -2242,6 +2247,13 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
}
#endif
+#ifdef QGL_BIND_TEXTURE_DEBUG
+ static int totalUploadTime = 0;
+ totalUploadTime += time.elapsed();
+ printf(" - upload done in (%d ms) time=%d\n", time.elapsed(), totalUploadTime);
+#endif
+
+
// this assumes the size of a texture is always smaller than the max cache size
int cost = img.width()*img.height()*4/1024;
QGLTexture *texture = new QGLTexture(q, tx_id, target, options);
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index d802bdd..971a660 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -86,9 +86,19 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
qt_egl_add_platform_config(configProps, device());
configProps.setRenderableType(QEgl::OpenGL);
+ QEgl::PixelFormatMatch matchType = QEgl::BestPixelFormat;
+ if (device()->depth() == 16) {
+ configProps.setValue(EGL_RED_SIZE, 5);
+ configProps.setValue(EGL_GREEN_SIZE, 6);
+ configProps.setValue(EGL_BLUE_SIZE, 5);
+ configProps.setValue(EGL_ALPHA_SIZE, 0);
+ matchType = QEgl::ExactPixelFormat;
+ }
+ configProps.setRenderableType(QEgl::OpenGL);
+
// Search for a matching configuration, reducing the complexity
// each time until we get something that matches.
- if (!d->eglContext->chooseConfig(configProps, QEgl::BestPixelFormat)) {
+ if (!d->eglContext->chooseConfig(configProps, matchType)) {
delete d->eglContext;
d->eglContext = 0;
return false;
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index 1ee3bbf..ae4bed0 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -48,9 +48,12 @@
#include <private/qgl_p.h>
#include <private/qdrawhelper_p.h>
+#include <private/qimage_p.h>
#include <private/qpaintengineex_opengl2_p.h>
+#include <qdesktopwidget.h>
+
QT_BEGIN_NAMESPACE
extern QGLWidget* qt_gl_share_widget();
@@ -315,7 +318,7 @@ void QGLPixmapData::ensureCreated() const
}
void QGLPixmapData::fromImage(const QImage &image,
- Qt::ImageConversionFlags)
+ Qt::ImageConversionFlags flags)
{
if (image.size() == QSize(w, h))
setSerialNumber(++qt_gl_pixmap_serial);
@@ -323,20 +326,26 @@ void QGLPixmapData::fromImage(const QImage &image,
if (pixelType() == BitmapType) {
m_source = image.convertToFormat(QImage::Format_MonoLSB);
+
} else {
- m_source = image.hasAlphaChannel()
- ? image.convertToFormat(QImage::Format_ARGB32_Premultiplied)
- : image.convertToFormat(QImage::Format_RGB32);
+ QImage::Format format = QImage::Format_RGB32;
+ if (qApp->desktop()->depth() == 16)
+ format = QImage::Format_RGB16;
+
+ if (image.hasAlphaChannel() && const_cast<QImage &>(image).data_ptr()->checkForAlphaPixels())
+ format = QImage::Format_ARGB32_Premultiplied;;
+
+ m_source = image.convertToFormat(format);
}
m_dirty = true;
m_hasFillColor = false;
- m_hasAlpha = image.hasAlphaChannel();
+ m_hasAlpha = m_source.hasAlphaChannel();
w = image.width();
h = image.height();
is_null = (w <= 0 || h <= 0);
- d = pixelType() == QPixmapData::PixmapType ? 32 : 1;
+ d = m_source.depth();
if (m_texture.id) {
QGLShareContextScope ctx(qt_gl_share_widget()->context());
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index 3a348bc..7f8577a 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -306,8 +306,13 @@ QGLWindowSurface::QGLWindowSurface(QWidget *window)
d_ptr->pb = 0;
d_ptr->fbo = 0;
d_ptr->ctx = 0;
+#if defined (QT_OPENGL_ES_2)
+ d_ptr->tried_fbo = true;
+ d_ptr->tried_pb = true;
+#else
d_ptr->tried_fbo = false;
d_ptr->tried_pb = false;
+#endif
d_ptr->destructive_swap_buffers = qgetenv("QT_GL_SWAPBUFFER_PRESERVE").isNull();
d_ptr->glDevice.d = d_ptr;
d_ptr->q_ptr = this;
@@ -438,6 +443,7 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &
QRect rect = br.translated(-offset - wOffset);
const GLenum target = GL_TEXTURE_2D;
+ Q_UNUSED(target);
if (context()) {
context()->makeCurrent();
diff --git a/src/qt3support/widgets/q3toolbar.cpp b/src/qt3support/widgets/q3toolbar.cpp
index 73b30ab..dbe3afd 100644
--- a/src/qt3support/widgets/q3toolbar.cpp
+++ b/src/qt3support/widgets/q3toolbar.cpp
@@ -422,7 +422,7 @@ void Q3ToolBar::addSeparator()
}
/*!
- \reimp
+ \internal
*/
void Q3ToolBar::styleChange(QStyle &oldStyle)
diff --git a/src/s60installs/qt.svg b/src/s60installs/qt.svg
new file mode 100644
index 0000000..22cb204
--- /dev/null
+++ b/src/s60installs/qt.svg
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" baseProfile="tiny" height="146.3063" version="1.0" viewBox="0 0 122 146" width="121.60006">
+<g transform="translate(-376.34283,-407.78046)">
+<g transform="matrix(0.697424,0,0,0.697424,376.34283,407.78046)">
+<path d="M 43.086,0.358597 C 40.9414,0.00358582 38.8399,-0.0824127 36.8086,0.0775909 L 36.8047,0.0735931 C 36.8047,0.0735931 22.9219,1.01859 22.2891,1.0696 C 9.6211,2.08159 0,12.5036 0,26.8896 L 0,196.554 L 14.1914,209.781 L 156.789,185.816 C 166.606,184.113 174.356,172.538 174.356,160.038 L 174.356,21.8786 L 43.086,0.358597 z" style="fill:#105000;fill-rule:evenodd;stroke:none"/>
+<path d="M 174.356,160.042 C 174.356,172.538 166.606,184.113 156.789,185.816 L 14.1914,209.781 L 14.1914,25.9916 C 14.1914,9.2726 27.5313,-2.20741 43.086,0.358597 L 174.356,21.8786 L 174.356,160.042 z" style="fill:#3fe400;fill-rule:evenodd;stroke:none"/>
+<path d="M 130.422,45.9136 L 141.938,47.1516 L 141.938,67.3626 L 154.899,68.2766 L 154.899,80.9566 L 141.938,80.3586 L 141.938,126.691 C 141.938,130.723 142.383,133.316 143.278,134.48 C 144.078,135.547 145.324,136.074 146.988,136.074 C 147.149,136.074 147.317,136.07 147.485,136.058 C 150.035,135.91 152.805,135.125 155.828,133.75 L 155.828,145.398 C 150.692,147.656 145.653,148.996 140.703,149.418 C 139.985,149.473 139.293,149.504 138.625,149.504 C 134.145,149.504 130.719,148.203 128.379,145.57 C 125.649,142.519 124.289,137.621 124.289,130.898 L 124.289,79.5426 L 118.063,79.2576 L 118.063,65.6716 L 125.649,66.2186 L 130.422,45.9136 z" style="fill:#ffffff;fill-rule:evenodd;stroke:none"/>
+<path d="M 154.899,80.9566 L 141.938,80.3586 L 141.938,80.6366 L 148.883,80.9566 L 154.899,80.9566 z" style="fill:#105000;fill-rule:evenodd;stroke:none"/>
+<path d="M 144.637,135.598 C 145.297,135.926 146.067,136.074 146.988,136.074 C 147.149,136.074 147.317,136.07 147.485,136.058 C 150.035,135.91 152.805,135.125 155.828,133.75 L 149.813,133.75 C 147.992,134.582 146.281,135.207 144.637,135.598 z" style="fill:#105000;fill-rule:evenodd;stroke:none"/>
+<path d="M 128.379,145.57 C 125.649,142.519 124.289,137.621 124.289,130.898 L 124.289,79.5426 L 118.063,79.2576 L 118.063,65.6716 L 112.047,65.6716 L 112.047,68.7066 C 112.918,71.9796 113.602,75.5266 114.11,79.3506 L 118.274,79.5426 L 118.274,130.898 C 118.274,137.621 119.641,142.519 122.364,145.57 C 124.707,148.203 128.129,149.504 132.61,149.504 L 138.625,149.504 C 134.145,149.504 130.719,148.203 128.379,145.57 z M 130.422,45.9136 L 124.406,45.9136 L 119.738,65.7966 L 125.649,66.2186 L 130.422,45.9136 z" style="fill:#105000;fill-rule:evenodd;stroke:none"/>
+<path d="M 91.1528,132.406 C 93.5038,126.355 94.6638,114.492 94.6638,96.7886 C 94.6638,80.8976 93.5158,69.9726 91.1798,63.9756 C 88.8438,57.9486 85.3478,54.6946 80.6598,54.2846 C 80.3008,54.2536 79.9458,54.2336 79.6018,54.2336 C 75.2618,54.2336 71.9218,56.7686 69.5938,61.8586 C 67.0738,67.4016 65.8008,78.8976 65.8008,96.2966 C 65.8008,113.113 67.0388,125.047 69.5348,132.051 C 71.8908,138.723 75.4138,142.027 80.0388,142.027 C 80.2458,142.027 80.4488,142.019 80.6598,142.008 C 85.2928,141.715 88.7808,138.512 91.1528,132.406 M 109.129,136.156 C 105.012,145.863 98.7348,152.214 90.1408,155.156 C 91.0078,159.605 92.3168,162.597 94.0628,164.175 C 95.4138,165.386 97.4958,165.996 100.285,165.996 C 101.09,165.996 101.953,165.941 102.875,165.839 L 102.875,178.964 L 96.9138,179.746 C 95.1558,179.976 93.4878,180.089 91.9098,180.089 C 86.6918,180.089 82.4648,178.824 79.2888,176.265 C 75.0818,172.886 71.9808,166.371 69.9918,156.73 C 60.8555,154.785 53.7344,148.976 48.8008,139.226 C 43.7969,129.324 41.25,114.836 41.25,95.8866 C 41.25,75.4566 44.7344,60.3786 51.5938,50.8156 C 57.3828,42.7456 65.4568,38.7766 75.6168,38.7766 C 77.2458,38.7766 78.9258,38.8786 80.6598,39.0816 C 92.6138,40.4566 101.278,46.0976 106.918,55.8706 C 112.453,65.4326 115.172,79.1366 115.172,97.1326 C 115.172,113.617 113.172,126.582 109.129,136.156 z" style="fill:#ffffff;fill-rule:evenodd;stroke:none"/>
+<path d="M 100.281,165.996 C 101.09,165.996 101.953,165.941 102.871,165.839 L 98.0348,165.839 C 98.7108,165.945 99.4878,165.996 100.281,165.996 z" style="fill:#105000;fill-rule:evenodd;stroke:none"/>
+<path d="M 84.8518,63.9756 C 87.1878,69.9726 88.3358,80.8976 88.3358,96.7886 C 88.3358,114.492 87.1758,126.355 84.8238,132.406 C 82.9298,137.285 80.2968,140.308 76.9608,141.476 C 77.9258,141.844 78.9528,142.027 80.0388,142.027 C 80.2458,142.027 80.4488,142.019 80.6598,142.008 C 85.2928,141.715 88.7808,138.512 91.1528,132.406 C 93.5038,126.355 94.6638,114.492 94.6638,96.7886 C 94.6638,80.8976 93.5158,69.9726 91.1798,63.9756 C 88.8438,57.9486 85.3478,54.6946 80.6598,54.2846 C 80.3008,54.2536 79.9458,54.2336 79.6018,54.2336 C 78.5118,54.2336 77.4848,54.3936 76.5198,54.7146 L 76.5198,54.7146 L 76.5158,54.7146 C 80.1168,55.8356 82.8948,58.9296 84.8518,63.9756 z M 82.5078,178.253 C 82.3948,178.203 82.2808,178.148 82.1718,178.093 C 82.1598,178.089 82.1488,178.081 82.1368,178.078 C 82.0348,178.027 81.9298,177.972 81.8278,177.921 C 81.8088,177.91 81.7888,177.902 81.7698,177.89 C 81.6798,177.839 81.5858,177.792 81.4918,177.742 C 81.4648,177.726 81.4378,177.706 81.4058,177.691 C 81.3238,177.648 81.2418,177.601 81.1638,177.554 C 81.1248,177.531 81.0858,177.507 81.0508,177.484 C 80.9808,177.445 80.9058,177.402 80.8358,177.359 C 80.7888,177.328 80.7418,177.3 80.6958,177.269 C 80.6368,177.23 80.5778,177.195 80.5198,177.156 C 80.4608,177.117 80.4058,177.081 80.3518,177.042 C 80.3008,177.011 80.2498,176.976 80.2028,176.945 C 80.1368,176.898 80.0708,176.851 80.0078,176.808 C 79.9688,176.781 79.9298,176.753 79.8948,176.726 C 79.8168,176.671 79.7418,176.613 79.6638,176.554 C 79.6408,176.538 79.6138,176.519 79.5858,176.499 C 79.4878,176.421 79.3868,176.343 79.2888,176.265 C 75.0818,172.886 71.9808,166.371 69.9918,156.73 C 60.8555,154.785 53.7344,148.976 48.8008,139.226 C 43.7969,129.324 41.25,114.836 41.25,95.8866 C 41.25,75.4566 44.7344,60.3786 51.5938,50.8156 C 57.3828,42.7456 65.4568,38.7766 75.6168,38.7766 C 75.6528,38.7766 69.2658,38.7766 69.2658,38.7766 L 69.2658,38.7766 C 59.1172,38.7846 51.0508,42.7536 45.2656,50.8156 C 38.4102,60.3786 34.9219,75.4566 34.9219,95.8866 C 34.9219,114.836 37.4688,129.324 42.4727,139.226 C 47.4063,148.976 54.5274,154.785 63.6638,156.73 C 65.6528,166.371 68.7538,172.886 72.9608,176.265 C 76.1368,178.824 80.3638,180.089 85.5858,180.089 C 85.6838,180.089 85.7848,180.089 85.8828,180.085 L 91.4218,180.085 C 88.0158,180.035 85.0388,179.425 82.5158,178.257 C 82.5158,178.257 82.5118,178.257 82.5078,178.253 z" style="fill:#105000;fill-rule:evenodd;stroke:none"/>
+</g>
+</g>
+</svg>
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index eb4dee1..9dea6dc 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -734,12 +734,12 @@ QT_BEGIN_NAMESPACE
\sa QTest::qSleep()
*/
-/*! \fn void QTest::qWaitForWindowShown(QWidget *window)
+/*! \fn bool QTest::qWaitForWindowShown(QWidget *window)
\since 4.6
Waits until the \a window is shown in the screen. This is mainly useful for
asynchronous systems like X11, where a window will be mapped to screen some
- time after being asked to show itself on the screen.
+ time after being asked to show itself on the screen. Returns true.
Example:
\snippet doc/src/snippets/code/src_qtestlib_qtestcase.cpp 24