Index: /trunk/configure.cmd
===================================================================
--- /trunk/configure.cmd	(revision 94)
+++ /trunk/configure.cmd	(revision 95)
@@ -45,6 +45,9 @@
  * (mostly because the relevant features are not yet implemented) */
 G.LIMITATION_DEFS   =,
-    "QT_NO_TABLET QT_NO_SYSTEMSEMAPHORE QT_NO_SHAREDMEMORY",
-    "QT_NO_SESSIONMANAGER"
+    "QT_NO_TABLET QT_NO_FONTCONFIG",
+    "QT_NO_SYSTEMSEMAPHORE QT_NO_SHAREDMEMORY",
+    "QT_NO_SESSIONMANAGER QT_NO_SYSTEMTRAYICON",
+    "QT_NO_DESKTOPSERVICES QT_NO_IM QT_NO_ACCESSIBILITY",
+    "QT_NO_PRINTER QT_NO_PRINTDIALOG"
 
 
@@ -227,5 +230,5 @@
     G.CFG_FONTCONFIG = "auto"
     G.CFG_QWS_FREETYPE = "auto"
-    G.CFG_LIBFREETYPE = "auto"
+    G.CFG_LIBFREETYPE = "no" /* @todo so far */
     G.CFG_SQL_AVAILABLE = ""
     G.QT_DEFAULT_BUILD_PARTS = "libs tools examples demos docs translations"
@@ -1330,5 +1333,5 @@
         G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_SHAPE")
     if (G.CFG_XINPUT == "no") then
-        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS QT_NO_XINPUT, "QT_NO_TABLET")
+        G.QCONFIG_FLAGS = Join(G.QCONFIG_FLAGS, "QT_NO_XINPUT "QT_NO_TABLET")
 
     if (G.CFG_XCURSOR == "runtime") then
Index: /trunk/src/gui/gui.pro
===================================================================
--- /trunk/src/gui/gui.pro	(revision 94)
+++ /trunk/src/gui/gui.pro	(revision 95)
@@ -5,5 +5,5 @@
 win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000
 
-!win32:!embedded:!mac:CONFIG      += x11
+!win32:!os2:!embedded:!mac:CONFIG      += x11
 
 unix:QMAKE_PKGCONFIG_REQUIRES = QtCore
@@ -20,21 +20,16 @@
 
 #modules
-# @todo on OS/2, temporarily disable some modules until implemented
-os2 {
-    include(kernel/kernel.pri)
-} else {
-    include(kernel/kernel.pri)
-    include(image/image.pri)
-    include(painting/painting.pri)
-    include(text/text.pri)
-    include(styles/styles.pri)
-    include(widgets/widgets.pri)
-    include(dialogs/dialogs.pri)
-    include(accessible/accessible.pri)
-    include(itemviews/itemviews.pri)
-    include(inputmethod/inputmethod.pri)
-    include(graphicsview/graphicsview.pri)
-    include(util/util.pri)
-}
+include(kernel/kernel.pri)
+include(image/image.pri)
+include(painting/painting.pri)
+include(text/text.pri)
+include(styles/styles.pri)
+include(widgets/widgets.pri)
+include(dialogs/dialogs.pri)
+include(accessible/accessible.pri)
+include(itemviews/itemviews.pri)
+include(inputmethod/inputmethod.pri)
+include(graphicsview/graphicsview.pri)
+include(util/util.pri)
 
 embedded: QT += network
Index: /trunk/src/gui/image/image.pri
===================================================================
--- /trunk/src/gui/image/image.pri	(revision 94)
+++ /trunk/src/gui/image/image.pri	(revision 95)
@@ -50,4 +50,7 @@
 win32 {
     SOURCES += image/qpixmap_win.cpp
+}
+os2 {
+    SOURCES += image/qpixmap_pm.cpp
 }
 embedded {
Index: /trunk/src/gui/image/qpixmap.cpp
===================================================================
--- /trunk/src/gui/image/qpixmap.cpp	(revision 94)
+++ /trunk/src/gui/image/qpixmap.cpp	(revision 95)
@@ -1844,4 +1844,6 @@
 #elif defined(Q_WS_WIN)
     return 32; // XXX
+#elif defined(Q_WS_PM)
+    return 32; // @todo check this
 #elif defined(Q_WS_MAC)
     return 32;
Index: /trunk/src/gui/image/qpixmap_pm.cpp
===================================================================
--- /trunk/src/gui/image/qpixmap_pm.cpp	(revision 95)
+++ /trunk/src/gui/image/qpixmap_pm.cpp	(revision 95)
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** Copyright (C) 2009 netlabs.org. OS/2 parts.
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qpixmap.h"
+#include "qpixmap_raster_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h )
+{
+    // @todo implement
+    return QPixmap();
+}
+
+QT_END_NAMESPACE
Index: /trunk/src/gui/image/qpixmapdatafactory.cpp
===================================================================
--- /trunk/src/gui/image/qpixmapdatafactory.cpp	(revision 94)
+++ /trunk/src/gui/image/qpixmapdatafactory.cpp	(revision 95)
@@ -51,4 +51,7 @@
 # include <private/qpixmap_raster_p.h>
 #endif
+#ifdef Q_WS_PM
+# include <private/qpixmap_raster_p.h> // @todo check this
+#endif
 #ifdef Q_WS_MAC
 # include <private/qpixmap_mac_p.h>
@@ -78,4 +81,6 @@
 #elif defined(Q_WS_WIN)
     return new QRasterPixmapData(type);
+#elif defined(Q_WS_PM)
+    return new QRasterPixmapData(type); // @todo check this
 #elif defined(Q_WS_MAC)
     return new QMacPixmapData(type);
Index: /trunk/src/gui/kernel/kernel.pri
===================================================================
--- /trunk/src/gui/kernel/kernel.pri	(revision 94)
+++ /trunk/src/gui/kernel/kernel.pri	(revision 95)
@@ -92,16 +92,12 @@
 
 os2 {
-	# @todo override everything since most things are not ready...
-	HEADERS = \
-		kernel/qapplication.h \
-		kernel/qapplication_p.h \
-		kernel/qwidget.h \
-		kernel/qwidget_p.h
-	SOURCES = \
-		kernel/qapplication.cpp \
-		kernel/qwidget.cpp
-
 	SOURCES += \
 		kernel/qapplication_pm.cpp \
+		kernel/qclipboard_pm.cpp \
+		kernel/qcursor_pm.cpp \
+		kernel/qdesktopwidget_pm.cpp \
+		kernel/qdnd_pm.cpp \
+		kernel/qkeymapper_pm.cpp \
+		kernel/qsound_pm.cpp \
 		kernel/qwidget_pm.cpp
 }
Index: /trunk/src/gui/kernel/qapplication.cpp
===================================================================
--- /trunk/src/gui/kernel/qapplication.cpp	(revision 94)
+++ /trunk/src/gui/kernel/qapplication.cpp	(revision 95)
@@ -127,5 +127,7 @@
 QApplicationPrivate *QApplicationPrivate::self = 0;
 
+#ifndef QT_NO_IM
 QInputContext *QApplicationPrivate::inputContext;
+#endif
 
 bool QApplicationPrivate::quitOnLastWindowClosed = true;
@@ -2056,4 +2058,5 @@
         focus_widget = focus;
 
+#ifndef QT_NO_IM
         if (prev && ((reason != Qt::PopupFocusReason && reason != Qt::MenuBarFocusReason
             && prev->testAttribute(Qt::WA_InputMethodEnabled))
@@ -2068,4 +2071,5 @@
             }
         }
+#endif
 
         if(focus_widget)
@@ -2089,4 +2093,5 @@
             }
             if(focus && QApplicationPrivate::focus_widget == focus) {
+#ifndef QT_NO_IM
                 if (focus->testAttribute(Qt::WA_InputMethodEnabled)) {
                     QInputContext *qic = focus->inputContext();
@@ -2094,4 +2099,5 @@
                         qic->setFocusWidget( focus_widget );
                 }
+#endif
                 QFocusEvent in(QEvent::FocusIn, reason);
                 QPointer<QWidget> that = focus;
@@ -4903,4 +4909,5 @@
 void QApplication::setInputContext(QInputContext *inputContext)
 {
+#ifndef QT_NO_IM
     Q_D(QApplication);
     Q_UNUSED(d);// only static members being used.
@@ -4912,4 +4919,5 @@
         delete d->inputContext;
     d->inputContext = inputContext;
+#endif
 }
 
@@ -4921,4 +4929,5 @@
 QInputContext *QApplication::inputContext() const
 {
+#ifndef QT_NO_IM
     Q_D(const QApplication);
     Q_UNUSED(d);// only static members being used.
@@ -4936,4 +4945,7 @@
 #endif
     return d->inputContext;
+#else
+    return 0;
+#endif
 }
 
Index: /trunk/src/gui/kernel/qapplication_p.h
===================================================================
--- /trunk/src/gui/kernel/qapplication_p.h	(revision 94)
+++ /trunk/src/gui/kernel/qapplication_p.h	(revision 95)
@@ -317,6 +317,7 @@
     }
 #endif
+#ifndef QT_NO_IM
     static QInputContext *inputContext;
-
+#endif
     static Qt::MouseButtons mouse_buttons;
     static Qt::KeyboardModifiers modifier_buttons;
Index: /trunk/src/gui/kernel/qapplication_pm.cpp
===================================================================
--- /trunk/src/gui/kernel/qapplication_pm.cpp	(revision 94)
+++ /trunk/src/gui/kernel/qapplication_pm.cpp	(revision 95)
@@ -82,5 +82,6 @@
 static bool	qt_try_modal(QWidget *, QMSG *, int& ret);
 
-static QWidget *qt_button_down = 0; // widget got last button-down
+QWidget *qt_button_down = 0; // widget got last button-down
+QPointer<QWidget> qt_last_mouse_receiver = 0;
 
 static HWND autoCaptureWnd = NULLHANDLE;
@@ -273,4 +274,9 @@
  *****************************************************************************/
 
+void QApplicationPrivate::createEventDispatcher()
+{
+    // @todo implement
+}
+
 /*****************************************************************************
   Platform specific QApplication members
@@ -286,15 +292,113 @@
 }
 
+void  QApplication::setCursorFlashTime(int msecs)
+{
+    // @todo implement
+}
+
+
+int QApplication::cursorFlashTime()
+{
+    // @todo implement
+    return 0;
+}
+
+void QApplication::setDoubleClickInterval(int ms)
+{
+    // @todo implement
+}
+
+int QApplication::doubleClickInterval()
+{
+    // @todo implement
+    return 0;
+}
+
+
+void QApplication::setKeyboardInputInterval(int ms)
+{
+    // @todo implement
+}
+
+int QApplication::keyboardInputInterval()
+{
+    // @todo implement
+    return 0;
+}
+
+#ifndef QT_NO_WHEELEVENT
+void QApplication::setWheelScrollLines(int n)
+{
+    // @todo implement
+}
+
+int QApplication::wheelScrollLines()
+{
+    // @todo implement
+    return 0;
+}
+#endif //QT_NO_WHEELEVENT
+
+void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable)
+{
+    // @todo implement
+}
+
+bool QApplication::isEffectEnabled(Qt::UIEffect effect)
+{
+    // @todo implement
+    return false;
+}
+
+void QApplication::beep()
+{
+    // @todo implement
+}
+
+void QApplication::alert(QWidget *widget, int duration)
+{
+    // @todo implement
+}
+
 /*****************************************************************************
   QApplication cursor stack
  *****************************************************************************/
 
+#ifndef QT_NO_CURSOR
+
+void QApplication::setOverrideCursor(const QCursor &cursor)
+{
+    // @todo implement
+}
+
+void QApplication::restoreOverrideCursor()
+{
+    // @todo implement
+}
+
+#endif
+
 /*****************************************************************************
   Routines to find a Qt widget from a screen position
  *****************************************************************************/
 
+QWidget *QApplication::topLevelAt(const QPoint &pos)
+{
+    // @todo implement
+    return 0;
+}
+
 /*****************************************************************************
   Main event loop
  *****************************************************************************/
+
+// QtWndProc() receives all messages from the main event loop
+
+extern "C"
+MRESULT EXPENTRY QtWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
+{
+    // @todo implement
+    return FALSE;
+}
 
 /*****************************************************************************
@@ -315,4 +419,20 @@
  *****************************************************************************/
 
+bool QApplicationPrivate::modalState()
+{
+    // @todo implement
+    return false;
+}
+
+void QApplicationPrivate::enterModal_sys(QWidget *widget)
+{
+    // @todo implement
+}
+
+void QApplicationPrivate::leaveModal_sys(QWidget *widget)
+{
+    // @todo implement
+}
+
 /*****************************************************************************
   Popup widget mechanism
@@ -329,4 +449,14 @@
  *****************************************************************************/
 
+void QApplicationPrivate::openPopup(QWidget *popup)
+{
+    // @todo implement
+}
+
+void QApplicationPrivate::closePopup(QWidget *popup)
+{
+    // @todo implement
+}
+
 /*****************************************************************************
   Event translation; translates PM events to Qt events
Index: /trunk/src/gui/kernel/qclipboard.cpp
===================================================================
--- /trunk/src/gui/kernel/qclipboard.cpp	(revision 94)
+++ /trunk/src/gui/kernel/qclipboard.cpp	(revision 95)
@@ -160,5 +160,5 @@
 #endif
 
-#ifndef Q_WS_WIN32
+#if !defined(Q_WS_WIN32) && !defined(Q_WS_PM)
 /*!
     \internal
@@ -230,5 +230,5 @@
 
     \value Selection  indicates that data should be stored and retrieved from
-    the global mouse selection. Support for \c Selection is provided only on 
+    the global mouse selection. Support for \c Selection is provided only on
     systems with a global mouse selection (e.g. X11).
 
@@ -346,5 +346,5 @@
     image is retrieved from the global clipboard.  If \a mode is
     QClipboard::Selection, the image is retrieved from the global
-    mouse selection. 
+    mouse selection.
 
     \sa setImage() pixmap() mimeData(), QImage::isNull()
@@ -461,5 +461,5 @@
 */
 
-/*! 
+/*!
     \fn void QClipboard::clear(Mode mode)
     Clear the clipboard contents.
@@ -469,5 +469,5 @@
     function clears the the global clipboard contents.  If \a mode is
     QClipboard::Selection, this function clears the global mouse
-    selection contents. If \a mode is QClipboard::FindBuffer, this 
+    selection contents. If \a mode is QClipboard::FindBuffer, this
     function clears the search string buffer.
 
@@ -562,5 +562,5 @@
 }
 
-/*! 
+/*!
     \internal
     \fn bool QClipboard::supportsMode(Mode mode) const;
@@ -569,5 +569,5 @@
 */
 
-/*! 
+/*!
     \internal
     \fn bool QClipboard::ownsMode(Mode mode) const;
@@ -576,5 +576,5 @@
 */
 
-/*! 
+/*!
     \internal
     Emits the appropriate changed signal for \a mode.
Index: /trunk/src/gui/kernel/qclipboard_pm.cpp
===================================================================
--- /trunk/src/gui/kernel/qclipboard_pm.cpp	(revision 95)
+++ /trunk/src/gui/kernel/qclipboard_pm.cpp	(revision 95)
@@ -0,0 +1,108 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** Copyright (C) 2009 netlabs.org. OS/2 parts.
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qclipboard.h"
+
+#ifndef QT_NO_CLIPBOARD
+
+#include "qapplication.h"
+#include "qapplication_p.h"
+#include "qeventloop.h"
+#include "qwidget.h"
+#include "qevent.h"
+#include "qmime.h"
+#include "qt_os2.h"
+#include "qdnd_p.h"
+
+QT_BEGIN_NAMESPACE
+
+QClipboard::~QClipboard()
+{
+    // @todo implement
+}
+
+void QClipboard::setMimeData(QMimeData *src, Mode mode)
+{
+    // @todo implement
+}
+
+void QClipboard::clear(Mode mode)
+{
+    // @todo implement
+}
+
+bool QClipboard::event(QEvent *e)
+{
+    // @todo implement
+    return false;
+}
+
+void QClipboard::connectNotify(const char *signal)
+{
+    // @todo implement
+}
+
+const QMimeData *QClipboard::mimeData(Mode mode) const
+{
+    // @todo implement
+    return 0;
+}
+
+bool QClipboard::supportsMode(Mode mode) const
+{
+    return (mode == Clipboard);
+}
+
+bool QClipboard::ownsMode(Mode mode) const
+{
+    // @todo implement
+    return false;
+}
+
+void QClipboard::ownerDestroyed()
+{
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_CLIPBOARD
Index: /trunk/src/gui/kernel/qcursor_pm.cpp
===================================================================
--- /trunk/src/gui/kernel/qcursor_pm.cpp	(revision 95)
+++ /trunk/src/gui/kernel/qcursor_pm.cpp	(revision 95)
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** Copyright (C) 2009 netlabs.org. OS/2 parts.
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <private/qcursor_p.h>
+#include <qbitmap.h>
+#include <qcursor.h>
+
+#ifndef QT_NO_CURSOR
+
+#include <qimage.h>
+#include <qt_os2.h>
+
+QT_BEGIN_NAMESPACE
+
+extern QCursorData *qt_cursorTable[Qt::LastCursor + 1]; // qcursor.cpp
+
+/*****************************************************************************
+  Internal QCursorData class
+ *****************************************************************************/
+
+QCursorData::QCursorData(Qt::CursorShape s)
+  : cshape(s), bm(0), bmm(0), hx(0), hy(0) // @todo, hcurs(0)
+{
+    ref = 1;
+}
+
+QCursorData::~QCursorData()
+{
+    delete bm;
+    delete bmm;
+    // @todo
+//  if (hcurs)
+//      delete it...
+}
+
+
+QCursorData *QCursorData::setBitmap(const QBitmap &bitmap, const QBitmap &mask, int hotX, int hotY)
+{
+    // @todo implement
+    return 0;
+}
+
+#endif //QT_NO_CURSOR
+
+QPoint QCursor::pos()
+{
+    // @todo implement
+    return QPoint();
+}
+
+void QCursor::setPos(int x, int y)
+{
+    // @todo implement
+}
+
+#ifndef QT_NO_CURSOR
+
+void QCursorData::update()
+{
+    if (!QCursorData::initialized)
+        QCursorData::initialize();
+    // @todo implement
+}
+
+QT_END_NAMESPACE
+#endif // QT_NO_CURSOR
Index: /trunk/src/gui/kernel/qdesktopwidget_pm.cpp
===================================================================
--- /trunk/src/gui/kernel/qdesktopwidget_pm.cpp	(revision 95)
+++ /trunk/src/gui/kernel/qdesktopwidget_pm.cpp	(revision 95)
@@ -0,0 +1,134 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** Copyright (C) 2009 netlabs.org. OS/2 parts.
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qdesktopwidget.h"
+#include "qt_os2.h"
+#include "qapplication_p.h"
+#include "qwidget_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDesktopWidgetPrivate : public QWidgetPrivate
+{
+public:
+};
+
+/*
+    \omit
+    Function is commented out in header
+    \fn void *QDesktopWidget::handle(int screen) const
+
+    Returns the window system handle of the display device with the
+    index \a screen, for low-level access.  Using this function is not
+    portable.
+
+    The return type varies with platform; see qwindowdefs.h for details.
+
+    \sa x11Display(), QPaintDevice::handle()
+    \endomit
+*/
+
+QDesktopWidget::QDesktopWidget()
+    : QWidget(*new QDesktopWidgetPrivate, 0, Qt::Desktop)
+  {
+    setObjectName(QLatin1String("desktop"));
+    // @todo implement
+}
+
+QDesktopWidget::~QDesktopWidget()
+{
+}
+
+bool QDesktopWidget::isVirtualDesktop() const
+{
+    return true;
+}
+
+int QDesktopWidget::primaryScreen() const
+{
+    // @todo implement
+    return 0;
+}
+
+int QDesktopWidget::numScreens() const
+{
+    // @todo implement
+    return 0;
+}
+
+QWidget *QDesktopWidget::screen(int /* screen */)
+{
+    // It seems that a Qt::WType_Desktop cannot be moved?
+    return this;
+}
+
+const QRect QDesktopWidget::availableGeometry(int screen) const
+{
+    // @todo implement
+    return QRect();
+}
+
+const QRect QDesktopWidget::screenGeometry(int screen) const
+{
+    // @todo implement
+    return QRect();
+}
+
+int QDesktopWidget::screenNumber(const QWidget *widget) const
+{
+    // @todo implement
+    return 0;
+}
+
+int QDesktopWidget::screenNumber(const QPoint &point) const
+{
+    // @todo implement
+    return 0;
+}
+
+void QDesktopWidget::resizeEvent(QResizeEvent *)
+{
+    // @todo implement
+}
+
+QT_END_NAMESPACE
Index: /trunk/src/gui/kernel/qdnd_pm.cpp
===================================================================
--- /trunk/src/gui/kernel/qdnd_pm.cpp	(revision 95)
+++ /trunk/src/gui/kernel/qdnd_pm.cpp	(revision 95)
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** Copyright (C) 2009 netlabs.org. OS/2 parts.
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qapplication.h"
+
+#include "qapplication_p.h"
+#include "qevent.h"
+#include "qpainter.h"
+#include "qwidget.h"
+#include "qbuffer.h"
+#include "qdatastream.h"
+#include "qcursor.h"
+#include "qt_os2.h"
+#include "qdnd_p.h"
+#include "qdebug.h"
+
+QT_BEGIN_NAMESPACE
+
+#if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD))
+
+//---------------------------------------------------------------------
+//                    QDropData
+//---------------------------------------------------------------------
+
+bool QDropData::hasFormat_sys(const QString &mimeType) const
+{
+    // @todo implement
+    return false;
+}
+
+QStringList QDropData::formats_sys() const
+{
+    QStringList fmts;
+    // @todo implement
+    return fmts;
+}
+
+QVariant QDropData::retrieveData_sys(const QString &mimeType, QVariant::Type type) const
+{
+    QVariant result;
+    // @todo implement
+    return result;
+}
+
+Qt::DropAction QDragManager::drag(QDrag *o)
+
+{
+#ifdef QDND_DEBUG
+    qDebug("QDragManager::drag(QDrag *drag)");
+#endif
+
+    // @todo implement
+    return Qt::IgnoreAction;
+}
+
+void QDragManager::cancel(bool /* deleteSource */)
+{
+    // @todo implement
+}
+
+void QDragManager::updatePixmap()
+{
+    // not used in PM implementation
+}
+
+bool QDragManager::eventFilter(QObject *, QEvent *)
+{
+    // not used in PM implementation
+    return false;
+}
+
+void QDragManager::timerEvent(QTimerEvent*)
+{
+    // not used in PM implementation
+}
+
+void QDragManager::move(const QPoint &)
+{
+    // not used in PM implementation
+}
+
+void QDragManager::drop()
+{
+    // not used in PM implementation
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_DRAGANDDROP
Index: /trunk/src/gui/kernel/qkeymapper_pm.cpp
===================================================================
--- /trunk/src/gui/kernel/qkeymapper_pm.cpp	(revision 95)
+++ /trunk/src/gui/kernel/qkeymapper_pm.cpp	(revision 95)
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** Copyright (C) 2009 netlabs.org. OS/2 parts.
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qkeymapper_p.h"
+
+QT_BEGIN_NAMESPACE
+
+// Uncommend, to show debugging information for the keymapper
+//#define DEBUG_KEYMAPPER
+
+// Keyboard map private ----------------------------------------------------------------[ start ]---
+
+QKeyMapperPrivate::QKeyMapperPrivate()
+{
+    // @todo implement
+}
+
+QKeyMapperPrivate::~QKeyMapperPrivate()
+{
+    clearMappings();
+}
+
+void QKeyMapperPrivate::clearMappings()
+{
+    // @todo implement
+}
+
+QList<int> QKeyMapperPrivate::possibleKeys(QKeyEvent *e)
+{
+    QList<int> result;
+
+    // @todo implement
+    return result;
+}
+
+// QKeyMapper (PM) implementation -------------------------------------------------[ start ]---
+
+bool QKeyMapper::sendKeyEvent(QWidget *widget, bool grab,
+                              QEvent::Type type, int code, Qt::KeyboardModifiers modifiers,
+                              const QString &text, bool autorepeat, int count,
+                              quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
+                              bool *)
+{
+    // @todo implement
+    return false;
+}
+
+QT_END_NAMESPACE
Index: /trunk/src/gui/kernel/qsound_pm.cpp
===================================================================
--- /trunk/src/gui/kernel/qsound_pm.cpp	(revision 95)
+++ /trunk/src/gui/kernel/qsound_pm.cpp	(revision 95)
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** Copyright (C) 2009 netlabs.org. OS/2 parts.
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qsound.h"
+
+#ifndef QT_NO_SOUND
+
+#include "qapplication.h"
+#include "qapplication_p.h"
+#include <qfile.h>
+#include "qpointer.h"
+#include "qsound_p.h"
+
+#include <qt_os2.h>
+
+QT_BEGIN_NAMESPACE
+
+QAuServer* qt_new_audio_server()
+{
+    // @todo implement
+    return 0;
+}
+
+QT_END_NAMESPACE
+
+// @todo
+//#include "qsound_pm.moc"
+
+#endif // QT_NO_SOUND
Index: /trunk/src/gui/kernel/qwidget.cpp
===================================================================
--- /trunk/src/gui/kernel/qwidget.cpp	(revision 94)
+++ /trunk/src/gui/kernel/qwidget.cpp	(revision 95)
@@ -298,8 +298,8 @@
 void QWidget::setInputContext(QInputContext *context)
 {
+#ifndef QT_NO_IM
     Q_D(QWidget);
     if (!testAttribute(Qt::WA_InputMethodEnabled))
         return;
-#ifndef QT_NO_IM
     if (d->ic)
         delete d->ic;
@@ -323,7 +323,7 @@
 void QWidget::resetInputContext()
 {
+#ifndef QT_NO_IM
     if (!hasFocus())
         return;
-#ifndef QT_NO_IM
     QInputContext *qic = this->inputContext();
     if(qic)
@@ -9822,4 +9822,5 @@
 #endif
     case Qt::WA_NativeWindow: {
+#ifndef QT_NO_IM
         QInputContext *ic = 0;
         if (on && !internalWinId() && testAttribute(Qt::WA_InputMethodEnabled) && hasFocus()) {
@@ -9828,10 +9829,13 @@
             ic->setFocusWidget(0);
         }
+#endif
         if (!qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) && parentWidget())
             parentWidget()->d_func()->enforceNativeChildren();
         if (on && !internalWinId() && testAttribute(Qt::WA_WState_Created))
             d->createWinId();
+#ifndef QT_NO_IM
         if (ic)
             ic->setFocusWidget(this);
+#endif
         break;
     }
@@ -9867,4 +9871,5 @@
             QInputContextPrivate::updateImeStatus(this, true);
 #endif
+#ifndef QT_NO_IM
         QInputContext *ic = d->ic;
         if (!ic) {
@@ -9881,4 +9886,5 @@
             }
         }
+#endif
         break;
     }
Index: /trunk/src/gui/kernel/qwidget_p.h
===================================================================
--- /trunk/src/gui/kernel/qwidget_p.h	(revision 94)
+++ /trunk/src/gui/kernel/qwidget_p.h	(revision 95)
@@ -594,5 +594,5 @@
 #endif
 
-#if defined(Q_WS_X11) || defined (Q_WS_WIN)  || defined (Q_WS_PM) || defined(Q_WS_MAC)
+#if defined(Q_WS_X11) || defined (Q_WS_WIN) || defined (Q_WS_PM) || defined(Q_WS_MAC)
 #ifdef Q_WS_MAC
     void setWSGeometry(bool dontShow=false, const QRect &oldRect = QRect());
Index: /trunk/src/gui/kernel/qwidget_pm.cpp
===================================================================
--- /trunk/src/gui/kernel/qwidget_pm.cpp	(revision 94)
+++ /trunk/src/gui/kernel/qwidget_pm.cpp	(revision 95)
@@ -64,3 +64,234 @@
  *****************************************************************************/
 
+void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyOldWindow)
+{
+    // @todo implement
+}
+
+void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
+{
+    // @todo implement
+}
+
+QPoint QWidget::mapToGlobal(const QPoint &pos) const
+{
+    // @todo implement
+    return QPoint();
+}
+
+QPoint QWidget::mapFromGlobal(const QPoint &pos) const
+{
+    // @todo implement
+    return QPoint();
+}
+
+void QWidgetPrivate::updateSystemBackground() {}
+
+#ifndef QT_NO_CURSOR
+void QWidgetPrivate::setCursor_sys(const QCursor &cursor)
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::unsetCursor_sys()
+{
+    // @todo implement
+}
+#endif
+
+void QWidgetPrivate::setWindowTitle_sys(const QString &caption)
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::setWindowIcon_sys(bool forceReset)
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::setWindowIconText_sys(const QString &iconText)
+{
+    Q_UNUSED(iconText);
+}
+
+void QWidget::grabMouse()
+{
+    // @todo implement
+}
+
+void QWidget::grabMouse(const QCursor &cursor)
+{
+    // @todo implement
+}
+
+void QWidget::releaseMouse()
+{
+    // @todo implement
+}
+
+void QWidget::grabKeyboard()
+{
+    // @todo implement
+}
+
+void QWidget::releaseKeyboard()
+{
+    // @todo implement
+}
+
+QWidget *QWidget::mouseGrabber()
+{
+    // @todo implement
+    return 0;
+}
+
+QWidget *QWidget::keyboardGrabber()
+{
+    // @todo implement
+    return 0;
+}
+
+void QWidget::activateWindow()
+{
+    // @todo implement
+}
+
+void QWidget::setWindowState(Qt::WindowStates newstate)
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::hide_sys()
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::show_sys()
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::setFocus_sys()
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::raise_sys()
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::lower_sys()
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::stackUnder_sys(QWidget* w)
+{
+    // @todo implement
+}
+
+/*
+  Helper function for non-toplevel widgets. Helps to map Qt's 32bit
+  coordinate system to Windpws's 16bit coordinate system.
+
+  This code is duplicated from the X11 code, so any changes there
+  should also (most likely) be reflected here.
+
+  (In all comments below: s/X/PM/g)
+ */
+
+void QWidgetPrivate::setWSGeometry(bool dontShow)
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::setConstraints_sys()
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::scroll_sys(int dx, int dy)
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r)
+{
+    // @todo implement
+}
+
+int QWidget::metric(PaintDeviceMetric m) const
+{
+    // @todo implement
+    return 0;
+}
+
+void QWidgetPrivate::createSysExtra()
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::deleteSysExtra()
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::createTLSysExtra()
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::deleteTLSysExtra()
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::registerDropSite(bool on)
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::setMask_sys(const QRegion &region)
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::updateFrameStrut()
+{
+    // @todo implement
+}
+
+void QWidgetPrivate::setWindowOpacity_sys(qreal level)
+{
+    // @todo implement
+}
+
+QPaintEngine *QWidget::paintEngine() const
+{
+    // @todo implement
+    return 0;
+}
+
+QWindowSurface *QWidgetPrivate::createDefaultWindowSurface_sys()
+{
+    // @todo implement
+    return 0;
+}
+
+void QWidgetPrivate::setModal_sys()
+{
+    // @todo implement
+}
+
 QT_END_NAMESPACE
Index: /trunk/src/gui/painting/painting.pri
===================================================================
--- /trunk/src/gui/painting/painting.pri	(revision 94)
+++ /trunk/src/gui/painting/painting.pri	(revision 95)
@@ -112,4 +112,11 @@
 }
 
+os2 {
+        SOURCES += \
+                painting/qcolormap_pm.cpp \
+                painting/qpaintdevice_pm.cpp \
+                painting/qregion_pm.cpp
+}
+
 embedded {
     HEADERS += \
@@ -170,5 +177,5 @@
 }
 
-win32|x11|mac|embedded {
+win32|os2|x11|mac|embedded {
         SOURCES += painting/qbackingstore.cpp
         HEADERS += painting/qbackingstore_p.h
Index: /trunk/src/gui/painting/qcolormap_pm.cpp
===================================================================
--- /trunk/src/gui/painting/qcolormap_pm.cpp	(revision 95)
+++ /trunk/src/gui/painting/qcolormap_pm.cpp	(revision 95)
@@ -0,0 +1,130 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** Copyright (C) 2009 netlabs.org. OS/2 parts.
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qcolor.h"
+#include "qcolormap.h"
+#include "qvector.h"
+
+QT_BEGIN_NAMESPACE
+
+class QColormapPrivate
+{
+public:
+    inline QColormapPrivate()
+        : ref(1), mode(QColormap::Direct), depth(0) // @todo, hpal(0)
+    { }
+
+    QAtomicInt ref;
+
+    QColormap::Mode mode;
+    int depth;
+    int numcolors;
+
+// @todo implement
+//    HPALETTE hpal;
+    QVector<QColor> palette;
+};
+
+static QColormapPrivate *screenMap = 0;
+
+void QColormap::initialize()
+{
+    // @todo implement
+}
+
+void QColormap::cleanup()
+{
+    // @todo implement
+}
+
+QColormap QColormap::instance(int)
+{ return QColormap(); }
+
+QColormap::QColormap()
+    : d(screenMap)
+{ d->ref.ref(); }
+
+QColormap::QColormap(const QColormap &colormap)
+    :d (colormap.d)
+{ d->ref.ref(); }
+
+QColormap::~QColormap()
+{
+    if (!d->ref.deref())
+        delete d;
+}
+
+QColormap::Mode QColormap::mode() const
+{ return d->mode; }
+
+int QColormap::depth() const
+{ return d->depth; }
+
+int QColormap::size() const
+{ return d->numcolors; }
+
+uint QColormap::pixel(const QColor &color) const
+{
+    // @todo implement
+    return 0;
+}
+
+const QColor QColormap::colorAt(uint pixel) const
+{
+    // @todo implement
+    return QColor();
+}
+
+// @todo need?
+//HPALETTE QColormap::hPal()
+//{ return screenMap ? screenMap->hpal : 0; }
+
+
+const QVector<QColor> QColormap::colormap() const
+{ return d->palette; }
+
+QColormap &QColormap::operator=(const QColormap &colormap)
+{ qAtomicAssign(d, colormap.d); return *this; }
+
+
+QT_END_NAMESPACE
Index: /trunk/src/gui/painting/qgraphicssystem.cpp
===================================================================
--- /trunk/src/gui/painting/qgraphicssystem.cpp	(revision 94)
+++ /trunk/src/gui/painting/qgraphicssystem.cpp	(revision 95)
@@ -48,4 +48,7 @@
 # include <private/qpixmap_raster_p.h>
 #endif
+#ifdef Q_WS_PM
+# include <private/qpixmap_raster_p.h> // @todo check this
+#endif
 #ifdef Q_WS_MAC
 # include <private/qpixmap_mac_p.h>
@@ -67,4 +70,6 @@
 #elif defined(Q_WS_WIN)
     return new QRasterPixmapData(type);
+#elif defined(Q_WS_PM)
+    return new QRasterPixmapData(type); // @todo check this
 #elif defined(Q_WS_MAC)
     return new QMacPixmapData(type);
Index: /trunk/src/gui/painting/qpaintdevice_pm.cpp
===================================================================
--- /trunk/src/gui/painting/qpaintdevice_pm.cpp	(revision 95)
+++ /trunk/src/gui/painting/qpaintdevice_pm.cpp	(revision 95)
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** Copyright (C) 2009 netlabs.org. OS/2 parts.
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qpaintdevice.h"
+#include "qpainter.h"
+#include "qwidget.h"
+#include "qbitmap.h"
+#include "qapplication.h"
+
+QT_BEGIN_NAMESPACE
+
+QPaintDevice::QPaintDevice()
+{
+    painters = 0;
+}
+
+extern void qt_painter_removePaintDevice(QPaintDevice *); //qpainter.cpp
+
+QPaintDevice::~QPaintDevice()
+{
+    if (paintingActive())
+        qWarning("QPaintDevice: Cannot destroy paint device that is being "
+                  "painted.  Be sure to QPainter::end() painters!");
+    qt_painter_removePaintDevice(this);
+}
+
+int QPaintDevice::metric(PaintDeviceMetric) const
+{
+    qWarning("QPaintDevice::metrics: Device has no metric information");
+    return 0;
+}
+
+QT_END_NAMESPACE
Index: /trunk/src/gui/painting/qregion.cpp
===================================================================
--- /trunk/src/gui/painting/qregion.cpp	(revision 94)
+++ /trunk/src/gui/painting/qregion.cpp	(revision 95)
@@ -566,5 +566,5 @@
   \sa intersected()
 */
-#if !defined(Q_WS_WIN) || defined(Q_OS_WINCE)
+#if (!defined(Q_WS_WIN) || defined(Q_OS_WINCE)) && !defined(Q_WS_PM)
 QRegion& QRegion::operator&=(const QRegion &r)
     { return *this = *this & r; }
@@ -596,5 +596,5 @@
   \sa subtracted()
 */
-#if !defined(Q_WS_WIN) || defined(Q_OS_WINCE)
+#if (!defined(Q_WS_WIN) || defined(Q_OS_WINCE)) && !defined(Q_WS_PM)
 QRegion& QRegion::operator-=(const QRegion &r)
     { return *this = *this - r; }
Index: /trunk/src/gui/painting/qregion_pm.cpp
===================================================================
--- /trunk/src/gui/painting/qregion_pm.cpp	(revision 95)
+++ /trunk/src/gui/painting/qregion_pm.cpp	(revision 95)
@@ -0,0 +1,220 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** Copyright (C) 2009 netlabs.org. OS/2 parts.
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qbitmap.h"
+#include "qbuffer.h"
+#include "qimage.h"
+#include "qpolygon.h"
+#include "qregion.h"
+
+QT_BEGIN_NAMESPACE
+
+QRegion::QRegionData QRegion::shared_empty = { Q_BASIC_ATOMIC_INITIALIZER(1) }; // @todo, 0 };
+
+QRegion::QRegion()
+    : d(&shared_empty)
+{
+    d->ref.ref();
+}
+
+QRegion::QRegion(const QRect &r, RegionType t)
+{
+    // @todo implement
+}
+
+QRegion::QRegion(const QPolygon &a, Qt::FillRule fillRule)
+{
+    // @todo implement
+}
+
+QRegion::QRegion(const QRegion &r)
+{
+    d = r.d;
+    d->ref.ref();
+}
+
+QRegion::QRegion(const QBitmap &bm)
+{
+    // @todo implement
+}
+
+void QRegion::cleanUp(QRegion::QRegionData *x)
+{
+    // @todo implement
+}
+
+QRegion::~QRegion()
+{
+    if (!d->ref.deref())
+        cleanUp(d);
+}
+
+QRegion &QRegion::operator=(const QRegion &r)
+{
+    r.d->ref.ref();
+    if (!d->ref.deref())
+        cleanUp(d);
+    d = r.d;
+    return *this;
+}
+
+
+QRegion QRegion::copy() const
+{
+    // @todo implement
+    return QRegion();
+}
+
+bool QRegion::isEmpty() const
+{
+    return (d == &shared_empty || boundingRect().isEmpty());
+}
+
+
+bool QRegion::contains(const QPoint &p) const
+{
+    // @todo implement
+    return false;
+}
+
+bool QRegion::contains(const QRect &r) const
+{
+    // @todo implement
+    return false;
+}
+
+
+void QRegion::translate(int dx, int dy)
+{
+    // @todo implement
+}
+
+QRegion QRegion::unite(const QRegion &r) const
+{
+    // @todo implement
+    return QRegion();
+}
+
+QRegion QRegion::unite(const QRect &r) const
+{
+    return unite(QRegion(r));
+}
+
+QRegion QRegion::intersect(const QRegion &r) const
+{
+    // @todo implement
+    return QRegion();
+}
+
+QRegion QRegion::subtract(const QRegion &r) const
+{
+    // @todo implement
+    return QRegion();
+}
+
+QRegion QRegion::eor(const QRegion &r) const
+{
+    // @todo implement
+    return QRegion();
+}
+
+
+QRect QRegion::boundingRect() const
+{
+    // @todo implement
+    return QRect();
+}
+
+QVector<QRect> QRegion::rects() const
+{
+    // @todo implement
+    return QVector<QRect>();
+}
+
+void QRegion::setRects(const QRect *rects, int num)
+{
+    *this = QRegion();
+    if (!rects || num == 0 || (num == 1 && rects->isEmpty()))
+        return;
+    for (int i = 0; i < num; ++i)
+        *this |= rects[i];
+}
+
+int QRegion::numRects() const
+{
+    // @todo implement
+    return 0;
+}
+
+bool QRegion::operator==(const QRegion &r) const
+{
+    // @todo implement
+    return false;
+}
+
+QRegion& QRegion::operator+=(const QRegion &r)
+{
+    // @todo implement
+    return *this;
+}
+
+QRegion& QRegion::operator-=(const QRegion &r)
+{
+    // @todo implement
+    return *this;
+}
+
+QRegion& QRegion::operator&=(const QRegion &r)
+{
+    // @todo implement
+    return *this;
+}
+
+bool qt_region_strictContains(const QRegion &region, const QRect &rect)
+{
+    Q_UNUSED(region);
+    Q_UNUSED(rect);
+    return false;
+}
+
+QT_END_NAMESPACE
Index: /trunk/src/gui/text/qfont_pm.cpp
===================================================================
--- /trunk/src/gui/text/qfont_pm.cpp	(revision 95)
+++ /trunk/src/gui/text/qfont_pm.cpp	(revision 95)
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** Copyright (C) 2009 netlabs.org. OS/2 parts.
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qfont.h"
+#include "qfont_p.h"
+#include "qfontengine_p.h"
+#include "qtextengine_p.h"
+#include "qfontmetrics.h"
+#include "qfontinfo.h"
+
+QT_BEGIN_NAMESPACE
+
+/*****************************************************************************
+  QFont member functions
+ *****************************************************************************/
+
+void QFont::initialize()
+{
+}
+
+void QFont::cleanup()
+{
+    QFontCache::cleanup();
+}
+
+QString QFont::rawName() const
+{
+    return family();
+}
+
+void QFont::setRawName(const QString &name)
+{
+    setFamily(name);
+}
+
+QString QFont::defaultFamily() const
+{
+    switch(d->request.styleHint) {
+        case QFont::Times:
+            return QString::fromLatin1("Times New Roman");
+        case QFont::Courier:
+            return QString::fromLatin1("Courier New");
+        case QFont::Decorative:
+            return QString::fromLatin1("Bookman Old Style");
+        case QFont::Helvetica:
+            return QString::fromLatin1("Arial");
+        case QFont::System:
+        default:
+            return QString::fromLatin1("MS Sans Serif");
+    }
+}
+
+QString QFont::lastResortFamily() const
+{
+    return QString::fromLatin1("helvetica");
+}
+
+QString QFont::lastResortFont() const
+{
+    return QString::fromLatin1("arial");
+}
+
+QT_END_NAMESPACE
Index: /trunk/src/gui/text/qfontdatabase.cpp
===================================================================
--- /trunk/src/gui/text/qfontdatabase.cpp	(revision 94)
+++ /trunk/src/gui/text/qfontdatabase.cpp	(revision 95)
@@ -876,4 +876,6 @@
 #elif defined(Q_WS_WIN)
 #  include "qfontdatabase_win.cpp"
+#elif defined(Q_WS_PM)
+#  include "qfontdatabase_pm.cpp"
 #elif defined(Q_WS_QWS)
 #  include "qfontdatabase_qws.cpp"
@@ -2419,5 +2421,5 @@
 */
 
-/*! 
+/*!
     \fn bool QFontDatabase::supportsThreadedFontRendering()
     \since 4.4
Index: /trunk/src/gui/text/qfontdatabase_pm.cpp
===================================================================
--- /trunk/src/gui/text/qfontdatabase_pm.cpp	(revision 95)
+++ /trunk/src/gui/text/qfontdatabase_pm.cpp	(revision 95)
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** Copyright (C) 2009 netlabs.org. OS/2 parts.
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qabstractfileengine.h"
+
+QT_BEGIN_NAMESPACE
+
+static void initializeDb()
+{
+    // @todo implement
+}
+
+static inline void load(const QString &family = QString(), int = -1)
+{
+    // @todo implement
+}
+
+static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt)
+{
+    // @todo implement
+}
+
+void QFontDatabase::load(const QFontPrivate *d, int script)
+{
+    // @todo implement
+}
+
+bool QFontDatabase::removeApplicationFont(int handle)
+{
+    // @todo implement
+    return false;
+}
+
+bool QFontDatabase::removeAllApplicationFonts()
+{
+    // @todo implement
+    return false;
+}
+
+bool QFontDatabase::supportsThreadedFontRendering()
+{
+    // @todo implement
+    return false;
+}
+
+QT_END_NAMESPACE
Index: /trunk/src/gui/text/qfontengine_p.h
===================================================================
--- /trunk/src/gui/text/qfontengine_p.h	(revision 94)
+++ /trunk/src/gui/text/qfontengine_p.h	(revision 95)
@@ -323,5 +323,5 @@
     virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const;
 
-#if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
+#if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_PM) && !defined(Q_WS_MAC)
     void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si);
 #endif
Index: /trunk/src/gui/text/text.pri
===================================================================
--- /trunk/src/gui/text/text.pri	(revision 94)
+++ /trunk/src/gui/text/text.pri	(revision 95)
@@ -74,4 +74,9 @@
 		text/qfontengine_win.cpp
 	HEADERS += text/qfontengine_win_p.h
+}
+
+os2 {
+	SOURCES += \
+		text/qfont_pm.cpp
 }
 
Index: /trunk/src/gui/util/qdesktopservices_pm.cpp
===================================================================
--- /trunk/src/gui/util/qdesktopservices_pm.cpp	(revision 95)
+++ /trunk/src/gui/util/qdesktopservices_pm.cpp	(revision 95)
@@ -0,0 +1,249 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: Qt Software Information (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial Usage
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
+** package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at qt-sales@nokia.com.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qsettings.h>
+#include <qdir.h>
+#include <qurl.h>
+#include <qstringlist.h>
+#include <qprocess.h>
+#include <qtemporaryfile.h>
+#include <qcoreapplication.h>
+
+#include <windows.h>
+#include <shlobj.h>
+#if !defined(Q_OS_WINCE)
+#  include <intshcut.h>
+#else
+#  include <qguifunctions_wince.h>
+#  if !defined(STANDARDSHELL_UI_MODEL)
+#    include <winx.h>
+#  endif
+#endif
+
+#ifndef QT_NO_DESKTOPSERVICES
+
+QT_BEGIN_NAMESPACE
+
+//#undef UNICODE
+
+static bool openDocument(const QUrl &file)
+{
+    if (!file.isValid())
+        return false;
+
+    quintptr returnValue;
+    QT_WA({
+                returnValue = (quintptr)ShellExecute(0, 0, (TCHAR *)file.toString().utf16(), 0, 0, SW_SHOWNORMAL);
+            } , {
+                returnValue = (quintptr)ShellExecuteA(0, 0, file.toString().toLocal8Bit().constData(), 0, 0, SW_SHOWNORMAL);
+            });
+    return (returnValue > 32); //ShellExecute returns a value greater than 32 if successful
+}
+
+static QString expandEnvStrings(const QString &command)
+{
+
+#if defined(Q_OS_WINCE)
+    return command;
+#else
+    QByteArray path = command.toLocal8Bit();
+    char commandValue[2 * MAX_PATH] = {0};
+    DWORD returnValue = ExpandEnvironmentStringsA(path.data(), commandValue, MAX_PATH);
+    if (returnValue)
+        return QString::fromLocal8Bit(commandValue);
+    else
+        return command;
+#endif
+}
+
+static bool launchWebBrowser(const QUrl &url)
+{
+    if (url.scheme() == QLatin1String("mailto")) {
+        //Retrieve the commandline for the default mail client
+        //the key used below is the command line for the mailto: shell command
+        DWORD  bufferSize = 2 * MAX_PATH;
+        long  returnValue =  -1;
+        QString command;
+
+        HKEY handle;
+        LONG res;
+        QT_WA ({
+            res = RegOpenKeyExW(HKEY_CLASSES_ROOT, L"mailto\\Shell\\Open\\Command", 0, KEY_READ, &handle);
+            if (res != ERROR_SUCCESS)
+                return false;
+
+            wchar_t keyValue[2 * MAX_PATH] = {0};
+            returnValue = RegQueryValueExW(handle, L"", 0, 0, reinterpret_cast<unsigned char*>(keyValue), &bufferSize);
+            if (!returnValue)
+                command = QString::fromRawData((QChar*)keyValue, bufferSize);
+        }, {
+            res = RegOpenKeyExA(HKEY_CLASSES_ROOT, "mailto\\Shell\\Open\\Command", 0, KEY_READ, &handle);
+            if (res != ERROR_SUCCESS)
+                return false;
+
+            char keyValue[2 * MAX_PATH] = {0};
+            returnValue = RegQueryValueExA(handle, "", 0, 0, reinterpret_cast<unsigned char*>(keyValue), &bufferSize);
+            if (!returnValue)
+                command = QString::fromLocal8Bit(keyValue);
+        });
+        RegCloseKey(handle);
+
+        if(returnValue)
+            return false;
+        command = expandEnvStrings(command);
+        command = command.trimmed();
+        //Make sure the path for the process is in quotes
+        int index = -1 ;
+        if (command[0]!= QLatin1Char('\"')) {
+            index = command.indexOf(QLatin1String(".exe "), 0, Qt::CaseInsensitive);
+            command.insert(index+4, QLatin1Char('\"'));
+            command.insert(0, QLatin1Char('\"'));
+        }
+        //pass the url as the parameter
+        index =  command.lastIndexOf(QLatin1String("%1"));
+        if (index != -1){
+            command.replace(index, 2, url.toString());
+        }
+        //start the process
+        PROCESS_INFORMATION pi;
+        ZeroMemory(&pi, sizeof(pi));
+        QT_WA ({
+            STARTUPINFO si;
+            ZeroMemory(&si, sizeof(si));
+            si.cb = sizeof(si);
+
+            returnValue = CreateProcess(NULL, (TCHAR*)command.utf16(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
+        }, {
+            STARTUPINFOA si;
+            ZeroMemory(&si, sizeof(si));
+            si.cb = sizeof(si);
+
+            returnValue = CreateProcessA(NULL, command.toLocal8Bit().data(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
+        });
+
+        if (!returnValue)
+            return false;
+
+        CloseHandle(pi.hProcess);
+        CloseHandle(pi.hThread);
+        return true;
+    }
+
+    if (!url.isValid())
+        return false;
+
+    quintptr returnValue;
+     QT_WA ({
+         returnValue = (quintptr)ShellExecute(0, 0, (TCHAR *) QString::fromUtf8(url.toEncoded().constData()).utf16(), 0, 0, SW_SHOWNORMAL);
+            } , {
+                returnValue = (quintptr)ShellExecuteA(0, 0, url.toEncoded().constData(), 0, 0, SW_SHOWNORMAL);
+            });
+    return (returnValue > 32);
+}
+
+QString QDesktopServices::storageLocation(StandardLocation type)
+{
+#if !defined(QT_NO_SETTINGS)	
+    QSettings settings(QSettings::UserScope, QLatin1String("Microsoft"), QLatin1String("Windows"));
+    settings.beginGroup(QLatin1String("CurrentVersion/Explorer/Shell Folders"));
+    switch (type) {
+    case CacheLocation:
+        // Although Microsoft has a Cache key it is a pointer to IE's cache, not a cache
+        // location for everyone.  Most applications seem to be using a
+        // cache directory located in their AppData directory
+        return storageLocation(DataLocation) + QLatin1String("\\cache");
+    case DataLocation:
+        if (!settings.contains(QLatin1String("Local AppData")))
+            break;
+        return settings.value(QLatin1String("Local AppData")).toString()
+            + QLatin1String("\\") + QCoreApplication::organizationName()
+            + QLatin1String("\\") + QCoreApplication::applicationName();
+        break;
+    case DesktopLocation:
+        return settings.value(QLatin1String("Desktop")).toString();
+        break;
+
+    case DocumentsLocation:
+        return settings.value(QLatin1String("Personal")).toString();
+        break;
+
+    case FontsLocation:
+        return settings.value(QLatin1String("Fonts")).toString();
+        break;
+
+    case ApplicationsLocation:
+        return settings.value(QLatin1String("Programs")).toString();
+        break;
+
+    case MusicLocation:
+        return settings.value(QLatin1String("My Music")).toString();
+        break;
+
+    case MoviesLocation:
+        return settings.value(QLatin1String("My Video")).toString();
+        break;
+
+    case PicturesLocation:
+        return settings.value(QLatin1String("My Pictures")).toString();
+        break;
+
+    case QDesktopServices::HomeLocation:
+        return QDir::homePath(); break;
+
+    case QDesktopServices::TempLocation:
+        return QDir::tempPath(); break;
+
+    default:
+        break;
+    }
+#endif
+    return QString();
+}
+
+QString QDesktopServices::displayName(StandardLocation type)
+{
+    Q_UNUSED(type);
+    return QString();
+}
+
+QT_END_NAMESPACE
+
+#endif // QT_NO_DESKTOPSERVICES
