summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java55
-rw-r--r--src/corelib/Qt5CTestMacros.cmake8
-rw-r--r--src/corelib/Qt5CoreMacros.cmake12
-rw-r--r--src/corelib/global/qcompilerdetection.h2
-rw-r--r--src/corelib/global/qglobal.cpp2
-rw-r--r--src/corelib/global/qnamespace.qdoc8
-rw-r--r--src/corelib/global/qsystemdetection.h25
-rw-r--r--src/corelib/io/qprocess.cpp6
-rw-r--r--src/corelib/itemmodels/qitemselectionmodel.cpp2
-rw-r--r--src/corelib/json/qjsonvalue.cpp8
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp2
-rw-r--r--src/corelib/kernel/qmetaobject.cpp8
-rw-r--r--src/corelib/kernel/qmetaobject.h2
-rw-r--r--src/corelib/kernel/qobject.cpp34
-rw-r--r--src/corelib/mimetypes/qmimeglobpattern.cpp8
-rw-r--r--src/corelib/tools/qbytearray.cpp6
-rw-r--r--src/corelib/tools/qbytearray.h2
-rw-r--r--src/corelib/tools/qhash.cpp2
-rw-r--r--src/corelib/tools/qlist.h20
-rw-r--r--src/corelib/tools/qlocale_mac.mm2
-rw-r--r--src/corelib/tools/qlocale_tools.cpp5
-rw-r--r--src/dbus/qdbusconnection.cpp3
-rw-r--r--src/dbus/qdbusconnection_p.h5
-rw-r--r--src/dbus/qdbusintegrator.cpp108
-rw-r--r--src/dbus/qdbusmetaobject.cpp12
-rw-r--r--src/dbus/qdbuspendingcall.cpp6
-rw-r--r--src/dbus/qdbuspendingcall_p.h3
-rw-r--r--src/gui/image/qpnghandler.cpp18
-rw-r--r--src/gui/kernel/qguiapplication.cpp2
-rw-r--r--src/gui/kernel/qopenglcontext_p.h7
-rw-r--r--src/gui/kernel/qplatformscreen.cpp4
-rw-r--r--src/gui/opengl/qopengl.h2
-rw-r--r--src/gui/opengl/qopenglshaderprogram.cpp4
-rw-r--r--src/gui/opengl/qopengltextureglyphcache.cpp22
-rw-r--r--src/gui/util/qdesktopservices.cpp22
-rw-r--r--src/network/access/qhttpmultipart.cpp3
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp3
-rw-r--r--src/network/kernel/qnetworkinterface_unix.cpp20
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp67
-rw-r--r--src/network/ssl/qsslsocket_openssl_android.cpp179
-rw-r--r--src/network/ssl/qsslsocket_p.h3
-rw-r--r--src/network/ssl/ssl.pri2
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp8
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h832
-rw-r--r--src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp13
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.mm228
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm916
-rw-r--r--src/plugins/generic/evdevkeyboard/README7
-rw-r--r--src/plugins/generic/evdevmouse/README8
-rw-r--r--src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp15
-rw-r--r--src/plugins/platforms/android/src/opengl/qandroidopenglcontext.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.h3
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.mm18
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm19
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm2
-rw-r--r--src/plugins/platforms/cocoa/qprintengine_mac.mm5
-rw-r--r--src/plugins/platforms/eglfs/qeglfsbackingstore.cpp6
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp17
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.h2
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglbackingstore.cpp3
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglwindow.cpp1
-rw-r--r--src/plugins/platforms/platforms.pro4
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp12
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.h1
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.h1
-rw-r--r--src/plugins/platforms/windows/qwindowstheme.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp41
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp112
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.h4
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp8
-rw-r--r--src/plugins/platforms/xcb/qxcbxsettings.cpp4
-rw-r--r--src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp1
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog.cpp4
-rw-r--r--src/printsupport/dialogs/qprintdialog_mac.mm4
-rw-r--r--src/printsupport/kernel/qpaintengine_preview.cpp1
-rw-r--r--src/tools/bootstrap/bootstrap.pro8
-rw-r--r--src/tools/qdoc/doc/qdoc-manual-qdocconf-minimal.qdoc78
-rw-r--r--src/tools/qdoc/doc/qdoc-manual.qdoc621
-rw-r--r--src/tools/rcc/main.cpp1
-rw-r--r--src/widgets/doc/src/model-view-programming.qdoc2
-rw-r--r--src/widgets/doc/src/modelview.qdoc32
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp12
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp1
-rw-r--r--src/widgets/kernel/qapplication.cpp9
-rw-r--r--src/widgets/kernel/qdesktopwidget.h1
-rw-r--r--src/widgets/kernel/qdesktopwidget_qpa.cpp44
-rw-r--r--src/widgets/kernel/qdesktopwidget_qpa_p.h2
-rw-r--r--src/widgets/kernel/qwidget.cpp2
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp5
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm2
-rw-r--r--src/widgets/util/qcompleter.cpp1
-rw-r--r--src/widgets/widgets/qcombobox.cpp31
-rw-r--r--src/widgets/widgets/qcombobox.h4
-rw-r--r--src/widgets/widgets/qcombobox_p.h4
-rw-r--r--src/widgets/widgets/qdockarealayout.cpp2
97 files changed, 2627 insertions, 1256 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
index 4586ae2002..122fc55aad 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -57,6 +57,12 @@ import android.view.ContextMenu;
import android.view.Menu;
import android.view.MotionEvent;
+import java.security.KeyStore;
+import java.security.cert.X509Certificate;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
public class QtNative
{
private static Activity m_activity = null;
@@ -337,28 +343,6 @@ public class QtNative
touchEnd(id,1);
}
//@ANDROID-5
-
- switch (event.getAction()) {
- case MotionEvent.ACTION_UP:
- mouseUp(id,(int) event.getX(), (int) event.getY());
- break;
-
- case MotionEvent.ACTION_DOWN:
- mouseDown(id,(int) event.getX(), (int) event.getY());
- m_oldx = (int) event.getX();
- m_oldy = (int) event.getY();
- break;
-
- case MotionEvent.ACTION_MOVE:
- int dx = (int) (event.getX() - m_oldx);
- int dy = (int) (event.getY() - m_oldy);
- if (Math.abs(dx) > m_moveThreshold || Math.abs(dy) > m_moveThreshold) {
- mouseMove(id, (int) event.getX(), (int) event.getY());
- m_oldx = (int) event.getX();
- m_oldy = (int) event.getY();
- }
- break;
- }
}
static public void sendTrackballEvent(MotionEvent event, int id)
@@ -534,6 +518,33 @@ public class QtNative
});
}
+ private static byte[][] getSSLCertificates()
+ {
+ ArrayList<byte[]> certificateList = new ArrayList<byte[]>();
+
+ try {
+ TrustManagerFactory factory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+ factory.init((KeyStore) null);
+
+ for (TrustManager manager : factory.getTrustManagers()) {
+ if (manager instanceof X509TrustManager) {
+ X509TrustManager trustManager = (X509TrustManager) manager;
+
+ for (X509Certificate certificate : trustManager.getAcceptedIssuers()) {
+ byte buffer[] = certificate.getEncoded();
+ certificateList.add(buffer);
+ }
+ }
+ }
+ } catch (Exception e) {
+ Log.e(QtTAG, "Failed to get certificates", e);
+ }
+
+ byte[][] certificateArray = new byte[certificateList.size()][];
+ certificateArray = certificateList.toArray(certificateArray);
+ return certificateArray;
+ }
+
// screen methods
public static native void setDisplayMetrics(int screenWidthPixels,
int screenHeightPixels,
diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake
index 71097aadbf..cea514ff52 100644
--- a/src/corelib/Qt5CTestMacros.cmake
+++ b/src/corelib/Qt5CTestMacros.cmake
@@ -19,6 +19,14 @@ endforeach()
set(BUILD_OPTIONS_LIST)
+if (CMAKE_C_COMPILER)
+ list(APPEND BUILD_OPTIONS_LIST "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}")
+endif()
+
+if (CMAKE_CXX_COMPILER)
+ list(APPEND BUILD_OPTIONS_LIST "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}")
+endif()
+
if (CMAKE_BUILD_TYPE)
list(APPEND BUILD_OPTIONS_LIST "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
endif()
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
index f549fead59..6630885257 100644
--- a/src/corelib/Qt5CoreMacros.cmake
+++ b/src/corelib/Qt5CoreMacros.cmake
@@ -219,6 +219,18 @@ set(_Qt5_COMPONENT_PATH "${CMAKE_CURRENT_LIST_DIR}/..")
if (NOT CMAKE_VERSION VERSION_LESS 2.8.9)
macro(qt5_use_modules _target _link_type)
+ if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.11)
+ if(CMAKE_WARN_DEPRECATED)
+ set(messageType WARNING)
+ endif()
+ if(CMAKE_ERROR_DEPRECATED)
+ set(messageType FATAL_ERROR)
+ endif()
+ if(messageType)
+ message(${messageType} "The qt5_use_modules macro is obsolete. Use target_link_libraries with IMPORTED targets instead.")
+ endif()
+ endif()
+
if (NOT TARGET ${_target})
message(FATAL_ERROR "The first argument to qt5_use_modules must be an existing target.")
endif()
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 27fc2d4038..41e11ea652 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -584,7 +584,7 @@
# if __has_feature(cxx_alias_templates)
# define Q_COMPILER_TEMPLATE_ALIAS
# endif
-# if 0 /* not implemented in clang yet */
+# if __has_feature(cxx_thread_local)
# define Q_COMPILER_THREAD_LOCAL
# endif
# if __has_feature(cxx_user_literals)
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index ac347655bc..4ee4235278 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2324,7 +2324,7 @@ Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value
*/
void qsrand(uint seed)
{
-#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD)
+#if defined(Q_OS_UNIX) && !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && (_POSIX_THREAD_SAFE_FUNCTIONS - 0 > 0)
SeedStorage *seedStorage = randTLS();
if (seedStorage) {
SeedStorageType *pseed = seedStorage->localData();
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 4a5285fa5d..d8d7b9cbcd 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -1211,12 +1211,8 @@
/*! \typedef Qt::HANDLE
- Platform-specific handle type for system objects. This is
- equivalent to \c{void *} on Mac OS X and embedded Linux,
- and to \c{unsigned long} on X11. On Windows it is the
- DWORD returned by the Win32 function getCurrentThreadId().
-
- \warning Using this type is not portable.
+ A handle type for system objects, defined as \c{void *}
+ on all platforms.
*/
/*!
diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h
index 5e68226b60..dc9fa7383a 100644
--- a/src/corelib/global/qsystemdetection.h
+++ b/src/corelib/global/qsystemdetection.h
@@ -62,8 +62,8 @@
SOLARIS - Sun Solaris
HPUX - HP-UX
ULTRIX - DEC Ultrix
- LINUX - Linux
- FREEBSD - FreeBSD
+ LINUX - Linux [has variants]
+ FREEBSD - FreeBSD [has variants]
NETBSD - NetBSD
OPENBSD - OpenBSD
BSDI - BSD/OS
@@ -76,12 +76,20 @@
DGUX - DG/UX
RELIANT - Reliant UNIX
DYNIX - DYNIX/ptx
- QNX - QNX
+ QNX - QNX [has variants]
QNX6 - QNX RTP 6.1
LYNX - LynxOS
BSD4 - Any BSD 4.4 system
UNIX - Any UNIX BSD/SYSV system
ANDROID - Android platform
+
+ The following operating systems have variants:
+ LINUX - both Q_OS_LINUX and Q_OS_ANDROID are defined when building for Android
+ - only Q_OS_LINUX is defined if building for other Linux systems
+ QNX - both Q_OS_QNX and Q_OS_BLACKBERRY are defined when building for Blackberry 10
+ - only Q_OS_QNX is defined if building for other QNX targets
+ FREEBSD - Q_OS_FREEBSD is defined only when building for FreeBSD with a BSD userland
+ - Q_OS_FREEBSD_KERNEL is always defined on FreeBSD, even if the userland is from GNU
*/
#if defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__))
@@ -118,8 +126,11 @@
# define Q_OS_NACL
#elif defined(__linux__) || defined(__linux)
# define Q_OS_LINUX
-#elif defined(__FreeBSD__) || defined(__DragonFly__)
-# define Q_OS_FREEBSD
+#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
+# ifndef __FreeBSD_kernel__
+# define Q_OS_FREEBSD
+# endif
+# define Q_OS_FREEBSD_KERNEL
# define Q_OS_BSD4
#elif defined(__NetBSD__)
# define Q_OS_NETBSD
@@ -239,10 +250,6 @@
# if !defined(__IPHONE_7_0)
# define __IPHONE_7_0 70000
# endif
-#
-# if (__MAC_OS_X_VERSION_MAX_ALLOWED > __MAC_10_8)
-# warning "This version of OS X is unsupported"
-# endif
#endif
#ifdef __LSB_VERSION__
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 1be108d0a7..96cec568df 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1691,10 +1691,10 @@ QProcessEnvironment QProcess::processEnvironment() const
bool QProcess::waitForStarted(int msecs)
{
Q_D(QProcess);
- if (d->processState == QProcess::Running)
- return true;
+ if (d->processState == QProcess::Starting)
+ return d->waitForStarted(msecs);
- return d->waitForStarted(msecs);
+ return d->processState == QProcess::Running;
}
/*! \reimp
diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp
index a4d73ea480..ea4d9b44c3 100644
--- a/src/corelib/itemmodels/qitemselectionmodel.cpp
+++ b/src/corelib/itemmodels/qitemselectionmodel.cpp
@@ -622,6 +622,8 @@ void QItemSelectionModelPrivate::initModel(QAbstractItemModel *model)
q, SLOT(_q_layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)));
QObject::connect(model, SIGNAL(layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),
q, SLOT(_q_layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)));
+ QObject::connect(model, SIGNAL(modelReset()),
+ q, SLOT(reset()));
}
}
diff --git a/src/corelib/json/qjsonvalue.cpp b/src/corelib/json/qjsonvalue.cpp
index d0b06c6924..3aba6124b8 100644
--- a/src/corelib/json/qjsonvalue.cpp
+++ b/src/corelib/json/qjsonvalue.cpp
@@ -396,9 +396,13 @@ QVariant QJsonValue::toVariant() const
case String:
return toString();
case Array:
- return QJsonArray(d, static_cast<QJsonPrivate::Array *>(base)).toVariantList();
+ return d ?
+ QJsonArray(d, static_cast<QJsonPrivate::Array *>(base)).toVariantList() :
+ QVariantList();
case Object:
- return QJsonObject(d, static_cast<QJsonPrivate::Object *>(base)).toVariantMap();
+ return d ?
+ QJsonObject(d, static_cast<QJsonPrivate::Object *>(base)).toVariantMap() :
+ QVariantMap();
case Null:
case Undefined:
break;
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 4a46bb32f5..3460b9e228 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -1972,7 +1972,7 @@ QString QCoreApplication::applicationFilePath()
}
#endif
#if defined( Q_OS_UNIX )
-# ifdef Q_OS_LINUX
+# if defined(Q_OS_LINUX) && (!defined(Q_OS_ANDROID) || defined(Q_OS_ANDROID_NO_SDK))
// Try looking for a /proc/<pid>/exe symlink first which points to
// the absolute path of the executable
QFileInfo pfi(QString::fromLatin1("/proc/%1/exe").arg(getpid()));
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 7211a730ec..4dc766ecc5 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1589,6 +1589,14 @@ bool QMetaObject::invokeMethod(QObject *obj,
\internal
*/
+/*!
+ \macro Q_METAMETHOD_INVOKE_MAX_ARGS
+ \relates QMetaMethod
+
+ Equals maximum number of arguments available for
+ execution of the method via QMetaMethod::invoke()
+ */
+
QByteArray QMetaMethodPrivate::signature() const
{
Q_ASSERT(priv(mobj->d.data)->revision >= 7);
diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h
index 23fc89ffe3..0c8ad8591f 100644
--- a/src/corelib/kernel/qmetaobject.h
+++ b/src/corelib/kernel/qmetaobject.h
@@ -50,6 +50,8 @@ QT_BEGIN_NAMESPACE
template <typename T> class QList;
+#define Q_METAMETHOD_INVOKE_MAX_ARGS 10
+
class Q_CORE_EXPORT QMetaMethod
{
public:
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 997a65169d..f99bcf1532 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -816,6 +816,14 @@ QObject::~QObject()
m->unlock();
connectionList.first = c->nextConnectionList;
+
+ // The destroy operation must happen outside the lock
+ if (c->isSlotObject) {
+ locker.unlock();
+ c->slotObj->destroyIfLastRef();
+ c->isSlotObject = false;
+ locker.relock();
+ }
c->deref();
}
}
@@ -3135,6 +3143,13 @@ bool QMetaObjectPrivate::disconnectHelper(QObjectPrivate::Connection *c,
c->receiver = 0;
+ if (c->isSlotObject) {
+ senderMutex->unlock();
+ c->slotObj->destroyIfLastRef();
+ c->isSlotObject = false;
+ senderMutex->lock();
+ }
+
success = true;
if (disconnectType == DisconnectOne)
@@ -4385,16 +4400,19 @@ bool QObject::disconnect(const QMetaObject::Connection &connection)
QMutex *senderMutex = signalSlotLock(c->sender);
QMutex *receiverMutex = signalSlotLock(c->receiver);
- QOrderedMutexLocker locker(senderMutex, receiverMutex);
- QObjectConnectionListVector *connectionLists = QObjectPrivate::get(c->sender)->connectionLists;
- Q_ASSERT(connectionLists);
- connectionLists->dirty = true;
+ {
+ QOrderedMutexLocker locker(senderMutex, receiverMutex);
- *c->prev = c->next;
- if (c->next)
- c->next->prev = c->prev;
- c->receiver = 0;
+ QObjectConnectionListVector *connectionLists = QObjectPrivate::get(c->sender)->connectionLists;
+ Q_ASSERT(connectionLists);
+ connectionLists->dirty = true;
+
+ *c->prev = c->next;
+ if (c->next)
+ c->next->prev = c->prev;
+ c->receiver = 0;
+ }
// destroy the QSlotObject, if possible
if (c->isSlotObject) {
diff --git a/src/corelib/mimetypes/qmimeglobpattern.cpp b/src/corelib/mimetypes/qmimeglobpattern.cpp
index 96798cabcd..530d3de4a2 100644
--- a/src/corelib/mimetypes/qmimeglobpattern.cpp
+++ b/src/corelib/mimetypes/qmimeglobpattern.cpp
@@ -77,9 +77,11 @@ void QMimeGlobMatchResult::addMatch(const QString &mimeType, int weight, const Q
m_matchingPatternLength = pattern.length();
m_weight = weight;
}
- m_matchingMimeTypes.append(mimeType);
- if (pattern.startsWith(QLatin1String("*.")))
- m_foundSuffix = pattern.mid(2);
+ if (!m_matchingMimeTypes.contains(mimeType)) {
+ m_matchingMimeTypes.append(mimeType);
+ if (pattern.startsWith(QLatin1String("*.")))
+ m_foundSuffix = pattern.mid(2);
+ }
}
/*!
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 188deb4f94..a2d3891f00 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -586,7 +586,7 @@ QByteArray qUncompress(const uchar* data, int nbytes)
d->data()[len] = 0;
{
- QByteArrayDataPtr dataPtr = { reinterpret_cast<QByteArrayData *>(d.take()) };
+ QByteArrayDataPtr dataPtr = { d.take() };
return QByteArray(dataPtr);
}
@@ -3152,7 +3152,7 @@ QByteArray QByteArray::trimmed() const
}
int l = end - start + 1;
if (l <= 0) {
- QByteArrayDataPtr empty = { reinterpret_cast<QByteArrayData *>(Data::allocate(0)) };
+ QByteArrayDataPtr empty = { Data::allocate(0) };
return QByteArray(empty);
}
return QByteArray(s+start, l);
@@ -3889,7 +3889,7 @@ QByteArray QByteArray::fromRawData(const char *data, int size)
x = Data::fromRawData(data, size);
Q_CHECK_PTR(x);
}
- QByteArrayDataPtr dataPtr = { reinterpret_cast<QByteArrayData *>(x) };
+ QByteArrayDataPtr dataPtr = { x };
return QByteArray(dataPtr);
}
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index f3cc301a49..85d1f0ab90 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -373,7 +373,7 @@ public:
bool isNull() const;
inline QByteArray(QByteArrayDataPtr dd)
- : d(reinterpret_cast<Data *>(dd.ptr))
+ : d(static_cast<Data *>(dd.ptr))
{
}
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 59e7a979dc..4b9d120bb3 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -1226,7 +1226,7 @@ void QHashData::checkSanity()
/*! \fn QList<T> QHash::values() const
Returns a list containing all the values in the hash, in an
- arbitrary order. If a key is associated multiple values, all of
+ arbitrary order. If a key is associated with multiple values, all of
its values will be in the list, and not just the most recently
inserted one.
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 8a9d364eac..28d35745a5 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -725,18 +725,14 @@ Q_OUTOFLINE_TEMPLATE QList<T>::QList(const QList<T> &l)
if (!d->ref.ref()) {
p.detach(d->alloc);
- struct Cleanup
- {
- Cleanup(QListData::Data *d) : d_(d) {}
- ~Cleanup() { if (d_) QListData::dispose(d_); }
-
- QListData::Data *d_;
- } tryCatch(d);
-
- node_copy(reinterpret_cast<Node *>(p.begin()),
- reinterpret_cast<Node *>(p.end()),
- reinterpret_cast<Node *>(l.p.begin()));
- tryCatch.d_ = 0;
+ QT_TRY {
+ node_copy(reinterpret_cast<Node *>(p.begin()),
+ reinterpret_cast<Node *>(p.end()),
+ reinterpret_cast<Node *>(l.p.begin()));
+ } QT_CATCH(...) {
+ QListData::dispose(d);
+ QT_RETHROW;
+ }
}
}
diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm
index f399b7689d..43a0d67e74 100644
--- a/src/corelib/tools/qlocale_mac.mm
+++ b/src/corelib/tools/qlocale_mac.mm
@@ -434,7 +434,7 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
case CurrencyToString:
return macFormatCurrency(in.value<QSystemLocale::CurrencyToStringArgument>());
case UILanguages: {
- QCFType<CFPropertyListRef> languages = (CFArrayRef)CFPreferencesCopyValue(
+ QCFType<CFPropertyListRef> languages = CFPreferencesCopyValue(
CFSTR("AppleLanguages"),
kCFPreferencesAnyApplication,
kCFPreferencesCurrentUser,
diff --git a/src/corelib/tools/qlocale_tools.cpp b/src/corelib/tools/qlocale_tools.cpp
index 6b716b356f..e695ac0f4d 100644
--- a/src/corelib/tools/qlocale_tools.cpp
+++ b/src/corelib/tools/qlocale_tools.cpp
@@ -2370,10 +2370,9 @@ static char *_qdtoa( NEEDS_VOLATILE double d, int mode, int ndigits, int *decpt,
}
b = d2b(d, &be, &bbits);
-#ifdef Sudden_Underflow
i = (int)(getWord0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
-#else
- if ((i = int(getWord0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1))) != 0) {
+#ifndef Sudden_Underflow
+ if (i != 0) {
#endif
d2 = d;
setWord0(&d2, getWord0(d2) & Frac_mask1);
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
index 74a3a752a5..a29ba4cb0f 100644
--- a/src/dbus/qdbusconnection.cpp
+++ b/src/dbus/qdbusconnection.cpp
@@ -54,6 +54,7 @@
#include "qdbusinterface_p.h"
#include "qdbusutil_p.h"
#include "qdbusconnectionmanager_p.h"
+#include "qdbuspendingcall_p.h"
#include "qdbusthreaddebug_p.h"
@@ -611,7 +612,7 @@ QDBusPendingCall QDBusConnection::asyncCall(const QDBusMessage &message, int tim
return QDBusPendingCall(0); // null pointer -> disconnected
}
- QDBusPendingCallPrivate *priv = d->sendWithReplyAsync(message, timeout);
+ QDBusPendingCallPrivate *priv = d->sendWithReplyAsync(message, 0, 0, 0, timeout);
return QDBusPendingCall(priv);
}
diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h
index 48026e15bd..013896bd32 100644
--- a/src/dbus/qdbusconnection_p.h
+++ b/src/dbus/qdbusconnection_p.h
@@ -199,9 +199,8 @@ public:
int send(const QDBusMessage &message);
QDBusMessage sendWithReply(const QDBusMessage &message, int mode, int timeout = -1);
QDBusMessage sendWithReplyLocal(const QDBusMessage &message);
- QDBusPendingCallPrivate *sendWithReplyAsync(const QDBusMessage &message, int timeout = -1);
- int sendWithReplyAsync(const QDBusMessage &message, QObject *receiver,
- const char *returnMethod, const char *errorMethod, int timeout = -1);
+ QDBusPendingCallPrivate *sendWithReplyAsync(const QDBusMessage &message, QObject *receiver,
+ const char *returnMethod, const char *errorMethod,int timeout = -1);
bool connectSignal(const QString &service, const QString &path, const QString& interface,
const QString &name, const QStringList &argumentMatch, const QString &signature,
QObject *receiver, const char *slot);
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 010c076b7f..e5f3fbdc53 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -1830,7 +1830,6 @@ static void qDBusResultReceived(DBusPendingCall *pending, void *user_data)
void QDBusConnectionPrivate::waitForFinished(QDBusPendingCallPrivate *pcall)
{
Q_ASSERT(pcall->pending);
- Q_ASSERT(!pcall->autoDelete);
//Q_ASSERT(pcall->mutex.isLocked()); // there's no such function
if (pcall->waitingForFinished) {
@@ -1846,17 +1845,16 @@ void QDBusConnectionPrivate::waitForFinished(QDBusPendingCallPrivate *pcall)
// QDBusConnectionPrivate::processFinishedCall() is called automatically
}
pcall->mutex.lock();
+
+ if (pcall->pending) {
+ q_dbus_pending_call_unref(pcall->pending);
+ pcall->pending = 0;
+ }
+
pcall->waitForFinishedCondition.wakeAll();
}
}
-// this function is called only in a Q_ASSERT
-static inline Q_DECL_UNUSED bool waitingForFinishedIsSet(QDBusPendingCallPrivate *call)
-{
- const QMutexLocker locker(&call->mutex);
- return call->waitingForFinished;
-}
-
void QDBusConnectionPrivate::processFinishedCall(QDBusPendingCallPrivate *call)
{
QDBusConnectionPrivate *connection = const_cast<QDBusConnectionPrivate *>(call->connection);
@@ -1892,9 +1890,10 @@ void QDBusConnectionPrivate::processFinishedCall(QDBusPendingCallPrivate *call)
qDBusDebug() << "Deliver failed!";
}
- if (call->pending)
+ if (call->pending && !call->waitingForFinished) {
q_dbus_pending_call_unref(call->pending);
- call->pending = 0;
+ call->pending = 0;
+ }
locker.unlock();
@@ -1905,10 +1904,8 @@ void QDBusConnectionPrivate::processFinishedCall(QDBusPendingCallPrivate *call)
if (msg.type() == QDBusMessage::ErrorMessage)
emit connection->callWithCallbackFailed(QDBusError(msg), call->sentMessage);
- if (call->autoDelete) {
- Q_ASSERT(!waitingForFinishedIsSet(call)); // can't wait on a call with autoDelete!
+ if (!call->ref.deref())
delete call;
- }
}
int QDBusConnectionPrivate::send(const QDBusMessage& message)
@@ -1991,7 +1988,7 @@ QDBusMessage QDBusConnectionPrivate::sendWithReply(const QDBusMessage &message,
return amsg;
} else { // use the event loop
- QDBusPendingCallPrivate *pcall = sendWithReplyAsync(message, timeout);
+ QDBusPendingCallPrivate *pcall = sendWithReplyAsync(message, 0, 0, 0, timeout);
Q_ASSERT(pcall);
if (pcall->replyMessage.type() == QDBusMessage::InvalidMessage) {
@@ -2007,6 +2004,10 @@ QDBusMessage QDBusConnectionPrivate::sendWithReply(const QDBusMessage &message,
QDBusMessage reply = pcall->replyMessage;
lastError = QDBusError(reply); // set or clear error
+ bool r = pcall->ref.deref();
+ Q_ASSERT(!r);
+ Q_UNUSED(r);
+
delete pcall;
return reply;
}
@@ -2046,19 +2047,55 @@ QDBusMessage QDBusConnectionPrivate::sendWithReplyLocal(const QDBusMessage &mess
}
QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusMessage &message,
- int timeout)
+ QObject *receiver, const char *returnMethod,
+ const char *errorMethod, int timeout)
{
if (isServiceRegisteredByThread(message.service())) {
// special case for local calls
QDBusPendingCallPrivate *pcall = new QDBusPendingCallPrivate(message, this);
pcall->replyMessage = sendWithReplyLocal(message);
+ if (receiver && returnMethod)
+ pcall->setReplyCallback(receiver, returnMethod);
+
+ if (errorMethod) {
+ pcall->watcherHelper = new QDBusPendingCallWatcherHelper;
+ connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod,
+ Qt::QueuedConnection);
+ pcall->watcherHelper->moveToThread(thread());
+ }
+ if ((receiver && returnMethod) || errorMethod) {
+ // no one waiting, will delete pcall in processFinishedCall()
+ pcall->ref.store(1);
+ } else {
+ // set double ref to prevent race between processFinishedCall() and ref counting
+ // by QDBusPendingCall::QExplicitlySharedDataPointer<QDBusPendingCallPrivate>
+ pcall->ref.store(2);
+ }
+ processFinishedCall(pcall);
return pcall;
}
checkThread();
QDBusPendingCallPrivate *pcall = new QDBusPendingCallPrivate(message, this);
- pcall->ref.store(0);
+ if (receiver && returnMethod)
+ pcall->setReplyCallback(receiver, returnMethod);
+
+ if (errorMethod) {
+ pcall->watcherHelper = new QDBusPendingCallWatcherHelper;
+ connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod,
+ Qt::QueuedConnection);
+ pcall->watcherHelper->moveToThread(thread());
+ }
+
+ if ((receiver && returnMethod) || errorMethod) {
+ // no one waiting, will delete pcall in processFinishedCall()
+ pcall->ref.store(1);
+ } else {
+ // set double ref to prevent race between processFinishedCall() and ref counting
+ // by QDBusPendingCall::QExplicitlySharedDataPointer<QDBusPendingCallPrivate>
+ pcall->ref.store(2);
+ }
QDBusError error;
DBusMessage *msg = QDBusMessagePrivate::toDBusMessage(message, capabilities, &error);
@@ -2069,6 +2106,7 @@ QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusM
qPrintable(error.message()));
pcall->replyMessage = QDBusMessage::createError(error);
lastError = error;
+ processFinishedCall(pcall);
return pcall;
}
@@ -2094,46 +2132,10 @@ QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusM
q_dbus_message_unref(msg);
pcall->replyMessage = QDBusMessage::createError(error);
+ processFinishedCall(pcall);
return pcall;
}
-int QDBusConnectionPrivate::sendWithReplyAsync(const QDBusMessage &message, QObject *receiver,
- const char *returnMethod, const char *errorMethod,
- int timeout)
-{
- QDBusPendingCallPrivate *pcall = sendWithReplyAsync(message, timeout);
- Q_ASSERT(pcall);
-
- // has it already finished with success (dispatched locally)?
- if (pcall->replyMessage.type() == QDBusMessage::ReplyMessage) {
- pcall->setReplyCallback(receiver, returnMethod);
- processFinishedCall(pcall);
- delete pcall;
- return 1;
- }
-
- // either it hasn't finished or it has finished with error
- if (errorMethod) {
- pcall->watcherHelper = new QDBusPendingCallWatcherHelper;
- connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod,
- Qt::QueuedConnection);
- pcall->watcherHelper->moveToThread(thread());
- }
-
- // has it already finished and is an error reply message?
- if (pcall->replyMessage.type() == QDBusMessage::ErrorMessage) {
- processFinishedCall(pcall);
- delete pcall;
- return 1;
- }
-
- pcall->autoDelete = true;
- pcall->ref.ref();
- pcall->setReplyCallback(receiver, returnMethod);
-
- return 1;
-}
-
bool QDBusConnectionPrivate::connectSignal(const QString &service,
const QString &path, const QString &interface, const QString &name,
const QStringList &argumentMatch, const QString &signature,
diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp
index 799c66f6f9..127cf6658c 100644
--- a/src/dbus/qdbusmetaobject.cpp
+++ b/src/dbus/qdbusmetaobject.cpp
@@ -75,6 +75,7 @@ private:
QByteArray name;
QVarLengthArray<int, 4> inputTypes;
QVarLengthArray<int, 4> outputTypes;
+ QByteArray rawReturnType;
int flags;
};
@@ -276,6 +277,9 @@ void QDBusMetaObjectGenerator::parseMethods()
mm.outputTypes.append(type.id);
+ if (i == 0 && type.id == -1) {
+ mm.rawReturnType = type.name;
+ }
if (i != 0) {
// non-const ref parameter
mm.parameterNames.append(arg.name.toLatin1());
@@ -471,10 +475,14 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
int type;
QByteArray typeName;
if (i < 0) { // Return type
- if (!mm.outputTypes.isEmpty())
+ if (!mm.outputTypes.isEmpty()) {
type = mm.outputTypes.first();
- else
+ if (type == -1) {
+ type = IsUnresolvedType | strings.enter(mm.rawReturnType);
+ }
+ } else {
type = QMetaType::Void;
+ }
} else if (i < mm.inputTypes.size()) {
type = mm.inputTypes.at(i);
} else {
diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp
index 0b4ff3a397..49f9fc0cd8 100644
--- a/src/dbus/qdbuspendingcall.cpp
+++ b/src/dbus/qdbuspendingcall.cpp
@@ -256,6 +256,11 @@ QDBusPendingCall::QDBusPendingCall(const QDBusPendingCall &other)
QDBusPendingCall::QDBusPendingCall(QDBusPendingCallPrivate *dd)
: d(dd)
{
+ if (dd) {
+ bool r = dd->ref.deref();
+ Q_ASSERT(r);
+ Q_UNUSED(r);
+ }
}
/*!
@@ -469,6 +474,7 @@ QDBusPendingCall QDBusPendingCall::fromCompletedCall(const QDBusMessage &msg)
msg.type() == QDBusMessage::ReplyMessage) {
d = new QDBusPendingCallPrivate(QDBusMessage(), 0);
d->replyMessage = msg;
+ d->ref.store(1);
}
return QDBusPendingCall(d);
diff --git a/src/dbus/qdbuspendingcall_p.h b/src/dbus/qdbuspendingcall_p.h
index 36d0b9023a..d0b28b3c0e 100644
--- a/src/dbus/qdbuspendingcall_p.h
+++ b/src/dbus/qdbuspendingcall_p.h
@@ -85,7 +85,6 @@ public:
QVector<int> metaTypes;
int methodIdx;
- bool autoDelete;
// }
mutable QMutex mutex;
@@ -102,7 +101,7 @@ public:
// }
QDBusPendingCallPrivate(const QDBusMessage &sent, QDBusConnectionPrivate *connection)
- : sentMessage(sent), connection(connection), autoDelete(false), watcherHelper(0), pending(0), waitingForFinished(false)
+ : sentMessage(sent), connection(connection), watcherHelper(0), pending(0), waitingForFinished(false)
{ }
~QDBusPendingCallPrivate();
bool setReplyCallback(QObject *target, const char *member);
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp
index 1e906e0d92..e43ac666c7 100644
--- a/src/gui/image/qpnghandler.cpp
+++ b/src/gui/image/qpnghandler.cpp
@@ -408,9 +408,14 @@ static void read_image_scaled(QImage *outImage, png_structp png_ptr, png_infop i
png_uint_32 width;
png_uint_32 height;
+ png_int_32 offset_x;
+ png_int_32 offset_y;
+
int bit_depth;
int color_type;
+ int unit_type;
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0);
+ png_get_oFFs(png_ptr, info_ptr, &offset_x, &offset_y, &unit_type);
uchar *data = outImage->bits();
int bpl = outImage->bytesPerLine();
@@ -470,6 +475,10 @@ static void read_image_scaled(QImage *outImage, png_structp png_ptr, png_infop i
outImage->setDotsPerMeterX((png_get_x_pixels_per_meter(png_ptr,info_ptr)*oxsz)/ixsz);
outImage->setDotsPerMeterY((png_get_y_pixels_per_meter(png_ptr,info_ptr)*oysz)/iysz);
+
+ if (unit_type == PNG_OFFSET_PIXEL)
+ outImage->setOffset(QPoint(offset_x*oxsz/ixsz, offset_y*oysz/iysz));
+
}
#if defined(Q_C_CALLBACKS)
@@ -550,7 +559,6 @@ bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngHeader()
return true;
}
-
bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngImage(QImage *outImage)
{
if (state == Error)
@@ -585,9 +593,14 @@ bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngImage(QImage *outImage)
} else {
png_uint_32 width;
png_uint_32 height;
+ png_int_32 offset_x;
+ png_int_32 offset_y;
+
int bit_depth;
int color_type;
+ int unit_type;
png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0);
+ png_get_oFFs(png_ptr, info_ptr, &offset_x, &offset_y, &unit_type);
uchar *data = outImage->bits();
int bpl = outImage->bytesPerLine();
amp.row_pointers = new png_bytep[height];
@@ -601,6 +614,9 @@ bool Q_INTERNAL_WIN_NO_THROW QPngHandlerPrivate::readPngImage(QImage *outImage)
outImage->setDotsPerMeterX(png_get_x_pixels_per_meter(png_ptr,info_ptr));
outImage->setDotsPerMeterY(png_get_y_pixels_per_meter(png_ptr,info_ptr));
+ if (unit_type == PNG_OFFSET_PIXEL)
+ outImage->setOffset(QPoint(offset_x, offset_y));
+
// sanity check palette entries
if (color_type == PNG_COLOR_TYPE_PALETTE && outImage->format() == QImage::Format_Indexed8) {
int color_table_size = outImage->colorCount();
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index da3bc86433..6be3b066d8 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -1885,7 +1885,7 @@ void QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::Cl
QCloseEvent event;
QGuiApplication::sendSpontaneousEvent(e->window.data(), &event);
if (e->accepted) {
- *(e->accepted) = !event.isAccepted();
+ *(e->accepted) = event.isAccepted();
}
}
diff --git a/src/gui/kernel/qopenglcontext_p.h b/src/gui/kernel/qopenglcontext_p.h
index 3cbcd1c06d..280e2e1e33 100644
--- a/src/gui/kernel/qopenglcontext_p.h
+++ b/src/gui/kernel/qopenglcontext_p.h
@@ -203,6 +203,7 @@ public:
, max_texture_size(-1)
, workaround_brokenFBOReadBack(false)
, workaround_brokenTexSubImage(false)
+ , workaround_missingPrecisionQualifiers(false)
, active_engine(0)
{
}
@@ -233,6 +234,7 @@ public:
bool workaround_brokenFBOReadBack;
bool workaround_brokenTexSubImage;
+ bool workaround_missingPrecisionQualifiers;
QPaintEngineEx *active_engine;
@@ -240,6 +242,11 @@ public:
int maxTextureSize();
+ static QOpenGLContextPrivate *get(QOpenGLContext *context)
+ {
+ return context->d_func();
+ }
+
#if !defined(QT_NO_DEBUG)
static bool toggleMakeCurrentTracker(QOpenGLContext *context, bool value)
{
diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp
index 43db0e5f8e..05d04ae4ee 100644
--- a/src/gui/kernel/qplatformscreen.cpp
+++ b/src/gui/kernel/qplatformscreen.cpp
@@ -232,6 +232,10 @@ void QPlatformScreen::setOrientationUpdateMask(Qt::ScreenOrientations mask)
QPlatformScreen * QPlatformScreen::platformScreenForWindow(const QWindow *window)
{
+ // QTBUG 32681: It can happen during the transition between screens
+ // when one screen is disconnected that the window doesn't have a screen.
+ if (!window->screen())
+ return 0;
return window->screen()->handle();
}
diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h
index 6e8be66806..6eb656cd09 100644
--- a/src/gui/opengl/qopengl.h
+++ b/src/gui/opengl/qopengl.h
@@ -106,7 +106,7 @@ typedef GLfloat GLdouble;
# endif
# include <OpenGL/glext.h>
# else
-# define GL_GLEXT_LEGACY // Prevents GL/gl.h form #including system glext.h
+# define GL_GLEXT_LEGACY // Prevents GL/gl.h from #including system glext.h
# include <GL/gl.h>
# include <QtGui/qopenglext.h>
# endif // Q_OS_MAC
diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp
index 8278e4fb5a..c0e250b0fa 100644
--- a/src/gui/opengl/qopenglshaderprogram.cpp
+++ b/src/gui/opengl/qopenglshaderprogram.cpp
@@ -429,7 +429,9 @@ bool QOpenGLShader::compileSourceCode(const char *source)
// The precision qualifiers are useful on OpenGL/ES systems,
// but usually not present on desktop systems.
const QSurfaceFormat currentSurfaceFormat = QOpenGLContext::currentContext()->format();
+ QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(QOpenGLContext::currentContext());
if (currentSurfaceFormat.renderableType() == QSurfaceFormat::OpenGL
+ || ctx_d->workaround_missingPrecisionQualifiers
#ifdef QT_OPENGL_FORCE_SHADER_DEFINES
|| true
#endif
@@ -439,7 +441,7 @@ bool QOpenGLShader::compileSourceCode(const char *source)
}
#ifdef QOpenGL_REDEFINE_HIGHP
- if (d->shaderType == Fragment) {
+ if (d->shaderType == Fragment && !ctx_d->workaround_missingPrecisionQualifiers) {
src.append(redefineHighp);
srclen.append(GLint(sizeof(redefineHighp) - 1));
}
diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp
index 7d49c03f5b..506aec0f43 100644
--- a/src/gui/opengl/qopengltextureglyphcache.cpp
+++ b/src/gui/opengl/qopengltextureglyphcache.cpp
@@ -305,11 +305,6 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
const int maskWidth = mask.width();
const int maskHeight = mask.height();
-#if defined(QT_OPENGL_ES_2)
- QOpenGLExtensions extensions(ctx);
- bool hasBGRA = extensions.hasOpenGLExtension(QOpenGLExtensions::BGRATextureFormat);
-#endif
-
if (mask.format() == QImage::Format_Mono) {
mask = mask.convertToFormat(QImage::Format_Indexed8);
for (int y = 0; y < maskHeight; ++y) {
@@ -321,9 +316,6 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
if (mask.format() == QImage::Format_RGB32
// We need to make the alpha component equal to the average of the RGB values.
// This is needed when drawing sub-pixel antialiased text on translucent targets.
-#if defined(QT_OPENGL_ES_2)
- || !hasBGRA // We need to reverse the bytes
-#endif
) {
for (int y = 0; y < maskHeight; ++y) {
quint32 *src = (quint32 *) mask.scanLine(y);
@@ -338,12 +330,10 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
avg = src[x] >> 24;
#if defined(QT_OPENGL_ES_2)
- if (!hasBGRA) {
- // Reverse bytes to match GL_RGBA
- src[x] = (avg << 24) | (quint32(r) << 0) | (quint32(g) << 8) | (quint32(b) << 16);
- } else
+ // swizzle the bits to accommodate for the GL_RGBA upload.
+ src[x] = (avg << 24) | (quint32(r) << 0) | (quint32(g) << 8) | (quint32(b) << 16);
#endif
- src[x] = (src[x] & 0x00ffffff) | (avg << 24);
+ src[x] = (src[x] & 0x00ffffff) | (avg << 24);
}
}
}
@@ -352,7 +342,7 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
glBindTexture(GL_TEXTURE_2D, m_textureResource->m_texture);
if (mask.depth() == 32) {
#if defined(QT_OPENGL_ES_2)
- glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, hasBGRA ? GL_BGRA_EXT : GL_RGBA, GL_UNSIGNED_BYTE, mask.bits());
+ glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_RGBA, GL_UNSIGNED_BYTE, mask.bits());
#else
glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_BGRA, GL_UNSIGNED_BYTE, mask.bits());
#endif
@@ -382,7 +372,9 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
} else {
#endif
glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_ALPHA, GL_UNSIGNED_BYTE, mask.bits());
-// }
+#if 0
+ }
+#endif
}
}
diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp
index 97847af8ea..f5895414a9 100644
--- a/src/gui/util/qdesktopservices.cpp
+++ b/src/gui/util/qdesktopservices.cpp
@@ -254,7 +254,7 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme)
\enum QDesktopServices::StandardLocation
\since 4.4
\obsolete
- Use QStandardPaths::StandardLocation
+ Use QStandardPaths::StandardLocation (see storageLocation() for porting notes)
This enum describes the different locations that can be queried by
QDesktopServices::storageLocation and QDesktopServices::displayName.
@@ -282,6 +282,26 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme)
\fn QString QDesktopServices::storageLocation(StandardLocation type)
\obsolete
Use QStandardPaths::writableLocation()
+
+ \note when porting QDesktopServices::DataLocation to QStandardPaths::DataLocation,
+ a different path will be returned.
+
+ \c{QDesktopServices::DataLocation} was \c{GenericDataLocation + "/data/organization/application"},
+ while QStandardPaths::DataLocation is \c{GenericDataLocation + "/organization/application"}.
+
+ Also note that \c{application} could be empty in Qt 4, if QCoreApplication::setApplicationName()
+ wasn't called, while in Qt 5 it defaults to the name of the executable.
+
+ Therefore, if you still need to access the Qt 4 path (for example for data migration to Qt 5), replace
+ \code
+ QDesktopServices::storageLocation(QDesktopServices::DataLocation)
+ \endcode
+ with
+ \code
+ QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) +
+ "/data/organization/application"
+ \endcode
+ (assuming an organization name and an application name were set).
*/
/*!
diff --git a/src/network/access/qhttpmultipart.cpp b/src/network/access/qhttpmultipart.cpp
index 4397ef8205..5985ed94e0 100644
--- a/src/network/access/qhttpmultipart.cpp
+++ b/src/network/access/qhttpmultipart.cpp
@@ -497,7 +497,8 @@ qint64 QHttpMultiPartIODevice::readData(char *data, qint64 maxSize)
// skip the parts we have already read
while (index < multiPart->parts.count() &&
- readPointer >= partOffsets.at(index) + multiPart->parts.at(index).d->size())
+ readPointer >= partOffsets.at(index) + multiPart->parts.at(index).d->size()
+ + multiPart->boundary.count() + 6) // 6 == 2 boundary dashes, \r\n after boundary, \r\n after multipart
index++;
// read the data
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 7aee9aa38a..6e61eea5a4 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -1130,6 +1130,9 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
errorCode = QNetworkReply::RemoteHostClosedError;
}
} else if (state == QHttpNetworkConnectionChannel::ReadingState) {
+ if (!reply)
+ break;
+
if (!reply->d_func()->expectContent()) {
// No content expected, this is a valid way to have the connection closed by the server
return;
diff --git a/src/network/kernel/qnetworkinterface_unix.cpp b/src/network/kernel/qnetworkinterface_unix.cpp
index 0ec9554c82..b090213861 100644
--- a/src/network/kernel/qnetworkinterface_unix.cpp
+++ b/src/network/kernel/qnetworkinterface_unix.cpp
@@ -81,7 +81,7 @@
QT_BEGIN_NAMESPACE
-static QHostAddress addressFromSockaddr(sockaddr *sa)
+static QHostAddress addressFromSockaddr(sockaddr *sa, int ifindex = 0, const QString &ifname = QString())
{
QHostAddress address;
if (!sa)
@@ -92,7 +92,11 @@ static QHostAddress addressFromSockaddr(sockaddr *sa)
else if (sa->sa_family == AF_INET6) {
address.setAddress(((sockaddr_in6 *)sa)->sin6_addr.s6_addr);
int scope = ((sockaddr_in6 *)sa)->sin6_scope_id;
- if (scope) {
+ if (scope && scope == ifindex) {
+ // this is the most likely scenario:
+ // a scope ID in a socket is that of the interface this address came from
+ address.setScopeId(ifname);
+ } else if (scope) {
#ifndef QT_NO_IPV6IFNAME
char scopeid[IFNAMSIZ];
if (::if_indextoname(scope, scopeid)) {
@@ -410,14 +414,9 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
{
QList<QNetworkInterfacePrivate *> interfaces;
- int socket;
- if ((socket = qt_safe_socket(AF_INET, SOCK_STREAM, IPPROTO_IP)) == -1)
- return interfaces; // error
-
ifaddrs *interfaceListing;
if (getifaddrs(&interfaceListing) == -1) {
// error
- ::close(socket);
return interfaces;
}
@@ -439,20 +438,19 @@ static QList<QNetworkInterfacePrivate *> interfaceListing()
}
QNetworkAddressEntry entry;
- entry.setIp(addressFromSockaddr(ptr->ifa_addr));
+ entry.setIp(addressFromSockaddr(ptr->ifa_addr, iface->index, iface->name));
if (entry.ip().isNull())
// could not parse the address
continue;
- entry.setNetmask(addressFromSockaddr(ptr->ifa_netmask));
+ entry.setNetmask(addressFromSockaddr(ptr->ifa_netmask, iface->index, iface->name));
if (iface->flags & QNetworkInterface::CanBroadcast)
- entry.setBroadcast(addressFromSockaddr(ptr->ifa_broadaddr));
+ entry.setBroadcast(addressFromSockaddr(ptr->ifa_broadaddr, iface->index, iface->name));
iface->addressEntries << entry;
}
freeifaddrs(interfaceListing);
- ::close(socket);
return interfaces;
}
#endif
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 69181f40b4..e94df10fed 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -522,6 +522,8 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
} else {
qWarning("could not load crypt32 library"); // should never happen
}
+#elif defined(Q_OS_QNX)
+ s_loadRootCertsOnDemand = true;
#elif defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
// check whether we can enable on-demand root-cert loading (i.e. check whether the sym links are there)
QList<QByteArray> dirs = unixRootCertDirectories();
@@ -686,41 +688,48 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
}
#elif defined(Q_OS_UNIX)
QSet<QString> certFiles;
-# ifdef Q_OS_ANDROID
- QList<QByteArray> directories;
- directories << qgetenv("MINISTRO_SSL_CERTS_PATH"); // Set by Ministro
-# else
- QList<QByteArray> directories = unixRootCertDirectories();
-# endif
QDir currentDir;
QStringList nameFilters;
-# ifdef Q_OS_ANDROID
- nameFilters << QLatin1String("*.der");
-#else
+ QList<QByteArray> directories;
+ QSsl::EncodingFormat platformEncodingFormat;
+# ifndef Q_OS_ANDROID
+ directories = unixRootCertDirectories();
nameFilters << QLatin1String("*.pem") << QLatin1String("*.crt");
-# endif
- currentDir.setNameFilters(nameFilters);
- for (int a = 0; a < directories.count(); a++) {
- currentDir.setPath(QLatin1String(directories.at(a)));
- QDirIterator it(currentDir);
- while(it.hasNext()) {
- it.next();
- // use canonical path here to not load the same certificate twice if symlinked
- certFiles.insert(it.fileInfo().canonicalFilePath());
- }
- }
- QSetIterator<QString> it(certFiles);
- while(it.hasNext()) {
-# ifdef Q_OS_ANDROID
- systemCerts.append(QSslCertificate::fromPath(it.next(), QSsl::Der));
+ platformEncodingFormat = QSsl::Pem;
# else
- systemCerts.append(QSslCertificate::fromPath(it.next(), QSsl::Pem));
-# endif
- }
+ // Q_OS_ANDROID
+ QByteArray ministroPath = qgetenv("MINISTRO_SSL_CERTS_PATH"); // Set by Ministro
+ directories << ministroPath;
+ nameFilters << QLatin1String("*.der");
+ platformEncodingFormat = QSsl::Der;
+# ifndef Q_OS_ANDROID_NO_SDK
+ if (ministroPath.isEmpty()) {
+ QList<QByteArray> certificateData = fetchSslCertificateData();
+ for (int i = 0; i < certificateData.size(); ++i) {
+ systemCerts.append(QSslCertificate::fromData(certificateData.at(i), QSsl::Der));
+ }
+ } else
+# endif //Q_OS_ANDROID_NO_SDK
+# endif //Q_OS_ANDROID
+ {
+ currentDir.setNameFilters(nameFilters);
+ for (int a = 0; a < directories.count(); a++) {
+ currentDir.setPath(QLatin1String(directories.at(a)));
+ QDirIterator it(currentDir);
+ while (it.hasNext()) {
+ it.next();
+ // use canonical path here to not load the same certificate twice if symlinked
+ certFiles.insert(it.fileInfo().canonicalFilePath());
+ }
+ }
+ QSetIterator<QString> it(certFiles);
+ while (it.hasNext())
+ systemCerts.append(QSslCertificate::fromPath(it.next(), platformEncodingFormat));
# ifndef Q_OS_ANDROID
- systemCerts.append(QSslCertificate::fromPath(QLatin1String("/etc/pki/tls/certs/ca-bundle.crt"), QSsl::Pem)); // Fedora, Mandriva
- systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/local/share/certs/ca-root-nss.crt"), QSsl::Pem)); // FreeBSD's ca_root_nss
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/etc/pki/tls/certs/ca-bundle.crt"), QSsl::Pem)); // Fedora, Mandriva
+ systemCerts.append(QSslCertificate::fromPath(QLatin1String("/usr/local/share/certs/ca-root-nss.crt"), QSsl::Pem)); // FreeBSD's ca_root_nss
# endif
+ }
#endif
#ifdef QSSLSOCKET_DEBUG
qDebug() << "systemCaCertificates retrieval time " << timer.elapsed() << "ms";
diff --git a/src/network/ssl/qsslsocket_openssl_android.cpp b/src/network/ssl/qsslsocket_openssl_android.cpp
new file mode 100644
index 0000000000..fa612a75a6
--- /dev/null
+++ b/src/network/ssl/qsslsocket_openssl_android.cpp
@@ -0,0 +1,179 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtNetwork module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/****************************************************************************
+**
+** In addition, as a special exception, the copyright holders listed above give
+** permission to link the code of its release of Qt with the OpenSSL project's
+** "OpenSSL" library (or modified versions of the "OpenSSL" library that use the
+** same license as the original version), and distribute the linked executables.
+**
+** You must comply with the GNU General Public License version 2 in all
+** respects for all of the code used other than the "OpenSSL" code. If you
+** modify this file, you may extend this exception to your version of the file,
+** but you are not obligated to do so. If you do not wish to do so, delete
+** this exception statement from your version of this file.
+**
+****************************************************************************/
+
+#include "qsslsocket_openssl_p.h"
+
+
+
+#include <jni.h>
+#include <android/log.h>
+
+static JavaVM *javaVM = 0;
+static jclass appClass;
+
+static jmethodID getSslCertificatesMethodID;
+
+struct AttachedJNIEnv
+{
+ AttachedJNIEnv()
+ {
+ attached = false;
+ if (javaVM->GetEnv((void**)&jniEnv, JNI_VERSION_1_6) < 0) {
+ if (javaVM->AttachCurrentThread(&jniEnv, NULL) < 0) {
+ __android_log_print(ANDROID_LOG_ERROR, "Qt", "AttachCurrentThread failed");
+ jniEnv = 0;
+ return;
+ }
+ attached = true;
+ }
+ }
+
+ ~AttachedJNIEnv()
+ {
+ if (attached)
+ javaVM->DetachCurrentThread();
+ }
+ bool attached;
+ JNIEnv *jniEnv;
+};
+
+static const char logTag[] = "Qt";
+static const char classErrorMsg[] = "Can't find class \"%s\"";
+static const char methodErrorMsg[] = "Can't find method \"%s%s\"";
+
+
+#define FIND_AND_CHECK_CLASS(CLASS_NAME) \
+clazz = env->FindClass(CLASS_NAME); \
+if (!clazz) { \
+ __android_log_print(ANDROID_LOG_FATAL, logTag, classErrorMsg, CLASS_NAME); \
+ return JNI_FALSE; \
+}
+
+#define GET_AND_CHECK_STATIC_METHOD(VAR, CLASS, METHOD_NAME, METHOD_SIGNATURE) \
+VAR = env->GetStaticMethodID(CLASS, METHOD_NAME, METHOD_SIGNATURE); \
+if (!VAR) { \
+ __android_log_print(ANDROID_LOG_FATAL, logTag, methodErrorMsg, METHOD_NAME, METHOD_SIGNATURE); \
+ return JNI_FALSE; \
+}
+
+static bool registerNatives(JNIEnv *env)
+{
+ jclass clazz;
+ FIND_AND_CHECK_CLASS("org/qtproject/qt5/android/QtNative");
+ appClass = static_cast<jclass>(env->NewGlobalRef(clazz));
+
+#if 0 //we don't call C++ functions from Java at this time
+ if (env->RegisterNatives(appClass, methods, sizeof(methods) / sizeof(methods[0])) < 0) {
+ __android_log_print(ANDROID_LOG_FATAL, logTag, "RegisterNatives failed");
+ return JNI_FALSE;
+ }
+#endif
+
+ GET_AND_CHECK_STATIC_METHOD(getSslCertificatesMethodID, appClass, "getSSLCertificates", "()[[B");
+
+ return true;
+}
+
+Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void * /*reserved*/)
+{
+ typedef union {
+ JNIEnv *nativeEnvironment;
+ void *venv;
+ } UnionJNIEnvToVoid;
+
+ __android_log_print(ANDROID_LOG_INFO, logTag, "Network start");
+ UnionJNIEnvToVoid uenv;
+ uenv.venv = NULL;
+ javaVM = 0;
+
+ if (vm->GetEnv(&uenv.venv, JNI_VERSION_1_4) != JNI_OK) {
+ __android_log_print(ANDROID_LOG_FATAL, logTag, "GetEnv failed");
+ return -1;
+ }
+ JNIEnv *env = uenv.nativeEnvironment;
+ if (!registerNatives(env)) {
+ __android_log_print(ANDROID_LOG_FATAL, logTag, "registerNatives failed");
+ return -1;
+ }
+
+ javaVM = vm;
+ return JNI_VERSION_1_4;
+}
+
+QList<QByteArray> QSslSocketPrivate::fetchSslCertificateData()
+{
+ QList<QByteArray> certificateData;
+ AttachedJNIEnv env;
+
+ if (env.jniEnv) {
+ jobjectArray jcertificates =
+ static_cast<jobjectArray>(env.jniEnv->CallStaticObjectMethod(appClass, getSslCertificatesMethodID));
+ jint nCertificates = env.jniEnv->GetArrayLength(jcertificates);
+
+ for (int i = 0; i < nCertificates; ++i) {
+ jbyteArray jCert = static_cast<jbyteArray>(env.jniEnv->GetObjectArrayElement(jcertificates, i));
+
+ const uint sz = env.jniEnv->GetArrayLength(jCert);
+ jbyte *buffer = env.jniEnv->GetByteArrayElements(jCert, 0);
+ certificateData.append(QByteArray(reinterpret_cast<char*>(buffer), sz));
+
+ env.jniEnv->ReleaseByteArrayElements(jCert, buffer, JNI_ABORT); // don't copy back the elements
+ env.jniEnv->DeleteLocalRef(jCert);
+ }
+ }
+
+ return certificateData;
+}
diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h
index 4fed101a80..6281753225 100644
--- a/src/network/ssl/qsslsocket_p.h
+++ b/src/network/ssl/qsslsocket_p.h
@@ -197,6 +197,9 @@ public:
private:
static bool ensureLibraryLoaded();
static void ensureCiphersAndCertsLoaded();
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
+ static QList<QByteArray> fetchSslCertificateData();
+#endif
static bool s_libraryLoaded;
static bool s_loadedCiphersAndCerts;
diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri
index 1d8c8e1ab7..0fe231357b 100644
--- a/src/network/ssl/ssl.pri
+++ b/src/network/ssl/ssl.pri
@@ -28,6 +28,8 @@ contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) {
ssl/qsslcertificateextension.cpp \
ssl/qsslcontext.cpp
+android:!android-no-sdk: SOURCES += ssl/qsslsocket_openssl_android.cpp
+
# Add optional SSL libs
# Static linking of OpenSSL with msvc:
# - Binaries http://slproweb.com/products/Win32OpenSSL.html
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index 59401fe1e9..8e397295d1 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -317,7 +317,12 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed sub
uchar g = src[x] >> 8;
uchar b = src[x];
quint32 avg = (quint32(r) + quint32(g) + quint32(b) + 1) / 3; // "+1" for rounding.
+#if defined(QT_OPENGL_ES_2)
+ // swizzle the bits to accommodate for the GL_RGBA upload.
+ src[x] = (avg << 24) | (quint32(r) << 0) | (quint32(g) << 8) | (quint32(b) << 16);
+#else
src[x] = (src[x] & 0x00ffffff) | (avg << 24);
+#endif
}
}
}
@@ -325,8 +330,7 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed sub
glBindTexture(GL_TEXTURE_2D, m_textureResource->m_texture);
if (mask.format() == QImage::Format_RGB32) {
#if defined(QT_OPENGL_ES_2)
- // ###TODO Ensure extension is actually present on ES2
- glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_BGRA_EXT, GL_UNSIGNED_BYTE, mask.bits());
+ glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_RGBA, GL_UNSIGNED_BYTE, mask.bits());
#else
glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_BGRA, GL_UNSIGNED_BYTE, mask.bits());
#endif
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h b/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
index 2aa8248c32..22d1622516 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboard_defaultmap_p.h
@@ -89,166 +89,166 @@ const QEvdevKeyboardMap::Mapping QEvdevKeyboardHandler::s_keymap_default[] = {
{ 14, 0xffff, 0x01000003, 0x00, 0x00, 0x0000 },
{ 14, 0xffff, 0x01000000, 0x0c, 0x08, 0x0300 },
{ 15, 0xffff, 0x01000001, 0x00, 0x00, 0x0000 },
- { 16, 0x0071, 0x00000051, 0x00, 0x00, 0x0000 },
- { 16, 0x0051, 0x00000051, 0x01, 0x00, 0x0000 },
- { 16, 0x0071, 0x00000051, 0x02, 0x00, 0x0000 },
- { 16, 0x0051, 0x00000051, 0x03, 0x00, 0x0000 },
- { 16, 0x0071, 0x04000051, 0x04, 0x00, 0x0000 },
- { 16, 0x0071, 0x04000051, 0x05, 0x00, 0x0000 },
- { 16, 0x0071, 0x04000051, 0x06, 0x00, 0x0000 },
- { 16, 0x0071, 0x04000051, 0x07, 0x00, 0x0000 },
- { 16, 0x0071, 0x08000051, 0x08, 0x00, 0x0000 },
- { 16, 0x0071, 0x08000051, 0x09, 0x00, 0x0000 },
- { 16, 0x0071, 0x08000051, 0x0a, 0x00, 0x0000 },
- { 16, 0x0071, 0x08000051, 0x0b, 0x00, 0x0000 },
- { 16, 0x0071, 0x0c000051, 0x0c, 0x00, 0x0000 },
- { 16, 0x0071, 0x0c000051, 0x0d, 0x00, 0x0000 },
- { 16, 0x0071, 0x0c000051, 0x0e, 0x00, 0x0000 },
- { 16, 0x0071, 0x0c000051, 0x0f, 0x00, 0x0000 },
- { 17, 0x0077, 0x00000057, 0x00, 0x00, 0x0000 },
- { 17, 0x0057, 0x00000057, 0x01, 0x00, 0x0000 },
- { 17, 0x0077, 0x00000057, 0x02, 0x00, 0x0000 },
- { 17, 0x0057, 0x00000057, 0x03, 0x00, 0x0000 },
- { 17, 0x0077, 0x04000057, 0x04, 0x00, 0x0000 },
- { 17, 0x0077, 0x04000057, 0x05, 0x00, 0x0000 },
- { 17, 0x0077, 0x04000057, 0x06, 0x00, 0x0000 },
- { 17, 0x0077, 0x04000057, 0x07, 0x00, 0x0000 },
- { 17, 0x0077, 0x08000057, 0x08, 0x00, 0x0000 },
- { 17, 0x0077, 0x08000057, 0x09, 0x00, 0x0000 },
- { 17, 0x0077, 0x08000057, 0x0a, 0x00, 0x0000 },
- { 17, 0x0077, 0x08000057, 0x0b, 0x00, 0x0000 },
- { 17, 0x0077, 0x0c000057, 0x0c, 0x00, 0x0000 },
- { 17, 0x0077, 0x0c000057, 0x0d, 0x00, 0x0000 },
- { 17, 0x0077, 0x0c000057, 0x0e, 0x00, 0x0000 },
- { 17, 0x0077, 0x0c000057, 0x0f, 0x00, 0x0000 },
- { 18, 0x0065, 0x00000045, 0x00, 0x00, 0x0000 },
- { 18, 0x0045, 0x00000045, 0x01, 0x00, 0x0000 },
- { 18, 0x0065, 0x00000045, 0x02, 0x00, 0x0000 },
- { 18, 0x0045, 0x00000045, 0x03, 0x00, 0x0000 },
- { 18, 0x0065, 0x04000045, 0x04, 0x00, 0x0000 },
- { 18, 0x0065, 0x04000045, 0x05, 0x00, 0x0000 },
- { 18, 0x0065, 0x04000045, 0x06, 0x00, 0x0000 },
- { 18, 0x0065, 0x04000045, 0x07, 0x00, 0x0000 },
- { 18, 0x0065, 0x08000045, 0x08, 0x00, 0x0000 },
- { 18, 0x0065, 0x08000045, 0x09, 0x00, 0x0000 },
- { 18, 0x0065, 0x08000045, 0x0a, 0x00, 0x0000 },
- { 18, 0x0065, 0x08000045, 0x0b, 0x00, 0x0000 },
- { 18, 0x0065, 0x0c000045, 0x0c, 0x00, 0x0000 },
- { 18, 0x0065, 0x0c000045, 0x0d, 0x00, 0x0000 },
- { 18, 0x0065, 0x0c000045, 0x0e, 0x00, 0x0000 },
- { 18, 0x0065, 0x0c000045, 0x0f, 0x00, 0x0000 },
- { 19, 0x0072, 0x00000052, 0x00, 0x00, 0x0000 },
- { 19, 0x0052, 0x00000052, 0x01, 0x00, 0x0000 },
- { 19, 0x0072, 0x00000052, 0x02, 0x00, 0x0000 },
- { 19, 0x0052, 0x00000052, 0x03, 0x00, 0x0000 },
- { 19, 0x0072, 0x04000052, 0x04, 0x00, 0x0000 },
- { 19, 0x0072, 0x04000052, 0x05, 0x00, 0x0000 },
- { 19, 0x0072, 0x04000052, 0x06, 0x00, 0x0000 },
- { 19, 0x0072, 0x04000052, 0x07, 0x00, 0x0000 },
- { 19, 0x0072, 0x08000052, 0x08, 0x00, 0x0000 },
- { 19, 0x0072, 0x08000052, 0x09, 0x00, 0x0000 },
- { 19, 0x0072, 0x08000052, 0x0a, 0x00, 0x0000 },
- { 19, 0x0072, 0x08000052, 0x0b, 0x00, 0x0000 },
- { 19, 0x0072, 0x0c000052, 0x0c, 0x00, 0x0000 },
- { 19, 0x0072, 0x0c000052, 0x0d, 0x00, 0x0000 },
- { 19, 0x0072, 0x0c000052, 0x0e, 0x00, 0x0000 },
- { 19, 0x0072, 0x0c000052, 0x0f, 0x00, 0x0000 },
- { 20, 0x0074, 0x00000054, 0x00, 0x00, 0x0000 },
- { 20, 0x0054, 0x00000054, 0x01, 0x00, 0x0000 },
- { 20, 0x0074, 0x00000054, 0x02, 0x00, 0x0000 },
- { 20, 0x0054, 0x00000054, 0x03, 0x00, 0x0000 },
- { 20, 0x0074, 0x04000054, 0x04, 0x00, 0x0000 },
- { 20, 0x0074, 0x04000054, 0x05, 0x00, 0x0000 },
- { 20, 0x0074, 0x04000054, 0x06, 0x00, 0x0000 },
- { 20, 0x0074, 0x04000054, 0x07, 0x00, 0x0000 },
- { 20, 0x0074, 0x08000054, 0x08, 0x00, 0x0000 },
- { 20, 0x0074, 0x08000054, 0x09, 0x00, 0x0000 },
- { 20, 0x0074, 0x08000054, 0x0a, 0x00, 0x0000 },
- { 20, 0x0074, 0x08000054, 0x0b, 0x00, 0x0000 },
- { 20, 0x0074, 0x0c000054, 0x0c, 0x00, 0x0000 },
- { 20, 0x0074, 0x0c000054, 0x0d, 0x00, 0x0000 },
- { 20, 0x0074, 0x0c000054, 0x0e, 0x00, 0x0000 },
- { 20, 0x0074, 0x0c000054, 0x0f, 0x00, 0x0000 },
- { 21, 0x0079, 0x00000059, 0x00, 0x00, 0x0000 },
- { 21, 0x0059, 0x00000059, 0x01, 0x00, 0x0000 },
- { 21, 0x0079, 0x00000059, 0x02, 0x00, 0x0000 },
- { 21, 0x0059, 0x00000059, 0x03, 0x00, 0x0000 },
- { 21, 0x0079, 0x04000059, 0x04, 0x00, 0x0000 },
- { 21, 0x0079, 0x04000059, 0x05, 0x00, 0x0000 },
- { 21, 0x0079, 0x04000059, 0x06, 0x00, 0x0000 },
- { 21, 0x0079, 0x04000059, 0x07, 0x00, 0x0000 },
- { 21, 0x0079, 0x08000059, 0x08, 0x00, 0x0000 },
- { 21, 0x0079, 0x08000059, 0x09, 0x00, 0x0000 },
- { 21, 0x0079, 0x08000059, 0x0a, 0x00, 0x0000 },
- { 21, 0x0079, 0x08000059, 0x0b, 0x00, 0x0000 },
- { 21, 0x0079, 0x0c000059, 0x0c, 0x00, 0x0000 },
- { 21, 0x0079, 0x0c000059, 0x0d, 0x00, 0x0000 },
- { 21, 0x0079, 0x0c000059, 0x0e, 0x00, 0x0000 },
- { 21, 0x0079, 0x0c000059, 0x0f, 0x00, 0x0000 },
- { 22, 0x0075, 0x00000055, 0x00, 0x00, 0x0000 },
- { 22, 0x0055, 0x00000055, 0x01, 0x00, 0x0000 },
- { 22, 0x0075, 0x00000055, 0x02, 0x00, 0x0000 },
- { 22, 0x0055, 0x00000055, 0x03, 0x00, 0x0000 },
- { 22, 0x0075, 0x04000055, 0x04, 0x00, 0x0000 },
- { 22, 0x0075, 0x04000055, 0x05, 0x00, 0x0000 },
- { 22, 0x0075, 0x04000055, 0x06, 0x00, 0x0000 },
- { 22, 0x0075, 0x04000055, 0x07, 0x00, 0x0000 },
- { 22, 0x0075, 0x08000055, 0x08, 0x00, 0x0000 },
- { 22, 0x0075, 0x08000055, 0x09, 0x00, 0x0000 },
- { 22, 0x0075, 0x08000055, 0x0a, 0x00, 0x0000 },
- { 22, 0x0075, 0x08000055, 0x0b, 0x00, 0x0000 },
- { 22, 0x0075, 0x0c000055, 0x0c, 0x00, 0x0000 },
- { 22, 0x0075, 0x0c000055, 0x0d, 0x00, 0x0000 },
- { 22, 0x0075, 0x0c000055, 0x0e, 0x00, 0x0000 },
- { 22, 0x0075, 0x0c000055, 0x0f, 0x00, 0x0000 },
- { 23, 0x0069, 0x00000049, 0x00, 0x00, 0x0000 },
- { 23, 0x0049, 0x00000049, 0x01, 0x00, 0x0000 },
- { 23, 0x0069, 0x00000049, 0x02, 0x00, 0x0000 },
- { 23, 0x0049, 0x00000049, 0x03, 0x00, 0x0000 },
- { 23, 0x0069, 0x04000049, 0x04, 0x00, 0x0000 },
- { 23, 0x0069, 0x04000049, 0x05, 0x00, 0x0000 },
- { 23, 0x0069, 0x04000049, 0x06, 0x00, 0x0000 },
- { 23, 0x0069, 0x04000049, 0x07, 0x00, 0x0000 },
- { 23, 0x0069, 0x08000049, 0x08, 0x00, 0x0000 },
- { 23, 0x0069, 0x08000049, 0x09, 0x00, 0x0000 },
- { 23, 0x0069, 0x08000049, 0x0a, 0x00, 0x0000 },
- { 23, 0x0069, 0x08000049, 0x0b, 0x00, 0x0000 },
- { 23, 0x0069, 0x0c000049, 0x0c, 0x00, 0x0000 },
- { 23, 0x0069, 0x0c000049, 0x0d, 0x00, 0x0000 },
- { 23, 0x0069, 0x0c000049, 0x0e, 0x00, 0x0000 },
- { 23, 0x0069, 0x0c000049, 0x0f, 0x00, 0x0000 },
- { 24, 0x006f, 0x0000004f, 0x00, 0x00, 0x0000 },
- { 24, 0x004f, 0x0000004f, 0x01, 0x00, 0x0000 },
- { 24, 0x006f, 0x0000004f, 0x02, 0x00, 0x0000 },
- { 24, 0x004f, 0x0000004f, 0x03, 0x00, 0x0000 },
- { 24, 0x006f, 0x0400004f, 0x04, 0x00, 0x0000 },
- { 24, 0x006f, 0x0400004f, 0x05, 0x00, 0x0000 },
- { 24, 0x006f, 0x0400004f, 0x06, 0x00, 0x0000 },
- { 24, 0x006f, 0x0400004f, 0x07, 0x00, 0x0000 },
- { 24, 0x006f, 0x0800004f, 0x08, 0x00, 0x0000 },
- { 24, 0x006f, 0x0800004f, 0x09, 0x00, 0x0000 },
- { 24, 0x006f, 0x0800004f, 0x0a, 0x00, 0x0000 },
- { 24, 0x006f, 0x0800004f, 0x0b, 0x00, 0x0000 },
- { 24, 0x006f, 0x0c00004f, 0x0c, 0x00, 0x0000 },
- { 24, 0x006f, 0x0c00004f, 0x0d, 0x00, 0x0000 },
- { 24, 0x006f, 0x0c00004f, 0x0e, 0x00, 0x0000 },
- { 24, 0x006f, 0x0c00004f, 0x0f, 0x00, 0x0000 },
- { 25, 0x0070, 0x00000050, 0x00, 0x00, 0x0000 },
- { 25, 0x0050, 0x00000050, 0x01, 0x00, 0x0000 },
- { 25, 0x0070, 0x00000050, 0x02, 0x00, 0x0000 },
- { 25, 0x0050, 0x00000050, 0x03, 0x00, 0x0000 },
- { 25, 0x0070, 0x04000050, 0x04, 0x00, 0x0000 },
- { 25, 0x0070, 0x04000050, 0x05, 0x00, 0x0000 },
- { 25, 0x0070, 0x04000050, 0x06, 0x00, 0x0000 },
- { 25, 0x0070, 0x04000050, 0x07, 0x00, 0x0000 },
- { 25, 0x0070, 0x08000050, 0x08, 0x00, 0x0000 },
- { 25, 0x0070, 0x08000050, 0x09, 0x00, 0x0000 },
- { 25, 0x0070, 0x08000050, 0x0a, 0x00, 0x0000 },
- { 25, 0x0070, 0x08000050, 0x0b, 0x00, 0x0000 },
- { 25, 0x0070, 0x0c000050, 0x0c, 0x00, 0x0000 },
- { 25, 0x0070, 0x0c000050, 0x0d, 0x00, 0x0000 },
- { 25, 0x0070, 0x0c000050, 0x0e, 0x00, 0x0000 },
- { 25, 0x0070, 0x0c000050, 0x0f, 0x00, 0x0000 },
+ { 16, 0x0071, 0x00000051, 0x00, 0x02, 0x0000 },
+ { 16, 0x0051, 0x00000051, 0x01, 0x02, 0x0000 },
+ { 16, 0x0071, 0x00000051, 0x02, 0x02, 0x0000 },
+ { 16, 0x0051, 0x00000051, 0x03, 0x02, 0x0000 },
+ { 16, 0x0071, 0x04000051, 0x04, 0x02, 0x0000 },
+ { 16, 0x0071, 0x04000051, 0x05, 0x02, 0x0000 },
+ { 16, 0x0071, 0x04000051, 0x06, 0x02, 0x0000 },
+ { 16, 0x0071, 0x04000051, 0x07, 0x02, 0x0000 },
+ { 16, 0x0071, 0x08000051, 0x08, 0x02, 0x0000 },
+ { 16, 0x0071, 0x08000051, 0x09, 0x02, 0x0000 },
+ { 16, 0x0071, 0x08000051, 0x0a, 0x02, 0x0000 },
+ { 16, 0x0071, 0x08000051, 0x0b, 0x02, 0x0000 },
+ { 16, 0x0071, 0x0c000051, 0x0c, 0x02, 0x0000 },
+ { 16, 0x0071, 0x0c000051, 0x0d, 0x02, 0x0000 },
+ { 16, 0x0071, 0x0c000051, 0x0e, 0x02, 0x0000 },
+ { 16, 0x0071, 0x0c000051, 0x0f, 0x02, 0x0000 },
+ { 17, 0x0077, 0x00000057, 0x00, 0x02, 0x0000 },
+ { 17, 0x0057, 0x00000057, 0x01, 0x02, 0x0000 },
+ { 17, 0x0077, 0x00000057, 0x02, 0x02, 0x0000 },
+ { 17, 0x0057, 0x00000057, 0x03, 0x02, 0x0000 },
+ { 17, 0x0077, 0x04000057, 0x04, 0x02, 0x0000 },
+ { 17, 0x0077, 0x04000057, 0x05, 0x02, 0x0000 },
+ { 17, 0x0077, 0x04000057, 0x06, 0x02, 0x0000 },
+ { 17, 0x0077, 0x04000057, 0x07, 0x02, 0x0000 },
+ { 17, 0x0077, 0x08000057, 0x08, 0x02, 0x0000 },
+ { 17, 0x0077, 0x08000057, 0x09, 0x02, 0x0000 },
+ { 17, 0x0077, 0x08000057, 0x0a, 0x02, 0x0000 },
+ { 17, 0x0077, 0x08000057, 0x0b, 0x02, 0x0000 },
+ { 17, 0x0077, 0x0c000057, 0x0c, 0x02, 0x0000 },
+ { 17, 0x0077, 0x0c000057, 0x0d, 0x02, 0x0000 },
+ { 17, 0x0077, 0x0c000057, 0x0e, 0x02, 0x0000 },
+ { 17, 0x0077, 0x0c000057, 0x0f, 0x02, 0x0000 },
+ { 18, 0x0065, 0x00000045, 0x00, 0x02, 0x0000 },
+ { 18, 0x0045, 0x00000045, 0x01, 0x02, 0x0000 },
+ { 18, 0x0065, 0x00000045, 0x02, 0x02, 0x0000 },
+ { 18, 0x0045, 0x00000045, 0x03, 0x02, 0x0000 },
+ { 18, 0x0065, 0x04000045, 0x04, 0x02, 0x0000 },
+ { 18, 0x0065, 0x04000045, 0x05, 0x02, 0x0000 },
+ { 18, 0x0065, 0x04000045, 0x06, 0x02, 0x0000 },
+ { 18, 0x0065, 0x04000045, 0x07, 0x02, 0x0000 },
+ { 18, 0x0065, 0x08000045, 0x08, 0x02, 0x0000 },
+ { 18, 0x0065, 0x08000045, 0x09, 0x02, 0x0000 },
+ { 18, 0x0065, 0x08000045, 0x0a, 0x02, 0x0000 },
+ { 18, 0x0065, 0x08000045, 0x0b, 0x02, 0x0000 },
+ { 18, 0x0065, 0x0c000045, 0x0c, 0x02, 0x0000 },
+ { 18, 0x0065, 0x0c000045, 0x0d, 0x02, 0x0000 },
+ { 18, 0x0065, 0x0c000045, 0x0e, 0x02, 0x0000 },
+ { 18, 0x0065, 0x0c000045, 0x0f, 0x02, 0x0000 },
+ { 19, 0x0072, 0x00000052, 0x00, 0x02, 0x0000 },
+ { 19, 0x0052, 0x00000052, 0x01, 0x02, 0x0000 },
+ { 19, 0x0072, 0x00000052, 0x02, 0x02, 0x0000 },
+ { 19, 0x0052, 0x00000052, 0x03, 0x02, 0x0000 },
+ { 19, 0x0072, 0x04000052, 0x04, 0x02, 0x0000 },
+ { 19, 0x0072, 0x04000052, 0x05, 0x02, 0x0000 },
+ { 19, 0x0072, 0x04000052, 0x06, 0x02, 0x0000 },
+ { 19, 0x0072, 0x04000052, 0x07, 0x02, 0x0000 },
+ { 19, 0x0072, 0x08000052, 0x08, 0x02, 0x0000 },
+ { 19, 0x0072, 0x08000052, 0x09, 0x02, 0x0000 },
+ { 19, 0x0072, 0x08000052, 0x0a, 0x02, 0x0000 },
+ { 19, 0x0072, 0x08000052, 0x0b, 0x02, 0x0000 },
+ { 19, 0x0072, 0x0c000052, 0x0c, 0x02, 0x0000 },
+ { 19, 0x0072, 0x0c000052, 0x0d, 0x02, 0x0000 },
+ { 19, 0x0072, 0x0c000052, 0x0e, 0x02, 0x0000 },
+ { 19, 0x0072, 0x0c000052, 0x0f, 0x02, 0x0000 },
+ { 20, 0x0074, 0x00000054, 0x00, 0x02, 0x0000 },
+ { 20, 0x0054, 0x00000054, 0x01, 0x02, 0x0000 },
+ { 20, 0x0074, 0x00000054, 0x02, 0x02, 0x0000 },
+ { 20, 0x0054, 0x00000054, 0x03, 0x02, 0x0000 },
+ { 20, 0x0074, 0x04000054, 0x04, 0x02, 0x0000 },
+ { 20, 0x0074, 0x04000054, 0x05, 0x02, 0x0000 },
+ { 20, 0x0074, 0x04000054, 0x06, 0x02, 0x0000 },
+ { 20, 0x0074, 0x04000054, 0x07, 0x02, 0x0000 },
+ { 20, 0x0074, 0x08000054, 0x08, 0x02, 0x0000 },
+ { 20, 0x0074, 0x08000054, 0x09, 0x02, 0x0000 },
+ { 20, 0x0074, 0x08000054, 0x0a, 0x02, 0x0000 },
+ { 20, 0x0074, 0x08000054, 0x0b, 0x02, 0x0000 },
+ { 20, 0x0074, 0x0c000054, 0x0c, 0x02, 0x0000 },
+ { 20, 0x0074, 0x0c000054, 0x0d, 0x02, 0x0000 },
+ { 20, 0x0074, 0x0c000054, 0x0e, 0x02, 0x0000 },
+ { 20, 0x0074, 0x0c000054, 0x0f, 0x02, 0x0000 },
+ { 21, 0x0079, 0x00000059, 0x00, 0x02, 0x0000 },
+ { 21, 0x0059, 0x00000059, 0x01, 0x02, 0x0000 },
+ { 21, 0x0079, 0x00000059, 0x02, 0x02, 0x0000 },
+ { 21, 0x0059, 0x00000059, 0x03, 0x02, 0x0000 },
+ { 21, 0x0079, 0x04000059, 0x04, 0x02, 0x0000 },
+ { 21, 0x0079, 0x04000059, 0x05, 0x02, 0x0000 },
+ { 21, 0x0079, 0x04000059, 0x06, 0x02, 0x0000 },
+ { 21, 0x0079, 0x04000059, 0x07, 0x02, 0x0000 },
+ { 21, 0x0079, 0x08000059, 0x08, 0x02, 0x0000 },
+ { 21, 0x0079, 0x08000059, 0x09, 0x02, 0x0000 },
+ { 21, 0x0079, 0x08000059, 0x0a, 0x02, 0x0000 },
+ { 21, 0x0079, 0x08000059, 0x0b, 0x02, 0x0000 },
+ { 21, 0x0079, 0x0c000059, 0x0c, 0x02, 0x0000 },
+ { 21, 0x0079, 0x0c000059, 0x0d, 0x02, 0x0000 },
+ { 21, 0x0079, 0x0c000059, 0x0e, 0x02, 0x0000 },
+ { 21, 0x0079, 0x0c000059, 0x0f, 0x02, 0x0000 },
+ { 22, 0x0075, 0x00000055, 0x00, 0x02, 0x0000 },
+ { 22, 0x0055, 0x00000055, 0x01, 0x02, 0x0000 },
+ { 22, 0x0075, 0x00000055, 0x02, 0x02, 0x0000 },
+ { 22, 0x0055, 0x00000055, 0x03, 0x02, 0x0000 },
+ { 22, 0x0075, 0x04000055, 0x04, 0x02, 0x0000 },
+ { 22, 0x0075, 0x04000055, 0x05, 0x02, 0x0000 },
+ { 22, 0x0075, 0x04000055, 0x06, 0x02, 0x0000 },
+ { 22, 0x0075, 0x04000055, 0x07, 0x02, 0x0000 },
+ { 22, 0x0075, 0x08000055, 0x08, 0x02, 0x0000 },
+ { 22, 0x0075, 0x08000055, 0x09, 0x02, 0x0000 },
+ { 22, 0x0075, 0x08000055, 0x0a, 0x02, 0x0000 },
+ { 22, 0x0075, 0x08000055, 0x0b, 0x02, 0x0000 },
+ { 22, 0x0075, 0x0c000055, 0x0c, 0x02, 0x0000 },
+ { 22, 0x0075, 0x0c000055, 0x0d, 0x02, 0x0000 },
+ { 22, 0x0075, 0x0c000055, 0x0e, 0x02, 0x0000 },
+ { 22, 0x0075, 0x0c000055, 0x0f, 0x02, 0x0000 },
+ { 23, 0x0069, 0x00000049, 0x00, 0x02, 0x0000 },
+ { 23, 0x0049, 0x00000049, 0x01, 0x02, 0x0000 },
+ { 23, 0x0069, 0x00000049, 0x02, 0x02, 0x0000 },
+ { 23, 0x0049, 0x00000049, 0x03, 0x02, 0x0000 },
+ { 23, 0x0069, 0x04000049, 0x04, 0x02, 0x0000 },
+ { 23, 0x0069, 0x04000049, 0x05, 0x02, 0x0000 },
+ { 23, 0x0069, 0x04000049, 0x06, 0x02, 0x0000 },
+ { 23, 0x0069, 0x04000049, 0x07, 0x02, 0x0000 },
+ { 23, 0x0069, 0x08000049, 0x08, 0x02, 0x0000 },
+ { 23, 0x0069, 0x08000049, 0x09, 0x02, 0x0000 },
+ { 23, 0x0069, 0x08000049, 0x0a, 0x02, 0x0000 },
+ { 23, 0x0069, 0x08000049, 0x0b, 0x02, 0x0000 },
+ { 23, 0x0069, 0x0c000049, 0x0c, 0x02, 0x0000 },
+ { 23, 0x0069, 0x0c000049, 0x0d, 0x02, 0x0000 },
+ { 23, 0x0069, 0x0c000049, 0x0e, 0x02, 0x0000 },
+ { 23, 0x0069, 0x0c000049, 0x0f, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0000004f, 0x00, 0x02, 0x0000 },
+ { 24, 0x004f, 0x0000004f, 0x01, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0000004f, 0x02, 0x02, 0x0000 },
+ { 24, 0x004f, 0x0000004f, 0x03, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0400004f, 0x04, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0400004f, 0x05, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0400004f, 0x06, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0400004f, 0x07, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0800004f, 0x08, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0800004f, 0x09, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0800004f, 0x0a, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0800004f, 0x0b, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0c00004f, 0x0c, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0c00004f, 0x0d, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0c00004f, 0x0e, 0x02, 0x0000 },
+ { 24, 0x006f, 0x0c00004f, 0x0f, 0x02, 0x0000 },
+ { 25, 0x0070, 0x00000050, 0x00, 0x02, 0x0000 },
+ { 25, 0x0050, 0x00000050, 0x01, 0x02, 0x0000 },
+ { 25, 0x0070, 0x00000050, 0x02, 0x02, 0x0000 },
+ { 25, 0x0050, 0x00000050, 0x03, 0x02, 0x0000 },
+ { 25, 0x0070, 0x04000050, 0x04, 0x02, 0x0000 },
+ { 25, 0x0070, 0x04000050, 0x05, 0x02, 0x0000 },
+ { 25, 0x0070, 0x04000050, 0x06, 0x02, 0x0000 },
+ { 25, 0x0070, 0x04000050, 0x07, 0x02, 0x0000 },
+ { 25, 0x0070, 0x08000050, 0x08, 0x02, 0x0000 },
+ { 25, 0x0070, 0x08000050, 0x09, 0x02, 0x0000 },
+ { 25, 0x0070, 0x08000050, 0x0a, 0x02, 0x0000 },
+ { 25, 0x0070, 0x08000050, 0x0b, 0x02, 0x0000 },
+ { 25, 0x0070, 0x0c000050, 0x0c, 0x02, 0x0000 },
+ { 25, 0x0070, 0x0c000050, 0x0d, 0x02, 0x0000 },
+ { 25, 0x0070, 0x0c000050, 0x0e, 0x02, 0x0000 },
+ { 25, 0x0070, 0x0c000050, 0x0f, 0x02, 0x0000 },
{ 26, 0x005b, 0x0000005b, 0x00, 0x00, 0x0000 },
{ 26, 0x007b, 0x0000007b, 0x01, 0x00, 0x0000 },
{ 26, 0xffff, 0x01000000, 0x04, 0x00, 0x0000 },
@@ -259,150 +259,150 @@ const QEvdevKeyboardMap::Mapping QEvdevKeyboardHandler::s_keymap_default[] = {
{ 28, 0xffff, 0x01000004, 0x00, 0x00, 0x0000 },
{ 28, 0x006d, 0x0c00004d, 0x08, 0x00, 0x0000 },
{ 29, 0xffff, 0x01000021, 0x00, 0x04, 0x0004 },
- { 30, 0x0061, 0x00000041, 0x00, 0x00, 0x0000 },
- { 30, 0x0041, 0x00000041, 0x01, 0x00, 0x0000 },
- { 30, 0x0061, 0x00000041, 0x02, 0x00, 0x0000 },
- { 30, 0x0041, 0x00000041, 0x03, 0x00, 0x0000 },
- { 30, 0x0061, 0x04000041, 0x04, 0x00, 0x0000 },
- { 30, 0x0061, 0x04000041, 0x05, 0x00, 0x0000 },
- { 30, 0x0061, 0x04000041, 0x06, 0x00, 0x0000 },
- { 30, 0x0061, 0x04000041, 0x07, 0x00, 0x0000 },
- { 30, 0x0061, 0x08000041, 0x08, 0x00, 0x0000 },
- { 30, 0x0061, 0x08000041, 0x09, 0x00, 0x0000 },
- { 30, 0x0061, 0x08000041, 0x0a, 0x00, 0x0000 },
- { 30, 0x0061, 0x08000041, 0x0b, 0x00, 0x0000 },
- { 30, 0x0061, 0x0c000041, 0x0c, 0x00, 0x0000 },
- { 30, 0x0061, 0x0c000041, 0x0d, 0x00, 0x0000 },
- { 30, 0x0061, 0x0c000041, 0x0e, 0x00, 0x0000 },
- { 30, 0x0061, 0x0c000041, 0x0f, 0x00, 0x0000 },
- { 31, 0x0073, 0x00000053, 0x00, 0x00, 0x0000 },
- { 31, 0x0053, 0x00000053, 0x01, 0x00, 0x0000 },
- { 31, 0x0073, 0x00000053, 0x02, 0x00, 0x0000 },
- { 31, 0x0053, 0x00000053, 0x03, 0x00, 0x0000 },
- { 31, 0x0073, 0x04000053, 0x04, 0x00, 0x0000 },
- { 31, 0x0073, 0x04000053, 0x05, 0x00, 0x0000 },
- { 31, 0x0073, 0x04000053, 0x06, 0x00, 0x0000 },
- { 31, 0x0073, 0x04000053, 0x07, 0x00, 0x0000 },
- { 31, 0x0073, 0x08000053, 0x08, 0x00, 0x0000 },
- { 31, 0x0073, 0x08000053, 0x09, 0x00, 0x0000 },
- { 31, 0x0073, 0x08000053, 0x0a, 0x00, 0x0000 },
- { 31, 0x0073, 0x08000053, 0x0b, 0x00, 0x0000 },
- { 31, 0x0073, 0x0c000053, 0x0c, 0x00, 0x0000 },
- { 31, 0x0073, 0x0c000053, 0x0d, 0x00, 0x0000 },
- { 31, 0x0073, 0x0c000053, 0x0e, 0x00, 0x0000 },
- { 31, 0x0073, 0x0c000053, 0x0f, 0x00, 0x0000 },
- { 32, 0x0064, 0x00000044, 0x00, 0x00, 0x0000 },
- { 32, 0x0044, 0x00000044, 0x01, 0x00, 0x0000 },
- { 32, 0x0064, 0x00000044, 0x02, 0x00, 0x0000 },
- { 32, 0x0044, 0x00000044, 0x03, 0x00, 0x0000 },
- { 32, 0x0064, 0x04000044, 0x04, 0x00, 0x0000 },
- { 32, 0x0064, 0x04000044, 0x05, 0x00, 0x0000 },
- { 32, 0x0064, 0x04000044, 0x06, 0x00, 0x0000 },
- { 32, 0x0064, 0x04000044, 0x07, 0x00, 0x0000 },
- { 32, 0x0064, 0x08000044, 0x08, 0x00, 0x0000 },
- { 32, 0x0064, 0x08000044, 0x09, 0x00, 0x0000 },
- { 32, 0x0064, 0x08000044, 0x0a, 0x00, 0x0000 },
- { 32, 0x0064, 0x08000044, 0x0b, 0x00, 0x0000 },
- { 32, 0x0064, 0x0c000044, 0x0c, 0x00, 0x0000 },
- { 32, 0x0064, 0x0c000044, 0x0d, 0x00, 0x0000 },
- { 32, 0x0064, 0x0c000044, 0x0e, 0x00, 0x0000 },
- { 32, 0x0064, 0x0c000044, 0x0f, 0x00, 0x0000 },
- { 33, 0x0066, 0x00000046, 0x00, 0x00, 0x0000 },
- { 33, 0x0046, 0x00000046, 0x01, 0x00, 0x0000 },
- { 33, 0x0066, 0x00000046, 0x02, 0x00, 0x0000 },
- { 33, 0x0046, 0x00000046, 0x03, 0x00, 0x0000 },
- { 33, 0x0066, 0x04000046, 0x04, 0x00, 0x0000 },
- { 33, 0x0066, 0x04000046, 0x05, 0x00, 0x0000 },
- { 33, 0x0066, 0x04000046, 0x06, 0x00, 0x0000 },
- { 33, 0x0066, 0x04000046, 0x07, 0x00, 0x0000 },
- { 33, 0x0066, 0x08000046, 0x08, 0x00, 0x0000 },
- { 33, 0x0066, 0x08000046, 0x09, 0x00, 0x0000 },
- { 33, 0x0066, 0x08000046, 0x0a, 0x00, 0x0000 },
- { 33, 0x0066, 0x08000046, 0x0b, 0x00, 0x0000 },
- { 33, 0x0066, 0x0c000046, 0x0c, 0x00, 0x0000 },
- { 33, 0x0066, 0x0c000046, 0x0d, 0x00, 0x0000 },
- { 33, 0x0066, 0x0c000046, 0x0e, 0x00, 0x0000 },
- { 33, 0x0066, 0x0c000046, 0x0f, 0x00, 0x0000 },
- { 34, 0x0067, 0x00000047, 0x00, 0x00, 0x0000 },
- { 34, 0x0047, 0x00000047, 0x01, 0x00, 0x0000 },
- { 34, 0x0067, 0x00000047, 0x02, 0x00, 0x0000 },
- { 34, 0x0047, 0x00000047, 0x03, 0x00, 0x0000 },
- { 34, 0x0067, 0x04000047, 0x04, 0x00, 0x0000 },
- { 34, 0x0067, 0x04000047, 0x05, 0x00, 0x0000 },
- { 34, 0x0067, 0x04000047, 0x06, 0x00, 0x0000 },
- { 34, 0x0067, 0x04000047, 0x07, 0x00, 0x0000 },
- { 34, 0x0067, 0x08000047, 0x08, 0x00, 0x0000 },
- { 34, 0x0067, 0x08000047, 0x09, 0x00, 0x0000 },
- { 34, 0x0067, 0x08000047, 0x0a, 0x00, 0x0000 },
- { 34, 0x0067, 0x08000047, 0x0b, 0x00, 0x0000 },
- { 34, 0x0067, 0x0c000047, 0x0c, 0x00, 0x0000 },
- { 34, 0x0067, 0x0c000047, 0x0d, 0x00, 0x0000 },
- { 34, 0x0067, 0x0c000047, 0x0e, 0x00, 0x0000 },
- { 34, 0x0067, 0x0c000047, 0x0f, 0x00, 0x0000 },
- { 35, 0x0068, 0x00000048, 0x00, 0x00, 0x0000 },
- { 35, 0x0048, 0x00000048, 0x01, 0x00, 0x0000 },
- { 35, 0x0068, 0x00000048, 0x02, 0x00, 0x0000 },
- { 35, 0x0048, 0x00000048, 0x03, 0x00, 0x0000 },
- { 35, 0x0068, 0x04000048, 0x04, 0x00, 0x0000 },
- { 35, 0x0068, 0x04000048, 0x05, 0x00, 0x0000 },
- { 35, 0x0068, 0x04000048, 0x06, 0x00, 0x0000 },
- { 35, 0x0068, 0x04000048, 0x07, 0x00, 0x0000 },
- { 35, 0x0068, 0x08000048, 0x08, 0x00, 0x0000 },
- { 35, 0x0068, 0x08000048, 0x09, 0x00, 0x0000 },
- { 35, 0x0068, 0x08000048, 0x0a, 0x00, 0x0000 },
- { 35, 0x0068, 0x08000048, 0x0b, 0x00, 0x0000 },
- { 35, 0x0068, 0x0c000048, 0x0c, 0x00, 0x0000 },
- { 35, 0x0068, 0x0c000048, 0x0d, 0x00, 0x0000 },
- { 35, 0x0068, 0x0c000048, 0x0e, 0x00, 0x0000 },
- { 35, 0x0068, 0x0c000048, 0x0f, 0x00, 0x0000 },
- { 36, 0x006a, 0x0000004a, 0x00, 0x00, 0x0000 },
- { 36, 0x004a, 0x0000004a, 0x01, 0x00, 0x0000 },
- { 36, 0x006a, 0x0000004a, 0x02, 0x00, 0x0000 },
- { 36, 0x004a, 0x0000004a, 0x03, 0x00, 0x0000 },
- { 36, 0x006a, 0x0400004a, 0x04, 0x00, 0x0000 },
- { 36, 0x006a, 0x0400004a, 0x05, 0x00, 0x0000 },
- { 36, 0x006a, 0x0400004a, 0x06, 0x00, 0x0000 },
- { 36, 0x006a, 0x0400004a, 0x07, 0x00, 0x0000 },
- { 36, 0x006a, 0x0800004a, 0x08, 0x00, 0x0000 },
- { 36, 0x006a, 0x0800004a, 0x09, 0x00, 0x0000 },
- { 36, 0x006a, 0x0800004a, 0x0a, 0x00, 0x0000 },
- { 36, 0x006a, 0x0800004a, 0x0b, 0x00, 0x0000 },
- { 36, 0x006a, 0x0c00004a, 0x0c, 0x00, 0x0000 },
- { 36, 0x006a, 0x0c00004a, 0x0d, 0x00, 0x0000 },
- { 36, 0x006a, 0x0c00004a, 0x0e, 0x00, 0x0000 },
- { 36, 0x006a, 0x0c00004a, 0x0f, 0x00, 0x0000 },
- { 37, 0x006b, 0x0000004b, 0x00, 0x00, 0x0000 },
- { 37, 0x004b, 0x0000004b, 0x01, 0x00, 0x0000 },
- { 37, 0x006b, 0x0000004b, 0x02, 0x00, 0x0000 },
- { 37, 0x004b, 0x0000004b, 0x03, 0x00, 0x0000 },
- { 37, 0x006b, 0x0400004b, 0x04, 0x00, 0x0000 },
- { 37, 0x006b, 0x0400004b, 0x05, 0x00, 0x0000 },
- { 37, 0x006b, 0x0400004b, 0x06, 0x00, 0x0000 },
- { 37, 0x006b, 0x0400004b, 0x07, 0x00, 0x0000 },
- { 37, 0x006b, 0x0800004b, 0x08, 0x00, 0x0000 },
- { 37, 0x006b, 0x0800004b, 0x09, 0x00, 0x0000 },
- { 37, 0x006b, 0x0800004b, 0x0a, 0x00, 0x0000 },
- { 37, 0x006b, 0x0800004b, 0x0b, 0x00, 0x0000 },
- { 37, 0x006b, 0x0c00004b, 0x0c, 0x00, 0x0000 },
- { 37, 0x006b, 0x0c00004b, 0x0d, 0x00, 0x0000 },
- { 37, 0x006b, 0x0c00004b, 0x0e, 0x00, 0x0000 },
- { 37, 0x006b, 0x0c00004b, 0x0f, 0x00, 0x0000 },
- { 38, 0x006c, 0x0000004c, 0x00, 0x00, 0x0000 },
- { 38, 0x004c, 0x0000004c, 0x01, 0x00, 0x0000 },
- { 38, 0x006c, 0x0000004c, 0x02, 0x00, 0x0000 },
- { 38, 0x004c, 0x0000004c, 0x03, 0x00, 0x0000 },
- { 38, 0x006c, 0x0400004c, 0x04, 0x00, 0x0000 },
- { 38, 0x006c, 0x0400004c, 0x05, 0x00, 0x0000 },
- { 38, 0x006c, 0x0400004c, 0x06, 0x00, 0x0000 },
- { 38, 0x006c, 0x0400004c, 0x07, 0x00, 0x0000 },
- { 38, 0x006c, 0x0800004c, 0x08, 0x00, 0x0000 },
- { 38, 0x006c, 0x0800004c, 0x09, 0x00, 0x0000 },
- { 38, 0x006c, 0x0800004c, 0x0a, 0x00, 0x0000 },
- { 38, 0x006c, 0x0800004c, 0x0b, 0x00, 0x0000 },
- { 38, 0x006c, 0x0c00004c, 0x0c, 0x00, 0x0000 },
- { 38, 0x006c, 0x0c00004c, 0x0d, 0x00, 0x0000 },
- { 38, 0x006c, 0x0c00004c, 0x0e, 0x00, 0x0000 },
- { 38, 0x006c, 0x0c00004c, 0x0f, 0x00, 0x0000 },
+ { 30, 0x0061, 0x00000041, 0x00, 0x02, 0x0000 },
+ { 30, 0x0041, 0x00000041, 0x01, 0x02, 0x0000 },
+ { 30, 0x0061, 0x00000041, 0x02, 0x02, 0x0000 },
+ { 30, 0x0041, 0x00000041, 0x03, 0x02, 0x0000 },
+ { 30, 0x0061, 0x04000041, 0x04, 0x02, 0x0000 },
+ { 30, 0x0061, 0x04000041, 0x05, 0x02, 0x0000 },
+ { 30, 0x0061, 0x04000041, 0x06, 0x02, 0x0000 },
+ { 30, 0x0061, 0x04000041, 0x07, 0x02, 0x0000 },
+ { 30, 0x0061, 0x08000041, 0x08, 0x02, 0x0000 },
+ { 30, 0x0061, 0x08000041, 0x09, 0x02, 0x0000 },
+ { 30, 0x0061, 0x08000041, 0x0a, 0x02, 0x0000 },
+ { 30, 0x0061, 0x08000041, 0x0b, 0x02, 0x0000 },
+ { 30, 0x0061, 0x0c000041, 0x0c, 0x02, 0x0000 },
+ { 30, 0x0061, 0x0c000041, 0x0d, 0x02, 0x0000 },
+ { 30, 0x0061, 0x0c000041, 0x0e, 0x02, 0x0000 },
+ { 30, 0x0061, 0x0c000041, 0x0f, 0x02, 0x0000 },
+ { 31, 0x0073, 0x00000053, 0x00, 0x02, 0x0000 },
+ { 31, 0x0053, 0x00000053, 0x01, 0x02, 0x0000 },
+ { 31, 0x0073, 0x00000053, 0x02, 0x02, 0x0000 },
+ { 31, 0x0053, 0x00000053, 0x03, 0x02, 0x0000 },
+ { 31, 0x0073, 0x04000053, 0x04, 0x02, 0x0000 },
+ { 31, 0x0073, 0x04000053, 0x05, 0x02, 0x0000 },
+ { 31, 0x0073, 0x04000053, 0x06, 0x02, 0x0000 },
+ { 31, 0x0073, 0x04000053, 0x07, 0x02, 0x0000 },
+ { 31, 0x0073, 0x08000053, 0x08, 0x02, 0x0000 },
+ { 31, 0x0073, 0x08000053, 0x09, 0x02, 0x0000 },
+ { 31, 0x0073, 0x08000053, 0x0a, 0x02, 0x0000 },
+ { 31, 0x0073, 0x08000053, 0x0b, 0x02, 0x0000 },
+ { 31, 0x0073, 0x0c000053, 0x0c, 0x02, 0x0000 },
+ { 31, 0x0073, 0x0c000053, 0x0d, 0x02, 0x0000 },
+ { 31, 0x0073, 0x0c000053, 0x0e, 0x02, 0x0000 },
+ { 31, 0x0073, 0x0c000053, 0x0f, 0x02, 0x0000 },
+ { 32, 0x0064, 0x00000044, 0x00, 0x02, 0x0000 },
+ { 32, 0x0044, 0x00000044, 0x01, 0x02, 0x0000 },
+ { 32, 0x0064, 0x00000044, 0x02, 0x02, 0x0000 },
+ { 32, 0x0044, 0x00000044, 0x03, 0x02, 0x0000 },
+ { 32, 0x0064, 0x04000044, 0x04, 0x02, 0x0000 },
+ { 32, 0x0064, 0x04000044, 0x05, 0x02, 0x0000 },
+ { 32, 0x0064, 0x04000044, 0x06, 0x02, 0x0000 },
+ { 32, 0x0064, 0x04000044, 0x07, 0x02, 0x0000 },
+ { 32, 0x0064, 0x08000044, 0x08, 0x02, 0x0000 },
+ { 32, 0x0064, 0x08000044, 0x09, 0x02, 0x0000 },
+ { 32, 0x0064, 0x08000044, 0x0a, 0x02, 0x0000 },
+ { 32, 0x0064, 0x08000044, 0x0b, 0x02, 0x0000 },
+ { 32, 0x0064, 0x0c000044, 0x0c, 0x02, 0x0000 },
+ { 32, 0x0064, 0x0c000044, 0x0d, 0x02, 0x0000 },
+ { 32, 0x0064, 0x0c000044, 0x0e, 0x02, 0x0000 },
+ { 32, 0x0064, 0x0c000044, 0x0f, 0x02, 0x0000 },
+ { 33, 0x0066, 0x00000046, 0x00, 0x02, 0x0000 },
+ { 33, 0x0046, 0x00000046, 0x01, 0x02, 0x0000 },
+ { 33, 0x0066, 0x00000046, 0x02, 0x02, 0x0000 },
+ { 33, 0x0046, 0x00000046, 0x03, 0x02, 0x0000 },
+ { 33, 0x0066, 0x04000046, 0x04, 0x02, 0x0000 },
+ { 33, 0x0066, 0x04000046, 0x05, 0x02, 0x0000 },
+ { 33, 0x0066, 0x04000046, 0x06, 0x02, 0x0000 },
+ { 33, 0x0066, 0x04000046, 0x07, 0x02, 0x0000 },
+ { 33, 0x0066, 0x08000046, 0x08, 0x02, 0x0000 },
+ { 33, 0x0066, 0x08000046, 0x09, 0x02, 0x0000 },
+ { 33, 0x0066, 0x08000046, 0x0a, 0x02, 0x0000 },
+ { 33, 0x0066, 0x08000046, 0x0b, 0x02, 0x0000 },
+ { 33, 0x0066, 0x0c000046, 0x0c, 0x02, 0x0000 },
+ { 33, 0x0066, 0x0c000046, 0x0d, 0x02, 0x0000 },
+ { 33, 0x0066, 0x0c000046, 0x0e, 0x02, 0x0000 },
+ { 33, 0x0066, 0x0c000046, 0x0f, 0x02, 0x0000 },
+ { 34, 0x0067, 0x00000047, 0x00, 0x02, 0x0000 },
+ { 34, 0x0047, 0x00000047, 0x01, 0x02, 0x0000 },
+ { 34, 0x0067, 0x00000047, 0x02, 0x02, 0x0000 },
+ { 34, 0x0047, 0x00000047, 0x03, 0x02, 0x0000 },
+ { 34, 0x0067, 0x04000047, 0x04, 0x02, 0x0000 },
+ { 34, 0x0067, 0x04000047, 0x05, 0x02, 0x0000 },
+ { 34, 0x0067, 0x04000047, 0x06, 0x02, 0x0000 },
+ { 34, 0x0067, 0x04000047, 0x07, 0x02, 0x0000 },
+ { 34, 0x0067, 0x08000047, 0x08, 0x02, 0x0000 },
+ { 34, 0x0067, 0x08000047, 0x09, 0x02, 0x0000 },
+ { 34, 0x0067, 0x08000047, 0x0a, 0x02, 0x0000 },
+ { 34, 0x0067, 0x08000047, 0x0b, 0x02, 0x0000 },
+ { 34, 0x0067, 0x0c000047, 0x0c, 0x02, 0x0000 },
+ { 34, 0x0067, 0x0c000047, 0x0d, 0x02, 0x0000 },
+ { 34, 0x0067, 0x0c000047, 0x0e, 0x02, 0x0000 },
+ { 34, 0x0067, 0x0c000047, 0x0f, 0x02, 0x0000 },
+ { 35, 0x0068, 0x00000048, 0x00, 0x02, 0x0000 },
+ { 35, 0x0048, 0x00000048, 0x01, 0x02, 0x0000 },
+ { 35, 0x0068, 0x00000048, 0x02, 0x02, 0x0000 },
+ { 35, 0x0048, 0x00000048, 0x03, 0x02, 0x0000 },
+ { 35, 0x0068, 0x04000048, 0x04, 0x02, 0x0000 },
+ { 35, 0x0068, 0x04000048, 0x05, 0x02, 0x0000 },
+ { 35, 0x0068, 0x04000048, 0x06, 0x02, 0x0000 },
+ { 35, 0x0068, 0x04000048, 0x07, 0x02, 0x0000 },
+ { 35, 0x0068, 0x08000048, 0x08, 0x02, 0x0000 },
+ { 35, 0x0068, 0x08000048, 0x09, 0x02, 0x0000 },
+ { 35, 0x0068, 0x08000048, 0x0a, 0x02, 0x0000 },
+ { 35, 0x0068, 0x08000048, 0x0b, 0x02, 0x0000 },
+ { 35, 0x0068, 0x0c000048, 0x0c, 0x02, 0x0000 },
+ { 35, 0x0068, 0x0c000048, 0x0d, 0x02, 0x0000 },
+ { 35, 0x0068, 0x0c000048, 0x0e, 0x02, 0x0000 },
+ { 35, 0x0068, 0x0c000048, 0x0f, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0000004a, 0x00, 0x02, 0x0000 },
+ { 36, 0x004a, 0x0000004a, 0x01, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0000004a, 0x02, 0x02, 0x0000 },
+ { 36, 0x004a, 0x0000004a, 0x03, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0400004a, 0x04, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0400004a, 0x05, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0400004a, 0x06, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0400004a, 0x07, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0800004a, 0x08, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0800004a, 0x09, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0800004a, 0x0a, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0800004a, 0x0b, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0c00004a, 0x0c, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0c00004a, 0x0d, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0c00004a, 0x0e, 0x02, 0x0000 },
+ { 36, 0x006a, 0x0c00004a, 0x0f, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0000004b, 0x00, 0x02, 0x0000 },
+ { 37, 0x004b, 0x0000004b, 0x01, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0000004b, 0x02, 0x02, 0x0000 },
+ { 37, 0x004b, 0x0000004b, 0x03, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0400004b, 0x04, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0400004b, 0x05, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0400004b, 0x06, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0400004b, 0x07, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0800004b, 0x08, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0800004b, 0x09, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0800004b, 0x0a, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0800004b, 0x0b, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0c00004b, 0x0c, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0c00004b, 0x0d, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0c00004b, 0x0e, 0x02, 0x0000 },
+ { 37, 0x006b, 0x0c00004b, 0x0f, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0000004c, 0x00, 0x02, 0x0000 },
+ { 38, 0x004c, 0x0000004c, 0x01, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0000004c, 0x02, 0x02, 0x0000 },
+ { 38, 0x004c, 0x0000004c, 0x03, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0400004c, 0x04, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0400004c, 0x05, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0400004c, 0x06, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0400004c, 0x07, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0800004c, 0x08, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0800004c, 0x09, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0800004c, 0x0a, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0800004c, 0x0b, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0c00004c, 0x0c, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0c00004c, 0x0d, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0c00004c, 0x0e, 0x02, 0x0000 },
+ { 38, 0x006c, 0x0c00004c, 0x0f, 0x02, 0x0000 },
{ 39, 0x003b, 0x0000003b, 0x00, 0x00, 0x0000 },
{ 39, 0x003a, 0x0000003a, 0x01, 0x00, 0x0000 },
{ 40, 0x0027, 0x00000027, 0x00, 0x00, 0x0000 },
@@ -418,118 +418,118 @@ const QEvdevKeyboardMap::Mapping QEvdevKeyboardHandler::s_keymap_default[] = {
{ 43, 0x005c, 0x0000005c, 0x00, 0x00, 0x0000 },
{ 43, 0x007c, 0x0000007c, 0x01, 0x00, 0x0000 },
{ 43, 0x005c, 0x0400005c, 0x04, 0x00, 0x0000 },
- { 44, 0x007a, 0x0000005a, 0x00, 0x00, 0x0000 },
- { 44, 0x005a, 0x0000005a, 0x01, 0x00, 0x0000 },
- { 44, 0x007a, 0x0000005a, 0x02, 0x00, 0x0000 },
- { 44, 0x005a, 0x0000005a, 0x03, 0x00, 0x0000 },
- { 44, 0x007a, 0x0400005a, 0x04, 0x00, 0x0000 },
- { 44, 0x007a, 0x0400005a, 0x05, 0x00, 0x0000 },
- { 44, 0x007a, 0x0400005a, 0x06, 0x00, 0x0000 },
- { 44, 0x007a, 0x0400005a, 0x07, 0x00, 0x0000 },
- { 44, 0x007a, 0x0800005a, 0x08, 0x00, 0x0000 },
- { 44, 0x007a, 0x0800005a, 0x09, 0x00, 0x0000 },
- { 44, 0x007a, 0x0800005a, 0x0a, 0x00, 0x0000 },
- { 44, 0x007a, 0x0800005a, 0x0b, 0x00, 0x0000 },
- { 44, 0x007a, 0x0c00005a, 0x0c, 0x00, 0x0000 },
- { 44, 0x007a, 0x0c00005a, 0x0d, 0x00, 0x0000 },
- { 44, 0x007a, 0x0c00005a, 0x0e, 0x00, 0x0000 },
- { 44, 0x007a, 0x0c00005a, 0x0f, 0x00, 0x0000 },
- { 45, 0x0078, 0x00000058, 0x00, 0x00, 0x0000 },
- { 45, 0x0058, 0x00000058, 0x01, 0x00, 0x0000 },
- { 45, 0x0078, 0x00000058, 0x02, 0x00, 0x0000 },
- { 45, 0x0058, 0x00000058, 0x03, 0x00, 0x0000 },
- { 45, 0x0078, 0x04000058, 0x04, 0x00, 0x0000 },
- { 45, 0x0078, 0x04000058, 0x05, 0x00, 0x0000 },
- { 45, 0x0078, 0x04000058, 0x06, 0x00, 0x0000 },
- { 45, 0x0078, 0x04000058, 0x07, 0x00, 0x0000 },
- { 45, 0x0078, 0x08000058, 0x08, 0x00, 0x0000 },
- { 45, 0x0078, 0x08000058, 0x09, 0x00, 0x0000 },
- { 45, 0x0078, 0x08000058, 0x0a, 0x00, 0x0000 },
- { 45, 0x0078, 0x08000058, 0x0b, 0x00, 0x0000 },
- { 45, 0x0078, 0x0c000058, 0x0c, 0x00, 0x0000 },
- { 45, 0x0078, 0x0c000058, 0x0d, 0x00, 0x0000 },
- { 45, 0x0078, 0x0c000058, 0x0e, 0x00, 0x0000 },
- { 45, 0x0078, 0x0c000058, 0x0f, 0x00, 0x0000 },
- { 46, 0x0063, 0x00000043, 0x00, 0x00, 0x0000 },
- { 46, 0x0043, 0x00000043, 0x01, 0x00, 0x0000 },
- { 46, 0x0063, 0x00000043, 0x02, 0x00, 0x0000 },
- { 46, 0x0043, 0x00000043, 0x03, 0x00, 0x0000 },
- { 46, 0x0063, 0x04000043, 0x04, 0x00, 0x0000 },
- { 46, 0x0063, 0x04000043, 0x05, 0x00, 0x0000 },
- { 46, 0x0063, 0x04000043, 0x06, 0x00, 0x0000 },
- { 46, 0x0063, 0x04000043, 0x07, 0x00, 0x0000 },
- { 46, 0x0063, 0x08000043, 0x08, 0x00, 0x0000 },
- { 46, 0x0063, 0x08000043, 0x09, 0x00, 0x0000 },
- { 46, 0x0063, 0x08000043, 0x0a, 0x00, 0x0000 },
- { 46, 0x0063, 0x08000043, 0x0b, 0x00, 0x0000 },
- { 46, 0x0063, 0x0c000043, 0x0c, 0x00, 0x0000 },
- { 46, 0x0063, 0x0c000043, 0x0d, 0x00, 0x0000 },
- { 46, 0x0063, 0x0c000043, 0x0e, 0x00, 0x0000 },
- { 46, 0x0063, 0x0c000043, 0x0f, 0x00, 0x0000 },
- { 47, 0x0076, 0x00000056, 0x00, 0x00, 0x0000 },
- { 47, 0x0056, 0x00000056, 0x01, 0x00, 0x0000 },
- { 47, 0x0076, 0x00000056, 0x02, 0x00, 0x0000 },
- { 47, 0x0056, 0x00000056, 0x03, 0x00, 0x0000 },
- { 47, 0x0076, 0x04000056, 0x04, 0x00, 0x0000 },
- { 47, 0x0076, 0x04000056, 0x05, 0x00, 0x0000 },
- { 47, 0x0076, 0x04000056, 0x06, 0x00, 0x0000 },
- { 47, 0x0076, 0x04000056, 0x07, 0x00, 0x0000 },
- { 47, 0x0076, 0x08000056, 0x08, 0x00, 0x0000 },
- { 47, 0x0076, 0x08000056, 0x09, 0x00, 0x0000 },
- { 47, 0x0076, 0x08000056, 0x0a, 0x00, 0x0000 },
- { 47, 0x0076, 0x08000056, 0x0b, 0x00, 0x0000 },
- { 47, 0x0076, 0x0c000056, 0x0c, 0x00, 0x0000 },
- { 47, 0x0076, 0x0c000056, 0x0d, 0x00, 0x0000 },
- { 47, 0x0076, 0x0c000056, 0x0e, 0x00, 0x0000 },
- { 47, 0x0076, 0x0c000056, 0x0f, 0x00, 0x0000 },
- { 48, 0x0062, 0x00000042, 0x00, 0x00, 0x0000 },
- { 48, 0x0042, 0x00000042, 0x01, 0x00, 0x0000 },
- { 48, 0x0062, 0x00000042, 0x02, 0x00, 0x0000 },
- { 48, 0x0042, 0x00000042, 0x03, 0x00, 0x0000 },
- { 48, 0x0062, 0x04000042, 0x04, 0x00, 0x0000 },
- { 48, 0x0062, 0x04000042, 0x05, 0x00, 0x0000 },
- { 48, 0x0062, 0x04000042, 0x06, 0x00, 0x0000 },
- { 48, 0x0062, 0x04000042, 0x07, 0x00, 0x0000 },
- { 48, 0x0062, 0x08000042, 0x08, 0x00, 0x0000 },
- { 48, 0x0062, 0x08000042, 0x09, 0x00, 0x0000 },
- { 48, 0x0062, 0x08000042, 0x0a, 0x00, 0x0000 },
- { 48, 0x0062, 0x08000042, 0x0b, 0x00, 0x0000 },
- { 48, 0x0062, 0x0c000042, 0x0c, 0x00, 0x0000 },
- { 48, 0x0062, 0x0c000042, 0x0d, 0x00, 0x0000 },
- { 48, 0x0062, 0x0c000042, 0x0e, 0x00, 0x0000 },
- { 48, 0x0062, 0x0c000042, 0x0f, 0x00, 0x0000 },
- { 49, 0x006e, 0x0000004e, 0x00, 0x00, 0x0000 },
- { 49, 0x004e, 0x0000004e, 0x01, 0x00, 0x0000 },
- { 49, 0x006e, 0x0000004e, 0x02, 0x00, 0x0000 },
- { 49, 0x004e, 0x0000004e, 0x03, 0x00, 0x0000 },
- { 49, 0x006e, 0x0400004e, 0x04, 0x00, 0x0000 },
- { 49, 0x006e, 0x0400004e, 0x05, 0x00, 0x0000 },
- { 49, 0x006e, 0x0400004e, 0x06, 0x00, 0x0000 },
- { 49, 0x006e, 0x0400004e, 0x07, 0x00, 0x0000 },
- { 49, 0x006e, 0x0800004e, 0x08, 0x00, 0x0000 },
- { 49, 0x006e, 0x0800004e, 0x09, 0x00, 0x0000 },
- { 49, 0x006e, 0x0800004e, 0x0a, 0x00, 0x0000 },
- { 49, 0x006e, 0x0800004e, 0x0b, 0x00, 0x0000 },
- { 49, 0x006e, 0x0c00004e, 0x0c, 0x00, 0x0000 },
- { 49, 0x006e, 0x0c00004e, 0x0d, 0x00, 0x0000 },
- { 49, 0x006e, 0x0c00004e, 0x0e, 0x00, 0x0000 },
- { 49, 0x006e, 0x0c00004e, 0x0f, 0x00, 0x0000 },
- { 50, 0x006d, 0x0000004d, 0x00, 0x00, 0x0000 },
- { 50, 0x004d, 0x0000004d, 0x01, 0x00, 0x0000 },
- { 50, 0x006d, 0x0000004d, 0x02, 0x00, 0x0000 },
- { 50, 0x004d, 0x0000004d, 0x03, 0x00, 0x0000 },
- { 50, 0x006d, 0x0400004d, 0x04, 0x00, 0x0000 },
- { 50, 0x006d, 0x0400004d, 0x05, 0x00, 0x0000 },
- { 50, 0x006d, 0x0400004d, 0x06, 0x00, 0x0000 },
- { 50, 0x006d, 0x0400004d, 0x07, 0x00, 0x0000 },
- { 50, 0x006d, 0x0800004d, 0x08, 0x00, 0x0000 },
- { 50, 0x006d, 0x0800004d, 0x09, 0x00, 0x0000 },
- { 50, 0x006d, 0x0800004d, 0x0a, 0x00, 0x0000 },
- { 50, 0x006d, 0x0800004d, 0x0b, 0x00, 0x0000 },
- { 50, 0x006d, 0x0c00004d, 0x0c, 0x00, 0x0000 },
- { 50, 0x006d, 0x0c00004d, 0x0d, 0x00, 0x0000 },
- { 50, 0x006d, 0x0c00004d, 0x0e, 0x00, 0x0000 },
- { 50, 0x006d, 0x0c00004d, 0x0f, 0x00, 0x0000 },
+ { 44, 0x007a, 0x0000005a, 0x00, 0x02, 0x0000 },
+ { 44, 0x005a, 0x0000005a, 0x01, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0000005a, 0x02, 0x02, 0x0000 },
+ { 44, 0x005a, 0x0000005a, 0x03, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0400005a, 0x04, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0400005a, 0x05, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0400005a, 0x06, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0400005a, 0x07, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0800005a, 0x08, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0800005a, 0x09, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0800005a, 0x0a, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0800005a, 0x0b, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0c00005a, 0x0c, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0c00005a, 0x0d, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0c00005a, 0x0e, 0x02, 0x0000 },
+ { 44, 0x007a, 0x0c00005a, 0x0f, 0x02, 0x0000 },
+ { 45, 0x0078, 0x00000058, 0x00, 0x02, 0x0000 },
+ { 45, 0x0058, 0x00000058, 0x01, 0x02, 0x0000 },
+ { 45, 0x0078, 0x00000058, 0x02, 0x02, 0x0000 },
+ { 45, 0x0058, 0x00000058, 0x03, 0x02, 0x0000 },
+ { 45, 0x0078, 0x04000058, 0x04, 0x02, 0x0000 },
+ { 45, 0x0078, 0x04000058, 0x05, 0x02, 0x0000 },
+ { 45, 0x0078, 0x04000058, 0x06, 0x02, 0x0000 },
+ { 45, 0x0078, 0x04000058, 0x07, 0x02, 0x0000 },
+ { 45, 0x0078, 0x08000058, 0x08, 0x02, 0x0000 },
+ { 45, 0x0078, 0x08000058, 0x09, 0x02, 0x0000 },
+ { 45, 0x0078, 0x08000058, 0x0a, 0x02, 0x0000 },
+ { 45, 0x0078, 0x08000058, 0x0b, 0x02, 0x0000 },
+ { 45, 0x0078, 0x0c000058, 0x0c, 0x02, 0x0000 },
+ { 45, 0x0078, 0x0c000058, 0x0d, 0x02, 0x0000 },
+ { 45, 0x0078, 0x0c000058, 0x0e, 0x02, 0x0000 },
+ { 45, 0x0078, 0x0c000058, 0x0f, 0x02, 0x0000 },
+ { 46, 0x0063, 0x00000043, 0x00, 0x02, 0x0000 },
+ { 46, 0x0043, 0x00000043, 0x01, 0x02, 0x0000 },
+ { 46, 0x0063, 0x00000043, 0x02, 0x02, 0x0000 },
+ { 46, 0x0043, 0x00000043, 0x03, 0x02, 0x0000 },
+ { 46, 0x0063, 0x04000043, 0x04, 0x02, 0x0000 },
+ { 46, 0x0063, 0x04000043, 0x05, 0x02, 0x0000 },
+ { 46, 0x0063, 0x04000043, 0x06, 0x02, 0x0000 },
+ { 46, 0x0063, 0x04000043, 0x07, 0x02, 0x0000 },
+ { 46, 0x0063, 0x08000043, 0x08, 0x02, 0x0000 },
+ { 46, 0x0063, 0x08000043, 0x09, 0x02, 0x0000 },
+ { 46, 0x0063, 0x08000043, 0x0a, 0x02, 0x0000 },
+ { 46, 0x0063, 0x08000043, 0x0b, 0x02, 0x0000 },
+ { 46, 0x0063, 0x0c000043, 0x0c, 0x02, 0x0000 },
+ { 46, 0x0063, 0x0c000043, 0x0d, 0x02, 0x0000 },
+ { 46, 0x0063, 0x0c000043, 0x0e, 0x02, 0x0000 },
+ { 46, 0x0063, 0x0c000043, 0x0f, 0x02, 0x0000 },
+ { 47, 0x0076, 0x00000056, 0x00, 0x02, 0x0000 },
+ { 47, 0x0056, 0x00000056, 0x01, 0x02, 0x0000 },
+ { 47, 0x0076, 0x00000056, 0x02, 0x02, 0x0000 },
+ { 47, 0x0056, 0x00000056, 0x03, 0x02, 0x0000 },
+ { 47, 0x0076, 0x04000056, 0x04, 0x02, 0x0000 },
+ { 47, 0x0076, 0x04000056, 0x05, 0x02, 0x0000 },
+ { 47, 0x0076, 0x04000056, 0x06, 0x02, 0x0000 },
+ { 47, 0x0076, 0x04000056, 0x07, 0x02, 0x0000 },
+ { 47, 0x0076, 0x08000056, 0x08, 0x02, 0x0000 },
+ { 47, 0x0076, 0x08000056, 0x09, 0x02, 0x0000 },
+ { 47, 0x0076, 0x08000056, 0x0a, 0x02, 0x0000 },
+ { 47, 0x0076, 0x08000056, 0x0b, 0x02, 0x0000 },
+ { 47, 0x0076, 0x0c000056, 0x0c, 0x02, 0x0000 },
+ { 47, 0x0076, 0x0c000056, 0x0d, 0x02, 0x0000 },
+ { 47, 0x0076, 0x0c000056, 0x0e, 0x02, 0x0000 },
+ { 47, 0x0076, 0x0c000056, 0x0f, 0x02, 0x0000 },
+ { 48, 0x0062, 0x00000042, 0x00, 0x02, 0x0000 },
+ { 48, 0x0042, 0x00000042, 0x01, 0x02, 0x0000 },
+ { 48, 0x0062, 0x00000042, 0x02, 0x02, 0x0000 },
+ { 48, 0x0042, 0x00000042, 0x03, 0x02, 0x0000 },
+ { 48, 0x0062, 0x04000042, 0x04, 0x02, 0x0000 },
+ { 48, 0x0062, 0x04000042, 0x05, 0x02, 0x0000 },
+ { 48, 0x0062, 0x04000042, 0x06, 0x02, 0x0000 },
+ { 48, 0x0062, 0x04000042, 0x07, 0x02, 0x0000 },
+ { 48, 0x0062, 0x08000042, 0x08, 0x02, 0x0000 },
+ { 48, 0x0062, 0x08000042, 0x09, 0x02, 0x0000 },
+ { 48, 0x0062, 0x08000042, 0x0a, 0x02, 0x0000 },
+ { 48, 0x0062, 0x08000042, 0x0b, 0x02, 0x0000 },
+ { 48, 0x0062, 0x0c000042, 0x0c, 0x02, 0x0000 },
+ { 48, 0x0062, 0x0c000042, 0x0d, 0x02, 0x0000 },
+ { 48, 0x0062, 0x0c000042, 0x0e, 0x02, 0x0000 },
+ { 48, 0x0062, 0x0c000042, 0x0f, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0000004e, 0x00, 0x02, 0x0000 },
+ { 49, 0x004e, 0x0000004e, 0x01, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0000004e, 0x02, 0x02, 0x0000 },
+ { 49, 0x004e, 0x0000004e, 0x03, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0400004e, 0x04, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0400004e, 0x05, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0400004e, 0x06, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0400004e, 0x07, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0800004e, 0x08, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0800004e, 0x09, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0800004e, 0x0a, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0800004e, 0x0b, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0c00004e, 0x0c, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0c00004e, 0x0d, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0c00004e, 0x0e, 0x02, 0x0000 },
+ { 49, 0x006e, 0x0c00004e, 0x0f, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0000004d, 0x00, 0x02, 0x0000 },
+ { 50, 0x004d, 0x0000004d, 0x01, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0000004d, 0x02, 0x02, 0x0000 },
+ { 50, 0x004d, 0x0000004d, 0x03, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0400004d, 0x04, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0400004d, 0x05, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0400004d, 0x06, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0400004d, 0x07, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0800004d, 0x08, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0800004d, 0x09, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0800004d, 0x0a, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0800004d, 0x0b, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0c00004d, 0x0c, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0c00004d, 0x0d, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0c00004d, 0x0e, 0x02, 0x0000 },
+ { 50, 0x006d, 0x0c00004d, 0x0f, 0x02, 0x0000 },
{ 51, 0x002c, 0x0000002c, 0x00, 0x00, 0x0000 },
{ 51, 0x003c, 0x0000003c, 0x01, 0x00, 0x0000 },
{ 51, 0x002c, 0x0100125b, 0x02, 0x01, 0x0000 },
diff --git a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
index 26dc116f91..b97923c4b6 100644
--- a/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
+++ b/src/platformsupport/input/evdevkeyboard/qevdevkeyboardhandler.cpp
@@ -235,6 +235,8 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint
const QEvdevKeyboardMap::Mapping *map_plain = 0;
const QEvdevKeyboardMap::Mapping *map_withmod = 0;
+ quint8 modifiers = m_modifiers;
+
// get a specific and plain mapping for the keycode and the current modifiers
for (int i = 0; i < m_keymap_size && !(map_plain && map_withmod); ++i) {
const QEvdevKeyboardMap::Mapping *m = m_keymap + i;
@@ -250,9 +252,12 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint
}
}
+ if (m_locks[0] /*CapsLock*/ && map_withmod && (map_withmod->flags & QEvdevKeyboardMap::IsLetter))
+ modifiers ^= QEvdevKeyboardMap::ModShift;
+
#ifdef QT_QPA_KEYMAP_DEBUG
qWarning("Processing key event: keycode=%3d, modifiers=%02x pressed=%d, autorepeat=%d | plain=%d, withmod=%d, size=%d", \
- keycode, m_modifiers, pressed ? 1 : 0, autorepeat ? 1 : 0, \
+ keycode, modifiers, pressed ? 1 : 0, autorepeat ? 1 : 0, \
map_plain ? map_plain - m_keymap : -1, \
map_withmod ? map_withmod - m_keymap : -1, \
m_keymap_size);
@@ -263,7 +268,7 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint
if (!it) {
#ifdef QT_QPA_KEYMAP_DEBUG
// we couldn't even find a plain mapping
- qWarning("Could not find a suitable mapping for keycode: %3d, modifiers: %02x", keycode, m_modifiers);
+ qWarning("Could not find a suitable mapping for keycode: %3d, modifiers: %02x", keycode, modifiers);
#endif
return result;
}
@@ -285,7 +290,7 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint
lock ^= 1;
switch (qtcode) {
- case Qt::Key_CapsLock : result = lock ? CapsLockOn : CapsLockOff; m_modifiers ^= QEvdevKeyboardMap::ModShift; break;
+ case Qt::Key_CapsLock : result = lock ? CapsLockOn : CapsLockOff; break;
case Qt::Key_NumLock : result = lock ? NumLockOn : NumLockOff; break;
case Qt::Key_ScrollLock: result = lock ? ScrollLockOn : ScrollLockOff; break;
default : break;
@@ -347,7 +352,7 @@ QEvdevKeyboardHandler::KeycodeAction QEvdevKeyboardHandler::processKeycode(quint
// so just report the plain mapping with additional modifiers.
if ((it == map_plain && it != map_withmod) ||
(map_withmod && !(map_withmod->qtcode & modmask))) {
- qtcode |= QEvdevKeyboardHandler::toQtModifiers(m_modifiers);
+ qtcode |= QEvdevKeyboardHandler::toQtModifiers(modifiers);
}
if (m_composing == 2 && first_press && !(it->flags & QEvdevKeyboardMap::IsModifier)) {
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
index 7549b4a9f7..b0ed4076da 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
@@ -52,23 +52,18 @@
#include <QtCore/qdebug.h>
#include <QDir>
-#include <CoreWLAN/CoreWLAN.h>
-#include <CoreWLAN/CWInterface.h>
-#include <CoreWLAN/CWNetwork.h>
-#include <CoreWLAN/CWNetwork.h>
-#include <CoreWLAN/CW8021XProfile.h>
-
-#include <Foundation/NSEnumerator.h>
-#include <Foundation/NSKeyValueObserving.h>
-#include <Foundation/NSAutoreleasePool.h>
-#include <Foundation/NSLock.h>
-
-#include <SystemConfiguration/SCNetworkConfiguration.h>
+
+extern "C" { // Otherwise it won't find CWKeychain* symbols at link time
+#import <CoreWLAN/CoreWLAN.h>
+}
+
#include "private/qcore_mac_p.h"
#include <net/if.h>
#include <ifaddrs.h>
+#if QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_7, __IPHONE_NA)
+
@interface QT_MANGLE_NAMESPACE(QNSListener) : NSObject
{
NSNotificationCenter *notificationCenter;
@@ -94,7 +89,7 @@
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
notificationCenter = [NSNotificationCenter defaultCenter];
currentInterface = [CWInterface interfaceWithName:nil];
- [notificationCenter addObserver:self selector:@selector(notificationHandler:) name:kCWPowerDidChangeNotification object:nil];
+ [notificationCenter addObserver:self selector:@selector(notificationHandler:) name:CWPowerDidChangeNotification object:nil];
[locker unlock];
[autoreleasepool release];
return self;
@@ -131,7 +126,7 @@
}
@end
-QT_MANGLE_NAMESPACE(QNSListener) *listener = 0;
+static QT_MANGLE_NAMESPACE(QNSListener) *listener = 0;
QT_BEGIN_NAMESPACE
@@ -171,33 +166,25 @@ void QScanThread::run()
CWInterface *currentInterface = [CWInterface interfaceWithName: QCFString::toNSString(interfaceName)];
mutex.unlock();
- if([currentInterface power]) {
+ if (currentInterface.powerOn) {
NSError *err = nil;
- NSDictionary *parametersDict = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithBool:YES], kCWScanKeyMerge,
- [NSNumber numberWithInt:kCWScanTypeFast], kCWScanKeyScanType,
- [NSNumber numberWithInteger:100], kCWScanKeyRestTime, nil];
- NSArray* apArray = [currentInterface scanForNetworksWithParameters:parametersDict error:&err];
- CWNetwork *apNetwork;
+ NSSet* apSet = [currentInterface scanForNetworksWithName:nil error:&err];
if (!err) {
-
- for(uint row=0; row < [apArray count]; row++ ) {
- apNetwork = [apArray objectAtIndex:row];
-
+ for (CWNetwork *apNetwork in apSet) {
const QString networkSsid = QCFString::toQString([apNetwork ssid]);
const QString id = QString::number(qHash(QLatin1String("corewlan:") + networkSsid));
found.append(id);
QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Undefined;
bool known = isKnownSsid(networkSsid);
- if( [currentInterface.interfaceState intValue] == kCWInterfaceStateRunning) {
+ if (currentInterface.serviceActive) {
if( networkSsid == QCFString::toQString( [currentInterface ssid])) {
state = QNetworkConfiguration::Active;
}
}
- if(state == QNetworkConfiguration::Undefined) {
+ if (state == QNetworkConfiguration::Undefined) {
if(known) {
state = QNetworkConfiguration::Discovered;
} else {
@@ -205,7 +192,7 @@ void QScanThread::run()
}
}
QNetworkConfiguration::Purpose purpose = QNetworkConfiguration::UnknownPurpose;
- if([[apNetwork securityMode] intValue] == kCWSecurityModeOpen) {
+ if ([apNetwork supportsSecurity:kCWSecurityNone]) {
purpose = QNetworkConfiguration::PublicPurpose;
} else {
purpose = QNetworkConfiguration::PrivatePurpose;
@@ -235,7 +222,7 @@ void QScanThread::run()
interfaceName = ij.value();
}
- if( [currentInterface.interfaceState intValue] == kCWInterfaceStateRunning) {
+ if (currentInterface.serviceActive) {
if( networkSsid == QCFString::toQString([currentInterface ssid])) {
state = QNetworkConfiguration::Active;
}
@@ -298,14 +285,14 @@ void QScanThread::getUserConfigurations()
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
userProfiles.clear();
- NSArray *wifiInterfaces = [CWInterface supportedInterfaces];
- for(uint row=0; row < [wifiInterfaces count]; row++ ) {
+ NSSet *wifiInterfaces = [CWInterface interfaceNames];
+ for (NSString *ifName in wifiInterfaces) {
- CWInterface *wifiInterface = [CWInterface interfaceWithName: [wifiInterfaces objectAtIndex:row]];
- if ( ![wifiInterface power] )
+ CWInterface *wifiInterface = [CWInterface interfaceWithName: ifName];
+ if (!wifiInterface.powerOn)
continue;
- NSString *nsInterfaceName = [wifiInterface name];
+ NSString *nsInterfaceName = wifiInterface.ssid;
// add user configured system networks
SCDynamicStoreRef dynRef = SCDynamicStoreCreate(kCFAllocatorSystemDefault, (CFStringRef)@"Qt corewlan", nil, nil);
NSDictionary * airportPlist = (NSDictionary *)SCDynamicStoreCopyValue(dynRef, (CFStringRef)[NSString stringWithFormat:@"Setup:/Network/Interface/%@/AirPort", nsInterfaceName]);
@@ -314,7 +301,7 @@ void QScanThread::getUserConfigurations()
NSDictionary *prefNetDict = [airportPlist objectForKey:@"PreferredNetworks"];
NSArray *thisSsidarray = [prefNetDict valueForKey:@"SSID_STR"];
- for(NSString *ssidkey in thisSsidarray) {
+ for (NSString *ssidkey in thisSsidarray) {
QString thisSsid = QCFString::toQString(ssidkey);
if(!userProfiles.contains(thisSsid)) {
QMap <QString,QString> map;
@@ -442,7 +429,7 @@ void QCoreWlanEngine::initialize()
QMutexLocker locker(&mutex);
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
- if([[CWInterface supportedInterfaces] count] > 0 && !listener) {
+ if ([[CWInterface interfaceNames] count] > 0 && !listener) {
listener = [[QT_MANGLE_NAMESPACE(QNSListener) alloc] init];
listener.engine = this;
hasWifi = true;
@@ -479,135 +466,62 @@ void QCoreWlanEngine::connectToId(const QString &id)
CWInterface *wifiInterface =
[CWInterface interfaceWithName: QCFString::toNSString(interfaceString)];
- if ([wifiInterface power]) {
+ if (wifiInterface.powerOn) {
NSError *err = nil;
- NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
-
QString wantedSsid;
-
QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
const QString idHash = QString::number(qHash(QLatin1String("corewlan:") + ptr->name));
const QString idHash2 = QString::number(qHash(QLatin1String("corewlan:") + scanThread->getNetworkNameFromSsid(ptr->name)));
- bool using8021X = false;
- if (idHash2 != id) {
- NSArray *array = [CW8021XProfile allUser8021XProfiles];
-
- for (NSUInteger i = 0; i < [array count]; ++i) {
- const QString networkNameHashCheck = QString::number(qHash(QLatin1String("corewlan:") + QCFString::toQString([[array objectAtIndex:i] userDefinedName])));
-
- const QString ssidHash = QString::number(qHash(QLatin1String("corewlan:") + QCFString::toQString([[array objectAtIndex:i] ssid])));
-
- if (id == networkNameHashCheck || id == ssidHash) {
- const QString thisName = scanThread->getSsidFromNetworkName(id);
- if (thisName.isEmpty())
- wantedSsid = id;
- else
- wantedSsid = thisName;
-
- [params setValue: [array objectAtIndex:i] forKey:kCWAssocKey8021XProfile];
- using8021X = true;
- break;
- }
+ QString wantedNetwork;
+ QMapIterator<QString, QMap<QString, QString> > i(scanThread->userProfiles);
+ while (i.hasNext()) {
+ i.next();
+ wantedNetwork = i.key();
+ const QString networkNameHash = QString::number(qHash(QLatin1String("corewlan:") + wantedNetwork));
+ if (id == networkNameHash) {
+ wantedSsid = scanThread->getSsidFromNetworkName(wantedNetwork);
+ break;
}
}
- if (!using8021X) {
- QString wantedNetwork;
- QMapIterator<QString, QMap<QString,QString> > i(scanThread->userProfiles);
- while (i.hasNext()) {
- i.next();
- wantedNetwork = i.key();
- const QString networkNameHash = QString::number(qHash(QLatin1String("corewlan:") + wantedNetwork));
- if (id == networkNameHash) {
- wantedSsid = scanThread->getSsidFromNetworkName(wantedNetwork);
- break;
- }
- }
- }
- NSDictionary *scanParameters = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithBool:YES], kCWScanKeyMerge,
- [NSNumber numberWithInt:kCWScanTypeFast], kCWScanKeyScanType,
- [NSNumber numberWithInteger:100], kCWScanKeyRestTime,
- QCFString::toNSString(wantedSsid), kCWScanKeySSID,
- nil];
-
- NSArray *scanArray = [wifiInterface scanForNetworksWithParameters:scanParameters error:&err];
+ NSSet *scanSet = [wifiInterface scanForNetworksWithName:QCFString::toNSString(wantedSsid) error:&err];
if(!err) {
- for(uint row=0; row < [scanArray count]; row++ ) {
- CWNetwork *apNetwork = [scanArray objectAtIndex:row];
-
- if(wantedSsid == QCFString::toQString([apNetwork ssid])) {
-
- if(!using8021X) {
- SecKeychainAttribute attributes[3];
-
- NSString *account = [apNetwork ssid];
- NSString *keyKind = @"AirPort network password";
- NSString *keyName = account;
-
- attributes[0].tag = kSecAccountItemAttr;
- attributes[0].data = (void *)[account UTF8String];
- attributes[0].length = [account length];
-
- attributes[1].tag = kSecDescriptionItemAttr;
- attributes[1].data = (void *)[keyKind UTF8String];
- attributes[1].length = [keyKind length];
-
- attributes[2].tag = kSecLabelItemAttr;
- attributes[2].data = (void *)[keyName UTF8String];
- attributes[2].length = [keyName length];
-
- SecKeychainAttributeList attributeList = {3,attributes};
-
- SecKeychainSearchRef searchRef;
- SecKeychainSearchCreateFromAttributes(NULL, kSecGenericPasswordItemClass, &attributeList, &searchRef);
-
- NSString *password = @"";
- SecKeychainItemRef searchItem;
-
- if (SecKeychainSearchCopyNext(searchRef, &searchItem) == noErr) {
- UInt32 realPasswordLength;
- SecKeychainAttribute attributesW[8];
- attributesW[0].tag = kSecAccountItemAttr;
- SecKeychainAttributeList listW = {1,attributesW};
- char *realPassword;
- OSStatus status = SecKeychainItemCopyContent(searchItem, NULL, &listW, &realPasswordLength,(void **)&realPassword);
-
- if (status == noErr) {
- if (realPassword != NULL) {
-
- QByteArray pBuf;
- pBuf.resize(realPasswordLength);
- pBuf.prepend(realPassword);
- pBuf.insert(realPasswordLength,'\0');
-
- password = [NSString stringWithUTF8String:pBuf];
- }
- SecKeychainItemFreeContent(&listW, realPassword);
- }
-
- CFRelease(searchItem);
- } else {
- qDebug() << "SecKeychainSearchCopyNext error";
- }
- [params setValue: password forKey: kCWAssocKeyPassphrase];
- } // end using8021X
-
-
- bool result = [wifiInterface associateToNetwork: apNetwork parameters:[NSDictionary dictionaryWithDictionary:params] error:&err];
+ for (CWNetwork *apNetwork in scanSet) {
+ CFDataRef ssidData = (CFDataRef)[apNetwork ssidData];
+ bool result = false;
+
+ SecIdentityRef identity = 0;
+ // Check first whether we require IEEE 802.1X authentication for the wanted SSID
+ if (CWKeychainCopyEAPIdentity(ssidData, &identity) == errSecSuccess) {
+ CFStringRef username = 0;
+ CFStringRef password = 0;
+ if (CWKeychainCopyEAPUsernameAndPassword(ssidData, &username, &password) == errSecSuccess) {
+ result = [wifiInterface associateToEnterpriseNetwork:apNetwork
+ identity:identity username:(NSString *)username password:(NSString *)password
+ error:&err];
+ CFRelease(username);
+ CFRelease(password);
+ }
+ CFRelease(identity);
+ } else {
+ CFStringRef password = 0;
+ if (CWKeychainCopyPassword(ssidData, &password) == errSecSuccess) {
+ result = [wifiInterface associateToNetwork:apNetwork password:(NSString *)password error:&err];
+ CFRelease(password);
+ }
+ }
- if(!err) {
- if(!result) {
- emit connectionError(id, ConnectError);
- } else {
- return;
- }
+ if (!err) {
+ if (!result) {
+ emit connectionError(id, ConnectError);
} else {
- qDebug() <<"associate ERROR"<< QCFString::toQString([err localizedDescription ]);
+ return;
}
+ } else {
+ qDebug() <<"associate ERROR"<< QCFString::toQString([err localizedDescription ]);
}
} //end scan network
} else {
@@ -632,7 +546,7 @@ void QCoreWlanEngine::disconnectFromId(const QString &id)
[CWInterface interfaceWithName: QCFString::toNSString(interfaceString)];
[wifiInterface disassociate];
- if ([[wifiInterface interfaceState]intValue] != kCWInterfaceStateInactive) {
+ if (wifiInterface.serviceActive) {
locker.unlock();
emit connectionError(id, DisconnectionError);
locker.relock();
@@ -652,9 +566,9 @@ void QCoreWlanEngine::doRequestUpdate()
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
- NSArray *wifiInterfaces = [CWInterface supportedInterfaces];
- for (uint row = 0; row < [wifiInterfaces count]; ++row) {
- scanThread->interfaceName = QCFString::toQString([wifiInterfaces objectAtIndex:row]);
+ NSSet *wifiInterfaces = [CWInterface interfaceNames];
+ for (NSString *ifName in wifiInterfaces) {
+ scanThread->interfaceName = QCFString::toQString(ifName);
scanThread->start();
}
locker.unlock();
@@ -668,7 +582,7 @@ bool QCoreWlanEngine::isWifiReady(const QString &wifiDeviceName)
if(hasWifi) {
NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
CWInterface *defaultInterface = [CWInterface interfaceWithName: QCFString::toNSString(wifiDeviceName)];
- if([defaultInterface power]) {
+ if (defaultInterface.powerOn) {
haswifi = true;
}
[autoreleasepool release];
@@ -942,3 +856,7 @@ quint64 QCoreWlanEngine::getBytes(const QString &interfaceName, bool b)
}
QT_END_NAMESPACE
+
+#else // QT_MAC_PLATFORM_SDK_EQUAL_OR_ABOVE
+#include "qcorewlanengine_10_6.mm"
+#endif
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm b/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm
new file mode 100644
index 0000000000..1b95ae29ad
--- /dev/null
+++ b/src/plugins/bearer/corewlan/qcorewlanengine_10_6.mm
@@ -0,0 +1,916 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <SystemConfiguration/SCNetworkConfiguration.h>
+
+@interface QT_MANGLE_NAMESPACE(QNSListener) : NSObject
+{
+ NSNotificationCenter *notificationCenter;
+ CWInterface *currentInterface;
+ QCoreWlanEngine *engine;
+ NSLock *locker;
+}
+- (void)notificationHandler;//:(NSNotification *)notification;
+- (void)remove;
+- (void)setEngine:(QCoreWlanEngine *)coreEngine;
+- (QCoreWlanEngine *)engine;
+- (void)dealloc;
+
+@property (assign) QCoreWlanEngine* engine;
+
+@end
+
+@implementation QT_MANGLE_NAMESPACE(QNSListener)
+
+- (id) init
+{
+ [locker lock];
+ NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ notificationCenter = [NSNotificationCenter defaultCenter];
+ currentInterface = [CWInterface interfaceWithName:nil];
+ [notificationCenter addObserver:self selector:@selector(notificationHandler:) name:kCWPowerDidChangeNotification object:nil];
+ [locker unlock];
+ [autoreleasepool release];
+ return self;
+}
+
+-(void)dealloc
+{
+ [super dealloc];
+}
+
+-(void)setEngine:(QCoreWlanEngine *)coreEngine
+{
+ [locker lock];
+ if(!engine)
+ engine = coreEngine;
+ [locker unlock];
+}
+
+-(QCoreWlanEngine *)engine
+{
+ return engine;
+}
+
+-(void)remove
+{
+ [locker lock];
+ [notificationCenter removeObserver:self];
+ [locker unlock];
+}
+
+- (void)notificationHandler//:(NSNotification *)notification
+{
+ engine->requestUpdate();
+}
+@end
+
+static QT_MANGLE_NAMESPACE(QNSListener) *listener = 0;
+
+QT_BEGIN_NAMESPACE
+
+void networkChangeCallback(SCDynamicStoreRef/* store*/, CFArrayRef changedKeys, void *info)
+{
+ for ( long i = 0; i < CFArrayGetCount(changedKeys); i++) {
+
+ QString changed = QCFString::toQString((CFStringRef)CFArrayGetValueAtIndex(changedKeys, i));
+ if( changed.contains("/Network/Global/IPv4")) {
+ QCoreWlanEngine* wlanEngine = static_cast<QCoreWlanEngine*>(info);
+ wlanEngine->requestUpdate();
+ }
+ }
+ return;
+}
+
+
+QScanThread::QScanThread(QObject *parent)
+ :QThread(parent)
+{
+}
+
+QScanThread::~QScanThread()
+{
+}
+
+void QScanThread::quit()
+{
+ wait();
+}
+
+void QScanThread::run()
+{
+ NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QStringList found;
+ mutex.lock();
+ CWInterface *currentInterface = [CWInterface interfaceWithName: QCFString::toNSString(interfaceName)];
+ mutex.unlock();
+
+ if([currentInterface power]) {
+ NSError *err = nil;
+ NSDictionary *parametersDict = [NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithBool:YES], kCWScanKeyMerge,
+ [NSNumber numberWithInt:kCWScanTypeFast], kCWScanKeyScanType,
+ [NSNumber numberWithInteger:100], kCWScanKeyRestTime, nil];
+
+ NSArray* apArray = [currentInterface scanForNetworksWithParameters:parametersDict error:&err];
+ CWNetwork *apNetwork;
+
+ if (!err) {
+
+ for(uint row=0; row < [apArray count]; row++ ) {
+ apNetwork = [apArray objectAtIndex:row];
+
+ const QString networkSsid = QCFString::toQString([apNetwork ssid]);
+ const QString id = QString::number(qHash(QLatin1String("corewlan:") + networkSsid));
+ found.append(id);
+
+ QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Undefined;
+ bool known = isKnownSsid(networkSsid);
+ if( [currentInterface.interfaceState intValue] == kCWInterfaceStateRunning) {
+ if( networkSsid == QCFString::toQString( [currentInterface ssid])) {
+ state = QNetworkConfiguration::Active;
+ }
+ }
+ if(state == QNetworkConfiguration::Undefined) {
+ if(known) {
+ state = QNetworkConfiguration::Discovered;
+ } else {
+ state = QNetworkConfiguration::Undefined;
+ }
+ }
+ QNetworkConfiguration::Purpose purpose = QNetworkConfiguration::UnknownPurpose;
+ if([[apNetwork securityMode] intValue] == kCWSecurityModeOpen) {
+ purpose = QNetworkConfiguration::PublicPurpose;
+ } else {
+ purpose = QNetworkConfiguration::PrivatePurpose;
+ }
+
+ found.append(foundNetwork(id, networkSsid, state, interfaceName, purpose));
+
+ }
+ }
+ }
+ // add known configurations that are not around.
+ QMapIterator<QString, QMap<QString,QString> > i(userProfiles);
+ while (i.hasNext()) {
+ i.next();
+
+ QString networkName = i.key();
+ const QString id = QString::number(qHash(QLatin1String("corewlan:") + networkName));
+
+ if(!found.contains(id)) {
+ QString networkSsid = getSsidFromNetworkName(networkName);
+ const QString ssidId = QString::number(qHash(QLatin1String("corewlan:") + networkSsid));
+ QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Undefined;
+ QString interfaceName;
+ QMapIterator<QString, QString> ij(i.value());
+ while (ij.hasNext()) {
+ ij.next();
+ interfaceName = ij.value();
+ }
+
+ if( [currentInterface.interfaceState intValue] == kCWInterfaceStateRunning) {
+ if( networkSsid == QCFString::toQString([currentInterface ssid])) {
+ state = QNetworkConfiguration::Active;
+ }
+ }
+ if(state == QNetworkConfiguration::Undefined) {
+ if( userProfiles.contains(networkName)
+ && found.contains(ssidId)) {
+ state = QNetworkConfiguration::Discovered;
+ }
+ }
+
+ if(state == QNetworkConfiguration::Undefined) {
+ state = QNetworkConfiguration::Defined;
+ }
+
+ found.append(foundNetwork(id, networkName, state, interfaceName, QNetworkConfiguration::UnknownPurpose));
+ }
+ }
+ emit networksChanged();
+ [autoreleasepool release];
+}
+
+QStringList QScanThread::foundNetwork(const QString &id, const QString &name, const QNetworkConfiguration::StateFlags state, const QString &interfaceName, const QNetworkConfiguration::Purpose purpose)
+{
+ QStringList found;
+ QMutexLocker locker(&mutex);
+ QNetworkConfigurationPrivate *ptr = new QNetworkConfigurationPrivate;
+
+ ptr->name = name;
+ ptr->isValid = true;
+ ptr->id = id;
+ ptr->state = state;
+ ptr->type = QNetworkConfiguration::InternetAccessPoint;
+ ptr->bearerType = QNetworkConfiguration::BearerWLAN;
+ ptr->purpose = purpose;
+
+ fetchedConfigurations.append( ptr);
+ configurationInterface.insert(ptr->id, interfaceName);
+
+ locker.unlock();
+ locker.relock();
+ found.append(id);
+ return found;
+}
+
+QList<QNetworkConfigurationPrivate *> QScanThread::getConfigurations()
+{
+ QMutexLocker locker(&mutex);
+
+ QList<QNetworkConfigurationPrivate *> foundConfigurations = fetchedConfigurations;
+ fetchedConfigurations.clear();
+
+ return foundConfigurations;
+}
+
+void QScanThread::getUserConfigurations()
+{
+ QMutexLocker locker(&mutex);
+
+ NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ userProfiles.clear();
+
+ NSArray *wifiInterfaces = [CWInterface supportedInterfaces];
+ for(uint row=0; row < [wifiInterfaces count]; row++ ) {
+
+ CWInterface *wifiInterface = [CWInterface interfaceWithName: [wifiInterfaces objectAtIndex:row]];
+ if ( ![wifiInterface power] )
+ continue;
+
+ NSString *nsInterfaceName = [wifiInterface name];
+// add user configured system networks
+ SCDynamicStoreRef dynRef = SCDynamicStoreCreate(kCFAllocatorSystemDefault, (CFStringRef)@"Qt corewlan", nil, nil);
+ NSDictionary * airportPlist = (NSDictionary *)SCDynamicStoreCopyValue(dynRef, (CFStringRef)[NSString stringWithFormat:@"Setup:/Network/Interface/%@/AirPort", nsInterfaceName]);
+ CFRelease(dynRef);
+ if(airportPlist != nil) {
+ NSDictionary *prefNetDict = [airportPlist objectForKey:@"PreferredNetworks"];
+
+ NSArray *thisSsidarray = [prefNetDict valueForKey:@"SSID_STR"];
+ for(NSString *ssidkey in thisSsidarray) {
+ QString thisSsid = QCFString::toQString(ssidkey);
+ if(!userProfiles.contains(thisSsid)) {
+ QMap <QString,QString> map;
+ map.insert(thisSsid, QCFString::toQString(nsInterfaceName));
+ userProfiles.insert(thisSsid, map);
+ }
+ }
+ CFRelease(airportPlist);
+ }
+
+ // 802.1X user profiles
+ QString userProfilePath = QDir::homePath() + "/Library/Preferences/com.apple.eap.profiles.plist";
+ NSDictionary* eapDict = [[[NSDictionary alloc] initWithContentsOfFile: QCFString::toNSString(userProfilePath)] autorelease];
+ if(eapDict != nil) {
+ NSString *profileStr= @"Profiles";
+ NSString *nameStr = @"UserDefinedName";
+ NSString *networkSsidStr = @"Wireless Network";
+ for (id profileKey in eapDict) {
+ if ([profileStr isEqualToString:profileKey]) {
+ NSDictionary *itemDict = [eapDict objectForKey:profileKey];
+ for (id itemKey in itemDict) {
+
+ NSInteger dictSize = [itemKey count];
+ id objects[dictSize];
+ id keys[dictSize];
+
+ [itemKey getObjects:objects andKeys:keys];
+ QString networkName;
+ QString ssid;
+ for(int i = 0; i < dictSize; i++) {
+ if([nameStr isEqualToString:keys[i]]) {
+ networkName = QCFString::toQString(objects[i]);
+ }
+ if([networkSsidStr isEqualToString:keys[i]]) {
+ ssid = QCFString::toQString(objects[i]);
+ }
+ if(!userProfiles.contains(networkName)
+ && !ssid.isEmpty()) {
+ QMap<QString,QString> map;
+ map.insert(ssid, QCFString::toQString(nsInterfaceName));
+ userProfiles.insert(networkName, map);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ [autoreleasepool release];
+}
+
+QString QScanThread::getSsidFromNetworkName(const QString &name)
+{
+ QMutexLocker locker(&mutex);
+
+ QMapIterator<QString, QMap<QString,QString> > i(userProfiles);
+ while (i.hasNext()) {
+ i.next();
+ QMap<QString,QString> map = i.value();
+ QMapIterator<QString, QString> ij(i.value());
+ while (ij.hasNext()) {
+ ij.next();
+ const QString networkNameHash = QString::number(qHash(QLatin1String("corewlan:") +i.key()));
+ if(name == i.key() || name == networkNameHash) {
+ return ij.key();
+ }
+ }
+ }
+ return QString();
+}
+
+QString QScanThread::getNetworkNameFromSsid(const QString &ssid)
+{
+ QMutexLocker locker(&mutex);
+
+ QMapIterator<QString, QMap<QString,QString> > i(userProfiles);
+ while (i.hasNext()) {
+ i.next();
+ QMap<QString,QString> map = i.value();
+ QMapIterator<QString, QString> ij(i.value());
+ while (ij.hasNext()) {
+ ij.next();
+ if(ij.key() == ssid) {
+ return i.key();
+ }
+ }
+ }
+ return QString();
+}
+
+bool QScanThread::isKnownSsid(const QString &ssid)
+{
+ QMutexLocker locker(&mutex);
+
+ QMapIterator<QString, QMap<QString,QString> > i(userProfiles);
+ while (i.hasNext()) {
+ i.next();
+ QMap<QString,QString> map = i.value();
+ if(map.keys().contains(ssid)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+
+QCoreWlanEngine::QCoreWlanEngine(QObject *parent)
+: QBearerEngineImpl(parent), scanThread(0)
+{
+ scanThread = new QScanThread(this);
+ connect(scanThread, SIGNAL(networksChanged()),
+ this, SLOT(networksChanged()));
+}
+
+QCoreWlanEngine::~QCoreWlanEngine()
+{
+ while (!foundConfigurations.isEmpty())
+ delete foundConfigurations.takeFirst();
+ [listener remove];
+ [listener release];
+}
+
+void QCoreWlanEngine::initialize()
+{
+ QMutexLocker locker(&mutex);
+ NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+
+ if([[CWInterface supportedInterfaces] count] > 0 && !listener) {
+ listener = [[QT_MANGLE_NAMESPACE(QNSListener) alloc] init];
+ listener.engine = this;
+ hasWifi = true;
+ } else {
+ hasWifi = false;
+ }
+ storeSession = NULL;
+
+ startNetworkChangeLoop();
+ [autoreleasepool release];
+}
+
+
+QString QCoreWlanEngine::getInterfaceFromId(const QString &id)
+{
+ QMutexLocker locker(&mutex);
+
+ return scanThread->configurationInterface.value(id);
+}
+
+bool QCoreWlanEngine::hasIdentifier(const QString &id)
+{
+ QMutexLocker locker(&mutex);
+
+ return scanThread->configurationInterface.contains(id);
+}
+
+void QCoreWlanEngine::connectToId(const QString &id)
+{
+ QMutexLocker locker(&mutex);
+ NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ QString interfaceString = getInterfaceFromId(id);
+
+ CWInterface *wifiInterface =
+ [CWInterface interfaceWithName: QCFString::toNSString(interfaceString)];
+
+ if ([wifiInterface power]) {
+ NSError *err = nil;
+ NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
+
+ QString wantedSsid;
+
+ QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
+
+ const QString idHash = QString::number(qHash(QLatin1String("corewlan:") + ptr->name));
+ const QString idHash2 = QString::number(qHash(QLatin1String("corewlan:") + scanThread->getNetworkNameFromSsid(ptr->name)));
+
+ bool using8021X = false;
+ if (idHash2 != id) {
+ NSArray *array = [CW8021XProfile allUser8021XProfiles];
+
+ for (NSUInteger i = 0; i < [array count]; ++i) {
+ const QString networkNameHashCheck = QString::number(qHash(QLatin1String("corewlan:") + QCFString::toQString([[array objectAtIndex:i] userDefinedName])));
+
+ const QString ssidHash = QString::number(qHash(QLatin1String("corewlan:") + QCFString::toQString([[array objectAtIndex:i] ssid])));
+
+ if (id == networkNameHashCheck || id == ssidHash) {
+ const QString thisName = scanThread->getSsidFromNetworkName(id);
+ if (thisName.isEmpty())
+ wantedSsid = id;
+ else
+ wantedSsid = thisName;
+
+ [params setValue: [array objectAtIndex:i] forKey:kCWAssocKey8021XProfile];
+ using8021X = true;
+ break;
+ }
+ }
+ }
+
+ if (!using8021X) {
+ QString wantedNetwork;
+ QMapIterator<QString, QMap<QString,QString> > i(scanThread->userProfiles);
+ while (i.hasNext()) {
+ i.next();
+ wantedNetwork = i.key();
+ const QString networkNameHash = QString::number(qHash(QLatin1String("corewlan:") + wantedNetwork));
+ if (id == networkNameHash) {
+ wantedSsid = scanThread->getSsidFromNetworkName(wantedNetwork);
+ break;
+ }
+ }
+ }
+ NSDictionary *scanParameters = [NSDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithBool:YES], kCWScanKeyMerge,
+ [NSNumber numberWithInt:kCWScanTypeFast], kCWScanKeyScanType,
+ [NSNumber numberWithInteger:100], kCWScanKeyRestTime,
+ QCFString::toNSString(wantedSsid), kCWScanKeySSID,
+ nil];
+
+ NSArray *scanArray = [wifiInterface scanForNetworksWithParameters:scanParameters error:&err];
+
+ if(!err) {
+ for(uint row=0; row < [scanArray count]; row++ ) {
+ CWNetwork *apNetwork = [scanArray objectAtIndex:row];
+
+ if(wantedSsid == QCFString::toQString([apNetwork ssid])) {
+
+ if(!using8021X) {
+ SecKeychainAttribute attributes[3];
+
+ NSString *account = [apNetwork ssid];
+ NSString *keyKind = @"AirPort network password";
+ NSString *keyName = account;
+
+ attributes[0].tag = kSecAccountItemAttr;
+ attributes[0].data = (void *)[account UTF8String];
+ attributes[0].length = [account length];
+
+ attributes[1].tag = kSecDescriptionItemAttr;
+ attributes[1].data = (void *)[keyKind UTF8String];
+ attributes[1].length = [keyKind length];
+
+ attributes[2].tag = kSecLabelItemAttr;
+ attributes[2].data = (void *)[keyName UTF8String];
+ attributes[2].length = [keyName length];
+
+ SecKeychainAttributeList attributeList = {3,attributes};
+
+ SecKeychainSearchRef searchRef;
+ SecKeychainSearchCreateFromAttributes(NULL, kSecGenericPasswordItemClass, &attributeList, &searchRef);
+
+ NSString *password = @"";
+ SecKeychainItemRef searchItem;
+
+ if (SecKeychainSearchCopyNext(searchRef, &searchItem) == noErr) {
+ UInt32 realPasswordLength;
+ SecKeychainAttribute attributesW[8];
+ attributesW[0].tag = kSecAccountItemAttr;
+ SecKeychainAttributeList listW = {1,attributesW};
+ char *realPassword;
+ OSStatus status = SecKeychainItemCopyContent(searchItem, NULL, &listW, &realPasswordLength,(void **)&realPassword);
+
+ if (status == noErr) {
+ if (realPassword != NULL) {
+
+ QByteArray pBuf;
+ pBuf.resize(realPasswordLength);
+ pBuf.prepend(realPassword);
+ pBuf.insert(realPasswordLength,'\0');
+
+ password = [NSString stringWithUTF8String:pBuf];
+ }
+ SecKeychainItemFreeContent(&listW, realPassword);
+ }
+
+ CFRelease(searchItem);
+ } else {
+ qDebug() << "SecKeychainSearchCopyNext error";
+ }
+ [params setValue: password forKey: kCWAssocKeyPassphrase];
+ } // end using8021X
+
+
+ bool result = [wifiInterface associateToNetwork: apNetwork parameters:[NSDictionary dictionaryWithDictionary:params] error:&err];
+
+ if(!err) {
+ if(!result) {
+ emit connectionError(id, ConnectError);
+ } else {
+ return;
+ }
+ } else {
+ qDebug() <<"associate ERROR"<< QCFString::toQString([err localizedDescription ]);
+ }
+ }
+ } //end scan network
+ } else {
+ qDebug() <<"scan ERROR"<< QCFString::toQString([err localizedDescription ]);
+ }
+ emit connectionError(id, InterfaceLookupError);
+ }
+
+ locker.unlock();
+ emit connectionError(id, InterfaceLookupError);
+ [autoreleasepool release];
+}
+
+void QCoreWlanEngine::disconnectFromId(const QString &id)
+{
+ QMutexLocker locker(&mutex);
+
+ QString interfaceString = getInterfaceFromId(id);
+ NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+
+ CWInterface *wifiInterface =
+ [CWInterface interfaceWithName: QCFString::toNSString(interfaceString)];
+
+ [wifiInterface disassociate];
+ if ([[wifiInterface interfaceState]intValue] != kCWInterfaceStateInactive) {
+ locker.unlock();
+ emit connectionError(id, DisconnectionError);
+ locker.relock();
+ }
+ [autoreleasepool release];
+}
+
+void QCoreWlanEngine::requestUpdate()
+{
+ scanThread->getUserConfigurations();
+ doRequestUpdate();
+}
+
+void QCoreWlanEngine::doRequestUpdate()
+{
+ QMutexLocker locker(&mutex);
+
+ NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+
+ NSArray *wifiInterfaces = [CWInterface supportedInterfaces];
+ for (uint row = 0; row < [wifiInterfaces count]; ++row) {
+ scanThread->interfaceName = QCFString::toQString([wifiInterfaces objectAtIndex:row]);
+ scanThread->start();
+ }
+ locker.unlock();
+ [autoreleasepool release];
+}
+
+bool QCoreWlanEngine::isWifiReady(const QString &wifiDeviceName)
+{
+ QMutexLocker locker(&mutex);
+ bool haswifi = false;
+ if(hasWifi) {
+ NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ CWInterface *defaultInterface = [CWInterface interfaceWithName: QCFString::toNSString(wifiDeviceName)];
+ if([defaultInterface power]) {
+ haswifi = true;
+ }
+ [autoreleasepool release];
+ }
+ return haswifi;
+}
+
+
+QNetworkSession::State QCoreWlanEngine::sessionStateForId(const QString &id)
+{
+ QMutexLocker locker(&mutex);
+ QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
+
+ if (!ptr)
+ return QNetworkSession::Invalid;
+
+ if (!ptr->isValid) {
+ return QNetworkSession::Invalid;
+ } else if ((ptr->state & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
+ return QNetworkSession::Connected;
+ } else if ((ptr->state & QNetworkConfiguration::Discovered) ==
+ QNetworkConfiguration::Discovered) {
+ return QNetworkSession::Disconnected;
+ } else if ((ptr->state & QNetworkConfiguration::Defined) == QNetworkConfiguration::Defined) {
+ return QNetworkSession::NotAvailable;
+ } else if ((ptr->state & QNetworkConfiguration::Undefined) ==
+ QNetworkConfiguration::Undefined) {
+ return QNetworkSession::NotAvailable;
+ }
+
+ return QNetworkSession::Invalid;
+}
+
+QNetworkConfigurationManager::Capabilities QCoreWlanEngine::capabilities() const
+{
+ return QNetworkConfigurationManager::ForcedRoaming;
+}
+
+void QCoreWlanEngine::startNetworkChangeLoop()
+{
+
+ SCDynamicStoreContext dynStoreContext = { 0, this/*(void *)storeSession*/, NULL, NULL, NULL };
+ storeSession = SCDynamicStoreCreate(NULL,
+ CFSTR("networkChangeCallback"),
+ networkChangeCallback,
+ &dynStoreContext);
+ if (!storeSession ) {
+ qWarning() << "could not open dynamic store: error:" << SCErrorString(SCError());
+ return;
+ }
+
+ CFMutableArrayRef notificationKeys;
+ notificationKeys = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+ CFMutableArrayRef patternsArray;
+ patternsArray = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
+
+ CFStringRef storeKey;
+ storeKey = SCDynamicStoreKeyCreateNetworkGlobalEntity(NULL,
+ kSCDynamicStoreDomainState,
+ kSCEntNetIPv4);
+ CFArrayAppendValue(notificationKeys, storeKey);
+ CFRelease(storeKey);
+
+ storeKey = SCDynamicStoreKeyCreateNetworkServiceEntity(NULL,
+ kSCDynamicStoreDomainState,
+ kSCCompAnyRegex,
+ kSCEntNetIPv4);
+ CFArrayAppendValue(patternsArray, storeKey);
+ CFRelease(storeKey);
+
+ if (!SCDynamicStoreSetNotificationKeys(storeSession , notificationKeys, patternsArray)) {
+ qWarning() << "register notification error:"<< SCErrorString(SCError());
+ CFRelease(storeSession );
+ CFRelease(notificationKeys);
+ CFRelease(patternsArray);
+ return;
+ }
+ CFRelease(notificationKeys);
+ CFRelease(patternsArray);
+
+ runloopSource = SCDynamicStoreCreateRunLoopSource(NULL, storeSession , 0);
+ if (!runloopSource) {
+ qWarning() << "runloop source error:"<< SCErrorString(SCError());
+ CFRelease(storeSession );
+ return;
+ }
+
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), runloopSource, kCFRunLoopDefaultMode);
+ return;
+}
+
+QNetworkSessionPrivate *QCoreWlanEngine::createSessionBackend()
+{
+ return new QNetworkSessionPrivateImpl;
+}
+
+QNetworkConfigurationPrivatePointer QCoreWlanEngine::defaultConfiguration()
+{
+ return QNetworkConfigurationPrivatePointer();
+}
+
+bool QCoreWlanEngine::requiresPolling() const
+{
+ return true;
+}
+
+void QCoreWlanEngine::networksChanged()
+{
+ QMutexLocker locker(&mutex);
+
+ QStringList previous = accessPointConfigurations.keys();
+
+ QList<QNetworkConfigurationPrivate *> foundConfigurations = scanThread->getConfigurations();
+ while (!foundConfigurations.isEmpty()) {
+ QNetworkConfigurationPrivate *cpPriv = foundConfigurations.takeFirst();
+
+ previous.removeAll(cpPriv->id);
+
+ if (accessPointConfigurations.contains(cpPriv->id)) {
+ QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(cpPriv->id);
+
+ bool changed = false;
+
+ ptr->mutex.lock();
+
+ if (ptr->isValid != cpPriv->isValid) {
+ ptr->isValid = cpPriv->isValid;
+ changed = true;
+ }
+
+ if (ptr->name != cpPriv->name) {
+ ptr->name = cpPriv->name;
+ changed = true;
+ }
+
+ if (ptr->bearerType != cpPriv->bearerType) {
+ ptr->bearerType = cpPriv->bearerType;
+ changed = true;
+ }
+
+ if (ptr->state != cpPriv->state) {
+ ptr->state = cpPriv->state;
+ changed = true;
+ }
+
+ ptr->mutex.unlock();
+
+ if (changed) {
+ locker.unlock();
+ emit configurationChanged(ptr);
+ locker.relock();
+ }
+
+ delete cpPriv;
+ } else {
+ QNetworkConfigurationPrivatePointer ptr(cpPriv);
+
+ accessPointConfigurations.insert(ptr->id, ptr);
+
+ locker.unlock();
+ emit configurationAdded(ptr);
+ locker.relock();
+ }
+ }
+
+ while (!previous.isEmpty()) {
+ QNetworkConfigurationPrivatePointer ptr =
+ accessPointConfigurations.take(previous.takeFirst());
+
+ locker.unlock();
+ emit configurationRemoved(ptr);
+ locker.relock();
+ }
+
+ locker.unlock();
+ emit updateCompleted();
+
+}
+
+quint64 QCoreWlanEngine::bytesWritten(const QString &id)
+{
+ QMutexLocker locker(&mutex);
+ const QString interfaceStr = getInterfaceFromId(id);
+ return getBytes(interfaceStr,false);
+}
+
+quint64 QCoreWlanEngine::bytesReceived(const QString &id)
+{
+ QMutexLocker locker(&mutex);
+ const QString interfaceStr = getInterfaceFromId(id);
+ return getBytes(interfaceStr,true);
+}
+
+quint64 QCoreWlanEngine::startTime(const QString &identifier)
+{
+ QMutexLocker locker(&mutex);
+ NSAutoreleasePool *autoreleasepool = [[NSAutoreleasePool alloc] init];
+ quint64 timestamp = 0;
+
+ NSString *filePath = @"/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist";
+ NSDictionary* plistDict = [[[NSDictionary alloc] initWithContentsOfFile:filePath] autorelease];
+ if(plistDict == nil)
+ return timestamp;
+ NSString *input = @"KnownNetworks";
+ NSString *timeStampStr = @"_timeStamp";
+
+ NSString *ssidStr = @"SSID_STR";
+
+ for (id key in plistDict) {
+ if ([input isEqualToString:key]) {
+
+ NSDictionary *knownNetworksDict = [plistDict objectForKey:key];
+ if(knownNetworksDict == nil)
+ return timestamp;
+ for (id networkKey in knownNetworksDict) {
+ bool isFound = false;
+ NSDictionary *itemDict = [knownNetworksDict objectForKey:networkKey];
+ if(itemDict == nil)
+ return timestamp;
+ NSInteger dictSize = [itemDict count];
+ id objects[dictSize];
+ id keys[dictSize];
+
+ [itemDict getObjects:objects andKeys:keys];
+ bool ok = false;
+ for(int i = 0; i < dictSize; i++) {
+ if([ssidStr isEqualToString:keys[i]]) {
+ const QString ident = QString::number(qHash(QLatin1String("corewlan:") + QCFString::toQString(objects[i])));
+ if(ident == identifier) {
+ ok = true;
+ }
+ }
+ if(ok && [timeStampStr isEqualToString:keys[i]]) {
+ timestamp = (quint64)[objects[i] timeIntervalSince1970];
+ isFound = true;
+ break;
+ }
+ }
+ if(isFound)
+ break;
+ }
+ }
+ }
+ [autoreleasepool release];
+ return timestamp;
+}
+
+quint64 QCoreWlanEngine::getBytes(const QString &interfaceName, bool b)
+{
+ struct ifaddrs *ifAddressList, *ifAddress;
+ struct if_data *if_data;
+
+ quint64 bytes = 0;
+ ifAddressList = nil;
+ if(getifaddrs(&ifAddressList) == 0) {
+ for(ifAddress = ifAddressList; ifAddress; ifAddress = ifAddress->ifa_next) {
+ if(interfaceName == ifAddress->ifa_name) {
+ if_data = (struct if_data*)ifAddress->ifa_data;
+ if(b) {
+ bytes = if_data->ifi_ibytes;
+ break;
+ } else {
+ bytes = if_data->ifi_obytes;
+ break;
+ }
+ }
+ }
+ freeifaddrs(ifAddressList);
+ }
+ return bytes;
+}
+
+QT_END_NAMESPACE
diff --git a/src/plugins/generic/evdevkeyboard/README b/src/plugins/generic/evdevkeyboard/README
new file mode 100644
index 0000000000..0d7b52bd24
--- /dev/null
+++ b/src/plugins/generic/evdevkeyboard/README
@@ -0,0 +1,7 @@
+On development machines it might be useful to add the input devices
+to a group that your development user is part of. I.e. add:
+KERNEL=="event*", SUBSYSTEM=="input", MODE="0640", GROUP="users"
+
+to a file such as:
+/etc/udev/rules.d/10-local.rules
+
diff --git a/src/plugins/generic/evdevmouse/README b/src/plugins/generic/evdevmouse/README
index 76ee76bc91..c0dd3db8b3 100644
--- a/src/plugins/generic/evdevmouse/README
+++ b/src/plugins/generic/evdevmouse/README
@@ -12,3 +12,11 @@ initial position.
Touchpads reporting absolute events will work too, the positions will
be turned into relative. Touchscreens are however not supported.
+
+On development machines it might be useful to add the input devices
+to a group that your development user is part of. I.e. add:
+KERNEL=="event*", SUBSYSTEM=="input", MODE="0640", GROUP="users"
+
+to a file such as:
+/etc/udev/rules.d/10-local.rules
+
diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp b/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp
index 4d741807d0..9d6d4003f7 100644
--- a/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp
+++ b/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp
@@ -46,6 +46,8 @@
#include <QtCore/qdebug.h>
#include <qpa/qwindowsysteminterface.h>
+#include <QtGui/private/qopenglcontext_p.h>
+
QT_BEGIN_NAMESPACE
QAndroidOpenGLContext::QAndroidOpenGLContext(const QAndroidPlatformIntegration *integration,
@@ -75,4 +77,17 @@ void QAndroidOpenGLContext::swapBuffers(QPlatformSurface *surface)
}
}
+bool QAndroidOpenGLContext::makeCurrent(QPlatformSurface *surface)
+{
+ bool ret = QEglFSContext::makeCurrent(surface);
+
+ const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
+ if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0) {
+ QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(context());
+ ctx_d->workaround_missingPrecisionQualifiers = true;
+ }
+
+ return ret;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.h b/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.h
index c4c5a430ad..c419ae8392 100644
--- a/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.h
+++ b/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.h
@@ -58,6 +58,7 @@ public:
EGLenum eglApi = EGL_OPENGL_ES_API);
void swapBuffers(QPlatformSurface *surface);
+ bool makeCurrent(QPlatformSurface *surface);
private:
const QAndroidPlatformIntegration *m_platformIntegration;
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h
index 7224ee2ff8..59fda96dff 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.h
+++ b/src/plugins/platforms/cocoa/qcocoamenu.h
@@ -84,6 +84,8 @@ public:
inline NSMenuItem *nsMenuItem() const
{ return m_nativeItem; }
+ inline bool isVisible() const { return m_visible; }
+
virtual QPlatformMenuItem *menuItemAt(int position) const;
virtual QPlatformMenuItem *menuItemForTag(quintptr tag) const;
@@ -100,6 +102,7 @@ private:
NSMenuItem *m_nativeItem;
NSObject *m_delegate;
bool m_enabled;
+ bool m_visible;
quintptr m_tag;
QCocoaMenuBar *m_menuBar;
};
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index 8c4325a775..3ac48df09e 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -218,6 +218,7 @@ QT_BEGIN_NAMESPACE
QCocoaMenu::QCocoaMenu() :
m_enabled(true),
+ m_visible(true),
m_tag(0),
m_menuBar(0)
{
@@ -423,6 +424,7 @@ void QCocoaMenu::setEnabled(bool enabled)
void QCocoaMenu::setVisible(bool visible)
{
[m_nativeItem setSubmenu:(visible ? m_nativeMenu : nil)];
+ m_visible = visible;
}
void QCocoaMenu::showPopup(const QWindow *parentWindow, QPoint pos, const QPlatformMenuItem *item)
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm
index da2704f19c..0fea55ac68 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm
@@ -149,15 +149,17 @@ void QCocoaMenuBar::syncMenu(QPlatformMenu *menu)
Q_FOREACH (QCocoaMenuItem *item, cocoaMenu->items())
cocoaMenu->syncMenuItem(item);
- // If the NSMenu has no visble items, or only separators, we should hide it
- // on the menubar. This can happen after syncing the menu items since they
- // can be moved to other menus.
BOOL shouldHide = YES;
- for (NSMenuItem *item in [cocoaMenu->nsMenu() itemArray])
- if (![item isSeparatorItem] && ![item isHidden]) {
- shouldHide = NO;
- break;
- }
+ if (cocoaMenu->isVisible()) {
+ // If the NSMenu has no visble items, or only separators, we should hide it
+ // on the menubar. This can happen after syncing the menu items since they
+ // can be moved to other menus.
+ for (NSMenuItem *item in [cocoaMenu->nsMenu() itemArray])
+ if (![item isSeparatorItem] && ![item isHidden]) {
+ shouldHide = NO;
+ break;
+ }
+ }
[cocoaMenu->nsMenuItem() setHidden:shouldHide];
}
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index cc72f050d2..fcebb7e0dc 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -270,7 +270,6 @@ void QCocoaWindow::setGeometry(const QRect &rect)
#ifdef QT_COCOA_ENABLE_WINDOW_DEBUG
qDebug() << "QCocoaWindow::setGeometry" << this << rect;
#endif
- QPlatformWindow::setGeometry(rect);
setCocoaGeometry(rect);
}
@@ -278,8 +277,10 @@ void QCocoaWindow::setCocoaGeometry(const QRect &rect)
{
QCocoaAutoReleasePool pool;
- if (m_contentViewIsEmbedded)
+ if (m_contentViewIsEmbedded) {
+ QPlatformWindow::setGeometry(rect);
return;
+ }
if (m_nsWindow) {
NSRect bounds = qt_mac_flipRect(rect, window());
@@ -287,6 +288,8 @@ void QCocoaWindow::setCocoaGeometry(const QRect &rect)
} else {
[m_contentView setFrame : NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height())];
}
+
+ // will call QPlatformWindow::setGeometry(rect) during resize confirmation (see qnsview.mm)
}
void QCocoaWindow::setVisible(bool visible)
@@ -423,11 +426,13 @@ NSInteger QCocoaWindow::windowLevel(Qt::WindowFlags flags)
if (type == Qt::ToolTip)
windowLevel = NSScreenSaverWindowLevel;
- // A window should be in at least the same level as its parent.
- const QWindow * const transientParent = window()->transientParent();
- const QCocoaWindow * const transientParentWindow = transientParent ? static_cast<QCocoaWindow *>(transientParent->handle()) : 0;
- if (transientParentWindow)
- windowLevel = qMax([transientParentWindow->m_nsWindow level], windowLevel);
+ // Any "special" window should be in at least the same level as its parent.
+ if (type != Qt::Window) {
+ const QWindow * const transientParent = window()->transientParent();
+ const QCocoaWindow * const transientParentWindow = transientParent ? static_cast<QCocoaWindow *>(transientParent->handle()) : 0;
+ if (transientParentWindow)
+ windowLevel = qMax([transientParentWindow->m_nsWindow level], windowLevel);
+ }
return windowLevel;
}
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 285e4aeb9f..b8f0fc3cce 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -1049,7 +1049,7 @@ static QTouchDevice *touchDevice = 0;
timestamp,
(lastKnownModifiers & mac_mask) ? QEvent::KeyRelease : QEvent::KeyPress,
modifier_key_symbols[i].qt_code,
- qmodifiers);
+ qmodifiers ^ [QNSView convertKeyModifiers:mac_mask]);
}
}
diff --git a/src/plugins/platforms/cocoa/qprintengine_mac.mm b/src/plugins/platforms/cocoa/qprintengine_mac.mm
index 2dedf99582..ee8d7ea157 100644
--- a/src/plugins/platforms/cocoa/qprintengine_mac.mm
+++ b/src/plugins/platforms/cocoa/qprintengine_mac.mm
@@ -187,10 +187,8 @@ void QMacPrintEnginePrivate::setPaperName(const QString &name)
if (PMSessionGetCurrentPrinter(session(), &printer) == noErr) {
CFArrayRef array;
- if (PMPrinterGetPaperList(printer, &array) != noErr) {
- PMRelease(printer);
+ if (PMPrinterGetPaperList(printer, &array) != noErr)
return;
- }
int count = CFArrayGetCount(array);
for (int i = 0; i < count; ++i) {
PMPaper paper = static_cast<PMPaper>(const_cast<void *>(CFArrayGetValueAtIndex(array, i)));
@@ -208,7 +206,6 @@ void QMacPrintEnginePrivate::setPaperName(const QString &name)
}
}
}
- PMRelease(printer);
}
}
diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp
index 1898cde886..e09154bb59 100644
--- a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp
@@ -79,6 +79,9 @@ void QEglFSBackingStore::flush(QWindow *window, const QRegion &region, const QPo
makeCurrent();
+ QRectF sr = window->screen()->geometry();
+ glViewport(0, 0, sr.width(), sr.height());
+
#ifdef QEGL_EXTRA_DEBUG
qWarning("QEglBackingStore::flush %p", window);
#endif
@@ -120,7 +123,6 @@ void QEglFSBackingStore::flush(QWindow *window, const QRegion &region, const QPo
};
QRectF r = window->geometry();
- QRectF sr = window->screen()->geometry();
GLfloat x1 = (r.left() / sr.width()) * 2 - 1;
GLfloat x2 = (r.right() / sr.width()) * 2 - 1;
@@ -192,8 +194,6 @@ void QEglFSBackingStore::flush(QWindow *window, const QRegion &region, const QPo
void QEglFSBackingStore::makeCurrent()
{
- // needed to prevent QOpenGLContext::makeCurrent() from failing
- window()->setSurfaceType(QSurface::OpenGLSurface);
(static_cast<QEglFSWindow *>(window()->handle()))->create();
m_context->makeCurrent(window());
}
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index 1cc252d285..bf6e375ac0 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -55,12 +55,12 @@ QEglFSWindow::QEglFSWindow(QWindow *w)
: QPlatformWindow(w)
, m_surface(0)
, m_window(0)
+ , has_window(false)
{
- static int serialNo = 0;
- m_winid = ++serialNo;
#ifdef QEGL_EXTRA_DEBUG
- qWarning("QEglWindow %p: %p 0x%x\n", this, w, uint(m_winid));
+ qWarning("QEglWindow %p: %p 0x%x\n", this, w, uint(m_window));
#endif
+ w->setSurfaceType(QSurface::OpenGLSurface);
}
QEglFSWindow::~QEglFSWindow()
@@ -75,7 +75,7 @@ static inline bool supportsMultipleWindows()
void QEglFSWindow::create()
{
- if (m_window)
+ if (has_window)
return;
setWindowState(Qt::WindowFullScreen);
@@ -100,7 +100,7 @@ void QEglFSWindow::create()
void QEglFSWindow::invalidateSurface()
{
// Native surface has been deleted behind our backs
- m_window = 0;
+ has_window = false;
if (m_surface != 0) {
EGLDisplay display = (static_cast<QEglFSScreen *>(window()->screen()->handle()))->display();
eglDestroySurface(display, m_surface);
@@ -113,6 +113,7 @@ void QEglFSWindow::resetSurface()
EGLDisplay display = static_cast<QEglFSScreen *>(screen())->display();
m_window = QEglFSHooks::hooks()->createNativeWindow(QEglFSHooks::hooks()->screenSize(), m_format);
+ has_window = true;
m_surface = eglCreateWindowSurface(display, m_config, m_window, NULL);
if (m_surface == EGL_NO_SURFACE) {
@@ -138,9 +139,9 @@ void QEglFSWindow::destroy()
m_surface = 0;
}
- if (m_window) {
+ if (has_window) {
QEglFSHooks::hooks()->destroyNativeWindow(m_window);
- m_window = 0;
+ has_window = false;
}
}
@@ -160,7 +161,7 @@ void QEglFSWindow::setWindowState(Qt::WindowState)
WId QEglFSWindow::winId() const
{
- return m_winid;
+ return WId(m_window);
}
EGLSurface QEglFSWindow::surface() const
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.h b/src/plugins/platforms/eglfs/qeglfswindow.h
index ff360962ed..936537807a 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.h
+++ b/src/plugins/platforms/eglfs/qeglfswindow.h
@@ -75,9 +75,9 @@ protected:
EGLNativeWindowType m_window;
private:
- WId m_winid;
EGLConfig m_config;
QSurfaceFormat m_format;
+ bool has_window;
};
QT_END_NAMESPACE
#endif // QEGLFSWINDOW_H
diff --git a/src/plugins/platforms/minimalegl/qminimaleglbackingstore.cpp b/src/plugins/platforms/minimalegl/qminimaleglbackingstore.cpp
index cb245f2e5c..db6e5d94da 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglbackingstore.cpp
+++ b/src/plugins/platforms/minimalegl/qminimaleglbackingstore.cpp
@@ -80,9 +80,6 @@ void QMinimalEglBackingStore::flush(QWindow *window, const QRegion &region, cons
void QMinimalEglBackingStore::beginPaint(const QRegion &)
{
- // needed to prevent QOpenGLContext::makeCurrent() from failing
- window()->setSurfaceType(QSurface::OpenGLSurface);
-
m_context->makeCurrent(window());
m_device = new QOpenGLPaintDevice(window()->size());
}
diff --git a/src/plugins/platforms/minimalegl/qminimaleglwindow.cpp b/src/plugins/platforms/minimalegl/qminimaleglwindow.cpp
index 13640b73d6..956b5470e5 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglwindow.cpp
+++ b/src/plugins/platforms/minimalegl/qminimaleglwindow.cpp
@@ -58,6 +58,7 @@ QMinimalEglWindow::QMinimalEglWindow(QWindow *w)
if (w->geometry() != screenGeometry) {
QWindowSystemInterface::handleGeometryChange(w, screenGeometry);
}
+ w->setSurfaceType(QSurface::OpenGLSurface);
}
void QMinimalEglWindow::setGeometry(const QRect &)
diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro
index 92664826ab..377ca32e64 100644
--- a/src/plugins/platforms/platforms.pro
+++ b/src/plugins/platforms/platforms.pro
@@ -2,7 +2,9 @@ TEMPLATE = subdirs
android:!android-no-sdk: SUBDIRS += android
-SUBDIRS += minimal offscreen
+SUBDIRS += minimal
+
+!win32|contains(QT_CONFIG, freetype):SUBDIRS += offscreen
contains(QT_CONFIG, xcb) {
SUBDIRS += xcb
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index a9fd1d9836..de0a583e58 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -593,6 +593,11 @@ QWindow *QWindowsContext::windowUnderMouse() const
return d->m_mouseHandler.windowUnderMouse();
}
+void QWindowsContext::clearWindowUnderMouse()
+{
+ d->m_mouseHandler.clearWindowUnderMouse();
+}
+
/*!
\brief Find a child window at a screen point.
@@ -868,10 +873,15 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
case QtWindows::CloseEvent:
QWindowSystemInterface::handleCloseEvent(platformWindow->window());
return true;
- case QtWindows::ThemeChanged: // ### fixme: Compress these events?
+ case QtWindows::ThemeChanged: {
+ // Switch from Aero to Classic changes margins.
+ const Qt::WindowFlags flags = platformWindow->window()->flags();
+ if ((flags & Qt::WindowType_Mask) != Qt::Desktop && !(flags & Qt::FramelessWindowHint))
+ platformWindow->setFlag(QWindowsWindow::FrameDirty);
if (QWindowsTheme *theme = QWindowsTheme::instance())
theme->windowsThemeChanged(platformWindow->window());
return true;
+ }
#ifndef Q_OS_WINCE
case QtWindows::ActivateWindowEvent:
#ifndef QT_NO_TABLETEVENT
diff --git a/src/plugins/platforms/windows/qwindowscontext.h b/src/plugins/platforms/windows/qwindowscontext.h
index b5c97cddc9..0d3476e00f 100644
--- a/src/plugins/platforms/windows/qwindowscontext.h
+++ b/src/plugins/platforms/windows/qwindowscontext.h
@@ -168,6 +168,7 @@ public:
unsigned cwex_flags) const;
QWindow *windowUnderMouse() const;
+ void clearWindowUnderMouse();
inline bool windowsProc(HWND hwnd, UINT message,
QtWindows::WindowsEventType et,
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index 17a6cd6579..354f6700b3 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -2098,7 +2098,7 @@ QPlatformDialogHelper *createHelper(QPlatformTheme::DialogType type)
|| QSysInfo::windowsVersion() <= QSysInfo::WV_2003) {
return new QWindowsXpFileDialogHelper();
}
- if (QSysInfo::windowsVersion() > QSysInfo::WV_XP)
+ if (QSysInfo::windowsVersion() > QSysInfo::WV_2003)
return new QWindowsFileDialogHelper();
#else
return new QWindowsFileDialogHelper();
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.h b/src/plugins/platforms/windows/qwindowsmousehandler.h
index caf30e6b1a..7a7b92ca7e 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.h
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.h
@@ -72,6 +72,7 @@ public:
static Qt::MouseButtons queryMouseButtons();
QWindow *windowUnderMouse() const { return m_windowUnderMouse.data(); }
+ void clearWindowUnderMouse() { m_windowUnderMouse = 0; }
private:
inline bool translateMouseWheelEvent(QWindow *window, HWND hwnd,
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp
index 83d93b08bd..882967d22c 100644
--- a/src/plugins/platforms/windows/qwindowstheme.cpp
+++ b/src/plugins/platforms/windows/qwindowstheme.cpp
@@ -226,7 +226,6 @@ static inline QPalette menuPalette(const QPalette &systemPalette)
const QColor menuColor(getSysColor(COLOR_MENU));
const QColor menuTextColor(getSysColor(COLOR_MENUTEXT));
const QColor disabled(getSysColor(COLOR_GRAYTEXT));
- const bool isFlat = booleanSystemParametersInfo(SPI_GETFLATMENU, false);
// we might need a special color group for the result.
result.setColor(QPalette::Active, QPalette::Button, menuColor);
result.setColor(QPalette::Active, QPalette::Text, menuTextColor);
@@ -235,6 +234,7 @@ static inline QPalette menuPalette(const QPalette &systemPalette)
result.setColor(QPalette::Disabled, QPalette::WindowText, disabled);
result.setColor(QPalette::Disabled, QPalette::Text, disabled);
#ifndef Q_OS_WINCE
+ const bool isFlat = booleanSystemParametersInfo(SPI_GETFLATMENU, false);
result.setColor(QPalette::Disabled, QPalette::Highlight,
getSysColor(isFlat ? COLOR_MENUHILIGHT : COLOR_HIGHLIGHT));
#else
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index dc51dbfc88..e7e964a128 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -871,6 +871,9 @@ void QWindowsWindow::destroyWindow()
qDebug() << __FUNCTION__ << this << window() << m_data.hwnd;
if (m_data.hwnd) { // Stop event dispatching before Window is destroyed.
setFlag(WithinDestroy);
+ QWindowsContext *context = QWindowsContext::instance();
+ if (context->windowUnderMouse() == window())
+ context->clearWindowUnderMouse();
if (hasMouseCapture())
setMouseGrabEnabled(false);
unregisterDropSite();
@@ -893,7 +896,7 @@ void QWindowsWindow::destroyWindow()
#endif // !Q_OS_WINCE
if (m_data.hwnd != GetDesktopWindow())
DestroyWindow(m_data.hwnd);
- QWindowsContext::instance()->removeWindow(m_data.hwnd);
+ context->removeWindow(m_data.hwnd);
m_data.hwnd = 0;
}
}
@@ -1795,6 +1798,7 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const
}
#endif // !Q_OS_WINCE
+#ifndef QT_NO_CURSOR
// Return the default cursor (Arrow) from QWindowsCursor's cache.
static inline QWindowsWindowCursor defaultCursor(const QWindow *w)
{
@@ -1805,6 +1809,24 @@ static inline QWindowsWindowCursor defaultCursor(const QWindow *w)
return QWindowsWindowCursor(Qt::ArrowCursor);
}
+// Check whether to apply a new cursor. Either the window in question is
+// currently under mouse, or it is the parent of the window under mouse and
+// there is no other window with an explicitly set cursor in-between.
+static inline bool applyNewCursor(const QWindow *w)
+{
+ const QWindow *underMouse = QWindowsContext::instance()->windowUnderMouse();
+ if (underMouse == w)
+ return true;
+ for (const QWindow *p = underMouse; p ; p = p->parent()) {
+ if (p == w)
+ return true;
+ if (!QWindowsWindow::baseWindowOf(p)->cursor().isNull())
+ return false;
+ }
+ return false;
+}
+#endif // !QT_NO_CURSOR
+
/*!
\brief Applies to cursor property set on the window to the global cursor.
@@ -1826,23 +1848,6 @@ void QWindowsWindow::applyCursor()
#endif
}
-// Check whether to apply a new cursor. Either the window in question is
-// currently under mouse, or it is the parent of the window under mouse and
-// there is no other window with an explicitly set cursor in-between.
-static inline bool applyNewCursor(const QWindow *w)
-{
- const QWindow *underMouse = QWindowsContext::instance()->windowUnderMouse();
- if (underMouse == w)
- return true;
- for (const QWindow *p = underMouse; p ; p = p->parent()) {
- if (p == w)
- return true;
- if (!QWindowsWindow::baseWindowOf(p)->cursor().isNull())
- return false;
- }
- return false;
-}
-
void QWindowsWindow::setCursor(const QWindowsWindowCursor &c)
{
#ifndef QT_NO_CURSOR
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index 5fbc23c049..2529fb8a83 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -583,7 +583,7 @@ static const Qt::KeyboardModifiers ModsTbl[] = {
Qt::AltModifier | Qt::ShiftModifier, // 5
Qt::AltModifier | Qt::ControlModifier, // 6
Qt::AltModifier | Qt::ShiftModifier | Qt::ControlModifier, // 7
- Qt::NoModifier // Fall-back to raw Key_*
+ Qt::NoModifier // Fall-back to raw Key_*, for non-latin1 kb layouts
};
Qt::KeyboardModifiers QXcbKeyboard::translateModifiers(int s) const
@@ -602,8 +602,9 @@ Qt::KeyboardModifiers QXcbKeyboard::translateModifiers(int s) const
return ret;
}
-void QXcbKeyboard::readXKBConfig(struct xkb_rule_names *xkb_names)
+void QXcbKeyboard::readXKBConfig()
{
+ clearXKBConfig();
xcb_generic_error_t *error;
xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *config_reply;
@@ -634,15 +635,30 @@ void QXcbKeyboard::readXKBConfig(struct xkb_rule_names *xkb_names)
length -= len + 1;
} while (p < end || i < 5);
- xkb_names->rules = qstrdup(names[0]);
- xkb_names->model = qstrdup(names[1]);
- xkb_names->layout = qstrdup(names[2]);
- xkb_names->variant = qstrdup(names[3]);
- xkb_names->options = qstrdup(names[4]);
+ xkb_names.rules = qstrdup(names[0]);
+ xkb_names.model = qstrdup(names[1]);
+ xkb_names.layout = qstrdup(names[2]);
+ xkb_names.variant = qstrdup(names[3]);
+ xkb_names.options = qstrdup(names[4]);
free(config_reply);
}
+void QXcbKeyboard::clearXKBConfig()
+{
+ if (xkb_names.rules)
+ delete[] xkb_names.rules;
+ if (xkb_names.model)
+ delete[] xkb_names.model;
+ if (xkb_names.layout)
+ delete[] xkb_names.layout;
+ if (xkb_names.variant)
+ delete[] xkb_names.variant;
+ if (xkb_names.options)
+ delete[] xkb_names.options;
+ memset(&xkb_names, 0, sizeof(xkb_names));
+}
+
void QXcbKeyboard::updateKeymap()
{
m_config = true;
@@ -654,22 +670,13 @@ void QXcbKeyboard::updateKeymap()
return;
}
}
-
- struct xkb_rule_names xkb_names = {0, 0, 0, 0, 0};
-
- readXKBConfig(&xkb_names);
+ readXKBConfig();
// Compile a keymap from RMLVO (rules, models, layouts, variants and options) names
if (xkb_keymap)
xkb_keymap_unref(xkb_keymap);
xkb_keymap = xkb_keymap_new_from_names(xkb_context, &xkb_names, (xkb_keymap_compile_flags)0);
- delete[] xkb_names.rules;
- delete[] xkb_names.model;
- delete[] xkb_names.layout;
- delete[] xkb_names.variant;
- delete[] xkb_names.options;
-
if (!xkb_keymap) {
qWarning("Qt: Failed to compile a keymap");
m_config = false;
@@ -724,14 +731,14 @@ void QXcbKeyboard::updateXKBState(xcb_xkb_state_notify_event_t *state)
if (connection()->hasXKB()) {
- xkb_state_component newState;
- newState = xkb_state_update_mask(xkb_state,
- state->baseMods,
- state->latchedMods,
- state->lockedMods,
- state->baseGroup,
- state->latchedGroup,
- state->lockedGroup);
+ const xkb_state_component newState
+ = xkb_state_update_mask(xkb_state,
+ state->baseMods,
+ state->latchedMods,
+ state->lockedMods,
+ state->baseGroup,
+ state->latchedGroup,
+ state->lockedGroup);
if ((newState & XKB_STATE_LAYOUT_EFFECTIVE) == XKB_STATE_LAYOUT_EFFECTIVE) {
//qWarning("TODO: Support KeyboardLayoutChange on QPA (QTBUG-27681)");
@@ -745,17 +752,22 @@ void QXcbKeyboard::updateXKBStateFromCore(quint16 state)
if (!m_config)
return;
- quint32 modsDepressed, modsLatched, modsLocked;
- modsDepressed = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_DEPRESSED);
- modsLatched = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_LATCHED);
- modsLocked = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_LOCKED);
-
- quint32 xkbMask = xkbModMask(state);
- xkb_state_component newState;
- newState = xkb_state_update_mask(xkb_state,
- modsDepressed & xkbMask,
- modsLatched & xkbMask,
- modsLocked & xkbMask,
+ const quint32 modsDepressed = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_DEPRESSED);
+ const quint32 modsLatched = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_LATCHED);
+ const quint32 modsLocked = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_LOCKED);
+ const quint32 xkbMask = xkbModMask(state);
+
+ const quint32 latched = modsLatched & xkbMask;
+ const quint32 locked = modsLocked & xkbMask;
+ quint32 depressed = modsDepressed & xkbMask;
+ // set modifiers in depressed if they don't appear in any of the final masks
+ depressed |= ~(depressed | latched | locked) & xkbMask;
+
+ const xkb_state_component newState
+ = xkb_state_update_mask(xkb_state,
+ depressed,
+ latched,
+ locked,
0,
0,
(state >> 13) & 3); // bits 13 and 14 report the state keyboard group
@@ -838,7 +850,7 @@ QList<int> QXcbKeyboard::possibleKeys(const QKeyEvent *event) const
xkb_mod_index_t controlMod = xkb_keymap_mod_get_index(xkb_keymap, "Control");
xkb_mod_mask_t depressed;
-
+ struct xkb_keymap *fallback_keymap = 0;
int qtKey = 0;
//obtain a list of possible shortcuts for the given key event
for (uint i = 1; i < sizeof(ModsTbl) / sizeof(*ModsTbl) ; ++i) {
@@ -854,8 +866,23 @@ QList<int> QXcbKeyboard::possibleKeys(const QKeyEvent *event) const
depressed |= (1 << controlMod);
// update a keyboard state from a set of explicit masks
- xkb_state_update_mask(kb_state, depressed, latchedMods, lockedMods,
- baseLayout, latchedLayout, lockedLayout);
+ if (i == 8) {
+ // Add a fall back key for layouts with non Latin-1 characters
+ if (baseQtKey > 255) {
+ struct xkb_rule_names names = { xkb_names.rules, xkb_names.model, "us", 0, 0 };
+ fallback_keymap = xkb_keymap_new_from_names(xkb_context, &names, (xkb_keymap_compile_flags)0);
+ if (!fallback_keymap)
+ continue;
+ xkb_state_unref(kb_state);
+ kb_state = xkb_state_new(fallback_keymap);
+ if (!kb_state)
+ continue;
+ } else
+ continue;
+ } else {
+ xkb_state_update_mask(kb_state, depressed, latchedMods, lockedMods,
+ baseLayout, latchedLayout, lockedLayout);
+ }
sym = xkb_state_key_get_one_sym(kb_state, event->nativeScanCode());
if (sym == XKB_KEY_NoSymbol)
@@ -870,8 +897,11 @@ QList<int> QXcbKeyboard::possibleKeys(const QKeyEvent *event) const
result += (qtKey + mods);
}
}
+ if (kb_state)
+ xkb_state_unref(kb_state);
+ if (fallback_keymap)
+ xkb_keymap_unref(fallback_keymap);
- xkb_state_unref(kb_state);
return result;
}
@@ -941,6 +971,7 @@ QXcbKeyboard::QXcbKeyboard(QXcbConnection *connection)
, core_device_id(0)
#endif
{
+ memset(&xkb_names, 0, sizeof(xkb_names));
updateKeymap();
#ifndef QT_NO_XKB
if (connection->hasXKB()) {
@@ -982,6 +1013,7 @@ QXcbKeyboard::~QXcbKeyboard()
#ifdef QT_NO_XKB
xcb_key_symbols_free(m_key_symbols);
#endif
+ clearXKBConfig();
}
#ifndef QT_NO_XKB
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.h b/src/plugins/platforms/xcb/qxcbkeyboard.h
index 770a7eabea..0256602782 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.h
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.h
@@ -91,7 +91,8 @@ protected:
int keysymToQtKey(xcb_keysym_t keysym) const;
int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, QString text) const;
- void readXKBConfig(struct xkb_rule_names *names);
+ void readXKBConfig();
+ void clearXKBConfig();
#ifdef QT_NO_XKB
void updateModifiers();
@@ -107,6 +108,7 @@ private:
struct xkb_context *xkb_context;
struct xkb_keymap *xkb_keymap;
struct xkb_state *xkb_state;
+ struct xkb_rule_names xkb_names;
struct _mod_masks {
uint alt;
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index c95c4d95ba..35b95b84a1 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -1302,6 +1302,9 @@ QRect QXcbWindow::windowToWmGeometry(QRect r) const
r.translate(m_frameMargins.left(), m_frameMargins.top());
} else if (!frameInclusive && m_gravity == XCB_GRAVITY_NORTH_WEST) {
r.translate(-m_frameMargins.left(), -m_frameMargins.top());
+ } else if (!frameInclusive && m_gravity == XCB_GRAVITY_CENTER) {
+ r.translate(-(m_frameMargins.left() - m_frameMargins.right())/2,
+ -(m_frameMargins.top() - m_frameMargins.bottom())/2);
}
return r;
}
@@ -1643,7 +1646,8 @@ void QXcbWindow::handleUnmapNotifyEvent(const xcb_unmap_notify_event_t *event)
void QXcbWindow::handleButtonPressEvent(const xcb_button_press_event_t *event)
{
- if (window() != QGuiApplication::focusWindow()) {
+ const bool isWheel = event->detail >= 4 && event->detail <= 7;
+ if (!isWheel && window() != QGuiApplication::focusWindow()) {
QWindow *w = static_cast<QWindowPrivate *>(QObjectPrivate::get(window()))->eventReceiver();
if (!(w->flags() & Qt::WindowDoesNotAcceptFocus))
w->requestActivate();
@@ -1665,7 +1669,7 @@ void QXcbWindow::handleButtonPressEvent(const xcb_button_press_event_t *event)
Qt::KeyboardModifiers modifiers = connection()->keyboard()->translateModifiers(event->state);
- if (event->detail >= 4 && event->detail <= 7) {
+ if (isWheel) {
// Logic borrowed from qapplication_x11.cpp
int delta = 120 * ((event->detail == 4 || event->detail == 6) ? 1 : -1);
bool hor = (((event->detail == 4 || event->detail == 5)
diff --git a/src/plugins/platforms/xcb/qxcbxsettings.cpp b/src/plugins/platforms/xcb/qxcbxsettings.cpp
index c106bd00f8..1423c6262d 100644
--- a/src/plugins/platforms/xcb/qxcbxsettings.cpp
+++ b/src/plugins/platforms/xcb/qxcbxsettings.cpp
@@ -221,6 +221,7 @@ QXcbXSettings::QXcbXSettings(QXcbScreen *screen)
xcb_intern_atom_reply_t *atom_reply = xcb_intern_atom_reply(screen->xcb_connection(),atom_cookie,&error);
if (error) {
qWarning() << Q_FUNC_INFO << "Failed to find XSETTINGS_S atom";
+ free(error);
return;
}
xcb_atom_t selection_owner_atom = atom_reply->atom;
@@ -233,14 +234,15 @@ QXcbXSettings::QXcbXSettings(QXcbScreen *screen)
xcb_get_selection_owner_reply(screen->xcb_connection(), selection_cookie, &error);
if (error) {
qWarning() << Q_FUNC_INFO << "Failed to get selection owner for XSETTINGS_S atom";
+ free(error);
return;
}
d_ptr->x_settings_window = selection_result->owner;
+ free(selection_result);
if (!d_ptr->x_settings_window) {
return;
}
- free(selection_result);
const uint32_t event = XCB_CW_EVENT_MASK;
const uint32_t event_mask[] = { XCB_EVENT_MASK_STRUCTURE_NOTIFY|XCB_EVENT_MASK_PROPERTY_CHANGE };
diff --git a/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp b/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp
index 4e9cc446b3..e8758da1c7 100644
--- a/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp
+++ b/src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp
@@ -587,6 +587,7 @@ QFont QGtk2FontDialogHelper::currentFont() const
void QGtk2FontDialogHelper::onAccepted()
{
+ emit currentFontChanged(currentFont());
emit accept();
emit fontSelected(currentFont());
}
diff --git a/src/printsupport/dialogs/qabstractprintdialog.cpp b/src/printsupport/dialogs/qabstractprintdialog.cpp
index 6951d8c7bc..ba5320f040 100644
--- a/src/printsupport/dialogs/qabstractprintdialog.cpp
+++ b/src/printsupport/dialogs/qabstractprintdialog.cpp
@@ -460,6 +460,10 @@ void QAbstractPrintDialog::setOptionTabs(const QList<QWidget*> &tabs)
is shown with exec(), done() causes the local event loop to finish,
and exec() to return \a result.
+ \note This function does not apply to the Native Print Dialog on the Mac
+ OS X and Windows platforms, because the dialog is required to be modal
+ and only the user can close it.
+
\sa QDialog::done()
*/
void QPrintDialog::done(int result)
diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm
index e76bb18626..9839268af4 100644
--- a/src/printsupport/dialogs/qprintdialog_mac.mm
+++ b/src/printsupport/dialogs/qprintdialog_mac.mm
@@ -198,7 +198,9 @@ void QPrintDialogPrivate::openCocoaPrintPanel(Qt::WindowModality modality)
qApp->processEvents(QEventLoop::ExcludeUserInputEvents, QEventLoop::ExcludeSocketNotifiers);
QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate) *delegate = [[QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate) alloc] init];
- if (modality == Qt::ApplicationModal) {
+ if (modality == Qt::ApplicationModal || !q->parentWidget()) {
+ if (modality == Qt::NonModal)
+ qWarning("QPrintDialog is required to be modal on OS X");
int rval = [printPanel runModalWithPrintInfo:printInfo];
[delegate printPanelDidEnd:printPanel returnCode:rval contextInfo:q];
} else {
diff --git a/src/printsupport/kernel/qpaintengine_preview.cpp b/src/printsupport/kernel/qpaintengine_preview.cpp
index d8c653fed8..d0578c5543 100644
--- a/src/printsupport/kernel/qpaintengine_preview.cpp
+++ b/src/printsupport/kernel/qpaintengine_preview.cpp
@@ -94,6 +94,7 @@ bool QPreviewPaintEngine::begin(QPaintDevice *)
page->d_func()->in_memory_only = true;
d->painter = new QPainter(page);
d->engine = d->painter->paintEngine();
+ *d->painter->d_func()->state = *painter()->d_func()->state;
d->pages.append(page);
d->state = QPrinter::Active;
return true;
diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro
index bf19828634..697c8f5574 100644
--- a/src/tools/bootstrap/bootstrap.pro
+++ b/src/tools/bootstrap/bootstrap.pro
@@ -50,14 +50,11 @@ QMAKE_SYNCQT_OPTIONS += -version $$QT_VERSION
load(qt_module)
-INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
-
SOURCES += \
../../corelib/codecs/qlatincodec.cpp \
../../corelib/codecs/qtextcodec.cpp \
../../corelib/codecs/qutfcodec.cpp \
../../corelib/global/qglobal.cpp \
- ../../corelib/global/qlibraryinfo.cpp \
../../corelib/global/qlogging.cpp \
../../corelib/global/qmalloc.cpp \
../../corelib/global/qnumeric.cpp \
@@ -74,7 +71,6 @@ SOURCES += \
../../corelib/io/qfsfileengine_iterator.cpp \
../../corelib/io/qiodevice.cpp \
../../corelib/io/qfiledevice.cpp \
- ../../corelib/io/qsettings.cpp \
../../corelib/io/qtemporaryfile.cpp \
../../corelib/io/qtextstream.cpp \
../../corelib/io/qstandardpaths.cpp \
@@ -124,13 +120,11 @@ unix:SOURCES += ../../corelib/io/qfilesystemengine_unix.cpp \
win32:SOURCES += ../../corelib/io/qfilesystemengine_win.cpp \
../../corelib/io/qfilesystemiterator_win.cpp \
../../corelib/io/qfsfileengine_win.cpp \
- ../../corelib/io/qsettings_win.cpp \
../../corelib/kernel/qcoreapplication_win.cpp \
../../corelib/plugin/qsystemlibrary.cpp \
mac {
- SOURCES += ../../corelib/io/qsettings_mac.cpp \
- ../../corelib/kernel/qcoreapplication_mac.cpp \
+ SOURCES += ../../corelib/kernel/qcoreapplication_mac.cpp \
../../corelib/kernel/qcore_mac.cpp
LIBS += -framework CoreServices
}
diff --git a/src/tools/qdoc/doc/qdoc-manual-qdocconf-minimal.qdoc b/src/tools/qdoc/doc/qdoc-manual-qdocconf-minimal.qdoc
new file mode 100644
index 0000000000..dd4becef17
--- /dev/null
+++ b/src/tools/qdoc/doc/qdoc-manual-qdocconf-minimal.qdoc
@@ -0,0 +1,78 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+\page qdoc-manual-qdocconf-minimal
+\title Minimal qdocconf file
+\brief Describes a qdocconf file with a minimal number of statements
+
+The full contents of the minimal qdocconf file:
+
+\code
+ #include(compat.qdocconf)
+ headerdirs = .
+ sourcedirs = .
+ exampledirs = .
+ imagedirs = ./images
+
+\endcode
+
+\title Statements with Comments
+
+\code
+ #include(compat.qdocconf)
+\endcode
+
+In order to avoid compatibility issues between different versions of QDoc,
+it is advised to include compat.qdocconf.
+
+\code
+ headerdirs = .
+\endcode
+
+The header files associated with the .cpp source files can be found in the
+current directory.
+
+\code
+ #sourcedirs = .
+\endcode
+
+The .cpp or .qdoc files can be found in the current directory.
+
+\code
+ exampledirs = .
+\endcode
+
+The source code of the example files can be found in the current directory.
+
+\code
+ imagedirs = ./images
+\endcode
+
+The images used in the documentation can be found in subdirectory \e images.
+
+\note Please take care with this minimal qdocconf file. Using it in the wrong directory could cause qdoc to include a large number of files.
+*/
diff --git a/src/tools/qdoc/doc/qdoc-manual.qdoc b/src/tools/qdoc/doc/qdoc-manual.qdoc
index 4a4b1db6ff..010b2f79ec 100644
--- a/src/tools/qdoc/doc/qdoc-manual.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual.qdoc
@@ -83,12 +83,12 @@
\title Introduction to QDoc
QDoc is a tool used by Qt Developers to generate documentation for
- software projects. It works by extracting \e {qdoc comments} from
+ software projects. It works by extracting \e {QDoc comments} from
project source files and then formatting these comments as HTML
- pages or DITA XML documents, etc. QDoc finds qdoc comments in \c
- {.cpp} files and in \c {.qdoc} files. QDoc does not look for qdoc
- comments in \c {.h} files. A qdoc comment always begins with an
- exclamation mark \b{!} e.g.:
+ pages or DITA XML documents. QDoc finds QDoc comments in \c
+ {.cpp} files and in \c {.qdoc} files. QDoc does not look for QDoc
+ comments in \c {.h} files. A QDoc comment always begins with an
+ exclamation mark (\b{!})). For example:
\code
/ *!
@@ -112,27 +112,27 @@
QObjects organize themselves in \l {Object Trees &
Ownership} {object trees}. When you create a QObject with
another object as parent, the object will automatically
- add itself to the parent's children() list. The parent
- takes ownership of the object; i.e., it will automatically
+ add itself to the parent's \c children() list. The parent
+ takes ownership of the object. It will automatically
delete its children in its destructor. You can look for an
object by name and optionally type using findChild() or
findChildren().
Every object has an objectName() and its class name can be
found via the corresponding metaObject() (see
- QMetaObject::className()). You can determine whether the
+ QMetaObject::className()). You can determine whether the
object's class inherits another class in the QObject
- inheritance hierarchy by using the inherits() function.
+ inheritance hierarchy by using the \c inherits() function.
....
* /
\endcode
- From the qdoc comment above, QDoc generates the now famous HTML
- page \l {http://qt-project.org/doc/qt-5.0/qtcore/qobject.html#details}
+ From the QDoc comment above, QDoc generates the HTML page
+ \l {http://qt-project.org/doc/qt-5.0/qtcore/qobject.html#details}
{QObject Class Reference}.
- This manual explains how to use the QDoc commands in qdoc comments
+ This manual explains how to use the QDoc commands in QDoc comments
to embed good documentation in your source files. It also explains
how to make a \l {The QDoc Configuration File} {QDoc configuration
file}, which you will pass to QDoc on the command line.
@@ -154,10 +154,10 @@
and where to put the generated documentation. The configuration
file also contains other information for QDoc.
- See \l{The QDoc Configuration File} for a instructions on how to
- build a QDoc configuration file.
+ See \l{The QDoc Configuration File} for instructions on how to
+ set up a QDoc configuration file.
- \section1 How QDoc Works
+ \section1 How QDoc works
QDoc begins by reading the configuration file you specified on the
command line. It stores all the variables from the configuration
@@ -168,15 +168,15 @@
HTML output. That's usually what you will want anyway, but you can
also specify \e {DITAXML} to get DITA XML output instead.
- Next, QDoc uses the values of the \l
- {22-qdoc-configuration-generalvariables.html#headerdirs-variable}
+ Next, QDoc uses the values of the
+ \l {22-qdoc-configuration-generalvariables.html#headerdirs-variable}
{headerdirs} variable and/or the \l
{22-qdoc-configuration-generalvariables.html#headers-variable}
{headers} variable to find and parse all the header files for your
- project. QDoc does \e not scan header files for qdoc comments. It
+ project. QDoc does \e not scan header files for QDoc comments. It
parses the header files to build a master tree of all the items
- that should be documented (i.e. the items that QDoc should find
- qdoc comments for).
+ that should be documented, in other words, the items that QDoc should find
+ QDoc comments for.
After parsing all the header files and building the master tree of
items to be documented, QDoc uses the value of the \l
@@ -185,11 +185,11 @@
{22-qdoc-configuration-generalvariables.html#sources-variable}
{sources} variable to find and parse all the \c {.cpp} and \c
{.qdoc} files for your project. These are the files QDoc scans for
- \e {qdoc comments}. Remember that a qdoc comment begins with
- an exclamation mark, i.e. \b {/*!} .
+ \e {QDoc comments}. Remember that a QDoc comment begins with
+ an exclamation mark: \b {/*!} .
- For each qdoc comment it finds, it searches the master tree for
- the item where the documentation belongs. The it interprets the
+ For each QDoc comment it finds, it searches the master tree for
+ the item where the documentation belongs. Then it interprets the
qdoc commands in the comment and stores the interpreted commands
and the comment text in the tree node for the item.
@@ -211,17 +211,17 @@
\li \l {Markup Commands}
\endlist
- Topic commands identify the element you are documenting, e.g. a C++
- class, function, or type, an example, or an extra page of text
+ Topic commands identify the element you are documenting, for example
+ a C++ class, function, type, or an extra page of text
that doesn't map to an underlying C++ element.
Context commands tell QDoc how the element being documented
- relates to other documented elements, e.g. next and previous page
- links or inclusion in page groups or library modules. Context
+ relates to other documented elements, for example, next and previous page
+ links, inclusion in page groups, or library modules. Context
commands can also provide information about the documented element
- that QDoc can't get from the source files, e.g. whether the
- element is thread-safe, an overloaded or reimplemented function,
- or that it has been deprecated.
+ that QDoc can't get from the source files, for example, whether the
+ element is thread-safe, whether it is an overloaded or reimplemented function,
+ or whether it has been deprecated.
Markup commands tell QDoc how text and image elements in the
document should be rendered, or about the document's outline
@@ -273,6 +273,7 @@
\li \l {12-0-qdoc-commands-miscellaneous.html#meta-command} {\\meta}
\li \l {06-qdoc-commands-includecodeinline.html#newcode-command} {\\newcode}
\li \l {10-qdoc-commands-tablesandlists.html#li-command} {\\o} \span {class="newStuff"} {(deprecated, use \\li)}
+ \li \l {11-qdoc-commands-specialcontent.html#note-command} {\\note}
\li \l {06-qdoc-commands-includecodeinline.html#oldcode-command} {\\oldcode}
\li \l {12-0-qdoc-commands-miscellaneous.html#omit-command} {\\omit}
\li \l {05-qdoc-commands-documentstructure.html#part-command} {\\part}
@@ -353,17 +354,17 @@
The \a parent parameter is sent to the QWidget constructor.
\endquotation
- You can enclose the formal parameter name in curly brackets, if
- you want to, but it isn't necessary.
+ The formal parameter name may be enclosed between curly brackets,
+ but that isn't required.
\target c-command
\section1 \\c (code font)
The \\c command is used for rendering variable names, user-defined
- class names, and C++ keywords (e.g. \c int and \c for) in the code
+ class names, and C++ keywords (for example, \c int and \c for) in the code
font.
- The command renders its argument using a typewriter font. For
+ The command renders its argument using a monospace font. For
example:
\code
@@ -378,7 +379,7 @@
\quotation
The \c AnalogClock class provides a clock widget with hour
- and minute hands that is automatically updated every
+ and minute hands, which are automatically updated every
few seconds.
\endquotation
@@ -396,7 +397,7 @@
\endquotation
The \\c command accepts the special character \c \ within its
- argument, i.e. it renders it as a normal character. So if you want
+ argument, which renders it as a normal character. So if you want
to use nested commands, you must use the \l {tt-command} {teletype
(\\tt)} command instead.
@@ -411,7 +412,7 @@
An argument must be provided in curly braces, as in the qdoc
comment shown below. The argument is not interpreted but is used
- as attribute(s) of the tag that is ultimately output by qdoc.
+ as attribute(s) of the tag that is output by qdoc.
For example, we might want to render an inline image so that it
floats to the right of the current block of text:
@@ -432,7 +433,7 @@
\endcode
For HTML, the attribute value \e {float-right} then will refer to
- a clause in the style.css file. which in this case could be:
+ a clause in the style.css file, which in this case could be:
\code
div.float-right
@@ -456,9 +457,9 @@
Your DITA XML publishing program must then recognize the \e
{outputclass} attribute value.
- \note The \b {\\div} command can be nested.
+ \note Note that the \b {\\div} command can be nested.
- Below is an example taken from the index.qdoc file used to
+ Below you can find an example taken from the index.qdoc file used to
generate index.html for Qt 4.7:
\code
@@ -491,7 +492,7 @@
\endcode
When all the class attribute values are defined as they are in the
- style.css file that is used for rendering the Qt 4.7 documentation,
+ style.css file that is used for rendering the Qt documentation,
the above example is rendered as:
\div {class="indexbox guide"}
@@ -573,14 +574,13 @@
\target span -command
\section1 \\span
- The \\span command is for applying special formatting
- attributes to a small block of text.
+ The \\span command applies special formatting to a small block of text.
Two arguments must be provided, each argument in curly braces, as
- shown in the qdoc comment below. The first argument is not
- interpreted but is used as the formatting attribute(s) of the tag
- that is ultimately output by qdoc. The second argument is the text
- to be rendered with the special formatting attributes.
+ shown in the QDoc comment below. The first argument is not
+ interpreted, but specifies the formatting attribute(s) of the tag
+ output by QDoc. The second argument is the text to be rendered with
+ the special formatting attributes.
For example, we might want to render the first word of each
element in a numeric list in blue.
@@ -633,8 +633,8 @@
\code
/ *!
- After \c setupUi() populates the main container with
- child widgets it scans the main container's list of
+ After having populated the main container with
+ child widgets, \c setupUi() scans the main container's list of
slots for names with the form
\tt{on_\e{objectName}_\e{signalName}().}
* /
@@ -643,10 +643,10 @@
QDoc renders this as:
\quotation
- After \c setupUi() populates the main container with
- child widgets it scans the main container's list of
- slots for names with the form
- \tt{on_\e{objectName}_\e{signalName}().}
+ After having populated the main container with
+ child widgets, \c setupUi() scans the main container's list of
+ slots for names with the form
+ \tt{on_\e{objectName}_\e{signalName}().}
\endquotation
If the text to be rendered in the code font contains spaces, enclose the
@@ -695,14 +695,14 @@
\code
/ *!
- Here, we render \e {a few words} in italic.
+ Here, we render \e {a few words} in italics.
* /
\endcode
QDoc renders this as:
\quotation
- Here, we render \e {a few words} in italic.
+ Here, we render \e {a few words} in italics.
\endquotation
If you want to use other QDoc commands within an argument that
@@ -725,7 +725,7 @@
\endquotation
Finally, trailing punctuation is not included in an argument [4],
- nor is 's [5]
+ nor is "'s" [5]
\raw HTML
<table align="center" cellpadding="2"
@@ -841,7 +841,7 @@
\section1 \\uicontrol
The \\uicontrol command is used to mark content as being used for UI
- control elements. When using HTML the output is rendered in bold.
+ control elements. When using HTML, the output is rendered in bold.
When using DITA XML the content is enclosed in a \c{uicontrol} tag.
\sa \\b
@@ -854,7 +854,7 @@
\code
/ *!
The \underline {F}ile menu gives the users the possibility
- to open, and edit, an existing file, save a new or modified
+ to edit an existing file, or save a new or modified
file, and exit the application.
* /
\endcode
@@ -863,7 +863,7 @@
\quotation
The \underline {F}ile menu gives the users the possibility
- to open, and edit, an existing file, save a new or modified
+ to edit an existing file, or save a new or modified
file, and exit the application.
\endquotation
@@ -873,12 +873,11 @@
\target backslash-command
\section1 \\\\ (double backslash)
- The \\\\ command expands to a single backslash.
+ The \\\\ command expands to a double backslash.
- QDoc commands always start with a backslash alone. To display an
- actual backslash in the text you need to type two of the kind. If
- you want to display two backslashes, you need to type four, and so
- forth.
+ QDoc commands always start with a single backslash. To display a
+ single backslash in the text you need to type two backslashes. If
+ you want to display two backslashes, you need to type four.
\code
/ *!
@@ -896,7 +895,7 @@
writing C:\\windows\\home\\.
\endquotation
- However, if you want your text to appear in a typewriter font as
+ However, if you want your text to appear in a monospace font as
well, you can use the \l {c-command} {\\c} command instead, which
accepts and renders the backslash as any other character. For
example:
@@ -905,7 +904,7 @@
/ *!
The \\c command is useful if you want a
backslash to appear verbatim, and the word
- that contains it written in a typewriter font,
+ that contains it written in a monospace font,
like this: \c {C:\windows\home\}.
* /
\endcode
@@ -915,7 +914,7 @@
\quotation
The \\c command is useful if you want a
backslash to appear verbatim, and the word
- that contains it written in a typewriter font,
+ that contains it written in a monospace font,
like this: \c {C:\windows\home\}.
\endquotation
@@ -931,8 +930,8 @@
The document structuring commands are for dividing your document
into sections. QDoc supports six kinds of sections: \c \part, \c
- \chapter, \c \section1, \c \section2, \c \section3 and \c
- \section4. The \c \section1..4 commands are the most useful. The
+ \chapter, \c \section1, \c \section2, \c \section3, and \c
+ \section4. The \c \section1..4 commands are the most useful. They
correspond to the traditional section, subsection, etc used in
outlining.
@@ -1098,7 +1097,7 @@
Each section is a logical unit in the document. The section
heading appears in the automatically generated table of contents
- that normally appears in the upper righthand corner of the page.
+ that normally appears in the upper right-hand corner of the page.
\target chapter-command
\section1 \\chapter
@@ -1107,7 +1106,7 @@
larger documents, and divides the document into chapters.
See \l{part} {\\part} for an explanation of the various
- section units, command argument and rendering.
+ section units, command argument, and rendering.
\target sectionOne-command
\section1 \\section1
@@ -1115,7 +1114,7 @@
The \\section1 command starts a new section.
See \l{part} {\\part} for an explanation of the various
- section units, command argument and rendering.
+ section units, command argument, and rendering.
\target sectionTwo-command
\section1 \\section2
@@ -1123,7 +1122,7 @@
The \\section2 command starts a new section.
See \l{part} {\\part} for an explanation of the various
- section units, command argument and rendering.
+ section units, command argument, and rendering.
\target sectionThree-command
\section1 \\section3
@@ -1131,7 +1130,7 @@
The \\section3 command starts a new section.
See \l{part} {\\part} for an explanation of the various
- section units, command argument and rendering.
+ section units, command argument, and rendering.
\target sectionFour-command
\section1 \\section4
@@ -1139,7 +1138,7 @@
The \\section4 command starts a new section.
See \l{part} {\\part} for an explanation of the various
- section units, command argument and rendering.
+ section units, command argument, and rendering.
*/
@@ -1178,7 +1177,7 @@
When processing any of the \\code, \l {newcode-command} {\\newcode} or \l
{oldcode-command} {\\oldcode} commands, QDoc removes all
indentation that is common for the verbatim code blocks within a
- \c{/}\c{*!} ... \c{*}\c{/} comment before it adds the standard
+ \c{/}\c{*!} ... \c{*}\c{/} comment before it adds the standard
indentation. For that reason the recommended style is to use 8
spaces for the verbatim code contained within these commands
@@ -1224,7 +1223,7 @@
See also \l {c-command} {\\c}, \l
{07-0-qdoc-commands-includingexternalcode.html#quotefromfile-command}
- {\\quotefromfile}, \l{newcode-command} {\\newcode} and \l {oldcode-command}
+ {\\quotefromfile}, \l{newcode-command} {\\newcode}, and \l {oldcode-command}
{\\oldcode}.
\target newcode-command
@@ -1233,13 +1232,15 @@
The \\newcode, \\oldcode, and \\endcode commands enable you to
show how to port a snippet of code to a new version of an API.
- The \\newcode command, and its companion the \\oldcode command, is
+ The \\newcode command and its companion the \\oldcode command are
a convenience combination of the \l {code-command} {\\code} commands:
- The combination provides a text relating the two code snippets to each
- other. The command requires a preceding \\oldcode statement.
+ this combination provides a text relating the two code snippets to each
+ other.
+
+ The \\newcode command requires a preceding \\oldcode statement.
Like the \l{code-command}{\\code} command, the \\newcode command renders its
- code on a new line in the documentation using a typewriter font and the
+ code on a new line in the documentation using a monospace font and the
standard indentation.
\code
@@ -1284,8 +1285,8 @@
\section1 \\qml
The \\qml and \\endqml commands enclose a snippet of QML source
- code. Currently, QDoc handles \\qml and \\endqml exactly the same
- as \\code and \\endcode.
+ code. Currently, QDoc handles \\qml and \\endqml in exactly the same
+ way as \\code and \\endcode.
\code
/ *!
@@ -1362,7 +1363,7 @@
argument, make sure to follow the file name with a line break.
The file's contents is rendered in a separate paragraph, using a
- typewriter font and the standard indentation. The code is shown
+ monospace font and the standard indentation. The code is shown
verbatim.
\code
@@ -1476,7 +1477,7 @@
substring with a line break.
The line from the source file is rendered as a separate paragraph,
- using a typewriter font and the standard indentation. The code is
+ using a monospace font and the standard indentation. The code is
shown verbatim.
\code
@@ -1605,7 +1606,7 @@
{printline-command} {\\printline} command.
The lines from the source file are rendered in a separate
- paragraph, using a typewriter font and the standard
+ paragraph, using a monospace font and the standard
indentation. The code is shown verbatim.
\code
@@ -1654,7 +1655,7 @@
{printline-command} {\\printline} command.
The lines from the source file are rendered in a separate
- paragraph, using a typewriter font and the standard
+ paragraph, using a monospace font and the standard
indentation. The code is shown verbatim.
\code
@@ -1779,7 +1780,7 @@
\skipto main
\printuntil }
- First we create a QApplication object. There
+ First we create a QApplication object. There
has to be exactly one such object in
every GUI application that uses Qt. Then
we create a QPushButton, resize it to a reasonable
@@ -1797,7 +1798,7 @@
\skipto main
\printuntil }
- First we create a QApplication object. There has to be
+ First we create a QApplication object. There has to be
exactly one such object in every GUI application that
uses Qt. Then we create a QPushButton, resize it to a
reasonable size ...
@@ -1874,7 +1875,7 @@
The command is used in conjunction with the \l
{quotefromfile-command} {\\quotefromfile} command, and should be
stated on its own line. The dots are rendered on a new line, using
- a typewriter font.
+ a monospace font.
\code
/ *!
@@ -1928,10 +1929,10 @@
The \\snippet command causes a code snippet to be included
verbatim as preformatted text, which may be syntax highlighted.
- Each code snippet are referenced by the file that holds it and by
+ Each code snippet is referenced by the file that holds it and by
a unique identifier for that file. Snippet files are typically
stored in a \c{snippets} directory inside the documentation
- directory (e.g., \c{$QTDIR/doc/src/snippets}).
+ directory (for example, \c{$QTDIR/doc/src/snippets}).
For example, the following documentation references a snippet in a
file residing in a subdirectory of the documentation directory:
@@ -1942,7 +1943,7 @@
The text following the file name is the unique identifier for the
snippet. This is used to delimit the quoted code in the relevant
- snippet file as shown in the following example that corresponds to
+ snippet file, as shown in the following example that corresponds to
the above \c{\\snippet} command:
\dots
@@ -2021,7 +2022,7 @@
\target assertions
Assertions make some statement about the text at the
- point where they occur in the regexp but they do not
+ point where they occur in the regexp, but they do not
match any characters.
...
@@ -2038,7 +2039,7 @@
\target assertions
Assertions make some statement about the text at the
- point where they occur in the regexp but they do not
+ point where they occur in the regexp, but they do not
match any characters.
...
@@ -2048,7 +2049,7 @@
* /
\endcode
- For the one-parameter version the braces can often be omitted.
+ For the one-parameter version, the braces can often be omitted.
The \\l command supports several kinds of links:
\list
@@ -2069,7 +2070,7 @@
\l {title-command} {\\title} command.
\li \c {\l {Introduction to QDoc}}- The text from one of the
- \l{part-command} {\\part}, \l{chapter} {\\chapter} or \l
+ \l{part-command} {\\part}, \l{chapter} {\\chapter}, or \l
{sectionOne-command} {\\section} commands.
\li \c {\l fontmatching} - The argument of a \l {target-command}
@@ -2085,8 +2086,8 @@
\endlist
- QDoc also tries to make a link out of any words that don't
- resemble any normal English words, for example Qt class names or
+ QDoc also tries to make a link out of any word that doesn't
+ resemble a normal English word, for example, Qt class names or
functions, like QWidget or QWidget::sizeHint(). In these cases,
the \\l command can actually be omitted, but by using the command,
you ensure that QDoc will emit a warning if it cannot find the
@@ -2103,7 +2104,7 @@
\l {QWidget::} {sizeHint()}
\endquotation
- See also \l {sa-command} {\\sa}, \l {target-command} {\\target}
+ See also \l {sa-command} {\\sa}, \l {target-command} {\\target},
and \l {keyword-command} {\\keyword}.
@@ -2116,7 +2117,7 @@
The command takes a comma-separated list of links as its
argument. If the line ends with a comma, you can continue
- the list on the next line. The general syntax is:
+ the list on the next line. The general syntax is:
\code
\sa {the first link}, {the second link},
@@ -2200,14 +2201,14 @@
within the same document containing the target in two ways:
\list
- \li \c {\l {capturing parentheses}} (from within the same qdoc comment)
+ \li \c {\l {capturing parentheses}} (from within the same QDoc comment)
\li \c {\l qregexp.html#capturing-parentheses} (from elsewhere in the same document)
\endlist
\note The brackets in the link example are required because the
target name contains spaces.
- From other documents, the target name can be linked this way:
+ The target name can be linked to in the following way from other documents:
\list
\li \c {\l http://qt-project.org/doc/qt-5.0/qtcore/qregexp.html#capturing-parentheses}
@@ -2252,7 +2253,7 @@
* /
\endcode
- The location marked with the keyword can be linked with:
+ The location marked with the keyword can be linked to with:
\code
/ *!
@@ -2264,7 +2265,7 @@
QDoc renders this as:
\quotation
- When a string is surrounded by slashes, it's
+ When a string is surrounded by slashes, it is
interpreted as a \l {regular expression}.
\endquotation
@@ -2296,8 +2297,8 @@
The command takes two arguments. The first argument is the name of
the image file. The second argument is optional and is a simple
description of the image, equivalent to the HTML alt="" in an image
- tag. The description is used for tooltips, and for when a browser
- doesn't support images, like the Lynx text browser.
+ tag. The description is used for tooltips and for browsers that don't
+ support images, like the Lynx text browser.
The remaining text \e{after} the file name is the optional,
description argument. Be sure to follow the file name or the
@@ -2414,7 +2415,7 @@
\inlineimage training.jpg Qt Training
The Qt Programming course is offered as a
five day Open Enrollment Course. The classes
- are open to the public. While the course is open
+ are open to the public. Although the course is open
to anyone who wants to learn, attendees should
have significant experience in C++ development
to derive maximum benefit from the course.
@@ -2427,7 +2428,7 @@
\inlineimage training.jpg Qt Training
The Qt Programming course is offered as a
five day Open Enrollment Course. The classes
- are open to the public. While the course is open
+ are open to the public. Although the course is open
to anyone who wants to learn, attendees should
have significant experience in C++ development
to derive maximum benefit from the course.
@@ -2584,10 +2585,10 @@
/ *!
\table
\header
- \li {3,1} This header cell spans three columns
+ \li {3,1} This header cell spans three columns,
but only one row.
\row
- \li {2, 1} This table cell spans two columns
+ \li {2, 1} This table cell spans two columns,
but only one row
\li {1, 2} This table cell spans only one column,
but two rows.
@@ -2606,13 +2607,13 @@
<tr valign="top" bgcolor="#a2c511">
<th colspan="3" rowspan=" 1">
- This header cell spans three columns but only one row
+ This header cell spans three columns, but only one row.
</th>
</tr>
<tr valign="top" bgcolor="#d0d0d0">
<td colspan="2" rowspan=" 1">
- This table cell spans two columns but only one row
+ This table cell spans two columns, but only one row.
</td>
<td rowspan=" 2">
This table cell spans only one column, but two rows.
@@ -2759,7 +2760,7 @@
\endraw
See also \l {table-command} {\\table}, \l {header-command}
- {\\header} and \l {li-command} {\\li}.
+ {\\header}, and \l {li-command} {\\li}.
\target value-command
\section1 \\value
@@ -2935,10 +2936,10 @@
is only used in \l{table-command} {tables} and \l{list-command}
{lists}.
- It considers everything until the next \\li command, or until the
- next \l {table-command} {\\endtable} or \l {list-command} {\\endlist}
- command, as its argument. See \l {table-command} {\\table} and \l
- {list-command} {\\list} for examples.
+ It considers everything as its argument until the next \\li command, until the
+ next \l {table-command} {\\endtable}, or \l {list-command} {\\endlist}
+ command. See \l {table-command} {\\table} and \l {list-command} {\\list}
+ for examples.
If the command is used within a table, you can also specify
how many rows or columns the item should span.
@@ -2969,13 +2970,13 @@
<tr valign="top" bgcolor="#a2c511">
<th colspan="3" rowspan=" 1">
- This header cell spans three columns but only one row
+ This header cell spans three columns, but only one row.
</th>
</tr>
<tr valign="top" bgcolor="#d0d0d0">
<td colspan="2" rowspan=" 1">
- This table item spans two columns but only one row
+ This table item spans two columns, but only one row.
</td>
<td rowspan=" 2">
This table item spans only one column, but two rows.
@@ -3006,7 +3007,7 @@
\title Special Content
The document contents commands identify parts of the documentation,
- i.e. parts with a special rendering, conceptual meaning or
+ parts with a special rendering, conceptual meaning or
function.
\target abstract-command
@@ -3033,7 +3034,7 @@
\code
/ *!
- While the prospect of a significantly broader market is
+ Although the prospect of a significantly broader market is
good news for Firstlogic, the notion also posed some
challenges. Dave Dobson, director of technology for the La
Crosse, Wisconsin-based company, said:
@@ -3081,6 +3082,12 @@
have not been implemented. The footnote is rendered as a regular
HTML paragraph.
+ \target note-command
+ \section1 \\note
+
+ The \\note command defines a new paragraph preceded by "Note:"
+ in bold.
+
\target tableofcontents-command
\section1 \\tableofcontents
@@ -3094,7 +3101,7 @@
\section1 \\brief
The \\brief command introduces a one-sentence description of a
- class, namespace, header file, property or variable.
+ class, namespace, header file, property, or variable.
The brief text is used to introduce the documentation of the
associated object, and in lists generated using the \l
@@ -3117,13 +3124,13 @@
\code
/ *!
\property QWidget::isActiveWindow
- \brief whether this widget's window is the active window
+ \brief Whether this widget's window is the active window
The active window is the window that contains the widget that
has keyboard focus.
When popup windows are visible, this property is true
- for both the active window \e and for the popup.
+ for both the active window \e and the popup.
\sa activateWindow(), QApplication::activeWindow()
* /
@@ -3134,7 +3141,7 @@
\code
/ *!
\property QWidget::geometry
- \brief the geometry of the widget relative to its parent and
+ \brief The geometry of the widget relative to its parent and
excluding the window frame
When changing the geometry, the widget, if visible,
@@ -3342,7 +3349,7 @@
In the generated HTML, the delimited text is surrounded by a \b
{<div class="LegaleseLeft">} and \b {</div>} tags.
- For example, here is a license agreement enclosed in \\legalese
+ An example of a license agreement enclosed in \\legalese
and \\endlegalese:
\code
@@ -3521,7 +3528,7 @@
The \c classes argument provides a complete alphabetical list of
the classes. Each class name is a link to the class's reference
- documentation. This command is uded to generate the \l
+ documentation. This command is used to generate the \l
{classes.html} {All Classes} page this way:
\code
@@ -3530,7 +3537,7 @@
\title All Classes
\ingroup classlists
- \brief If you know the name of the class you want, find it here.
+ \brief Alphabetical list of classes.
This is a list of all Qt classes. For a list of the classes
provided for compatibility with Qt3, see \l{Qt3 Support
@@ -3561,7 +3568,7 @@
\title Phonon Module
\ingroup modules
- \brief The Phonon module contains namespaces and classes for multimedia functionality.
+ \brief Contains namespaces and classes for multimedia functionality.
\generatelist{classesbymodule Phonon}
@@ -3577,7 +3584,7 @@
\section2 \c compatclasses
The \c compatclasses argument generates a list in alphabetical
- order of the support classes. It is normally used only to
+ order of the support classes. It is normally used only to
generate the \l {compatclasses.html} {Qt3 Support Classes} page
this way:
@@ -3587,7 +3594,7 @@
\title Qt3 Support Classes
\ingroup classlists
- \brief These classes ease the porting of code from Qt 3 to Qt 4.
+ \brief Enable porting of code from Qt 3 to Qt 4.
These are the classes that Qt provides for compatibility with Qt
3. Most of these are provided by the Qt3Support module.
@@ -3616,7 +3623,7 @@
link to where each one is declared.
This is the list of all documented member functions and global
- functions in the Qt API. Each function has a link to the
+ functions in the Qt API. Each function has a link to the
class or header file where it is declared and documented.
\generatelist functionindex
@@ -3813,7 +3820,7 @@
QT3_SUPPORT symbol, turning on compatibility
function support).
- You can also define the symbol manually (e.g.,
+ You can also define the symbol manually (for example,
if you don't want to link against the \c
Qt3Support library), or you can define \c
QT3_SUPPORT_WARNINGS instead, telling the
@@ -3886,8 +3893,8 @@
The \\include command sends all or part of the file specified by
its first argument to the QDoc input stream to be processed as a
- qdoc comment snippet. This command is often assigned the alias,
- \e {input}, in the QDoc configuration file, e.g. \e {alias.include
+ QDoc comment snippet. This command is often assigned the alias,
+ \e {input}, in the QDoc configuration file, for example \e {alias.include
= input}.
The command is useful when some snippet of commands and text is to
@@ -3900,8 +3907,8 @@
The command can have either one or two arguments. The first
argument is always a file name. The contents of the file must be
- QDoc input, i.e. a sequence of QDoc commands and text, but without
- the enclosing qdoc comment \c{/}\c{*!} ... \c{*}\c{/} delimeters.
+ QDoc input, in other words, a sequence of QDoc commands and text, but
+ without the enclosing QDoc comment \c{/}\c{*!} ... \c{*}\c{/} delimiters.
If you want to include the entire named file, don't use the second
argument. If you want to include only part of the file, see the
\l{2-argument-form}{two argument form} below. Here is an example
@@ -3926,11 +3933,11 @@
\target 2-argument-form}
\section2 \\include filename snippet-identifier
- It is kind of a pain to make a separate \c .qdocinc file for every
+ It is a waste of time to make a separate \c .qdocinc file for every
QDoc include snippet you want to use in multiple places in the
documentation, especially given that you probably have to put the
copyright/license notice in every one of these files. So if you
- have lots of these include snippets, you can put them all in a
+ have a large number of snippets to be included, you can put them all in a
single file if you want, and surround each one with:
\code
//! [snippet-id1]
@@ -3965,8 +3972,8 @@
XML files. It is also used when generating HTML output for specifying
the \e maintainer(s) of a C++ class.
- The command has two arguments: The first argument is the name of the
- metadata attribute you wish to set, and the second argument is the
+ The command has two arguments: the first argument is the name of the
+ metadata attribute, and the second argument is the
value for the attribute. Each argument should be enclosed in curly
brackets, as shown in this example:
@@ -4026,14 +4033,14 @@
</prolog>
\endcode
- In the example output, several values have been set using defualt
+ In the example output, several values have been set using default
values obtained from the QDoc configuration file. See \l
{Generating DITA XML Output} for details.
\target omit-command
\section1 \\omit
- The \\omit command and the correspondning \\endomit command
+ The \\omit command and the corresponding \\endomit command
delimit parts of the documentation that you want QDoc to skip. For
example:
@@ -4091,8 +4098,8 @@
commands in your \l {table-command} {\\table} or \l {list-command}
{\\list}.
- The command takes an argument specifying the code's format;
- currently the only supported format is HTML.
+ The command takes an argument specifying the code's format.
+ Currently, the only supported format is HTML.
The \\raw command is useful if you want some special HTML effects
in your documentation.
@@ -4147,7 +4154,7 @@
\tt {\span {id="color-cyan"} {cyan(#00ffff)}}.
\endcode
- ...which is rendered again as:
+ ...which is rendered as:
\tt {\span {id="color-blue"} {Blue(#0000ff)}},
\tt {\span {id="color-darkBlue"} {dark blue(#000080)}} and
@@ -4254,10 +4261,10 @@
\endcode
A topic command can appear anywhere in a comment but must stand
- alone on its own line. Best practice is to let the topic commend
+ alone on its own line. It is good practice is to let the topic command
be the first line of the comment. If the argument spans several
lines, make sure that each line (except the last one) is ended
- with a backslash. In addition QDoc counts parentheses, which means
+ with a backslash. Moreover, QDoc counts parentheses, which means
that if it encounters a '(' it considers everything until the
closing ')' as its argument.
@@ -4304,7 +4311,7 @@
The HTML documentation for the named class is written to a
\c{.html} file named from the class name, in lower case, and with
- the double colon qulifier(s) replaced with '-'. For example, the
+ the double colon qualifier(s) replaced with '-'. For example, the
documentation for the \c QMap::Iterator class is written to \c
qmap-iterator.html.
@@ -4312,7 +4319,7 @@
The file contains the class description from the \\class comment,
plus the documentation generated from QDoc comments for all the
- class members, i.e. a list of the class's types, properties,
+ class members: a list of the class's types, properties,
functions, signals, and slots.
In addition to the detailed description of the class, the \\class
@@ -4323,7 +4330,7 @@
\code
/ *!
\class PreviewWindow
- \brief The PreviewWindow class is a custom widget
+ \brief The PreviewWindow class is a custom widget.
displaying the names of its currently set
window flags in a read-only text editor.
@@ -4626,7 +4633,7 @@
\endquotation
To achieve the same result without using the \\externalpage
- command, you would have to hard code the address into your
+ command, you would have to hard-code the address into your
documentation:
\code
@@ -4649,7 +4656,7 @@
and list of formal arguments with types. If the named function
doesn't exist, QDoc emits a warning.
- \note The \\fn command is QDoc's default command, i.e. when no
+ \note The \\fn command is QDoc's default command: when no
topic command can be found in a QDoc comment, QDoc tries to tie
the documentation to the following code as if it is the
documentation for a function. Hence, it is normally not necessary
@@ -4695,7 +4702,7 @@
{\\generatelist} command (see example below).
The \\group command is typically followed by a \l {title-command}
- {\\title} command and a short introduction to the group. The
+ {\\title} command and a short introduction to the group. The
HTML page for the group is written to a \c {.html} file put in
<lower-case>\e{group}.html.
@@ -4710,7 +4717,7 @@
\title Input/Output and Networking
These classes are used to handle input and output to
- and from external devices, processes, files etc. as
+ and from external devices, processes, files etc., as
well as manipulating files and directories.
* /
\endcode
@@ -4724,7 +4731,7 @@
<h1>Input/Output and Networking</h1>
<p>These classes are used to handle input and output
- to and from external devices, processes, files etc. as
+ to and from external devices, processes, files etc., as
well as manipulating files and directories.</p>
<p>
@@ -4781,13 +4788,13 @@
\section1 \\headerfile
The \\headerfile command is for documenting the global functions,
- types and macros that are declared in a header file but not in a
- namespace. The argument is the name of the header file. The HTML
+ types and macros that are declared in a header file, but not in a
+ namespace. The argument is the name of the header file. The HTML
page is written to a \c {.html} file constructed from the header
file argument.
The documentation for a function, type, or macro that is declared
- in the header file being documented is included in the header file
+ in the header file being documented, is included in the header file
page using the \l {relates-command} {\\relates} command.
If the argument doesn't exist as a header file, the \\headerfile
@@ -4919,7 +4926,7 @@
The Q_OBJECT macro must appear in the private section
of a class definition that declares its own signals and
- slots or that uses other services provided by Qt's
+ slots, or that uses other services provided by Qt's
meta-object system.
...
@@ -4949,7 +4956,7 @@
\section1 \\module
The \\module creates a page that lists the classes belonging to
- the module specified by the command's argument. A class included
+ the module specified by the command's argument. A class included
in the module by including the \l {inmodule-command} {\\inmodule}
command in the \\class comment.
@@ -4965,8 +4972,7 @@
\title Qt Network Module
- \brief The Qt Network module offers classes that allow
- you to write TCP/IP clients and servers.
+ \brief Contains classes for writing TCP/IP clients and servers.
The network module provides classes to make network
programming easier and portable. It offers both
@@ -5054,8 +5060,7 @@
/ *!
\namespace Qt
- \brief The Qt namespace contains miscellaneous
- identifiers used throughout the Qt library.
+ \brief Contains miscellaneous identifiers used throughout the Qt library.
* /
\endcode
@@ -5089,7 +5094,7 @@
\raw HTML
<h2>Detailed Description</h2>
- <p>The Qt namespace contains miscellaneous identifiers
+ <p>Contains miscellaneous identifiers
used throughout the Qt library.</p>
\endraw
@@ -5100,7 +5105,7 @@
\section1 \\page
The \\page command is for creating a stand-alone documentation
- page. The argument can consist of two parts separated by a
+ page. The argument can consist of two parts separated by a
space. The first part is the name of the file where QDoc should
store the page. The second part, if present, is a word that
specifies the page type. Currently, the second part can be one of
@@ -5110,7 +5115,7 @@
\li faq - A frequently asked question.
- \li howto - A user guide for how to use some component of the
+ \li howto - A user guide on how to use some components of the
software.
\li example - A page that describes a working example.
@@ -5120,9 +5125,9 @@
\li tutorial - For text pages that are part of a tutorial.
- \li api - This is the type of page used for C++ class references
- and QML type references, etc. You should never use this one for
- the pages you write, because this one is reserved for qdoc.
+ \li api - This is the type of page used for C++ class references and
+ QML type references. You should never use this one for the pages
+ you write, because this one is reserved for qdoc.
\endlist
@@ -5183,7 +5188,7 @@
\code
/ *!
\property QPushButton::flat
- \brief whether the border is disabled
+ \brief Whether the border is disabled.
This property's default is false.
* /
@@ -5212,7 +5217,7 @@
\code
/ *!
\property QWidget::width
- \brief the width of the widget excluding any window frame
+ \brief The width of the widget excluding any window frame.
See the \l {Window Geometry} documentation for an
overview of window geometry.
@@ -5344,7 +5349,7 @@
\qmlbasictype int
\ingroup qmlbasictypes
- \brief An integer is a whole number, e.g. 0, 10, or -20.
+ \brief An integer is a whole number, for example 0, 10, or -20.
An integer is a whole number, e.g. 0, 10, or -20. The possible
\c int values range from around -2000000000 to around
@@ -5379,11 +5384,10 @@
\qmlclass Transform QGraphicsTransform
\ingroup qml-transform-elements
\since 4.7
- \brief The Transform elements provide a way of building
- advanced transformations on Items.
+ \brief Provides a way of building advanced transformations on Items.
The Transform element is a base type which cannot be
- instantiated directly. The following concrete Transform types
+ instantiated directly. The following concrete Transform types
are available:
\list
@@ -5407,7 +5411,7 @@
page. The \\qmlclass comment should include the \l
{since-command} {\\since} command, because all QML types are
new. It should also include the \l{brief-command} {\\brief}
- command. And if a type is a member of a group of QML
+ command. If a type is a member of a group of QML
types, it should also include one or more \l{ingroup-command}
{\\ingroup} commands.
@@ -5426,9 +5430,8 @@
If either start or end is out of range, the selection is not changed.
- After calling this, selectionStart will become the lesser and
- selectionEnd will become the greater (regardless of the order
- passed to this method).
+ After having called this, selectionStart will become the lesser, and
+ selectionEnd the greater (regardless of the order passed to this method).
\sa selectionStart, selectionEnd
* /
@@ -5458,7 +5461,7 @@
advanced transformations on Items.
The Transform element is a base type which cannot be
- instantiated directly. The concrete Transform types are:
+ instantiated directly. The concrete Transform types are:
\list
\li \l Rotation
@@ -5483,9 +5486,9 @@
the C++ class QGraphicsTransform. A \\qmltype comment should
always include a \l {since-command} {\\since} command, because all
QML types are new. It should also include a \l{brief-command}
- {\\brief} description. And if a QML type is a member of a group of
- QML types, the \\qmltype comment should include one or more
- \l{ingroup-command} {\\ingroup} commands.
+ {\\brief} description. If a QML type is a member of a QML type group,
+ the \\qmltype comment should include one or more \l{ingroup-command}
+ {\\ingroup} commands.
\target qmlmethod-command
\section1 \\qmlmethod
@@ -5502,9 +5505,8 @@
If either start or end is out of range, the selection is not changed.
- After calling this, selectionStart will become the lesser and
- selectionEnd will become the greater (regardless of the order
- passed to this method).
+ After having called this, selectionStart will become the lesser and
+ selectionEnd the greater (regardless of the order passed to this method).
\sa selectionStart, selectionEnd
* /
@@ -5624,7 +5626,7 @@
\instantiates QGraphicsTransform
\ingroup qml-transform-elements
\since 4.7
- \brief The Transform elements provide a way to build
+ \brief Provides elements provide a way to build
advanced transformations on Items.
The Transform element is a base type which cannot be
@@ -5645,7 +5647,7 @@
argument is the name of the typedef. The documentation for
the typedef will be included in the reference documentation
for the class, namespace, or header file in which the typedef
- is declared. To relat the \\typedef to a class, namespace, or
+ is declared. To relate the \\typedef to a class, namespace, or
header file, the \\typedef comment must contain a
\l {relates-command} {\\relates} command.
@@ -5736,14 +5738,14 @@
\\brief command.
The documentation will be located in the in the associated class,
- header file or namespace documentation.
+ header file, or namespace documentation.
In case of a member variable:
\code
/ *!
\variable QStyleOption::palette
- \brief the palette that should be used when painting
+ \brief The palette that should be used when painting
the control
* /
\endcode
@@ -5764,7 +5766,7 @@
when painting the control.
\endquotation
- You can also document constants with the \\variable command. For
+ You can also document constants with the \\variable command. For
example, suppose you have the \c Type and \c UserType constants in
the QTreeWidgetItem class:
@@ -5772,7 +5774,7 @@
enum { Type = 0, UserType = 1000 };
\endcode
- For these, the \\vaqriable command can be used this way:
+ For these, the \\variable command can be used this way:
\code
/ *!
@@ -5832,9 +5834,14 @@
\title Context Commands
The context commands provide information about the element being
- documented that QDoc can't deduce on its own. e.g. Is a class
- thread-safe? Is a function reentrant? Which module is the class a
- member of? Context commands can appear anywhere in a QDoc comment,
+ documented that QDoc can't deduce on its own. For example:
+ \list
+ \li Is this class thread-safe?
+ \li Is this function reentrant?
+ \li Of which module is this class a member ?
+ \endlist
+
+ Context commands can appear anywhere in a QDoc comment,
but they are normally placed near the top of the comment, just
below the \l {Topic Commands} {topic} command.
@@ -5948,7 +5955,7 @@
* /
\endcode
- QDoc renders the "Getting Started" page in \c{creatingdialogs.html}:
+ QDoc renders the "Getting Started" page in \c{creatingdialogs.html}:
\quotation
\raw HTML
@@ -5992,7 +5999,7 @@
titles and topics, while the start page is the page considered by
the author to be the starting point of a multipage document.
- The links are included in the generated HTML source code but have
+ The links are included in the generated HTML source code, but have
no visual effect on the documentation:
\code
@@ -6011,8 +6018,8 @@
The \\previouspage command links the current page to the previous
page in a sequence.a The command has two arguments, each enclosed
- by curly braces: The first is the link target, i.e. the title of
- the previous page, the second is the link text. If the page's
+ by curly braces: the first is the link target (the title of
+ the previous page), the second is the link text. If the page's
title is equivalent to the link text, the second argument can be
omitted.
@@ -6164,7 +6171,7 @@
\code
/ *!
\qmlproperty list<Change> State::changes
- This property holds the changes to apply for this state
+ This property holds the changes to apply for this state.
\default
By default these changes are applied against the default state. If the state
@@ -6188,7 +6195,7 @@
When generating the reference documentation for a class, QDoc will
create and link to a separate page documenting its obsolete
- functions. Usually an equivalent function is provided as an
+ functions. Usually an equivalent function is provided as an
alternative.
\code
@@ -6382,8 +6389,8 @@
\c Reentrant means that all the functions in the referenced class
can be called simultaneously by multiple threads, provided that
- each invocation of the functions reference unique data. While \c
- threadsafe means that all the functions in the referenced class
+ each invocation of the functions reference unique data. \c
+ thread-safe means that all the functions in the referenced class
can be called simultaneously by multiple threads even when each
invocation references shared data.
@@ -6485,7 +6492,7 @@
declared reentrant, and lists the exceptions (the declared
nonreentrant functions). A link to the general documentation on \l
{threads.html#reentrant} {reentrancy and thread-safety} is
- included. In addition a warning, "\b Warning: This function is
+ included. In addition a warning, "\b Warning: This function is
not reentrant.", is generated in the nonreentrant functions'
documentation.
@@ -6501,14 +6508,14 @@
\section2 \\threadsafe
The \\threadsafe command includes a line in the documentation to
- indicate that the associated class or function is \e threadsafe
+ indicate that the associated class or function is \e threadsafe,
and can be called simultaneously by multiple threads, even when
separate invocations reference shared data.
The command must stand on its own line.
The documentation generated from this command will be similar to
- the what is generated for the \l {reentrant-command} {\\reentrant}
+ the documentation generated for the \l {reentrant-command} {\\reentrant}
command. See the example above in the \l {reentrant-example}
{introduction}.
@@ -6555,12 +6562,15 @@
\title Relating Things
The relating commands are for specifying how one documented
- element relates to another documented element. e.g., This function
- is an overload of another function, or this function is a
- reimplementation of another function, or this typedef is \e
- related to some class or header file. There is also a command
- for documenting that a QML type inherits some other QML
- type.
+ element relates to another documented element. Some examples:
+ \list
+ \li This function is an overload of another function.
+ \li This function is a reimplementation of another function.
+ \li This typedef is \e related to some class or header file.
+ \endlist
+
+ There is also a command for documenting that a QML type inherits
+ some other QML type.
\section1 Commands
@@ -6614,7 +6624,7 @@
For a function name that is overloaded (except constructors), QDoc
expects one primary version of the function, and all the others
- marked with the \b {\\overload command}. The primary version
+ marked with the \b {\\overload command}. The primary version
should be fully documented. Each overload can have whatever extra
documentation you want to add for just that overloaded version.
@@ -6820,7 +6830,7 @@
the command's argument.
For the basic classes in Qt, a class's module is determined by its
- location, i.e. its directory. However, for extensions, like
+ location, namely its directory. However, for extensions like
ActiveQt and Qt Designer, a class must be related to a module
explicitly.
@@ -6854,7 +6864,7 @@
\title Naming Things
In general, a title command considers everything that follows it
- until the first line break as its argument. If the title is so
+ until the first line break as its argument. If the title is so
long it must span multiple lines, end each line (except the last
one) with a backslash.
@@ -6874,7 +6884,7 @@
Signals and slots are used for communication between
objects. The signals and slots mechanism is a central
- feature of Qt and probably the part that differs most
+ feature of Qt, and probably the part that differs most
from the features provided by other frameworks.
...
@@ -7003,7 +7013,7 @@
The \\mapref command is for creating a mapref in the ditamap. A
mapref refers to another ditamap, which you want to include in
- your ditamap. Like the \\topicref command, the \\mapref command
+ your ditamap. Like the \\topicref command, the \\mapref command
has two arguments, but for the \\mapref command, both arguments
are required. The arguments are essentially the same as described
for \\topicref, but for \\mapref, the second command must be the
@@ -7021,7 +7031,7 @@
\code
\ditamap creator.ditamap
- \title The DITA Map For Creator
+ \title The DITA Map for Creator
\topicref {QML Module QtQuick 1}
\topicref {QML Mouse Events} \endtopicref
@@ -7051,7 +7061,7 @@
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
<topicmeta>
- <shortdesc>The DITA Map For Creator</shortdesc>
+ <shortdesc>The DITA Map for Creator</shortdesc>
</topicmeta>
<topicref navtitle="QML Module QtQuick 1" href="qtquick-1.xml">
<topicref navtitle="QML Mouse Events" href="qtquick2-mouseevents.xml"/>
@@ -7107,12 +7117,12 @@
while '+=' adds a new value to the current one.
Some configuration variables accept a list of strings as their
- value, e.g.
+ value, for example:
\l {22-qdoc-configuration-generalvariables.html#sourcedirs-variable}
{\c{sourcedirs}}, while others accept only a single string. Double
quotes around a value string are optional, but including them allows
- you to use special characters like '=' and ' \" ' within the valuem
- string, e.g.:
+ you to use special characters like '=' and ' \" ' within the value
+ string, for example:
\code
HTML.postheader = "<a href=\"index.html\">Home</a>"
@@ -7215,7 +7225,7 @@
QDoc can generate \l {http://dita.xml.org} {DITA XML output}.
- In your confifiguration file, set your \c {outputformats} variable
+ In your configuration file, set your \c {outputformats} variable
to \c {DITAXML}, and send the output to an appropriate directory:
\code
@@ -7290,7 +7300,7 @@
alias.e = i
\endcode
- This renames the built-in command \\e (italics) to be \\i. The \c
+ This renames the built-in command \\e (italics) to be \\i. The \c
alias variable is often used for compatibility reasons.
See also \l {macro-variable} {macro}.
@@ -7353,12 +7363,12 @@
line using the -D option. For example:
\code
- currentdirectory$ qdoc -Dconsoleedition qt.qdocconf
+ currentdirectory$ qdoc -Dconsoleedition qtgui.qdocconf
\endcode
In this case the -D option ensures that the \c consoleedition
preprocessor symbol is defined when QDoc processes the source
- files defined in the qt.qdocconf file.
+ files defined in the qtgui.qdocconf file.
See also \l {falsehoods-variable} {falsehoods} and \l {if-command} {\\if}.
@@ -7402,7 +7412,7 @@
The \l {examples-variable} {examples} {examples} and \l
{exampledirs-variable} {exampledirs} variables are used by the \l
{quotefromfile-command} {\\quotefromfile}, \l {quotefile-command}
- {\\quotefile} and \l {example-command} {\\example} commands. If
+ {\\quotefile} and \l {example-command} {\\example} commands. If
both the \l {examples-variable} {examples} and \l
{exampledirs-variable} {exampledirs} variables are defined, QDoc
will search in both, first in \l {examples-variable} {examples}
@@ -7427,9 +7437,9 @@
\quotefromfile widgets/calculator/calculator.cpp
\endcode
- QDoc will then see if there exists a file called \c calculator.cpp
+ QDoc will see if there is a file called \c calculator.cpp
listed as a value in the \l {examples} {\c examples} variable. If
- it doesn't, it will search in the \c exampledirs variable, and
+ there isn't, it will search in the \c exampledirs variable, and
first see if there exists a file called
\code
@@ -7485,7 +7495,7 @@
The default extensions are *.cpp, *.h, *.js, *.xq, *.svg, *.xml
and *.ui.
- The extensions are given as standard wildcard expressions. You
+ The extensions are given as standard wildcard expressions. You
can add a file extension to the filter using '+='. For example:
\code
@@ -7502,7 +7512,7 @@
\l {sourcedirs-variable} {sourcedirs} or \l {headerdirs-variable} {headerdirs}
variables.
- For example,
+ For example:
\code
sourcedirs = src/corelib
@@ -7548,9 +7558,10 @@
The general syntax is \tt {extraimages.\e{format} = \e image}. The
file extension is optional.
- For example, if additional images are used within the HTML.postheader
- value, then these images must also be specified using the \c
- extraimages variable:
+ For example, in \l qtgui.qdocconf we use a couple of images within
+ the HTML.postheader variable which value is pure HTML. For that
+ reason, these images are specified using the \c extraimages
+ variable:
\code
extraimages.HTML = qt-logo
@@ -7646,11 +7657,11 @@
\c headerdirs.
In the specified directories, QDoc will only read the files with
- the fileextensions specified in the \l {headers.fileextensions}
+ the \c fileextensions specified in the \l {headers.fileextensions}
{\c headers.fileextensions} variable. The default extensions are
- *.ch, *.h, *.h++, *.hh, *.hpp and *.hxx". The files specified by
- \l {headers} {\c headers} will be read independent of their
- fileextensions.
+ *.ch, *.h, *.h++, *.hh, *.hpp, and *.hxx". The files specified by
+ \l {headers} {\c headers} will be read without taking into account
+ their fileextensions.
See also \l headers and \l headers.fileextensions.
@@ -7682,13 +7693,13 @@
When processing the header files specified in the \l {headerdirs}
{\c headerdirs} variable, QDoc will only read the files with the
fileextensions specified in the \c headers.fileextensions
- variable. In this way QDoc avoid spending time reading irrelevant
+ variable. In this way QDoc avoids spending time reading irrelevant
files.
- The default extensions are *.ch, *.h, *.h++, *.hh, *.hpp and
+ The default extensions are *.ch, *.h, *.h++, *.hh, *.hpp, and
*.hxx.
- The extensions are given as standard wildcard expressions. You
+ The extensions are given as standard wildcard expressions. You
can add a file extension to the filter using '+='. For example:
\code
@@ -7707,9 +7718,9 @@
The \l {images} {\c images} and \c imagedirs variables are used by
the \l {image-command} {\\image} and \l {inlineimage-command}
- {\\inlineimage} commands. If both the \l {images} {\c images} and
- \c imagedirs variables are defined, QDoc will search in both,
- first in \l {images} {\c images} then in \c imagedirs.
+ {\\inlineimage} commands. If both the \l {images} {\c images} and
+ \c imagedirs variables are defined, QDoc will search in both. First
+ in \l {images} {\c images}, then in \c imagedirs.
QDoc will search through the directories in the specified order,
and accept the first matching file it finds. It will only search
@@ -7728,29 +7739,29 @@
\image calculator-example.png
\endcode
- QDoc will then see if there exists a file called
+ QDoc will then see if there is a file called
calculator-example.png listed as a value in the \c images
- variable. If it doesn't, it will search in the \c imagedirs
- variable, and first see if there exists a file called
+ variable. If there isn't, it will search in the \c imagedirs
+ variable for:
\code
$QTDIR/doc/src/images/calculator-example.png
\endcode
- If it doesn't, QDoc will look for a file called
+ If the file doesn't exist, QDoc will look for a file called
\code
$QTDIR/examples/calculator-example.png
\endcode
You can filter the images in an image directory using the \l
- {images.fileextensions} {\c images.fileextensions} variable. The
+ {images.fileextensions} {\c images.fileextensions} variable. The
general idea behind the \l {images.fileextensions} {\c images.fileextensions}
variable is to enable different image format for different output format.
\warning The \l {images.fileextensions} {\c images.fileextensions}
- variable's functionality is preliminay since QDoc at this point
- only support HTML.
+ variable's functionality is preliminary since QDoc at this point
+ only supports HTML.
See also \l images and \l images.fileextensions.
@@ -7779,7 +7790,7 @@
image directory.
The variable's values (the extensions) are given as standard
- wildcard expressions. The general syntax is: \tt
+ wildcard expressions. The general syntax is: \tt
{images.fileextensions.\e{format} = *.\e{extension}}.
The idea is to enable different image format for different output
@@ -7792,13 +7803,13 @@
Then, when processing the \l {image-command} {\\image} and \l
{inlineimage-command} {\\inlineimage} commands, QDoc will only
- search for files with extensions specified in the output format's
- associated image extension variable.
+ search for files with extensions specified in the variable
+ containing the list of output formats.
- \warning This is preliminary functionality since QDoc at this
- point only support HTML.
+ \warning This is only a preliminary functionality since QDoc at this
+ point only supports HTML.
- The default extensions for HTML are *.png, *.jpg, *.jpeg and
+ The default extensions for HTML are *.png, *.jpg, *.jpeg, and
*.gif.
You can add a file extension to the filter using '+='. For
@@ -7818,13 +7829,14 @@
Currently, C++ is the only language that QDoc understands. It is
also the default language, and doesn't really need to be
- specified.
+ specified. However, a possible example of a language variable
+ statement:
\code
language = Cpp
\endcode
- identifies the language of the Qt source code as C++.
+ This identifies C++ as the language of the Qt source code.
\target macro-variable
\section1 macro
@@ -7888,8 +7900,6 @@
The \c outputdir variable specifies the directory where QDoc will
put the generated documentation.
- For example:
-
\code
outputdir = $QTDIR/doc/html
\endcode
@@ -7972,13 +7982,8 @@
the \c .cpp or \c .qdoc files used in the documentation.
\code
- sourcedirs = $QTDIR/src \
- $QTDIR/doc/src \
- $QTDIR/extensions/activeqt \
- $QTDIR/extensions/motif \
- $QTDIR/tools/designer/src/lib/extension \
- $QTDIR/tools/designer/src/lib/sdk \
- $QTDIR/tools/designer/src/lib/uilib
+ sourcedirs += .. \
+ ../../../examples/gui/doc/src
\endcode
When executed, the first thing QDoc will do is to read through the
@@ -7989,7 +7994,7 @@
Then it will read through the sources specified in the \l
{sources} {\c sources}, and the ones located in the directories
- specified in the \l {sourcedirs} {\c sourcedirs} varible
+ specified in the \l {sourcedirs} {\c sourcedirs} variable
(including all subdirectories), merging the documentation with the
structure it retrieved from the header files.
@@ -7998,7 +8003,7 @@
\c sourcedirs.
In the specified directories, QDoc will only read the files with
- the fileextensions specified in the \l {sources.fileextensions}
+ the \c fileextensions specified in the \l {sources.fileextensions}
{\c sources.fileextensions} variable. The default extensions are
*.c++, *.cc, *.cpp and *.cxx. The files specified by \l {sources}
{\c sources} will be read independent of their fileextensions.
@@ -8023,7 +8028,7 @@
Although qdoc will use the encoding to read source and
documentation files, limitations of C++ compilers may prevent you
- from using non-ASCII characters in source code comments. In cases
+ from using non-ASCII characters in source code comments. In cases
like these, it is possible to write API documentation completely
in documentation files.
@@ -8063,7 +8068,7 @@
The default extensions are *.c++, *.cc, *.cpp and *.cxx.
- The extensions are given as standard wildcard expressions. You
+ The extensions are given as standard wildcard expressions. You
can add a file extension to the filter using '+='. For example:
\code
@@ -8080,7 +8085,7 @@
\section1 spurious
The \c spurious variable excludes specified QDoc warnings from the
- output. The warnings are specified using standard wildcard
+ output. The warnings are specified using standard wildcard
expressions.
\code
@@ -8119,7 +8124,7 @@
tabsize = 4
\endcode
- will give the tab character the size of 4 spaces. The default
+ will give the tab character the size of 4 spaces. The default
value of the variable is 8, and doesn't need to be specified.
\target tagfile-variable
@@ -8154,8 +8159,6 @@
The \c versionsym variable specifies a C++ preprocessor symbol
that defines the version number of the documented software.
- For example:
-
\code
versionsym = QT_VERSION_STR
\endcode
@@ -8172,7 +8175,7 @@
the documentation.
\warning The \\version command's functionality is not fully
- implemented; currently it only works within raw HTML code.
+ implemented. Currently, it only works within raw HTML code.
See also \l {version} {\\version}.
*/
@@ -8259,7 +8262,6 @@
\target Cpp.ignoredirectives-variable
\section1 Cpp.ignoredirectives
-
The \c Cpp.ignoredirectives variable makes QDoc ignore the
specified non-standard constructs, within C++ source code.
@@ -8267,8 +8269,6 @@
Cpp.ignoredirectives} variables, non-standard constructs
(typically macros) can result in erroneous documentation.
- For example:
-
\code
Cpp.ignoredirectives = Q_DECLARE_INTERFACE \
Q_DECLARE_OPERATORS_FOR_FLAGS \
@@ -8321,6 +8321,8 @@
Cpp.ignoredirectives} variables, non-standard constructs
(typically macros) can result in erroneous documentation.
+ In \l qtgui.qdocconf:
+
\code
Cpp.ignoretokens = QAXFACTORY_EXPORT \
QM_EXPORT_CANVAS \
@@ -8390,6 +8392,9 @@
"</tr></table></div></address>"
\endcode
+ The complete variable entry provides the standard footer of the
+ \l {http://doc.qt.digia.com/4.0/index.html} {Qt Reference Documentation}.
+
\target HTML.postheader-variable
\section1 HTML.postheader
@@ -8413,6 +8418,8 @@
"</table>"
\endcode
+ The complete variable entry in \l qtgui.qdocconf provides the
+ standard header of the \l {http://doc.qt.digia.com/}
{Qt Reference Documentation}.
\target HTML.style-variable
@@ -8470,8 +8477,8 @@
\title Supporting Derived Projects
Some configuration variables allow you to use QDoc to support
- Qt-based projects; i.e allow your project to contain links to the
- online Qt documentation. This means that QDoc will be able to
+ Qt-based projects. They allow your project to contain links to the
+ online Qt documentation, which means that QDoc will be able to
create links to the class reference documentation, without any
explicit linking command.
@@ -8560,44 +8567,11 @@
\endcode
The \l project variable name is used to form a file name for the
- index file; in this case the \c qt.index file is created. The \l
- url is stored in the index file. Later, when we use the index on
- its own, QDoc will use this as the base URL when constructing
- links to classes, functions, and other things listed in the index.
-
- In a mini-project, you can use an index file by defining an \l
- indexes configuration variable in your \c .qdocconf file.
-
- \code
- project = QtCreator
- description = Qt Creator Manual
- url = http://qt-project.org/doc/qtcreator-2.6/
-
- indexes = $QTDIR/doc/html/qt.index
-
- outputdir = html
-
- headerdirs = src
- sourcedirs = src \
- examples
- sources.fileextensions = "*.cpp *.qdoc *.doc"
-
- exampledirs = examples
- \endcode
-
- The code above requires that you run QDoc from the directory that
- contains this file.
-
- \b {To resolve the actual links to Qt classes, the
- mini-project's \c .qdocconf file needs to assign a value to the \l
- indexes variable; \c $QTDIR/doc/html/qt.index makes sure that you
- always use the updated index file for the Qt documentation.}
+ index file; in this case the \c qt.index file is created. The \l
+ url is stored in the index file. Afterwards, QDoc will use this
+ as the base URL when constructing links to classes, functions,
+ and other things listed in the index.
- The only disadvantages with this approach are the extra file that
- QDoc has to generate and the time it takes to do so. Reading the
- index back again later isn't instantaneous either, but it's
- quicker than processing all the Qt classes each time you need to
- write a new document.
*/
/*!
@@ -8751,6 +8725,7 @@
\li \l {15-qdoc-commands-navigation.html#nextpage-command} {\\nextpage}
\li \l {06-qdoc-commands-includecodeinline.html#newcode-command} {\\newcode}
\li \l {17-qdoc-commands-thread.html#nonreentrant-command} {\\nonreentrant}
+ \li \l {11-qdoc-commands-specialcontent.html#note-command} {\\note}
\li \l {10-qdoc-commands-tablesandlists.html#li-command} {\\o} \span {class="newStuff"} {(deprecated, use \\li)}
\li \l {16-qdoc-commands-status.html#obsolete-command} {\\obsolete}
diff --git a/src/tools/rcc/main.cpp b/src/tools/rcc/main.cpp
index c0ed7401bc..6b311a8e55 100644
--- a/src/tools/rcc/main.cpp
+++ b/src/tools/rcc/main.cpp
@@ -69,6 +69,7 @@ void showHelp(const QString &argv0, const QString &error)
" -namespace turn off namespace macros\n"
" -project Output a resource file containing all\n"
" files from the current directory\n"
+ " -list lists .qrc file entries\n"
" -version display version\n"
" -help display this information\n",
qPrintable(argv0));
diff --git a/src/widgets/doc/src/model-view-programming.qdoc b/src/widgets/doc/src/model-view-programming.qdoc
index 6bcd0943a1..377ecf204e 100644
--- a/src/widgets/doc/src/model-view-programming.qdoc
+++ b/src/widgets/doc/src/model-view-programming.qdoc
@@ -189,7 +189,7 @@
to the QTableView::sortByColumn() slot or the
QTreeView::sortByColumn() slot, respectively.
- The alternative approach, if your model do not have the required
+ The alternative approach, if your model does not have the required
interface or if you want to use a list view to present your data,
is to use a proxy model to transform the structure of your model
before presenting the data in the view. This is covered in detail
diff --git a/src/widgets/doc/src/modelview.qdoc b/src/widgets/doc/src/modelview.qdoc
index 97d1c72e85..b2f9da9563 100644
--- a/src/widgets/doc/src/modelview.qdoc
+++ b/src/widgets/doc/src/modelview.qdoc
@@ -73,7 +73,7 @@
This tutorial includes example code for you to edit and integrate into your
project. The tutorial's source code is located in Qt's
- \c examples/tutorials/modelview directory.
+ \e examples/widgets/tutorials/modelview directory.
For more detailed information you may also want to look at the
\l{model-view-programming.html}{reference documentation}
@@ -190,14 +190,14 @@
Below are 7 very simple and independent applications that show different
sides of model/view programming. The source code can be found inside the
- \c{examples/tutorials/modelview} directory.
+ \c{examples/widgets/tutorials/modelview} directory.
\section2 2.1 A Read Only Table
We start with an application that uses a QTableView to show data. We will
add editing capabilities later.
- (file source: examples/tutorials/modelview/1_readonly/main.cpp)
+ (file source: examples/widgets/tutorials/modelview/1_readonly/main.cpp)
\snippet tutorials/modelview/1_readonly/main.cpp Quoting ModelView Tutorial
We have the usual \l {modelview-part2-main-cpp.html}{main()} function:
@@ -218,12 +218,12 @@
We have a table data set, so let's start with QAbstractTableModel since it
is easier to use than the more general QAbstractItemModel.
- (file source: examples/tutorials/modelview/1_readonly/mymodel.h)
+ (file source: examples/widgets/tutorials/modelview/1_readonly/mymodel.h)
\snippet tutorials/modelview/1_readonly/mymodel.h Quoting ModelView Tutorial
QAbstractTableModel requires the implementation of three abstract methods.
- (file source: examples/tutorials/modelview/1_readonly/mymodel.cpp)
+ (file source: examples/widgets/tutorials/modelview/1_readonly/mymodel.cpp)
\snippet tutorials/modelview/1_readonly/mymodel.cpp Quoting ModelView Tutorial
The number of rows and columns is provided by
@@ -259,7 +259,7 @@
result shown above. The difference is that this time we use parameter int
role to return different pieces of information depending on its value.
- (file source: examples/tutorials/modelview/2_formatting/mymodel.cpp)
+ (file source: examples/widgets/tutorials/modelview/2_formatting/mymodel.cpp)
\snippet tutorials/modelview/2_formatting/mymodel.cpp Quoting ModelView Tutorial
Each formatting property will be requested from the model with a separate
@@ -320,7 +320,7 @@
We still have a read only table, but this time the content changes every
second because we are showing the current time.
- (file source: examples/tutorials/modelview/3_changingmodel/mymodel.cpp)
+ (file source: examples/widgets/tutorials/modelview/3_changingmodel/mymodel.cpp)
\snippet tutorials/modelview/3_changingmodel/mymodel.cpp quoting mymodel_QVariant
Something is missing to make the clock tick. We need to tell the view every
@@ -328,12 +328,12 @@
this with a timer. In the constructor, we set its interval to 1 second and
connect its timeout signal.
- (file source: examples/tutorials/modelview/3_changingmodel/mymodel.cpp)
+ (file source: examples/widgets/tutorials/modelview/3_changingmodel/mymodel.cpp)
\snippet tutorials/modelview/3_changingmodel/mymodel.cpp quoting mymodel_a
Here is the corresponding slot:
- (file source: examples/tutorials/modelview/3_changingmodel/mymodel.cpp)
+ (file source: examples/widgets/tutorials/modelview/3_changingmodel/mymodel.cpp)
\snippet tutorials/modelview/3_changingmodel/mymodel.cpp quoting mymodel_b
We ask the view to read the data in the top left cell again by emitting the
@@ -349,7 +349,7 @@
The header content, however, is set via the model, so we reimplement the
\l{QAbstractItemModel::headerData()}{headerData()} method:
- (file source: examples/tutorials/modelview/4_headers/mymodel.cpp)
+ (file source: examples/widgets/tutorials/modelview/4_headers/mymodel.cpp)
\snippet tutorials/modelview/4_headers/mymodel.cpp quoting mymodel_c
Note that method \l{QAbstractItemModel::headerData()}{headerData()} also has
@@ -368,7 +368,7 @@
enabled. This is done by reimplementing the following virtual methods:
\l{QAbstractItemModel::}{setData()} and \l{QAbstractItemModel::}{flags()}.
- (file source: examples/tutorials/modelview/5_edit/mymodel.h)
+ (file source: examples/widgets/tutorials/modelview/5_edit/mymodel.h)
\snippet tutorials/modelview/5_edit/mymodel.h Quoting ModelView Tutorial
We use \c the two-dimensional array QString \c m_gridData to store our data.
@@ -377,7 +377,7 @@
interface. We have also introduced the \c editCompleted() signal, which
makes it possible to transfer the modified text to the window title.
- (file source: examples/tutorials/modelview/5_edit/mymodel.cpp)
+ (file source: examples/widgets/tutorials/modelview/5_edit/mymodel.cpp)
\snippet tutorials/modelview/5_edit/mymodel.cpp quoting mymodel_e
\l{QAbstractItemModel::setData()}{setData()} will be called each time the
@@ -388,7 +388,7 @@
checkbox to be selected, calls would also be made with the role set to
\l Qt::CheckStateRole.
- (file source: examples/tutorials/modelview/5_edit/mymodel.cpp)
+ (file source: examples/widgets/tutorials/modelview/5_edit/mymodel.cpp)
\snippet tutorials/modelview/5_edit/mymodel.cpp quoting mymodel_f
Various properties of a cell can be adjusted with
@@ -432,7 +432,7 @@
\image tree_2_with_algorithm.png
- (file source: examples/tutorials/modelview/6_treeview/mainwindow.cpp)
+ (file source: examples/widgets/tutorials/modelview/6_treeview/mainwindow.cpp)
\snippet tutorials/modelview/6_treeview/mainwindow.cpp Quoting ModelView Tutorial
We simply instantiate a QStandardItemModel and add a couple of
@@ -450,7 +450,7 @@
So let's create a couple of items:
- (file source: examples/tutorials/modelview/7_selections/mainwindow.cpp)
+ (file source: examples/widgets/tutorials/modelview/7_selections/mainwindow.cpp)
\snippet tutorials/modelview/7_selections/mainwindow.cpp quoting modelview_a
Views manage selections within a separate selection model, which can be
@@ -458,7 +458,7 @@
retrieve the selection Model in order to connect a slot to its
\l{QAbstractItemView::}{selectionChanged()} signal.
- (file source: examples/tutorials/modelview/7_selections/mainwindow.cpp)
+ (file source: examples/widgets/tutorials/modelview/7_selections/mainwindow.cpp)
\snippet tutorials/modelview/7_selections/mainwindow.cpp quoting modelview_b
We get the model index that corresponds to the selection by calling
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index 1c15905ff0..bb6033ba6c 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -4199,9 +4199,14 @@ QTransform QGraphicsItem::deviceTransform(const QTransform &viewportTransform) c
return QTransform();
}
- // First translate the base untransformable item.
- untransformedAncestor->d_ptr->ensureSceneTransform();
- QPointF mappedPoint = (untransformedAncestor->d_ptr->sceneTransform * viewportTransform).map(QPointF(0, 0));
+ // Determine the inherited origin. Find the parent of the topmost untransformable.
+ // Use its scene transform to map the position of the untransformable. Then use
+ // that viewport position as the anchoring point for the untransformable subtree.
+ QGraphicsItem *parentOfUntransformedAncestor = untransformedAncestor->parentItem();
+ QTransform inheritedMatrix;
+ if (parentOfUntransformedAncestor)
+ inheritedMatrix = parentOfUntransformedAncestor->sceneTransform();
+ QPointF mappedPoint = (inheritedMatrix * viewportTransform).map(untransformedAncestor->pos());
// COMBINE
QTransform matrix = QTransform::fromTranslate(mappedPoint.x(), mappedPoint.y());
@@ -7355,7 +7360,6 @@ void QGraphicsItem::updateMicroFocus()
if (qApp)
qApp->inputMethod()->update(Qt::ImQueryAll);
break;
- }
}
}
}
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index d78e32205f..846858ab31 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -3214,7 +3214,6 @@ void QGraphicsView::mouseDoubleClickEvent(QMouseEvent *event)
mouseEvent.setLastScenePos(d->lastMouseMoveScenePoint);
mouseEvent.setLastScreenPos(d->lastMouseMoveScreenPoint);
mouseEvent.setButtons(event->buttons());
- mouseEvent.setButtons(event->buttons());
mouseEvent.setAccepted(false);
mouseEvent.setButton(event->button());
mouseEvent.setModifiers(event->modifiers());
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 27a152b706..af3d134a5a 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -2861,7 +2861,14 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
QKeyEvent* key = static_cast<QKeyEvent*>(e);
#ifndef QT_NO_SHORTCUT
// Try looking for a Shortcut before sending key events
- if (qApp->d_func()->shortcutMap.tryShortcutEvent(receiver, key))
+ QObject *shortcutReceiver = receiver;
+ if (!isWidget && isWindow) {
+ QWindow *w = qobject_cast<QWindow *>(receiver);
+ QObject *focus = w ? w->focusObject() : 0;
+ if (focus)
+ shortcutReceiver = focus;
+ }
+ if (qApp->d_func()->shortcutMap.tryShortcutEvent(shortcutReceiver, key))
return true;
#endif
qt_in_tab_key_event = (key->key() == Qt::Key_Backtab
diff --git a/src/widgets/kernel/qdesktopwidget.h b/src/widgets/kernel/qdesktopwidget.h
index da44242b86..42c338f696 100644
--- a/src/widgets/kernel/qdesktopwidget.h
+++ b/src/widgets/kernel/qdesktopwidget.h
@@ -92,6 +92,7 @@ protected:
private:
Q_DISABLE_COPY(QDesktopWidget)
Q_DECLARE_PRIVATE(QDesktopWidget)
+ Q_PRIVATE_SLOT(d_func(), void _q_updateScreens())
friend class QApplication;
friend class QApplicationPrivate;
diff --git a/src/widgets/kernel/qdesktopwidget_qpa.cpp b/src/widgets/kernel/qdesktopwidget_qpa.cpp
index 64236321a4..015573dfbe 100644
--- a/src/widgets/kernel/qdesktopwidget_qpa.cpp
+++ b/src/widgets/kernel/qdesktopwidget_qpa.cpp
@@ -49,12 +49,13 @@ QT_BEGIN_NAMESPACE
QT_USE_NAMESPACE
-void QDesktopWidgetPrivate::updateScreenList()
+void QDesktopWidgetPrivate::_q_updateScreens()
{
Q_Q(QDesktopWidget);
- QList<QScreen *> screenList = QGuiApplication::screens();
- int targetLength = screenList.length();
- int currentLength = screens.length();
+ const QList<QScreen *> screenList = QGuiApplication::screens();
+ const int targetLength = screenList.length();
+ const int oldLength = screens.length();
+ int currentLength = oldLength;
// Add or remove screen widgets as necessary
if(currentLength > targetLength) {
@@ -65,23 +66,41 @@ void QDesktopWidgetPrivate::updateScreenList()
}
}
else if (currentLength < targetLength) {
- QDesktopScreenWidget *screen;
while (currentLength < targetLength) {
- screen = new QDesktopScreenWidget(currentLength++);
- screens.append(screen);
+ QScreen *qScreen = screenList.at(currentLength);
+ QDesktopScreenWidget *screenWidget = new QDesktopScreenWidget(currentLength++);
+ screenWidget->setGeometry(qScreen->geometry());
+ QObject::connect(qScreen, SIGNAL(geometryChanged(QRect)),
+ q, SLOT(_q_updateScreens()), Qt::QueuedConnection);
+ QObject::connect(qScreen, SIGNAL(destroyed()),
+ q, SLOT(_q_updateScreens()), Qt::QueuedConnection);
+ screens.append(screenWidget);
}
}
QRegion virtualGeometry;
- // update the geometry of each screen widget
+ // update the geometry of each screen widget, determine virtual geometry
+ // and emit change signals afterwards.
+ QList<int> changedScreens;
for (int i = 0; i < screens.length(); i++) {
- QRect screenGeometry = screenList.at(i)->geometry();
- screens.at(i)->setGeometry(screenGeometry);
+ const QRect screenGeometry = screenList.at(i)->geometry();
+ if (screenGeometry != screens.at(i)->geometry()) {
+ screens.at(i)->setGeometry(screenGeometry);
+ changedScreens.push_back(i);
+ }
virtualGeometry += screenGeometry;
}
q->setGeometry(virtualGeometry.boundingRect());
+
+ if (oldLength != targetLength)
+ emit q->screenCountChanged(targetLength);
+
+ foreach (int changedScreen, changedScreens) {
+ emit q->resized(changedScreen);
+ emit q->workAreaResized(changedScreen);
+ }
}
QDesktopWidget::QDesktopWidget()
@@ -89,7 +108,8 @@ QDesktopWidget::QDesktopWidget()
{
Q_D(QDesktopWidget);
setObjectName(QLatin1String("desktop"));
- d->updateScreenList();
+ d->_q_updateScreens();
+ connect(qApp, SIGNAL(screenAdded(QScreen*)), this, SLOT(_q_updateScreens()));
}
QDesktopWidget::~QDesktopWidget()
@@ -169,3 +189,5 @@ void QDesktopWidget::resizeEvent(QResizeEvent *)
}
QT_END_NAMESPACE
+
+#include "moc_qdesktopwidget.cpp"
diff --git a/src/widgets/kernel/qdesktopwidget_qpa_p.h b/src/widgets/kernel/qdesktopwidget_qpa_p.h
index 017934fbf1..f461869f1b 100644
--- a/src/widgets/kernel/qdesktopwidget_qpa_p.h
+++ b/src/widgets/kernel/qdesktopwidget_qpa_p.h
@@ -74,7 +74,7 @@ class QDesktopWidgetPrivate : public QWidgetPrivate {
public:
~QDesktopWidgetPrivate() {foreach(QDesktopScreenWidget *s, screens) delete s; }
- void updateScreenList();
+ void _q_updateScreens();
QList<QDesktopScreenWidget *> screens;
};
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index fcef038e1e..5532b04b22 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1405,7 +1405,7 @@ QWidget::~QWidget()
w = w->d_func()->extra->focus_proxy;
QWidget *window = w->window();
QWExtra *e = window ? window->d_func()->extra : 0;
- if (!e || !e->proxyWidget)
+ if (!e || !e->proxyWidget || (w->parentWidget() && w->parentWidget()->d_func()->focus_child == this))
#endif
clearFocus();
} QT_CATCH(...) {
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index d29ba82a04..f2bd389769 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -538,9 +538,10 @@ void QWidgetWindow::handleResizeEvent(QResizeEvent *event)
}
}
-void QWidgetWindow::handleCloseEvent(QCloseEvent *)
+void QWidgetWindow::handleCloseEvent(QCloseEvent *event)
{
- m_widget->d_func()->close_helper(QWidgetPrivate::CloseWithSpontaneousEvent);
+ bool is_closing = m_widget->d_func()->close_helper(QWidgetPrivate::CloseWithSpontaneousEvent);
+ event->setAccepted(is_closing);
}
#ifndef QT_NO_WHEELEVENT
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 9119e2cfba..0b860450d1 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -3741,6 +3741,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
comboCopy.direction = Qt::LeftToRight;
if ((opt->state & QStyle::State_Small) && QSysInfo::macVersion() > QSysInfo::MV_10_6)
comboCopy.rect.translate(0, w ? -1 : -2); // Supports Qt Quick Controls
+ else if (QSysInfo::macVersion() > QSysInfo::MV_10_8)
+ comboCopy.rect.translate(0, 1);
QCommonStyle::drawControl(CE_ComboBoxLabel, &comboCopy, p, w);
}
break;
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp
index 64b7b12e90..18c8ed2bd2 100644
--- a/src/widgets/util/qcompleter.cpp
+++ b/src/widgets/util/qcompleter.cpp
@@ -829,6 +829,7 @@ void QCompleterPrivate::_q_complete(QModelIndex index, bool highlighted)
if (!index.isValid() || (!proxy->showAll && (index.row() >= proxy->engine->matchCount()))) {
completion = prefix;
+ index = QModelIndex();
} else {
if (!(index.flags() & Qt::ItemIsEnabled))
return;
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index b89067155d..bdd06da7fc 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -59,6 +59,7 @@
#include <qheaderview.h>
#include <qmath.h>
#include <qmetaobject.h>
+#include <qabstractproxymodel.h>
#include <private/qguiapplication_p.h>
#include <private/qapplication_p.h>
#include <private/qcombobox_p.h>
@@ -173,18 +174,28 @@ QStyleOptionMenuItem QComboMenuDelegate::getStyleOption(const QStyleOptionViewIt
return menuOption;
}
-#ifdef QT_KEYPAD_NAVIGATION
-void QComboBoxPrivate::_q_completerActivated()
+#ifndef QT_NO_COMPLETER
+void QComboBoxPrivate::_q_completerActivated(const QModelIndex &index)
{
Q_Q(QComboBox);
+ if (index.isValid() && q->completer()) {
+ QAbstractProxyModel *proxy = qobject_cast<QAbstractProxyModel *>(q->completer()->completionModel());
+ if (proxy) {
+ q->setCurrentIndex(proxy->mapToSource(index).row());
+ emitActivated(currentIndex);
+ }
+ }
+
+# ifdef QT_KEYPAD_NAVIGATION
if ( QApplication::keypadNavigationEnabled()
&& q->isEditable()
&& q->completer()
&& q->completer()->completionMode() == QCompleter::UnfilteredPopupCompletion ) {
q->setEditFocus(false);
}
+# endif // QT_KEYPAD_NAVIGATION
}
-#endif
+#endif // !QT_NO_COMPLETER
void QComboBoxPrivate::updateArrow(QStyle::StateFlag state)
{
@@ -1149,6 +1160,14 @@ void QComboBoxPrivate::_q_editingFinished()
void QComboBoxPrivate::_q_returnPressed()
{
Q_Q(QComboBox);
+
+ // The insertion code below does not apply when the policy is QComboBox::NoInsert.
+ // In case a completer is installed, item activation via the completer is handled
+ // in _q_completerActivated(). Otherwise _q_editingFinished() updates the current
+ // index as appropriate.
+ if (insertPolicy == QComboBox::NoInsert)
+ return;
+
if (lineEdit && !lineEdit->text().isEmpty()) {
if (q->count() >= maxCount && !(this->insertPolicy == QComboBox::InsertAtCurrent))
return;
@@ -1191,7 +1210,6 @@ void QComboBoxPrivate::_q_returnPressed()
break;
}
break;
- case QComboBox::NoInsert:
default:
break;
}
@@ -1393,6 +1411,7 @@ void QComboBox::setAutoCompletion(bool enable)
if (d->lineEdit->completer())
return;
d->completer = new QCompleter(d->model, d->lineEdit);
+ connect(d->completer, SIGNAL(activated(QModelIndex)), this, SLOT(_q_completerActivated(QModelIndex)));
d->completer->setCaseSensitivity(d->autoCompletionCaseSensitivity);
d->completer->setCompletionMode(QCompleter::InlineCompletion);
d->completer->setCompletionColumn(d->modelColumn);
@@ -1805,8 +1824,10 @@ void QComboBox::setCompleter(QCompleter *c)
if (!d->lineEdit)
return;
d->lineEdit->setCompleter(c);
- if (c)
+ if (c) {
+ connect(c, SIGNAL(activated(QModelIndex)), this, SLOT(_q_completerActivated(QModelIndex)));
c->setWidget(this);
+ }
}
/*!
diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h
index d4aeeb9620..0002cd08cb 100644
--- a/src/widgets/widgets/qcombobox.h
+++ b/src/widgets/widgets/qcombobox.h
@@ -260,8 +260,8 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_rowsRemoved(const QModelIndex & parent, int start, int end))
Q_PRIVATE_SLOT(d_func(), void _q_modelDestroyed())
Q_PRIVATE_SLOT(d_func(), void _q_modelReset())
-#ifdef QT_KEYPAD_NAVIGATION
- Q_PRIVATE_SLOT(d_func(), void _q_completerActivated())
+#ifndef QT_NO_COMPLETER
+ Q_PRIVATE_SLOT(d_func(), void _q_completerActivated(const QModelIndex &index))
#endif
};
diff --git a/src/widgets/widgets/qcombobox_p.h b/src/widgets/widgets/qcombobox_p.h
index 14cf9e7925..07ba9b0925 100644
--- a/src/widgets/widgets/qcombobox_p.h
+++ b/src/widgets/widgets/qcombobox_p.h
@@ -348,8 +348,8 @@ public:
void _q_emitCurrentIndexChanged(const QModelIndex &index);
void _q_modelDestroyed();
void _q_modelReset();
-#ifdef QT_KEYPAD_NAVIGATION
- void _q_completerActivated();
+#ifndef QT_NO_COMPLETER
+ void _q_completerActivated(const QModelIndex &index);
#endif
void _q_resetButton();
void _q_dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
diff --git a/src/widgets/widgets/qdockarealayout.cpp b/src/widgets/widgets/qdockarealayout.cpp
index ac061e7071..72a463b30b 100644
--- a/src/widgets/widgets/qdockarealayout.cpp
+++ b/src/widgets/widgets/qdockarealayout.cpp
@@ -1471,7 +1471,7 @@ QList<int> QDockAreaLayoutInfo::indexOf(QWidget *widget) const
continue;
}
- if (!(item.flags & QDockAreaLayoutItem::GapItem) && item.widgetItem->widget() == widget) {
+ if (!(item.flags & QDockAreaLayoutItem::GapItem) && item.widgetItem && item.widgetItem->widget() == widget) {
QList<int> result;
result << i;
return result;