Replace some Q_WS_X11 by check for platform's name.

Change-Id: I33d7ce31e01c355e0d9e05c98d6a84ea4f6d5bbd
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
bb10
Friedemann Kleint 2012-07-16 12:25:49 +02:00 committed by Qt by Nokia
parent 0518a569c7
commit a51f37a430
3 changed files with 10 additions and 15 deletions

View File

@ -62,9 +62,6 @@
# include <qaccessible.h>
#endif
#if defined(Q_WS_X11)
#include <limits.h>
#endif
//#define QABSTRACTSPINBOX_QSBDEBUG
#ifdef QABSTRACTSPINBOX_QSBDEBUG
@ -1014,16 +1011,15 @@ void QAbstractSpinBox::keyPressEvent(QKeyEvent *event)
return;
#endif
#ifdef Q_WS_X11 // only X11
case Qt::Key_U:
if (event->modifiers() & Qt::ControlModifier) {
if (event->modifiers() & Qt::ControlModifier
&& QGuiApplication::platformName() == QLatin1String("xcb")) { // only X11
event->accept();
if (!isReadOnly())
clear();
return;
}
break;
#endif
case Qt::Key_End:
case Qt::Key_Home:

View File

@ -253,14 +253,14 @@ void QWidgetResizeHandler::mouseMoveEvent(QMouseEvent *e)
QPoint p = globalPos + invertedMoveOffset;
QPoint pp = globalPos - moveOffset;
#ifdef Q_WS_X11
// Workaround for window managers which refuse to move a tool window partially offscreen.
QRect desktop = QApplication::desktop()->availableGeometry(widget);
pp.rx() = qMax(pp.x(), desktop.left());
pp.ry() = qMax(pp.y(), desktop.top());
p.rx() = qMin(p.x(), desktop.right());
p.ry() = qMin(p.y(), desktop.bottom());
#endif
if (QGuiApplication::platformName() == QLatin1String("xcb")) {
const QRect desktop = QApplication::desktop()->availableGeometry(widget);
pp.rx() = qMax(pp.x(), desktop.left());
pp.ry() = qMax(pp.y(), desktop.top());
p.rx() = qMin(p.x(), desktop.right());
p.ry() = qMin(p.y(), desktop.bottom());
}
QSize ms = qSmartMinSize(childWidget);
int mw = ms.width();

View File

@ -1271,10 +1271,9 @@ void QWidgetTextControlPrivate::keyPressEvent(QKeyEvent *e)
}
else if (e == QKeySequence::Paste) {
QClipboard::Mode mode = QClipboard::Clipboard;
#ifdef Q_WS_X11
if (QGuiApplication::platformName() == QLatin1String("xcb"))
if (e->modifiers() == (Qt::CTRL | Qt::SHIFT) && e->key() == Qt::Key_Insert)
mode = QClipboard::Selection;
#endif
q->paste(mode);
}
#endif