summaryrefslogtreecommitdiff
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2010-12-07 14:57:38 +0100
committerDavid Boddie <david.boddie@nokia.com>2010-12-07 14:57:38 +0100
commitd8fb8ca3a378743eebb8464f7910a5e6d1870c01 (patch)
tree9c31a017163a532946f10107b8d9f4405ed1c9db /src/gui/kernel
parentb5915ef3a6d0417440ad82e9369d6679505b953e (diff)
parent076bba6c901e292b61fffb7a91020075dcd84919 (diff)
downloadqt4-tools-d8fb8ca3a378743eebb8464f7910a5e6d1870c01.tar.gz
Merge branch 'qdoc-simplified' into mimir-simplified
Conflicts: doc/src/platforms/compiler-notes.qdoc tools/qdoc3/ditaxmlgenerator.cpp tools/qdoc3/ditaxmlgenerator.h tools/qdoc3/htmlgenerator.cpp tools/qdoc3/htmlgenerator.h tools/qdoc3/node.cpp tools/qdoc3/pagegenerator.h
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qapplication.cpp21
-rw-r--r--src/gui/kernel/qapplication_p.h3
-rw-r--r--src/gui/kernel/qapplication_s60.cpp13
-rw-r--r--src/gui/kernel/qapplication_win.cpp4
-rw-r--r--src/gui/kernel/qapplication_x11.cpp26
-rw-r--r--src/gui/kernel/qclipboard_mac.cpp2
-rw-r--r--src/gui/kernel/qclipboard_s60.cpp84
-rw-r--r--src/gui/kernel/qclipboard_win.cpp2
-rw-r--r--src/gui/kernel/qclipboard_x11.cpp4
-rw-r--r--src/gui/kernel/qcocoamenuloader_mac.mm2
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm4
-rw-r--r--src/gui/kernel/qevent.cpp2
-rw-r--r--src/gui/kernel/qeventdispatcher_s60.cpp66
-rw-r--r--src/gui/kernel/qeventdispatcher_s60_p.h24
-rw-r--r--src/gui/kernel/qgesture.cpp27
-rw-r--r--src/gui/kernel/qgesturemanager.cpp16
-rw-r--r--src/gui/kernel/qgesturemanager_p.h3
-rw-r--r--src/gui/kernel/qguiplatformplugin.cpp2
-rw-r--r--src/gui/kernel/qkeymapper_mac.cpp4
-rw-r--r--src/gui/kernel/qkeysequence.cpp2
-rw-r--r--src/gui/kernel/qmotifdnd_x11.cpp5
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp2
-rw-r--r--src/gui/kernel/qsound_s60.cpp2
-rw-r--r--src/gui/kernel/qstandardgestures.cpp25
-rw-r--r--src/gui/kernel/qt_x11_p.h1
-rw-r--r--src/gui/kernel/qwidget.cpp87
-rw-r--r--src/gui/kernel/qwidget_mac.mm50
-rw-r--r--src/gui/kernel/qwidget_p.h2
-rw-r--r--src/gui/kernel/qwidget_qws.cpp24
-rw-r--r--src/gui/kernel/qwidget_s60.cpp21
-rw-r--r--src/gui/kernel/qx11embed_x11.cpp2
31 files changed, 445 insertions, 87 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp
index 3323fbc27e..a4ae46b2ac 100644
--- a/src/gui/kernel/qapplication.cpp
+++ b/src/gui/kernel/qapplication.cpp
@@ -497,7 +497,7 @@ bool QApplicationPrivate::fade_tooltip = false;
bool QApplicationPrivate::animate_toolbox = false;
bool QApplicationPrivate::widgetCount = false;
bool QApplicationPrivate::load_testability = false;
-QString QApplicationPrivate::qmljsDebugArguments;
+QString QApplicationPrivate::qmljs_debug_arguments;
#ifdef QT_KEYPAD_NAVIGATION
# ifdef Q_OS_SYMBIAN
Qt::NavigationMode QApplicationPrivate::navigationMode = Qt::NavigationModeKeypadDirectional;
@@ -570,7 +570,7 @@ void QApplicationPrivate::process_cmdline()
if (arg == "-qdevel" || arg == "-qdebug") {
// obsolete argument
} else if (arg.indexOf("-qmljsdebugger=", 0) != -1) {
- qmljsDebugArguments = QString::fromLocal8Bit(arg.right(arg.length() - 15));
+ qmljs_debug_arguments = QString::fromLocal8Bit(arg.right(arg.length() - 15));
} else if (arg.indexOf("-style=", 0) != -1) {
s = QString::fromLocal8Bit(arg.right(arg.length() - 7).toLower());
} else if (arg == "-style" && i < argc-1) {
@@ -1430,10 +1430,18 @@ QStyle *QApplication::style()
// Compile-time search for default style
//
QString style;
- if (!QApplicationPrivate::styleOverride.isEmpty())
+#ifdef QT_BUILD_INTERNAL
+ QString envStyle = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE"));
+#else
+ QString envStyle;
+#endif
+ if (!QApplicationPrivate::styleOverride.isEmpty()) {
style = QApplicationPrivate::styleOverride;
- else
+ } else if (!envStyle.isEmpty()) {
+ style = envStyle;
+ } else {
style = QApplicationPrivate::desktopStyleKey();
+ }
QStyle *&app_style = QApplicationPrivate::app_style;
app_style = QStyleFactory::create(style);
@@ -6086,6 +6094,11 @@ QPixmap QApplicationPrivate::getPixmapCursor(Qt::CursorShape cshape)
return QPixmap();
}
+QString QApplicationPrivate::qmljsDebugArgumentsString()
+{
+ return qmljs_debug_arguments;
+}
+
QT_END_NAMESPACE
#include "moc_qapplication.cpp"
diff --git a/src/gui/kernel/qapplication_p.h b/src/gui/kernel/qapplication_p.h
index 9c5095d390..a0e14528a7 100644
--- a/src/gui/kernel/qapplication_p.h
+++ b/src/gui/kernel/qapplication_p.h
@@ -446,7 +446,8 @@ public:
static bool animate_toolbox;
static bool widgetCount; // Coupled with -widgetcount switch
static bool load_testability; // Coupled with -testability switch
- static QString qmljsDebugArguments; // a string containing arguments for js/qml debugging.
+ static QString qmljs_debug_arguments; // a string containing arguments for js/qml debugging.
+ static QString qmljsDebugArgumentsString(); // access string from other libraries
#ifdef Q_WS_MAC
static bool native_modal_dialog_active;
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 5ff2fd4a80..85965633ce 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1425,7 +1425,7 @@ void qt_init(QApplicationPrivate * /* priv */, int)
TInt err = CApaCommandLine::GetCommandLineFromProcessEnvironment(commandLine);
// After this construction, CEikonEnv will be available from CEikonEnv::Static().
// (much like our qApp).
- CEikonEnv* coe = new CEikonEnv;
+ QtEikonEnv* coe = new QtEikonEnv;
//not using QT_TRAP_THROWING, because coe owns the cleanupstack so it can't be pushed there.
if(err == KErrNone)
TRAP(err, coe->ConstructAppFromCommandLineL(factory,*commandLine));
@@ -2055,6 +2055,17 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent
}
#endif
break;
+#ifdef Q_SYMBIAN_SUPPORTS_SURFACES
+ case EEventUser:
+ {
+ // GOOM is looking for candidates to kill so indicate that we are
+ // capable of cleaning up by handling this event
+ TInt32 *data = reinterpret_cast<TInt32 *>(event->EventData());
+ if (data[0] == EApaSystemEventShutdown && data[1] == KGoomMemoryLowEvent)
+ return 1;
+ }
+ break;
+#endif
default:
break;
}
diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp
index 78028eb1f4..10c4ed6f1b 100644
--- a/src/gui/kernel/qapplication_win.cpp
+++ b/src/gui/kernel/qapplication_win.cpp
@@ -3269,7 +3269,7 @@ bool QETWidget::translateMouseEvent(const MSG &msg)
if (type == QEvent::MouseButtonPress
&& QApplication::activePopupWidget() != activePopupWidget
&& replayPopupMouseEvent) {
- // the popup dissappeared. Replay the event
+ // the popup disappeared. Replay the event
QWidget* w = QApplication::widgetAt(gpos.x, gpos.y);
if (w && !QApplicationPrivate::isBlockedByModal(w)) {
Q_ASSERT(w->testAttribute(Qt::WA_WState_Created));
@@ -3506,7 +3506,7 @@ static void tabletInit(const quint64 uniqueId, const UINT csr_type, HCTX hTab)
}
#endif // QT_NO_TABLETEVENT
-// Update the "dynamic" informations of a cursor device (pen, airbrush, etc).
+// Update the "dynamic" information of a cursor device (pen, airbrush, etc).
// The dynamic information is the information of QTabletDeviceData that can change
// in time (eraser or pen if a device is turned around).
#ifndef QT_NO_TABLETEVENT
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index d8fb74cae9..7c68170f57 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -2334,6 +2334,30 @@ void qt_init(QApplicationPrivate *priv, int,
X11->desktopEnvironment = DE_4DWM;
break;
}
+
+ if (XGetWindowProperty(X11->display, QX11Info::appRootWindow(),
+ ATOM(_NET_SUPPORTING_WM_CHECK),
+ 0, 1024, False, XA_WINDOW, &type,
+ &format, &length, &after, &data) == Success) {
+ if (type == XA_WINDOW && format == 32) {
+ Window windowManagerWindow = *((Window*) data);
+ XFree(data);
+ data = 0;
+
+ if (windowManagerWindow != XNone) {
+ Atom utf8atom = ATOM(UTF8_STRING);
+ if (XGetWindowProperty(QX11Info::display(), windowManagerWindow, ATOM(_NET_WM_NAME),
+ 0, 1024, False, utf8atom, &type,
+ &format, &length, &after, &data) == Success) {
+ if (type == utf8atom && format == 8) {
+ if (qstrcmp((const char *)data, "MCompositor") == 0)
+ X11->desktopEnvironment = DE_MEEGO_COMPOSITOR;
+ }
+ }
+ }
+ }
+ }
+
} while(0);
if (data)
@@ -3742,7 +3766,7 @@ int QApplication::x11ProcessEvent(XEvent* event)
// toplevel reparented...
QWidget *newparent = QWidget::find(event->xreparent.parent);
if (! newparent || (newparent->windowType() == Qt::Desktop)) {
- // we dont' know about the new parent (or we've been
+ // we don't know about the new parent (or we've been
// reparented to root), perhaps a window manager
// has been (re)started? reset the focus model to unknown
X11->focus_model = QX11Data::FM_Unknown;
diff --git a/src/gui/kernel/qclipboard_mac.cpp b/src/gui/kernel/qclipboard_mac.cpp
index 49a6cc81d7..482a3a3be4 100644
--- a/src/gui/kernel/qclipboard_mac.cpp
+++ b/src/gui/kernel/qclipboard_mac.cpp
@@ -623,7 +623,7 @@ QMacPasteboard::sync() const
#ifdef DEBUG_PASTEBOARD
if(fromGlobal)
- qDebug("Pasteboard: Syncronize!");
+ qDebug("Pasteboard: Synchronize!");
#endif
return fromGlobal;
}
diff --git a/src/gui/kernel/qclipboard_s60.cpp b/src/gui/kernel/qclipboard_s60.cpp
index f07e06652f..73280b264e 100644
--- a/src/gui/kernel/qclipboard_s60.cpp
+++ b/src/gui/kernel/qclipboard_s60.cpp
@@ -50,16 +50,18 @@
#include "qwidget.h"
#include "qevent.h"
#include "private/qcore_symbian_p.h"
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include "txtclipboard.h"
+#endif
+#include "txtetext.h"
#include <QtDebug>
// Symbian's clipboard
#include <baclipb.h>
QT_BEGIN_NAMESPACE
-//### Mime Type mapping to UIDs
-
const TUid KQtCbDataStream = {0x2001B2DD};
-
+const TInt KPlainTextBegin = 0;
class QClipboardData
{
@@ -141,7 +143,6 @@ void writeToStreamLX(const QMimeData* aData, RWriteStream& aStream)
{
HBufC* stringData = TPtrC(reinterpret_cast<const TUint16*>((*iter).utf16())).AllocLC();
QByteArray ba = aData->data((*iter));
- qDebug() << "copy to clipboard mime: " << *iter << " data: " << ba;
// mime type
aStream << TCardinality(stringData->Size());
aStream << *(stringData);
@@ -152,6 +153,43 @@ void writeToStreamLX(const QMimeData* aData, RWriteStream& aStream)
}
}
+void writeToSymbianStoreLX(const QMimeData* aData, CClipboard* clipboard)
+{
+ // This function both leaves and throws exceptions. There must be no destructor
+ // dependencies between cleanup styles, and no cleanup stack dependencies on stacked objects.
+ if (aData->hasText()) {
+ CPlainText* text = CPlainText::NewL();
+ CleanupStack::PushL(text);
+
+ TPtrC textPtr(qt_QString2TPtrC(aData->text()));
+ text->InsertL(KPlainTextBegin, textPtr);
+ text->CopyToStoreL(clipboard->Store(), clipboard->StreamDictionary(),
+ KPlainTextBegin, textPtr.Length());
+ CleanupStack::PopAndDestroy(text);
+ }
+}
+
+void readSymbianStoreLX(QMimeData* aData, CClipboard* clipboard)
+{
+ // This function both leaves and throws exceptions. There must be no destructor
+ // dependencies between cleanup styles, and no cleanup stack dependencies on stacked objects.
+ CPlainText* text = CPlainText::NewL();
+ CleanupStack::PushL(text);
+ TInt dataLength = text->PasteFromStoreL(clipboard->Store(), clipboard->StreamDictionary(),
+ KPlainTextBegin);
+ if (dataLength == 0) {
+ User::Leave(KErrNotFound);
+ }
+ HBufC* hBuf = HBufC::NewL(dataLength);
+ TPtr buf = hBuf->Des();
+ text->Extract(buf, KPlainTextBegin, dataLength);
+
+ QString string = qt_TDesC2QString(buf);
+ CleanupStack::PopAndDestroy(text);
+
+ aData->setText(string);
+}
+
void readFromStreamLX(QMimeData* aData,RReadStream& aStream)
{
// This function both leaves and throws exceptions. There must be no destructor
@@ -174,7 +212,6 @@ void readFromStreamLX(QMimeData* aData,RReadStream& aStream)
ba.reserve(dataSize);
aStream.ReadL(reinterpret_cast<uchar*>(ba.data_ptr()->data),dataSize);
ba.data_ptr()->size = dataSize;
- qDebug() << "paste from clipboard mime: " << mimeType << " data: " << ba;
aData->setData(mimeType,ba);
}
}
@@ -192,23 +229,42 @@ const QMimeData* QClipboard::mimeData(Mode mode) const
{
if (mode != Clipboard) return 0;
QClipboardData *d = clipboardData();
+ bool dataExists(false);
if (d)
{
TRAPD(err,{
RFs fs = qt_s60GetRFs();
CClipboard* cb = CClipboard::NewForReadingLC(fs);
Q_ASSERT(cb);
+ //stream for qt
RStoreReadStream stream;
TStreamId stid = (cb->StreamDictionary()).At(KQtCbDataStream);
- stream.OpenLC(cb->Store(),stid);
- QT_TRYCATCH_LEAVING(readFromStreamLX(d->source(),stream));
- CleanupStack::PopAndDestroy(2,cb);
- return d->source();
+ if (stid != 0) {
+ stream.OpenLC(cb->Store(),stid);
+ QT_TRYCATCH_LEAVING(readFromStreamLX(d->source(),stream));
+ CleanupStack::PopAndDestroy(&stream);
+ dataExists = true;
+ }
+ else {
+ //symbian clipboard
+ RStoreReadStream symbianStream;
+ TStreamId symbianStId = (cb->StreamDictionary()).At(KClipboardUidTypePlainText);
+ if (symbianStId != 0) {
+ symbianStream.OpenLC(cb->Store(), symbianStId);
+ QT_TRYCATCH_LEAVING(readSymbianStoreLX(d->source(), cb));
+ CleanupStack::PopAndDestroy(&symbianStream);
+ dataExists = true;
+ }
+ }
+ CleanupStack::PopAndDestroy(cb);
});
if (err != KErrNone){
qDebug()<< "clipboard is empty/err: " << err;
}
+ if (dataExists) {
+ return d->source();
+ }
}
return 0;
}
@@ -223,6 +279,7 @@ void QClipboard::setMimeData(QMimeData* src, Mode mode)
TRAPD(err,{
RFs fs = qt_s60GetRFs();
CClipboard* cb = CClipboard::NewForWritingLC(fs);
+ //stream for qt
RStoreWriteStream stream;
TStreamId stid = stream.CreateLC(cb->Store());
QT_TRYCATCH_LEAVING(writeToStreamLX(src,stream));
@@ -230,7 +287,14 @@ void QClipboard::setMimeData(QMimeData* src, Mode mode)
stream.CommitL();
(cb->StreamDictionary()).AssignL(KQtCbDataStream,stid);
cb->CommitL();
- CleanupStack::PopAndDestroy(2,cb);
+
+ //stream for symbian
+ RStoreWriteStream symbianStream;
+ TStreamId symbianStId = symbianStream.CreateLC(cb->Store());
+ QT_TRYCATCH_LEAVING(writeToSymbianStoreLX(src, cb));
+ (cb->StreamDictionary()).AssignL(KClipboardUidTypePlainText, symbianStId);
+ cb->CommitL();
+ CleanupStack::PopAndDestroy(3,cb);
});
if (err != KErrNone){
qDebug()<< "clipboard write err :" << err;
diff --git a/src/gui/kernel/qclipboard_win.cpp b/src/gui/kernel/qclipboard_win.cpp
index 63ca9e59cf..c2e29fdb25 100644
--- a/src/gui/kernel/qclipboard_win.cpp
+++ b/src/gui/kernel/qclipboard_win.cpp
@@ -141,7 +141,7 @@ public:
clipBoardViewer = new QWidget();
clipBoardViewer->createWinId();
clipBoardViewer->setObjectName(QLatin1String("internal clipboard owner"));
- // We dont need this internal widget to appear in QApplication::topLevelWidgets()
+ // We don't need this internal widget to appear in QApplication::topLevelWidgets()
if (QWidgetPrivate::allWidgets)
QWidgetPrivate::allWidgets->remove(clipBoardViewer);
}
diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp
index 55548efd27..62c861d916 100644
--- a/src/gui/kernel/qclipboard_x11.cpp
+++ b/src/gui/kernel/qclipboard_x11.cpp
@@ -132,7 +132,7 @@ void setupOwner()
requestor = new QWidget(0);
requestor->createWinId();
requestor->setObjectName(QLatin1String("internal clipboard requestor"));
- // We dont need this internal widgets to appear in QApplication::topLevelWidgets()
+ // We don't need this internal widgets to appear in QApplication::topLevelWidgets()
if (QWidgetPrivate::allWidgets) {
QWidgetPrivate::allWidgets->remove(owner);
QWidgetPrivate::allWidgets->remove(requestor);
@@ -769,7 +769,7 @@ QByteArray QX11Data::clipboardReadIncrementalProperty(Window win, Atom property,
delete requestor;
requestor = new QWidget(0);
requestor->setObjectName(QLatin1String("internal clipboard requestor"));
- // We dont need this internal widget to appear in QApplication::topLevelWidgets()
+ // We don't need this internal widget to appear in QApplication::topLevelWidgets()
if (QWidgetPrivate::allWidgets)
QWidgetPrivate::allWidgets->remove(requestor);
diff --git a/src/gui/kernel/qcocoamenuloader_mac.mm b/src/gui/kernel/qcocoamenuloader_mac.mm
index 8d38f4511d..4bf6ed9832 100644
--- a/src/gui/kernel/qcocoamenuloader_mac.mm
+++ b/src/gui/kernel/qcocoamenuloader_mac.mm
@@ -89,7 +89,7 @@ QT_USE_NAMESPACE
- (void)ensureAppMenuInMenu:(NSMenu *)menu
{
// The application menu is the menu in the menu bar that contains the
- // 'Quit' item. When changing menu bar (e.g when swithing between
+ // 'Quit' item. When changing menu bar (e.g when switching between
// windows with different menu bars), we never recreate this menu, but
// instead pull it out the current menu bar and place into the new one:
NSMenu *mainMenu = [NSApp mainMenu];
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index a552ce7f6f..f759fe0cc0 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -939,10 +939,6 @@ static int qCocoaViewCount = 0;
}
}
#endif //QT_NO_WHEELEVENT
-
- if (!wheelOK) {
- return [super scrollWheel:theEvent];
- }
}
- (void)tabletProximity:(NSEvent *)tabletEvent
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index eade02e7a3..7fdb92680d 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -1970,7 +1970,7 @@ void QInputMethodEvent::setCommitString(const QString &commitString, int replace
is usually given by a wheel on 4D mouse. If the device does not support a
Z-axis, pass zero here.
- The \a tangentialPressure paramater contins the tangential pressure of an air
+ The \a tangentialPressure parameter contins the tangential pressure of an air
brush. If the device does not support tangential pressure, pass 0 here.
\a rotation contains the device's rotation in degrees. 4D mice support
diff --git a/src/gui/kernel/qeventdispatcher_s60.cpp b/src/gui/kernel/qeventdispatcher_s60.cpp
index bc787b81fb..77ebd0de42 100644
--- a/src/gui/kernel/qeventdispatcher_s60.cpp
+++ b/src/gui/kernel/qeventdispatcher_s60.cpp
@@ -45,6 +45,62 @@
QT_BEGIN_NAMESPACE
+QtEikonEnv::QtEikonEnv()
+ : m_lastIterationCount(0)
+ , m_savedStatusCode(KRequestPending)
+ , m_hasAlreadyRun(false)
+{
+}
+
+QtEikonEnv::~QtEikonEnv()
+{
+}
+
+void QtEikonEnv::RunL()
+{
+ QEventDispatcherS60 *dispatcher = qobject_cast<QEventDispatcherS60 *>(QAbstractEventDispatcher::instance());
+ if (!dispatcher) {
+ CEikonEnv::RunL();
+ return;
+ }
+
+ if (m_lastIterationCount != dispatcher->iterationCount()) {
+ m_hasAlreadyRun = false;
+ m_lastIterationCount = dispatcher->iterationCount();
+ }
+
+ if (m_hasAlreadyRun) {
+ // Fool the active scheduler into believing we are still waiting for events.
+ // The window server thinks we are not, however.
+ m_savedStatusCode = iStatus.Int();
+ iStatus = KRequestPending;
+ SetActive();
+ dispatcher->queueDeferredActiveObjectsCompletion();
+ } else {
+ m_hasAlreadyRun = true;
+ CEikonEnv::RunL();
+ }
+}
+
+void QtEikonEnv::DoCancel()
+{
+ complete();
+
+ CEikonEnv::DoCancel();
+}
+
+void QtEikonEnv::complete()
+{
+ if (m_hasAlreadyRun) {
+ if (m_savedStatusCode != KRequestPending) {
+ TRequestStatus *status = &iStatus;
+ QEventDispatcherSymbian::RequestComplete(status, m_savedStatusCode);
+ m_savedStatusCode = KRequestPending;
+ }
+ m_hasAlreadyRun = false;
+ }
+}
+
QEventDispatcherS60::QEventDispatcherS60(QObject *parent)
: QEventDispatcherSymbian(parent),
m_noInputEvents(false)
@@ -127,4 +183,14 @@ void QEventDispatcherS60::removeInputEventsForWidget(QObject *object)
}
}
+// reimpl
+void QEventDispatcherS60::reactivateDeferredActiveObjects()
+{
+ if (S60->qtOwnsS60Environment) {
+ static_cast<QtEikonEnv *>(CCoeEnv::Static())->complete();
+ }
+
+ QEventDispatcherSymbian::reactivateDeferredActiveObjects();
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qeventdispatcher_s60_p.h b/src/gui/kernel/qeventdispatcher_s60_p.h
index d2f327c4fc..c14fef0643 100644
--- a/src/gui/kernel/qeventdispatcher_s60_p.h
+++ b/src/gui/kernel/qeventdispatcher_s60_p.h
@@ -56,8 +56,30 @@
#include <private/qeventdispatcher_symbian_p.h>
#include "qt_s60_p.h"
+#include <eikenv.h>
+
QT_BEGIN_NAMESPACE
+class QEventDispatcherS60;
+
+class QtEikonEnv : public CEikonEnv
+{
+public:
+ QtEikonEnv();
+ ~QtEikonEnv();
+
+ // from CActive.
+ void RunL();
+ void DoCancel();
+
+ void complete();
+
+private:
+ int m_lastIterationCount;
+ TInt m_savedStatusCode;
+ bool m_hasAlreadyRun;
+};
+
class Q_GUI_EXPORT QEventDispatcherS60 : public QEventDispatcherSymbian
{
Q_OBJECT
@@ -73,6 +95,8 @@ public:
void saveInputEvent(QSymbianControl *control, QWidget *widget, QInputEvent *event);
+ void reactivateDeferredActiveObjects();
+
private:
bool sendDeferredInputEvents();
diff --git a/src/gui/kernel/qgesture.cpp b/src/gui/kernel/qgesture.cpp
index 5725a228a0..e3339c4d83 100644
--- a/src/gui/kernel/qgesture.cpp
+++ b/src/gui/kernel/qgesture.cpp
@@ -260,6 +260,27 @@ QGesture::GestureCancelPolicy QGesture::gestureCancelPolicy() const
/*!
\property QPanGesture::acceleration
+ \brief the acceleration in the motion of the touch point for this gesture
+*/
+
+/*!
+ \property QPanGesture::horizontalVelocity
+ \brief the horizontal component of the motion of the touch point for this
+ gesture
+ \since 4.7.1
+ \internal
+
+ \sa verticalVelocity, acceleration
+*/
+
+/*!
+ \property QPanGesture::verticalVelocity
+ \brief the vertical component of the motion of the touch point for this
+ gesture
+ \since 4.7.1
+ \internal
+
+ \sa horizontalVelocity, acceleration
*/
/*!
@@ -633,6 +654,12 @@ void QPinchGesture::setRotationAngle(qreal value)
*/
/*!
+ \property QSwipeGesture::velocity
+ \since 4.7.1
+ \internal
+*/
+
+/*!
\internal
*/
QSwipeGesture::QSwipeGesture(QObject *parent)
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index 6dd8127690..46450b197f 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -171,9 +171,13 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ
foreach (QGesture *g, gestures) {
m_deletedRecognizers.remove(g);
m_gestureToRecognizer.remove(g);
+ m_maybeGestures.remove(g);
+ m_activeGestures.remove(g);
+ m_gestureOwners.remove(g);
+ m_gestureTargets.remove(g);
+ m_gesturesToDelete.insert(g);
}
- qDeleteAll(gestures);
iter = m_objectGestures.erase(iter);
} else {
++iter;
@@ -185,7 +189,7 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ
QGesture *QGestureManager::getState(QObject *object, QGestureRecognizer *recognizer, Qt::GestureType type)
{
// if the widget is being deleted we should be careful not to
- // create a new state, as it will create QWeakPointer which doesnt work
+ // create a new state, as it will create QWeakPointer which doesn't work
// from the destructor.
if (object->isWidgetType()) {
if (static_cast<QWidget *>(object)->d_func()->data.in_destructor)
@@ -381,6 +385,11 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *,
recycle(gesture);
m_gestureTargets.remove(gesture);
}
+
+ //Clean up the Gestures
+ qDeleteAll(m_gesturesToDelete);
+ m_gesturesToDelete.clear();
+
return ret;
}
@@ -443,7 +452,8 @@ void QGestureManager::cancelGesturesForChildren(QGesture *original)
void QGestureManager::cleanupGesturesForRemovedRecognizer(QGesture *gesture)
{
QGestureRecognizer *recognizer = m_deletedRecognizers.value(gesture);
- Q_ASSERT(recognizer);
+ if(!recognizer) //The Gesture is removed while in the even loop, so the recognizers for this gestures was removed
+ return;
m_deletedRecognizers.remove(gesture);
if (m_deletedRecognizers.keys(recognizer).isEmpty()) {
// no more active gestures, cleanup!
diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h
index 0d84b67434..92310f5f0b 100644
--- a/src/gui/kernel/qgesturemanager_p.h
+++ b/src/gui/kernel/qgesturemanager_p.h
@@ -101,7 +101,7 @@ private:
NotGesture,
MaybeGesture // this means timers are up and waiting for some
// more events, and input events are handled by
- // gesture recognizer explicitely
+ // gesture recognizer explicitly
} state;
struct ObjectGesture
@@ -130,6 +130,7 @@ private:
QHash<QGestureRecognizer *, QSet<QGesture *> > m_obsoleteGestures;
QHash<QGesture *, QGestureRecognizer *> m_deletedRecognizers;
+ QSet<QGesture *> m_gesturesToDelete;
void cleanupGesturesForRemovedRecognizer(QGesture *gesture);
QGesture *getState(QObject *widget, QGestureRecognizer *recognizer,
diff --git a/src/gui/kernel/qguiplatformplugin.cpp b/src/gui/kernel/qguiplatformplugin.cpp
index 2dd251bcd7..c80c6d36e2 100644
--- a/src/gui/kernel/qguiplatformplugin.cpp
+++ b/src/gui/kernel/qguiplatformplugin.cpp
@@ -187,7 +187,7 @@ QString QGuiPlatformPlugin::styleName()
#endif
}
-/* return an aditional default palette (only work on X11) */
+/* return an additional default palette (only work on X11) */
QPalette QGuiPlatformPlugin::palette()
{
#ifdef Q_WS_X11
diff --git a/src/gui/kernel/qkeymapper_mac.cpp b/src/gui/kernel/qkeymapper_mac.cpp
index 3dc6afc88a..b8f08bfcd4 100644
--- a/src/gui/kernel/qkeymapper_mac.cpp
+++ b/src/gui/kernel/qkeymapper_mac.cpp
@@ -749,7 +749,7 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, EventHandlerCallRef e
}
return false;
}
- // Once we process the key down , we dont need to send the saved event again from
+ // Once we process the key down , we don't need to send the saved event again from
// kEventTextInputUnicodeForKeyEvent, so clear it.
if (currentContext && ekind == kEventRawKeyDown) {
QMacInputContext *context = qobject_cast<QMacInputContext*>(currentContext);
@@ -765,7 +765,7 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, EventHandlerCallRef e
&handled_event) == false)
return handled_event;
QString text(ourChar);
- /* This is actually wrong - but unfortunatly it is the best that can be
+ /* This is actually wrong - but unfortunately it is the best that can be
done for now because of the Control/Meta mapping problems */
if (modifiers & (Qt::ControlModifier | Qt::MetaModifier)
&& !qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) {
diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp
index 50b2354156..bf3eddde23 100644
--- a/src/gui/kernel/qkeysequence.cpp
+++ b/src/gui/kernel/qkeysequence.cpp
@@ -1105,7 +1105,7 @@ QKeySequence QKeySequence::mnemonic(const QString &text)
#else
found = true;
} else {
- qWarning("QKeySequence::mnemonic: \"%s\" contains multiple occurences of '&'", qPrintable(text));
+ qWarning("QKeySequence::mnemonic: \"%s\" contains multiple occurrences of '&'", qPrintable(text));
#endif
}
}
diff --git a/src/gui/kernel/qmotifdnd_x11.cpp b/src/gui/kernel/qmotifdnd_x11.cpp
index 333445501d..3b79129468 100644
--- a/src/gui/kernel/qmotifdnd_x11.cpp
+++ b/src/gui/kernel/qmotifdnd_x11.cpp
@@ -385,7 +385,10 @@ static void DndReadSourceProperty(Display * dpy,
static void DndWriteReceiverProperty(Display * dpy, Window window,
unsigned char protocol_style)
{
- DndReceiverProp receiver_prop ;
+ DndReceiverProp receiver_prop;
+
+ // squelch potential valgrind errors about uninitialized reads
+ memset(&receiver_prop, 0, sizeof(receiver_prop));
receiver_prop.byte_order = DndByteOrder() ;
receiver_prop.protocol_version = DND_PROTOCOL_VERSION;
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index fee1580082..c81d75f6af 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -265,7 +265,7 @@ bool QSoftKeyManagerPrivateS60::setSoftkeyImage(CEikButtonGroupContainer *cba,
CFbsBitmap* nMask = softkeyAlpha.toSymbianCFbsBitmap();
CEikImage* myimage = new (ELeave) CEikImage;
- myimage->SetPicture( nBitmap, nMask ); // nBitmap and nMask ownership transfered
+ myimage->SetPicture( nBitmap, nMask ); // nBitmap and nMask ownership transferred
EikSoftkeyImage::SetImage(cba, *myimage, left); // Takes myimage ownership
cbaHasImage[position] = true;
diff --git a/src/gui/kernel/qsound_s60.cpp b/src/gui/kernel/qsound_s60.cpp
index df2830bc4e..accfce2dd0 100644
--- a/src/gui/kernel/qsound_s60.cpp
+++ b/src/gui/kernel/qsound_s60.cpp
@@ -150,7 +150,7 @@ void QAuServerS60::playCompleted(QAuBucketS60 *bucket, int error)
} else {
// We don't have a way to inform about errors -> just decrement loops
// in order that QSound::isFinished will return true;
- while (decLoop(sound)) {}
+ while (decLoop(sound) > 0) {}
if (staticPlayingSounds.removeAll(sound))
delete sound;
}
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index 893ba2b282..48b7ac1c35 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -194,29 +194,28 @@ QGestureRecognizer::Result QPinchGestureRecognizer::recognize(QGesture *state,
d->hotSpot = p1.screenPos();
d->isHotSpotSet = true;
+ QPointF centerPoint = (p1.screenPos() + p2.screenPos()) / 2.0;
if (d->isNewSequence) {
d->startPosition[0] = p1.screenPos();
d->startPosition[1] = p2.screenPos();
+ d->lastCenterPoint = centerPoint;
+ } else {
+ d->lastCenterPoint = d->centerPoint;
}
- QLineF line(p1.screenPos(), p2.screenPos());
- QLineF lastLine(p1.lastScreenPos(), p2.lastScreenPos());
- QLineF tmp(line);
- tmp.setLength(line.length() / 2.);
- QPointF centerPoint = tmp.p2();
-
- d->lastCenterPoint = d->centerPoint;
d->centerPoint = centerPoint;
- d->changeFlags |= QPinchGesture::CenterPointChanged;
- const qreal scaleFactor = line.length() / lastLine.length();
+ d->changeFlags |= QPinchGesture::CenterPointChanged;
if (d->isNewSequence) {
- d->lastScaleFactor = scaleFactor;
+ d->scaleFactor = 1.0;
+ d->lastScaleFactor = 1.0;
} else {
d->lastScaleFactor = d->scaleFactor;
+ QLineF line(p1.screenPos(), p2.screenPos());
+ QLineF lastLine(p1.lastScreenPos(), p2.lastScreenPos());
+ d->scaleFactor = line.length() / lastLine.length();
}
- d->scaleFactor = scaleFactor;
- d->totalScaleFactor = d->totalScaleFactor * scaleFactor;
+ d->totalScaleFactor = d->totalScaleFactor * d->scaleFactor;
d->changeFlags |= QPinchGesture::ScaleFactorChanged;
qreal angle = QLineF(p1.screenPos(), p2.screenPos()).angle();
@@ -227,7 +226,7 @@ QGestureRecognizer::Result QPinchGestureRecognizer::recognize(QGesture *state,
startAngle -= 360;
const qreal rotationAngle = startAngle - angle;
if (d->isNewSequence)
- d->lastRotationAngle = rotationAngle;
+ d->lastRotationAngle = 0.0;
else
d->lastRotationAngle = d->rotationAngle;
d->rotationAngle = rotationAngle;
diff --git a/src/gui/kernel/qt_x11_p.h b/src/gui/kernel/qt_x11_p.h
index d62d9c3d48..56c8094819 100644
--- a/src/gui/kernel/qt_x11_p.h
+++ b/src/gui/kernel/qt_x11_p.h
@@ -338,6 +338,7 @@ enum DesktopEnvironment {
DE_KDE,
DE_GNOME,
DE_CDE,
+ DE_MEEGO_COMPOSITOR,
DE_4DWM
};
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index f7c795e34a..c5f64e5d52 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -68,6 +68,7 @@
# include "qt_cocoa_helpers_mac_p.h"
# include "qmainwindow.h"
# include "qtoolbar.h"
+# include <private/qmainwindowlayout_p.h>
#endif
#if defined(Q_WS_QWS)
# include "qwsdisplay_qws.h"
@@ -235,6 +236,17 @@ void QWidgetBackingStoreTracker::unregisterWidget(QWidget *w)
}
}
+/*!
+ \internal
+ Recursively remove widget and all of its descendents.
+ */
+void QWidgetBackingStoreTracker::unregisterWidgetSubtree(QWidget *widget)
+{
+ unregisterWidget(widget);
+ foreach (QObject *child, widget->children())
+ if (QWidget *childWidget = qobject_cast<QWidget *>(child))
+ unregisterWidgetSubtree(childWidget);
+}
QWidgetPrivate::QWidgetPrivate(int version)
: QObjectPrivate(version)
@@ -325,15 +337,27 @@ QWidgetPrivate::~QWidgetPrivate()
#endif //QT_NO_GRAPHICSEFFECT
}
+class QDummyWindowSurface : public QWindowSurface
+{
+public:
+ QDummyWindowSurface(QWidget *window) : QWindowSurface(window) {}
+ QPaintDevice *paintDevice() { return window(); }
+ void flush(QWidget *, const QRegion &, const QPoint &) {}
+};
+
QWindowSurface *QWidgetPrivate::createDefaultWindowSurface()
{
Q_Q(QWidget);
QWindowSurface *surface;
- if (QApplicationPrivate::graphicsSystem())
- surface = QApplicationPrivate::graphicsSystem()->createWindowSurface(q);
- else
- surface = createDefaultWindowSurface_sys();
+ if (q->property("_q_DummyWindowSurface").toBool()) {
+ surface = new QDummyWindowSurface(q);
+ } else {
+ if (QApplicationPrivate::graphicsSystem())
+ surface = QApplicationPrivate::graphicsSystem()->createWindowSurface(q);
+ else
+ surface = createDefaultWindowSurface_sys();
+ }
return surface;
}
@@ -1649,13 +1673,8 @@ void QWidgetPrivate::setWinId(WId id) // set widget identifier
}
if(oldWinId != id) {
- // Do not emit an event when the old winId is destroyed. This only
- // happens (a) during widget destruction, and (b) immediately prior
- // to creation of a new winId, for example as a result of re-parenting.
- if(id != 0) {
- QEvent e(QEvent::WinIdChange);
- QCoreApplication::sendEvent(q, &e);
- }
+ QEvent e(QEvent::WinIdChange);
+ QCoreApplication::sendEvent(q, &e);
}
}
@@ -3002,6 +3021,15 @@ bool QWidget::isFullScreen() const
*/
void QWidget::showFullScreen()
{
+#ifdef Q_WS_MAC
+ // If the unified toolbar is enabled, we have to disable it before going fullscreen.
+ QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this);
+ if (mainWindow && mainWindow->unifiedTitleAndToolBarOnMac()) {
+ mainWindow->setUnifiedTitleAndToolBarOnMac(false);
+ QMainWindowLayout *mainLayout = qobject_cast<QMainWindowLayout*>(mainWindow->layout());
+ mainLayout->activateUnifiedToolbarAfterFullScreen = true;
+ }
+#endif // Q_WS_MAC
ensurePolished();
#ifdef QT3_SUPPORT
if (parent())
@@ -3034,6 +3062,18 @@ void QWidget::showMaximized()
setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowFullScreen))
| Qt::WindowMaximized);
+#ifdef Q_WS_MAC
+ // If the unified toolbar was enabled before going fullscreen, we have to enable it back.
+ QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this);
+ if (mainWindow)
+ {
+ QMainWindowLayout *mainLayout = qobject_cast<QMainWindowLayout*>(mainWindow->layout());
+ if (mainLayout->activateUnifiedToolbarAfterFullScreen) {
+ mainWindow->setUnifiedTitleAndToolBarOnMac(true);
+ mainLayout->activateUnifiedToolbarAfterFullScreen = false;
+ }
+ }
+#endif // Q_WS_MAC
show();
}
@@ -3055,6 +3095,18 @@ void QWidget::showNormal()
setWindowState(windowState() & ~(Qt::WindowMinimized
| Qt::WindowMaximized
| Qt::WindowFullScreen));
+#ifdef Q_WS_MAC
+ // If the unified toolbar was enabled before going fullscreen, we have to enable it back.
+ QMainWindow *mainWindow = qobject_cast<QMainWindow*>(this);
+ if (mainWindow)
+ {
+ QMainWindowLayout *mainLayout = qobject_cast<QMainWindowLayout*>(mainWindow->layout());
+ if (mainLayout->activateUnifiedToolbarAfterFullScreen) {
+ mainWindow->setUnifiedTitleAndToolBarOnMac(true);
+ mainLayout->activateUnifiedToolbarAfterFullScreen = false;
+ }
+ }
+#endif // Q_WS_MAC
show();
}
@@ -8779,7 +8831,7 @@ void QWidget::mousePressEvent(QMouseEvent *event)
QWidget* w;
while ((w = QApplication::activePopupWidget()) && w != this){
w->close();
- if (QApplication::activePopupWidget() == w) // widget does not want to dissappear
+ if (QApplication::activePopupWidget() == w) // widget does not want to disappear
w->hide(); // hide at least
}
if (!rect().contains(event->pos())){
@@ -9248,7 +9300,7 @@ void QWidget::setInputMethodHints(Qt::InputMethodHints hints)
#ifndef QT_NO_IM
Q_D(QWidget);
d->imHints = hints;
- // Optimisation to update input context only it has already been created.
+ // Optimization to update input context only it has already been created.
if (d->ic || qApp->d_func()->inputContext) {
QInputContext *ic = inputContext();
if (ic)
@@ -9997,7 +10049,16 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
if (newParent && isAncestorOf(focusWidget()))
focusWidget()->clearFocus();
+ QTLWExtra *oldTopExtra = window()->d_func()->maybeTopData();
+ QWidgetBackingStoreTracker *oldBsTracker = oldTopExtra ? &oldTopExtra->backingStore : 0;
+
d->setParent_sys(parent, f);
+
+ QTLWExtra *topExtra = window()->d_func()->maybeTopData();
+ QWidgetBackingStoreTracker *bsTracker = topExtra ? &topExtra->backingStore : 0;
+ if (oldBsTracker && oldBsTracker != bsTracker)
+ oldBsTracker->unregisterWidgetSubtree(this);
+
if (desktopWidget)
parent = 0;
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 1e2aa9f848..997419b5e9 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2794,19 +2794,38 @@ void QWidgetPrivate::transferChildren()
#ifdef QT_MAC_USE_COCOA
void QWidgetPrivate::setSubWindowStacking(bool set)
{
+ // This will set/remove a visual relationship between parent and child on screen.
+ // The reason for doing this is to ensure that a child always stacks infront of
+ // its parent. Unfortunatly is turns out that [NSWindow addChildWindow] has
+ // several unwanted side-effects, one of them being the moving of a child when
+ // moving the parent, which we choose to accept. A way tougher side-effect is
+ // that Cocoa will hide the parent if you hide the child. And in the case of
+ // a tool window, since it will normally hide when you deactivate the
+ // application, Cocoa will hide the parent upon deactivate as well. The result often
+ // being no more visible windows on screen. So, to make a long story short, we only
+ // allow parent-child relationships between windows that both are either a plain window
+ // or a dialog.
+
Q_Q(QWidget);
- if (!q->isWindow() || !q->testAttribute(Qt::WA_WState_Created))
+ if (!q->isWindow())
+ return;
+ NSWindow *qwin = [qt_mac_nativeview_for(q) window];
+ if (!qwin)
+ return;
+ Qt::WindowType qtype = q->windowType();
+ if (set && !(qtype == Qt::Window || qtype == Qt::Dialog))
+ return;
+ if (set && ![qwin isVisible])
return;
if (QWidget *parent = q->parentWidget()) {
- if (parent->testAttribute(Qt::WA_WState_Created)) {
+ if (NSWindow *pwin = [qt_mac_nativeview_for(parent) window]) {
if (set) {
- if (parent->isVisible()) {
- NSWindow *childwin = qt_mac_window_for(q);
- [qt_mac_window_for(parent) addChildWindow:childwin ordered:NSWindowAbove];
- }
+ Qt::WindowType ptype = parent->window()->windowType();
+ if ([pwin isVisible] && (ptype == Qt::Window || ptype == Qt::Dialog) && ![qwin parentWindow])
+ [pwin addChildWindow:qwin ordered:NSWindowAbove];
} else {
- [qt_mac_window_for(parent) removeChildWindow:qt_mac_window_for(q)];
+ [pwin removeChildWindow:qwin];
}
}
}
@@ -2814,12 +2833,15 @@ void QWidgetPrivate::setSubWindowStacking(bool set)
QList<QWidget *> widgets = q->findChildren<QWidget *>();
for (int i=0; i<widgets.size(); ++i) {
QWidget *child = widgets.at(i);
- if (child->isWindow() && child->testAttribute(Qt::WA_WState_Created) && child->isVisibleTo(q)) {
- if (set) {
- NSWindow *childwin = qt_mac_window_for(child);
- [qt_mac_window_for(q) addChildWindow:childwin ordered:NSWindowAbove];
- } else {
- [qt_mac_window_for(q) removeChildWindow:qt_mac_window_for(child)];
+ if (child && child->isWindow()) {
+ if (NSWindow *cwin = [qt_mac_nativeview_for(child) window]) {
+ if (set) {
+ Qt::WindowType ctype = child->window()->windowType();
+ if ([cwin isVisible] && (ctype == Qt::Window || ctype == Qt::Dialog) && ![cwin parentWindow])
+ [qwin addChildWindow:cwin ordered:NSWindowAbove];
+ } else {
+ [qwin removeChildWindow:qt_mac_window_for(child)];
+ }
}
}
}
@@ -3442,7 +3464,6 @@ void QWidgetPrivate::show_sys()
#else
// sync the opacity value back (in case of a fade).
[window setAlphaValue:q->windowOpacity()];
- setSubWindowStacking(true);
QWidget *top = 0;
if (QApplicationPrivate::tryModalHelper(q, &top)) {
@@ -3461,6 +3482,7 @@ void QWidgetPrivate::show_sys()
[modalWin orderFront:window];
}
}
+ setSubWindowStacking(true);
#endif
if (q->windowType() == Qt::Popup) {
if (q->focusWidget())
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index 6c89659d65..6a27469e34 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -122,6 +122,7 @@ public:
void registerWidget(QWidget *w);
void unregisterWidget(QWidget *w);
+ void unregisterWidgetSubtree(QWidget *w);
inline QWidgetBackingStore* data()
{
@@ -225,6 +226,7 @@ struct QTLWExtra {
#endif
#elif defined(Q_OS_SYMBIAN)
uint inExpose : 1; // Prevents drawing recursion
+ uint nativeWindowTransparencyEnabled : 1; // Tracks native window transparency
#endif
};
diff --git a/src/gui/kernel/qwidget_qws.cpp b/src/gui/kernel/qwidget_qws.cpp
index 31451362f1..c6cbbd067f 100644
--- a/src/gui/kernel/qwidget_qws.cpp
+++ b/src/gui/kernel/qwidget_qws.cpp
@@ -1017,6 +1017,30 @@ int QWidget::metric(PaintDeviceMetric m) const
return static_cast<QWidget *>(d->parent)->metric(m);
const QScreen *screen = d->getScreen();
return qRound(screen->height() / double(screen->physicalHeight() / 25.4));
+ } else if (m == PdmNumColors) {
+ QScreen *screen = d->getScreen();
+ int ret = screen->colorCount();
+ if (!ret) {
+ const int depth = qwsDisplay()->depth();
+ switch (depth) {
+ case 1:
+ ret = 2;
+ break;
+ case 8:
+ ret = 256;
+ break;
+ case 16:
+ ret = 65536;
+ break;
+ case 24:
+ ret = 16777216;
+ break;
+ case 32:
+ ret = 2147483647;
+ break;
+ }
+ }
+ return ret;
} else {
val = QPaintDevice::metric(m);// XXX
}
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 9a451cee01..609307c275 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -57,7 +57,7 @@
#include <eikbtgpc.h>
#endif
-// This is necessary in order to be able to perform delayed invokation on slots
+// This is necessary in order to be able to perform delayed invocation on slots
// which take arguments of type WId. One example is
// QWidgetPrivate::_q_delayedDestroy, which is used to delay destruction of
// CCoeControl objects until after the CONE event handler has finished running.
@@ -544,7 +544,7 @@ void QWidgetPrivate::show_sys()
id->MakeVisible(true);
- if(q->isWindow())
+ if(q->isWindow()&&!q->testAttribute(Qt::WA_ShowWithoutActivating))
id->setFocusSafely(true);
}
@@ -577,7 +577,7 @@ void QWidgetPrivate::hide_sys()
QSymbianControl *id = static_cast<QSymbianControl *>(q->internalWinId());
if (id) {
- //Incorrect optimisation - for popup windows, Qt's focus is moved before
+ //Incorrect optimization - for popup windows, Qt's focus is moved before
//hide_sys is called, resulting in the popup window keeping its elevated
//position in the CONE control stack.
//This can result in keyboard focus being in an invisible widget in some
@@ -709,7 +709,8 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
// old_winid may not have received a 'not visible' visibility
// changed event before being destroyed; make sure that it is
// removed from the backing store's list of visible windows.
- S60->controlVisibilityChanged(old_winid, false);
+ if (old_winid)
+ S60->controlVisibilityChanged(old_winid, false);
setWinId(0);
@@ -766,17 +767,24 @@ void QWidgetPrivate::s60UpdateIsOpaque()
if (!q->testAttribute(Qt::WA_WState_Created) || !q->testAttribute(Qt::WA_TranslucentBackground))
return;
+ createTLExtra();
+
RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE
window->SetSurfaceTransparency(!isOpaque);
+ extra->topextra->nativeWindowTransparencyEnabled = !isOpaque;
#else
if (!isOpaque) {
const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
- if (window->SetTransparencyAlphaChannel() == KErrNone)
+ if (window->SetTransparencyAlphaChannel() == KErrNone) {
window->SetBackgroundColor(TRgb(255, 255, 255, 0));
- } else
+ extra->topextra->nativeWindowTransparencyEnabled = 1;
+ }
+ } else if (extra->topextra->nativeWindowTransparencyEnabled) {
window->SetTransparentRegion(TRegionFix<1>());
+ extra->topextra->nativeWindowTransparencyEnabled = 0;
+ }
#endif
}
@@ -935,6 +943,7 @@ void QWidgetPrivate::registerDropSite(bool /* on */)
void QWidgetPrivate::createTLSysExtra()
{
extra->topextra->inExpose = 0;
+ extra->topextra->nativeWindowTransparencyEnabled = 0;
}
void QWidgetPrivate::deleteTLSysExtra()
diff --git a/src/gui/kernel/qx11embed_x11.cpp b/src/gui/kernel/qx11embed_x11.cpp
index 9f1b1f8f3c..e6e3bfb9f3 100644
--- a/src/gui/kernel/qx11embed_x11.cpp
+++ b/src/gui/kernel/qx11embed_x11.cpp
@@ -1136,7 +1136,7 @@ void QX11EmbedContainer::paintEvent(QPaintEvent *)
/*! \internal
- Returns wether or not the windows' embedded flag is set.
+ Returns whether or not the windows' embedded flag is set.
*/
bool QX11EmbedContainerPrivate::isEmbedded() const
{