summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2010-09-07 17:38:12 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2010-09-07 17:38:12 (GMT)
commit332c194a66ef37179c3267c2f4acd1f6b6feb7f3 (patch)
tree3b363d2f173acf903ce0b7ee77a18bc103ffb5e3 /src/gui
parent415ad7b69d364c41156d35b98790b02667a6671b (diff)
parent77fb7ffa69fe0183e8547fca69fc976364d05408 (diff)
downloadQt-332c194a66ef37179c3267c2f4acd1f6b6feb7f3.zip
Qt-332c194a66ef37179c3267c2f4acd1f6b6feb7f3.tar.gz
Qt-332c194a66ef37179c3267c2f4acd1f6b6feb7f3.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/image/qpixmap_s60.cpp12
-rw-r--r--src/gui/image/qpixmap_s60_p.h6
-rw-r--r--src/gui/kernel/qapplication.cpp6
-rw-r--r--src/gui/kernel/qapplication_x11.cpp7
-rw-r--r--src/gui/kernel/qgesturemanager.cpp3
-rw-r--r--src/gui/kernel/qgesturemanager_p.h4
6 files changed, 27 insertions, 11 deletions
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index dbdf0bc..47249d9 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -66,9 +66,10 @@ const uchar qt_pixmap_bit_mask[] = { 0x01, 0x02, 0x04, 0x08,
static bool cleanup_function_registered = false;
static QS60PixmapData *firstPixmap = 0;
-static void qt_symbian_register_pixmap(QS60PixmapData *pd)
+// static
+void QS60PixmapData::qt_symbian_register_pixmap(QS60PixmapData *pd)
{
- if(!cleanup_function_registered) {
+ if (!cleanup_function_registered) {
qAddPostRoutine(qt_symbian_release_pixmaps);
cleanup_function_registered = true;
}
@@ -80,7 +81,8 @@ static void qt_symbian_register_pixmap(QS60PixmapData *pd)
firstPixmap = pd;
}
-static void qt_symbian_unregister_pixmap(QS60PixmapData *pd)
+// static
+void QS60PixmapData::qt_symbian_unregister_pixmap(QS60PixmapData *pd)
{
if (pd->next)
pd->next->prev = pd->prev;
@@ -90,7 +92,8 @@ static void qt_symbian_unregister_pixmap(QS60PixmapData *pd)
firstPixmap = pd->next;
}
-static void qt_symbian_release_pixmaps()
+// static
+void QS60PixmapData::qt_symbian_release_pixmaps()
{
// Scan all QS60PixmapData objects in the system and destroy them.
QS60PixmapData *pd = firstPixmap;
@@ -828,7 +831,6 @@ void* QS60PixmapData::toNativeType(NativeType type)
bool convertToArgb32 = false;
bool needsCopy = false;
- QSysInfo::SymbianVersion symbianVersion = QSysInfo::symbianVersion();
if (!(S60->supportsPremultipliedAlpha)) {
// Convert argb32_premultiplied to argb32 since Symbian 9.2 does
// not support premultipied format.
diff --git a/src/gui/image/qpixmap_s60_p.h b/src/gui/image/qpixmap_s60_p.h
index a82f5c2..12885ec 100644
--- a/src/gui/image/qpixmap_s60_p.h
+++ b/src/gui/image/qpixmap_s60_p.h
@@ -128,9 +128,9 @@ private:
QS60PixmapData *next;
QS60PixmapData *prev;
- friend void qt_symbian_register_pixmap(QS60PixmapData *pd);
- friend void qt_symbian_unregister_pixmap(QS60PixmapData *pd);
- friend void qt_symbian_release_pixmaps();
+ static void qt_symbian_register_pixmap(QS60PixmapData *pd);
+ static void qt_symbian_unregister_pixmap(QS60PixmapData *pd);
+ static void qt_symbian_release_pixmaps();
friend class QPixmap;
friend class QS60WindowSurface;
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 3d3a749..82dd83a 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -809,6 +809,12 @@ void QApplicationPrivate::construct(
if (testLib.load()) {
typedef void (*TasInitialize)(void);
TasInitialize initFunction = (TasInitialize)testLib.resolve("qt_testability_init");
+#ifdef Q_OS_SYMBIAN
+ // resolving method by name does not work on Symbian OS so need to use ordinal
+ if(!initFunction) {
+ initFunction = (TasInitialize)testLib.resolve("1");
+ }
+#endif
if (initFunction) {
initFunction();
} else {
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index e4d9848..7495f6d 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -3642,6 +3642,11 @@ int QApplication::x11ProcessEvent(XEvent* event)
case MapNotify: // window shown
if (widget->isWindow()) {
+ // if we got a MapNotify when we were not waiting for it, it most
+ // likely means the user has already asked to hide the window before
+ // it ever being shown, so we try to withdraw a window after sending
+ // the QShowEvent.
+ bool pendingHide = widget->testAttribute(Qt::WA_WState_ExplicitShowHide) && widget->testAttribute(Qt::WA_WState_Hidden);
widget->d_func()->topData()->waitingForMapNotify = 0;
if (widget->windowType() != Qt::Popup) {
@@ -3661,6 +3666,8 @@ int QApplication::x11ProcessEvent(XEvent* event)
widget->setAttribute(Qt::WA_WState_Visible, true);
}
}
+ if (pendingHide) // hide the window
+ XWithdrawWindow(X11->display, widget->internalWinId(), widget->x11Info().screen());
}
break;
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index cb4061e..5c80340 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -162,7 +162,7 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ
QMap<ObjectGesture, QList<QGesture *> >::Iterator iter = m_objectGestures.begin();
while (iter != m_objectGestures.end()) {
ObjectGesture objectGesture = iter.key();
- if (objectGesture.gesture == type && target == objectGesture.object.data()) {
+ if (objectGesture.gesture == type && target == objectGesture.object) {
QSet<QGesture *> gestures = iter.value().toSet();
for (QHash<QGestureRecognizer *, QSet<QGesture *> >::iterator
it = m_obsoleteGestures.begin(), e = m_obsoleteGestures.end(); it != e; ++it) {
@@ -172,6 +172,7 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ
m_deletedRecognizers.remove(g);
m_gestureToRecognizer.remove(g);
}
+
qDeleteAll(gestures);
iter = m_objectGestures.erase(iter);
} else {
diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h
index 747cb1a..0d84b67 100644
--- a/src/gui/kernel/qgesturemanager_p.h
+++ b/src/gui/kernel/qgesturemanager_p.h
@@ -106,13 +106,13 @@ private:
struct ObjectGesture
{
- QWeakPointer<QObject> object;
+ QObject* object;
Qt::GestureType gesture;
ObjectGesture(QObject *o, const Qt::GestureType &g) : object(o), gesture(g) { }
inline bool operator<(const ObjectGesture &rhs) const
{
- if (object.data() < rhs.object.data())
+ if (object < rhs.object)
return true;
if (object == rhs.object)
return gesture < rhs.gesture;