# include <qaccessible.h>
#endif
-#if defined(Q_WS_X11)
-#include <limits.h>
-#endif
//#define QABSTRACTSPINBOX_QSBDEBUG
#ifdef QABSTRACTSPINBOX_QSBDEBUG
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:
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();
}
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