diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/Qt5GuiConfigExtras.cmake.in | 108 | ||||
-rw-r--r-- | src/gui/accessible/qaccessible.h | 5 | ||||
-rw-r--r-- | src/gui/gui.pro | 39 | ||||
-rw-r--r-- | src/gui/image/qicon.cpp | 5 | ||||
-rw-r--r-- | src/gui/image/qiconloader.cpp | 9 | ||||
-rw-r--r-- | src/gui/kernel/qevent.cpp | 8 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 7 | ||||
-rw-r--r-- | src/gui/kernel/qkeysequence.cpp | 13 | ||||
-rw-r--r-- | src/gui/kernel/qopenglcontext.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 8 | ||||
-rw-r--r-- | src/gui/kernel/qwindow.h | 6 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.cpp | 4 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qwindowsysteminterface_p.h | 6 | ||||
-rw-r--r-- | src/gui/opengl/qopengltimerquery.h | 2 | ||||
-rw-r--r-- | src/gui/opengl/qopenglvertexarrayobject.h | 2 |
16 files changed, 198 insertions, 28 deletions
diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index d9313d4364..f385fa0f6e 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -1,5 +1,48 @@ -!!IF !contains(QT_CONFIG, angle) +!!IF !isEmpty(CMAKE_ANGLE_EGL_DLL_RELEASE) + +!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE) +set(Qt5Gui_EGL_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\") +!!ELSE +set(Qt5Gui_EGL_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\") +!!ENDIF + +set(Qt5Gui_OPENGL_INCLUDE_DIRS ${Qt5Gui_EGL_INCLUDE_DIRS}) + +macro(_populate_qt5gui_gl_target_properties TargetName Configuration LIB_LOCATION IMPLIB_LOCATION) + set_property(TARGET Qt5::${TargetName} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration}) + + set_target_properties(Qt5::${TargetName} PROPERTIES +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) + \"IMPORTED_LOCATION_${Configuration}\" \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${LIB_LOCATION}\" +!!ELSE + \"IMPORTED_LOCATION_${Configuration}\" \"$${CMAKE_LIB_DIR}${LIB_LOCATION}\" +!!ENDIF +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) + \"IMPORTED_IMPLIB_${Configuration}\" \"${_qt5Gui_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\" +!!ELSE + \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\" +!!ENDIF + ) +endmacro() + +add_library(Qt5::Gui_EGL SHARED IMPORTED) +_populate_qt5gui_gl_target_properties(Gui_EGL RELEASE $${CMAKE_ANGLE_EGL_DLL_RELEASE} $${CMAKE_ANGLE_EGL_IMPLIB_RELEASE}) +add_library(Qt5::Gui_GLESv2 SHARED IMPORTED) +_populate_qt5gui_gl_target_properties(Gui_GLESv2 RELEASE $${CMAKE_ANGLE_GLES2_DLL_RELEASE} $${CMAKE_ANGLE_GLES2_IMPLIB_RELEASE}) + +set_property(TARGET Qt5::Gui_EGL APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_EGL_INCLUDE_DIRS}) +set_property(TARGET Qt5::Gui_GLESv2 APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_OPENGL_INCLUDE_DIRS}) + +!!IF !isEmpty(CMAKE_DEBUG_TYPE) +_populate_qt5gui_gl_target_properties(Gui_EGL DEBUG $${CMAKE_ANGLE_EGL_DLL_DEBUG} $${CMAKE_ANGLE_EGL_IMPLIB_DEBUG}) +_populate_qt5gui_gl_target_properties(Gui_GLESv2 DEBUG $${CMAKE_ANGLE_GLES2_DLL_DEBUG} $${CMAKE_ANGLE_GLES2_IMPLIB_DEBUG}) +!!ENDIF + +set(Qt5Gui_EGL_LIBRARIES Qt5::Gui_EGL) +set(Qt5Gui_OPENGL_LIBRARIES Qt5::Gui_GLESv2) + +!!ELSE !!IF !isEmpty(CMAKE_GL_INCDIRS) @@ -17,4 +60,67 @@ unset(_qt5gui_OPENGL_INCLUDE_DIR CACHE) !!ENDIF +macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) + set(Qt5Gui_${Name}_LIBRARIES) + set(Qt5Gui_EGL_INCLUDE_DIRS ${IncDirs}) + foreach(_lib ${Libs}) + string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _cmake_lib_name ${_lib}) + if (NOT TARGET Qt5::Gui_${_cmake_lib_name}) + find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY ${_lib} +!!IF !isEmpty(CROSS_COMPILE) + PATHS \"${LibDir}\" NO_DEFAULT_PATH +!!ENDIF + ) +!!IF mac + set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}") +!!ENDIF + if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY) + message(FATAL_ERROR \"Failed to find \\\"${_lib}\\\" in \\\"${LibDir}\\\", using the CMAKE_FIND_ROOT_PATH \\\"${CMAKE_FIND_ROOT_PATH}\\\".\") + endif() + add_library(Qt5::Gui_${_cmake_lib_name} SHARED IMPORTED) + set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${IncDirs}) + + set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_LOCATION_RELEASE \"${Qt5Gui_${_cmake_lib_name}_LIBRARY}\") +!!IF !isEmpty(CMAKE_WINDOWS_BUILD) + set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_IMPLIB_RELEASE \"${Qt5Gui_${_cmake_lib_name}_LIBRARY}\") +!!ENDIF + unset(Qt5Gui_${_cmake_lib_name}_LIBRARY CACHE) + + find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG ${_lib}d + PATHS \"${LibDir}\" NO_DEFAULT_PATH) + if (Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG) + set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_LOCATION_DEBUG \"${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}\") +!!IF !isEmpty(CMAKE_WINDOWS_BUILD) + set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_IMPLIB_DEBUG \"${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}\") +!!ENDIF + endif() + unset(Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG CACHE) + endif() + list(APPEND Qt5Gui_${Name}_LIBRARIES Qt5::Gui_${_cmake_lib_name}) + endforeach() +endmacro() + + +!!IF !isEmpty(CMAKE_EGL_LIBS) +_qt5gui_find_extra_libs(EGL \"$$CMAKE_EGL_LIBS\" \"$$CMAKE_EGL_LIBDIR\" \"$$CMAKE_EGL_INCDIRS\") +!!ENDIF + +!!IF !isEmpty(CMAKE_OPENGL_LIBS) +_qt5gui_find_extra_libs(OPENGL \"$$CMAKE_OPENGL_LIBS\" \"$$CMAKE_OPENGL_LIBDIR\" \"$$CMAKE_OPENGL_INCDIRS\") + !!ENDIF + +!!ENDIF + +set(Qt5Gui_OPENGL_IMPLEMENTATION $$CMAKE_QT_OPENGL_IMPLEMENTATION) + +get_target_property(_configs Qt5::Gui IMPORTED_CONFIGURATIONS) +foreach(_config ${_configs}) + set_property(TARGET Qt5::Gui APPEND PROPERTY + IMPORTED_LINK_DEPENDENT_LIBRARIES_${_config} + ${Qt5Gui_EGL_LIBRARIES} ${Qt5Gui_OPENGL_LIBRARIES} + ) +endforeach() +unset(_configs) diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index 339e3fbcd6..283209d08f 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -66,11 +66,8 @@ class QTextCursor; // We need to inherit QObject to expose the enums to QML. class Q_GUI_EXPORT QAccessible -#ifndef Q_QDOC - :public QObject -#endif { - Q_OBJECT + Q_GADGET Q_ENUMS(Role Event State) public: diff --git a/src/gui/gui.pro b/src/gui/gui.pro index 9238fd91a4..062f00c4c4 100644 --- a/src/gui/gui.pro +++ b/src/gui/gui.pro @@ -37,18 +37,49 @@ QMAKE_LIBS += $$QMAKE_LIBS_GUI load(cmake_functions) -!contains(QT_CONFIG, angle) { +win32: CMAKE_WINDOWS_BUILD = True + +contains(QT_CONFIG, angle) { + CMAKE_GL_INCDIRS = $$CMAKE_INCLUDE_DIR + CMAKE_ANGLE_EGL_DLL_RELEASE = libEGL.dll + CMAKE_ANGLE_EGL_IMPLIB_RELEASE = libEGL.lib + CMAKE_ANGLE_GLES2_DLL_RELEASE = libGLESv2.dll + CMAKE_ANGLE_GLES2_IMPLIB_RELEASE = libGLESv2.lib + CMAKE_ANGLE_EGL_DLL_DEBUG = libEGLd.dll + CMAKE_ANGLE_EGL_IMPLIB_DEBUG = libEGLd.lib + CMAKE_ANGLE_GLES2_DLL_DEBUG = libGLESv2d.dll + CMAKE_ANGLE_GLES2_IMPLIB_DEBUG = libGLESv2d.lib + + CMAKE_QT_OPENGL_IMPLEMENTATION = GLESv2 +} else { + CMAKE_EGL_LIBS = $$cmakeProcessLibs($$QMAKE_LIBS_EGL) + !isEmpty(QMAKE_LIBDIR_EGL): CMAKE_EGL_LIBDIR += $$cmakeTargetPath($$QMAKE_LIBDIR_EGL) + contains(QT_CONFIG, opengles1) { - CMAKE_GL_INCDIRS = $$cmakeTargetPaths($$QMAKE_INCDIR_OPENGL_ES1) + !isEmpty(QMAKE_INCDIR_OPENGL_ES1): CMAKE_GL_INCDIRS = $$cmakeTargetPaths($$QMAKE_INCDIR_OPENGL_ES1) + CMAKE_OPENGL_INCDIRS = $$cmakePortablePaths($$QMAKE_INCDIR_OPENGL_ES1) + CMAKE_OPENGL_LIBS = $$cmakeProcessLibs($$QMAKE_LIBS_OPENGL_ES1) + !isEmpty(QMAKE_LIBDIR_OPENGL_ES1): CMAKE_OPENGL_LIBDIR = $$cmakePortablePaths($$QMAKE_LIBDIR_OPENGL_ES1) CMAKE_GL_HEADER_NAME = GLES/gl.h + CMAKE_QT_OPENGL_IMPLEMENTATION = GLES } else:contains(QT_CONFIG, opengles2) { - CMAKE_GL_INCDIRS = $$cmakeTargetPaths($$QMAKE_INCDIR_OPENGL_ES2) + !isEmpty(QMAKE_INCDIR_OPENGL_ES2): CMAKE_GL_INCDIRS = $$cmakeTargetPaths($$QMAKE_INCDIR_OPENGL_ES2) + CMAKE_OPENGL_INCDIRS = $$cmakePortablePaths($$QMAKE_INCDIR_OPENGL_ES2) + CMAKE_OPENGL_LIBS = $$cmakeProcessLibs($$QMAKE_LIBS_OPENGL_ES2) + !isEmpty(QMAKE_LIBDIR_OPENGL_ES2): CMAKE_OPENGL_LIBDIR = $$cmakePortablePaths($$QMAKE_LIBDIR_OPENGL_ES2) CMAKE_GL_HEADER_NAME = GLES2/gl2.h + CMAKE_QT_OPENGL_IMPLEMENTATION = GLESv2 } else { - CMAKE_GL_INCDIRS = $$cmakeTargetPaths($$QMAKE_INCDIR_OPENGL) + !isEmpty(QMAKE_INCDIR_OPENGL): CMAKE_GL_INCDIRS = $$cmakeTargetPaths($$QMAKE_INCDIR_OPENGL) + CMAKE_OPENGL_INCDIRS = $$cmakePortablePaths($$QMAKE_INCDIR_OPENGL) + CMAKE_OPENGL_LIBS = $$cmakeProcessLibs($$QMAKE_LIBS_OPENGL) + !isEmpty(QMAKE_LIBDIR_OPENGL): CMAKE_OPENGL_LIBDIR = $$cmakePortablePaths($$QMAKE_LIBDIR_OPENGL) CMAKE_GL_HEADER_NAME = GL/gl.h mac: CMAKE_GL_HEADER_NAME = gl.h + CMAKE_QT_OPENGL_IMPLEMENTATION = GL } } +CMAKE_EGL_INCDIRS = $$cmakePortablePaths($$QMAKE_INCDIR_EGL) + QMAKE_DYNAMIC_LIST_FILE = $$PWD/QtGui.dynlist diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index ea35da54dc..f2f822331d 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -483,6 +483,11 @@ void QPixmapIconEngine::virtual_hook(int id, void *data) #ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QIconEngineFactoryInterface_iid, QLatin1String("/iconengines"), Qt::CaseInsensitive)) + +QFactoryLoader *qt_iconEngineFactoryLoader() +{ + return loader(); +} #endif diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index 6303f5cbe1..d202d62957 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -104,6 +104,10 @@ static inline QStringList systemIconSearchPaths() return QStringList(); } +#ifndef QT_NO_LIBRARY +extern QFactoryLoader *qt_iconEngineFactoryLoader(); // qicon.cpp +#endif + void QIconLoader::ensureInitialized() { if (!m_initialized) { @@ -116,10 +120,7 @@ void QIconLoader::ensureInitialized() if (m_systemTheme.isEmpty()) m_systemTheme = fallbackTheme(); #ifndef QT_NO_LIBRARY - QFactoryLoader iconFactoryLoader(QIconEngineFactoryInterface_iid, - QLatin1String("/iconengines"), - Qt::CaseInsensitive); - if (iconFactoryLoader.keyMap().key(QLatin1String("svg"), -1) != -1) + if (qt_iconEngineFactoryLoader()->keyMap().key(QLatin1String("svg"), -1) != -1) m_supportsSvg = true; #endif //QT_NO_LIBRARY } diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 4f1f7d838f..c5be379b7d 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -966,7 +966,7 @@ QKeyEvent::~QKeyEvent() \sa QApplication::keyboardModifiers() */ -//###### We must check with XGetModifierMapping + Qt::KeyboardModifiers QKeyEvent::modifiers() const { if (key() == Qt::Key_Shift) @@ -977,6 +977,8 @@ Qt::KeyboardModifiers QKeyEvent::modifiers() const return Qt::KeyboardModifiers(QInputEvent::modifiers()^Qt::AltModifier); if (key() == Qt::Key_Meta) return Qt::KeyboardModifiers(QInputEvent::modifiers()^Qt::MetaModifier); + if (key() == Qt::Key_AltGr) + return Qt::KeyboardModifiers(QInputEvent::modifiers()^Qt::GroupSwitchModifier); return QInputEvent::modifiers(); } @@ -990,10 +992,10 @@ Qt::KeyboardModifiers QKeyEvent::modifiers() const */ bool QKeyEvent::matches(QKeySequence::StandardKey matchKey) const { - uint searchkey = (modifiers() | key()) & ~(Qt::KeypadModifier); //The keypad modifier should not make a difference + //The keypad and group switch modifier should not make a difference + uint searchkey = (modifiers() | key()) & ~(Qt::KeypadModifier | Qt::GroupSwitchModifier); const uint platform = QKeySequencePrivate::currentKeyPlatforms(); - uint N = QKeySequencePrivate::numberOfKeyBindings; int first = 0; int last = N - 1; diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index fba516c135..3c79e62e75 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1640,6 +1640,10 @@ void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate } emit qApp->focusWindowChanged(newFocus); + if (previous) + emit previous->activeChanged(); + if (newFocus) + emit newFocus->activeChanged(); } void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfacePrivate::WindowStateChangedEvent *wse) @@ -1736,6 +1740,9 @@ void QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::Cl QCloseEvent event; QGuiApplication::sendSpontaneousEvent(e->window.data(), &event); + if (e->accepted) { + *(e->accepted) = !event.isAccepted(); + } } void QGuiApplicationPrivate::processFileOpenEvent(QWindowSystemInterfacePrivate::FileOpenEvent *e) diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 44de8c5847..a0255f610a 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -1225,7 +1225,8 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence *gmodifs << QModifKeyName(Qt::CTRL, QLatin1String("ctrl+")) << QModifKeyName(Qt::SHIFT, QLatin1String("shift+")) << QModifKeyName(Qt::ALT, QLatin1String("alt+")) - << QModifKeyName(Qt::META, QLatin1String("meta+")); + << QModifKeyName(Qt::META, QLatin1String("meta+")) + << QModifKeyName(Qt::KeypadModifier, QLatin1String("numpad+")); } } else { gmodifs = globalPortableModifs(); @@ -1233,7 +1234,8 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence *gmodifs << QModifKeyName(Qt::CTRL, QLatin1String("ctrl+")) << QModifKeyName(Qt::SHIFT, QLatin1String("shift+")) << QModifKeyName(Qt::ALT, QLatin1String("alt+")) - << QModifKeyName(Qt::META, QLatin1String("meta+")); + << QModifKeyName(Qt::META, QLatin1String("meta+")) + << QModifKeyName(Qt::KeypadModifier, QLatin1String("numpad+")); } } if (!gmodifs) return ret; @@ -1244,7 +1246,8 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence modifs << QModifKeyName(Qt::CTRL, QCoreApplication::translate("QShortcut", "Ctrl").toLower().append(QLatin1Char('+'))) << QModifKeyName(Qt::SHIFT, QCoreApplication::translate("QShortcut", "Shift").toLower().append(QLatin1Char('+'))) << QModifKeyName(Qt::ALT, QCoreApplication::translate("QShortcut", "Alt").toLower().append(QLatin1Char('+'))) - << QModifKeyName(Qt::META, QCoreApplication::translate("QShortcut", "Meta").toLower().append(QLatin1Char('+'))); + << QModifKeyName(Qt::META, QCoreApplication::translate("QShortcut", "Meta").toLower().append(QLatin1Char('+'))) + << QModifKeyName(Qt::KeypadModifier, QCoreApplication::translate("QShortcut", "Numpad").toLower().append(QLatin1Char('+'))); } modifs += *gmodifs; // Test non-translated ones last @@ -1418,10 +1421,12 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Alt") : QString::fromLatin1("Alt"), format); if ((key & Qt::SHIFT) == Qt::SHIFT) addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Shift") : QString::fromLatin1("Shift"), format); + if ((key & Qt::KeypadModifier) == Qt::KeypadModifier) + addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Numpad") : QString::fromLatin1("Numpad"), format); } - key &= ~(Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier); + key &= ~(Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier | Qt::KeypadModifier); QString p; if (key && key < Qt::Key_Escape && key != Qt::Key_Space) { diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 483baf0f09..c93752c3d7 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -759,7 +759,7 @@ bool QOpenGLContext::makeCurrent(QSurface *surface) return false; if (surface->surfaceType() != QSurface::OpenGLSurface) { - qWarning() << "QOpenGLContext::makeCurrent() called with non-opengl surface"; + qWarning() << "QOpenGLContext::makeCurrent() called with non-opengl surface" << surface; return false; } diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 8c9bc575bd..0dd85f2d56 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -874,6 +874,14 @@ bool QWindow::isExposed() const } /*! + \property QWindow::active + \brief the active status of the window + \since 5.1 + + \sa requestActivate() +*/ + +/*! Returns true if the window should appear active from a style perspective. This is the case for the window that has input focus as well as windows diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h index 9b1ed2c702..79f90f2c62 100644 --- a/src/gui/kernel/qwindow.h +++ b/src/gui/kernel/qwindow.h @@ -115,6 +115,7 @@ class Q_GUI_EXPORT QWindow : public QObject, public QSurface Q_PROPERTY(int maximumWidth READ maximumWidth WRITE setMaximumWidth NOTIFY maximumWidthChanged REVISION 1) Q_PROPERTY(int maximumHeight READ maximumHeight WRITE setMaximumHeight NOTIFY maximumHeightChanged REVISION 1) Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) + Q_PROPERTY(bool active READ isActive NOTIFY activeChanged REVISION 1) Q_PROPERTY(Visibility visibility READ visibility WRITE setVisibility NOTIFY visibilityChanged REVISION 1) Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation WRITE reportContentOrientationChange NOTIFY contentOrientationChanged REVISION 1) Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged REVISION 1) @@ -170,8 +171,6 @@ public: void setMask(const QRegion ®ion); QRegion mask() const; - void requestActivate(); - bool isActive() const; void reportContentOrientationChange(Qt::ScreenOrientation orientation); @@ -264,6 +263,8 @@ public: static QWindow *fromWinId(WId id); public Q_SLOTS: + Q_REVISION(1) void requestActivate(); + void setVisible(bool visible); void show(); @@ -310,6 +311,7 @@ Q_SIGNALS: void visibleChanged(bool arg); Q_REVISION(1) void visibilityChanged(QWindow::Visibility visibility); + Q_REVISION(1) void activeChanged(); Q_REVISION(1) void contentOrientationChanged(Qt::ScreenOrientation orientation); void focusObjectChanged(QObject *object); diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index d2add91d66..7dc1e7f7e5 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -140,11 +140,11 @@ void QWindowSystemInterface::handleGeometryChange(QWindow *tlw, const QRect &new QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); } -void QWindowSystemInterface::handleCloseEvent(QWindow *tlw) +void QWindowSystemInterface::handleCloseEvent(QWindow *tlw, bool *accepted) { if (tlw) { QWindowSystemInterfacePrivate::CloseEvent *e = - new QWindowSystemInterfacePrivate::CloseEvent(tlw); + new QWindowSystemInterfacePrivate::CloseEvent(tlw, accepted); QWindowSystemInterfacePrivate::handleWindowSystemEvent(e); } } diff --git a/src/gui/kernel/qwindowsysteminterface.h b/src/gui/kernel/qwindowsysteminterface.h index 212259c113..521c2a4941 100644 --- a/src/gui/kernel/qwindowsysteminterface.h +++ b/src/gui/kernel/qwindowsysteminterface.h @@ -131,7 +131,7 @@ public: static void handleTouchCancelEvent(QWindow *w, ulong timestamp, QTouchDevice *device, Qt::KeyboardModifiers mods = Qt::NoModifier); static void handleGeometryChange(QWindow *w, const QRect &newRect); - static void handleCloseEvent(QWindow *w); + static void handleCloseEvent(QWindow *w, bool *accepted = 0); static void handleEnterEvent(QWindow *w, const QPointF &local = QPointF(), const QPointF& global = QPointF()); static void handleLeaveEvent(QWindow *w); static void handleEnterLeaveEvent(QWindow *enter, QWindow *leave, const QPointF &local = QPointF(), const QPointF& global = QPointF()); diff --git a/src/gui/kernel/qwindowsysteminterface_p.h b/src/gui/kernel/qwindowsysteminterface_p.h index f1bc4667f7..a6ea15c5f2 100644 --- a/src/gui/kernel/qwindowsysteminterface_p.h +++ b/src/gui/kernel/qwindowsysteminterface_p.h @@ -105,9 +105,11 @@ public: class CloseEvent : public WindowSystemEvent { public: - explicit CloseEvent(QWindow *w) - : WindowSystemEvent(Close), window(w) { } + explicit CloseEvent(QWindow *w, bool *a = 0) + : WindowSystemEvent(Close), window(w), accepted(a) + { } QPointer<QWindow> window; + bool *accepted; }; class GeometryChangeEvent : public WindowSystemEvent { diff --git a/src/gui/opengl/qopengltimerquery.h b/src/gui/opengl/qopengltimerquery.h index 649e80d6c0..c1cada9bdb 100644 --- a/src/gui/opengl/qopengltimerquery.h +++ b/src/gui/opengl/qopengltimerquery.h @@ -42,6 +42,8 @@ #ifndef QOPENGLTIMERQUERY_H #define QOPENGLTIMERQUERY_H +#include <QtCore/qglobal.h> + #if !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) #include <QtCore/QObject> diff --git a/src/gui/opengl/qopenglvertexarrayobject.h b/src/gui/opengl/qopenglvertexarrayobject.h index d5226d3ebd..569aeea730 100644 --- a/src/gui/opengl/qopenglvertexarrayobject.h +++ b/src/gui/opengl/qopenglvertexarrayobject.h @@ -42,6 +42,8 @@ #ifndef QOPENGLVERTEXARRAYOBJECT_H #define QOPENGLVERTEXARRAYOBJECT_H +#include <QtCore/qglobal.h> + #ifndef QT_NO_OPENGL #include <QtCore/QObject> |