summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-26 10:55:01 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-26 10:55:01 (GMT)
commit4837518d3161c77b4e811057d638dcbd22b89195 (patch)
treea0891fcaefa3ee627cace708b59a2a50180434da /src
parent39b861b75566c4db0db3b5aba2aa191a59f10bdb (diff)
parent2eedb392048fdebbb29615345ea3716cebabd451 (diff)
downloadQt-4837518d3161c77b4e811057d638dcbd22b89195.zip
Qt-4837518d3161c77b4e811057d638dcbd22b89195.tar.gz
Qt-4837518d3161c77b4e811057d638dcbd22b89195.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: tst_qxmlstream: fix in shadowbuild QXmlStreamWriter: Auto-formatting does not behave properly with processing instructions. Update the state of the keyboard modifiers on drop events.
Diffstat (limited to 'src')
-rw-r--r--src/corelib/xml/qxmlstream.cpp3
-rw-r--r--src/gui/kernel/qdnd_x11.cpp21
2 files changed, 22 insertions, 2 deletions
diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp
index 1bf00b8..ae12007 100644
--- a/src/corelib/xml/qxmlstream.cpp
+++ b/src/corelib/xml/qxmlstream.cpp
@@ -3716,7 +3716,8 @@ void QXmlStreamWriter::writeProcessingInstruction(const QString &target, const Q
{
Q_D(QXmlStreamWriter);
Q_ASSERT(!data.contains(QLatin1String("?>")));
- d->finishStartElement();
+ if (!d->finishStartElement(false) && d->autoFormatting)
+ d->indent(d->tagStack.size());
d->write("<?");
d->write(target);
if (!data.isNull()) {
diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp
index 2b12317..92dd0a1 100644
--- a/src/gui/kernel/qdnd_x11.cpp
+++ b/src/gui/kernel/qdnd_x11.cpp
@@ -64,6 +64,7 @@
#include "qtextcodec.h"
#include "qdnd_p.h"
+#include "qapplication_p.h"
#include "qt_x11_p.h"
#include "qx11info_x11.h"
@@ -1111,7 +1112,20 @@ void qt_xdnd_send_leave()
waiting_for_status = false;
}
-
+// TODO: remove and use QApplication::currentKeyboardModifiers() in Qt 4.8.
+static Qt::KeyboardModifiers currentKeyboardModifiers()
+{
+ Window root;
+ Window child;
+ int root_x, root_y, win_x, win_y;
+ uint keybstate;
+ for (int i = 0; i < ScreenCount(X11->display); ++i) {
+ if (XQueryPointer(X11->display, QX11Info::appRootWindow(i), &root, &child,
+ &root_x, &root_y, &win_x, &win_y, &keybstate))
+ return X11->translateModifiers(keybstate & 0x00ff);
+ }
+ return 0;
+}
void QX11Data::xdndHandleDrop(QWidget *, const XEvent * xe, bool passive)
{
@@ -1159,6 +1173,11 @@ void QX11Data::xdndHandleDrop(QWidget *, const XEvent * xe, bool passive)
if (!dropData)
dropData = (manager->object) ? manager->dragPrivate()->data : manager->dropData;
+ // Drop coming from another app? Update keyboard modifiers.
+ if (!qt_xdnd_dragging) {
+ QApplicationPrivate::modifier_buttons = currentKeyboardModifiers();
+ }
+
QDropEvent de(qt_xdnd_current_position, possible_actions, dropData,
QApplication::mouseButtons(), QApplication::keyboardModifiers());
QApplication::sendEvent(qt_xdnd_current_widget, &de);