diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/accessible/qaccessible2.h | 12 | ||||
-rw-r--r-- | src/gui/image/qimage.h | 21 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qplatformintegration_qpa.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qplatformintegration_qpa.h | 3 | ||||
-rw-r--r-- | src/gui/kernel/qplatformwindow_qpa.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qstylehints.cpp | 5 | ||||
-rw-r--r-- | src/gui/kernel/qstylehints.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 24 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface_qpa.cpp | 4 | ||||
-rw-r--r-- | src/gui/opengl/qopenglpaintengine_p.h | 2 | ||||
-rw-r--r-- | src/gui/painting/qblittable_p.h | 2 | ||||
-rw-r--r-- | src/gui/painting/qcosmeticstroker_p.h | 2 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper_p.h | 6 | ||||
-rw-r--r-- | src/gui/painting/qmemrotate.cpp | 1 | ||||
-rw-r--r-- | src/gui/text/qtextengine_p.h | 2 | ||||
-rw-r--r-- | src/gui/util/qdesktopservices.cpp | 18 | ||||
-rw-r--r-- | src/gui/util/qdesktopservices.h | 4 |
19 files changed, 83 insertions, 35 deletions
diff --git a/src/gui/accessible/qaccessible2.h b/src/gui/accessible/qaccessible2.h index 56a39b640d..dcac22e5bb 100644 --- a/src/gui/accessible/qaccessible2.h +++ b/src/gui/accessible/qaccessible2.h @@ -56,12 +56,6 @@ class QModelIndex; namespace QAccessible2 { - enum CoordinateType - { - RelativeToScreen = 0, - RelativeToParent = 1 - }; - enum BoundaryType { CharBoundary, WordBoundary, @@ -80,9 +74,9 @@ public: virtual void addSelection(int startOffset, int endOffset) = 0; virtual QString attributes(int offset, int *startOffset, int *endOffset) const = 0; virtual int cursorPosition() const = 0; - virtual QRect characterRect(int offset, QAccessible2::CoordinateType coordType) const = 0; + virtual QRect characterRect(int offset) const = 0; virtual int selectionCount() const = 0; - virtual int offsetAtPoint(const QPoint &point, QAccessible2::CoordinateType coordType) const = 0; + virtual int offsetAtPoint(const QPoint &point) const = 0; virtual void selection(int selectionIndex, int *startOffset, int *endOffset) const = 0; virtual QString text(int startOffset, int endOffset) const = 0; virtual QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType, @@ -249,7 +243,7 @@ public: virtual QString imageDescription() const = 0; virtual QSize imageSize() const = 0; - virtual QRect imagePosition(QAccessible2::CoordinateType coordType) const = 0; + virtual QRect imagePosition() const = 0; }; #endif // QT_NO_ACCESSIBILITY diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index e9192f1031..6acc03f4bd 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -70,10 +70,10 @@ struct QImageData; class QImageDataMisc; // internal #ifndef QT_NO_IMAGE_TEXT #if QT_DEPRECATED_SINCE(5, 0) -class QT_DEPRECATED QImageTextKeyLang { +class QImageTextKeyLang { public: - QImageTextKeyLang(const char* k, const char* l) : key(k), lang(l) { } - QImageTextKeyLang() { } + QT_DEPRECATED QImageTextKeyLang(const char* k, const char* l) : key(k), lang(l) { } + QT_DEPRECATED QImageTextKeyLang() { } QByteArray key; QByteArray lang; @@ -315,6 +315,14 @@ Q_GUI_EXPORT_INLINE void QImage::setPixel(const QPoint &pt, uint index_or_rgb) { #if QT_DEPRECATED_SINCE(5, 0) #ifndef QT_NO_IMAGE_TEXT + +#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#elif defined(Q_CC_MSVC) +# pragma warning(disable: 4996) +#endif + inline QString QImage::text(const char* key, const char* lang) const { if (!d) @@ -384,6 +392,13 @@ inline void QImage::setText(const char* key, const char* lang, const QString &s) k += QLatin1Char('/') + QString::fromAscii(lang); setText(k, s); } + +#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) +# pragma GCC diagnostic pop +#elif defined(Q_CC_MSVC) +# pragma warning(default: 4996) +#endif + #endif inline int QImage::numColors() const diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 9b0973afb2..57238f362f 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -996,6 +996,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo } QWindow *window = e->window.data(); + modifier_buttons = e->modifiers; if (!window) window = QGuiApplication::topLevelAt(e->globalPos.toPoint()); @@ -1098,6 +1099,7 @@ void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wh QPointF globalPoint = e->globalPos; QGuiApplicationPrivate::lastCursorPosition = globalPoint; + modifier_buttons = e->modifiers; QWindow *window = e->window.data(); @@ -1114,6 +1116,7 @@ void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wh void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent *e) { QWindow *window = e->window.data(); + modifier_buttons = e->modifiers; if (e->nullWindow) window = QGuiApplication::activeWindow(); if (!window) @@ -1271,6 +1274,7 @@ Q_GUI_EXPORT bool operator==(const QGuiApplicationPrivate::ActiveTouchPointsKey void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent *e) { QGuiApplicationPrivate *d = self; + modifier_buttons = e->modifiers; if (e->touchType == QEvent::TouchCancel) { // The touch sequence has been canceled (e.g. by the compositor). diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp index 786e915a19..6879f0517e 100644 --- a/src/gui/kernel/qplatformintegration_qpa.cpp +++ b/src/gui/kernel/qplatformintegration_qpa.cpp @@ -291,6 +291,8 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const return 500; case ShowIsFullScreen: return false; + case PasswordMaskDelay: + return 0; } return 0; diff --git a/src/gui/kernel/qplatformintegration_qpa.h b/src/gui/kernel/qplatformintegration_qpa.h index 632b3af613..68dfc21833 100644 --- a/src/gui/kernel/qplatformintegration_qpa.h +++ b/src/gui/kernel/qplatformintegration_qpa.h @@ -121,7 +121,8 @@ public: StartDragDistance, StartDragTime, KeyboardAutoRepeatRate, - ShowIsFullScreen + ShowIsFullScreen, + PasswordMaskDelay }; virtual QVariant styleHint(StyleHint hint) const; diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp index c8e2776366..227059e24e 100644 --- a/src/gui/kernel/qplatformwindow_qpa.cpp +++ b/src/gui/kernel/qplatformwindow_qpa.cpp @@ -170,7 +170,7 @@ Qt::WindowFlags QPlatformWindow::setWindowFlags(Qt::WindowFlags flags) bool QPlatformWindow::isExposed() const { Q_D(const QPlatformWindow); - return d->window->visible(); + return d->window->isVisible(); } /*! diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp index 15fcec21d8..4970f6a26b 100644 --- a/src/gui/kernel/qstylehints.cpp +++ b/src/gui/kernel/qstylehints.cpp @@ -96,4 +96,9 @@ bool QStyleHints::showIsFullScreen() const return hint(QPlatformIntegration::ShowIsFullScreen).toBool(); } +int QStyleHints::passwordMaskDelay() const +{ + return hint(QPlatformIntegration::PasswordMaskDelay).toInt(); +} + QT_END_NAMESPACE diff --git a/src/gui/kernel/qstylehints.h b/src/gui/kernel/qstylehints.h index 0fc7e776b5..ae51ebc052 100644 --- a/src/gui/kernel/qstylehints.h +++ b/src/gui/kernel/qstylehints.h @@ -62,6 +62,8 @@ public: int keyboardAutoRepeatRate() const; int cursorFlashTime() const; bool showIsFullScreen() const; + int passwordMaskDelay() const; + private: friend class QGuiApplication; QStyleHints(); diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index d72cc991d7..85f619db31 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -52,6 +52,7 @@ #include "qwindow_p.h" #include "qguiapplication_p.h" +#include "qaccessible.h" #include <private/qevent_p.h> @@ -746,9 +747,6 @@ void QWindow::setWindowState(Qt::WindowState state) void QWindow::setTransientParent(QWindow *parent) { Q_D(QWindow); - - QWindow *previousParent = d->transientParent; - d->transientParent = parent; } @@ -1454,13 +1452,25 @@ bool QWindow::event(QEvent *ev) keyReleaseEvent(static_cast<QKeyEvent *>(ev)); break; - case QEvent::FocusIn: + case QEvent::FocusIn: { focusInEvent(static_cast<QFocusEvent *>(ev)); - break; +#ifndef QT_NO_ACCESSIBILITY + QAccessible::State state; + state.active = true; + QAccessibleStateChangeEvent event(this, state); + QAccessible::updateAccessibility(&event); +#endif + break; } - case QEvent::FocusOut: + case QEvent::FocusOut: { focusOutEvent(static_cast<QFocusEvent *>(ev)); - break; +#ifndef QT_NO_ACCESSIBILITY + QAccessible::State state; + state.active = true; + QAccessibleStateChangeEvent event(this, state); + QAccessible::updateAccessibility(&event); +#endif + break; } #ifndef QT_NO_WHEELEVENT case QEvent::Wheel: diff --git a/src/gui/kernel/qwindowsysteminterface_qpa.cpp b/src/gui/kernel/qwindowsysteminterface_qpa.cpp index bcbf96b2c0..e49edf0b98 100644 --- a/src/gui/kernel/qwindowsysteminterface_qpa.cpp +++ b/src/gui/kernel/qwindowsysteminterface_qpa.cpp @@ -159,6 +159,8 @@ bool QWindowSystemInterface::tryHandleSynchronousShortcutEvent(QWindow *w, int k bool QWindowSystemInterface::tryHandleSynchronousShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count) { + QGuiApplicationPrivate::modifier_buttons = mods; + QKeyEvent qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count); qevent.setTimestamp(timestamp); return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(w, &qevent); @@ -176,6 +178,8 @@ bool QWindowSystemInterface::tryHandleSynchronousExtendedShortcutEvent(QWindow * quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, const QString &text, bool autorep, ushort count) { + QGuiApplicationPrivate::modifier_buttons = mods; + QKeyEventEx qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count, nativeScanCode, nativeVirtualKey, nativeModifiers); qevent.setTimestamp(timestamp); return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(w, &qevent); diff --git a/src/gui/opengl/qopenglpaintengine_p.h b/src/gui/opengl/qopenglpaintengine_p.h index 1b3dfbae28..8b49ec250f 100644 --- a/src/gui/opengl/qopenglpaintengine_p.h +++ b/src/gui/opengl/qopenglpaintengine_p.h @@ -199,7 +199,7 @@ public: void updateBrushUniforms(); void updateMatrix(); void updateCompositionMode(); - void updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform, GLuint id = -1); + void updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform, GLuint id = GLuint(-1)); void resetGLState(); diff --git a/src/gui/painting/qblittable_p.h b/src/gui/painting/qblittable_p.h index 0d2f6983d4..c36de8fa08 100644 --- a/src/gui/painting/qblittable_p.h +++ b/src/gui/painting/qblittable_p.h @@ -64,7 +64,7 @@ public: SourceOverScaledPixmapCapability = 0x0008, // Internal ones - OutlineCapability = 0x0001000, + OutlineCapability = 0x0001000 }; Q_DECLARE_FLAGS (Capabilities, Capability); diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h index 86e811c5f6..7a1221c1a7 100644 --- a/src/gui/painting/qcosmeticstroker_p.h +++ b/src/gui/painting/qcosmeticstroker_p.h @@ -72,7 +72,7 @@ public: enum Caps { NoCaps = 0, CapBegin = 0x1, - CapEnd = 0x2, + CapEnd = 0x2 }; // used to avoid drop outs or duplicated points diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 035f56b35e..7571d81a36 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -814,7 +814,6 @@ template<TextureBlendType blendType> void fetchTransformedBilinear_pixelBounds(int max, int l1, int l2, int &v1, int &v2); template<> -Q_STATIC_TEMPLATE_SPECIALIZATION inline void fetchTransformedBilinear_pixelBounds<BlendTransformedBilinearTiled>(int max, int, int, int &v1, int &v2) { v1 %= max; @@ -828,7 +827,6 @@ inline void fetchTransformedBilinear_pixelBounds<BlendTransformedBilinearTiled>( } template<> -Q_STATIC_TEMPLATE_SPECIALIZATION inline void fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(int, int l1, int l2, int &v1, int &v2) { if (v1 < l1) diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index 2e88fe718a..442fd8bcd7 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -67,12 +67,6 @@ QT_BEGIN_NAMESPACE -#if defined(Q_CC_MSVC) && _MSCVER <= 1300 && !defined(Q_CC_INTEL) -#define Q_STATIC_TEMPLATE_SPECIALIZATION static -#else -#define Q_STATIC_TEMPLATE_SPECIALIZATION -#endif - #if defined(Q_CC_RVCT) // RVCT doesn't like static template functions # define Q_STATIC_TEMPLATE_FUNCTION diff --git a/src/gui/painting/qmemrotate.cpp b/src/gui/painting/qmemrotate.cpp index e6fcc3e5dd..6f4dc5b358 100644 --- a/src/gui/painting/qmemrotate.cpp +++ b/src/gui/painting/qmemrotate.cpp @@ -423,7 +423,6 @@ inline void qt_memrotate270_template(const T *src, int srcWidth, int srcHeight, } template <> -Q_STATIC_TEMPLATE_SPECIALIZATION inline void qt_memrotate90_template<quint24>(const quint24 *src, int srcWidth, int srcHeight, int srcStride, quint24 *dest, int dstStride) { diff --git a/src/gui/text/qtextengine_p.h b/src/gui/text/qtextengine_p.h index 03581eb6a2..aac2390943 100644 --- a/src/gui/text/qtextengine_p.h +++ b/src/gui/text/qtextengine_p.h @@ -425,7 +425,7 @@ public: enum LayoutState { LayoutEmpty, InLayout, - LayoutFailed, + LayoutFailed }; struct Q_GUI_EXPORT LayoutData { LayoutData(const QString &str, void **stack_memory, int mem_size); diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index 25fb08f532..1a6661440c 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -54,6 +54,7 @@ #include <qmutex.h> #include <qplatformservices_qpa.h> #include <qplatformintegration_qpa.h> +#include <qdir.h> QT_BEGIN_NAMESPACE @@ -283,6 +284,23 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme) Use QStandardPaths::displayName() */ + +QString QDesktopServices::storageLocationImpl(StandardLocation type) +{ +#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) + if (type == DataLocation) { + QString xdgDataHome = QLatin1String(qgetenv("XDG_DATA_HOME")); + if (xdgDataHome.isEmpty()) + xdgDataHome = QDir::homePath() + QLatin1String("/.local/share"); + xdgDataHome += QLatin1String("/data/") + + QCoreApplication::organizationName() + QLatin1Char('/') + + QCoreApplication::applicationName(); + return xdgDataHome; + } +#endif + return QStandardPaths::writableLocation(static_cast<QStandardPaths::StandardLocation>(type)); +} + QT_END_NAMESPACE #include "qdesktopservices.moc" diff --git a/src/gui/util/qdesktopservices.h b/src/gui/util/qdesktopservices.h index 04a639437e..280acaf277 100644 --- a/src/gui/util/qdesktopservices.h +++ b/src/gui/util/qdesktopservices.h @@ -79,12 +79,14 @@ public: }; QT_DEPRECATED static QString storageLocation(StandardLocation type) { - return QStandardPaths::writableLocation(static_cast<QStandardPaths::StandardLocation>(type)); + return storageLocationImpl(type); } QT_DEPRECATED static QString displayName(StandardLocation type) { return QStandardPaths::displayName(static_cast<QStandardPaths::StandardLocation>(type)); } #endif +private: + static QString storageLocationImpl(StandardLocation type); }; #endif // QT_NO_DESKTOPSERVICES |