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
;;
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);
}
/*!
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)
{
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)
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()
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()