summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2010-01-22 07:32:35 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2010-01-22 07:32:35 (GMT)
commit89664f6c813449afa41db13e00a0b0f46c36365f (patch)
treef14950ff34266e6c3bdb82b78efdcfdc74e29f49 /src
parent03c77ad02d5a3c69f4edfdfd2f3ef7cd7dc67aaa (diff)
parent747cca678faedac763fa9206d6ec55e028d24452 (diff)
downloadQt-89664f6c813449afa41db13e00a0b0f46c36365f.zip
Qt-89664f6c813449afa41db13e00a0b0f46c36365f.tar.gz
Qt-89664f6c813449afa41db13e00a0b0f46c36365f.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/ChangeLog11
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h6
-rw-r--r--src/3rdparty/webkit/VERSION2
-rw-r--r--src/3rdparty/webkit/WebCore/ChangeLog45
-rw-r--r--src/3rdparty/webkit/WebCore/WebCore.pro4
-rw-r--r--src/3rdparty/webkit/WebCore/platform/PopupMenu.h2
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp21
-rw-r--r--src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp5
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp4
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp10
-rw-r--r--src/3rdparty/webkit/WebKit/qt/ChangeLog10
-rw-r--r--src/corelib/io/qurl.cpp2
-rw-r--r--src/corelib/kernel/qcoreevent.cpp2
-rw-r--r--src/corelib/tools/qbytearray.cpp5
-rw-r--r--src/corelib/tools/qeasingcurve.cpp6
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp155
-rw-r--r--src/gui/graphicsview/qgraphicsitem_p.h12
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp31
-rw-r--r--src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp10
-rw-r--r--src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h2
-rw-r--r--src/gui/graphicsview/qgraphicssceneindex.cpp2
-rw-r--r--src/gui/graphicsview/qgraphicssceneindex_p.h2
-rw-r--r--src/gui/kernel/qapplication_mac.mm42
-rw-r--r--src/gui/kernel/qapplication_p.h6
-rw-r--r--src/gui/kernel/qapplication_s60.cpp47
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm2
-rw-r--r--src/gui/kernel/qformlayout.cpp6
-rw-r--r--src/gui/kernel/qwidget_mac.mm32
-rw-r--r--src/gui/styles/qgtkstyle.cpp20
-rw-r--r--src/gui/widgets/qlinecontrol.cpp5
-rw-r--r--src/gui/widgets/qlinecontrol_p.h5
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp7
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h3
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp2
-rw-r--r--src/network/socket/qnativesocketengine_win.cpp6
-rw-r--r--src/network/ssl/qsslcertificate.cpp8
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp26
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp7
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager_p.h5
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadersource_p.h678
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp25
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h2
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp3
-rw-r--r--src/s60installs/bwins/QtCoreu.def1
-rw-r--r--src/s60installs/bwins/QtGuiu.def14
-rw-r--r--src/s60installs/bwins/QtScriptu.def1
-rw-r--r--src/s60installs/eabi/QtCoreu.def1
-rw-r--r--src/s60installs/eabi/QtGuiu.def14
-rw-r--r--src/s60installs/eabi/QtScriptu.def1
-rw-r--r--src/s60installs/qt.iby26
-rw-r--r--src/s60installs/s60installs.pro5
-rw-r--r--src/tools/uic3/converter.cpp20
-rw-r--r--src/tools/uic3/form.cpp8
-rw-r--r--src/tools/uic3/main.cpp18
-rw-r--r--src/tools/uic3/ui3reader.cpp22
-rw-r--r--src/tools/uic3/ui3reader.h16
-rw-r--r--src/xml/dom/qdom.cpp12
58 files changed, 872 insertions, 575 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
index e292418..b943840 100644
--- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog
+++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog
@@ -10,17 +10,6 @@
(OpaqueJSClass::OpaqueJSClass):
(OpaqueJSClassContextData::OpaqueJSClassContextData):
-2010-01-07 Norbert Leser <norbert.leser@nokia.com>
-
- Reviewed by NOBODY (OOPS!).
-
- Added time-based optimization and increased optimization level to O3,
- conditionally for COMPILER(RVCT),
- for increasing performance of JavaScript execution.
- (Default settings are Ospace and O2)
-
- * runtime/Structure.h:
-
2009-11-19 Thiago Macieira <thiago.macieira@nokia.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h
index ecdd997..f355c53 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Structure.h
@@ -45,12 +45,6 @@
#define DUMP_PROPERTYMAP_STATS 0
#endif
-#if COMPILER(RVCT)
-#pragma arm
-#pragma Otime
-#pragma O3
-#endif
-
namespace JSC {
class MarkStack;
diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION
index 4f33e22..6fe71d6 100644
--- a/src/3rdparty/webkit/VERSION
+++ b/src/3rdparty/webkit/VERSION
@@ -8,4 +8,4 @@ The commit imported was from the
and has the sha1 checksum
- 8f6992f4e8f027818429d428393b08068eca9ffa
+ 8f5ca3ba5da63a47d4f90bbd867d3e8453443dd3
diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog
index 02daf86..8e1c965 100644
--- a/src/3rdparty/webkit/WebCore/ChangeLog
+++ b/src/3rdparty/webkit/WebCore/ChangeLog
@@ -1,3 +1,48 @@
+2010-01-17 Srinidhi Shreedhara <srinidhi.shreedhara@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] [Symbian] SetWindow call in npapi plugin does not happen when the cooridnates are negative
+ https://bugs.webkit.org/show_bug.cgi?id=33573
+
+ * plugins/symbian/PluginViewSymbian.cpp:
+ (WebCore::PluginView::setNPWindowIfNeeded): Remove tests for negative
+ coordinates for early return.
+
+2010-01-14 Norbert Leser <norbert.leser@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ Platform Symbian specific:
+ Added time-based optimization (-Otime) and increased optimization level to -O3,
+ conditionally for RVCT compiler (for ARM), for increasing performance
+ (primarily affecting JavaScript execution).
+ Default settings are -Ospace and -O2.
+
+ No new tests needed because no new funtionality is introduced,
+ only potential regression on existing tests needs to be evaluated.
+
+ * WebCore.pro:
+
+2010-01-13 Girish Ramakrishnan <girish@forwardbias.in>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt/Win] Flash in QGraphicsWebView does not process hover correctly.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33591
+
+ Mouse hover does not work as expected with the flash in some sites.
+ - http://www.bbc.co.uk/ Hover over the map
+ - http://www.barbie.com/ Hover over the menu items (Games, Videos)
+ The problem appears to be that Flash queries NPNVnetscapeWindow on every
+ mouse hover. I do not how flash uses this value but returning 0 when flash
+ is in windowless mode solves the problem (When using QGraphicsWebView we
+ inject wmode opaque, thereby putting the plugin in windowless mode).
+
+ * plugins/win/PluginViewWin.cpp:
+ (windowHandleForPageClient):
+
2010-01-13 Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed by Simon Hausmann.
diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro
index 1489fa0..04aba62 100644
--- a/src/3rdparty/webkit/WebCore/WebCore.pro
+++ b/src/3rdparty/webkit/WebCore/WebCore.pro
@@ -23,7 +23,9 @@ symbian: {
TARGET.UID3 = 0x200267C2
# RO text (code) section in qtwebkit.dll exceeds allocated space for gcce udeb target.
# Move RW-section base address to start from 0xE00000 instead of the toolchain default 0x400000.
- QMAKE_LFLAGS.ARMCC += --rw-base 0xE00000
+ MMP_RULES += "LINKEROPTION armcc --rw-base 0xE00000"
+ MMP_RULES += ALWAYS_BUILD_AS_ARM
+ QMAKE_CXXFLAGS.ARMCC += -OTime -O3
}
include($$PWD/../WebKit.pri)
diff --git a/src/3rdparty/webkit/WebCore/platform/PopupMenu.h b/src/3rdparty/webkit/WebCore/platform/PopupMenu.h
index 2315f02..f2fffb5 100644
--- a/src/3rdparty/webkit/WebCore/platform/PopupMenu.h
+++ b/src/3rdparty/webkit/WebCore/platform/PopupMenu.h
@@ -44,6 +44,7 @@ typedef struct HBITMAP__* HBITMAP;
namespace WebCore {
class QWebPopup;
}
+class QGraphicsProxyWidget;
#elif PLATFORM(GTK)
typedef struct _GtkMenu GtkMenu;
typedef struct _GtkMenuItem GtkMenuItem;
@@ -147,6 +148,7 @@ private:
void clear();
void populate(const IntRect&);
QWebPopup* m_popup;
+ QGraphicsProxyWidget* m_proxy;
#elif PLATFORM(WIN)
// ScrollBarClient
virtual void valueChanged(Scrollbar*);
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp b/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp
index f6ec4f7..989b34c 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/PopupMenuQt.cpp
@@ -1,6 +1,7 @@
/*
* This file is part of the popup menu implementation for <select> elements in WebCore.
*
+ * Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
* Copyright (C) 2006 Apple Computer, Inc.
* Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
@@ -35,6 +36,9 @@
#include <QAction>
#include <QDebug>
+#include <QGraphicsProxyWidget>
+#include <QGraphicsScene>
+#include <QGraphicsView>
#include <QListWidget>
#include <QListWidgetItem>
#include <QMenu>
@@ -46,6 +50,7 @@ namespace WebCore {
PopupMenu::PopupMenu(PopupMenuClient* client)
: m_popupClient(client)
+ , m_proxy(0)
{
m_popup = new QWebPopup(client);
}
@@ -53,6 +58,7 @@ PopupMenu::PopupMenu(PopupMenuClient* client)
PopupMenu::~PopupMenu()
{
delete m_popup;
+ delete m_proxy;
}
void PopupMenu::clear()
@@ -92,8 +98,19 @@ void PopupMenu::show(const IntRect& r, FrameView* v, int index)
rect.moveTopLeft(v->contentsToWindow(r.topLeft()));
rect.setHeight(m_popup->sizeHint().height());
- m_popup->setParent(client->ownerWidget());
- m_popup->setGeometry(rect);
+ if (QGraphicsView* view = qobject_cast<QGraphicsView*>(client->ownerWidget())) {
+ if (!m_proxy) {
+ m_proxy = new QGraphicsProxyWidget;
+ m_proxy->setWidget(m_popup);
+ view->scene()->addItem(m_proxy);
+ } else
+ m_proxy->setVisible(true);
+ m_proxy->setGeometry(rect);
+ } else {
+ m_popup->setParent(client->ownerWidget());
+ m_popup->setGeometry(rect);
+ }
+
m_popup->setCurrentIndex(index);
m_popup->exec();
}
diff --git a/src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp b/src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp
index d077079..f7ebbc7 100644
--- a/src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/qt/QWebPopup.cpp
@@ -26,6 +26,7 @@
#include <QApplication>
#include <QInputContext>
#include <QMouseEvent>
+#include <QGraphicsProxyWidget>
namespace WebCore {
@@ -67,6 +68,10 @@ void QWebPopup::hidePopup()
}
QComboBox::hidePopup();
+
+ if (QGraphicsProxyWidget* proxy = graphicsProxyWidget())
+ proxy->setVisible(false);
+
if (!m_popupVisible)
return;
diff --git a/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp b/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp
index 14e25b1..cf69723 100644
--- a/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/symbian/PluginViewSymbian.cpp
@@ -280,8 +280,6 @@ void PluginView::setNPWindowIfNeeded()
m_npWindow.width = m_windowRect.width();
m_npWindow.height = m_windowRect.height();
- if (m_npWindow.x < 0 || m_npWindow.y < 0 || m_npWindow.width <= 0 || m_npWindow.height <= 0)
- return;
PluginView::setCurrentPluginView(this);
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
diff --git a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp
index b313afb..ab71273 100644
--- a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp
@@ -86,7 +86,9 @@ static inline HWND windowHandleForPageClient(PlatformPageClient client)
#if PLATFORM(QT)
if (!client)
return 0;
- return client->ownerWidget()->winId();
+ if (QWidget* pluginParent = qobject_cast<QWidget*>(client->pluginParent()))
+ return pluginParent->winId();
+ return 0;
#else
return client;
#endif
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
index 6d08c32..a289ec0 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp
@@ -1708,8 +1708,14 @@ QWebPage::~QWebPage()
FrameLoader *loader = d->mainFrame->d->frame->loader();
if (loader)
loader->detachFromParent();
- if (d->inspector)
- d->inspector->setPage(0);
+ if (d->inspector) {
+ // Since we have to delete an internal inspector,
+ // call setInspector(0) directly to prevent potential crashes
+ if (d->inspectorIsInternalOnly)
+ d->setInspector(0);
+ else
+ d->inspector->setPage(0);
+ }
delete d;
}
diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog
index cd47982..ee555f3 100644
--- a/src/3rdparty/webkit/WebKit/qt/ChangeLog
+++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog
@@ -1,3 +1,13 @@
+2009-11-19 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix QWebInspector destruction problem.
+ https://bugs.webkit.org/show_bug.cgi?id=31664
+
+ * Api/qwebpage.cpp:
+ (QWebPage::~QWebPage):
+
2010-01-14 Simon Hausmann <simon.hausmann@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 74e5f74..a131d6c 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -5932,7 +5932,7 @@ void QUrl::detach()
*/
bool QUrl::isDetached() const
{
- return d && d->ref == 1;
+ return !d || d->ref == 1;
}
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 1b167e2..3f69b4f 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -107,13 +107,13 @@ QT_BEGIN_NAMESPACE
\value ApplicationLayoutDirectionChange The default application layout direction has changed.
\value ApplicationPaletteChange The default application palette has changed.
\value ApplicationWindowIconChange The application's icon has changed.
- \value CloseSoftwareInputPanel A widget wants to close the software input panel (SIP).
\value ChildAdded An object gets a child (QChildEvent).
\value ChildInserted An object gets a child (QChildEvent). Qt3Support only, use ChildAdded instead.
\value ChildPolished A widget child gets polished (QChildEvent).
\value ChildRemoved An object loses a child (QChildEvent).
\value Clipboard The clipboard contents have changed (QClipboardEvent).
\value Close Widget was closed (QCloseEvent).
+ \value CloseSoftwareInputPanel A widget wants to close the software input panel (SIP).
\value ContentsRectChange The margins of the widget's content rect changed.
\value ContextMenu Context popup menu (QContextMenuEvent).
\value CursorChange The widget's cursor has changed.
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index d2fbf5a..556093f 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -538,7 +538,7 @@ QByteArray qUncompress(const uchar* data, int nbytes)
forever {
ulong alloc = len;
- d.reset(q_check_ptr(static_cast<QByteArray::Data *>(qRealloc(d.data(), sizeof(QByteArray::Data) + alloc))));
+ d.reset(q_check_ptr(static_cast<QByteArray::Data *>(qRealloc(d.take(), sizeof(QByteArray::Data) + alloc))));
if (!d) {
// we are not allowed to crash here when compiling with QT_NO_EXCEPTIONS
qWarning("qUncompress: could not allocate enough memory to uncompress data");
@@ -551,7 +551,7 @@ QByteArray qUncompress(const uchar* data, int nbytes)
switch (res) {
case Z_OK:
if (len != alloc) {
- d.reset(q_check_ptr(static_cast<QByteArray::Data *>(qRealloc(d.data(), sizeof(QByteArray::Data) + len))));
+ d.reset(q_check_ptr(static_cast<QByteArray::Data *>(qRealloc(d.take(), sizeof(QByteArray::Data) + len))));
if (!d) {
// we are not allowed to crash here when compiling with QT_NO_EXCEPTIONS
qWarning("qUncompress: could not allocate enough memory to uncompress data");
@@ -561,6 +561,7 @@ QByteArray qUncompress(const uchar* data, int nbytes)
d->ref = 1;
d->alloc = d->size = len;
d->data = d->array;
+ d->array[len] = 0;
return QByteArray(d.take(), 0, 0);
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index 0ef92d9..b6a2df4 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -125,7 +125,7 @@
\value OutCubic \inlineimage qeasingcurve-outcubic.png
\br
Easing curve for a cubic (t^3) function:
- decelerating from zero velocity.
+ decelerating to zero velocity.
\value InOutCubic \inlineimage qeasingcurve-inoutcubic.png
\br
Easing curve for a cubic (t^3) function:
@@ -141,7 +141,7 @@
\value OutQuart \inlineimage qeasingcurve-outquart.png
\br
Easing curve for a cubic (t^4) function:
- decelerating from zero velocity.
+ decelerating to zero velocity.
\value InOutQuart \inlineimage qeasingcurve-inoutquart.png
\br
Easing curve for a cubic (t^4) function:
@@ -157,7 +157,7 @@
\value OutQuint \inlineimage qeasingcurve-outquint.png
\br
Easing curve for a cubic (t^5) function:
- decelerating from zero velocity.
+ decelerating to zero velocity.
\value InOutQuint \inlineimage qeasingcurve-inoutquint.png
\br
Easing curve for a cubic (t^5) function:
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index cae9660..d43176b 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -798,8 +798,36 @@ void QGraphicsItemPrivate::updateAncestorFlag(QGraphicsItem::GraphicsItemFlag ch
return;
}
- foreach (QGraphicsItem *child, children)
- child->d_ptr->updateAncestorFlag(childFlag, flag, enabled, false);
+ for (int i = 0; i < children.size(); ++i)
+ children.at(i)->d_ptr->updateAncestorFlag(childFlag, flag, enabled, false);
+}
+
+void QGraphicsItemPrivate::updateAncestorFlags()
+{
+ int flags = 0;
+ if (parent) {
+ // Inherit the parent's ancestor flags.
+ QGraphicsItemPrivate *pd = parent->d_ptr.data();
+ flags = pd->ancestorFlags;
+
+ // Add in flags from the parent.
+ if (pd->filtersDescendantEvents)
+ flags |= AncestorFiltersChildEvents;
+ if (pd->handlesChildEvents)
+ flags |= AncestorHandlesChildEvents;
+ if (pd->flags & QGraphicsItem::ItemClipsChildrenToShape)
+ flags |= AncestorClipsChildren;
+ if (pd->flags & QGraphicsItem::ItemIgnoresTransformations)
+ flags |= AncestorIgnoresTransformations;
+ }
+
+ if (ancestorFlags == flags)
+ return; // No change; stop propagation.
+ ancestorFlags = flags;
+
+ // Propagate to children recursively.
+ for (int i = 0; i < children.size(); ++i)
+ children.at(i)->d_ptr->updateAncestorFlags();
}
/*!
@@ -984,25 +1012,17 @@ QVariant QGraphicsItemPrivate::inputMethodQueryHelper(Qt::InputMethodQuery query
prepareGeometryChange) if the item is in its destructor, i.e.
inDestructor is 1.
*/
-void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
+void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const QVariant *newParentVariant,
+ const QVariant *thisPointerVariant)
{
Q_Q(QGraphicsItem);
- if (newParent == q) {
- qWarning("QGraphicsItem::setParentItem: cannot assign %p as a parent of itself", this);
- return;
- }
- if (newParent == parent)
- return;
-
- const QVariant newParentVariant(q->itemChange(QGraphicsItem::ItemParentChange,
- qVariantFromValue<QGraphicsItem *>(newParent)));
- newParent = qVariantValue<QGraphicsItem *>(newParentVariant);
if (newParent == parent)
return;
if (scene) {
// Deliver the change to the index
- scene->d_func()->index->itemChange(q, QGraphicsItem::ItemParentChange, newParentVariant);
+ if (scene->d_func()->indexMethod != QGraphicsScene::NoIndex)
+ scene->d_func()->index->itemChange(q, QGraphicsItem::ItemParentChange, newParent);
// Disable scene pos notifications for old ancestors
if (scenePosDescendants || (flags & QGraphicsItem::ItemSendsScenePositionChanges))
@@ -1020,11 +1040,11 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
if (!inDestructor)
q_ptr->prepareGeometryChange();
- const QVariant thisPointerVariant(qVariantFromValue<QGraphicsItem *>(q));
if (parent) {
// Remove from current parent
parent->d_ptr->removeChild(q);
- parent->itemChange(QGraphicsItem::ItemChildRemovedChange, thisPointerVariant);
+ if (thisPointerVariant)
+ parent->itemChange(QGraphicsItem::ItemChildRemovedChange, *thisPointerVariant);
}
// Update toplevelitem list. If this item is being deleted, its parent
@@ -1042,7 +1062,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
QGraphicsItem *p = parent;
QGraphicsItem *parentFocusScopeItem = 0;
while (p) {
- if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
+ if (p->d_ptr->flags & QGraphicsItem::ItemIsFocusScope) {
// If this item's focus scope's focus scope item points
// to this item or a descendent, then clear it.
QGraphicsItem *fsi = p->d_ptr->focusScopeItem;
@@ -1063,11 +1083,11 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
QGraphicsItem *ancestorScope = 0;
QGraphicsItem *p = subFocusItem->d_ptr->parent;
while (p) {
- if (p->flags() & QGraphicsItem::ItemIsFocusScope)
+ if (p->d_ptr->flags & QGraphicsItem::ItemIsFocusScope)
ancestorScope = p;
- if (p->isPanel())
+ if (p->d_ptr->flags & QGraphicsItem::ItemIsPanel)
break;
- p = p->parentItem();
+ p = p->d_ptr->parent;
}
if (ancestorScope)
newFocusScopeItem = ancestorScope;
@@ -1075,7 +1095,7 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
QGraphicsItem *p = newParent;
while (p) {
- if (p->flags() & QGraphicsItem::ItemIsFocusScope) {
+ if (p->d_ptr->flags & QGraphicsItem::ItemIsFocusScope) {
p->d_ptr->focusScopeItem = newFocusScopeItem;
// Ensure the new item is no longer the subFocusItem. The
// only way to set focus on a child of a focus scope is
@@ -1100,7 +1120,8 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
}
parent->d_ptr->addChild(q);
- parent->itemChange(QGraphicsItem::ItemChildAddedChange, thisPointerVariant);
+ if (thisPointerVariant)
+ parent->itemChange(QGraphicsItem::ItemChildAddedChange, *thisPointerVariant);
if (scene) {
if (!implicitUpdate)
scene->d_func()->markDirty(q_ptr);
@@ -1111,30 +1132,24 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
}
// Inherit ancestor flags from the new parent.
- updateAncestorFlag(QGraphicsItem::GraphicsItemFlag(-2));
- updateAncestorFlag(QGraphicsItem::GraphicsItemFlag(-1));
- updateAncestorFlag(QGraphicsItem::ItemClipsChildrenToShape);
- updateAncestorFlag(QGraphicsItem::ItemIgnoresTransformations);
+ updateAncestorFlags();
// Update item visible / enabled.
- if (parent->isVisible() != visible) {
- if (!parent->isVisible() || !explicitlyHidden)
- setVisibleHelper(parent->isVisible(), /* explicit = */ false, /* update = */ !implicitUpdate);
+ if (parent->d_ptr->visible != visible) {
+ if (!parent->d_ptr->visible || !explicitlyHidden)
+ setVisibleHelper(parent->d_ptr->visible, /* explicit = */ false, /* update = */ !implicitUpdate);
}
if (parent->isEnabled() != enabled) {
- if (!parent->isEnabled() || !explicitlyDisabled)
- setEnabledHelper(parent->isEnabled(), /* explicit = */ false, /* update = */ !implicitUpdate);
+ if (!parent->d_ptr->enabled || !explicitlyDisabled)
+ setEnabledHelper(parent->d_ptr->enabled, /* explicit = */ false, /* update = */ !implicitUpdate);
}
// Auto-activate if visible and the parent is active.
- if (q->isVisible() && parent->isActive())
+ if (visible && parent->isActive())
q->setActive(true);
} else {
// Inherit ancestor flags from the new parent.
- updateAncestorFlag(QGraphicsItem::GraphicsItemFlag(-2));
- updateAncestorFlag(QGraphicsItem::GraphicsItemFlag(-1));
- updateAncestorFlag(QGraphicsItem::ItemClipsChildrenToShape);
- updateAncestorFlag(QGraphicsItem::ItemIgnoresTransformations);
+ updateAncestorFlags();
if (!inDestructor) {
// Update item visible / enabled.
@@ -1161,7 +1176,8 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent)
}
// Deliver post-change notification
- q->itemChange(QGraphicsItem::ItemParentHasChanged, newParentVariant);
+ if (newParentVariant)
+ q->itemChange(QGraphicsItem::ItemParentHasChanged, *newParentVariant);
if (isObject)
emit static_cast<QGraphicsObject *>(q)->parentChanged();
@@ -1350,7 +1366,7 @@ QGraphicsItem::~QGraphicsItem()
d_ptr->scene->d_func()->removeItemHelper(this);
} else {
d_ptr->resetFocusProxy();
- d_ptr->setParentItemHelper(0);
+ setParentItem(0);
}
#ifndef QT_NO_GRAPHICSEFFECT
@@ -1555,9 +1571,23 @@ const QGraphicsObject *QGraphicsItem::toGraphicsObject() const
\sa parentItem(), childItems()
*/
-void QGraphicsItem::setParentItem(QGraphicsItem *parent)
+void QGraphicsItem::setParentItem(QGraphicsItem *newParent)
{
- d_ptr->setParentItemHelper(parent);
+ if (newParent == this) {
+ qWarning("QGraphicsItem::setParentItem: cannot assign %p as a parent of itself", this);
+ return;
+ }
+ if (newParent == d_ptr->parent)
+ return;
+
+ const QVariant newParentVariant(itemChange(QGraphicsItem::ItemParentChange,
+ qVariantFromValue<QGraphicsItem *>(newParent)));
+ newParent = qVariantValue<QGraphicsItem *>(newParentVariant);
+ if (newParent == d_ptr->parent)
+ return;
+
+ const QVariant thisPointerVariant(qVariantFromValue<QGraphicsItem *>(this));
+ d_ptr->setParentItemHelper(newParent, &newParentVariant, &thisPointerVariant);
}
/*!
@@ -1607,7 +1637,7 @@ bool QGraphicsItem::isWidget() const
*/
bool QGraphicsItem::isWindow() const
{
- return isWidget() && (static_cast<const QGraphicsWidget *>(this)->windowType() & Qt::Window);
+ return d_ptr->isWidget && (static_cast<const QGraphicsWidget *>(this)->windowType() & Qt::Window);
}
/*!
@@ -1644,9 +1674,9 @@ QGraphicsItem::GraphicsItemFlags QGraphicsItem::flags() const
void QGraphicsItem::setFlag(GraphicsItemFlag flag, bool enabled)
{
if (enabled)
- setFlags(flags() | flag);
+ setFlags(GraphicsItemFlags(d_ptr->flags) | flag);
else
- setFlags(flags() & ~flag);
+ setFlags(GraphicsItemFlags(d_ptr->flags) & ~flag);
}
/*!
@@ -1693,8 +1723,8 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags)
flags = GraphicsItemFlags(itemChange(ItemFlagsChange, quint32(flags)).toUInt());
if (quint32(d_ptr->flags) == quint32(flags))
return;
- if (d_ptr->scene)
- d_ptr->scene->d_func()->index->itemChange(this, ItemFlagsChange, quint32(flags));
+ if (d_ptr->scene && d_ptr->scene->d_func()->indexMethod != QGraphicsScene::NoIndex)
+ d_ptr->scene->d_func()->index->itemChange(this, ItemFlagsChange, &flags);
// Flags that alter the geometry of the item (or its children).
const quint32 geomChangeFlagsMask = (ItemClipsChildrenToShape | ItemClipsToShape | ItemIgnoresTransformations | ItemIsSelectable);
@@ -1703,7 +1733,7 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags)
d_ptr->paintedViewBoundingRectsNeedRepaint = 1;
// Keep the old flags to compare the diff.
- GraphicsItemFlags oldFlags = this->flags();
+ GraphicsItemFlags oldFlags = GraphicsItemFlags(d_ptr->flags);
// Update flags.
d_ptr->flags = flags;
@@ -1732,7 +1762,23 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags)
d_ptr->updateAncestorFlag(ItemIgnoresTransformations);
}
+ if ((flags & ItemNegativeZStacksBehindParent) != (oldFlags & ItemNegativeZStacksBehindParent)) {
+ // NB! We change the flags directly here, so we must also update d_ptr->flags.
+ // Note that this has do be done before the ItemStacksBehindParent check
+ // below; otherwise we will loose the change.
+
+ // Update stack-behind.
+ if (d_ptr->z < qreal(0.0))
+ flags |= ItemStacksBehindParent;
+ else
+ flags &= ~ItemStacksBehindParent;
+ d_ptr->flags = flags;
+ }
+
if ((flags & ItemStacksBehindParent) != (oldFlags & ItemStacksBehindParent)) {
+ // NB! This check has to come after the ItemNegativeZStacksBehindParent
+ // check above. Be careful.
+
// Ensure child item sorting is up to date when toggling this flag.
if (d_ptr->parent)
d_ptr->parent->d_ptr->needSortChildren = 1;
@@ -1746,10 +1792,6 @@ void QGraphicsItem::setFlags(GraphicsItemFlags flags)
d_ptr->scene->d_func()->updateInputMethodSensitivityInViews();
}
- if ((flags & ItemNegativeZStacksBehindParent) != (oldFlags & ItemNegativeZStacksBehindParent)) {
- // Update stack-behind.
- setFlag(ItemStacksBehindParent, d_ptr->z < qreal(0.0));
- }
if ((d_ptr->panelModality != NonModal)
&& d_ptr->scene
@@ -2997,9 +3039,16 @@ void QGraphicsItem::setActive(bool active)
*/
bool QGraphicsItem::hasFocus() const
{
+ if (!d_ptr->scene || !d_ptr->scene->isActive())
+ return false;
+
if (d_ptr->focusProxy)
return d_ptr->focusProxy->hasFocus();
- return isActive() && (d_ptr->scene && d_ptr->scene->focusItem() == this);
+
+ if (d_ptr->scene->d_func()->focusItem != this)
+ return false;
+
+ return panel() == d_ptr->scene->d_func()->activePanel;
}
/*!
@@ -4257,9 +4306,9 @@ void QGraphicsItem::setZValue(qreal z)
if (newZ == d_ptr->z)
return;
- if (d_ptr->scene) {
+ if (d_ptr->scene && d_ptr->scene->d_func()->indexMethod != QGraphicsScene::NoIndex) {
// Z Value has changed, we have to notify the index.
- d_ptr->scene->d_func()->index->itemChange(this, ItemZValueChange, newZVariant);
+ d_ptr->scene->d_func()->index->itemChange(this, ItemZValueChange, &newZ);
}
d_ptr->z = newZ;
diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h
index 2d34b80..ac10aa7 100644
--- a/src/gui/graphicsview/qgraphicsitem_p.h
+++ b/src/gui/graphicsview/qgraphicsitem_p.h
@@ -153,7 +153,7 @@ public:
dirtyChildren(0),
localCollisionHack(0),
inSetPosHelper(0),
- needSortChildren(1), // ### can be 0 by default?
+ needSortChildren(0),
allChildrenDirty(0),
fullUpdatePending(0),
flags(0),
@@ -197,6 +197,7 @@ public:
void updateAncestorFlag(QGraphicsItem::GraphicsItemFlag childFlag,
AncestorFlag flag = NoFlag, bool enabled = false, bool root = true);
+ void updateAncestorFlags();
void setIsMemberOfGroup(bool enabled);
void remapItemPos(QEvent *event, QGraphicsItem *item);
QPointF genericMapFromScene(const QPointF &pos, const QWidget *viewport) const;
@@ -229,7 +230,8 @@ public:
void resolveDepth();
void addChild(QGraphicsItem *child);
void removeChild(QGraphicsItem *child);
- void setParentItemHelper(QGraphicsItem *parent);
+ void setParentItemHelper(QGraphicsItem *parent, const QVariant *newParentVariant,
+ const QVariant *thisPointerVariant);
void childrenBoundingRectHelper(QTransform *x, QRectF *rect);
void initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform,
const QRegion &exposedRegion, bool allItems = false) const;
@@ -721,11 +723,13 @@ inline QTransform QGraphicsItemPrivate::transformToParent() const
inline void QGraphicsItemPrivate::ensureSortedChildren()
{
if (needSortChildren) {
- qSort(children.begin(), children.end(), qt_notclosestLeaf);
needSortChildren = 0;
sequentialOrdering = 1;
+ if (children.isEmpty())
+ return;
+ qSort(children.begin(), children.end(), qt_notclosestLeaf);
for (int i = 0; i < children.size(); ++i) {
- if (children[i]->d_ptr->siblingIndex != i) {
+ if (children.at(i)->d_ptr->siblingIndex != i) {
sequentialOrdering = 0;
break;
}
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index cea723c..088a6b9 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -599,7 +599,7 @@ void QGraphicsScenePrivate::removeItemHelper(QGraphicsItem *item)
if (parentItem->scene()) {
Q_ASSERT_X(parentItem->scene() == q, "QGraphicsScene::removeItem",
"Parent item's scene is different from this item's scene");
- item->d_ptr->setParentItemHelper(0);
+ item->setParentItem(0);
}
} else {
unregisterTopLevelItem(item);
@@ -2482,12 +2482,12 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
qWarning("QGraphicsScene::addItem: cannot add null item");
return;
}
- if (item->scene() == this) {
+ if (item->d_ptr->scene == this) {
qWarning("QGraphicsScene::addItem: item has already been added to this scene");
return;
}
// Remove this item from its existing scene
- if (QGraphicsScene *oldScene = item->scene())
+ if (QGraphicsScene *oldScene = item->d_ptr->scene)
oldScene->removeItem(item);
// Notify the item that its scene is changing, and allow the item to
@@ -2496,15 +2496,15 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
qVariantFromValue<QGraphicsScene *>(this)));
QGraphicsScene *targetScene = qVariantValue<QGraphicsScene *>(newSceneVariant);
if (targetScene != this) {
- if (targetScene && item->scene() != targetScene)
+ if (targetScene && item->d_ptr->scene != targetScene)
targetScene->addItem(item);
return;
}
// Detach this item from its parent if the parent's scene is different
// from this scene.
- if (QGraphicsItem *itemParent = item->parentItem()) {
- if (itemParent->scene() != this)
+ if (QGraphicsItem *itemParent = item->d_ptr->parent) {
+ if (itemParent->d_ptr->scene != this)
item->setParentItem(0);
}
@@ -2534,7 +2534,7 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
d->enableMouseTrackingOnViews();
}
#ifndef QT_NO_CURSOR
- if (d->allItemsUseDefaultCursor && item->hasCursor()) {
+ if (d->allItemsUseDefaultCursor && item->d_ptr->hasCursor) {
d->allItemsUseDefaultCursor = false;
if (d->allItemsIgnoreHoverEvents) // already enabled otherwise
d->enableMouseTrackingOnViews();
@@ -2542,7 +2542,7 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
#endif //QT_NO_CURSOR
// Enable touch events if the item accepts touch events.
- if (d->allItemsIgnoreTouchEvents && item->acceptTouchEvents()) {
+ if (d->allItemsIgnoreTouchEvents && item->d_ptr->acceptTouchEvents) {
d->allItemsIgnoreTouchEvents = false;
d->enableTouchEventsOnViews();
}
@@ -2575,8 +2575,9 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
}
// Add all children recursively
- foreach (QGraphicsItem *child, item->children())
- addItem(child);
+ item->d_ptr->ensureSortedChildren();
+ for (int i = 0; i < item->d_ptr->children.size(); ++i)
+ addItem(item->d_ptr->children.at(i));
// Resolve font and palette.
item->d_ptr->resolveFont(d->font.resolve());
@@ -2619,7 +2620,7 @@ void QGraphicsScene::addItem(QGraphicsItem *item)
}
}
- if (item->flags() & QGraphicsItem::ItemSendsScenePositionChanges)
+ if (item->d_ptr->flags & QGraphicsItem::ItemSendsScenePositionChanges)
d->registerScenePosItem(item);
// Ensure that newly added items that have subfocus set, gain
@@ -3766,10 +3767,10 @@ void QGraphicsScene::helpEvent(QGraphicsSceneHelpEvent *helpEvent)
bool QGraphicsScenePrivate::itemAcceptsHoverEvents_helper(const QGraphicsItem *item) const
{
- return (!item->isBlockedByModalPanel() &&
- (item->acceptHoverEvents()
- || (item->isWidget()
- && static_cast<const QGraphicsWidget *>(item)->d_func()->hasDecoration())));
+ return (item->d_ptr->acceptsHover
+ || (item->d_ptr->isWidget
+ && static_cast<const QGraphicsWidget *>(item)->d_func()->hasDecoration()))
+ && !item->isBlockedByModalPanel();
}
/*!
diff --git a/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp b/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
index 2e92b87..2a91348 100644
--- a/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
+++ b/src/gui/graphicsview/qgraphicsscenebsptreeindex.cpp
@@ -635,16 +635,17 @@ void QGraphicsSceneBspTreeIndex::updateSceneRect(const QRectF &rect)
This method react to the \a change of the \a item and use the \a value to
update the BSP tree if necessary.
*/
-void QGraphicsSceneBspTreeIndex::itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const QVariant &value)
+void QGraphicsSceneBspTreeIndex::itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const void *const value)
{
Q_D(QGraphicsSceneBspTreeIndex);
switch (change) {
case QGraphicsItem::ItemFlagsChange: {
// Handle ItemIgnoresTransformations
+ QGraphicsItem::GraphicsItemFlags newFlags = *static_cast<const QGraphicsItem::GraphicsItemFlags *>(value);
bool ignoredTransform = item->d_ptr->flags & QGraphicsItem::ItemIgnoresTransformations;
- bool willIgnoreTransform = value.toUInt() & QGraphicsItem::ItemIgnoresTransformations;
+ bool willIgnoreTransform = newFlags & QGraphicsItem::ItemIgnoresTransformations;
bool clipsChildren = item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape;
- bool willClipChildren = value.toUInt() & QGraphicsItem::ItemClipsChildrenToShape;
+ bool willClipChildren = newFlags & QGraphicsItem::ItemClipsChildrenToShape;
if ((ignoredTransform != willIgnoreTransform) || (clipsChildren != willClipChildren)) {
QGraphicsItem *thatItem = const_cast<QGraphicsItem *>(item);
// Remove item and its descendants from the index and append
@@ -661,7 +662,7 @@ void QGraphicsSceneBspTreeIndex::itemChange(const QGraphicsItem *item, QGraphics
case QGraphicsItem::ItemParentChange: {
d->invalidateSortCache();
// Handle ItemIgnoresTransformations
- QGraphicsItem *newParent = qVariantValue<QGraphicsItem *>(value);
+ const QGraphicsItem *newParent = static_cast<const QGraphicsItem *>(value);
bool ignoredTransform = item->d_ptr->itemIsUntransformable();
bool willIgnoreTransform = (item->d_ptr->flags & QGraphicsItem::ItemIgnoresTransformations)
|| (newParent && newParent->d_ptr->itemIsUntransformable());
@@ -682,7 +683,6 @@ void QGraphicsSceneBspTreeIndex::itemChange(const QGraphicsItem *item, QGraphics
default:
break;
}
- return QGraphicsSceneIndex::itemChange(item, change, value);
}
/*!
\reimp
diff --git a/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h b/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
index 119571b..f671fd9 100644
--- a/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
+++ b/src/gui/graphicsview/qgraphicsscenebsptreeindex_p.h
@@ -97,7 +97,7 @@ protected:
void removeItem(QGraphicsItem *item);
void prepareBoundingRectChange(const QGraphicsItem *item);
- void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const QVariant &value);
+ void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const void *const value);
private :
Q_DECLARE_PRIVATE(QGraphicsSceneBspTreeIndex)
diff --git a/src/gui/graphicsview/qgraphicssceneindex.cpp b/src/gui/graphicsview/qgraphicssceneindex.cpp
index bc8a7dc..043c4eb 100644
--- a/src/gui/graphicsview/qgraphicssceneindex.cpp
+++ b/src/gui/graphicsview/qgraphicssceneindex.cpp
@@ -624,7 +624,7 @@ void QGraphicsSceneIndex::deleteItem(QGraphicsItem *item)
\sa QGraphicsItem::GraphicsItemChange
*/
-void QGraphicsSceneIndex::itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const QVariant &value)
+void QGraphicsSceneIndex::itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange change, const void *const value)
{
Q_UNUSED(item);
Q_UNUSED(change);
diff --git a/src/gui/graphicsview/qgraphicssceneindex_p.h b/src/gui/graphicsview/qgraphicssceneindex_p.h
index def58f0..597a229 100644
--- a/src/gui/graphicsview/qgraphicssceneindex_p.h
+++ b/src/gui/graphicsview/qgraphicssceneindex_p.h
@@ -110,7 +110,7 @@ protected:
virtual void removeItem(QGraphicsItem *item) = 0;
virtual void deleteItem(QGraphicsItem *item);
- virtual void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange, const QVariant &value);
+ virtual void itemChange(const QGraphicsItem *item, QGraphicsItem::GraphicsItemChange, const void *const value);
virtual void prepareBoundingRectChange(const QGraphicsItem *item);
QGraphicsSceneIndex(QGraphicsSceneIndexPrivate &dd, QGraphicsScene *scene);
diff --git a/src/gui/kernel/qapplication_mac.mm b/src/gui/kernel/qapplication_mac.mm
index 6aebef5..e8b821af 100644
--- a/src/gui/kernel/qapplication_mac.mm
+++ b/src/gui/kernel/qapplication_mac.mm
@@ -227,8 +227,29 @@ void onApplicationChangedActivation( bool activated );
static void qt_mac_read_fontsmoothing_settings()
{
- NSInteger appleFontSmoothing = [[NSUserDefaults standardUserDefaults] integerForKey:@"AppleFontSmoothing"];
- qt_applefontsmoothing_enabled = (appleFontSmoothing > 0);
+ qt_applefontsmoothing_enabled = true;
+ int w = 10, h = 10;
+ QImage image(w, h, QImage::Format_RGB32);
+ image.fill(0xffffffff);
+ QPainter p(&image);
+ p.drawText(0, h, "X\\");
+ p.end();
+
+ const int *bits = (const int *) ((const QImage &) image).bits();
+ int bpl = image.bytesPerLine() / 4;
+ for (int y=0; y<w; ++y) {
+ for (int x=0; x<h; ++x) {
+ int r = qRed(bits[x]);
+ int g = qGreen(bits[x]);
+ int b = qBlue(bits[x]);
+ if (r != g || r != b) {
+ qt_applefontsmoothing_enabled = true;
+ return;
+ }
+ }
+ bits += bpl;
+ }
+ qt_applefontsmoothing_enabled = false;
}
Q_GUI_EXPORT bool qt_mac_execute_apple_script(const char *script, long script_len, AEDesc *ret) {
@@ -772,11 +793,11 @@ static void qt_mac_update_intersected_gl_widgets(QWidget *widget)
qt_post_window_change_event(glWidget);
it->lastUpdateWidget = widget;
} else if (it->lastUpdateWidget == widget) {
- // Update the gl wigets that the widget intersected the last time around,
- // and that we are not intersecting now. This prevents paint errors when the
+ // Update the gl wigets that the widget intersected the last time around,
+ // and that we are not intersecting now. This prevents paint errors when the
// intersecting widget leaves a gl widget.
qt_post_window_change_event(glWidget);
- it->lastUpdateWidget = 0;
+ it->lastUpdateWidget = 0;
}
}
#else
@@ -808,8 +829,8 @@ Q_GUI_EXPORT void qt_event_request_window_change(QWidget *widget)
// Post a kEventQtRequestWindowChange event. This event is semi-public,
// don't remove this line!
qt_event_request_window_change();
-
- // Post update request on gl widgets unconditionally.
+
+ // Post update request on gl widgets unconditionally.
if (qt_widget_private(widget)->isGLWidget == true) {
qt_post_window_change_event(widget);
return;
@@ -1214,8 +1235,6 @@ void qt_init(QApplicationPrivate *priv, int)
if (QApplication::desktopSettingsAware())
QApplicationPrivate::qt_mac_apply_settings();
- qt_mac_read_fontsmoothing_settings();
-
// Cocoa application delegate
#ifdef QT_MAC_USE_COCOA
NSApplication *cocoaApp = [NSApplication sharedApplication];
@@ -1253,6 +1272,7 @@ void qt_init(QApplicationPrivate *priv, int)
}
priv->native_modal_dialog_active = false;
+ qt_mac_read_fontsmoothing_settings();
}
void qt_release_apple_event_handler()
@@ -1705,7 +1725,7 @@ QApplicationPrivate::globalEventProcessor(EventHandlerCallRef er, EventRef event
// kEventMouseWheelMoved events if we dont eat this event
// (actually two events; one for horizontal and one for vertical).
// As a results of this, and to make sure we dont't receive duplicate events,
- // we try to detect when this happend by checking the 'compatibilityEvent'.
+ // we try to detect when this happend by checking the 'compatibilityEvent'.
SInt32 mdelt = 0;
GetEventParameter(event, kEventParamMouseWheelSmoothHorizontalDelta, typeSInt32, 0,
sizeof(mdelt), 0, &mdelt);
@@ -2576,7 +2596,7 @@ void QApplicationPrivate::closePopup(QWidget *popup)
if (QApplicationPrivate::popupWidgets->isEmpty()) { // this was the last popup
delete QApplicationPrivate::popupWidgets;
QApplicationPrivate::popupWidgets = 0;
-
+
// Special case for Tool windows: since they are activated and deactived together
// with a normal window they never become the QApplicationPrivate::active_window.
QWidget *appFocusWidget = QApplication::focusWidget();
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index f8943a8..9c001ab 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -501,9 +501,9 @@ public:
static TUint resolveS60ScanCode(TInt scanCode, TUint keysym);
QSet<WId> nativeWindows;
- int symbianProcessWsEvent(const TWsEvent *event);
- int symbianHandleCommand(int command);
- int symbianResourceChange(int type);
+ int symbianProcessWsEvent(const QSymbianEvent *symbianEvent);
+ int symbianHandleCommand(const QSymbianEvent *symbianEvent);
+ int symbianResourceChange(const QSymbianEvent *symbianEvent);
#endif
#if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined (Q_WS_QWS)
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 8c77728..361d231 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1528,6 +1528,12 @@ void QApplication::beep()
qt_S60Beep->Play();
}
+static inline bool callSymbianEventFilters(const QSymbianEvent *event)
+{
+ long unused;
+ return qApp->filterEvent(const_cast<QSymbianEvent *>(event), &unused);
+}
+
/*!
\warning This function is only available on Symbian.
\since 4.6
@@ -1544,6 +1550,9 @@ int QApplication::symbianProcessEvent(const QSymbianEvent *event)
QScopedLoopLevelCounter counter(d->threadData);
+ if (d->eventDispatcher->filterEvent(const_cast<QSymbianEvent *>(event)))
+ return 1;
+
QWidget *w = qApp ? qApp->focusWidget() : 0;
if (w) {
QInputContext *ic = w->inputContext();
@@ -1556,29 +1565,34 @@ int QApplication::symbianProcessEvent(const QSymbianEvent *event)
switch (event->type()) {
case QSymbianEvent::WindowServerEvent:
- return d->symbianProcessWsEvent(event->windowServerEvent());
+ return d->symbianProcessWsEvent(event);
case QSymbianEvent::CommandEvent:
- return d->symbianHandleCommand(event->command());
+ return d->symbianHandleCommand(event);
case QSymbianEvent::ResourceChangeEvent:
- return d->symbianResourceChange(event->resourceChangeType());
+ return d->symbianResourceChange(event);
default:
return -1;
}
}
-int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event)
+int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent)
{
// Qt event handling. Handle some events regardless of if the handle is in our
// widget map or not.
+ const TWsEvent *event = symbianEvent->windowServerEvent();
CCoeControl* control = reinterpret_cast<CCoeControl*>(event->Handle());
const bool controlInMap = QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control);
switch (event->Type()) {
case EEventPointerEnter:
- if (controlInMap)
+ if (controlInMap) {
+ callSymbianEventFilters(symbianEvent);
return 1; // Qt::Enter will be generated in HandlePointerL
+ }
break;
case EEventPointerExit:
if (controlInMap) {
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
if (S60) {
// mouseEvent outside our window, send leave event to last focused widget
QMouseEvent mEvent(QEvent::Leave, S60->lastPointerEventPos, S60->lastCursorPos,
@@ -1591,6 +1605,8 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event)
}
break;
case EEventScreenDeviceChanged:
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
if (S60)
S60->updateScreenSize();
if (qt_desktopWidget) {
@@ -1603,6 +1619,8 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event)
return 0; // Propagate to CONE
case EEventWindowVisibilityChanged:
if (controlInMap) {
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
const TWsVisibilityChangedEvent *visChangedEvent = event->VisibilityChanged();
QWidget *w = QWidgetPrivate::mapper->value(control);
if (!w->d_func()->maybeTopData())
@@ -1620,6 +1638,8 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event)
}
break;
case EEventFocusGained:
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
#ifndef QT_NO_CURSOR
//re-enable mouse interaction
if (S60->mouseInteractionEnabled) {
@@ -1633,6 +1653,8 @@ int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event)
#endif
break;
case EEventFocusLost:
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
#ifndef QT_NO_CURSOR
//disable mouse as may be moving to application that does not support it
if (S60->mouseInteractionEnabled) {
@@ -1684,11 +1706,16 @@ bool QApplication::symbianEventFilter(const QSymbianEvent *event)
\sa s60EventFilter(), s60ProcessEvent()
*/
-int QApplicationPrivate::symbianHandleCommand(int command)
+int QApplicationPrivate::symbianHandleCommand(const QSymbianEvent *symbianEvent)
{
Q_Q(QApplication);
int ret = 0;
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
+
+ int command = symbianEvent->command();
+
switch (command) {
#ifdef Q_WS_S60
case EAknSoftkeyExit: {
@@ -1728,14 +1755,18 @@ int QApplicationPrivate::symbianHandleCommand(int command)
Currently, KEikDynamicLayoutVariantSwitch and
KAknsMessageSkinChange are handled.
*/
-int QApplicationPrivate::symbianResourceChange(int type)
+int QApplicationPrivate::symbianResourceChange(const QSymbianEvent *symbianEvent)
{
int ret = 0;
+ int type = symbianEvent->resourceChangeType();
+
switch (type) {
#ifdef Q_WS_S60
case KEikDynamicLayoutVariantSwitch:
{
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
if (S60)
S60->updateScreenSize();
@@ -1760,6 +1791,8 @@ int QApplicationPrivate::symbianResourceChange(int type)
#ifndef QT_NO_STYLE_S60
case KAknsMessageSkinChange:
+ if (callSymbianEventFilters(symbianEvent))
+ return 1;
if (QS60Style *s60Style = qobject_cast<QS60Style*>(QApplication::style())) {
s60Style->d_func()->handleSkinChange();
ret = 1;
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index c14798a..f61d2fe 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -510,7 +510,7 @@ extern "C" {
}
// Make sure the opengl context is updated on resize.
- if (0 && qwidgetprivate->isGLWidget) {
+ if (qwidgetprivate->isGLWidget) {
qwidgetprivate->needWindowChange = true;
QEvent event(QEvent::MacGLWindowChange);
qApp->sendEvent(qwidget, &event);
diff --git a/src/gui/kernel/qformlayout.cpp b/src/gui/kernel/qformlayout.cpp
index b44cd50..aebc3a5 100644
--- a/src/gui/kernel/qformlayout.cpp
+++ b/src/gui/kernel/qformlayout.cpp
@@ -1925,11 +1925,11 @@ void QFormLayoutPrivate::arrangeWidgets(const QVector<QLayoutStruct>& layouts, Q
/*
If the field on the right-hand side is tall,
we want the label to be top-aligned, but not too
- much. So we introduce a 5 / 4 factor so that it
- gets a few extra pixels at the top.
+ much. So we introduce a 7 / 4 factor so that it
+ gets some extra pixels at the top.
*/
height = qMin(height,
- qMin(label->sizeHint.height() * 5 / 4,
+ qMin(label->sizeHint.height() * 7 / 4,
label->maxSize.height()));
}
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index b18830f..3dbc843 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -3414,6 +3414,38 @@ void QWidgetPrivate::hide_sys()
ShowHide(window, false);
#else
[window orderOut:window];
+ // Unfortunately it is not as easy as just hiding the window, we need
+ // to find out if we were in full screen mode. If we were and this is
+ // the last window in full screen mode then we need to unset the full screen
+ // mode. If this is not the last visible window in full screen mode then we
+ // don't change the full screen mode.
+ if(q->isFullScreen())
+ {
+ bool keepFullScreen = false;
+ QWidgetList windowList = qApp->topLevelWidgets();
+ int windowCount = windowList.count();
+ for(int i = 0; i < windowCount; i++)
+ {
+ QWidget *w = windowList[i];
+ // If it is the same window, we don't need to check :-)
+ if(q == w)
+ continue;
+ // If they are not visible or if they are minimized then
+ // we just ignore them.
+ if(!w->isVisible() || w->isMinimized())
+ continue;
+ // Is it full screen?
+ // Notice that if there is one window in full screen mode then we
+ // cannot switch the full screen mode off, therefore we just abort.
+ if(w->isFullScreen()) {
+ keepFullScreen = true;
+ break;
+ }
+ }
+ // No windows in full screen mode, so let just unset that flag.
+ if(!keepFullScreen)
+ qt_mac_set_fullscreen_mode(false);
+ }
#endif
toggleDrawers(false);
#ifndef QT_MAC_USE_COCOA
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index 211f4ce..b5f052b 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -1106,8 +1106,14 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
// ### Note: Ubuntulooks breaks when the proper widget is passed
// Murrine engine requires a widget not to get RGBA check - warnings
GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton"));
- gtkPainter.paintOption(gtkCheckButton , buttonRect, state, shadow, gtkRadioButton->style, QLS("radiobutton"));
-
+ QString key(QLS("radiobutton"));
+ if (option->state & State_HasFocus) { // Themes such as Nodoka check this flag
+ key += QLatin1Char('f');
+ GTK_WIDGET_SET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS);
+ }
+ gtkPainter.paintOption(gtkCheckButton , buttonRect, state, shadow, gtkRadioButton->style, key);
+ if (option->state & State_HasFocus)
+ GTK_WIDGET_UNSET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS);
}
break;
@@ -1128,6 +1134,11 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
int spacing;
GtkWidget *gtkCheckButton = d->gtkWidget(QLS("GtkCheckButton"));
+ QString key(QLS("checkbutton"));
+ if (option->state & State_HasFocus) { // Themes such as Nodoka checks this flag
+ key += QLatin1Char('f');
+ GTK_WIDGET_SET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS);
+ }
// Some styles such as aero-clone assume they can paint in the spacing area
gtkPainter.setClipRect(option->rect);
@@ -1137,7 +1148,10 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
QRect checkRect = option->rect.adjusted(spacing, spacing, -spacing, -spacing);
gtkPainter.paintCheckbox(gtkCheckButton, checkRect, state, shadow, gtkCheckButton->style,
- QLS("checkbutton"));
+ key);
+ if (option->state & State_HasFocus)
+ GTK_WIDGET_UNSET_FLAGS(gtkCheckButton, GTK_HAS_FOCUS);
+
}
break;
diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp
index 414c2ed..b0a64ea 100644
--- a/src/gui/widgets/qlinecontrol.cpp
+++ b/src/gui/widgets/qlinecontrol.cpp
@@ -524,8 +524,11 @@ void QLineControl::draw(QPainter *painter, const QPoint &offset, const QRect &cl
m_textLayout.draw(painter, offset, selections, clip);
if (flags & DrawCursor){
+ int cursor = m_cursor;
+ if (m_preeditCursor != -1)
+ cursor += m_preeditCursor;
if(!m_blinkPeriod || m_blinkStatus)
- m_textLayout.drawCursor(painter, offset, m_cursor, m_cursorWidth);
+ m_textLayout.drawCursor(painter, offset, cursor, m_cursorWidth);
}
}
diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h
index 301ff72..d6f2705 100644
--- a/src/gui/widgets/qlinecontrol_p.h
+++ b/src/gui/widgets/qlinecontrol_p.h
@@ -549,7 +549,10 @@ inline qreal QLineControl::cursorToX(int cursor) const
inline qreal QLineControl::cursorToX() const
{
- return cursorToX(m_cursor);
+ int cursor = m_cursor;
+ if (m_preeditCursor != -1)
+ cursor += m_preeditCursor;
+ return cursorToX(cursor);
}
inline bool QLineControl::isReadOnly() const
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 20baac8..fff7097 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -564,7 +564,8 @@ bool QHttpNetworkConnectionPrivate::fillPipeline(QList<HttpMessagePair> &queue,
}
-QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket* socket)
+QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket* socket,
+ const QString &extraDetail)
{
Q_ASSERT(socket);
@@ -581,7 +582,7 @@ QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError e
errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Connection closed"));
break;
case QNetworkReply::TimeoutError:
- errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTP request failed"));
+ errorString = QLatin1String(QT_TRANSLATE_NOOP("QAbstractSocket", "Socket operation timed out"));
break;
case QNetworkReply::ProxyAuthenticationRequiredError:
errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Proxy requires authentication"));
@@ -600,7 +601,7 @@ QString QHttpNetworkConnectionPrivate::errorDetail(QNetworkReply::NetworkError e
break;
default:
// all other errors are treated as QNetworkReply::UnknownNetworkError
- errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTP request failed"));
+ errorString = extraDetail;
break;
}
return errorString;
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
index 76da883..03cf09c 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -185,7 +185,8 @@ public:
void createAuthorization(QAbstractSocket *socket, QHttpNetworkRequest &request);
- QString errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket *socket);
+ QString errorDetail(QNetworkReply::NetworkError errorCode, QAbstractSocket *socket,
+ const QString &extraDetail = QString());
#ifndef QT_NO_COMPRESS
bool expand(QAbstractSocket *socket, QHttpNetworkReply *reply, bool dataComplete);
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 1955dba..b80ae9a 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -872,7 +872,7 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
break;
}
QPointer<QObject> that = connection;
- QString errorString = connection->d_func()->errorDetail(errorCode, socket);
+ QString errorString = connection->d_func()->errorDetail(errorCode, socket, socket->errorString());
if (send2Reply) {
if (reply) {
reply->d_func()->errorString = errorString;
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp
index 8257545..7088a57 100644
--- a/src/network/socket/qnativesocketengine_win.cpp
+++ b/src/network/socket/qnativesocketengine_win.cpp
@@ -1007,21 +1007,21 @@ qint64 QNativeSocketEnginePrivate::nativeWrite(const char *data, qint64 len)
ret += qint64(bytesWritten);
+ int err;
if (socketRet != SOCKET_ERROR) {
if (ret == len)
break;
else
continue;
- } else if (WSAGetLastError() == WSAEWOULDBLOCK) {
+ } else if ((err = WSAGetLastError()) == WSAEWOULDBLOCK) {
break;
- } else if (WSAGetLastError() == WSAENOBUFS) {
+ } else if (err == WSAENOBUFS) {
// this function used to not send more than 49152 per call to WSASendTo
// to avoid getting a WSAENOBUFS. However this is a performance regression
// and we think it only appears with old windows versions. We now handle the
// WSAENOBUFS and hope it never appears anyway.
// just go on, the next loop run we will try a smaller number
} else {
- int err = WSAGetLastError();
WS_ERROR_DEBUG(err);
switch (err) {
case WSAECONNRESET:
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index 8993e72..9a9b1b5 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -696,11 +696,11 @@ QSslCertificate QSslCertificatePrivate::QSslCertificate_from_X509(X509 *x509)
static bool matchLineFeed(const QByteArray &pem, int *offset)
{
- char ch = pem.at(*offset);
+ char ch;
// ignore extra whitespace at the end of the line
- while (ch == ' ' && *offset < pem.size())
- ch = pem.at(++*offset);
+ while (*offset < pem.size() && (ch = pem.at(*offset)) == ' ')
+ ++*offset;
if (ch == '\n') {
*offset += 1;
@@ -732,7 +732,7 @@ QList<QSslCertificate> QSslCertificatePrivate::certificatesFromPem(const QByteAr
break;
offset = endPos + sizeof(ENDCERTSTRING) - 1;
- if (!matchLineFeed(pem, &offset))
+ if (offset < pem.size() && !matchLineFeed(pem, &offset))
break;
QByteArray decoded = QByteArray::fromBase64(
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index de1583e..892d330 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -553,6 +553,12 @@ void QSslSocketBackendPrivate::transmit()
#endif
writeBuffer.free(writtenBytes);
totalBytesWritten += writtenBytes;
+
+ if (writtenBytes < nextDataBlockSize) {
+ // break out of the writing loop and try again after we had read
+ transmitting = true;
+ break;
+ }
}
if (totalBytesWritten > 0) {
@@ -586,12 +592,26 @@ void QSslSocketBackendPrivate::transmit()
while ((pendingBytes = plainSocket->bytesAvailable()) > 0) {
// Read encrypted data from the socket into a buffer.
data.resize(pendingBytes);
- int decryptedBytesRead = plainSocket->read(data.data(), pendingBytes);
+ // just peek() here because q_BIO_write could write less data than expected
+ int encryptedBytesRead = plainSocket->peek(data.data(), pendingBytes);
#ifdef QSSLSOCKET_DEBUG
- qDebug() << "QSslSocketBackendPrivate::transmit: read" << decryptedBytesRead << "encrypted bytes from the socket";
+ qDebug() << "QSslSocketBackendPrivate::transmit: read" << encryptedBytesRead << "encrypted bytes from the socket";
#endif
// Write encrypted data from the buffer into the read BIO.
- q_BIO_write(readBio, data.constData(), decryptedBytesRead);
+ int writtenToBio = q_BIO_write(readBio, data.constData(), encryptedBytesRead);
+
+ // do the actual read() here and throw away the results.
+ if (writtenToBio > 0) {
+ // ### TODO: make this cheaper by not making it memcpy. E.g. make it work with data=0x0 or make it work with seek
+ plainSocket->read(data.data(), writtenToBio);
+ } else {
+ // ### Better error handling.
+ q->setErrorString(QSslSocket::tr("Unable to decrypt data: %1").arg(SSL_ERRORSTR()));
+ q->setSocketError(QAbstractSocket::UnknownSocketError);
+ emit q->error(QAbstractSocket::UnknownSocketError);
+ return;
+ }
+
transmitting = true;
}
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
index 556b888..9fd9e18 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -324,6 +324,11 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS
newProg->program->bindAttributeLocation("textureCoordArray", QT_TEXTURE_COORDS_ATTR);
if (newProg->useOpacityAttribute)
newProg->program->bindAttributeLocation("opacityArray", QT_OPACITY_ATTR);
+ if (newProg->usePmvMatrix) {
+ newProg->program->bindAttributeLocation("pmvMatrix1", QT_PMV_MATRIX_1_ATTR);
+ newProg->program->bindAttributeLocation("pmvMatrix2", QT_PMV_MATRIX_2_ATTR);
+ newProg->program->bindAttributeLocation("pmvMatrix3", QT_PMV_MATRIX_3_ATTR);
+ }
newProg->program->link();
if (!newProg->program->isLinked()) {
@@ -424,7 +429,6 @@ GLuint QGLEngineShaderManager::getUniformLocation(Uniform id)
"patternColor",
"globalOpacity",
"depth",
- "pmvMatrix",
"maskTexture",
"fragmentColor",
"linearData",
@@ -743,6 +747,7 @@ bool QGLEngineShaderManager::useCorrectShaderProg()
}
requiredProgram.useTextureCoords = texCoords;
requiredProgram.useOpacityAttribute = (opacityMode == AttributeOpacity);
+ requiredProgram.usePmvMatrix = true;
// At this point, requiredProgram is fully populated so try to find the program in the cache
currentShaderProg = sharedShaders->findProgramInCache(requiredProgram);
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
index c52e5c0..3ab4ebe 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h
@@ -253,6 +253,9 @@ 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;
+static const GLuint QT_PMV_MATRIX_1_ATTR = 3;
+static const GLuint QT_PMV_MATRIX_2_ATTR = 4;
+static const GLuint QT_PMV_MATRIX_3_ATTR = 5;
class QGLEngineShaderProg;
@@ -397,6 +400,7 @@ public:
bool useTextureCoords;
bool useOpacityAttribute;
+ bool usePmvMatrix;
bool operator==(const QGLEngineShaderProg& other) {
// We don't care about the program
@@ -431,7 +435,6 @@ public:
PatternColor,
GlobalOpacity,
Depth,
- PmvMatrix,
MaskTexture,
FragmentColor,
LinearData,
diff --git a/src/opengl/gl2paintengineex/qglengineshadersource_p.h b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
index d9a61e9..ee04166 100644
--- a/src/opengl/gl2paintengineex/qglengineshadersource_p.h
+++ b/src/opengl/gl2paintengineex/qglengineshadersource_p.h
@@ -63,210 +63,229 @@ QT_BEGIN_NAMESPACE
QT_MODULE(OpenGL)
-static const char* const qglslMainVertexShader = "\
- uniform highp float depth;\
- void setPosition();\
- void main(void)\
- {\
- setPosition();\
- gl_Position.z = depth * gl_Position.w;\
- }";
-
-static const char* const qglslMainWithTexCoordsVertexShader = "\
- attribute highp vec2 textureCoordArray; \
- varying highp vec2 textureCoords; \
- uniform highp float depth;\
- void setPosition();\
- void main(void) \
- {\
- setPosition();\
- gl_Position.z = depth * gl_Position.w;\
- 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 qglslMainVertexShader = "\n\
+ void setPosition(); \n\
+ void main(void) \n\
+ { \n\
+ setPosition(); \n\
+ }\n";
+
+static const char* const qglslMainWithTexCoordsVertexShader = "\n\
+ attribute highp vec2 textureCoordArray; \n\
+ varying highp vec2 textureCoords; \n\
+ void setPosition(); \n\
+ void main(void) \n\
+ { \n\
+ setPosition(); \n\
+ textureCoords = textureCoordArray; \n\
+ }\n";
+
+static const char* const qglslMainWithTexCoordsAndOpacityVertexShader = "\n\
+ attribute highp vec2 textureCoordArray; \n\
+ attribute lowp float opacityArray; \n\
+ varying highp vec2 textureCoords; \n\
+ varying lowp float opacity; \n\
+ void setPosition(); \n\
+ void main(void) \n\
+ { \n\
+ setPosition(); \n\
+ textureCoords = textureCoordArray; \n\
+ opacity = opacityArray; \n\
+ }\n";
// NOTE: We let GL do the perspective correction so texture lookups in the fragment
// shader are also perspective corrected.
-static const char* const qglslPositionOnlyVertexShader = "\
- attribute highp vec2 vertexCoordsArray;\
- uniform highp mat3 pmvMatrix;\
- void setPosition(void)\
- {\
- vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \
- gl_Position = vec4(transformedPos.xy, 0.0, transformedPos.z); \
- }";
-
-static const char* const qglslUntransformedPositionVertexShader = "\
- attribute highp vec4 vertexCoordsArray;\
- void setPosition(void)\
- {\
- gl_Position = vertexCoordsArray;\
- }";
+static const char* const qglslPositionOnlyVertexShader = "\n\
+ attribute highp vec2 vertexCoordsArray; \n\
+ attribute highp vec3 pmvMatrix1; \n\
+ attribute highp vec3 pmvMatrix2; \n\
+ attribute highp vec3 pmvMatrix3; \n\
+ void setPosition(void) \n\
+ { \n\
+ highp mat3 pmvMatrix = mat3(pmvMatrix1, pmvMatrix2, pmvMatrix3); \n\
+ vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \n\
+ gl_Position = vec4(transformedPos.xy, 0.0, transformedPos.z); \n\
+ }\n";
+
+static const char* const qglslUntransformedPositionVertexShader = "\n\
+ attribute highp vec4 vertexCoordsArray; \n\
+ void setPosition(void) \n\
+ { \n\
+ gl_Position = vertexCoordsArray; \n\
+ }\n";
// Pattern Brush - This assumes the texture size is 8x8 and thus, the inverted size is 0.125
-static const char* const qglslPositionWithPatternBrushVertexShader = "\
- attribute highp vec2 vertexCoordsArray; \
- uniform highp mat3 pmvMatrix; \
- uniform mediump vec2 halfViewportSize; \
- uniform highp vec2 invertedTextureSize; \
- uniform highp mat3 brushTransform; \
- varying highp vec2 patternTexCoords; \
- void setPosition(void) { \
- vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \
- gl_Position.xy = transformedPos.xy / transformedPos.z; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1.0); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \
- patternTexCoords.xy = (hTexCoords.xy * 0.125) * invertedHTexCoordsZ; \
- }";
+static const char* const qglslPositionWithPatternBrushVertexShader = "\n\
+ attribute highp vec2 vertexCoordsArray; \n\
+ attribute highp vec3 pmvMatrix1; \n\
+ attribute highp vec3 pmvMatrix2; \n\
+ attribute highp vec3 pmvMatrix3; \n\
+ uniform mediump vec2 halfViewportSize; \n\
+ uniform highp vec2 invertedTextureSize; \n\
+ uniform highp mat3 brushTransform; \n\
+ varying highp vec2 patternTexCoords; \n\
+ void setPosition(void) \n\
+ { \n\
+ highp mat3 pmvMatrix = mat3(pmvMatrix1, pmvMatrix2, pmvMatrix3); \n\
+ vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \n\
+ gl_Position.xy = transformedPos.xy / transformedPos.z; \n\
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \n\
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1.0); \n\
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \n\
+ gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \n\
+ patternTexCoords.xy = (hTexCoords.xy * 0.125) * invertedHTexCoordsZ; \n\
+ }\n";
static const char* const qglslAffinePositionWithPatternBrushVertexShader
= qglslPositionWithPatternBrushVertexShader;
-static const char* const qglslPatternBrushSrcFragmentShader = "\
- uniform lowp sampler2D brushTexture;\
- uniform lowp vec4 patternColor; \
- varying highp vec2 patternTexCoords;\
- lowp vec4 srcPixel() { \
- return patternColor * (1.0 - texture2D(brushTexture, patternTexCoords).r); \
+static const char* const qglslPatternBrushSrcFragmentShader = "\n\
+ uniform lowp sampler2D brushTexture; \n\
+ uniform lowp vec4 patternColor; \n\
+ varying highp vec2 patternTexCoords;\n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return patternColor * (1.0 - texture2D(brushTexture, patternTexCoords).r); \n\
}\n";
// Linear Gradient Brush
-static const char* const qglslPositionWithLinearGradientBrushVertexShader = "\
- attribute highp vec2 vertexCoordsArray; \
- uniform highp mat3 pmvMatrix; \
- uniform mediump vec2 halfViewportSize; \
- uniform highp vec3 linearData; \
- uniform highp mat3 brushTransform; \
- varying mediump float index; \
- void setPosition() { \
- vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \
- gl_Position.xy = transformedPos.xy / transformedPos.z; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \
- index = (dot(linearData.xy, hTexCoords.xy) * linearData.z) * invertedHTexCoordsZ; \
- }";
+static const char* const qglslPositionWithLinearGradientBrushVertexShader = "\n\
+ attribute highp vec2 vertexCoordsArray; \n\
+ attribute highp vec3 pmvMatrix1; \n\
+ attribute highp vec3 pmvMatrix2; \n\
+ attribute highp vec3 pmvMatrix3; \n\
+ uniform mediump vec2 halfViewportSize; \n\
+ uniform highp vec3 linearData; \n\
+ uniform highp mat3 brushTransform; \n\
+ varying mediump float index; \n\
+ void setPosition() \n\
+ { \n\
+ highp mat3 pmvMatrix = mat3(pmvMatrix1, pmvMatrix2, pmvMatrix3); \n\
+ vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \n\
+ gl_Position.xy = transformedPos.xy / transformedPos.z; \n\
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \n\
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \n\
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \n\
+ gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \n\
+ index = (dot(linearData.xy, hTexCoords.xy) * linearData.z) * invertedHTexCoordsZ; \n\
+ }\n";
static const char* const qglslAffinePositionWithLinearGradientBrushVertexShader
= qglslPositionWithLinearGradientBrushVertexShader;
-static const char* const qglslLinearGradientBrushSrcFragmentShader = "\
- uniform lowp sampler2D brushTexture; \
- varying mediump float index; \
- lowp vec4 srcPixel() { \
- mediump vec2 val = vec2(index, 0.5); \
- return texture2D(brushTexture, val); \
+static const char* const qglslLinearGradientBrushSrcFragmentShader = "\n\
+ uniform lowp sampler2D brushTexture; \n\
+ varying mediump float index; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ mediump vec2 val = vec2(index, 0.5); \n\
+ return texture2D(brushTexture, val); \n\
}\n";
// Conical Gradient Brush
-static const char* const qglslPositionWithConicalGradientBrushVertexShader = "\
- attribute highp vec2 vertexCoordsArray;\
- uniform highp mat3 pmvMatrix;\
- uniform mediump vec2 halfViewportSize; \
- uniform highp mat3 brushTransform; \
- varying highp vec2 A; \
- void setPosition(void)\
- {\
- vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \
- gl_Position.xy = transformedPos.xy / transformedPos.z; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \
- A = hTexCoords.xy * invertedHTexCoordsZ; \
- }";
+static const char* const qglslPositionWithConicalGradientBrushVertexShader = "\n\
+ attribute highp vec2 vertexCoordsArray; \n\
+ attribute highp vec3 pmvMatrix1; \n\
+ attribute highp vec3 pmvMatrix2; \n\
+ attribute highp vec3 pmvMatrix3; \n\
+ uniform mediump vec2 halfViewportSize; \n\
+ uniform highp mat3 brushTransform; \n\
+ varying highp vec2 A; \n\
+ void setPosition(void) \n\
+ { \n\
+ highp mat3 pmvMatrix = mat3(pmvMatrix1, pmvMatrix2, pmvMatrix3); \n\
+ vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \n\
+ gl_Position.xy = transformedPos.xy / transformedPos.z; \n\
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \n\
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \n\
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \n\
+ gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \n\
+ A = hTexCoords.xy * invertedHTexCoordsZ; \n\
+ }\n";
static const char* const qglslAffinePositionWithConicalGradientBrushVertexShader
= qglslPositionWithConicalGradientBrushVertexShader;
static const char* const qglslConicalGradientBrushSrcFragmentShader = "\n\
#define INVERSE_2PI 0.1591549430918953358 \n\
- uniform lowp sampler2D brushTexture; \n\
- uniform mediump float angle; \
- varying highp vec2 A; \
- lowp vec4 srcPixel() { \
- highp float t; \
- if (abs(A.y) == abs(A.x)) \
- t = (atan(-A.y + 0.002, A.x) + angle) * INVERSE_2PI; \
- else \
- t = (atan(-A.y, A.x) + angle) * INVERSE_2PI; \
- return texture2D(brushTexture, vec2(t - floor(t), 0.5)); \
- }";
+ uniform lowp sampler2D brushTexture; \n\
+ uniform mediump float angle; \n\
+ varying highp vec2 A; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ highp float t; \n\
+ if (abs(A.y) == abs(A.x)) \n\
+ t = (atan(-A.y + 0.002, A.x) + angle) * INVERSE_2PI; \n\
+ else \n\
+ t = (atan(-A.y, A.x) + angle) * INVERSE_2PI; \n\
+ return texture2D(brushTexture, vec2(t - floor(t), 0.5)); \n\
+ }\n";
// Radial Gradient Brush
-static const char* const qglslPositionWithRadialGradientBrushVertexShader = "\
- attribute highp vec2 vertexCoordsArray;\
- uniform highp mat3 pmvMatrix;\
- uniform mediump vec2 halfViewportSize; \
- uniform highp mat3 brushTransform; \
- uniform highp vec2 fmp; \
- varying highp float b; \
- varying highp vec2 A; \
- void setPosition(void) \
- {\
- vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \
- gl_Position.xy = transformedPos.xy / transformedPos.z; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \
- A = hTexCoords.xy * invertedHTexCoordsZ; \
- b = 2.0 * dot(A, fmp); \
- }";
+static const char* const qglslPositionWithRadialGradientBrushVertexShader = "\n\
+ attribute highp vec2 vertexCoordsArray;\n\
+ attribute highp vec3 pmvMatrix1; \n\
+ attribute highp vec3 pmvMatrix2; \n\
+ attribute highp vec3 pmvMatrix3; \n\
+ uniform mediump vec2 halfViewportSize; \n\
+ uniform highp mat3 brushTransform; \n\
+ uniform highp vec2 fmp; \n\
+ varying highp float b; \n\
+ varying highp vec2 A; \n\
+ void setPosition(void) \n\
+ {\n\
+ highp mat3 pmvMatrix = mat3(pmvMatrix1, pmvMatrix2, pmvMatrix3); \n\
+ vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \n\
+ gl_Position.xy = transformedPos.xy / transformedPos.z; \n\
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \n\
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \n\
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \n\
+ gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \n\
+ A = hTexCoords.xy * invertedHTexCoordsZ; \n\
+ b = 2.0 * dot(A, fmp); \n\
+ }\n";
static const char* const qglslAffinePositionWithRadialGradientBrushVertexShader
= qglslPositionWithRadialGradientBrushVertexShader;
-static const char* const qglslRadialGradientBrushSrcFragmentShader = "\
- uniform lowp sampler2D brushTexture; \
- uniform highp float fmp2_m_radius2; \
- uniform highp float inverse_2_fmp2_m_radius2; \
- varying highp float b; \
- varying highp vec2 A; \
- lowp vec4 srcPixel() { \
- highp float c = -dot(A, A); \
- highp vec2 val = vec2((-b + sqrt(b*b - 4.0*fmp2_m_radius2*c)) * inverse_2_fmp2_m_radius2, 0.5); \
- return texture2D(brushTexture, val); \
- }";
+static const char* const qglslRadialGradientBrushSrcFragmentShader = "\n\
+ uniform lowp sampler2D brushTexture; \n\
+ uniform highp float fmp2_m_radius2; \n\
+ uniform highp float inverse_2_fmp2_m_radius2; \n\
+ varying highp float b; \n\
+ varying highp vec2 A; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ highp float c = -dot(A, A); \n\
+ highp vec2 val = vec2((-b + sqrt(b*b - 4.0*fmp2_m_radius2*c)) * inverse_2_fmp2_m_radius2, 0.5); \n\
+ return texture2D(brushTexture, val); \n\
+ }\n";
// Texture Brush
-static const char* const qglslPositionWithTextureBrushVertexShader = "\
- attribute highp vec2 vertexCoordsArray; \
- uniform highp mat3 pmvMatrix; \
- uniform mediump vec2 halfViewportSize; \
- uniform highp vec2 invertedTextureSize; \
- uniform highp mat3 brushTransform; \
- varying highp vec2 textureCoords; \
- void setPosition(void) { \
- vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \
- gl_Position.xy = transformedPos.xy / transformedPos.z; \
- mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \
- mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \
- mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \
- gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \
- textureCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \
- }";
+static const char* const qglslPositionWithTextureBrushVertexShader = "\n\
+ attribute highp vec2 vertexCoordsArray; \n\
+ attribute highp vec3 pmvMatrix1; \n\
+ attribute highp vec3 pmvMatrix2; \n\
+ attribute highp vec3 pmvMatrix3; \n\
+ uniform mediump vec2 halfViewportSize; \n\
+ uniform highp vec2 invertedTextureSize; \n\
+ uniform highp mat3 brushTransform; \n\
+ varying highp vec2 textureCoords; \n\
+ void setPosition(void) \n\
+ { \n\
+ highp mat3 pmvMatrix = mat3(pmvMatrix1, pmvMatrix2, pmvMatrix3); \n\
+ vec3 transformedPos = pmvMatrix * vec3(vertexCoordsArray.xy, 1.0); \n\
+ gl_Position.xy = transformedPos.xy / transformedPos.z; \n\
+ mediump vec2 viewportCoords = (gl_Position.xy + 1.0) * halfViewportSize; \n\
+ mediump vec3 hTexCoords = brushTransform * vec3(viewportCoords, 1); \n\
+ mediump float invertedHTexCoordsZ = 1.0 / hTexCoords.z; \n\
+ gl_Position = vec4(gl_Position.xy * invertedHTexCoordsZ, 0.0, invertedHTexCoordsZ); \n\
+ textureCoords.xy = (hTexCoords.xy * invertedTextureSize) * gl_Position.w; \n\
+ }\n";
static const char* const qglslAffinePositionWithTextureBrushVertexShader
= qglslPositionWithTextureBrushVertexShader;
@@ -275,148 +294,165 @@ static const char* const qglslAffinePositionWithTextureBrushVertexShader
// OpenGL ES does not support GL_REPEAT wrap modes for NPOT textures. So instead,
// we emulate GL_REPEAT by only taking the fractional part of the texture coords.
// TODO: Special case POT textures which don't need this emulation
-static const char* const qglslTextureBrushSrcFragmentShader = "\
- varying highp vec2 textureCoords; \
- uniform lowp sampler2D brushTexture; \
- lowp vec4 srcPixel() { \
- return texture2D(brushTexture, fract(textureCoords)); \
- }";
+static const char* const qglslTextureBrushSrcFragmentShader = "\n\
+ varying highp vec2 textureCoords; \n\
+ uniform lowp sampler2D brushTexture; \n\
+ lowp vec4 srcPixel() { \n\
+ return texture2D(brushTexture, fract(textureCoords)); \n\
+ }\n";
#else
-static const char* const qglslTextureBrushSrcFragmentShader = "\
- varying highp vec2 textureCoords; \
- uniform lowp sampler2D brushTexture; \
- lowp vec4 srcPixel() { \
- return texture2D(brushTexture, textureCoords); \
- }";
+static const char* const qglslTextureBrushSrcFragmentShader = "\n\
+ varying highp vec2 textureCoords; \n\
+ uniform lowp sampler2D brushTexture; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return texture2D(brushTexture, textureCoords); \n\
+ }\n";
#endif
-static const char* const qglslTextureBrushSrcWithPatternFragmentShader = "\
- varying highp vec2 textureCoords; \
- uniform lowp vec4 patternColor; \
- uniform lowp sampler2D brushTexture; \
- lowp vec4 srcPixel() { \
- return patternColor * (1.0 - texture2D(brushTexture, textureCoords).r); \
- }";
+static const char* const qglslTextureBrushSrcWithPatternFragmentShader = "\n\
+ varying highp vec2 textureCoords; \n\
+ uniform lowp vec4 patternColor; \n\
+ uniform lowp sampler2D brushTexture; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return patternColor * (1.0 - texture2D(brushTexture, textureCoords).r); \n\
+ }\n";
// Solid Fill Brush
-static const char* const qglslSolidBrushSrcFragmentShader = "\
- uniform lowp vec4 fragmentColor; \
- lowp vec4 srcPixel() { \
- return fragmentColor; \
- }";
-
-static const char* const qglslImageSrcFragmentShader = "\
- varying highp vec2 textureCoords; \
- uniform lowp sampler2D imageTexture; \
- lowp vec4 srcPixel() { \
- return texture2D(imageTexture, textureCoords); \
- }";
-
-static const char* const qglslCustomSrcFragmentShader = "\
- varying highp vec2 textureCoords; \
- uniform lowp sampler2D imageTexture; \
- lowp vec4 customShader(lowp sampler2D texture, highp vec2 coords); \
- lowp vec4 srcPixel() { \
- return customShader(imageTexture, textureCoords); \
- }";
-
-static const char* const qglslImageSrcWithPatternFragmentShader = "\
- varying highp vec2 textureCoords; \
- uniform lowp vec4 patternColor; \
- uniform lowp sampler2D imageTexture; \
- lowp vec4 srcPixel() { \
- return patternColor * (1.0 - texture2D(imageTexture, textureCoords).r); \
- }\n";
-
-static const char* const qglslNonPremultipliedImageSrcFragmentShader = "\
- varying highp vec2 textureCoords; \
- uniform lowp sampler2D imageTexture; \
- lowp vec4 srcPixel() { \
- lowp vec4 sample = texture2D(imageTexture, textureCoords); \
- sample.rgb = sample.rgb * sample.a; \
- return sample; \
- }";
-
-static const char* const qglslShockingPinkSrcFragmentShader = "\
- lowp vec4 srcPixel() { \
- 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; \
- lowp vec4 srcPixel(); \
- lowp vec4 applyMask(lowp vec4); \
- lowp vec4 compose(lowp vec4); \
- void main() { \
- gl_FragColor = applyMask(compose(srcPixel()*globalOpacity))); \
- }";
-
-static const char* const qglslMainFragmentShader_CM = "\
- lowp vec4 srcPixel(); \
- lowp vec4 applyMask(lowp vec4); \
- lowp vec4 compose(lowp vec4); \
- void main() { \
- gl_FragColor = applyMask(compose(srcPixel())); \
- }";
-
-static const char* const qglslMainFragmentShader_MO = "\
- uniform lowp float globalOpacity; \
- lowp vec4 srcPixel(); \
- lowp vec4 applyMask(lowp vec4); \
- void main() { \
- gl_FragColor = applyMask(srcPixel()*globalOpacity); \
- }";
-
-static const char* const qglslMainFragmentShader_M = "\
- lowp vec4 srcPixel(); \
- lowp vec4 applyMask(lowp vec4); \
- void main() { \
- gl_FragColor = applyMask(srcPixel()); \
- }";
-
-static const char* const qglslMainFragmentShader_CO = "\
- uniform lowp float globalOpacity; \
- lowp vec4 srcPixel(); \
- lowp vec4 compose(lowp vec4); \
- void main() { \
- gl_FragColor = compose(srcPixel()*globalOpacity); \
- }";
-
-static const char* const qglslMainFragmentShader_C = "\
- lowp vec4 srcPixel(); \
- lowp vec4 compose(lowp vec4); \
- void main() { \
- gl_FragColor = compose(srcPixel()); \
- }";
-
-static const char* const qglslMainFragmentShader_O = "\
- uniform lowp float globalOpacity; \
- lowp vec4 srcPixel(); \
- void main() { \
- gl_FragColor = srcPixel()*globalOpacity; \
- }";
-
-static const char* const qglslMainFragmentShader = "\
- lowp vec4 srcPixel(); \
- void main() { \
- gl_FragColor = srcPixel(); \
- }";
-
-static const char* const qglslMaskFragmentShader = "\
- varying highp vec2 textureCoords;\
- uniform lowp sampler2D maskTexture;\
- lowp vec4 applyMask(lowp vec4 src) \
- {\
- lowp vec4 mask = texture2D(maskTexture, textureCoords); \
- return src * mask.a; \
- }";
+static const char* const qglslSolidBrushSrcFragmentShader = "\n\
+ uniform lowp vec4 fragmentColor; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return fragmentColor; \n\
+ }\n";
+
+static const char* const qglslImageSrcFragmentShader = "\n\
+ varying highp vec2 textureCoords; \n\
+ uniform lowp sampler2D imageTexture; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return texture2D(imageTexture, textureCoords); \n\
+ }\n";
+
+static const char* const qglslCustomSrcFragmentShader = "\n\
+ varying highp vec2 textureCoords; \n\
+ uniform lowp sampler2D imageTexture; \n\
+ lowp vec4 customShader(lowp sampler2D texture, highp vec2 coords); \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return customShader(imageTexture, textureCoords); \n\
+ }\n";
+
+static const char* const qglslImageSrcWithPatternFragmentShader = "\n\
+ varying highp vec2 textureCoords; \n\
+ uniform lowp vec4 patternColor; \n\
+ uniform lowp sampler2D imageTexture; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return patternColor * (1.0 - texture2D(imageTexture, textureCoords).r); \n\
+ }\n";
+
+static const char* const qglslNonPremultipliedImageSrcFragmentShader = "\n\
+ varying highp vec2 textureCoords; \n\
+ uniform lowp sampler2D imageTexture; \n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ lowp vec4 sample = texture2D(imageTexture, textureCoords); \n\
+ sample.rgb = sample.rgb * sample.a; \n\
+ return sample; \n\
+ }\n";
+
+static const char* const qglslShockingPinkSrcFragmentShader = "\n\
+ lowp vec4 srcPixel() \n\
+ { \n\
+ return vec4(0.98, 0.06, 0.75, 1.0); \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_ImageArrays = "\n\
+ varying lowp float opacity; \n\
+ lowp vec4 srcPixel(); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = srcPixel() * opacity; \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_CMO = "\n\
+ uniform lowp float globalOpacity; \n\
+ lowp vec4 srcPixel(); \n\
+ lowp vec4 applyMask(lowp vec4); \n\
+ lowp vec4 compose(lowp vec4); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = applyMask(compose(srcPixel()*globalOpacity))); \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_CM = "\n\
+ lowp vec4 srcPixel(); \n\
+ lowp vec4 applyMask(lowp vec4); \n\
+ lowp vec4 compose(lowp vec4); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = applyMask(compose(srcPixel())); \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_MO = "\n\
+ uniform lowp float globalOpacity; \n\
+ lowp vec4 srcPixel(); \n\
+ lowp vec4 applyMask(lowp vec4); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = applyMask(srcPixel()*globalOpacity); \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_M = "\n\
+ lowp vec4 srcPixel(); \n\
+ lowp vec4 applyMask(lowp vec4); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = applyMask(srcPixel()); \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_CO = "\n\
+ uniform lowp float globalOpacity; \n\
+ lowp vec4 srcPixel(); \n\
+ lowp vec4 compose(lowp vec4); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = compose(srcPixel()*globalOpacity); \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_C = "\n\
+ lowp vec4 srcPixel(); \n\
+ lowp vec4 compose(lowp vec4); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = compose(srcPixel()); \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader_O = "\n\
+ uniform lowp float globalOpacity; \n\
+ lowp vec4 srcPixel(); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = srcPixel()*globalOpacity; \n\
+ }\n";
+
+static const char* const qglslMainFragmentShader = "\n\
+ lowp vec4 srcPixel(); \n\
+ void main() \n\
+ { \n\
+ gl_FragColor = srcPixel(); \n\
+ }\n";
+
+static const char* const qglslMaskFragmentShader = "\n\
+ varying highp vec2 textureCoords;\n\
+ uniform lowp sampler2D maskTexture;\n\
+ lowp vec4 applyMask(lowp vec4 src) \n\
+ {\n\
+ lowp vec4 mask = texture2D(maskTexture, textureCoords); \n\
+ return src * mask.a; \n\
+ }\n";
// For source over with subpixel antialiasing, the final color is calculated per component as follows
// (.a is alpha component, .c is red, green or blue component):
@@ -433,23 +469,23 @@ static const char* const qglslMaskFragmentShader = "\
// dest.c = dest.c * (1 - mask.c) + src.c * alpha
//
-static const char* const qglslRgbMaskFragmentShaderPass1 = "\
- varying highp vec2 textureCoords;\
- uniform lowp sampler2D maskTexture;\
- lowp vec4 applyMask(lowp vec4 src) \
- {\
- lowp vec4 mask = texture2D(maskTexture, textureCoords); \
- return src.a * mask; \
- }";
-
-static const char* const qglslRgbMaskFragmentShaderPass2 = "\
- varying highp vec2 textureCoords;\
- uniform lowp sampler2D maskTexture;\
- lowp vec4 applyMask(lowp vec4 src) \
- {\
- lowp vec4 mask = texture2D(maskTexture, textureCoords); \
- return src * mask; \
- }";
+static const char* const qglslRgbMaskFragmentShaderPass1 = "\n\
+ varying highp vec2 textureCoords;\n\
+ uniform lowp sampler2D maskTexture;\n\
+ lowp vec4 applyMask(lowp vec4 src) \n\
+ { \n\
+ lowp vec4 mask = texture2D(maskTexture, textureCoords); \n\
+ return src.a * mask; \n\
+ }\n";
+
+static const char* const qglslRgbMaskFragmentShaderPass2 = "\n\
+ varying highp vec2 textureCoords;\n\
+ uniform lowp sampler2D maskTexture;\n\
+ lowp vec4 applyMask(lowp vec4 src) \n\
+ { \n\
+ lowp vec4 mask = texture2D(maskTexture, textureCoords); \n\
+ return src * mask; \n\
+ }\n";
/*
Left to implement:
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index caa679b..b282676 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -168,12 +168,6 @@ void QGL2PaintEngineExPrivate::useSimpleShader()
if (matrixDirty)
updateMatrix();
-
- if (simpleShaderMatrixUniformDirty) {
- const GLuint location = shaderManager->simpleProgram()->uniformLocation("pmvMatrix");
- glUniformMatrix3fv(location, 1, GL_FALSE, (GLfloat*)pmvMatrix);
- simpleShaderMatrixUniformDirty = false;
- }
}
void QGL2PaintEngineExPrivate::updateBrushTexture()
@@ -392,9 +386,11 @@ void QGL2PaintEngineExPrivate::updateMatrix()
matrixDirty = false;
- // The actual data has been updated so both shader program's uniforms need updating
- simpleShaderMatrixUniformDirty = true;
- shaderMatrixUniformDirty = true;
+ // Set the PMV matrix attribute. As we use an attributes rather than uniforms, we only
+ // need to do this once for every matrix change and persists across all shader programs.
+ glVertexAttrib3fv(QT_PMV_MATRIX_1_ATTR, pmvMatrix[0]);
+ glVertexAttrib3fv(QT_PMV_MATRIX_2_ATTR, pmvMatrix[1]);
+ glVertexAttrib3fv(QT_PMV_MATRIX_3_ATTR, pmvMatrix[2]);
dasher.setInvScale(inverseScale);
stroker.setInvScale(inverseScale);
@@ -932,18 +928,12 @@ bool QGL2PaintEngineExPrivate::prepareForDraw(bool srcPixelsAreOpaque)
if (changed) {
// The shader program has changed so mark all uniforms as dirty:
brushUniformsDirty = true;
- shaderMatrixUniformDirty = true;
opacityUniformDirty = true;
}
if (brushUniformsDirty && mode != ImageDrawingMode && mode != ImageArrayDrawingMode)
updateBrushUniforms();
- if (shaderMatrixUniformDirty) {
- glUniformMatrix3fv(location(QGLEngineShaderManager::PmvMatrix), 1, GL_FALSE, (GLfloat*)pmvMatrix);
- shaderMatrixUniformDirty = false;
- }
-
if (opacityMode == QGLEngineShaderManager::UniformOpacity && opacityUniformDirty) {
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::GlobalOpacity), (GLfloat)q->state()->opacity);
opacityUniformDirty = false;
@@ -1955,11 +1945,8 @@ void QGL2PaintEngineEx::setState(QPainterState *new_state)
if (old_state == s || old_state->renderHintsChanged)
renderHintsChanged();
- if (old_state == s || old_state->matrixChanged) {
+ if (old_state == s || old_state->matrixChanged)
d->matrixDirty = true;
- d->simpleShaderMatrixUniformDirty = true;
- d->shaderMatrixUniformDirty = true;
- }
if (old_state == s || old_state->compositionModeChanged)
d->compositionModeDirty = true;
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index ce1b538..8fa0eff 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -252,8 +252,6 @@ public:
bool compositionModeDirty;
bool brushTextureDirty;
bool brushUniformsDirty;
- bool simpleShaderMatrixUniformDirty;
- bool shaderMatrixUniformDirty;
bool opacityUniformDirty;
bool stencilClean; // Has the stencil not been used for clipping so far?
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index cb9c921..6764e75 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -378,9 +378,6 @@ void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion &region,
return;
}
screen->flipSurface(dfbSurface, flipFlags, region, offset);
- if (noSystemBackground) {
- dfbSurface->Clear(dfbSurface, 0, 0, 0, 0);
- }
#else
setOpaque(windowOpacity != 0xff);
if (mode == Offscreen) {
diff --git a/src/s60installs/bwins/QtCoreu.def b/src/s60installs/bwins/QtCoreu.def
index fe752c8..e7e890c 100644
--- a/src/s60installs/bwins/QtCoreu.def
+++ b/src/s60installs/bwins/QtCoreu.def
@@ -4398,4 +4398,5 @@ EXPORTS
?object@WrappedEvent@QStateMachine@@QBEPAVQObject@@XZ @ 4397 NONAME ; class QObject * QStateMachine::WrappedEvent::object(void) const
?sender@SignalEvent@QStateMachine@@QBEPAVQObject@@XZ @ 4398 NONAME ; class QObject * QStateMachine::SignalEvent::sender(void) const
?signalIndex@SignalEvent@QStateMachine@@QBEHXZ @ 4399 NONAME ; int QStateMachine::SignalEvent::signalIndex(void) const
+ ?disconnectOne@QMetaObject@@SA_NPBVQObject@@H0H@Z @ 4400 NONAME ; bool QMetaObject::disconnectOne(class QObject const *, int, class QObject const *, int)
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 7a629d7..da65230 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -10694,10 +10694,10 @@ EXPORTS
?swipeAngle@QSwipeGesture@@QBEMXZ @ 10693 NONAME ; float QSwipeGesture::swipeAngle(void) const
?symbianEventFilter@QApplication@@UAE_NPBVQSymbianEvent@@@Z @ 10694 NONAME ; bool QApplication::symbianEventFilter(class QSymbianEvent const *)
?symbianFilterEvent@QInputContext@@UAE_NPAVQWidget@@PBVQSymbianEvent@@@Z @ 10695 NONAME ; bool QInputContext::symbianFilterEvent(class QWidget *, class QSymbianEvent const *)
- ?symbianHandleCommand@QApplicationPrivate@@QAEHH@Z @ 10696 NONAME ; int QApplicationPrivate::symbianHandleCommand(int)
+ ?symbianHandleCommand@QApplicationPrivate@@QAEHH@Z @ 10696 NONAME ABSENT ; int QApplicationPrivate::symbianHandleCommand(int)
?symbianProcessEvent@QApplication@@QAEHPBVQSymbianEvent@@@Z @ 10697 NONAME ; int QApplication::symbianProcessEvent(class QSymbianEvent const *)
- ?symbianProcessWsEvent@QApplicationPrivate@@QAEHPBVTWsEvent@@@Z @ 10698 NONAME ; int QApplicationPrivate::symbianProcessWsEvent(class TWsEvent const *)
- ?symbianResourceChange@QApplicationPrivate@@QAEHH@Z @ 10699 NONAME ; int QApplicationPrivate::symbianResourceChange(int)
+ ?symbianProcessWsEvent@QApplicationPrivate@@QAEHPBVTWsEvent@@@Z @ 10698 NONAME ABSENT ; int QApplicationPrivate::symbianProcessWsEvent(class TWsEvent const *)
+ ?symbianResourceChange@QApplicationPrivate@@QAEHH@Z @ 10699 NONAME ABSENT ; int QApplicationPrivate::symbianResourceChange(int)
?symbol@Parser@QCss@@QBEABUSymbol@2@XZ @ 10700 NONAME ; struct QCss::Symbol const & QCss::Parser::symbol(void) const
?sync@QPaintEngineEx@@UAEXXZ @ 10701 NONAME ; void QPaintEngineEx::sync(void)
?syncBackingStore@QWidgetPrivate@@QAEXABVQRegion@@@Z @ 10702 NONAME ; void QWidgetPrivate::syncBackingStore(class QRegion const &)
@@ -12525,4 +12525,12 @@ EXPORTS
??0Tab@QTextOption@@QAE@ABU01@@Z @ 12524 NONAME ; QTextOption::Tab::Tab(struct QTextOption::Tab const &)
?effectiveBoundingRect@QGraphicsItemPrivate@@QBE?AVQRectF@@ABV2@@Z @ 12525 NONAME ; class QRectF QGraphicsItemPrivate::effectiveBoundingRect(class QRectF const &) const
?glyphCache@QFontEngine@@QBEPAVQFontEngineGlyphCache@@PAXW4Type@2@ABVQTransform@@@Z @ 12526 NONAME ; class QFontEngineGlyphCache * QFontEngine::glyphCache(void *, enum QFontEngineGlyphCache::Type, class QTransform const &) const
+ ?qt_blurImage@@YAXAAVQImage@@M_NH@Z @ 12527 NONAME ; void qt_blurImage(class QImage &, float, bool, int)
+ ?qt_blurImage@@YAXPAVQPainter@@AAVQImage@@M_N2H@Z @ 12528 NONAME ; void qt_blurImage(class QPainter *, class QImage &, float, bool, bool, int)
+ ?qt_halfScaled@@YA?AVQImage@@ABV1@@Z @ 12529 NONAME ; class QImage qt_halfScaled(class QImage const &)
+ ?qt_memrotate90@@YAXPBIHHHPAIH@Z @ 12530 NONAME ; void qt_memrotate90(unsigned int const *, int, int, int, unsigned int *, int)
+ ?qt_memrotate90_gl@@YAXPBIHHHPAIH@Z @ 12531 NONAME ; void qt_memrotate90_gl(unsigned int const *, int, int, int, unsigned int *, int)
+ ?symbianHandleCommand@QApplicationPrivate@@QAEHPBVQSymbianEvent@@@Z @ 12532 NONAME ; int QApplicationPrivate::symbianHandleCommand(class QSymbianEvent const *)
+ ?symbianProcessWsEvent@QApplicationPrivate@@QAEHPBVQSymbianEvent@@@Z @ 12533 NONAME ; int QApplicationPrivate::symbianProcessWsEvent(class QSymbianEvent const *)
+ ?symbianResourceChange@QApplicationPrivate@@QAEHPBVQSymbianEvent@@@Z @ 12534 NONAME ; int QApplicationPrivate::symbianResourceChange(class QSymbianEvent const *)
diff --git a/src/s60installs/bwins/QtScriptu.def b/src/s60installs/bwins/QtScriptu.def
index 8b53524..19f7037 100644
--- a/src/s60installs/bwins/QtScriptu.def
+++ b/src/s60installs/bwins/QtScriptu.def
@@ -369,4 +369,5 @@ EXPORTS
?willExecuteProgram@QScriptEngineAgentPrivate@@UAEXABVDebuggerCallFrame@QTJSC@@HH@Z @ 368 NONAME ; void QScriptEngineAgentPrivate::willExecuteProgram(class QTJSC::DebuggerCallFrame const &, int, int)
?staticMetaObject@QScriptExtensionPlugin@@2UQMetaObject@@B @ 369 NONAME ; struct QMetaObject const QScriptExtensionPlugin::staticMetaObject
?staticMetaObject@QScriptEngine@@2UQMetaObject@@B @ 370 NONAME ; struct QMetaObject const QScriptEngine::staticMetaObject
+ ?isQObject@QScriptDeclarativeClass@@UBE_NXZ @ 371 NONAME ; bool QScriptDeclarativeClass::isQObject(void) const
diff --git a/src/s60installs/eabi/QtCoreu.def b/src/s60installs/eabi/QtCoreu.def
index 89fa76f..a427ff9 100644
--- a/src/s60installs/eabi/QtCoreu.def
+++ b/src/s60installs/eabi/QtCoreu.def
@@ -3633,4 +3633,5 @@ EXPORTS
_ZTIN13QStateMachine12WrappedEventE @ 3632 NONAME
_ZTVN13QStateMachine11SignalEventE @ 3633 NONAME
_ZTVN13QStateMachine12WrappedEventE @ 3634 NONAME
+ _ZN11QMetaObject13disconnectOneEPK7QObjectiS2_i @ 3635 NONAME
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index b6862e5..05f620c 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -11629,9 +11629,9 @@ EXPORTS
_ZN18QTapAndHoldGestureC1EP7QObject @ 11628 NONAME
_ZN18QTapAndHoldGestureC2EP7QObject @ 11629 NONAME
_ZN19QAbstractScrollArea18setViewportMarginsERK8QMargins @ 11630 NONAME
- _ZN19QApplicationPrivate20symbianHandleCommandEi @ 11631 NONAME
- _ZN19QApplicationPrivate21symbianProcessWsEventEPK8TWsEvent @ 11632 NONAME
- _ZN19QApplicationPrivate21symbianResourceChangeEi @ 11633 NONAME
+ _ZN19QApplicationPrivate20symbianHandleCommandEi @ 11631 NONAME ABSENT
+ _ZN19QApplicationPrivate21symbianProcessWsEventEPK8TWsEvent @ 11632 NONAME ABSENT
+ _ZN19QApplicationPrivate21symbianResourceChangeEi @ 11633 NONAME ABSENT
_ZN19QGraphicsBlurEffect12setBlurHintsE6QFlagsINS_8BlurHintEE @ 11634 NONAME
_ZN19QGraphicsBlurEffect13setBlurRadiusEf @ 11635 NONAME
_ZN19QGraphicsBlurEffect16blurHintsChangedE6QFlagsINS_8BlurHintEE @ 11636 NONAME
@@ -11784,4 +11784,12 @@ EXPORTS
_ZNK14QEglProperties8toStringEv @ 11783 NONAME ABSENT
_ZNK11QFontEngine10glyphCacheEPvN21QFontEngineGlyphCache4TypeERK10QTransform @ 11784 NONAME
_ZNK20QGraphicsItemPrivate21effectiveBoundingRectERK6QRectF @ 11785 NONAME
+ _Z12qt_blurImageP8QPainterR6QImagefbbi @ 11786 NONAME
+ _Z12qt_blurImageR6QImagefbi @ 11787 NONAME
+ _Z13qt_halfScaledRK6QImage @ 11788 NONAME
+ _Z14qt_memrotate90PKjiiiPji @ 11789 NONAME
+ _Z17qt_memrotate90_glPKjiiiPji @ 11790 NONAME
+ _ZN19QApplicationPrivate20symbianHandleCommandEPK13QSymbianEvent @ 11791 NONAME
+ _ZN19QApplicationPrivate21symbianProcessWsEventEPK13QSymbianEvent @ 11792 NONAME
+ _ZN19QApplicationPrivate21symbianResourceChangeEPK13QSymbianEvent @ 11793 NONAME
diff --git a/src/s60installs/eabi/QtScriptu.def b/src/s60installs/eabi/QtScriptu.def
index 8df03c2..8a4be2c 100644
--- a/src/s60installs/eabi/QtScriptu.def
+++ b/src/s60installs/eabi/QtScriptu.def
@@ -393,4 +393,5 @@ EXPORTS
_ZNK23QScriptDeclarativeClass7contextEv @ 392 NONAME
_ZTI23QScriptDeclarativeClass @ 393 NONAME
_ZTV23QScriptDeclarativeClass @ 394 NONAME
+ _ZNK23QScriptDeclarativeClass9isQObjectEv @ 395 NONAME
diff --git a/src/s60installs/qt.iby b/src/s60installs/qt.iby
index f24ac4b..bdd668c 100644
--- a/src/s60installs/qt.iby
+++ b/src/s60installs/qt.iby
@@ -90,27 +90,27 @@ file=ABI_DIR\BUILD_DIR\qts60plugin_5_0.dll SHARED_LIB_DIR\qts60plugin_5_0.dll
S60_APP_RESOURCE(s60main)
// imageformats stubs
-data=\epoc32\data\qt\qtlibspluginstubs\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\imageformats\qgif.qtplugin resource\qt\plugins\imageformats\qgif.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\imageformats\qico.qtplugin resource\qt\plugins\imageformats\qico.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\imageformats\qjpeg.qtplugin resource\qt\plugins\imageformats\qjpeg.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\imageformats\qmng.qtplugin resource\qt\plugins\imageformats\qmng.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\imageformats\qsvg.qtplugin resource\qt\plugins\imageformats\qsvg.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\imageformats\qtiff.qtplugin resource\qt\plugins\imageformats\qtiff.qtplugin
// codecs stubs
-data=\epoc32\data\qt\qtlibspluginstubs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin
-data=\epoc32\data\qt\qtlibspluginstubs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\codecs\qcncodecs.qtplugin resource\qt\plugins\codecs\qcncodecs.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\codecs\qjpcodecs.qtplugin resource\qt\plugins\codecs\qjpcodecs.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\codecs\qkrcodecs.qtplugin resource\qt\plugins\codecs\qkrcodecs.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\codecs\qtwcodecs.qtplugin resource\qt\plugins\codecs\qtwcodecs.qtplugin
// iconengines stubs
-data=\epoc32\data\qt\qtlibspluginstubs\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\iconengines\qsvgicon.qtplugin resource\qt\plugins\iconengines\qsvgicon.qtplugin
// Phonon MMF backend
-data=\epoc32\data\qt\qtlibspluginstubs\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin resource\qt\plugins\phonon_backend\phonon_mmf.qtplugin
// graphicssystems
-data=\epoc32\data\qt\qtlibspluginstubs\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin resource\qt\plugins\graphicssystems\qvggraphicssystem.qtplugin
// Stub sis file
data=ZSYSTEM\install\qt.sis System\Install\qt.sis
diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro
index bbc758b..55eaee1 100644
--- a/src/s60installs/s60installs.pro
+++ b/src/s60installs/s60installs.pro
@@ -112,9 +112,4 @@ symbian: {
BLD_INF_RULES.prj_exports += "qt.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(qt.iby)"
BLD_INF_RULES.prj_exports += "qtdemoapps.iby $$CORE_APP_LAYER_IBY_EXPORT_PATH(qtdemoapps.iby)"
- PLUGIN_STUBS = $$files(qmakepluginstubs/*)
- for(STUB, PLUGIN_STUBS) {
- STUB_FILENAME = $$basename(STUB)
- BLD_INF_RULES.prj_exports += "qmakepluginstubs/$${STUB_FILENAME} /epoc32/data/qt/qtlibspluginstubs/$${STUB_FILENAME}"
- }
}
diff --git a/src/tools/uic3/converter.cpp b/src/tools/uic3/converter.cpp
index 8fe2a24..2bf293d 100644
--- a/src/tools/uic3/converter.cpp
+++ b/src/tools/uic3/converter.cpp
@@ -121,7 +121,7 @@ static inline bool isKDEClass(const QString &className)
return className.at(1) .isUpper() && className.at(2).isLower();
}
-DomUI *Ui3Reader::generateUi4(const QDomElement &widget, bool implicitIncludes)
+DomUI *Ui3Reader::generateUi4(const QDomElement &widget)
{
QDomNodeList nl;
candidateCustomWidgets.clear();
@@ -474,7 +474,7 @@ DomUI *Ui3Reader::generateUi4(const QDomElement &widget, bool implicitIncludes)
// Magic header generation feature for legacy KDE forms
// (for example, filesharing/advanced/kcm_sambaconf/share.ui)
- if (implicitIncludes && isKDEClass(customClass)) {
+ if ((m_options & ImplicitIncludes) && isKDEClass(customClass)) {
QString header = customClass.toLower();
header += QLatin1String(".h");
DomHeader *domHeader = new DomHeader;
@@ -710,10 +710,13 @@ DomWidget *Ui3Reader::createWidget(const QDomElement &w, const QString &widgetCl
ui_action_list.append(a);
} else if (t == QLatin1String("property")) {
// skip the property it is already handled by createProperties
-
- QString name = e.attribute(QLatin1String("name")); // change the varname this widget
- if (name == QLatin1String("name"))
- ui_widget->setAttributeName(DomTool::readProperty(w, QLatin1String("name"), QVariant()).toString());
+ const QString name = e.attribute(QLatin1String("name")); // change the varname this widget
+ if (name == QLatin1String("name")) {
+ // Do not name QLayoutWidget if layout names are to be used.
+ const bool applyName = !(m_options & PreserveLayoutNames) || className != QLatin1String("QLayoutWidget");
+ if (applyName)
+ ui_widget->setAttributeName(DomTool::readProperty(w, QLatin1String("name"), QVariant()).toString());
+ }
} else if (t == QLatin1String("row")) {
DomRow *row = new DomRow();
row->read(e);
@@ -797,6 +800,11 @@ DomLayout *Ui3Reader::createLayout(const QDomElement &w)
createProperties(w, &ui_property_list, className);
createAttributes(w, &ui_attribute_list, className);
+ if (m_options & PreserveLayoutNames) {
+ const QString layoutName = getLayoutName(w);
+ if (!layoutName.isEmpty())
+ lay->setAttributeName(layoutName);
+ }
QDomElement e = w.firstChild().toElement();
while (!e.isNull()) {
diff --git a/src/tools/uic3/form.cpp b/src/tools/uic3/form.cpp
index ac2668b..df1314f 100644
--- a/src/tools/uic3/form.cpp
+++ b/src/tools/uic3/form.cpp
@@ -100,7 +100,7 @@ QByteArray combinePath(const char *infile, const char *outfile)
\sa createFormImpl()
*/
-void Ui3Reader::createFormDecl(const QDomElement &e, bool implicitIncludes)
+void Ui3Reader::createFormDecl(const QDomElement &e)
{
QDomElement body = e;
@@ -138,7 +138,7 @@ void Ui3Reader::createFormDecl(const QDomElement &e, bool implicitIncludes)
QString tagName = n3.tagName().toLower();
if (tagName == QLatin1String("class")) {
cl = n3.firstChild().toText().data();
- if (!nofwd)
+ if (m_options & CustomWidgetForwardDeclarations)
forwardDecl << cl;
customWidgets.insert(cl, 0);
} else if (tagName == QLatin1String("header")) {
@@ -257,10 +257,10 @@ void Ui3Reader::createFormDecl(const QDomElement &e, bool implicitIncludes)
d.option().copyrightHeader = false;
d.option().extractImages = m_extractImages;
d.option().qrcOutputFile = m_qrcOutputFile;
- d.option().implicitIncludes = implicitIncludes;
+ d.option().implicitIncludes = (m_options & ImplicitIncludes) ? 1 : 0;
if (trmacro.size())
d.option().translateFunction = trmacro;
- DomUI *ui = generateUi4(e, implicitIncludes);
+ DomUI *ui = generateUi4(e);
d.uic(fileName, ui, &out);
delete ui;
diff --git a/src/tools/uic3/main.cpp b/src/tools/uic3/main.cpp
index ecc345e..6acc94f 100644
--- a/src/tools/uic3/main.cpp
+++ b/src/tools/uic3/main.cpp
@@ -78,13 +78,11 @@ int runUic3(int argc, char * argv[])
QByteArray image_tmpfile;
const char* projectName = 0;
const char* trmacro = 0;
- bool nofwd = false;
bool fix = false;
bool deps = false;
- bool implicitIncludes = true;
+ unsigned readerOptions = Ui3Reader::ImplicitIncludes|Ui3Reader::CustomWidgetForwardDeclarations;
QByteArray pchFile;
-
QApplication app(argc, argv, false);
for (int n = 1; n < argc && error == 0; n++) {
@@ -146,9 +144,11 @@ int runUic3(int argc, char * argv[])
} else if (opt == "d") {
deps = true;
} else if (opt == "no-implicit-includes") {
- implicitIncludes = false;
+ readerOptions &= ~Ui3Reader::ImplicitIncludes;
} else if (opt == "nofwd") {
- nofwd = true;
+ readerOptions &= ~Ui3Reader::CustomWidgetForwardDeclarations;
+ } else if (opt == "layout-names") {
+ readerOptions |= Ui3Reader::PreserveLayoutNames;
} else if (opt == "nounload") {
// skip
} else if (opt == "convert") {
@@ -253,6 +253,7 @@ int runUic3(int argc, char * argv[])
"\t-extract qrcFile Create resource file and extract embedded images into \"image\" dir\n"
"\t-pch file Add #include \"file\" as the first statement in implementation\n"
"\t-nofwd Omit forward declarations of custom classes\n"
+ "\t-layout-names Preserve layout names of Qt Designer 3\n"
"\t-no-implicit-includes Do not generate #include-directives for custom classes\n"
"\t-nounload Do not unload plugins after processing\n"
"\t-tr func Use func() instead of tr() for i18n\n"
@@ -289,9 +290,8 @@ int runUic3(int argc, char * argv[])
QTextStream out(&fileOut);
- Ui3Reader ui3(out);
+ Ui3Reader ui3(out, readerOptions);
ui3.setExtractImages(extract, qrcOutputFile);
-
if (projectName && imagecollection) {
out.setEncoding(QTextStream::Latin1);
ui3.embed(projectName, images);
@@ -349,7 +349,7 @@ int runUic3(int argc, char * argv[])
return 0;
} else if (convert) {
- ui3.generateUi4(QFile::decodeName(fileName), QFile::decodeName(outputFile), doc, implicitIncludes);
+ ui3.generateUi4(QFile::decodeName(fileName), QFile::decodeName(outputFile), doc);
return 0;
}
@@ -388,8 +388,6 @@ int runUic3(int argc, char * argv[])
subcl,
QString::fromUtf8(trmacro),
QString::fromUtf8(className),
- nofwd,
- implicitIncludes,
convertedUi);
if (!protector.isEmpty()) {
diff --git a/src/tools/uic3/ui3reader.cpp b/src/tools/uic3/ui3reader.cpp
index 6c5bda3..fd50a19 100644
--- a/src/tools/uic3/ui3reader.cpp
+++ b/src/tools/uic3/ui3reader.cpp
@@ -176,7 +176,6 @@ void Ui3Reader::init()
{
outputFileName.clear();
trmacro.clear();
- nofwd = false;
fileName.clear();
writeFunctImpl = true;
@@ -241,11 +240,10 @@ QDomElement Ui3Reader::parse(const QDomDocument &doc)
return widget;
}
-Ui3Reader::Ui3Reader(QTextStream &outStream)
- : out(outStream), trout(&languageChangeBody)
+Ui3Reader::Ui3Reader(QTextStream &outStream, unsigned options) :
+ m_options(options), out(outStream), trout(&languageChangeBody),
+ m_porting(new Porting), m_extractImages(false)
{
- m_porting = new Porting();
- m_extractImages = false;
}
Ui3Reader::~Ui3Reader()
@@ -255,14 +253,13 @@ Ui3Reader::~Ui3Reader()
void Ui3Reader::generate(const QString &fn, const QString &outputFn,
QDomDocument doc, bool decl, bool subcl, const QString &trm,
- const QString& subClass, bool omitForwardDecls, bool implicitIncludes, const QString &convertedUiFile)
+ const QString& subClass, const QString &convertedUiFile)
{
init();
fileName = fn;
outputFileName = outputFn;
trmacro = trm;
- nofwd = omitForwardDecls;
QDomElement e = parse(doc);
@@ -281,21 +278,21 @@ void Ui3Reader::generate(const QString &fn, const QString &outputFn,
createSubImpl(e, subClass);
} else {
if (decl)
- createFormDecl(e, implicitIncludes);
+ createFormDecl(e);
else
createFormImpl(e);
}
}
-void Ui3Reader::generateUi4(const QString &fn, const QString &outputFn, QDomDocument doc, bool implicitIncludes)
+void Ui3Reader::generateUi4(const QString &fn, const QString &outputFn, QDomDocument doc)
{
init();
fileName = fn;
outputFileName = outputFn;
- DomUI *ui = generateUi4(parse(doc), implicitIncludes);
+ DomUI *ui = generateUi4(parse(doc));
if (!ui)
return;
@@ -317,11 +314,6 @@ void Ui3Reader::setTrMacro(const QString &trmacro)
this->trmacro = trmacro;
}
-void Ui3Reader::setForwardDeclarationsEnabled(bool b)
-{
- nofwd = !b;
-}
-
void Ui3Reader::setOutputFileName(const QString &fileName)
{
outputFileName = fileName;
diff --git a/src/tools/uic3/ui3reader.h b/src/tools/uic3/ui3reader.h
index cd17835..144ef05 100644
--- a/src/tools/uic3/ui3reader.h
+++ b/src/tools/uic3/ui3reader.h
@@ -68,23 +68,24 @@ typedef QList<QPair<int, Color> > ColorGroup;
class Ui3Reader
{
public:
- Ui3Reader(QTextStream &stream);
+ enum Options { CustomWidgetForwardDeclarations = 0x1, ImplicitIncludes = 0x2, PreserveLayoutNames = 0x4 };
+
+ explicit Ui3Reader(QTextStream &stream, unsigned options);
~Ui3Reader();
void computeDeps(const QDomElement &e, QStringList &globalIncludes, QStringList &localIncludes, bool impl = false);
- void generateUi4(const QString &fn, const QString &outputFn, QDomDocument doc, bool implicitIncludes);
+ void generateUi4(const QString &fn, const QString &outputFn, QDomDocument doc);
void generate(const QString &fn, const QString &outputFn,
QDomDocument doc, bool decl, bool subcl, const QString &trm,
- const QString& subclname, bool omitForwardDecls, bool implicitIncludes, const QString &convertedUiFile);
+ const QString& subclname, const QString &convertedUiFile);
void embed(const char *project, const QStringList &images);
void setTrMacro(const QString &trmacro);
- void setForwardDeclarationsEnabled(bool b);
void setOutputFileName(const QString &fileName);
- void createFormDecl(const QDomElement &e, bool implicitIncludes);
+ void createFormDecl(const QDomElement &e);
void createFormImpl(const QDomElement &e);
void createWrapperDecl(const QDomElement &e, const QString &convertedUiFile);
@@ -125,7 +126,7 @@ private:
void errorInvalidSlot(const QString &slot, const QString &widgetName, const QString &widgetClass,
int line, int col);
- DomUI *generateUi4(const QDomElement &e, bool implicitIncludes);
+ DomUI *generateUi4(const QDomElement &e);
DomWidget *createWidget(const QDomElement &w, const QString &widgetClass = QString());
void createProperties(const QDomElement &e, QList<DomProperty*> *properties, const QString &className);
void createAttributes(const QDomElement &e, QList<DomProperty*> *properties, const QString &className);
@@ -145,6 +146,8 @@ private:
void fixLayoutMargin(DomLayout *ui_layout);
+ const unsigned m_options;
+
QTextStream &out;
QTextOStream trout;
QString languageChangeBody;
@@ -157,7 +160,6 @@ private:
QString formName;
QString lastItem;
QString trmacro;
- bool nofwd;
struct Buddy
{
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 657c79a..cae959b 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -2596,11 +2596,15 @@ QDomNode QDomNode::removeChild(const QDomNode& oldChild)
already has an element node as a child, \a newChild is not added as
a child and a null node is returned.
- Calling this function on a null node(created, for example, with the
- default constructor) does nothing.
+ Returns a new reference to \a newChild on success or a \link
+ isNull() null node\endlink on failure.
- The DOM specification disallow inserting attribute nodes, but due
- to historical reasons QDom accept them nevertheless.
+ Calling this function on a null node(created, for example, with
+ the default constructor) does nothing and returns a \link isNull()
+ null node\endlink.
+
+ The DOM specification disallow inserting attribute nodes, but for
+ historical reasons, QDom accepts them anyway.
\sa insertBefore() insertAfter() replaceChild() removeChild()
*/