Merge remote-tracking branch 'origin/master' into api_changes
authorLars Knoll <lars.knoll@nokia.com>
Mon, 16 Apr 2012 10:04:34 +0000 (12:04 +0200)
committerLars Knoll <lars.knoll@nokia.com>
Mon, 16 Apr 2012 10:04:34 +0000 (12:04 +0200)
Conflicts:
configure
src/corelib/io/qurl.cpp
src/gui/kernel/qwindow.cpp
src/tools/moc/generator.cpp
src/widgets/kernel/qwidget_qpa.cpp
src/widgets/styles/qstyle.h
src/widgets/widgets/qtabbar.cpp
tests/auto/corelib/codecs/utf8/tst_utf8.cpp

Change-Id: Ia457228d6f684ec8184e13e8fcc9d25857b1751e

57 files changed:
1  2 
configure
src/corelib/global/qcompilerdetection.h
src/corelib/global/qglobal.cpp
src/corelib/global/qglobal.h
src/corelib/global/qnamespace.h
src/corelib/io/io.pri
src/corelib/json/qjsonvalue.cpp
src/corelib/kernel/qcoreevent.cpp
src/corelib/kernel/qobject.cpp
src/corelib/kernel/qobject.h
src/corelib/kernel/qobjectdefs.h
src/corelib/tools/qbytearray.h
src/corelib/tools/qstring.cpp
src/gui/kernel/qguiapplication.cpp
src/gui/kernel/qguiapplication_p.h
src/gui/kernel/qkeysequence.cpp
src/gui/kernel/qopenglcontext.h
src/gui/kernel/qplatformwindow_qpa.cpp
src/gui/kernel/qwindow.cpp
src/gui/kernel/qwindow.h
src/gui/kernel/qwindow_p.h
src/gui/opengl/qopenglfunctions.h
src/gui/painting/painting.pri
src/gui/painting/qpaintengineex_p.h
src/gui/text/qtextengine.cpp
src/gui/text/qtextoption.h
src/network/access/qnetworkaccessmanager.cpp
src/network/access/qnetworkreplyhttpimpl.cpp
src/network/ssl/qsslsocket.h
src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
src/plugins/platforms/windows/qwindowswindow.cpp
src/plugins/platforms/xcb/qxcbwindow.cpp
src/plugins/platforms/xcb/qxcbwindow.h
src/sql/drivers/odbc/qsql_odbc.cpp
src/tools/moc/generator.cpp
src/tools/moc/preprocessor.cpp
src/widgets/itemviews/qheaderview.cpp
src/widgets/kernel/qapplication.cpp
src/widgets/kernel/qapplication.h
src/widgets/kernel/qapplication_qpa.cpp
src/widgets/kernel/qwidget.cpp
src/widgets/kernel/qwidget.h
src/widgets/kernel/qwidget_qpa.cpp
src/widgets/kernel/qwidgetbackingstore.cpp
src/widgets/kernel/qwidgetwindow_qpa.cpp
src/widgets/styles/qstyle.h
src/widgets/styles/qwindowsxpstyle.cpp
src/widgets/widgets/qmenu.h
src/xml/sax/qxml.h
tests/auto/corelib/codecs/utf8/tst_utf8.cpp
tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp
tests/auto/corelib/kernel/qobject/tst_qobject.cpp
tests/auto/other/qaccessibility/tst_qaccessibility.cpp
tests/auto/tools/moc/tst_moc.cpp
tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
tests/auto/xml/dom/qdom/tst_qdom.cpp

diff --cc configure
+++ b/configure
@@@ -887,7 -892,7 +889,7 @@@ while [ "$#" -gt 0 ]; d
          VAL=no
          ;;
      #Qt style yes options
-     -profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-eglfs|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-exceptions|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-qml-debug|-javascript-jit|-rpath|-force-pkg-config|-icu|-force-asserts|-testcocoon)
 -    -profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-eglfs|-directfb|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-exceptions|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-qml-debug|-javascript-jit|-rpath|-pkg-config|-force-pkg-config|-icu|-force-asserts|-testcocoon)
++    -profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-eglfs|-directfb|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-exceptions|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-qml-debug|-javascript-jit|-rpath|-pkg-config|-force-pkg-config|-icu|-force-asserts|-testcocoon)
          VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
          VAL=yes
          ;;
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -1128,10 -1272,13 +1263,14 @@@ void QGuiApplicationPrivate::processKey
          window = QGuiApplication::activeWindow();
      if (!window)
          return;
+     if (window->d_func()->blockedByModalWindow) {
+         // a modal window is blocking this window, don't allow key events through
+         return;
+     }
  
 -    QKeyEventEx ev(e->keyType, e->key, e->modifiers, e->unicode, e->repeat, e->repeatCount,
 -                   e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers);
 +    QKeyEvent ev(e->keyType, e->key, e->modifiers,
 +                 e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers,
 +                 e->unicode, e->repeat, e->repeatCount);
      ev.setTimestamp(e->timestamp);
      QGuiApplication::sendSpontaneousEvent(window, &ev);
  }
Simple merge
Simple merge
Simple merge
@@@ -1396,10 -1379,7 +1399,10 @@@ void QWindow::resizeEvent(QResizeEvent 
  /*!
      Override this to handle show events.
  
-     The show event is called when the window has requested becoming visible.
 -    This function is called when the window becomes visible in the windowing system.
++    The function is called when the window has requested becoming visible.
 +
 +    If the window is successfully shown by the windowing system, this will
 +    be followed by a resize and an expose event.
  */
  void QWindow::showEvent(QShowEvent *ev)
  {
  }
  
  /*!
 -    Override this to handle hide events.
 +    Override this to handle hide evens.
  
-     The hide event is called when the window has requested being hidden in the
 -    This function is called when the window becomes hidden in the windowing system.
++    The function is called when the window has requested being hidden in the
 +    windowing system.
  */
  void QWindow::hideEvent(QHideEvent *ev)
  {
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -1213,11 -1036,17 +1213,17 @@@ void Generator::generateSignal(Function
          fprintf(out, "%s _t%d%s", a.type.name.constData(), offset++, a.rightType.constData());
      }
      fprintf(out, ")%s\n{\n", constQualifier);
-     if (def->type.name.size() && def->normalizedType != "void")
-         fprintf(out, "    %s _t0 = %s();\n", noRef(def->normalizedType).constData(), noRef(def->normalizedType).constData());
 -    if (def->type.name.size() && def->normalizedType.size()) {
++    if (def->type.name.size() && def->normalizedType != "void") {
+         QByteArray returnType = noRef(def->normalizedType);
+         if (returnType.endsWith('*')) {
+             fprintf(out, "    %s _t0 = 0;\n", returnType.constData());
+         } else {
+             fprintf(out, "    %s _t0 = %s();\n", returnType.constData(), returnType.constData());
+         }
+     }
  
      fprintf(out, "    void *_a[] = { ");
 -    if (def->normalizedType.isEmpty()) {
 +    if (def->normalizedType == "void") {
          fprintf(out, "0");
      } else {
          if (def->returnTypeIsVolatile)
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -440,9 -440,16 +440,16 @@@ static inline QRect positionTopLevelWin
  void QWidgetPrivate::show_sys()
  {
      Q_Q(QWidget);
 -    q->setAttribute(Qt::WA_Mapped);
+     QWindow *window = q->windowHandle();
      if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
          invalidateBuffer(q->rect());
 +        q->setAttribute(Qt::WA_Mapped);
+         if (q->isWindow() && q->windowModality() != Qt::NonModal && window) {
+             // add our window to the modal window list
+             QGuiApplicationPrivate::showModalWindow(window);
+         }
          return;
      }
  
  void QWidgetPrivate::hide_sys()
  {
      Q_Q(QWidget);
 -    q->setAttribute(Qt::WA_Mapped, false);
+     QWindow *window = q->windowHandle();
+     if (q->testAttribute(Qt::WA_DontShowOnScreen)
+         && q->isWindow()
+         && q->windowModality() != Qt::NonModal
+         && window) {
+         // remove our window from the modal window list
+         QGuiApplicationPrivate::hideModalWindow(window);
+     }
      deactivateWidgetCleanup();
 +
      if (!q->isWindow()) {
          QWidget *p = q->parentWidget();
          if (p &&p->isVisible()) {
          return;
      }
  
 -    if (window)
 -        window->setVisible(false);
 +    invalidateBuffer(q->rect());
 +
 +    if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
 +        q->setAttribute(Qt::WA_Mapped, false);
-     } else if (QWindow *window = q->windowHandle()) {
++    } else if (window) {
 +         window->setVisible(false);
 +    }
  }
  
  void QWidgetPrivate::setMaxWindowState_helper()
Simple merge
Simple merge
Simple merge
@@@ -233,8 -313,37 +233,40 @@@ void tst_Utf8::nonCharacters_data(
      QTest::addColumn<QByteArray>("utf8");
      QTest::addColumn<QString>("utf16");
  
+     // Unicode has a couple of "non-characters" that one can use internally,
+     // but are not allowed to be used for text interchange.
+     //
+     // Those are the last two entries each Unicode Plane (U+FFFE, U+FFFF,
+     // U+1FFFE, U+1FFFF, etc.) as well as the entries between U+FDD0 and
+     // U+FDEF (inclusive)
+     // U+FDD0 through U+FDEF
+     for (int i = 0; i < 32; ++i) {
+         char utf8[] = { char(0357), char(0267), char(0220 + i), 0 };
+         QString utf16 = QChar(0xfdd0 + i);
+         QTest::newRow(qPrintable(QString::number(0xfdd0 + i, 16))) << QByteArray(utf8) << utf16;
+     }
+     // the last two in Planes 1 through 16
+     for (uint plane = 1; plane <= 16; ++plane) {
+         for (uint lower = 0xfffe; lower < 0x10000; ++lower) {
+             uint ucs4 = (plane << 16) | lower;
+             char utf8[] = { char(0xf0 | uchar(ucs4 >> 18)),
+                             char(0x80 | (uchar(ucs4 >> 12) & 0x3f)),
+                             char(0x80 | (uchar(ucs4 >> 6) & 0x3f)),
+                             char(0x80 | (uchar(ucs4) & 0x3f)),
+                             0 };
+             ushort utf16[] = { QChar::highSurrogate(ucs4), QChar::lowSurrogate(ucs4), 0 };
+             QTest::newRow(qPrintable(QString::number(ucs4, 16))) << QByteArray(utf8) << QString::fromUtf16(utf16);
+         }
+     }
+     QTest::newRow("fffe") << QByteArray("\xEF\xBF\xBE") << QString(QChar(0xfffe));
+     QTest::newRow("ffff") << QByteArray("\xEF\xBF\xBF") << QString(QChar(0xffff));
++
 +    extern void loadNonCharactersRows();
 +    loadNonCharactersRows();
  }
  
  void tst_Utf8::nonCharacters()
Simple merge
Simple merge