From 9abfe7031db60bb8e2c16e2fbe92b0950089168c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 28 Mar 2012 10:07:34 +0200 Subject: Windows: Fix handling of -nomake. Add to list of disabled build parts (see b9a498bf514255b2a6298f44801d3d43c958044c). This fixes the tests are currently built in developer-build despite "-nomake tests". Change-Id: I43282112e03328dd89d8c874ca31b0483742ddb3 --- tools/configure/configureapp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 9ff402da9f..1b25911d8c 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -958,7 +958,7 @@ void Configure::parseCmdLine() ++i; if (i == argCount) break; - nobuildParts.removeAll(configCmdLine.at(i)); + nobuildParts.append(configCmdLine.at(i)); } // Directories ---------------------------------------------- -- cgit v1.2.3 From 0174c966f734ba48d387257a14447e8b56d85d37 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 4 Apr 2012 18:27:24 +0200 Subject: qmake vcxproj generator: properly escape XML attributes Task-number: QTBUG-24954 Change-Id: I21299440ba3f268c2fa1e14d37003cdc3e6a35ad Reviewed-by: Oswald Buddenhagen --- qmake/generators/xmloutput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/xmloutput.cpp b/qmake/generators/xmloutput.cpp index f7fa547a75..c868021f2b 100644 --- a/qmake/generators/xmloutput.cpp +++ b/qmake/generators/xmloutput.cpp @@ -179,7 +179,7 @@ XmlOutput& XmlOutput::operator<<(const xml_output& o) break; case tTagValue: addRaw(QString("\n%1<%2>").arg(currentIndent).arg(o.xo_text)); - addRaw(QString("%1").arg(o.xo_value)); + addRaw(doConversion(o.xo_value)); addRaw(QString("").arg(o.xo_text)); break; case tValueTag: -- cgit v1.2.3 From fddbe8beecd8cd4f783ce85076994f6cb90e9154 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 5 Apr 2012 16:40:11 +0200 Subject: Windows: Send empty region in expose event from setVisible(false). Fixing a crash in tst_qwidget.cpp, trying to redraw on destroying the platform window. Change-Id: I6b6e9a063a1c72dff8110c379f8392605aadbdd6 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowswindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index fa3661db22..2b86d069ab 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -704,11 +704,13 @@ void QWindowsWindow::setVisible(bool visible) if (m_data.hwnd) { if (visible) { show_sys(); + QWindowSystemInterface::handleSynchronousExposeEvent(window(), + QRect(QPoint(), geometry().size())); } else { hide_sys(); + QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRegion()); } } - QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRect(QPoint(), geometry().size())); } bool QWindowsWindow::isVisible() const -- cgit v1.2.3 From bdfff4d82537ae4c69585b0102457cfc522ef070 Mon Sep 17 00:00:00 2001 From: Debao Zhang Date: Wed, 4 Apr 2012 20:26:31 -0700 Subject: Fix compilation with MinGW-W64. These types and values and been defined propsys.h from MinGW-W64 Version2 on. Change-Id: If74b7cf07a0fce414009c86519494a782508d8fe Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowsdialoghelpers.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 1239f3d8e2..aa366da672 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -116,6 +116,7 @@ typedef struct _COMDLG_FILTERSPEC #define FOS_DEFAULTNOMINIMODE 0x20000000 #define FOS_FORCEPREVIEWPANEON 0x40000000 +#if !defined(__MINGW64_VERSION_MAJOR) || (__MINGW64_VERSION_MAJOR < 2) typedef int GETPROPERTYSTOREFLAGS; #define GPS_DEFAULT 0x00000000 #define GPS_HANDLERPROPERTIESONLY 0x00000001 @@ -126,6 +127,7 @@ typedef int GETPROPERTYSTOREFLAGS; #define GPS_DELAYCREATION 0x00000020 #define GPS_BESTEFFORT 0x00000040 #define GPS_MASK_VALID 0x0000007F +#endif typedef int (QT_WIN_CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData); // message from browser @@ -288,7 +290,9 @@ DECLARE_INTERFACE_(IFileOpenDialog, IFileDialog) STDMETHOD(GetSelectedItems)(THIS_ IShellItemArray **ppsai) PURE; }; +#if !defined(__MINGW64_VERSION_MAJOR) || (__MINGW64_VERSION_MAJOR < 2) typedef IUnknown IPropertyStore; +#endif typedef IUnknown IFileOperationProgressSink; DECLARE_INTERFACE_(IFileSaveDialog, IFileDialog) -- cgit v1.2.3 From 1c20c3f29441a6856c6eb58dda40b86bdaac6a06 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Thu, 5 Apr 2012 16:46:18 +0100 Subject: Moving stack-smashing protection to the Blackberry mkspecs It transpires that QNX 6.5.0 does not yet have libc support for the gcc stack smashing protection. Change-Id: Ic635662b6aa3ce2fad5f69e236386ae9ace420db Reviewed-by: Andreas Holzammer Reviewed-by: Stephen Kelly Reviewed-by: Oswald Buddenhagen --- mkspecs/common/qcc-base.conf | 3 +-- mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf | 3 +++ mkspecs/unsupported/blackberry-x86-qcc/qmake.conf | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mkspecs/common/qcc-base.conf b/mkspecs/common/qcc-base.conf index a2aefc6cd3..aa6abee0a0 100644 --- a/mkspecs/common/qcc-base.conf +++ b/mkspecs/common/qcc-base.conf @@ -7,10 +7,9 @@ # # 1) -pipe is removed as it's on by default in qcc (and has an analogous -nopipe option) # 2) -Wno-psabi is added to silence harmless warnings about va_list mangling -# 3) -fstack-protector -fstack-protector-all is added to enable stack smashing protection # -QMAKE_CFLAGS += -Wno-psabi -fstack-protector -fstack-protector-all +QMAKE_CFLAGS += -Wno-psabi QMAKE_CFLAGS_DEPS += -M QMAKE_CFLAGS_WARN_ON += -Wall -W QMAKE_CFLAGS_WARN_OFF += -w diff --git a/mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf b/mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf index df9961b107..4e72667c5d 100644 --- a/mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf +++ b/mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf @@ -6,4 +6,7 @@ DEFINES += Q_OS_BLACKBERRY CONFIG += blackberry LIBS += -lbps +# Blackberry also has support for stack smashing protection in its libc +QMAKE_CFLAGS += -fstack-protector -fstack-protector-all + include(../qnx-armv7le-qcc/qmake.conf) diff --git a/mkspecs/unsupported/blackberry-x86-qcc/qmake.conf b/mkspecs/unsupported/blackberry-x86-qcc/qmake.conf index 2cb405cd51..60b67f801e 100644 --- a/mkspecs/unsupported/blackberry-x86-qcc/qmake.conf +++ b/mkspecs/unsupported/blackberry-x86-qcc/qmake.conf @@ -6,4 +6,7 @@ DEFINES += Q_OS_BLACKBERRY CONFIG += blackberry LIBS += -lbps +# Blackberry also has support for stack smashing protection in its libc +QMAKE_CFLAGS += -fstack-protector -fstack-protector-all + include(../qnx-x86-qcc/qmake.conf) -- cgit v1.2.3 From 39b45781562712f320edb6519aef7b2444699848 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 30 Mar 2012 14:09:15 +0200 Subject: QTypeInfo: document Q_PRIMITIVE_TYPE existing practice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Despite the documentation requiring Q_PRIMITIVE_TYPEs to be PODs, existing practice in Qt (QFixed, QFlags, QUuid) is to allow constructors on primitive types as long as every bit pattern represents a valid object (ie. memory doesn't have to be initialised to hold an object of the type) and memcpy() can be used to create an independent copy of the object (memcpy()ing QString, e.g., while creating two valid objects, doesn't create independent copies). Change-Id: Ia85d48b89f6cc84e69ea76719eab9a858d247ad6 Reviewed-by: Thiago Macieira Reviewed-by: Olivier Goffart Reviewed-by: Lars Knoll Reviewed-by: Jędrzej Nowacki --- src/corelib/global/qglobal.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 8125161897..7d518cbcd8 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2518,7 +2518,9 @@ int qrand() \list \li \c Q_PRIMITIVE_TYPE specifies that \a Type is a POD (plain old - data) type with no constructor or destructor. + data) type with no constructor or destructor, or else a type where + every bit pattern is a valid object and memcpy() creates a valid + independent copy of the object. \li \c Q_MOVABLE_TYPE specifies that \a Type has a constructor and/or a destructor but can be moved in memory using \c memcpy(). @@ -2531,6 +2533,11 @@ int qrand() \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 38 + An example of a non-POD "primitive" type is QUuid: Even though + QUuid has constructors (and therefore isn't POD), every bit + pattern still represents a valid object, and memcpy() can be used + to create a valid independent copy of a QUuid object. + Example of a movable type: \snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 39 -- cgit v1.2.3 From 300ce31d7047a038c882235979988d928159ee30 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 9 Apr 2012 15:08:18 -0700 Subject: Fix constness of QPlatformCursorImage::hostpot() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QPlatformCursorImage::hotspot() should be const. Change-Id: I2b517098e75b013947386a5a620a15dc48e76cec Reviewed-by: Jørgen Lind --- src/gui/kernel/qplatformcursor_qpa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qplatformcursor_qpa.h b/src/gui/kernel/qplatformcursor_qpa.h index e29cf87d03..a31501958c 100644 --- a/src/gui/kernel/qplatformcursor_qpa.h +++ b/src/gui/kernel/qplatformcursor_qpa.h @@ -60,7 +60,7 @@ public: QPlatformCursorImage(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY) { set(data, mask, width, height, hotX, hotY); } QImage * image() { return &cursorImage; } - QPoint hotspot() { return hot; } + QPoint hotspot() const { return hot; } void set(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY); void set(const QImage &image, int hx, int hy); void set(Qt::CursorShape); -- cgit v1.2.3 From c75ef6e2231163493b0d8878670ec7cada291001 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 9 Apr 2012 15:22:07 -0700 Subject: Fix header inclusion guards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The inclusion guards refer to the old graphics system code Change-Id: Ifa72e3030c83797e471735a9a696bf12c0f75b08 Reviewed-by: Jørgen Lind --- src/gui/kernel/qplatformcursor_qpa.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qplatformcursor_qpa.h b/src/gui/kernel/qplatformcursor_qpa.h index a31501958c..c1a572b27d 100644 --- a/src/gui/kernel/qplatformcursor_qpa.h +++ b/src/gui/kernel/qplatformcursor_qpa.h @@ -38,8 +38,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef QGRAPHICSSYSTEMCURSOR_H -#define QGRAPHICSSYSTEMCURSOR_H +#ifndef QPLATFORMCURSOR_QPA_H +#define QPLATFORMCURSOR_QPA_H #include #include @@ -97,4 +97,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QGRAPHICSSYSTEMCURSOR_H +#endif // QPLATFORMCURSOR_QPA_H -- cgit v1.2.3 From 2ee8b98cae753f071f7194fc30a3a1209209c5cd Mon Sep 17 00:00:00 2001 From: Donald Carr Date: Fri, 6 Apr 2012 20:31:04 +0000 Subject: Remove QWS era pvr headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The QWS powervr plugin ceased to exist with the move to QPA; these headers are therefore entirely redundant Change-Id: I28c7baae15df5bb9d7ea3763e3a018e9e1ae1fc6 Reviewed-by: Girish Ramakrishnan Reviewed-by: Samuel Rødal --- src/3rdparty/README | 6 - src/3rdparty/powervr/pvr2d.h | 502 ------------------------------------------- src/3rdparty/powervr/wsegl.h | 240 --------------------- 3 files changed, 748 deletions(-) delete mode 100644 src/3rdparty/powervr/pvr2d.h delete mode 100644 src/3rdparty/powervr/wsegl.h diff --git a/src/3rdparty/README b/src/3rdparty/README index 0248db1c53..f6d7c525e1 100644 --- a/src/3rdparty/README +++ b/src/3rdparty/README @@ -15,9 +15,3 @@ library directory, following the latest clean version update commit. The 'patches' subdirectory contains certain patches applied prior to the start of the public git history, where the library has not been updated since. - --- - -The pvr2d.h & wsegl.h in the powervr directory are required for building -the PowerVR plugin on Qt for Embedded Linux. These headers are for SGX -based SoCs, but may also work on MBX SoCs. diff --git a/src/3rdparty/powervr/pvr2d.h b/src/3rdparty/powervr/pvr2d.h deleted file mode 100644 index 07f28c7316..0000000000 --- a/src/3rdparty/powervr/pvr2d.h +++ /dev/null @@ -1,502 +0,0 @@ -/*!**************************************************************************** -@File pvr2d.h -@Title PVR2D external header file -@Author Imagination Technologies -@Copyright Copyright (c) by Imagination Technologies Limited. - This specification is protected by copyright laws and contains - material proprietary to Imagination Technologies Limited. - You may use and distribute this specification free of charge for implementing - the functionality therein, without altering or removing any trademark, copyright, - or other notice from the specification. -@Platform Generic -@Description PVR2D definitions for PVR2D clients -******************************************************************************/ - - -/****************************************************************************** -Modifications :- -$Log: pvr2d.h $ -******************************************************************************/ - -#ifndef _PVR2D_H_ -#define _PVR2D_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* PVR2D Platform-specific definitions */ -#define PVR2D_EXPORT -#define PVR2D_IMPORT - - -#define PVR2D_REV_MAJOR 2 -#define PVR2D_REV_MINOR 1 - -typedef enum -{ - PVR2D_FALSE = 0, - PVR2D_TRUE -} PVR2D_BOOL; - - -/* error codes */ -typedef enum -{ - PVR2D_OK = 0, - PVR2DERROR_INVALID_PARAMETER = -1, - PVR2DERROR_DEVICE_UNAVAILABLE = -2, - PVR2DERROR_INVALID_CONTEXT = -3, - PVR2DERROR_MEMORY_UNAVAILABLE = -4, - PVR2DERROR_DEVICE_NOT_PRESENT = -5, - PVR2DERROR_IOCTL_ERROR = -6, - PVR2DERROR_GENERIC_ERROR = -7, - PVR2DERROR_BLT_NOTCOMPLETE = -8, - PVR2DERROR_HW_FEATURE_NOT_SUPPORTED = -9, - PVR2DERROR_NOT_YET_IMPLEMENTED = -10, - PVR2DERROR_MAPPING_FAILED = -11 -}PVR2DERROR; - - -/* pixel formats */ -typedef enum -{ - PVR2D_1BPP = 0, - PVR2D_RGB565, - PVR2D_ARGB4444, - PVR2D_RGB888, - PVR2D_ARGB8888, - PVR2D_ARGB1555, - PVR2D_ALPHA8, - PVR2D_ALPHA4, - PVR2D_PAL2, - PVR2D_PAL4, - PVR2D_PAL8, - PVR2D_VGAEMU - -}PVR2DFORMAT; - - -/* wrap surface type */ -typedef enum -{ - PVR2D_WRAPFLAG_NONCONTIGUOUS = 0, - PVR2D_WRAPFLAG_CONTIGUOUS = 1, - -}PVR2DWRAPFLAGS; - -/* flags for control information of additional blits */ -typedef enum -{ - PVR2D_BLIT_DISABLE_ALL = 0x0000, /* disable all additional controls */ - PVR2D_BLIT_CK_ENABLE = 0x0001, /* enable colour key */ - PVR2D_BLIT_GLOBAL_ALPHA_ENABLE = 0x0002, /* enable standard global alpha */ - PVR2D_BLIT_PERPIXEL_ALPHABLEND_ENABLE = 0x0004, /* enable per-pixel alpha bleding */ - PVR2D_BLIT_PAT_SURFACE_ENABLE = 0x0008, /* enable pattern surf (disable fill) */ - PVR2D_BLIT_FULLY_SPECIFIED_ALPHA_ENABLE = 0x0010, /* enable fully specified alpha */ - PVR2D_BLIT_ROT_90 = 0x0020, /* apply 90 degree rotation to the blt */ - PVR2D_BLIT_ROT_180 = 0x0040, /* apply 180 degree rotation to the blt */ - PVR2D_BLIT_ROT_270 = 0x0080, /* apply 270 degree rotation to the blt */ - PVR2D_BLIT_COPYORDER_TL2BR = 0x0100, /* copy order overrides */ - PVR2D_BLIT_COPYORDER_BR2TL = 0x0200, - PVR2D_BLIT_COPYORDER_TR2BL = 0x0400, - PVR2D_BLIT_COPYORDER_BL2TR = 0x0800, - PVR2D_BLIT_COLKEY_SOURCE = 0x1000, /* Key colour is on the source surface */ - PVR2D_BLIT_COLKEY_DEST = 0x2000 /* Key colour is on the destination surface */ - -} PVR2DBLITFLAGS; - -/* standard alpha-blending functions, AlphaBlendingFunc field of PVR2DBLTINFO */ -typedef enum -{ - PVR2D_ALPHA_OP_SRC_DSTINV = 1, /* source alpha : Cdst = Csrc*Asrc + Cdst*(1-Asrc) */ - PVR2D_ALPHA_OP_SRCP_DSTINV = 2 /* premultiplied source alpha : Cdst = Csrc + Cdst*(1-Asrc) */ -} PVR2D_ALPHABLENDFUNC; - -/* blend ops for fully specified alpha */ -typedef enum -{ - PVR2D_BLEND_OP_ZERO = 0, - PVR2D_BLEND_OP_ONE = 1, - PVR2D_BLEND_OP_SRC = 2, - PVR2D_BLEND_OP_DST = 3, - PVR2D_BLEND_OP_GLOBAL = 4, - PVR2D_BLEND_OP_SRC_PLUS_GLOBAL = 5, - PVR2D_BLEND_OP_DST_PLUS_GLOBAL = 6 -}PVR2D_BLEND_OP; - - -typedef void* PVR2D_HANDLE; - - -/* Fully specified alpha blend : pAlpha field of PVR2DBLTINFO structure */ -/* a fully specified Alpha Blend operation is defined as */ -/* DST (ALPHA) = (ALPHA_1 * SRC (ALPHA)) + (ALPHA_3 * DST (ALPHA)) */ -/* DST (RGB) = (ALPHA_2 * SRC (RGB)) + (ALPHA_4 * DST (RGB)) */ -/* if the pre-multiplication stage is enabled then the equations become the following: */ -/* PRE_MUL = ((SRC(A)) * (Global Alpha Value)) */ -/* DST (ALPHA) = (ALPHA_1 * SRC (ALPHA)) + (PRE_MUL * DST (ALPHA)) */ -/* DST (RGB) = (ALPHA_2 * SRC (RGB)) + (PRE_MUL * DST (RGB)) */ -/* if the transparent source alpha stage is enabled then a source alpha of zero forces the */ -/* source to be transparent for that pixel regardless of the blend equation being used. */ -typedef struct _PVR2D_ALPHABLT -{ - PVR2D_BLEND_OP eAlpha1; - PVR2D_BOOL bAlpha1Invert; - PVR2D_BLEND_OP eAlpha2; - PVR2D_BOOL bAlpha2Invert; - PVR2D_BLEND_OP eAlpha3; - PVR2D_BOOL bAlpha3Invert; - PVR2D_BLEND_OP eAlpha4; - PVR2D_BOOL bAlpha4Invert; - PVR2D_BOOL bPremulAlpha; /* enable pre-multiplication stage */ - PVR2D_BOOL bTransAlpha; /* enable transparent source alpha stage */ - PVR2D_BOOL bUpdateAlphaLookup; /* enable and update the 1555-Lookup alpha table */ - unsigned char uAlphaLookup0; /* 8 bit alpha when A=0 in a 1555-Lookup surface */ - unsigned char uAlphaLookup1; /* 8 bit alpha when A=1 in a 1555-Lookup surface */ - unsigned char uGlobalRGB; /* Global Alpha Value for RGB, 0=transparent 255=opaque */ - unsigned char uGlobalA; /* Global Alpha Value for Alpha */ - -} PVR2D_ALPHABLT, *PPVR2D_ALPHABLT; - - -/* surface memory info structure */ -typedef struct _PVR2DMEMINFO -{ - void *pBase; - unsigned long ui32MemSize; - unsigned long ui32DevAddr; - unsigned long ulFlags; - void *hPrivateData; - void *hPrivateMapData; - -}PVR2DMEMINFO, *PPVR2DMEMINFO; - - -#define PVR2D_MAX_DEVICE_NAME 20 - -typedef struct _PVR2DDEVICEINFO -{ - unsigned long ulDevID; - char szDeviceName[PVR2D_MAX_DEVICE_NAME]; -}PVR2DDEVICEINFO; - - -typedef struct _PVR2DISPLAYINFO -{ - unsigned long ulMaxFlipChains; - unsigned long ulMaxBuffersInChain; - PVR2DFORMAT eFormat; - unsigned long ulWidth; - unsigned long ulHeight; - long lStride; - unsigned long ulMinFlipInterval; - unsigned long ulMaxFlipInterval; - -}PVR2DDISPLAYINFO; - - -typedef struct _PVR2DBLTINFO -{ - unsigned long CopyCode; /* rop code */ - unsigned long Colour; /* fill colour */ - unsigned long ColourKey; /* colour key */ - unsigned char GlobalAlphaValue; /* global alpha blending */ - unsigned char AlphaBlendingFunc; /* per-pixel alpha-blending function */ - - PVR2DBLITFLAGS BlitFlags; /* additional blit control information */ - - PVR2DMEMINFO *pDstMemInfo; /* destination memory */ - unsigned long DstOffset; /* byte offset from start of allocation to destination surface pixel 0,0 */ - long DstStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */ - long DstX, DstY; /* pixel offset from start of dest surface to start of blt rectangle */ - long DSizeX,DSizeY; /* blt size */ - PVR2DFORMAT DstFormat; /* dest format */ - unsigned long DstSurfWidth; /* size of dest surface in pixels */ - unsigned long DstSurfHeight; /* size of dest surface in pixels */ - - PVR2DMEMINFO *pSrcMemInfo; /* source mem, (source fields are also used for patterns) */ - unsigned long SrcOffset; /* byte offset from start of allocation to src/pat surface pixel 0,0 */ - long SrcStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */ - long SrcX, SrcY; /* pixel offset from start of surface to start of source rectangle */ - /* for patterns this is the start offset within the pattern */ - long SizeX,SizeY; /* source rectangle size or pattern size in pixels */ - PVR2DFORMAT SrcFormat; /* source/pattern format */ - PVR2DMEMINFO *pPalMemInfo; /* source/pattern palette memory containing argb8888 colour table */ - unsigned long PalOffset; /* byte offset from start of allocation to start of palette */ - unsigned long SrcSurfWidth; /* size of source surface in pixels */ - unsigned long SrcSurfHeight; /* size of source surface in pixels */ - - PVR2DMEMINFO *pMaskMemInfo; /* mask memory, 1bpp format implied */ - unsigned long MaskOffset; /* byte offset from start of allocation to mask surface pixel 0,0 */ - long MaskStride; /* signed stride, the number of bytes from pixel 0,0 to 0,1 */ - long MaskX, MaskY; /* mask rect top left (mask size = blt size) */ - unsigned long MaskSurfWidth; /* size of mask surface in pixels */ - unsigned long MaskSurfHeight; /* size of mask surface in pixels */ - - PPVR2D_ALPHABLT pAlpha; /* fully specified alpha blend */ - -}PVR2DBLTINFO, *PPVR2DBLTINFO; - -typedef struct _PVR2DRECT -{ - long left, top; - long right, bottom; -} PVR2DRECT; - -typedef struct -{ - PVR2DMEMINFO *pSurfMemInfo; /* surface memory */ - unsigned long SurfOffset; /* byte offset from start of allocation to destination surface pixel 0,0 */ - long Stride; /* signed stride */ - PVR2DFORMAT Format; - unsigned long SurfWidth; /* surface size in pixels */ - unsigned long SurfHeight; - -} PVR2D_SURFACE, *PPVR2D_SURFACE; - -typedef struct -{ - unsigned long *pUseCode; /* USSE code */ - unsigned long UseCodeSize; /* usse code size in bytes */ - -} PVR2D_USECODE, *PPVR2D_USECODE; - -typedef struct -{ - PVR2D_SURFACE sDst; /* destination surface */ - PVR2D_SURFACE sSrc; /* source surface */ - PVR2DRECT rcDest; /* destination rectangle */ - PVR2DRECT rcSource; /* source rectangle */ - PVR2D_HANDLE hUseCode; /* custom USE code (NULL implies source copy) */ - unsigned long UseParams[2]; /* per-blt params for use code */ - -} PVR2D_3DBLT, *PPVR2D_3DBLT; - - -#define MAKE_COPY_BLIT(src,soff,dest,doff,sx,sy,dx,dy,sz) - -typedef void* PVR2DCONTEXTHANDLE; -typedef void* PVR2DFLIPCHAINHANDLE; - - -// CopyCode field of PVR2DBLTINFO structure: -// the CopyCode field of the PVR2DBLTINFO structure should contain a rop3 or rop4 code. -// a rop3 is an 8 bit code that describes a blt with three inputs : source dest and pattern -// rop4 is a 16 bit code that describes a blt with four inputs : source dest pattern and mask -// common rop3 codes are defined below -// a colour fill blt is processed in the pattern channel as a constant colour with a rop code of 0xF0 -// PVR2D_BLIT_PAT_SURFACE_ENABLE defines whether the pattern channel is a surface or a fill colour. -// a rop4 is defined by two rop3 codes, and the 1 bit-per-pixel mask surface defines which is used. -// a common rop4 is 0xAAF0 which is the mask copy blt used for text glyphs. -// CopyCode is taken to be a rop4 when pMaskMemInfo is non zero, otherwise it is assumed to be a rop3 -// use the PVR2DMASKROP4 macro below to construct a rop4 from two rop3's -// rop3a is the rop used when mask pixel = 1, and rop3b when mask = 0 -#define PVR2DROP4(rop3b, rop3a) ((rop3b<<8)|rop3a) - -/* common rop codes */ -#define PVR2DROPclear 0x00 /* 0 (whiteness) */ -#define PVR2DROPset 0xFF /* 1 (blackness) */ -#define PVR2DROPnoop 0xAA /* dst (used for masked blts) */ - -/* source and dest rop codes */ -#define PVR2DROPand 0x88 /* src AND dst */ -#define PVR2DROPandReverse 0x44 /* src AND NOT dst */ -#define PVR2DROPcopy 0xCC /* src (used for source copy and alpha blts) */ -#define PVR2DROPandInverted 0x22 /* NOT src AND dst */ -#define PVR2DROPxor 0x66 /* src XOR dst */ -#define PVR2DROPor 0xEE /* src OR dst */ -#define PVR2DROPnor 0x11 /* NOT src AND NOT dst */ -#define PVR2DROPequiv 0x99 /* NOT src XOR dst */ -#define PVR2DROPinvert 0x55 /* NOT dst */ -#define PVR2DROPorReverse 0xDD /* src OR NOT dst */ -#define PVR2DROPcopyInverted 0x33 /* NOT src */ -#define PVR2DROPorInverted 0xBB /* NOT src OR dst */ -#define PVR2DROPnand 0x77 /* NOT src OR NOT dst */ - -/* pattern rop codes */ -#define PVR2DPATROPand 0xA0 /* pat AND dst */ -#define PVR2DPATROPandReverse 0x50 /* pat AND NOT dst */ -#define PVR2DPATROPcopy 0xF0 /* pat (used for solid color fills and pattern blts) */ -#define PVR2DPATROPandInverted 0x0A /* NOT pat AND dst */ -#define PVR2DPATROPxor 0x5A /* pat XOR dst */ -#define PVR2DPATROPor 0xFA /* pat OR dst */ -#define PVR2DPATROPnor 0x05 /* NOT pat AND NOT dst */ -#define PVR2DPATROPequiv 0xA5 /* NOT pat XOR dst */ -#define PVR2DPATROPinvert 0x55 /* NOT dst */ -#define PVR2DPATROPorReverse 0xF5 /* pat OR NOT dst */ -#define PVR2DPATROPcopyInverted 0x0F /* NOT pat */ -#define PVR2DPATROPorInverted 0xAF /* NOT pat OR dst */ -#define PVR2DPATROPnand 0x5F /* NOT pat OR NOT dst */ - -/* common rop4 codes */ -#define PVR2DROP4MaskedCopy PVR2DROP4(PVR2DROPnoop,PVR2DROPcopy) /* masked source copy blt (used for rounded window corners etc) */ -#define PVR2DROP4MaskedFill PVR2DROP4(PVR2DROPnoop,PVR2DPATROPcopy) /* masked colour fill blt (used for text) */ - -/* Legacy support */ -#define PVR2DROP3_PATMASK PVR2DPATROPcopy -#define PVR2DROP3_SRCMASK PVR2DROPcopy - -/* pixmap memory alignment */ -#define PVR2D_ALIGNMENT_4 4 /* DWORD alignment */ -#define PVR2D_ALIGNMENT_ANY 0 /* no alignment */ -#define PVR2D_ALIGNMENT_PALETTE 16 /* 16 byte alignment is required for palettes */ - -/* Heap number for PVR2DGetFrameBuffer */ -#define PVR2D_FB_PRIMARY_SURFACE 0 - -#define PVR2D_PRESENT_PROPERTY_SRCSTRIDE (1 << 0) -#define PVR2D_PRESENT_PROPERTY_DSTSIZE (1 << 1) -#define PVR2D_PRESENT_PROPERTY_DSTPOS (1 << 2) -#define PVR2D_PRESENT_PROPERTY_CLIPRECTS (1 << 3) -#define PVR2D_PRESENT_PROPERTY_INTERVAL (1 << 4) - - -#define PVR2D_CREATE_FLIPCHAIN_SHARED (1 << 0) -#define PVR2D_CREATE_FLIPCHAIN_QUERY (1 << 1) - -/* Functions that the library exports */ - -PVR2D_IMPORT -int PVR2DEnumerateDevices(PVR2DDEVICEINFO *pDevInfo); - -PVR2D_IMPORT -PVR2DERROR PVR2DCreateDeviceContext(unsigned long ulDevID, - PVR2DCONTEXTHANDLE* phContext, - unsigned long ulFlags); - -PVR2D_IMPORT -PVR2DERROR PVR2DDestroyDeviceContext(PVR2DCONTEXTHANDLE hContext); - -PVR2D_IMPORT -PVR2DERROR PVR2DGetDeviceInfo(PVR2DCONTEXTHANDLE hContext, - PVR2DDISPLAYINFO *pDisplayInfo); - -PVR2D_IMPORT -PVR2DERROR PVR2DGetScreenMode(PVR2DCONTEXTHANDLE hContext, - PVR2DFORMAT *pFormat, - long *plWidth, - long *plHeight, - long *plStride, - int *piRefreshRate); - -PVR2D_IMPORT -PVR2DERROR PVR2DGetFrameBuffer(PVR2DCONTEXTHANDLE hContext, - int nHeap, - PVR2DMEMINFO **ppsMemInfo); - -PVR2D_IMPORT -PVR2DERROR PVR2DMemAlloc(PVR2DCONTEXTHANDLE hContext, - unsigned long ulBytes, - unsigned long ulAlign, - unsigned long ulFlags, - PVR2DMEMINFO **ppsMemInfo); - -PVR2D_IMPORT -PVR2DERROR PVR2DMemWrap(PVR2DCONTEXTHANDLE hContext, - void *pMem, - unsigned long ulFlags, - unsigned long ulBytes, - unsigned long alPageAddress[], - PVR2DMEMINFO **ppsMemInfo); - -PVR2D_IMPORT -PVR2DERROR PVR2DMemMap(PVR2DCONTEXTHANDLE hContext, - unsigned long ulFlags, - void *hPrivateMapData, - PVR2DMEMINFO **ppsDstMem); - -PVR2D_IMPORT -PVR2DERROR PVR2DMemFree(PVR2DCONTEXTHANDLE hContext, - PVR2DMEMINFO *psMemInfo); - -PVR2D_IMPORT -PVR2DERROR PVR2DBlt(PVR2DCONTEXTHANDLE hContext, - PVR2DBLTINFO *pBltInfo); - -PVR2D_IMPORT -PVR2DERROR PVR2DBltClipped(PVR2DCONTEXTHANDLE hContext, - PVR2DBLTINFO *pBltInfo, - unsigned long ulNumClipRects, - PVR2DRECT *pClipRects); - -PVR2D_IMPORT -PVR2DERROR PVR2DQueryBlitsComplete(PVR2DCONTEXTHANDLE hContext, - PVR2DMEMINFO *pMemInfo, - unsigned int uiWaitForComplete); - -PVR2D_IMPORT -PVR2DERROR PVR2DSetPresentBltProperties(PVR2DCONTEXTHANDLE hContext, - unsigned long ulPropertyMask, - long lSrcStride, - unsigned long ulDstWidth, - unsigned long ulDstHeight, - long lDstXPos, - long lDstYPos, - unsigned long ulNumClipRects, - PVR2DRECT *pClipRects, - unsigned long ulSwapInterval); - -PVR2D_IMPORT -PVR2DERROR PVR2DPresentBlt(PVR2DCONTEXTHANDLE hContext, - PVR2DMEMINFO *pMemInfo, - long lRenderID); - -PVR2D_IMPORT -PVR2DERROR PVR2DCreateFlipChain(PVR2DCONTEXTHANDLE hContext, - unsigned long ulFlags, - unsigned long ulNumBuffers, - unsigned long ulWidth, - unsigned long ulHeight, - PVR2DFORMAT eFormat, - long *plStride, - unsigned long *pulFlipChainID, - PVR2DFLIPCHAINHANDLE *phFlipChain); - -PVR2D_IMPORT -PVR2DERROR PVR2DDestroyFlipChain(PVR2DCONTEXTHANDLE hContext, - PVR2DFLIPCHAINHANDLE hFlipChain); - -PVR2D_IMPORT -PVR2DERROR PVR2DGetFlipChainBuffers(PVR2DCONTEXTHANDLE hContext, - PVR2DFLIPCHAINHANDLE hFlipChain, - unsigned long *pulNumBuffers, - PVR2DMEMINFO *psMemInfo[]); - -PVR2D_IMPORT -PVR2DERROR PVR2DSetPresentFlipProperties(PVR2DCONTEXTHANDLE hContext, - PVR2DFLIPCHAINHANDLE hFlipChain, - unsigned long ulPropertyMask, - long lDstXPos, - long lDstYPos, - unsigned long ulNumClipRects, - PVR2DRECT *pClipRects, - unsigned long ulSwapInterval); - -PVR2D_IMPORT -PVR2DERROR PVR2DPresentFlip(PVR2DCONTEXTHANDLE hContext, - PVR2DFLIPCHAINHANDLE hFlipChain, - PVR2DMEMINFO *psMemInfo, - long lRenderID); - -PVR2D_IMPORT -PVR2DERROR PVR2DGetAPIRev(long *lRevMajor, long *lRevMinor); - -PVR2D_IMPORT -PVR2DERROR PVR2DLoadUseCode (const PVR2DCONTEXTHANDLE hContext, const unsigned char *pUseCode, - const unsigned long UseCodeSize, PVR2D_HANDLE *pUseCodeHandle); -PVR2D_IMPORT -PVR2DERROR PVR2DFreeUseCode (const PVR2DCONTEXTHANDLE hContext, const PVR2D_HANDLE hUseCodeHandle); - -PVR2D_IMPORT -PVR2DERROR PVR2DBlt3D (const PVR2DCONTEXTHANDLE hContext, const PPVR2D_3DBLT pBlt3D); - -#ifdef __cplusplus -} -#endif - -#endif /* _PVR2D_H_ */ - -/****************************************************************************** - End of file (pvr2d.h) -******************************************************************************/ diff --git a/src/3rdparty/powervr/wsegl.h b/src/3rdparty/powervr/wsegl.h deleted file mode 100644 index 04906076a8..0000000000 --- a/src/3rdparty/powervr/wsegl.h +++ /dev/null @@ -1,240 +0,0 @@ -/****************************************************************************** - Name : wsegl.h - Copyright : Copyright (c) Imagination Technologies Limited. - This specification is protected by copyright laws and contains - material proprietary to Imagination Technologies Limited. - You may use and distribute this specification free of charge for implementing - the functionality therein, without altering or removing any trademark, copyright, - or other notice from the specification. - Platform : ANSI -*****************************************************************************/ - - -#if !defined(__WSEGL_H__) -#define __WSEGL_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* -// WSEGL Platform-specific definitions -*/ -#define WSEGL_EXPORT -#define WSEGL_IMPORT - -/* -// WSEGL API Version Number -*/ - -#define WSEGL_VERSION 1 -#define WSEGL_DEFAULT_DISPLAY 0 -#define WSEGL_DEFAULT_NATIVE_ENGINE 0 - -#define WSEGL_FALSE 0 -#define WSEGL_TRUE 1 -#define WSEGL_NULL 0 - -#define WSEGL_UNREFERENCED_PARAMETER(param) (param) = (param) - -/* -// WSEGL handles -*/ -typedef void *WSEGLDisplayHandle; -typedef void *WSEGLDrawableHandle; - -/* -// Display capability type -*/ -typedef enum WSEGLCapsType_TAG -{ - WSEGL_NO_CAPS = 0, - WSEGL_CAP_MIN_SWAP_INTERVAL = 1, /* System default value = 1 */ - WSEGL_CAP_MAX_SWAP_INTERVAL = 2, /* System default value = 1 */ - WSEGL_CAP_WINDOWS_USE_HW_SYNC = 3, /* System default value = 0 (FALSE) */ - WSEGL_CAP_PIXMAPS_USE_HW_SYNC = 4, /* System default value = 0 (FALSE) */ - -} WSEGLCapsType; - -/* -// Display capability -*/ -typedef struct WSEGLCaps_TAG -{ - WSEGLCapsType eCapsType; - unsigned long ui32CapsValue; - -} WSEGLCaps; - -/* -// Drawable type -*/ -#define WSEGL_NO_DRAWABLE 0x0 -#define WSEGL_DRAWABLE_WINDOW 0x1 -#define WSEGL_DRAWABLE_PIXMAP 0x2 - - -/* -// Pixel format of display/drawable -*/ -typedef enum WSEGLPixelFormat_TAG -{ - WSEGL_PIXELFORMAT_565 = 0, - WSEGL_PIXELFORMAT_4444 = 1, - WSEGL_PIXELFORMAT_8888 = 2, - WSEGL_PIXELFORMAT_1555 = 3 - -} WSEGLPixelFormat; - -/* -// Transparent of display/drawable -*/ -typedef enum WSEGLTransparentType_TAG -{ - WSEGL_OPAQUE = 0, - WSEGL_COLOR_KEY = 1, - -} WSEGLTransparentType; - -/* -// Display/drawable configuration -*/ -typedef struct WSEGLConfig_TAG -{ - /* - // Type of drawables this configuration applies to - - // OR'd values of drawable types. - */ - unsigned long ui32DrawableType; - - /* Pixel format */ - WSEGLPixelFormat ePixelFormat; - - /* Native Renderable - set to WSEGL_TRUE if native renderable */ - unsigned long ulNativeRenderable; - - /* FrameBuffer Level Parameter */ - unsigned long ulFrameBufferLevel; - - /* Native Visual ID */ - unsigned long ulNativeVisualID; - - /* Native Visual */ - void *hNativeVisual; - - /* Transparent Type */ - WSEGLTransparentType eTransparentType; - - /* Transparent Color - only used if transparent type is COLOR_KEY */ - unsigned long ulTransparentColor; /* packed as 0x00RRGGBB */ - - -} WSEGLConfig; - -/* -// WSEGL errors -*/ -typedef enum WSEGLError_TAG -{ - WSEGL_SUCCESS = 0, - WSEGL_CANNOT_INITIALISE = 1, - WSEGL_BAD_NATIVE_DISPLAY = 2, - WSEGL_BAD_NATIVE_WINDOW = 3, - WSEGL_BAD_NATIVE_PIXMAP = 4, - WSEGL_BAD_NATIVE_ENGINE = 5, - WSEGL_BAD_DRAWABLE = 6, - WSEGL_BAD_CONFIG = 7, - WSEGL_OUT_OF_MEMORY = 8 - -} WSEGLError; - -/* -// Drawable orientation (in degrees anti-clockwise) -*/ -typedef enum WSEGLRotationAngle_TAG -{ - WSEGL_ROTATE_0 = 0, - WSEGL_ROTATE_90 = 1, - WSEGL_ROTATE_180 = 2, - WSEGL_ROTATE_270 = 3 - -} WSEGLRotationAngle; - -/* -// Drawable information required by OpenGL-ES driver -*/ -typedef struct WSEGLDrawableParams_TAG -{ - /* Width in pixels of the drawable */ - unsigned long ui32Width; - - /* Height in pixels of the drawable */ - unsigned long ui32Height; - - /* Stride in pixels of the drawable */ - unsigned long ui32Stride; - - /* Pixel format of the drawable */ - WSEGLPixelFormat ePixelFormat; - - /* User space cpu virtual address of the drawable */ - void *pvLinearAddress; - - /* HW address of the drawable */ - unsigned long ui32HWAddress; - - /* Private data for the drawable */ - void *hPrivateData; - -} WSEGLDrawableParams; - - -/* -// Table of function pointers that is returned by WSEGL_GetFunctionTablePointer() -// -// The first entry in the table is the version number of the wsegl.h header file that -// the module has been written against, and should therefore be set to WSEGL_VERSION -*/ -typedef struct WSEGL_FunctionTable_TAG -{ - unsigned long ui32WSEGLVersion; - - WSEGLError (*pfnWSEGL_IsDisplayValid)(NativeDisplayType); - - WSEGLError (*pfnWSEGL_InitialiseDisplay)(NativeDisplayType, WSEGLDisplayHandle *, const WSEGLCaps **, WSEGLConfig **); - - WSEGLError (*pfnWSEGL_CloseDisplay)(WSEGLDisplayHandle); - - WSEGLError (*pfnWSEGL_CreateWindowDrawable)(WSEGLDisplayHandle, WSEGLConfig *, WSEGLDrawableHandle *, NativeWindowType, WSEGLRotationAngle *); - - WSEGLError (*pfnWSEGL_CreatePixmapDrawable)(WSEGLDisplayHandle, WSEGLConfig *, WSEGLDrawableHandle *, NativePixmapType, WSEGLRotationAngle *); - - WSEGLError (*pfnWSEGL_DeleteDrawable)(WSEGLDrawableHandle); - - WSEGLError (*pfnWSEGL_SwapDrawable)(WSEGLDrawableHandle, unsigned long); - - WSEGLError (*pfnWSEGL_SwapControlInterval)(WSEGLDrawableHandle, unsigned long); - - WSEGLError (*pfnWSEGL_WaitNative)(WSEGLDrawableHandle, unsigned long); - - WSEGLError (*pfnWSEGL_CopyFromDrawable)(WSEGLDrawableHandle, NativePixmapType); - - WSEGLError (*pfnWSEGL_CopyFromPBuffer)(void *, unsigned long, unsigned long, unsigned long, WSEGLPixelFormat, NativePixmapType); - - WSEGLError (*pfnWSEGL_GetDrawableParameters)(WSEGLDrawableHandle, WSEGLDrawableParams *, WSEGLDrawableParams *); - - -} WSEGL_FunctionTable; - - -WSEGL_IMPORT const WSEGL_FunctionTable *WSEGL_GetFunctionTablePointer(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __WSEGL_H__ */ - -/****************************************************************************** - End of file (wsegl.h) -******************************************************************************/ -- cgit v1.2.3 From 673ce6c84edd8792dbb2c7747c769084ff3a9132 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 29 Mar 2012 13:41:06 -0700 Subject: eglfs: Implement xlib based hook for testing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a hook implementation for X11 using xlib. This is primarily for testing. xcb is not used since the x11/egl-mesa integration appears to be done through xlib. Currently, there is no input mechanism. The size can be adjusted using EGLFS_X11_SIZE environment variable. Change-Id: Ifcfbfd958d9d110d94e22f04dfad1f6c29818103 Reviewed-by: Samuel Rødal --- src/plugins/platforms/eglfs/eglfs.pro | 4 ++ src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp | 90 ++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp diff --git a/src/plugins/platforms/eglfs/eglfs.pro b/src/plugins/platforms/eglfs/eglfs.pro index 89d56efc82..9a36cacd05 100644 --- a/src/plugins/platforms/eglfs/eglfs.pro +++ b/src/plugins/platforms/eglfs/eglfs.pro @@ -12,6 +12,10 @@ DESTDIR = $$QT.gui.plugins/platforms #Avoid X11 header collision DEFINES += MESA_EGL_NO_X11_HEADERS +#To test the hooks on x11 (xlib), comment the above define too +#EGLFS_PLATFORM_HOOKS_SOURCES += qeglfs_hooks_x11.cpp +#LIBS += -lX11 + SOURCES = main.cpp \ qeglfsintegration.cpp \ qeglfswindow.cpp \ diff --git a/src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp b/src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp new file mode 100644 index 0000000000..baba3be492 --- /dev/null +++ b/src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qeglfs_hooks.h" + +#include + +QEglFSHooks platform_hooks; +static Display *display = 0; + +void QEglFSHooks::platformInit() +{ + display = XOpenDisplay(NULL); + if (!display) + qFatal("Could not open display"); +} + +void QEglFSHooks::platformDestroy() +{ + XCloseDisplay(display); +} + +EGLNativeDisplayType QEglFSHooks::platformDisplay() const +{ + return display; +} + +QSize QEglFSHooks::screenSize() const +{ + QList env = qgetenv("EGLFS_X11_SIZE").split('x'); + if (env.length() != 2) + return QSize(640, 480); + return QSize(env.at(0).toInt(), env.at(1).toInt()); +} + +EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) +{ + Window root = DefaultRootWindow(display); + XSetWindowAttributes swa; + memset(&swa, 0, sizeof(swa)); + Window win = XCreateWindow(display, root, 0, 0, size.width(), size.height(), 0, CopyFromParent, + InputOutput, CopyFromParent, CWEventMask, &swa); + XMapWindow(display, win); + XStoreName(display, win, "EGLFS"); + return win; +} + +void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) +{ + XDestroyWindow(display, window); +} + -- cgit v1.2.3 From 2756101d0e3b2a044e3e13a53421512c86dc5ba5 Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Sun, 8 Apr 2012 15:50:02 +0200 Subject: Fixed build issue when using GLEW with MSVC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MSVC does not support the #warning precompiler command and is considered an error when used. This change checks for GCC before issuing the warning. Change-Id: Iee1e27841fe77b0289e88b7b4ccaa176ab56a39d Reviewed-by: Samuel Rødal --- src/gui/kernel/qopenglcontext.h | 2 ++ src/gui/opengl/qopenglfunctions.h | 2 ++ src/opengl/qglfunctions.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h index 52f94a8a10..2dc4357b00 100644 --- a/src/gui/kernel/qopenglcontext.h +++ b/src/gui/kernel/qopenglcontext.h @@ -51,9 +51,11 @@ #include #ifdef __GLEW_H__ +#if defined(Q_CC_GNU) #warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined #warning To use GLEW with Qt, do not include or after glew.h #endif +#endif #include diff --git a/src/gui/opengl/qopenglfunctions.h b/src/gui/opengl/qopenglfunctions.h index 4e778dda66..be366a79c8 100644 --- a/src/gui/opengl/qopenglfunctions.h +++ b/src/gui/opengl/qopenglfunctions.h @@ -45,9 +45,11 @@ #ifndef QT_NO_OPENGL #ifdef __GLEW_H__ +#if defined(Q_CC_GNU) #warning qopenglfunctions.h is not compatible with GLEW, GLEW defines will be undefined #warning To use GLEW with Qt, do not include or after glew.h #endif +#endif #include #include diff --git a/src/opengl/qglfunctions.h b/src/opengl/qglfunctions.h index da3ce7db4d..0cb0b712ba 100644 --- a/src/opengl/qglfunctions.h +++ b/src/opengl/qglfunctions.h @@ -43,9 +43,11 @@ #define QGLFUNCTIONS_H #ifdef __GLEW_H__ +#if defined(Q_CC_GNU) #warning qglfunctions.h is not compatible with GLEW, GLEW defines will be undefined #warning To use GLEW with Qt, do not include or after glew.h #endif +#endif #include #include -- cgit v1.2.3 From 00f3299e8b499e323c3e3d9552d518a872a0695a Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Fri, 30 Mar 2012 14:16:55 +0200 Subject: Blackberry OS implementation of QStandardPaths Change-Id: I31427b896ca691de7071da17af4863d16348df7b Reviewed-by: David Faure Reviewed-by: Robin Burchell --- src/corelib/io/io.pri | 2 + src/corelib/io/qstandardpaths_blackberry.cpp | 103 +++++++++++++++++++++ .../io/qstandardpaths/tst_qstandardpaths.cpp | 6 +- 3 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 src/corelib/io/qstandardpaths_blackberry.cpp diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index 29599295ad..d24ea667b2 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -106,6 +106,8 @@ win32 { SOURCES += io/qstandardpaths_mac.cpp } else:standardpathsjson { SOURCES += io/qstandardpaths_json.cpp + } else:blackberry { + SOURCES += io/qstandardpaths_blackberry.cpp } else { SOURCES += io/qstandardpaths_unix.cpp } diff --git a/src/corelib/io/qstandardpaths_blackberry.cpp b/src/corelib/io/qstandardpaths_blackberry.cpp new file mode 100644 index 0000000000..b4c036dcc7 --- /dev/null +++ b/src/corelib/io/qstandardpaths_blackberry.cpp @@ -0,0 +1,103 @@ +/*************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qstandardpaths.h" +#include + +#ifndef QT_NO_STANDARDPATHS + +QT_BEGIN_NAMESPACE + +QString QStandardPaths::writableLocation(StandardLocation type) +{ + QDir sharedDir = QDir::home(); + sharedDir.cd(QLatin1String("../shared")); + + const QString sharedRoot = sharedDir.absolutePath(); + + switch (type) { + case DataLocation: + case DesktopLocation: + case HomeLocation: + return QDir::homePath(); + case RuntimeLocation: + case TempLocation: + return QDir::tempPath(); + case CacheLocation: + case GenericCacheLocation: + return QDir::homePath() + QLatin1String("/Cache"); + case ConfigLocation: + return QDir::homePath() + QLatin1String("/Settings"); + case GenericDataLocation: + return sharedRoot + QLatin1String("/misc"); + case DocumentsLocation: + return sharedRoot + QLatin1String("/documents"); + case PicturesLocation: + return sharedRoot + QLatin1String("/photos"); + case FontsLocation: + // this is not a writable location + return QString(); + case MusicLocation: + return sharedRoot + QLatin1String("/music"); + case MoviesLocation: + return sharedRoot + QLatin1String("/videos"); + case DownloadLocation: + return sharedRoot + QLatin1String("/downloads"); + case ApplicationsLocation: + return QString(); + default: + break; + } + + return QString(); +} + +QStringList QStandardPaths::standardLocations(StandardLocation type) +{ + if (type == FontsLocation) + return QStringList(QLatin1String("/base/usr/fonts")); + + return QStringList(writableLocation(type)); +} + +QT_END_NAMESPACE + +#endif // QT_NO_STANDARDPATHS diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp index e9af29494b..b15d5fca2c 100644 --- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp +++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp @@ -49,7 +49,7 @@ #include #endif -#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) +#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC) && !defined(Q_OS_BLACKBERRY) #define Q_XDG_PLATFORM #endif @@ -186,12 +186,16 @@ void tst_qstandardpaths::testDataLocation() { // On all platforms, DataLocation should be GenericDataLocation / organization name / app name // This allows one app to access the data of another app. + // Blackberry OS is an exception to this case, owing to the fact that + // applications are sandboxed. +#ifndef Q_OS_BLACKBERRY const QString base = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); QCOMPARE(QStandardPaths::writableLocation(QStandardPaths::DataLocation), base + "/tst_qstandardpaths"); QCoreApplication::instance()->setOrganizationName("Qt"); QCOMPARE(QStandardPaths::writableLocation(QStandardPaths::DataLocation), base + "/Qt/tst_qstandardpaths"); QCoreApplication::instance()->setApplicationName("QtTest"); QCOMPARE(QStandardPaths::writableLocation(QStandardPaths::DataLocation), base + "/Qt/QtTest"); +#endif #ifdef Q_XDG_PLATFORM setDefaultLocations(); -- cgit v1.2.3 From efdadbb3d6413c909dc0c7d6c0f3713684c671c6 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 9 Apr 2012 16:52:02 -0700 Subject: Remove unused signal QWindow::backBufferReady MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit backBufferReady is not used anywhere Change-Id: Ic5c8f6a89e031b3bd757b03f60737d55be969ee5 Reviewed-by: Jørgen Lind Reviewed-by: Gunnar Sletta Reviewed-by: Samuel Rødal --- src/gui/kernel/qwindow.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h index 711761e5e0..315c403d20 100644 --- a/src/gui/kernel/qwindow.h +++ b/src/gui/kernel/qwindow.h @@ -254,7 +254,6 @@ public Q_SLOTS: } Q_SIGNALS: - void backBufferReady(); void screenChanged(QScreen *screen); void windowModalityChanged(Qt::WindowModality windowModality); -- cgit v1.2.3 From 5a02c2115c2522847ac3388e2719de6876166e03 Mon Sep 17 00:00:00 2001 From: Andrew den Exter Date: Wed, 4 Apr 2012 15:34:09 +1000 Subject: Fix crash with invalid pre-edit position. Ensure the script item position is within the bounds of the text block when adjusted to compensate for pre-edit text. Change-Id: I2c745bf08afc0d9bc3aba27c24c2a123af017dc6 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 7d366275a3..e36104370c 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2185,7 +2185,7 @@ int QTextEngine::formatIndex(const QScriptItem *si) const int pos = si->position; if (specialData && si->position >= specialData->preeditPosition) { if (si->position < specialData->preeditPosition + specialData->preeditText.length()) - pos = qMax(specialData->preeditPosition - 1, 0); + pos = qMax(qMin(block.length(), specialData->preeditPosition) - 1, 0); else pos -= specialData->preeditText.length(); } -- cgit v1.2.3 From a159ca80d73f07d617d6edd9b3e59bda25449a1c Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Thu, 22 Mar 2012 17:12:32 +0100 Subject: Don't hardcode the default families in qfont_qpa.cpp Since different platforms come with different fonts, we should probably leave it up to the platform to decide which family to use. Change-Id: I18bb81c0ce87cc7e9ac7f3abaeae1b41c0ce8410 Reviewed-by: Friedemann Kleint Reviewed-by: Jiang Jiang --- src/gui/text/qfont_qpa.cpp | 35 +++---------- src/gui/text/qfontdatabase.h | 5 -- .../fontconfig/qfontconfigdatabase.cpp | 7 +++ .../platforms/windows/qwindowsfontdatabase.cpp | 26 ++++++++++ .../platforms/windows/qwindowsfontdatabase_ft.cpp | 25 +++++++++ tests/auto/gui/text/qfont/tst_qfont.cpp | 60 +++++++++++++++------- 6 files changed, 106 insertions(+), 52 deletions(-) diff --git a/src/gui/text/qfont_qpa.cpp b/src/gui/text/qfont_qpa.cpp index 6576f237c4..b73b03025b 100644 --- a/src/gui/text/qfont_qpa.cpp +++ b/src/gui/text/qfont_qpa.cpp @@ -75,35 +75,12 @@ void QFont::setRawName(const QString &) QString QFont::defaultFamily() const { - QString familyName; - switch(d->request.styleHint) { - case QFont::SansSerif: - familyName = QString::fromLatin1("sans-serif"); - break; - case QFont::Serif: - familyName = QString::fromLatin1("serif"); - break; - case QFont::TypeWriter: - case QFont::Monospace: - familyName = QString::fromLatin1("monospace"); - break; - case QFont::Cursive: - familyName = QString::fromLatin1("cursive"); - break; - case QFont::Fantasy: - familyName = QString::fromLatin1("fantasy"); - break; - case QFont::Decorative: - familyName = QString::fromLatin1("decorative"); - break; - case QFont::System: - default: - familyName = QString(); - break; - } - - return QGuiApplicationPrivate::platformIntegration()->fontDatabase()->resolveFontFamilyAlias(familyName); - + QPlatformFontDatabase *fontDB = QGuiApplicationPrivate::platformIntegration()->fontDatabase(); + const QStringList fallbacks = fontDB->fallbacksForFamily(QString(), QFont::StyleNormal + , QFont::StyleHint(d->request.styleHint), QUnicodeTables::Common); + if (!fallbacks.isEmpty()) + return fallbacks.first(); + return QString(); } QString QFont::lastResortFamily() const diff --git a/src/gui/text/qfontdatabase.h b/src/gui/text/qfontdatabase.h index b30f7da48d..f0830f2a41 100644 --- a/src/gui/text/qfontdatabase.h +++ b/src/gui/text/qfontdatabase.h @@ -46,8 +46,6 @@ #include #include -class tst_QFont; - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -162,9 +160,6 @@ private: friend class QFontEngineMultiXLFD; friend class QFontEngineMultiQWS; friend class QFontEngineMultiQPA; -#ifdef QT_BUILD_INTERNAL - friend class ::tst_QFont; -#endif QFontDatabasePrivate *d; }; diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index bf05433b22..9ad9b96d15 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -291,8 +291,15 @@ static const char *getFcFamilyForStyleHint(const QFont::StyleHint style) stylehint = "serif"; break; case QFont::TypeWriter: + case QFont::Monospace: stylehint = "monospace"; break; + case QFont::Cursive: + stylehint = "cursive"; + break; + case QFont::Fantasy: + stylehint = "fantasy"; + break; default: break; } diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp index c1c25dd686..3fc40f49ac 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp @@ -698,6 +698,32 @@ QStringList QWindowsFontDatabase::fallbacksForFamily(const QString family, const QStringList result = QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script); if (!result.isEmpty()) return result; + + switch (styleHint) { + case QFont::Times: + result << QString::fromLatin1("Times New Roman"); + break; + case QFont::Courier: + result << QString::fromLatin1("Courier New"); + break; + case QFont::Monospace: + result << QString::fromLatin1("Courier New"); + break; + case QFont::Cursive: + result << QString::fromLatin1("Comic Sans MS"); + break; + case QFont::Fantasy: + result << QString::fromLatin1("Impact"); + break; + case QFont::Decorative: + result << QString::fromLatin1("Old English"); + break; + case QFont::Helvetica: + case QFont::System: + default: + result << QString::fromLatin1("Arial"); + } + if (QWindowsContext::verboseFonts) qDebug() << __FUNCTION__ << family << style << styleHint << script << result << m_families.size(); diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp index e84f0c7630..246b5b3710 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp @@ -422,6 +422,31 @@ QStringList QWindowsFontDatabaseFT::fallbacksForFamily(const QString family, con QStringList result = QPlatformFontDatabase::fallbacksForFamily(family, style, styleHint, script); if (!result.isEmpty()) return result; + + switch (styleHint) { + case QFont::Times: + result << QString::fromLatin1("Times New Roman"); + break; + case QFont::Courier: + result << QString::fromLatin1("Courier New"); + break; + case QFont::Monospace: + result << QString::fromLatin1("Courier New"); + break; + case QFont::Cursive: + result << QString::fromLatin1("Comic Sans MS"); + break; + case QFont::Fantasy: + result << QString::fromLatin1("Impact"); + break; + case QFont::Decorative: + result << QString::fromLatin1("Old English"); + break; + case QFont::Helvetica: + case QFont::System: + default: + result << QString::fromLatin1("Arial"); + } if (QWindowsContext::verboseFonts) qDebug() << __FUNCTION__ << family << style << styleHint << script << result << m_families; diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp index 1cedfa5c01..ea26b9262b 100644 --- a/tests/auto/gui/text/qfont/tst_qfont.cpp +++ b/tests/auto/gui/text/qfont/tst_qfont.cpp @@ -75,10 +75,8 @@ private slots: void serializeSpacing(); void lastResortFont(); void styleName(); -#ifdef QT_BUILD_INTERNAL void defaultFamily_data(); void defaultFamily(); -#endif }; // Testing get/set functions @@ -623,36 +621,62 @@ void tst_QFont::styleName() #endif } -#ifdef QT_BUILD_INTERNAL +QString getPlatformGenericFont(const char* genericName) +{ +#if defined(Q_OS_UNIX) && !defined(QT_NO_FONTCONFIG) + QProcess p; + p.start(QLatin1String("fc-match"), (QStringList() << "-f%{family}" << genericName)); + if (!p.waitForStarted()) + qWarning("fc-match cannot be started: %s", qPrintable(p.errorString())); + if (p.waitForFinished()) + return QString::fromLatin1(p.readAllStandardOutput()); +#endif + return QLatin1String(genericName); +} + +static inline QByteArray msgNotAcceptableFont(const QString &defaultFamily, const QStringList &acceptableFamilies) +{ + QString res = QString::fromLatin1("Font family '%1' is not one of the following accaptable results: ").arg(defaultFamily); + Q_FOREACH (const QString &family, acceptableFamilies) + res += QString::fromLatin1("\n %1").arg(family); + return res.toLocal8Bit(); +} + Q_DECLARE_METATYPE(QFont::StyleHint) void tst_QFont::defaultFamily_data() { QTest::addColumn("styleHint"); - QTest::addColumn("defaultFamily"); - - QTest::newRow("serif") << QFont::Times << "serif"; - QTest::newRow("monospace") << QFont::Monospace << "monospace"; - QTest::newRow("sans-serif") << QFont::SansSerif << "sans-serif"; - QTest::newRow("cursive") << QFont::Cursive << "cursive"; - QTest::newRow("fantasy") << QFont::Fantasy << "fantasy"; - QTest::newRow("old english") << QFont::OldEnglish << "Old English"; + QTest::addColumn("acceptableFamilies"); + + QTest::newRow("serif") << QFont::Serif << (QStringList() << "Times New Roman" << "Times" << getPlatformGenericFont("serif")); + QTest::newRow("monospace") << QFont::Monospace << (QStringList() << "Courier New" << "Monaco" << getPlatformGenericFont("monospace")); + QTest::newRow("cursive") << QFont::Cursive << (QStringList() << "Comic Sans MS" << "Apple Chancery" << getPlatformGenericFont("cursive")); + QTest::newRow("fantasy") << QFont::Fantasy << (QStringList() << "Impact" << "Zapfino" << getPlatformGenericFont("fantasy")); + QTest::newRow("sans-serif") << QFont::SansSerif << (QStringList() << "Arial" << "Lucida Grande" << getPlatformGenericFont("sans-serif")); } void tst_QFont::defaultFamily() { QFETCH(QFont::StyleHint, styleHint); - QFETCH(QString, defaultFamily); - - QFontDatabase db; - if (!db.hasFamily(defaultFamily)) - QSKIP("Font family is not available on the system"); + QFETCH(QStringList, acceptableFamilies); QFont f; + QFontDatabase db; f.setStyleHint(styleHint); - QCOMPARE(QFontDatabase::resolveFontFamilyAlias(f.defaultFamily()), QFontDatabase::resolveFontFamilyAlias(defaultFamily)); + const QString familyForHint(f.defaultFamily()); + // it should at least return a family that is available. + QVERIFY(db.hasFamily(familyForHint)); + + bool isAcceptable = false; + Q_FOREACH (const QString& family, acceptableFamilies) { + if (!familyForHint.compare(family, Qt::CaseInsensitive)) { + isAcceptable = true; + break; + } + } + QVERIFY2(isAcceptable, msgNotAcceptableFont(familyForHint, acceptableFamilies)); } -#endif // QT_BUILD_INTERNAL QTEST_MAIN(tst_QFont) #include "tst_qfont.moc" -- cgit v1.2.3 From ef4783d2978ec5edf1b90ef5a13467c6c9ee3df6 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Fri, 30 Mar 2012 14:23:36 +0300 Subject: Make it possible to enable non-scalable font scaling Windows native font engine supports scaling of non-scalalble fonts, so make it possible to do so. Added two functions to QPlatformFontDatabase: fontsAlwaysScalable() and standardSizes(), and made fontsAlwaysScalable() to return true for Windows native font database. Windows Freetype font engine doesn't seem to support scaling of non-scalable fonts, so didn't enable it in there. Added implementation of standardSizes() for Mac OS. Task-number: QTBUG-24970 Change-Id: I41c9356ede8a37b7c61db94340dbeb5b629f34b9 Reviewed-by: Friedemann Kleint Reviewed-by: Bradley T. Hughes Reviewed-by: Jiang Jiang --- src/gui/text/qfontdatabase.cpp | 22 ++++++++-------- src/gui/text/qfontdatabase_qpa.cpp | 6 +++-- src/gui/text/qplatformfontdatabase_qpa.cpp | 29 ++++++++++++++++++++++ src/gui/text/qplatformfontdatabase_qpa.h | 2 ++ .../fontdatabases/mac/qcoretextfontdatabase.mm | 11 ++++++++ .../fontdatabases/mac/qcoretextfontdatabase_p.h | 2 ++ .../platforms/windows/qwindowsfontdatabase.cpp | 5 ++++ .../platforms/windows/qwindowsfontdatabase.h | 2 ++ 8 files changed, 67 insertions(+), 12 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 468d029cf2..a1af856992 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -735,12 +735,13 @@ static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDe fontDef->family += QLatin1Char(']'); } - if (desc.style->smoothScalable) + if (desc.style->smoothScalable + || QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fontsAlwaysScalable() + || (desc.style->bitmapScalable && (request.styleStrategy & QFont::PreferMatch))) { fontDef->pixelSize = request.pixelSize; - else if ((desc.style->bitmapScalable && (request.styleStrategy & QFont::PreferMatch))) - fontDef->pixelSize = request.pixelSize; - else + } else { fontDef->pixelSize = desc.size->pixelSize; + } fontDef->styleHint = request.styleHint; fontDef->styleStrategy = request.styleStrategy; @@ -1534,6 +1535,9 @@ bool QFontDatabase::isScalable(const QString &family, QList QFontDatabase::pointSizes(const QString &family, const QString &styleName) { + if (QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fontsAlwaysScalable()) + return standardSizes(); + bool smoothScalable = false; QString familyName, foundryName; parseFontName(family, foundryName, familyName); @@ -1634,6 +1638,9 @@ QFont QFontDatabase::font(const QString &family, const QString &style, QList QFontDatabase::smoothSizes(const QString &family, const QString &styleName) { + if (QGuiApplicationPrivate::platformIntegration()->fontDatabase()->fontsAlwaysScalable()) + return standardSizes(); + bool smoothScalable = false; QString familyName, foundryName; parseFontName(family, foundryName, familyName); @@ -1689,12 +1696,7 @@ QList QFontDatabase::smoothSizes(const QString &family, */ QList QFontDatabase::standardSizes() { - QList ret; - static const unsigned short standard[] = - { 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72, 0 }; - const unsigned short *sizes = standard; - while (*sizes) ret << *sizes++; - return ret; + return QGuiApplicationPrivate::platformIntegration()->fontDatabase()->standardSizes(); } diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index 0014efc450..c2a3aa9722 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -161,9 +161,12 @@ QFontEngine *loadSingleEngine(int script, Q_UNUSED(foundry); Q_ASSERT(size); + QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase(); int pixelSize = size->pixelSize; - if (!pixelSize || (style->smoothScalable && pixelSize == SMOOTH_SCALABLE)) + if (!pixelSize || (style->smoothScalable && pixelSize == SMOOTH_SCALABLE) + || pfdb->fontsAlwaysScalable()) { pixelSize = request.pixelSize; + } QFontDef def = request; def.pixelSize = pixelSize; @@ -171,7 +174,6 @@ QFontEngine *loadSingleEngine(int script, QFontCache::Key key(def,script); QFontEngine *engine = QFontCache::instance()->findEngine(key); if (!engine) { - QPlatformFontDatabase *pfdb = QGuiApplicationPrivate::platformIntegration()->fontDatabase(); engine = pfdb->fontEngine(def,QUnicodeTables::Script(script),size->handle); if (engine) { QFontCache::Key key(def,script); diff --git a/src/gui/text/qplatformfontdatabase_qpa.cpp b/src/gui/text/qplatformfontdatabase_qpa.cpp index 6af0398f00..f6d82802f7 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.cpp +++ b/src/gui/text/qplatformfontdatabase_qpa.cpp @@ -384,6 +384,35 @@ QString QPlatformFontDatabase::resolveFontFamilyAlias(const QString &family) con return family; } +/*! + Return true if all fonts are considered scalable when using this font database. + Defaults to false. + + \since 5.0 + */ + +bool QPlatformFontDatabase::fontsAlwaysScalable() const +{ + return false; +} + +/*! + Return list of standard font sizes when using this font database. + + \since 5.0 + */ + + QList QPlatformFontDatabase::standardSizes() const +{ + QList ret; + static const unsigned short standard[] = + { 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72, 0 }; + ret.reserve(int(sizeof(standard) / sizeof(standard[0]))); + const unsigned short *sizes = standard; + while (*sizes) ret << *sizes++; + return ret; +} + /*! \class QPlatformFontDatabase \brief The QPlatformFontDatabase class makes it possible to customize how fonts diff --git a/src/gui/text/qplatformfontdatabase_qpa.h b/src/gui/text/qplatformfontdatabase_qpa.h index 3810b75dbf..9fe3b0380d 100644 --- a/src/gui/text/qplatformfontdatabase_qpa.h +++ b/src/gui/text/qplatformfontdatabase_qpa.h @@ -102,6 +102,8 @@ public: virtual QFont defaultFont() const; virtual QString resolveFontFamilyAlias(const QString &family) const; + virtual bool fontsAlwaysScalable() const; + virtual QList standardSizes() const; //callback static void registerQPF2Font(const QByteArray &dataArray, void *handle); diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index c42320889a..4063a9ec91 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -393,5 +393,16 @@ QFont QCoreTextFontDatabase::defaultFont() const return QFont(defaultFontName); } +QList QCoreTextFontDatabase::standardSizes() const +{ + QList ret; + static const unsigned short standard[] = + { 9, 10, 11, 12, 13, 14, 18, 24, 36, 48, 64, 72, 96, 144, 288, 0 }; + ret.reserve(int(sizeof(standard) / sizeof(standard[0]))); + const unsigned short *sizes = standard; + while (*sizes) ret << *sizes++; + return ret; +} + QT_END_NAMESPACE diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h index adcfeebf0b..556b176b07 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h @@ -58,6 +58,8 @@ public: QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName); void releaseHandle(void *handle); QFont defaultFont() const; + QList standardSizes() const; + private: mutable QString defaultFontName; QHash fallbackLists; diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp index 3fc40f49ac..979b2a028b 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp @@ -900,6 +900,11 @@ QString QWindowsFontDatabase::fontDir() const return result; } +bool QWindowsFontDatabase::fontsAlwaysScalable() const +{ + return true; +} + HFONT QWindowsFontDatabase::systemFont() { static const HFONT stock_sysfont = (HFONT)GetStockObject(SYSTEM_FONT); diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.h b/src/plugins/platforms/windows/qwindowsfontdatabase.h index 2fa615253e..3921992775 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase.h +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.h @@ -86,6 +86,8 @@ public: virtual QString fontDir() const; virtual QFont defaultFont() const { return systemDefaultFont(); } + virtual bool fontsAlwaysScalable() const; + static QFont systemDefaultFont(); static QFontEngine *createEngine(int script, const QFontDef &request, -- cgit v1.2.3 From a86923459383b7c501044212908031191cfd8957 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 10 Apr 2012 21:56:45 +1000 Subject: Remove Qt5 to-do comments in qtextformat.cpp. These won't be done for Qt 5.0 and to-do tasks really belong in a bug-tracker not in the code. Task-number: QTBUG-25072 Change-Id: Ife4ff148167e0f0c66a58233548f4011b0b10784 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextformat.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index a7e68a41c2..9a38b1f0b2 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -3010,7 +3010,6 @@ QTextImageFormat::QTextImageFormat(const QTextFormat &fmt) */ -// ### Qt5 qreal replace with a QTextLength /*! \fn qreal QTextImageFormat::width() const @@ -3029,7 +3028,6 @@ QTextImageFormat::QTextImageFormat(const QTextFormat &fmt) */ -// ### Qt5 qreal replace with a QTextLength /*! \fn qreal QTextImageFormat::height() const -- cgit v1.2.3 From 2dca19b44ebb3b3e94bb08be1e347cafe107a7be Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 9 Apr 2012 14:20:09 +0200 Subject: Document QEvent::ThreadChange That event is mentioned in the documentation of QObject::moveToThread, but not in the documentation of QEvent::Type Task-number: QTBUG-16787 Change-Id: Iab769307d3de54881a82e59bed63b3831a3ffb29 Reviewed-by: Geir Vattekar --- src/corelib/kernel/qcoreevent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 032590fa7f..f8aa001410 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -203,6 +203,7 @@ QT_BEGIN_NAMESPACE \value OkRequest Ok button in decoration pressed. Supported only for Windows CE. \value TabletEnterProximity Wacom tablet enter proximity event (QTabletEvent), sent to QApplication. \value TabletLeaveProximity Wacom tablet leave proximity event (QTabletEvent), sent to QApplication. + \value ThreadChange The object is moved to another thread. This is the last event sent to this object in the previous thread. See QObject::moveToThread(). \value Timer Regular timer events (QTimerEvent). \value ToolBarChange The toolbar button is toggled on Mac OS X. \value ToolTip A tooltip was requested (QHelpEvent). @@ -265,7 +266,6 @@ QT_BEGIN_NAMESPACE \omitvalue ShowWindowRequest \omitvalue Speech \omitvalue Style - \omitvalue ThreadChange \omitvalue ZeroTimerEvent \omitvalue ApplicationActivated \omitvalue ApplicationDeactivated -- cgit v1.2.3 From 933a1d227486a7a25361b0011905cc2dd1a48a00 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 10 Apr 2012 14:56:08 +0300 Subject: remove CODEC_FOR_C_STRINGS leftovers Change-Id: Iaafb945882e3f6ad6d39f7eefb62b83ff50a9ba8 Reviewed-by: Robin Burchell --- src/corelib/tools/qchar.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp index 0261843a3a..6efd9f20af 100644 --- a/src/corelib/tools/qchar.cpp +++ b/src/corelib/tools/qchar.cpp @@ -50,19 +50,12 @@ #include "qchar.h" #include "qdatastream.h" -#include "qtextcodec.h" #include "qunicodetables_p.h" #include "qunicodetables.cpp" QT_BEGIN_NAMESPACE -#ifndef QT_NO_CODEC_FOR_C_STRINGS -# ifdef QT_NO_TEXTCODEC -# define QT_NO_CODEC_FOR_C_STRINGS -# endif -#endif - #define FLAG(x) (1 << (x)) /*! @@ -71,8 +64,7 @@ QT_BEGIN_NAMESPACE \ingroup string-processing - This class is only useful to avoid the codec for C strings business - in the QChar(ch) constructor. You can avoid it by writing QChar(ch, 0). + This class is only useful to construct a QChar with 8-bit character. \sa QChar, QLatin1String, QString */ -- cgit v1.2.3 From d60d98450ada232fc3e8d0c5762a2b7a90beb921 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 6 Apr 2012 01:05:45 -0700 Subject: Save configuration feedback into config.summary Scrolling the configure output to locate the build configuration is painful. So save it in config.summary. Change-Id: I40a2f7628e9a2b91a8ea44619dd49c00d5a61561 Reviewed-by: Oswald Buddenhagen --- configure | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configure b/configure index e782f2389d..6ed696950b 100755 --- a/configure +++ b/configure @@ -5836,6 +5836,7 @@ fi #------------------------------------------------------------------------------- # give feedback on configuration #------------------------------------------------------------------------------- +exec 3>&1 1>$outpath/config.summary # redirect output temporarily to config.summary case "$COMPILER" in g++*) @@ -6045,6 +6046,10 @@ if [ "$CFG_OPENSSL" = "linked" ] && [ "$OPENSSL_LIBS" = "" ]; then echo " OPENSSL_LIBS='-L/opt/ssl/lib -lssl -lcrypto' ./configure -openssl-linked" echo fi + +exec 1>&3 3>&- # restore stdout +cat $outpath/config.summary # display config feedback to user + if [ "$BUILD_ON_MAC" = "yes" ] && [ "$CFG_FRAMEWORK" = "yes" ] && [ "$CFG_DEBUG" = "yes" ] && [ "$CFG_DEBUG_RELEASE" = "no" ]; then echo echo "Error: debug-only framework builds are not supported. Configure with -no-framework" -- cgit v1.2.3 From d1502057d817843478937783a36829cbc521b6a2 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Tue, 10 Apr 2012 16:29:02 +0200 Subject: fix mingw detection Change-Id: I7eb78ebd79bfc1be36cc43a1f41f4e574b063aed Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/accessible/accessible.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/accessible/accessible.pri b/src/plugins/platforms/windows/accessible/accessible.pri index 3069c2dda3..1a409cb87e 100644 --- a/src/plugins/platforms/windows/accessible/accessible.pri +++ b/src/plugins/platforms/windows/accessible/accessible.pri @@ -8,7 +8,7 @@ HEADERS += \ $$PWD/qwindowsaccessibility.h \ $$PWD/comutils.h -!*g++: { +!win32-g++*: { SOURCES += $$PWD/iaccessible2.cpp HEADERS += $$PWD/iaccessible2.h include(../../../../3rdparty/iaccessible2/iaccessible2.pri) -- cgit v1.2.3 From 766498083a4d3f1db28604ea5d5f0da613f3839b Mon Sep 17 00:00:00 2001 From: Jan-Arve Saether Date: Tue, 10 Apr 2012 14:52:21 +0200 Subject: Add missing virtual destructor. Change-Id: I94ac82ad4771b2b4c36ac24cc412fa43a0d77afb Reviewed-by: Mark Brand --- src/plugins/platforms/windows/accessible/iaccessible2.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.h b/src/plugins/platforms/windows/accessible/iaccessible2.h index 9b8a1ad3a6..b33562a900 100644 --- a/src/plugins/platforms/windows/accessible/iaccessible2.h +++ b/src/plugins/platforms/windows/accessible/iaccessible2.h @@ -310,6 +310,8 @@ struct AccessibleRelation : public IAccessibleRelation } + virtual ~AccessibleRelation() {} + /* IUnknown */ HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, LPVOID *iface) { -- cgit v1.2.3 From 880cbf602701b0116ca1143d6d07ee8e7eb3f03f Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Mon, 2 Apr 2012 22:17:36 +1000 Subject: Bump some Qt 5 to-do's to Qt 6. Source-incompatible changes are no longer desirable for Qt 5, so these items must wait until at least Qt 6. Task-number: QTBUG-23524 Change-Id: I0b9ae5f6f3a792e0169a4b0d3aefbdcb744acd2f Reviewed-by: Thiago Macieira Reviewed-by: Lars Knoll --- src/corelib/global/qlibraryinfo.h | 2 +- src/corelib/global/qnamespace.h | 2 +- src/corelib/io/qfileinfo.cpp | 2 +- src/corelib/io/qiodevice.h | 2 +- src/corelib/io/qsettings.h | 4 ++-- src/corelib/tools/qbytearray.h | 2 +- src/corelib/tools/qline.h | 2 +- src/widgets/dialogs/qwizard.h | 2 +- src/widgets/styles/qstyle.h | 6 +++--- src/widgets/widgets/qcombobox.h | 2 +- src/widgets/widgets/qdockwidget.h | 2 +- src/widgets/widgets/qstatusbar.h | 2 +- tests/auto/xml/dom/qdom/tst_qdom.cpp | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h index d180e63198..5666afbad8 100644 --- a/src/corelib/global/qlibraryinfo.h +++ b/src/corelib/global/qlibraryinfo.h @@ -88,7 +88,7 @@ public: #endif SettingsPath = 100 }; - static QString location(LibraryLocation); // ### Qt 5: consider renaming it to path() + static QString location(LibraryLocation); // ### Qt 6: consider renaming it to path() #ifdef QT_BUILD_QMAKE static QString rawLocation(LibraryLocation); #endif diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 4ea62c77a6..fa13bedab6 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -153,7 +153,7 @@ public: NoButton = 0x00000000, LeftButton = 0x00000001, RightButton = 0x00000002, - MidButton = 0x00000004, // ### Qt 5: remove me + MidButton = 0x00000004, // ### Qt 6: remove me MiddleButton = MidButton, XButton1 = 0x00000008, BackButton = XButton1, diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 044c71d00a..1805e759ab 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -830,7 +830,7 @@ QString QFileInfo::suffix() const QDir QFileInfo::dir() const { Q_D(const QFileInfo); - // ### Qt5: Maybe rename this to parentDirectory(), considering what it actually do? + // ### Qt 6: Maybe rename this to parentDirectory(), considering what it actually does? return QDir(d->fileEntry.path()); } diff --git a/src/corelib/io/qiodevice.h b/src/corelib/io/qiodevice.h index eba408b285..8e39f9ccd7 100644 --- a/src/corelib/io/qiodevice.h +++ b/src/corelib/io/qiodevice.h @@ -102,7 +102,7 @@ public: virtual bool open(OpenMode mode); virtual void close(); - // ### Qt 5: pos() and seek() should not be virtual, and + // ### Qt 6: pos() and seek() should not be virtual, and // ### seek() should call a virtual seekData() function. virtual qint64 pos() const; virtual qint64 size() const; diff --git a/src/corelib/io/qsettings.h b/src/corelib/io/qsettings.h index a4bb8349a8..ca3fe245ea 100644 --- a/src/corelib/io/qsettings.h +++ b/src/corelib/io/qsettings.h @@ -173,8 +173,8 @@ public: static void setDefaultFormat(Format format); static Format defaultFormat(); - static void setSystemIniPath(const QString &dir); // ### remove in 5.0 (use setPath() instead) - static void setUserIniPath(const QString &dir); // ### remove in 5.0 (use setPath() instead) + static void setSystemIniPath(const QString &dir); // ### Qt 6: remove (use setPath() instead) + static void setUserIniPath(const QString &dir); // ### Qt 6: remove (use setPath() instead) static void setPath(Format format, Scope scope, const QString &path); typedef QMap SettingsMap; diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index 7711d7349e..dd35fcd9bc 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -339,7 +339,7 @@ public: QByteArray &setNum(qulonglong, int base = 10); QByteArray &setNum(float, char f = 'g', int prec = 6); QByteArray &setNum(double, char f = 'g', int prec = 6); - QByteArray &setRawData(const char *a, uint n); // ### Qt 5: use an int + QByteArray &setRawData(const char *a, uint n); // ### Qt 6: use an int static QByteArray number(int, int base = 10); static QByteArray number(uint, int base = 10); diff --git a/src/corelib/tools/qline.h b/src/corelib/tools/qline.h index 92ea4ea426..f2e0d4380a 100644 --- a/src/corelib/tools/qline.h +++ b/src/corelib/tools/qline.h @@ -245,7 +245,7 @@ public: QLineF unitVector() const; Q_DECL_CONSTEXPR inline QLineF normalVector() const; - // ### Qt 5: rename intersects() or intersection() and rename IntersectType IntersectionType + // ### Qt 6: rename intersects() or intersection() and rename IntersectType IntersectionType IntersectType intersect(const QLineF &l, QPointF *intersectionPoint) const; qreal angle(const QLineF &l) const; diff --git a/src/widgets/dialogs/qwizard.h b/src/widgets/dialogs/qwizard.h index caa9d5e648..c9d791653b 100644 --- a/src/widgets/dialogs/qwizard.h +++ b/src/widgets/dialogs/qwizard.h @@ -130,7 +130,7 @@ public: void removePage(int id); QWizardPage *page(int id) const; bool hasVisitedPage(int id) const; - QList visitedPages() const; // ### visitedIds()? + QList visitedPages() const; // ### Qt 6: visitedIds()? QList pageIds() const; void setStartId(int id); int startId() const; diff --git a/src/widgets/styles/qstyle.h b/src/widgets/styles/qstyle.h index a8ec8c8c3e..42bd8763d2 100644 --- a/src/widgets/styles/qstyle.h +++ b/src/widgets/styles/qstyle.h @@ -194,7 +194,7 @@ public: PE_IndicatorItemViewItemDrop, PE_PanelItemViewItem, - PE_PanelItemViewRow, // ### Qt 5: remove + PE_PanelItemViewRow, // ### Qt 6: remove PE_PanelStatusBar, @@ -303,7 +303,7 @@ public: SE_ProgressBarContents, SE_ProgressBarLabel, - // ### Qt 5: These values are unused; eliminate them + // ### Qt 6: These values are unused; eliminate them SE_DialogButtonAccept, SE_DialogButtonReject, SE_DialogButtonApply, @@ -343,7 +343,7 @@ public: SE_CheckBoxLayoutItem, SE_ComboBoxLayoutItem, SE_DateTimeEditLayoutItem, - SE_DialogButtonBoxLayoutItem, // ### remove + SE_DialogButtonBoxLayoutItem, // ### Qt 6: remove SE_LabelLayoutItem, SE_ProgressBarLayoutItem, SE_PushButtonLayoutItem, diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h index 1442cd983e..854ced596b 100644 --- a/src/widgets/widgets/qcombobox.h +++ b/src/widgets/widgets/qcombobox.h @@ -131,7 +131,7 @@ public: enum SizeAdjustPolicy { AdjustToContents, AdjustToContentsOnFirstShow, - AdjustToMinimumContentsLength, // ### Qt 5: remove + AdjustToMinimumContentsLength, // ### Qt 6: remove AdjustToMinimumContentsLengthWithIcon }; diff --git a/src/widgets/widgets/qdockwidget.h b/src/widgets/widgets/qdockwidget.h index 21872fa404..bd5a2c2aa4 100644 --- a/src/widgets/widgets/qdockwidget.h +++ b/src/widgets/widgets/qdockwidget.h @@ -82,7 +82,7 @@ public: DockWidgetVerticalTitleBar = 0x08, DockWidgetFeatureMask = 0x0f, - AllDockWidgetFeatures = DockWidgetClosable|DockWidgetMovable|DockWidgetFloatable, // ### remove in 5.0 + AllDockWidgetFeatures = DockWidgetClosable|DockWidgetMovable|DockWidgetFloatable, // ### Qt 6: remove NoDockWidgetFeatures = 0x00, Reserved = 0xff diff --git a/src/widgets/widgets/qstatusbar.h b/src/widgets/widgets/qstatusbar.h index b05bf627ad..4cab706c0b 100644 --- a/src/widgets/widgets/qstatusbar.h +++ b/src/widgets/widgets/qstatusbar.h @@ -87,7 +87,7 @@ protected: void paintEvent(QPaintEvent *); void resizeEvent(QResizeEvent *); - // ### Qt 5: consider making reformat() and hideOrShow() private + // ### Qt 6: consider making reformat() and hideOrShow() private void reformat(); void hideOrShow(); bool event(QEvent *); diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp index 1533e6a139..3633975896 100644 --- a/tests/auto/xml/dom/qdom/tst_qdom.cpp +++ b/tests/auto/xml/dom/qdom/tst_qdom.cpp @@ -1405,7 +1405,7 @@ void tst_QDom::normalizeEndOfLine() const const QString expected(QLatin1String("\nc\nc\na\na")); - // ### Qt 5: fix this, if we keep QDom at all + // ### Qt 6: fix this, if we keep QDom at all QEXPECT_FAIL("", "The parser doesn't perform newline normalization. Fixing that would change behavior.", Continue); QCOMPARE(doc.documentElement().text(), expected); } -- cgit v1.2.3 From 89387415b1fc305d82b81707f5d9c0ec85906620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 2 Apr 2012 08:37:01 +0200 Subject: Removed Qt5 todo comment in qpaintengineex_p.h This won't get done for Qt 5, and QtOpenGL still implements this API. Task-number: QTBUG-25069 Change-Id: Ia8437d2a4a5a0e750afdf67764c53d75ee8065f6 Reviewed-by: Lars Knoll --- src/gui/painting/qpaintengineex_p.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/painting/qpaintengineex_p.h b/src/gui/painting/qpaintengineex_p.h index bc944b2297..eaa3b3b1cf 100644 --- a/src/gui/painting/qpaintengineex_p.h +++ b/src/gui/painting/qpaintengineex_p.h @@ -211,7 +211,6 @@ public: virtual void beginNativePainting() {} virtual void endNativePainting() {} - // ### Qt5: remove, once QtGui is merged into QtGui and QtWidgets // Return a pixmap filter of "type" that can render the parameters // in "prototype". The returned filter is owned by the engine and // will be destroyed when the engine is destroyed. The "prototype" -- cgit v1.2.3 From 592bb3ca5eab21246c3194e18b534defb0fb7022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 2 Apr 2012 08:48:47 +0200 Subject: Removed Qt 5 todo comments from qgl.h / qgl_p.h. No point in changing QGLContext API when QOpenGLContext is meant to obsolete it. Task-number: QTBUG-25074 Change-Id: Ie21692c8c402ed9cd6af56bef0175c4e46c3d8a9 Reviewed-by: Lars Knoll --- src/opengl/qgl.h | 6 ++---- src/opengl/qgl_p.h | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index caa5b96cdc..6903d3278c 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -277,7 +277,6 @@ public: QGLFormat requestedFormat() const; void setFormat(const QGLFormat& format); - // ### Qt 5: return bools + maybe remove virtuals virtual void makeCurrent(); virtual void doneCurrent(); @@ -340,7 +339,7 @@ protected: void setWindowCreated(bool on); bool initialized() const; void setInitialized(bool on); - void generateFontDisplayLists(const QFont & fnt, int listBase); // ### Qt 5: remove + void generateFontDisplayLists(const QFont & fnt, int listBase); uint colorIndex(const QColor& c) const; void setValid(bool valid); @@ -402,7 +401,6 @@ public: bool isValid() const; bool isSharing() const; - // ### Qt 5: return bools void makeCurrent(); void doneCurrent(); @@ -474,7 +472,7 @@ protected: virtual void glInit(); virtual void glDraw(); - int fontDisplayListBase(const QFont & fnt, int listBase = 2000); // ### Qt 5: remove + int fontDisplayListBase(const QFont & fnt, int listBase = 2000); QGLWidget(QGLWidgetPrivate &dd, const QGLFormat &format = QGLFormat(), diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 86645fd5c1..fb503a31f1 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -402,7 +402,6 @@ private slots: } }; -// ### make QGLContext a QObject in 5.0 and remove the proxy stuff class Q_OPENGL_EXPORT QGLSignalProxy : public QObject { Q_OBJECT -- cgit v1.2.3 From bf3c3862b486bbc472117d8e11e03f621b11c064 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Fri, 9 Mar 2012 11:53:45 +0200 Subject: Fix crash with evaluation license With QWS, an infinite loop is formed at application startup when commercial evaluation license is used and QT_EVAL is defined. Change-Id: If9712428932b51f5c8eee9ef2d0d444da06a25d9 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qtcore_eval.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/corelib/kernel/qtcore_eval.cpp b/src/corelib/kernel/qtcore_eval.cpp index 2b07fa99cc..1624bfef5c 100644 --- a/src/corelib/kernel/qtcore_eval.cpp +++ b/src/corelib/kernel/qtcore_eval.cpp @@ -555,13 +555,8 @@ void qt_eval_init_widget(QWidget *w) { if (qt_eval_days_left() == -2) return; - if (w->isTopLevel()) { - QString windowTitle = w->windowTitle(); - if (windowTitle.isEmpty()) { - w->setWindowTitle(QLatin1String(" ")); - } else if (!windowTitle.startsWith(qt_eval_title_prefix())) { - qt_eval_adapt_window_title(windowTitle); - } + if (w->isTopLevel() && w->windowTitle().isEmpty() && w->windowType() != Qt::Desktop ) { + w->setWindowTitle(QLatin1String(" ")); } } #endif -- cgit v1.2.3 From d7851bbc587b01a3900a8e52b1659f3054f6c3d0 Mon Sep 17 00:00:00 2001 From: Yuchen Deng Date: Wed, 4 Apr 2012 08:51:52 +0800 Subject: Add imports directory to ignore list Change-Id: Iac2ae46ff606e6c71628ca480ac1b5fe82d9bf4e Reviewed-by: Thiago Macieira --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7c98265f57..3190e4e1ef 100644 --- a/.gitignore +++ b/.gitignore @@ -215,6 +215,7 @@ examples/tools/plugandpaint/plugins include/* include/*/* lib/* +imports/* !lib/fonts !lib/README plugins/*/* -- cgit v1.2.3 From 8e74b5cfe43893522c0f06d0b0d0dd5b7393aa6f Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 10 Apr 2012 14:53:42 +0300 Subject: fix digitValue() returned 0 instead of -1 for invalid ucs4 characters Task-number: QTBUG-20318 Change-Id: I96c4c2b042bad478b7c704669e7ea0d574d3b22f Reviewed-by: Robin Burchell Reviewed-by: Oswald Buddenhagen Reviewed-by: Lars Knoll --- src/corelib/tools/qchar.cpp | 2 +- tests/auto/corelib/tools/qchar/tst_qchar.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp index 6efd9f20af..1ce19ec911 100644 --- a/src/corelib/tools/qchar.cpp +++ b/src/corelib/tools/qchar.cpp @@ -717,7 +717,7 @@ int QChar::digitValue(ushort ucs2) int QChar::digitValue(uint ucs4) { if (ucs4 > UNICODE_LAST_CODEPOINT) - return 0; + return -1; return qGetProp(ucs4)->digitValue; } diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp index e72af11fbb..215f4c18f2 100644 --- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp +++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp @@ -523,6 +523,9 @@ void tst_QChar::digitValue() QVERIFY(QChar::digitValue((ushort)0x1040) == 0); QVERIFY(QChar::digitValue((uint)0x1049) == 9); QVERIFY(QChar::digitValue((uint)0x1040) == 0); + + QVERIFY(QChar::digitValue((ushort)0xd800) == -1); + QVERIFY(QChar::digitValue((uint)UNICODE_LAST_CODEPOINT + 1) == -1); } void tst_QChar::decomposition() -- cgit v1.2.3 From 3b778df102e82a7cf4b1db7fca0bcfeadfe98857 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Thu, 5 Apr 2012 02:28:37 +0300 Subject: minor improvement for NormalizationCorrections let's don't hardcode the latests affected version value and simply use the one parsed from NormalizationCorrections.txt Change-Id: I37021e8238d77deada4c5ba7a2d160c87186b9dd Reviewed-by: Lars Knoll --- src/corelib/tools/qstring.cpp | 4 ++-- src/corelib/tools/qunicodetables.cpp | 1 + util/unicode/main.cpp | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index f263c0b1db..81fa3bc544 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -6212,8 +6212,8 @@ void qt_string_normalize(QString *data, QString::NormalizationForm mode, QChar:: return; if (version == QChar::Unicode_Unassigned) { - version = UNICODE_DATA_VERSION; - } else if (version != UNICODE_DATA_VERSION) { + version = QChar::currentUnicodeVersion(); + } else if (int(version) <= NormalizationCorrectionsVersionMax) { const QString &s = *data; QChar *d = 0; for (int i = 0; i < NumNormalizationCorrections; ++i) { diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/tools/qunicodetables.cpp index 91d260b724..507186dd24 100644 --- a/src/corelib/tools/qunicodetables.cpp +++ b/src/corelib/tools/qunicodetables.cpp @@ -8029,6 +8029,7 @@ static const NormalizationCorrection uc_normalization_corrections[] = { }; enum { NumNormalizationCorrections = 6 }; +enum { NormalizationCorrectionsVersionMax = 7 }; enum { UnicodeBlockCount = 512 }; // number of unicode blocks enum { UnicodeBlockSize = 128 }; // size of each block diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp index 4a11ec667b..2b4a76363f 100644 --- a/util/unicode/main.cpp +++ b/util/unicode/main.cpp @@ -1078,7 +1078,7 @@ static void readDerivedNormalizationProps() struct NormalizationCorrection { uint codepoint; uint mapped; - uint version; + int version; }; static QByteArray createNormalizationCorrections() @@ -1099,6 +1099,7 @@ static QByteArray createNormalizationCorrections() "static const NormalizationCorrection uc_normalization_corrections[] = {\n"; + int maxVersion = 0; int numCorrections = 0; while (!f.atEnd()) { QByteArray line; @@ -1135,11 +1136,13 @@ static QByteArray createNormalizationCorrections() out += " { 0x" + QByteArray::number(c.codepoint, 16) + ", 0x" + QByteArray::number(c.mapped, 16) + ", " + QString::number(c.version) + " },\n"; ++numCorrections; + maxVersion = qMax(c.version, maxVersion); } out += "};\n\n" - "enum { NumNormalizationCorrections = " + QByteArray::number(numCorrections) + " };\n\n"; + "enum { NumNormalizationCorrections = " + QByteArray::number(numCorrections) + " };\n" + "enum { NormalizationCorrectionsVersionMax = " + QByteArray::number(maxVersion) + " };\n\n"; return out; } -- cgit v1.2.3 From 50fefebc8403c0f293210c6dc5a98adb19776b76 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Sun, 8 Apr 2012 10:18:45 +0300 Subject: replace hardcoded values with a surrogate handling methods Change-Id: Iba079953c46a29404232d2dacbe0c90170097d51 Reviewed-by: Oswald Buddenhagen Reviewed-by: Lars Knoll --- tests/auto/corelib/tools/qchar/tst_qchar.cpp | 18 ++++++++---------- util/unicode/main.cpp | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp index 215f4c18f2..6632776a86 100644 --- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp +++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp @@ -543,10 +543,10 @@ void tst_QChar::decomposition() { QString str; - str += QChar( (0x1D157 - 0x10000) / 0x400 + 0xd800 ); - str += QChar( ((0x1D157 - 0x10000) % 0x400) + 0xdc00 ); - str += QChar( (0x1D165 - 0x10000) / 0x400 + 0xd800 ); - str += QChar( ((0x1D165 - 0x10000) % 0x400) + 0xdc00 ); + str += QChar(QChar::highSurrogate(0x1D157)); + str += QChar(QChar::lowSurrogate(0x1D157)); + str += QChar(QChar::highSurrogate(0x1D165)); + str += QChar(QChar::lowSurrogate(0x1D165)); QVERIFY(QChar::decomposition(0x1D15e) == str); } @@ -629,14 +629,12 @@ void tst_QChar::normalization_data() for (int j = 0; j < c.size(); ++j) { bool ok; uint uc = c.at(j).toInt(&ok, 16); - if (uc < 0x10000) + if (!QChar::requiresSurrogates(uc)) { columns[i].append(QChar(uc)); - else { + } else { // convert to utf16 - ushort high = QChar::highSurrogate(uc); - ushort low = QChar::lowSurrogate(uc); - columns[i].append(QChar(high)); - columns[i].append(QChar(low)); + columns[i].append(QChar(QChar::highSurrogate(uc))); + columns[i].append(QChar(QChar::lowSurrogate(uc))); } } } diff --git a/util/unicode/main.cpp b/util/unicode/main.cpp index 2b4a76363f..d769176c6f 100644 --- a/util/unicode/main.cpp +++ b/util/unicode/main.cpp @@ -465,7 +465,7 @@ static int appendToSpecialCaseMap(const QList &map) QList utf16map; for (int i = 0; i < map.size(); ++i) { int val = map.at(i); - if (val >= 0x10000) { + if (QChar::requiresSurrogates(val)) { utf16map << QChar::highSurrogate(val); utf16map << QChar::lowSurrogate(val); } else { @@ -789,7 +789,7 @@ static void readUnicodeData() qWarning() << "upperCaseDiff exceeded (" << hex << codepoint << "->" << upperCase << ")"; data.p.upperCaseDiff = diff; maxUpperCaseDiff = qMax(maxUpperCaseDiff, qAbs(diff)); - if (codepoint >= 0x10000 || upperCase >= 0x10000) { + if (QChar::requiresSurrogates(codepoint) || QChar::requiresSurrogates(upperCase)) { // if the conditions below doesn't hold anymore we need to modify our upper casing code Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(upperCase)); Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(upperCase)); @@ -803,7 +803,7 @@ static void readUnicodeData() qWarning() << "lowerCaseDiff exceeded (" << hex << codepoint << "->" << lowerCase << ")"; data.p.lowerCaseDiff = diff; maxLowerCaseDiff = qMax(maxLowerCaseDiff, qAbs(diff)); - if (codepoint >= 0x10000 || lowerCase >= 0x10000) { + if (QChar::requiresSurrogates(codepoint) || QChar::requiresSurrogates(lowerCase)) { // if the conditions below doesn't hold anymore we need to modify our lower casing code Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(lowerCase)); Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(lowerCase)); @@ -820,7 +820,7 @@ static void readUnicodeData() qWarning() << "titleCaseDiff exceeded (" << hex << codepoint << "->" << titleCase << ")"; data.p.titleCaseDiff = diff; maxTitleCaseDiff = qMax(maxTitleCaseDiff, qAbs(diff)); - if (codepoint >= 0x10000 || titleCase >= 0x10000) { + if (QChar::requiresSurrogates(codepoint) || QChar::requiresSurrogates(titleCase)) { // if the conditions below doesn't hold anymore we need to modify our title casing code Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(titleCase)); Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(titleCase)); @@ -1253,7 +1253,7 @@ static void readSpecialCasing() // if the condition below doesn't hold anymore we need to modify our // lower/upper/title casing code and case folding code - Q_ASSERT(codepoint < 0x10000); + Q_ASSERT(!QChar::requiresSurrogates(codepoint)); // qDebug() << "codepoint" << hex << codepoint; // qDebug() << line; @@ -1359,7 +1359,7 @@ static void readCaseFolding() qWarning() << "caseFoldDiff exceeded (" << hex << codepoint << "->" << caseFolded << ")"; ud.p.caseFoldDiff = diff; maxCaseFoldDiff = qMax(maxCaseFoldDiff, qAbs(diff)); - if (codepoint >= 0x10000 || caseFolded >= 0x10000) { + if (QChar::requiresSurrogates(codepoint) || QChar::requiresSurrogates(caseFolded)) { // if the conditions below doesn't hold anymore we need to modify our case folding code Q_ASSERT(QChar::highSurrogate(codepoint) == QChar::highSurrogate(caseFolded)); Q_ASSERT(QChar::lowSurrogate(codepoint) + diff == QChar::lowSurrogate(caseFolded)); @@ -2317,11 +2317,11 @@ static QByteArray createCompositionInfo() if (!d.decomposition.isEmpty()) { int utf16Chars = 0; for (int j = 0; j < d.decomposition.size(); ++j) - utf16Chars += d.decomposition.at(j) >= 0x10000 ? 2 : 1; + utf16Chars += QChar::requiresSurrogates(d.decomposition.at(j)) ? 2 : 1; decompositions.append(d.decompositionType + (utf16Chars<<8)); for (int j = 0; j < d.decomposition.size(); ++j) { int code = d.decomposition.at(j); - if (code >= 0x10000) { + if (QChar::requiresSurrogates(code)) { // save as surrogate pair ushort high = QChar::highSurrogate(code); ushort low = QChar::lowSurrogate(code); @@ -2358,11 +2358,11 @@ static QByteArray createCompositionInfo() if (!d.decomposition.isEmpty()) { int utf16Chars = 0; for (int j = 0; j < d.decomposition.size(); ++j) - utf16Chars += d.decomposition.at(j) >= 0x10000 ? 2 : 1; + utf16Chars += QChar::requiresSurrogates(d.decomposition.at(j)) ? 2 : 1; decompositions.append(d.decompositionType + (utf16Chars<<8)); for (int j = 0; j < d.decomposition.size(); ++j) { int code = d.decomposition.at(j); - if (code >= 0x10000) { + if (QChar::requiresSurrogates(code)) { // save as surrogate pair ushort high = QChar::highSurrogate(code); ushort low = QChar::lowSurrogate(code); -- cgit v1.2.3 From 784076fccbc7f5644259bff274db371747fecee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Mill=C3=A1n=20Soto?= Date: Sun, 22 Jan 2012 19:48:09 +0100 Subject: Made qt_accStripAmp handle "&&" Changed qt_accStripAmp implementation to handle texts which contains pairs of ampersands representing a single ampersand. In order to do that, a new static function called qt_accAmpIndex was created. This function is based on the code of qt_accHotKey, which was changed to use qt_accAmpIndex. Change-Id: Idcc5d07581d7fb3251c30399b189740ca8071104 Reviewed-by: Frederik Gladhorn (cherry picked from commit f864f8f79b88bbc3cc9007d2a92b08ca4b5cb871) --- src/widgets/accessible/qaccessiblewidget.cpp | 41 ++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp index ae050ac643..796ce42118 100644 --- a/src/widgets/accessible/qaccessiblewidget.cpp +++ b/src/widgets/accessible/qaccessiblewidget.cpp @@ -100,16 +100,14 @@ static QString buddyString(const QWidget *widget) return QString(); } -QString Q_WIDGETS_EXPORT qt_accStripAmp(const QString &text) -{ - return QString(text).remove(QLatin1Char('&')); -} - -QString Q_WIDGETS_EXPORT qt_accHotKey(const QString &text) +/* This function will return the offset of the '&' in the text that would be + preceding the accelerator character. + If this text does not have an accelerator, -1 will be returned. */ +static int qt_accAmpIndex(const QString &text) { #ifndef QT_NO_SHORTCUT if (text.isEmpty()) - return text; + return -1; int fa = 0; QChar ac; @@ -118,23 +116,42 @@ QString Q_WIDGETS_EXPORT qt_accHotKey(const QString &text) if (fa < text.length()) { // ignore "&&" if (text.at(fa) == QLatin1Char('&')) { + ++fa; continue; } else { - ac = text.at(fa); + return fa - 1; break; } } } - if (ac.isNull()) - return QString(); - return QKeySequence(Qt::ALT).toString(QKeySequence::NativeText) + ac.toUpper(); + + return -1; #else Q_UNUSED(text); - return QString(); + return -1; #endif } +QString Q_WIDGETS_EXPORT qt_accStripAmp(const QString &text) +{ + QString newText(text); + int ampIndex = qt_accAmpIndex(newText); + if (ampIndex != -1) + newText.remove(ampIndex, 1); + + return newText.replace(QLatin1String("&&"), QLatin1String("&")); +} + +QString Q_WIDGETS_EXPORT qt_accHotKey(const QString &text) +{ + int ampIndex = qt_accAmpIndex(text); + if (ampIndex != -1) + return (QString)QKeySequence(Qt::ALT) + text.at(ampIndex + 1); + + return QString(); +} + class QAccessibleWidgetPrivate { public: -- cgit v1.2.3 From 97f9c6f8cdc0dd0f676c6ccfeb1cd6096e72fd48 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 10 Apr 2012 14:30:52 +0200 Subject: Minor clean up in QTextOption API Source compatible, but binary incompatible, change to QTextOption API to make it consistent with Qt's coding style. Change-Id: I368f13925339fa41025a570f684f4b944844a022 Reviewed-by: Jiang Jiang --- src/gui/text/qtextoption.cpp | 4 ++-- src/gui/text/qtextoption.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp index b3b4c90d79..25760de0dc 100644 --- a/src/gui/text/qtextoption.cpp +++ b/src/gui/text/qtextoption.cpp @@ -145,7 +145,7 @@ QTextOption &QTextOption::operator=(const QTextOption &o) \sa tabArray(), setTabStop(), setTabs() */ -void QTextOption::setTabArray(QList tabStops) // Qt5: const ref +void QTextOption::setTabArray(const QList &tabStops) { if (!d) d = new QTextOptionPrivate; @@ -165,7 +165,7 @@ void QTextOption::setTabArray(QList tabStops) // Qt5: const ref \sa tabStops() */ -void QTextOption::setTabs(QList tabStops) // Qt5: const ref +void QTextOption::setTabs(const QList &tabStops) { if (!d) d = new QTextOptionPrivate; diff --git a/src/gui/text/qtextoption.h b/src/gui/text/qtextoption.h index a0a4c76282..f2a9f52a26 100644 --- a/src/gui/text/qtextoption.h +++ b/src/gui/text/qtextoption.h @@ -122,10 +122,10 @@ public: inline void setTabStop(qreal tabStop); inline qreal tabStop() const { return tab; } - void setTabArray(QList tabStops); + void setTabArray(const QList &tabStops); QList tabArray() const; - void setTabs(QList tabStops); + void setTabs(const QList &tabStops); QList tabs() const; void setUseDesignMetrics(bool b) { design = b; } -- cgit v1.2.3 From c524bbbb8aa4ba10bac68292a3078534f1b51df5 Mon Sep 17 00:00:00 2001 From: Aron Rosenberg Date: Wed, 4 Apr 2012 16:34:33 -0700 Subject: Add Proxy Auto Config support (PAC) on Mac Adds support for fetching and parsing Proxy Auto Config files if one is specified in the Mac System Preferences Task-Number: QTBUG-2069 Task-Number: QTIFW-28 Change-Id: I91feb999222187e7467f2c41383904cf0cff8633 Reviewed-by: Shane Kearns --- src/network/kernel/kernel.pri | 2 +- src/network/kernel/qnetworkproxy_mac.cpp | 116 +++++++++++++++++++++++++++++-- 2 files changed, 113 insertions(+), 5 deletions(-) diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri index a5508af31f..f9ea6065a3 100644 --- a/src/network/kernel/kernel.pri +++ b/src/network/kernel/kernel.pri @@ -33,7 +33,7 @@ win32: { } integrity:SOURCES += kernel/qdnslookup_unix.cpp kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_unix.cpp -mac:LIBS_PRIVATE += -framework SystemConfiguration -framework CoreFoundation +mac:LIBS_PRIVATE += -framework SystemConfiguration -framework CoreFoundation -framework CoreServices mac:SOURCES += kernel/qnetworkproxy_mac.cpp else:win32:SOURCES += kernel/qnetworkproxy_win.cpp else:SOURCES += kernel/qnetworkproxy_generic.cpp diff --git a/src/network/kernel/qnetworkproxy_mac.cpp b/src/network/kernel/qnetworkproxy_mac.cpp index d25917ee47..3e62c0f867 100644 --- a/src/network/kernel/qnetworkproxy_mac.cpp +++ b/src/network/kernel/qnetworkproxy_mac.cpp @@ -48,6 +48,7 @@ #include #include +#include #include #include #include "private/qcore_mac_p.h" @@ -146,6 +147,66 @@ static QNetworkProxy proxyFromDictionary(CFDictionaryRef dict, QNetworkProxy::Pr return QNetworkProxy(); } + +static QNetworkProxy proxyFromDictionary(CFDictionaryRef dict) +{ + QNetworkProxy::ProxyType proxyType = QNetworkProxy::DefaultProxy; + QString hostName; + quint16 port = 0; + QString user; + QString password; + + CFStringRef cfProxyType = (CFStringRef)CFDictionaryGetValue(dict, kCFProxyTypeKey); + if (CFStringCompare(cfProxyType, kCFProxyTypeNone, 0) == kCFCompareEqualTo) { + proxyType = QNetworkProxy::NoProxy; + } else if (CFStringCompare(cfProxyType, kCFProxyTypeFTP, 0) == kCFCompareEqualTo) { + proxyType = QNetworkProxy::FtpCachingProxy; + } else if (CFStringCompare(cfProxyType, kCFProxyTypeHTTP, 0) == kCFCompareEqualTo) { + proxyType = QNetworkProxy::HttpProxy; + } else if (CFStringCompare(cfProxyType, kCFProxyTypeHTTPS, 0) == kCFCompareEqualTo) { + proxyType = QNetworkProxy::HttpProxy; + } else if (CFStringCompare(cfProxyType, kCFProxyTypeSOCKS, 0) == kCFCompareEqualTo) { + proxyType = QNetworkProxy::Socks5Proxy; + } + + hostName = QCFString::toQString((CFStringRef)CFDictionaryGetValue(dict, kCFProxyHostNameKey)); + user = QCFString::toQString((CFStringRef)CFDictionaryGetValue(dict, kCFProxyUsernameKey)); + password = QCFString::toQString((CFStringRef)CFDictionaryGetValue(dict, kCFProxyPasswordKey)); + + CFNumberRef portNumber = (CFNumberRef)CFDictionaryGetValue(dict, kCFProxyPortNumberKey); + if (portNumber) { + CFNumberGetValue(portNumber, kCFNumberSInt16Type, &port); + } + + return QNetworkProxy(proxyType, hostName, port, user, password); +} + +const char * cfurlErrorDescription(SInt32 errorCode) +{ + switch (errorCode) { + case kCFURLUnknownError: + return "Unknown Error"; + case kCFURLUnknownSchemeError: + return "Unknown Scheme"; + case kCFURLResourceNotFoundError: + return "Resource Not Found"; + case kCFURLResourceAccessViolationError: + return "Resource Access Violation"; + case kCFURLRemoteHostUnavailableError: + return "Remote Host Unavailable"; + case kCFURLImproperArgumentsError: + return "Improper Arguments"; + case kCFURLUnknownPropertyKeyError: + return "Unknown Property Key"; + case kCFURLPropertyKeyUnavailableError: + return "Property Key Unavailable"; + case kCFURLTimeoutError: + return "Timeout"; + default: + return "Really Unknown Error"; + } +} + QList macQueryInternal(const QNetworkProxyQuery &query) { QList result; @@ -168,11 +229,58 @@ QList macQueryInternal(const QNetworkProxyQuery &query) int enabled; if (CFNumberGetValue(pacEnabled, kCFNumberIntType, &enabled) && enabled) { // PAC is enabled - CFStringRef pacUrl = - (CFStringRef)CFDictionaryGetValue(dict, kSCPropNetProxiesProxyAutoConfigURLString); - QString url = QCFString::toQString(pacUrl); + CFStringRef cfPacLocation = (CFStringRef)CFDictionaryGetValue(dict, kSCPropNetProxiesProxyAutoConfigURLString); + +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) { + QCFType pacData; + QCFType pacUrl = CFURLCreateWithString(kCFAllocatorDefault, cfPacLocation, NULL); + SInt32 errorCode; + if (!CFURLCreateDataAndPropertiesFromResource(kCFAllocatorDefault, pacUrl, &pacData, NULL, NULL, &errorCode)) { + QString pacLocation = QCFString::toQString(cfPacLocation); + qWarning("Unable to get the PAC script at \"%s\" (%s)", qPrintable(pacLocation), cfurlErrorDescription(errorCode)); + return result; + } - // ### TODO: Use PAC somehow + QCFType pacScript = CFStringCreateFromExternalRepresentation(kCFAllocatorDefault, pacData, kCFStringEncodingISOLatin1); + if (!pacScript) { + // This should never happen, but the documentation says it may return NULL if there was a problem creating the object. + QString pacLocation = QCFString::toQString(cfPacLocation); + qWarning("Unable to read the PAC script at \"%s\"", qPrintable(pacLocation)); + return result; + } + + QByteArray encodedURL = query.url().toEncoded(); // converted to UTF-8 + if (encodedURL.isEmpty()) { + return result; // Invalid URL, abort + } + + QCFType targetURL = CFURLCreateWithBytes(kCFAllocatorDefault, (UInt8*)encodedURL.data(), encodedURL.size(), kCFStringEncodingUTF8, NULL); + if (!targetURL) { + return result; // URL creation problem, abort + } + + QCFType pacError; + QCFType proxies = CFNetworkCopyProxiesForAutoConfigurationScript(pacScript, targetURL, &pacError); + if (!proxies) { + QString pacLocation = QCFString::toQString(cfPacLocation); + QCFType pacErrorDescription = CFErrorCopyDescription(pacError); + qWarning("Execution of PAC script at \"%s\" failed: %s", qPrintable(pacLocation), qPrintable(QCFString::toQString(pacErrorDescription))); + return result; + } + + CFIndex size = CFArrayGetCount(proxies); + for (CFIndex i = 0; i < size; ++i) { + CFDictionaryRef proxy = (CFDictionaryRef)CFArrayGetValueAtIndex(proxies, i); + result << proxyFromDictionary(proxy); + } + return result; + } else +#endif + { + QString pacLocation = QCFString::toQString(cfPacLocation); + qWarning("Mac system proxy: PAC script at \"%s\" not handled", qPrintable(pacLocation)); + } } } -- cgit v1.2.3 From 90520cd834d84f2b091fea94f1d44bc6cb863420 Mon Sep 17 00:00:00 2001 From: Aron Rosenberg Date: Wed, 4 Apr 2012 16:41:27 -0700 Subject: Automatically query for Mac Proxy Server credentials Add support for automatically searching the Mac System Preferences for proxy server username/password. If a user has put credentials in the SystemPreferences->Network->Interface->Proxies area, we will now look in the KeyChain for those files. This will automatically pop up a Permissions dialog from the OS if valid credentials were found which match the server we are trying to access. Task-Number: QTBUG-22033 Change-Id: Ic7952afab4d16a65a87bb2f97a928c1c91167fe7 Reviewed-by: Shane Kearns --- src/network/access/access.pri | 2 + src/network/access/qnetworkaccessmanager.cpp | 70 ++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/src/network/access/access.pri b/src/network/access/access.pri index e0a0253b6c..590a37bf15 100644 --- a/src/network/access/access.pri +++ b/src/network/access/access.pri @@ -65,3 +65,5 @@ SOURCES += \ access/qhttpmultipart.cpp include($$PWD/../../3rdparty/zlib_dependency.pri) + +mac:LIBS_PRIVATE += -framework Security diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 397bb0535e..3a69ec4056 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -82,6 +82,64 @@ Q_GLOBAL_STATIC(QNetworkAccessFtpBackendFactory, ftpBackend) Q_GLOBAL_STATIC(QNetworkAccessDebugPipeBackendFactory, debugpipeBackend) #endif +#ifdef Q_OS_MAC + +#include +#include +#include + +bool getProxyAuth(const QString& proxyHostname, const QString &scheme, QString& username, QString& password) +{ + OSStatus err; + SecKeychainItemRef itemRef; + bool retValue = false; + SecProtocolType protocolType = kSecProtocolTypeAny; + if (scheme.compare(QLatin1String("ftp"),Qt::CaseInsensitive)==0) { + protocolType = kSecProtocolTypeFTP; + } else if (scheme.compare(QLatin1String("http"),Qt::CaseInsensitive)==0) { + protocolType = kSecProtocolTypeHTTP; + } else if (scheme.compare(QLatin1String("https"),Qt::CaseInsensitive)==0) { + protocolType = kSecProtocolTypeHTTPS; + } + QByteArray proxyHostnameUtf8(proxyHostname.toUtf8()); + err = SecKeychainFindInternetPassword(NULL, + proxyHostnameUtf8.length(), proxyHostnameUtf8.constData(), + 0,NULL, + 0, NULL, + 0, NULL, + 0, + protocolType, + kSecAuthenticationTypeAny, + 0, NULL, + &itemRef); + if (err == noErr) { + + SecKeychainAttribute attr; + SecKeychainAttributeList attrList; + UInt32 length; + void *outData; + + attr.tag = kSecAccountItemAttr; + attr.length = 0; + attr.data = NULL; + + attrList.count = 1; + attrList.attr = &attr; + + if (SecKeychainItemCopyContent(itemRef, NULL, &attrList, &length, &outData) == noErr) { + username = QString::fromUtf8((const char*)attr.data, attr.length); + password = QString::fromUtf8((const char*)outData, length); + SecKeychainItemFreeContent(&attrList,outData); + retValue = true; + } + CFRelease(itemRef); + } + return retValue; +} +#endif + + + static void ensureInitialized() { #ifndef QT_NO_FTP @@ -1117,6 +1175,18 @@ void QNetworkAccessManagerPrivate::authenticationRequired(QAuthenticator *authen return; } } +#ifdef Q_OS_MAC + //now we try to get the username and password from keychain + //if not successful signal will be emitted + QString username; + QString password; + if (getProxyAuth(proxy.hostName(),reply->request().url().scheme(),username,password)) { + authenticator->setUser(username); + authenticator->setPassword(password); + authenticationManager->cacheProxyCredentials(proxy, authenticator); + return; + } +#endif // if we emit a signal here in synchronous mode, the user might spin // an event loop, which might recurse and lead to problems -- cgit v1.2.3 From 8692326629eb736a007a30f9ccb91c72409c9117 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Tue, 6 Mar 2012 20:14:25 +0100 Subject: Fixed syncqt to ignore all lines that define Qt namespace That includes non-standard macroses for QtAddOns, e.g. for QtJsonDb addon the macro looks like QT_BEGIN_NAMESPACE_JSONDB - by default syncqt doesn't recognize the macro and concantenates it with the next line in the header file, which breaks forward include generation if that next line is the class definition. Change-Id: Ia269f8a091113e4951d6a2615ef392b21bd5e3a3 Reviewed-by: Marius Storm-Olsen --- bin/syncqt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/syncqt b/bin/syncqt index 581233a162..3e77d2001d 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -227,7 +227,7 @@ sub classNames { $line =~ s,//.*$,,; #remove c++ comments $line .= ";" if($line =~ m/^Q_[A-Z_]*\(.*\)[\r\n]*$/); #qt macro $line .= ";" if($line =~ m/^QT_(BEGIN|END)_HEADER[\r\n]*$/); #qt macro - $line .= ";" if($line =~ m/^QT_(BEGIN|END)_NAMESPACE[\r\n]*$/); #qt macro + $line .= ";" if($line =~ m/^QT_(BEGIN|END)_NAMESPACE(_[A-Z]+)*[\r\n]*$/); #qt macro $line .= ";" if($line =~ m/^QT_MODULE\(.*\)[\r\n]*$/); # QT_MODULE macro $parsable .= " " . $line; } -- cgit v1.2.3 From 699f2424eba929d04b081af2a0cad74e2e58e235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Tue, 3 Apr 2012 06:38:48 +0200 Subject: QHeaderView - rename many spans classes and variables In (SHA) b800d8b94a7861ecf8853621f6556fca186fb5b7 the span model was replaced with a plain section model. The code however still has variables and classes called someting with spans which would be confusing for possible new readers of the code. This patch cleans up most of it. It only renames classes,functions and variables (and not any semantics or the public API). Change-Id: I6ceb068c7317223f0d8e37f8032197f518d0174c Reviewed-by: Stephen Kelly --- src/widgets/itemviews/qheaderview.cpp | 159 +++++++++++---------- src/widgets/itemviews/qheaderview_p.h | 32 ++--- .../itemviews/qheaderview/tst_qheaderview.cpp | 4 +- 3 files changed, 99 insertions(+), 96 deletions(-) diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index e82cd477c5..444e56d6d0 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -67,15 +67,15 @@ QT_BEGIN_NAMESPACE #ifndef QT_NO_DATASTREAM -QDataStream &operator<<(QDataStream &out, const QHeaderViewPrivate::SectionSpan &span) +QDataStream &operator<<(QDataStream &out, const QHeaderViewPrivate::SectionItem §ion) { - span.write(out); + section.write(out); return out; } -QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionSpan &span) +QDataStream &operator>>(QDataStream &in, QHeaderViewPrivate::SectionItem §ion) { - span.read(in); + section.read(in); return in; } #endif // QT_NO_DATASTREAM @@ -789,18 +789,18 @@ void QHeaderView::moveSection(int from, int to) //Q_ASSERT(oldHeaderLength == length()); // move sizes - // ### check for spans of section sizes here + // ### check for items of section sizes here if (to > from) { for (visual = from; visual <= to; ++visual) { int size = sizes[visual - from]; ResizeMode mode = modes[visual - from]; - d->createSectionSpan(visual, visual, size, mode); + d->createSectionItems(visual, visual, size, mode); } } else { for (visual = to; visual <= from; ++visual) { int size = sizes[visual - to]; ResizeMode mode = modes[visual - to]; - d->createSectionSpan(visual, visual, size, mode); + d->createSectionItems(visual, visual, size, mode); } } //Q_ASSERT(d->headerLength() == length()); @@ -839,8 +839,8 @@ void QHeaderView::swapSections(int first, int second) ResizeMode secondMode = d->headerSectionResizeMode(second); int secondLogical = d->logicalIndex(second); - d->createSectionSpan(second, second, firstSize, firstMode); - d->createSectionSpan(first, first, secondSize, secondMode); + d->createSectionItems(second, second, firstSize, firstMode); + d->createSectionItems(first, first, secondSize, secondMode); d->initializeIndexMapping(); @@ -898,7 +898,7 @@ void QHeaderView::resizeSection(int logical, int size) if (stretchLastSection() && visual == d->lastVisibleVisualIndex()) d->lastSectionSize = size; - d->createSectionSpan(visual, visual, size, d->headerSectionResizeMode(visual)); + d->createSectionItems(visual, visual, size, d->headerSectionResizeMode(visual)); if (!updatesEnabled()) { if (d->hasAutoResizeSections()) @@ -1719,18 +1719,18 @@ void QHeaderView::sectionsInserted(const QModelIndex &parent, int insertAt = logicalFirst; int insertCount = logicalLast - logicalFirst + 1; - QHeaderViewPrivate::SectionSpan span(d->defaultSectionSize, d->globalResizeMode); + QHeaderViewPrivate::SectionItem section(d->defaultSectionSize, d->globalResizeMode); d->sectionStartposRecalc = true; - if (d->sectionSpans.isEmpty() || insertAt >= d->sectionSpans.count()) { + if (d->sectionItems.isEmpty() || insertAt >= d->sectionItems.count()) { int insertLength = d->defaultSectionSize * insertCount; d->length += insertLength; - d->sectionSpans.insert(d->sectionSpans.count(), insertCount, span); // append + d->sectionItems.insert(d->sectionItems.count(), insertCount, section); // append } else { - // separate them out into their own spans + // separate them out into their own sections int insertLength = d->defaultSectionSize * insertCount; d->length += insertLength; - d->sectionSpans.insert(insertAt, insertCount, span); + d->sectionItems.insert(insertAt, insertCount, section); } // update sorting column @@ -1852,7 +1852,7 @@ void QHeaderViewPrivate::_q_sectionsRemoved(const QModelIndex &parent, if (visualIndices.isEmpty() && logicalIndices.isEmpty()) { //Q_ASSERT(headerSectionCount() == sectionCount); - removeSectionsFromSpans(logicalFirst, logicalLast); + removeSectionsFromSectionItems(logicalFirst, logicalLast); } else { if (logicalFirst == logicalLast) { // Remove just one index. int l = logicalFirst; @@ -1869,21 +1869,21 @@ void QHeaderViewPrivate::_q_sectionsRemoved(const QModelIndex &parent, logicalIndices.remove(visual); visualIndices.remove(l); //Q_ASSERT(headerSectionCount() == sectionCount); - removeSectionsFromSpans(visual, visual); + removeSectionsFromSectionItems(visual, visual); } else { sectionStartposRecalc = true; // We will need to recalc positions after removing items - for (int u = 0; u < sectionSpans.count(); ++u) // Store spans info - sectionSpans.at(u).tmpLogIdx = logicalIndices.at(u); - for (int v = sectionSpans.count() - 1; v >= 0; --v) { // Remove the sections - if (logicalFirst <= sectionSpans.at(v).tmpLogIdx && sectionSpans.at(v).tmpLogIdx <= logicalLast) - removeSectionsFromSpans(v, v); // Invalidates the spans variable + for (int u = 0; u < sectionItems.count(); ++u) // Store section info + sectionItems.at(u).tmpLogIdx = logicalIndices.at(u); + for (int v = sectionItems.count() - 1; v >= 0; --v) { // Remove the sections + if (logicalFirst <= sectionItems.at(v).tmpLogIdx && sectionItems.at(v).tmpLogIdx <= logicalLast) + removeSectionsFromSectionItems(v, v); } - visualIndices.resize(sectionSpans.count()); - logicalIndices.resize(sectionSpans.count()); + visualIndices.resize(sectionItems.count()); + logicalIndices.resize(sectionItems.count()); int* visual_data = visualIndices.data(); int* logical_data = logicalIndices.data(); - for (int w = 0; w < sectionSpans.count(); ++w) { // Restore visual and logical indexes - int logindex = sectionSpans.at(w).tmpLogIdx; + for (int w = 0; w < sectionItems.count(); ++w) { // Restore visual and logical indexes + int logindex = sectionItems.at(w).tmpLogIdx; if (logindex > logicalFirst) logindex -= changeCount; visual_data[logindex] = w; @@ -2005,7 +2005,7 @@ void QHeaderView::initializeSections(int start, int end) if (end + 1 < d->sectionCount()) { int newCount = end + 1; - d->removeSectionsFromSpans(newCount, d->sectionCount() - 1); + d->removeSectionsFromSectionItems(newCount, d->sectionCount() - 1); if (!d->hiddenSectionSize.isEmpty()) { if (oldCount - newCount > d->hiddenSectionSize.count()) { for (int i = end + 1; i < d->sectionCount(); ++i) @@ -2055,7 +2055,7 @@ void QHeaderView::initializeSections(int start, int end) d->sectionHidden.resize(newSectionCount); if (newSectionCount > oldCount) - d->createSectionSpan(start, end, (end - start + 1) * d->defaultSectionSize, d->globalResizeMode); + d->createSectionItems(start, end, (end - start + 1) * d->defaultSectionSize, d->globalResizeMode); //Q_ASSERT(d->headerLength() == d->length); if (d->sectionCount() != oldCount) @@ -2224,14 +2224,14 @@ void QHeaderView::paintEvent(QPaintEvent *e) } #if 0 - // ### visualize section spans - for (int a = 0, i = 0; i < d->sectionSpans.count(); ++i) { + // ### visualize sections + for (int a = 0, i = 0; i < d->sectionItems.count(); ++i) { QColor color((i & 4 ? 255 : 0), (i & 2 ? 255 : 0), (i & 1 ? 255 : 0)); if (d->orientation == Qt::Horizontal) - painter.fillRect(a - d->offset, 0, d->sectionSpans.at(i).size, 4, color); + painter.fillRect(a - d->offset, 0, d->sectionItems.at(i).size, 4, color); else - painter.fillRect(0, a - d->offset, 4, d->sectionSpans.at(i).size, color); - a += d->sectionSpans.at(i).size; + painter.fillRect(0, a - d->offset, 4, d->sectionItems.at(i).size, color); + a += d->sectionItems.at(i).size; } #endif @@ -3108,6 +3108,7 @@ void QHeaderViewPrivate::resizeSections(QHeaderView::ResizeMode globalMode, bool pixelReminder = lengthToStrech % numberOfStretchedSections; } + // ### The code below would be nicer if it was cleaned up a bit (since spans has been replaced with items) int spanStartSection = 0; int previousSectionLength = 0; @@ -3149,7 +3150,7 @@ void QHeaderViewPrivate::resizeSections(QHeaderView::ResizeMode globalMode, bool if ((previousSectionResizeMode != newSectionResizeMode || previousSectionLength != newSectionLength) && i > 0) { int spanLength = (i - spanStartSection) * previousSectionLength; - createSectionSpan(spanStartSection, i - 1, spanLength, previousSectionResizeMode); + createSectionItems(spanStartSection, i - 1, spanLength, previousSectionResizeMode); //Q_ASSERT(headerLength() == length); spanStartSection = i; } @@ -3161,7 +3162,7 @@ void QHeaderViewPrivate::resizeSections(QHeaderView::ResizeMode globalMode, bool previousSectionResizeMode = newSectionResizeMode; } - createSectionSpan(spanStartSection, sectionCount() - 1, + createSectionItems(spanStartSection, sectionCount() - 1, (sectionCount() - spanStartSection) * previousSectionLength, previousSectionResizeMode); //Q_ASSERT(headerLength() == length); @@ -3169,14 +3170,14 @@ void QHeaderViewPrivate::resizeSections(QHeaderView::ResizeMode globalMode, bool viewport->update(); } -void QHeaderViewPrivate::createSectionSpan(int start, int end, int size, QHeaderView::ResizeMode mode) +void QHeaderViewPrivate::createSectionItems(int start, int end, int size, QHeaderView::ResizeMode mode) { int sizePerSection = size / (end - start + 1); - if (end >= sectionSpans.count()) { - sectionSpans.resize(end + 1); + if (end >= sectionItems.count()) { + sectionItems.resize(end + 1); sectionStartposRecalc = true; } - SectionSpan *sectiondata = sectionSpans.data(); + SectionItem *sectiondata = sectionItems.data(); for (int i = start; i <= end; ++i) { length += (sizePerSection - sectiondata[i].size); sectionStartposRecalc |= (sectiondata[i].size != sizePerSection); @@ -3185,15 +3186,15 @@ void QHeaderViewPrivate::createSectionSpan(int start, int end, int size, QHeader } } -void QHeaderViewPrivate::removeSectionsFromSpans(int start, int end) +void QHeaderViewPrivate::removeSectionsFromSectionItems(int start, int end) { // remove sections - sectionStartposRecalc |= (end != sectionSpans.count() - 1); + sectionStartposRecalc |= (end != sectionItems.count() - 1); int removedlength = 0; for (int u = start; u <= end; ++u) - removedlength += sectionSpans.at(u).size; + removedlength += sectionItems.at(u).size; length -= removedlength; - sectionSpans.remove(start, end - start + 1); + sectionItems.remove(start, end - start + 1); } void QHeaderViewPrivate::clear() @@ -3205,7 +3206,7 @@ void QHeaderViewPrivate::clear() sectionSelected.clear(); sectionHidden.clear(); hiddenSectionSize.clear(); - sectionSpans.clear(); + sectionItems.clear(); } } @@ -3242,7 +3243,7 @@ void QHeaderViewPrivate::cascadingResize(int visual, int newSize) int originalSectionSize = cascadingSectionSize.value(i); if (currentSectionSize < originalSectionSize) { int newSectionSize = currentSectionSize + delta; - resizeSectionSpan(i, currentSectionSize, newSectionSize); + resizeSectionItem(i, currentSectionSize, newSectionSize); if (newSectionSize >= originalSectionSize && false) cascadingSectionSize.remove(i); // the section is now restored sectionResized = true; @@ -3256,7 +3257,7 @@ void QHeaderViewPrivate::cascadingResize(int visual, int newSize) if (!sectionResized) { newSize = qMax(newSize, minimumSize); if (oldSize != newSize) - resizeSectionSpan(visual, oldSize, newSize); + resizeSectionItem(visual, oldSize, newSize); } // cascade the section size change @@ -3268,7 +3269,7 @@ void QHeaderViewPrivate::cascadingResize(int visual, int newSize) continue; int newSectionSize = qMax(currentSectionSize - delta, minimumSize); //qDebug() << "### cascading to" << i << newSectionSize - currentSectionSize << delta; - resizeSectionSpan(i, currentSectionSize, newSectionSize); + resizeSectionItem(i, currentSectionSize, newSectionSize); saveCascadingSectionSize(i, currentSectionSize); delta = delta - (currentSectionSize - newSectionSize); //qDebug() << "new delta" << delta; @@ -3288,7 +3289,7 @@ void QHeaderViewPrivate::cascadingResize(int visual, int newSize) if (currentSectionSize >= originalSectionSize) continue; int newSectionSize = currentSectionSize - delta; - resizeSectionSpan(i, currentSectionSize, newSectionSize); + resizeSectionItem(i, currentSectionSize, newSectionSize); if (newSectionSize >= originalSectionSize && false) { //qDebug() << "section" << i << "restored to" << originalSectionSize; cascadingSectionSize.remove(i); // the section is now restored @@ -3298,7 +3299,7 @@ void QHeaderViewPrivate::cascadingResize(int visual, int newSize) } // resize the section - resizeSectionSpan(visual, oldSize, qMax(newSize, minimumSize)); + resizeSectionItem(visual, oldSize, qMax(newSize, minimumSize)); // cascade the section size change if (delta < 0 && newSize < minimumSize) { @@ -3308,7 +3309,7 @@ void QHeaderViewPrivate::cascadingResize(int visual, int newSize) int sectionSize = headerSectionSize(i); if (sectionSize <= minimumSize) continue; - resizeSectionSpan(i, sectionSize, qMax(sectionSize + delta, minimumSize)); + resizeSectionItem(i, sectionSize, qMax(sectionSize + delta, minimumSize)); saveCascadingSectionSize(i, sectionSize); break; } @@ -3321,7 +3322,7 @@ void QHeaderViewPrivate::cascadingResize(int visual, int newSize) continue; int currentSectionSize = headerSectionSize(i); int newSectionSize = qMax(currentSectionSize - delta, minimumSize); - resizeSectionSpan(i, currentSectionSize, newSectionSize); + resizeSectionItem(i, currentSectionSize, newSectionSize); break; } } @@ -3337,14 +3338,14 @@ void QHeaderViewPrivate::setDefaultSectionSize(int size) { Q_Q(QHeaderView); defaultSectionSize = size; - for (int i = 0; i < sectionSpans.count(); ++i) { - QHeaderViewPrivate::SectionSpan &span = sectionSpans[i]; + for (int i = 0; i < sectionItems.count(); ++i) { + QHeaderViewPrivate::SectionItem §ion = sectionItems[i]; if (sectionHidden.isEmpty() || !sectionHidden.testBit(i)) { // resize on not hidden. const int newSize = size; - if (newSize != span.size) { - length += newSize - span.size; //the whole length is changed - const int oldSectionSize = span.sectionSize(); - span.size = size; + if (newSize != section.size) { + length += newSize - section.size; //the whole length is changed + const int oldSectionSize = section.sectionSize(); + section.size = size; emit q->sectionResized(logicalIndex(i), oldSectionSize, size); } } @@ -3354,25 +3355,25 @@ void QHeaderViewPrivate::setDefaultSectionSize(int size) void QHeaderViewPrivate::recalcSectionStartPos() const // linear (but fast) { int pixelpos = 0; - for (QVector::const_iterator i = sectionSpans.constBegin(); i != sectionSpans.constEnd(); ++i) { + for (QVector::const_iterator i = sectionItems.constBegin(); i != sectionItems.constEnd(); ++i) { i->calculated_startpos = pixelpos; // write into const mutable pixelpos += i->size; } sectionStartposRecalc = false; } -void QHeaderViewPrivate::resizeSectionSpan(int visualIndex, int oldSize, int newSize) +void QHeaderViewPrivate::resizeSectionItem(int visualIndex, int oldSize, int newSize) { Q_Q(QHeaderView); QHeaderView::ResizeMode mode = headerSectionResizeMode(visualIndex); - createSectionSpan(visualIndex, visualIndex, newSize, mode); + createSectionItems(visualIndex, visualIndex, newSize, mode); emit q->sectionResized(logicalIndex(visualIndex), oldSize, newSize); } int QHeaderViewPrivate::headerSectionSize(int visual) const { if (visual < sectionCount() && visual >= 0) - return sectionSpans.at(visual).sectionSize(); + return sectionItems.at(visual).sectionSize(); return -1; } @@ -3381,7 +3382,7 @@ int QHeaderViewPrivate::headerSectionPosition(int visual) const if (visual < sectionCount() && visual >= 0) { if (sectionStartposRecalc) recalcSectionStartPos(); - return sectionSpans.at(visual).calculated_startpos; + return sectionItems.at(visual).calculated_startpos; } return -1; } @@ -3391,13 +3392,13 @@ int QHeaderViewPrivate::headerVisualIndexAt(int position) const if (sectionStartposRecalc) recalcSectionStartPos(); int startidx = 0; - int endidx = sectionSpans.count() - 1; + int endidx = sectionItems.count() - 1; while (startidx <= endidx) { int middle = (endidx + startidx) / 2; - if (sectionSpans.at(middle).calculated_startpos > position) { + if (sectionItems.at(middle).calculated_startpos > position) { endidx = middle - 1; } else { - if (sectionSpans.at(middle).calculatedEndPos() <= position) + if (sectionItems.at(middle).calculatedEndPos() <= position) startidx = middle + 1; else // we found it. return middle; @@ -3409,7 +3410,7 @@ int QHeaderViewPrivate::headerVisualIndexAt(int position) const void QHeaderViewPrivate::setHeaderSectionResizeMode(int visual, QHeaderView::ResizeMode mode) { int size = headerSectionSize(visual); - createSectionSpan(visual, visual, size, mode); + createSectionItems(visual, visual, size, mode); } QHeaderView::ResizeMode QHeaderViewPrivate::headerSectionResizeMode(int visual) const @@ -3417,14 +3418,14 @@ QHeaderView::ResizeMode QHeaderViewPrivate::headerSectionResizeMode(int visual) int span = sectionSpanIndex(visual); if (span == -1) return globalResizeMode; - return sectionSpans.at(span).resizeMode; + return sectionItems.at(span).resizeMode; } void QHeaderViewPrivate::setGlobalHeaderResizeMode(QHeaderView::ResizeMode mode) { globalResizeMode = mode; - for (int i = 0; i < sectionSpans.count(); ++i) - sectionSpans[i].resizeMode = mode; + for (int i = 0; i < sectionItems.count(); ++i) + sectionItems[i].resizeMode = mode; } int QHeaderViewPrivate::viewSectionSizeHint(int logical) const @@ -3442,7 +3443,7 @@ int QHeaderViewPrivate::adjustedVisualIndex(int visualIndex) const if (!sectionHidden.isEmpty()) { int adjustedVisualIndex = visualIndex; int currentVisualIndex = 0; - for (int i = 0; i < sectionSpans.count(); ++i) { + for (int i = 0; i < sectionItems.count(); ++i) { if (sectionHidden.testBit(i)) ++adjustedVisualIndex; else @@ -3484,7 +3485,7 @@ void QHeaderViewPrivate::write(QDataStream &out) const out << int(defaultAlignment); out << int(globalResizeMode); - out << sectionSpans; + out << sectionItems; } bool QHeaderViewPrivate::read(QDataStream &in) @@ -3524,15 +3525,17 @@ bool QHeaderViewPrivate::read(QDataStream &in) in >> global; globalResizeMode = (QHeaderView::ResizeMode)global; - in >> sectionSpans; - // Spans in Qt5 only contains one element - but for backward compability with Qt4 we do the following - QVector newSectionSpans; - for (int u = 0; u < sectionSpans.count(); ++u) { - int count = sectionSpans.at(u).tmpDataStreamSectionCount; + in >> sectionItems; + // In Qt4 we had a vector of spans where one span could hold information on more sections. + // Now we have an itemvector where one items contains information about one section + // For backward compability with Qt4 we do the following + QVector newSectionItems; + for (int u = 0; u < sectionItems.count(); ++u) { + int count = sectionItems.at(u).tmpDataStreamSectionCount; for (int n = 0; n < count; ++n) - newSectionSpans.append(sectionSpans[u]); + newSectionItems.append(sectionItems[u]); } - sectionSpans = newSectionSpans; + sectionItems = newSectionItems; recalcSectionStartPos(); return true; } diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h index a2b0ef2180..d6e6ab991a 100644 --- a/src/widgets/itemviews/qheaderview_p.h +++ b/src/widgets/itemviews/qheaderview_p.h @@ -141,7 +141,7 @@ public: else sectionSelected.fill(false); } - inline int sectionCount() const {return sectionSpans.count();} + inline int sectionCount() const {return sectionItems.count();} inline bool reverse() const { return orientation == Qt::Horizontal && q_func()->isRightToLeft(); @@ -195,7 +195,7 @@ public: } inline void clearCascadingSections() { - firstCascadingSection = sectionSpans.count(); + firstCascadingSection = sectionItems.count(); lastCascadingSection = 0; cascadingSectionSize.clear(); } @@ -283,9 +283,9 @@ public: QHeaderView::ResizeMode globalResizeMode; QList persistentHiddenSections; mutable bool sectionStartposRecalc; - // header section spans + // header sections - struct SectionSpan { + struct SectionItem { int size; union { // This union is made in order to save space and ensure good vector performance (on remove) mutable int calculated_startpos; // <- this is the primary used member. @@ -293,8 +293,8 @@ public: int tmpDataStreamSectionCount; // recalcSectionStartPos() or set sectionStartposRecalc to true }; // to ensure that calculated_startpos will be calculated afterwards. QHeaderView::ResizeMode resizeMode; - inline SectionSpan() : size(0), resizeMode(QHeaderView::Interactive) {} - inline SectionSpan(int length, QHeaderView::ResizeMode mode) + inline SectionItem() : size(0), resizeMode(QHeaderView::Interactive) {} + inline SectionItem(int length, QHeaderView::ResizeMode mode) : size(length), calculated_startpos(-1), resizeMode(mode) {} inline int sectionSize() const { return size; } inline int calculatedEndPos() const { return calculated_startpos + size; } @@ -306,34 +306,34 @@ public: #endif }; - QVector sectionSpans; + QVector sectionItems; - void createSectionSpan(int start, int end, int size, QHeaderView::ResizeMode mode); - void removeSectionsFromSpans(int start, int end); - void resizeSectionSpan(int visualIndex, int oldSize, int newSize); + void createSectionItems(int start, int end, int size, QHeaderView::ResizeMode mode); + void removeSectionsFromSectionItems(int start, int end); + void resizeSectionItem(int visualIndex, int oldSize, int newSize); void setDefaultSectionSize(int size); void recalcSectionStartPos() const; // not really const inline int headerSectionCount() const { // for debugging - return sectionSpans.count(); + return sectionItems.count(); } inline int headerLength() const { // for debugging int len = 0; - for (int i = 0; i < sectionSpans.count(); ++i) - len += sectionSpans.at(i).size; + for (int i = 0; i < sectionItems.count(); ++i) + len += sectionItems.at(i).size; return len; } inline void removeSpans(const QList &spans) { for (int i = spans.count() - 1; i >= 0; --i) { - length -= sectionSpans.at(spans.at(i)).size; - sectionSpans.remove(spans.at(i)); + length -= sectionItems.at(spans.at(i)).size; + sectionItems.remove(spans.at(i)); } } inline int sectionSpanIndex(int visual) const { - if (visual < sectionSpans.count() && visual >= 0) { + if (visual < sectionItems.count() && visual >= 0) { return visual; } return -1; diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp index 1158a9f06b..1518403a64 100644 --- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp +++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp @@ -1947,8 +1947,8 @@ void tst_QHeaderView::noSectionsWithNegativeSize() void tst_QHeaderView::emptySectionSpan() { - QHeaderViewPrivate::SectionSpan span; - QCOMPARE(span.sectionSize(), 0); + QHeaderViewPrivate::SectionItem section; + QCOMPARE(section.sectionSize(), 0); } void tst_QHeaderView::task236450_hidden_data() -- cgit v1.2.3 From e8b098b6367baafda9e494ec4c9ddd1b7bf661ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Tue, 10 Apr 2012 08:22:12 +0200 Subject: QHeaderView - remove some (nearly) unused span functions This removes a couple of functions. Two of them are unused and the last one has its (now) very simple implementation inlined in the only caller. The last function was called something with spans and we would like to get away from using the word 'span' since we no longer uses spans. Change-Id: Icef95166289d52bd958400cba70daceb6fa75913 Reviewed-by: Stephen Kelly --- src/widgets/itemviews/qheaderview.cpp | 5 ++--- src/widgets/itemviews/qheaderview_p.h | 18 ------------------ 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index 444e56d6d0..e6376cef60 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -3415,10 +3415,9 @@ void QHeaderViewPrivate::setHeaderSectionResizeMode(int visual, QHeaderView::Res QHeaderView::ResizeMode QHeaderViewPrivate::headerSectionResizeMode(int visual) const { - int span = sectionSpanIndex(visual); - if (span == -1) + if (visual < 0 || visual >= sectionItems.count()) return globalResizeMode; - return sectionItems.at(span).resizeMode; + return sectionItems.at(visual).resizeMode; } void QHeaderViewPrivate::setGlobalHeaderResizeMode(QHeaderView::ResizeMode mode) diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h index d6e6ab991a..cca81b0c22 100644 --- a/src/widgets/itemviews/qheaderview_p.h +++ b/src/widgets/itemviews/qheaderview_p.h @@ -314,10 +314,6 @@ public: void setDefaultSectionSize(int size); void recalcSectionStartPos() const; // not really const - inline int headerSectionCount() const { // for debugging - return sectionItems.count(); - } - inline int headerLength() const { // for debugging int len = 0; for (int i = 0; i < sectionItems.count(); ++i) @@ -325,20 +321,6 @@ public: return len; } - inline void removeSpans(const QList &spans) { - for (int i = spans.count() - 1; i >= 0; --i) { - length -= sectionItems.at(spans.at(i)).size; - sectionItems.remove(spans.at(i)); - } - } - - inline int sectionSpanIndex(int visual) const { - if (visual < sectionItems.count() && visual >= 0) { - return visual; - } - return -1; - } - int headerSectionSize(int visual) const; int headerSectionPosition(int visual) const; int headerVisualIndexAt(int position) const; -- cgit v1.2.3 From 127c431e25208e98304a1e9dc1140fdfba078be8 Mon Sep 17 00:00:00 2001 From: Christoph Schleifenbaum Date: Sat, 31 Mar 2012 10:24:52 +0200 Subject: Add Mac OS X backend for QDesktopServices. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie48844ed93385c8aef9ae0765b7a3d26583ed642 Reviewed-by: James Turner Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/cocoa.pro | 2 + src/plugins/platforms/cocoa/qcocoaintegration.h | 3 ++ src/plugins/platforms/cocoa/qcocoaintegration.mm | 6 +++ src/plugins/platforms/cocoa/qcocoaservices.h | 58 ++++++++++++++++++++ src/plugins/platforms/cocoa/qcocoaservices.mm | 69 ++++++++++++++++++++++++ 5 files changed, 138 insertions(+) create mode 100644 src/plugins/platforms/cocoa/qcocoaservices.h create mode 100644 src/plugins/platforms/cocoa/qcocoaservices.mm diff --git a/src/plugins/platforms/cocoa/cocoa.pro b/src/plugins/platforms/cocoa/cocoa.pro index 2ae39dd16c..f149a6775b 100644 --- a/src/plugins/platforms/cocoa/cocoa.pro +++ b/src/plugins/platforms/cocoa/cocoa.pro @@ -36,6 +36,7 @@ OBJECTIVE_SOURCES += main.mm \ qpaintengine_mac.mm \ qprintengine_mac.mm \ qcocoaprintersupport.mm \ + qcocoaservices.mm \ HEADERS += qcocoaintegration.h \ qcocoatheme.h \ @@ -69,6 +70,7 @@ HEADERS += qcocoaintegration.h \ qpaintengine_mac_p.h \ qprintengine_mac_p.h \ qcocoaprintersupport.h \ + qcocoaservices.h \ FORMS += $$PWD/../../../widgets/dialogs/qfiledialog.ui RESOURCES += qcocoaresources.qrc diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h index fb3ee3290e..b3eeab3f7a 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.h +++ b/src/plugins/platforms/cocoa/qcocoaintegration.h @@ -48,6 +48,7 @@ #include "qcocoacursor.h" #include "qcocoaclipboard.h" #include "qcocoadrag.h" +#include "qcocoaservices.h" #include #include @@ -99,6 +100,7 @@ public: QStringList themeNames() const; QPlatformTheme *createPlatformTheme(const QString &name) const; + QPlatformServices *services() const; private: @@ -111,6 +113,7 @@ private: QList mScreens; QCocoaClipboard *mCocoaClipboard; QScopedPointer mCocoaDrag; + QScopedPointer mServices; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index f91351ad46..0a3790fd72 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -99,6 +99,7 @@ QCocoaIntegration::QCocoaIntegration() , mAccessibility(new QPlatformAccessibility) , mCocoaClipboard(new QCocoaClipboard) , mCocoaDrag(new QCocoaDrag) + , mServices(new QCocoaServices) { QCocoaAutoReleasePool pool; @@ -239,4 +240,9 @@ QPlatformTheme *QCocoaIntegration::createPlatformTheme(const QString &name) cons return QPlatformIntegration::createPlatformTheme(name); } +QPlatformServices *QCocoaIntegration::services() const +{ + return mServices.data(); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/cocoa/qcocoaservices.h b/src/plugins/platforms/cocoa/qcocoaservices.h new file mode 100644 index 0000000000..022c39dc57 --- /dev/null +++ b/src/plugins/platforms/cocoa/qcocoaservices.h @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QCOCOADESKTOPSERVICES_H +#define QCOCOADESKTOPSERVICES_H + +#include + +QT_BEGIN_NAMESPACE + +class QCocoaServices : public QPlatformServices +{ +public: + bool openUrl(const QUrl &url); + bool openDocument(const QUrl &url); +}; + +QT_END_NAMESPACE + +#endif // QCOCOADESKTOPSERVICES_H diff --git a/src/plugins/platforms/cocoa/qcocoaservices.mm b/src/plugins/platforms/cocoa/qcocoaservices.mm new file mode 100644 index 0000000000..60bd62eef8 --- /dev/null +++ b/src/plugins/platforms/cocoa/qcocoaservices.mm @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qcocoaservices.h" + +#include "qt_mac_p.h" + +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +bool QCocoaServices::openUrl(const QUrl &url) +{ + const QString scheme = url.scheme(); + if (scheme.isEmpty()) + return openDocument(url); + return [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:QT_PREPEND_NAMESPACE(QCFString::toNSString)(url.toString())]]; +} + +bool QCocoaServices::openDocument(const QUrl &url) +{ + if (!url.isValid()) + return false; + + return [[NSWorkspace sharedWorkspace] openFile:QT_PREPEND_NAMESPACE(QCFString::toNSString)(url.toLocalFile())]; +} + +QT_END_NAMESPACE -- cgit v1.2.3 From 42f3bf772bab75d639b9211d66a0e085538526e2 Mon Sep 17 00:00:00 2001 From: Donald Carr Date: Tue, 10 Apr 2012 17:20:31 +0000 Subject: Extend eglhooks to include hasCapability MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add BufferQueueingOpenGL to Raspberry PI's numerous capabilities Change-Id: I1197c28a0c82df3ae2f6d5360791010e17373555 Reviewed-by: Girish Ramakrishnan Reviewed-by: Donald Carr Reviewed-by: Samuel Rødal --- .../linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp | 5 +++++ mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp | 13 +++++++++++++ src/plugins/platforms/eglfs/qeglfs_hooks.h | 8 ++++++++ src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp | 5 +++++ src/plugins/platforms/eglfs/qeglfsintegration.cpp | 4 ++++ src/plugins/platforms/eglfs/qeglfsscreen.cpp | 7 ------- 6 files changed, 35 insertions(+), 7 deletions(-) diff --git a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp index 06cb424e4f..40fb2a336b 100644 --- a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp +++ b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp @@ -92,4 +92,9 @@ void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) delete window; } +bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + return false; +} + QEglFSHooks platform_hooks; diff --git a/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp b/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp index 2cbd297a90..f17af55947 100644 --- a/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp +++ b/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp @@ -140,4 +140,17 @@ void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) delete eglWindow; } +bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + switch (cap) { + case QPlatformIntegration::ThreadedPixmaps: + case QPlatformIntegration::OpenGL: + case QPlatformIntegration::ThreadedOpenGL: + case QPlatformIntegration::BufferQueueingOpenGL: + return true; + default: + return false; + } +} + QEglFSHooks platform_hooks; diff --git a/src/plugins/platforms/eglfs/qeglfs_hooks.h b/src/plugins/platforms/eglfs/qeglfs_hooks.h index a30af9409f..628ef1f33b 100644 --- a/src/plugins/platforms/eglfs/qeglfs_hooks.h +++ b/src/plugins/platforms/eglfs/qeglfs_hooks.h @@ -54,8 +54,16 @@ struct QEglFSHooks { QSize screenSize() const; EGLNativeWindowType createNativeWindow(const QSize &size); void destroyNativeWindow(EGLNativeWindowType window); + bool hasCapability(QPlatformIntegration::Capability cap) const; }; +#ifdef EGLFS_PLATFORM_HOOKS +extern QEglFSHooks platform_hooks; +static QEglFSHooks *hooks = &platform_hooks; +#else +static QEglFSHooks *hooks = 0; +#endif + QT_END_NAMESPACE #endif diff --git a/src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp b/src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp index baba3be492..594614e7a0 100644 --- a/src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp +++ b/src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp @@ -88,3 +88,8 @@ void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) XDestroyWindow(display, window); } +bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + return false; +} + diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index d9214f87fe..b1f5a69570 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -74,6 +74,10 @@ QEglFSIntegration::~QEglFSIntegration() bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) const { + // We assume that devices will have more and not less capabilities + if (hooks && hooks->hasCapability(cap)) + return true; + switch (cap) { case ThreadedPixmaps: return true; case OpenGL: return true; diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp index c7e983b0fb..3c2f4c580d 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp @@ -53,13 +53,6 @@ QT_BEGIN_NAMESPACE -#ifdef EGLFS_PLATFORM_HOOKS -extern QEglFSHooks platform_hooks; -static QEglFSHooks *hooks = &platform_hooks; -#else -static QEglFSHooks *hooks = 0; -#endif - // #define QEGL_EXTRA_DEBUG #ifdef QEGL_EXTRA_DEBUG -- cgit v1.2.3 From e60ca0de6015a8ee16c7be54d0d430252ef525c1 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 10 Apr 2012 22:06:48 -0700 Subject: eglfs: rework hooks design MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are two problems with the current design: 1. if (hooks) hooks->foo() doesn't work in debug mode when no platform hook is defined. The problem doesn't arise in release mode because the compiler optimizes away the if (hooks) into a no-op since hooks is NULL when no platform hook is defined. 2. Adding a new hook requires changing every platform's hook implementation. New approach: 1. Define QEglFSHooks as a class with virtual functions. A stub file provides the default implementation. 2. Platform hooks derive from above class and reimplement whatever is needed. The filenames and variables have been changed to be more in line with the Qt style. Change-Id: I2eaaa5ad7c8b48a06361c4747d4f210c428c983f Reviewed-by: Samuel Rødal --- .../qeglfs_hooks_8726m.cpp | 100 ------------ .../qeglfshooks_8726m.cpp | 92 +++++++++++ .../devices/linux-arm-amlogic-8726M-g++/qmake.conf | 2 +- mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp | 156 ------------------- .../devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp | 169 +++++++++++++++++++++ mkspecs/devices/linux-rasp-pi-g++/qmake.conf | 2 +- src/plugins/platforms/eglfs/eglfs.pro | 7 +- src/plugins/platforms/eglfs/qeglfs_hooks.h | 69 --------- src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp | 95 ------------ src/plugins/platforms/eglfs/qeglfshooks.h | 72 +++++++++ src/plugins/platforms/eglfs/qeglfshooks_stub.cpp | 81 ++++++++++ src/plugins/platforms/eglfs/qeglfshooks_x11.cpp | 110 ++++++++++++++ src/plugins/platforms/eglfs/qeglfsintegration.cpp | 2 +- src/plugins/platforms/eglfs/qeglfsscreen.cpp | 2 +- 14 files changed, 532 insertions(+), 427 deletions(-) delete mode 100644 mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp create mode 100644 mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfshooks_8726m.cpp delete mode 100644 mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp create mode 100644 mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp delete mode 100644 src/plugins/platforms/eglfs/qeglfs_hooks.h delete mode 100644 src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp create mode 100644 src/plugins/platforms/eglfs/qeglfshooks.h create mode 100644 src/plugins/platforms/eglfs/qeglfshooks_stub.cpp create mode 100644 src/plugins/platforms/eglfs/qeglfshooks_x11.cpp diff --git a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp deleted file mode 100644 index 40fb2a336b..0000000000 --- a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfs_hooks_8726m.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the qmake spec of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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, Nokia gives you certain additional -** rights. These rights are described in the Nokia 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. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qeglfs_hooks.h" -#include -#include -#include -#include -#include -#include -#include - -void QEglFSHooks::platformInit() -{ -} - -void QEglFSHooks::platformDestroy() -{ -} - -EGLNativeDisplayType QEglFSHooks::platformDisplay() const -{ - return EGL_DEFAULT_DISPLAY; -} - -QSize QEglFSHooks::screenSize() const -{ - int fd = open("/dev/fb0", O_RDONLY); - if (fd == -1) { - qFatal("Failed to open fb to detect screen resolution!"); - } - - struct fb_var_screeninfo vinfo; - if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) == -1) { - qFatal("Could not get variable screen info"); - } - - close(fd); - - return QSize(vinfo.xres, vinfo.yres); -} - -EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) -{ - fbdev_window *window = new fbdev_window; - window->width = size.width(); - window->height = size.height(); - - return window; -} - -void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) -{ - delete window; -} - -bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const -{ - return false; -} - -QEglFSHooks platform_hooks; diff --git a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfshooks_8726m.cpp b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfshooks_8726m.cpp new file mode 100644 index 0000000000..6655c50573 --- /dev/null +++ b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qeglfshooks_8726m.cpp @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qeglfshooks.h" +#include +#include +#include +#include +#include +#include +#include + +class QEglFS8726MHooks : public QEglFSHooks +{ +public: + virtual QSize screenSize() const; + virtual EGLNativeWindowType createNativeWindow(const QSize &size); + virtual void destroyNativeWindow(EGLNativeWindowType window); +}; + +QSize QEglFS8726MHooks::screenSize() const +{ + int fd = open("/dev/fb0", O_RDONLY); + if (fd == -1) { + qFatal("Failed to open fb to detect screen resolution!"); + } + + struct fb_var_screeninfo vinfo; + if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) == -1) { + qFatal("Could not get variable screen info"); + } + + close(fd); + + return QSize(vinfo.xres, vinfo.yres); +} + +EGLNativeWindowType QEglFS8726MHooks::createNativeWindow(const QSize &size) +{ + fbdev_window *window = new fbdev_window; + window->width = size.width(); + window->height = size.height(); + + return window; +} + +void QEglFS8726MHooks::destroyNativeWindow(EGLNativeWindowType window) +{ + delete window; +} + +QEglFS8726MHooks eglFS8726MHooks; +QEglFSHooks *platformHooks = &eglFS8726MHooks; + diff --git a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf index b0b02f32e6..7525397a65 100644 --- a/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf +++ b/mkspecs/devices/linux-arm-amlogic-8726M-g++/qmake.conf @@ -31,6 +31,6 @@ QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE deviceSanityCheckCompiler() -EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfs_hooks_8726m.cpp +EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_8726m.cpp load(qt_config) diff --git a/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp b/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp deleted file mode 100644 index f17af55947..0000000000 --- a/mkspecs/devices/linux-rasp-pi-g++/qeglfs_hooks.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the qmake spec of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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, Nokia gives you certain additional -** rights. These rights are described in the Nokia 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. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qeglfs_hooks.h" - -#include - -#if 0 //fb size query -#include -#include -#include -#include -#include -#include -#endif - -static DISPMANX_DISPLAY_HANDLE_T dispman_display = 0; -static DISPMANX_UPDATE_HANDLE_T dispman_update = 0; - -void QEglFSHooks::platformInit() -{ - bcm_host_init(); -} - -EGLNativeDisplayType QEglFSHooks::platformDisplay() const -{ - dispman_display = vc_dispmanx_display_open(0/* LCD */); - return EGL_DEFAULT_DISPLAY; -} - -void QEglFSHooks::platformDestroy() -{ - vc_dispmanx_display_close(dispman_display); -} - -QSize QEglFSHooks::screenSize() const -{ - //both mechanisms work -#if 1 - uint32_t width, height; - graphics_get_display_size(0 /* LCD */, &width, &height); - return QSize(width, height); -#else - int fd = open("/dev/fb0", O_RDONLY); - if (fd == -1) { - fprintf(stderr, "Failed to open fb to detect screen resolution!\n"); - return QSize(); - } - - struct fb_var_screeninfo vinfo; - if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) = -1) { - fprintf(stderr, "Could not query screen info variable\n"); - close(fd); - return QSize(); - } - - close(fd); - - return QSize(vinfo.xres, vinfo.yres); -#endif -} - -EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) -{ - VC_RECT_T dst_rect; - dst_rect.x = 0; - dst_rect.y = 0; - dst_rect.width = size.width(); - dst_rect.height = size.height(); - - VC_RECT_T src_rect; - src_rect.x = 0; - src_rect.y = 0; - src_rect.width = size.width() << 16; - src_rect.height = size.height() << 16; - - dispman_update = vc_dispmanx_update_start(0); - - VC_DISPMANX_ALPHA_T alpha; - alpha.flags = DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS; - alpha.opacity = 0xFF; - alpha.mask = 0; - - DISPMANX_ELEMENT_HANDLE_T dispman_element = vc_dispmanx_element_add( - dispman_update, dispman_display, 0, &dst_rect, 0, &src_rect, - DISPMANX_PROTECTION_NONE, &alpha, (DISPMANX_CLAMP_T *)NULL, (DISPMANX_TRANSFORM_T)0); - - vc_dispmanx_update_submit_sync(dispman_update); - - EGL_DISPMANX_WINDOW_T *eglWindow = new EGL_DISPMANX_WINDOW_T; - eglWindow->element = dispman_element; - eglWindow->width = size.width(); - eglWindow->height = size.height(); - - return eglWindow; -} - -void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) -{ - EGL_DISPMANX_WINDOW_T *eglWindow = static_cast(window); - vc_dispmanx_element_remove(dispman_update, eglWindow->element); - delete eglWindow; -} - -bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const -{ - switch (cap) { - case QPlatformIntegration::ThreadedPixmaps: - case QPlatformIntegration::OpenGL: - case QPlatformIntegration::ThreadedOpenGL: - case QPlatformIntegration::BufferQueueingOpenGL: - return true; - default: - return false; - } -} - -QEglFSHooks platform_hooks; diff --git a/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp b/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp new file mode 100644 index 0000000000..21052a5b63 --- /dev/null +++ b/mkspecs/devices/linux-rasp-pi-g++/qeglfshooks_pi.cpp @@ -0,0 +1,169 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qeglfshooks.h" + +#include + +#if 0 //fb size query +#include +#include +#include +#include +#include +#include +#endif + +static DISPMANX_DISPLAY_HANDLE_T dispman_display = 0; +static DISPMANX_UPDATE_HANDLE_T dispman_update = 0; + +class QEglFSPiHooks : public QEglFSHooks +{ +public: + virtual void platformInit(); + virtual void platformDestroy(); + virtual EGLNativeDisplayType platformDisplay() const; + virtual QSize screenSize() const; + virtual EGLNativeWindowType createNativeWindow(const QSize &size); + virtual void destroyNativeWindow(EGLNativeWindowType window); + virtual bool hasCapability(QPlatformIntegration::Capability cap) const; +}; + +void QEglFSPiHooks::platformInit() +{ + bcm_host_init(); +} + +EGLNativeDisplayType QEglFSPiHooks::platformDisplay() const +{ + dispman_display = vc_dispmanx_display_open(0/* LCD */); + return EGL_DEFAULT_DISPLAY; +} + +void QEglFSPiHooks::platformDestroy() +{ + vc_dispmanx_display_close(dispman_display); +} + +QSize QEglFSPiHooks::screenSize() const +{ + //both mechanisms work +#if 1 + uint32_t width, height; + graphics_get_display_size(0 /* LCD */, &width, &height); + return QSize(width, height); +#else + int fd = open("/dev/fb0", O_RDONLY); + if (fd == -1) { + fprintf(stderr, "Failed to open fb to detect screen resolution!\n"); + return QSize(); + } + + struct fb_var_screeninfo vinfo; + if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) = -1) { + fprintf(stderr, "Could not query screen info variable\n"); + close(fd); + return QSize(); + } + + close(fd); + + return QSize(vinfo.xres, vinfo.yres); +#endif +} + +EGLNativeWindowType QEglFSPiHooks::createNativeWindow(const QSize &size) +{ + VC_RECT_T dst_rect; + dst_rect.x = 0; + dst_rect.y = 0; + dst_rect.width = size.width(); + dst_rect.height = size.height(); + + VC_RECT_T src_rect; + src_rect.x = 0; + src_rect.y = 0; + src_rect.width = size.width() << 16; + src_rect.height = size.height() << 16; + + dispman_update = vc_dispmanx_update_start(0); + + VC_DISPMANX_ALPHA_T alpha; + alpha.flags = DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS; + alpha.opacity = 0xFF; + alpha.mask = 0; + + DISPMANX_ELEMENT_HANDLE_T dispman_element = vc_dispmanx_element_add( + dispman_update, dispman_display, 0, &dst_rect, 0, &src_rect, + DISPMANX_PROTECTION_NONE, &alpha, (DISPMANX_CLAMP_T *)NULL, (DISPMANX_TRANSFORM_T)0); + + vc_dispmanx_update_submit_sync(dispman_update); + + EGL_DISPMANX_WINDOW_T *eglWindow = new EGL_DISPMANX_WINDOW_T; + eglWindow->element = dispman_element; + eglWindow->width = size.width(); + eglWindow->height = size.height(); + + return eglWindow; +} + +void QEglFSPiHooks::destroyNativeWindow(EGLNativeWindowType window) +{ + EGL_DISPMANX_WINDOW_T *eglWindow = static_cast(window); + vc_dispmanx_element_remove(dispman_update, eglWindow->element); + delete eglWindow; +} + +bool QEglFSPiHooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + switch (cap) { + case QPlatformIntegration::ThreadedPixmaps: + case QPlatformIntegration::OpenGL: + case QPlatformIntegration::ThreadedOpenGL: + case QPlatformIntegration::BufferQueueingOpenGL: + return true; + default: + return false; + } +} + +QEglFSPiHooks eglFSPiHooks; +QEglFSHooks *platformHooks = &eglFSPiHooks; diff --git a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf index 326d6b3b61..4c75e0b0b2 100644 --- a/mkspecs/devices/linux-rasp-pi-g++/qmake.conf +++ b/mkspecs/devices/linux-rasp-pi-g++/qmake.conf @@ -48,7 +48,7 @@ QMAKE_CFLAGS_RELEASE += \ QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE -EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfs_hooks.cpp +EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_pi.cpp # Sanity check deviceSanityCheckCompiler() diff --git a/src/plugins/platforms/eglfs/eglfs.pro b/src/plugins/platforms/eglfs/eglfs.pro index 9a36cacd05..421bbd5561 100644 --- a/src/plugins/platforms/eglfs/eglfs.pro +++ b/src/plugins/platforms/eglfs/eglfs.pro @@ -13,20 +13,21 @@ DESTDIR = $$QT.gui.plugins/platforms DEFINES += MESA_EGL_NO_X11_HEADERS #To test the hooks on x11 (xlib), comment the above define too -#EGLFS_PLATFORM_HOOKS_SOURCES += qeglfs_hooks_x11.cpp +#EGLFS_PLATFORM_HOOKS_SOURCES += qeglfshooks_x11.cpp #LIBS += -lX11 SOURCES = main.cpp \ qeglfsintegration.cpp \ qeglfswindow.cpp \ qeglfsbackingstore.cpp \ - qeglfsscreen.cpp + qeglfsscreen.cpp \ + qeglfshooks_stub.cpp HEADERS = qeglfsintegration.h \ qeglfswindow.h \ qeglfsbackingstore.h \ qeglfsscreen.h \ - qeglfs_hooks.h + qeglfshooks.h QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF diff --git a/src/plugins/platforms/eglfs/qeglfs_hooks.h b/src/plugins/platforms/eglfs/qeglfs_hooks.h deleted file mode 100644 index 628ef1f33b..0000000000 --- a/src/plugins/platforms/eglfs/qeglfs_hooks.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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, Nokia gives you certain additional -** rights. These rights are described in the Nokia 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. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QEGLFS_HOOKS_H -#define QEGLFS_HOOKS_H - -#include "qplatformintegration_qpa.h" -#include - -QT_BEGIN_NAMESPACE - -struct QEglFSHooks { - void platformInit(); - void platformDestroy(); - EGLNativeDisplayType platformDisplay() const; - QSize screenSize() const; - EGLNativeWindowType createNativeWindow(const QSize &size); - void destroyNativeWindow(EGLNativeWindowType window); - bool hasCapability(QPlatformIntegration::Capability cap) const; -}; - -#ifdef EGLFS_PLATFORM_HOOKS -extern QEglFSHooks platform_hooks; -static QEglFSHooks *hooks = &platform_hooks; -#else -static QEglFSHooks *hooks = 0; -#endif - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp b/src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp deleted file mode 100644 index 594614e7a0..0000000000 --- a/src/plugins/platforms/eglfs/qeglfs_hooks_x11.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the qmake spec of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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, Nokia gives you certain additional -** rights. These rights are described in the Nokia 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. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qeglfs_hooks.h" - -#include - -QEglFSHooks platform_hooks; -static Display *display = 0; - -void QEglFSHooks::platformInit() -{ - display = XOpenDisplay(NULL); - if (!display) - qFatal("Could not open display"); -} - -void QEglFSHooks::platformDestroy() -{ - XCloseDisplay(display); -} - -EGLNativeDisplayType QEglFSHooks::platformDisplay() const -{ - return display; -} - -QSize QEglFSHooks::screenSize() const -{ - QList env = qgetenv("EGLFS_X11_SIZE").split('x'); - if (env.length() != 2) - return QSize(640, 480); - return QSize(env.at(0).toInt(), env.at(1).toInt()); -} - -EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) -{ - Window root = DefaultRootWindow(display); - XSetWindowAttributes swa; - memset(&swa, 0, sizeof(swa)); - Window win = XCreateWindow(display, root, 0, 0, size.width(), size.height(), 0, CopyFromParent, - InputOutput, CopyFromParent, CWEventMask, &swa); - XMapWindow(display, win); - XStoreName(display, win, "EGLFS"); - return win; -} - -void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) -{ - XDestroyWindow(display, window); -} - -bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const -{ - return false; -} - diff --git a/src/plugins/platforms/eglfs/qeglfshooks.h b/src/plugins/platforms/eglfs/qeglfshooks.h new file mode 100644 index 0000000000..a56c80261b --- /dev/null +++ b/src/plugins/platforms/eglfs/qeglfshooks.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QEGLFSHOOKS_H +#define QEGLFSHOOKS_H + +#include "qplatformintegration_qpa.h" +#include + +QT_BEGIN_NAMESPACE + +class QEglFSHooks +{ +public: + virtual void platformInit(); + virtual void platformDestroy(); + virtual EGLNativeDisplayType platformDisplay() const; + virtual QSize screenSize() const; + virtual EGLNativeWindowType createNativeWindow(const QSize &size); + virtual void destroyNativeWindow(EGLNativeWindowType window); + virtual bool hasCapability(QPlatformIntegration::Capability cap) const; +}; + +#ifdef EGLFS_PLATFORM_HOOKS +extern QEglFSHooks *platformHooks; +static QEglFSHooks *hooks = platformHooks; +#else +extern QEglFSHooks stubHooks; +static QEglFSHooks *hooks = &stubHooks; +#endif + +QT_END_NAMESPACE + +#endif // QEGLFSHOOKS_H diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp new file mode 100644 index 0000000000..7cc3527a0c --- /dev/null +++ b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qeglfshooks.h" + +void QEglFSHooks::platformInit() +{ +} + +void QEglFSHooks::platformDestroy() +{ +} + +EGLNativeDisplayType QEglFSHooks::platformDisplay() const +{ + return EGL_DEFAULT_DISPLAY; +} + +QSize QEglFSHooks::screenSize() const +{ + return QSize(); +} + +EGLNativeWindowType QEglFSHooks::createNativeWindow(const QSize &size) +{ + Q_UNUSED(size); + return 0; +} + +void QEglFSHooks::destroyNativeWindow(EGLNativeWindowType window) +{ + Q_UNUSED(window); +} + +bool QEglFSHooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + Q_UNUSED(cap); + return false; +} + +#ifndef EGLFS_PLATFORM_HOOKS +QEglFSHooks stubHooks; +#endif diff --git a/src/plugins/platforms/eglfs/qeglfshooks_x11.cpp b/src/plugins/platforms/eglfs/qeglfshooks_x11.cpp new file mode 100644 index 0000000000..cb788c52f2 --- /dev/null +++ b/src/plugins/platforms/eglfs/qeglfshooks_x11.cpp @@ -0,0 +1,110 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qeglfshooks.h" + +#include + +class QEglFSX11Hooks : public QEglFSHooks +{ +public: + virtual void platformInit(); + virtual void platformDestroy(); + virtual EGLNativeDisplayType platformDisplay() const; + virtual QSize screenSize() const; + virtual EGLNativeWindowType createNativeWindow(const QSize &size); + virtual void destroyNativeWindow(EGLNativeWindowType window); + virtual bool hasCapability(QPlatformIntegration::Capability cap) const; +}; + +static Display *display = 0; + +void QEglFSX11Hooks::platformInit() +{ + display = XOpenDisplay(NULL); + if (!display) + qFatal("Could not open display"); +} + +void QEglFSX11Hooks::platformDestroy() +{ + XCloseDisplay(display); +} + +EGLNativeDisplayType QEglFSX11Hooks::platformDisplay() const +{ + return display; +} + +QSize QEglFSX11Hooks::screenSize() const +{ + QList env = qgetenv("EGLFS_X11_SIZE").split('x'); + if (env.length() != 2) + return QSize(640, 480); + return QSize(env.at(0).toInt(), env.at(1).toInt()); +} + +EGLNativeWindowType QEglFSX11Hooks::createNativeWindow(const QSize &size) +{ + Window root = DefaultRootWindow(display); + XSetWindowAttributes swa; + memset(&swa, 0, sizeof(swa)); + Window win = XCreateWindow(display, root, 0, 0, size.width(), size.height(), 0, CopyFromParent, + InputOutput, CopyFromParent, CWEventMask, &swa); + XMapWindow(display, win); + XStoreName(display, win, "EGLFS"); + return win; +} + +void QEglFSX11Hooks::destroyNativeWindow(EGLNativeWindowType window) +{ + XDestroyWindow(display, window); +} + +bool QEglFSX11Hooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + Q_UNUSED(cap); + return false; +} + +static QEglFSX11Hooks eglFSX11Hooks; +QEglFSHooks *platformHooks = &eglFSX11Hooks; + diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index b1f5a69570..9b7d9246f9 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -43,7 +43,7 @@ #include "qeglfswindow.h" #include "qeglfsbackingstore.h" -#include "qeglfs_hooks.h" +#include "qeglfshooks.h" #include #include diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp index 3c2f4c580d..ea939a9821 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp @@ -41,7 +41,7 @@ #include "qeglfsscreen.h" #include "qeglfswindow.h" -#include "qeglfs_hooks.h" +#include "qeglfshooks.h" #include #include -- cgit v1.2.3 From 3f9a7f955708be6152e98132cf34e4738365c173 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Tue, 10 Apr 2012 22:39:01 +1000 Subject: Remove Qt5 to-do comment in qtexthtmlparser.cpp. The comment relates to a change that is neither source- nor binary-incompatible, so the change can be done in any minor release. Task-number: QTBUG-25117 Change-Id: Ifba3ef53241f9bf2504c573066e4cfa5fbfe679e Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtexthtmlparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index da08c4e468..7005fca902 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -1051,7 +1051,7 @@ void QTextHtmlParserNode::initializeProperties(const QTextHtmlParserNode *parent && !attributes.at(i + 1).isEmpty()) { hasHref = true; charFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline); - charFormat.setForeground(Qt::blue); // ### Qt5: QApplication::palette().link()); + charFormat.setForeground(Qt::blue); } } -- cgit v1.2.3 From 9cdfeb2b84bcdb4f9dd5060283c0745224a7c58d Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Sat, 31 Mar 2012 12:41:00 +0200 Subject: Change default value of QMAKE_LIBS_OPENGL_ES1 to libGLESv1_CM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The naming convention for these libraries says that libGLES_CM is to be used when EGL is included while libGLESv1_CM should be used when EGL is not included. Since we have a seperate variable for libEGL, it makes sense to have this variable represent the non-EGL version of the library. Change-Id: I9147c116da7be4a296a0ebeac39762b46725f10e Reviewed-by: Oswald Buddenhagen Reviewed-by: Samuel Rødal --- mkspecs/common/linux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf index fd10785079..064d16c359 100644 --- a/mkspecs/common/linux.conf +++ b/mkspecs/common/linux.conf @@ -30,7 +30,7 @@ QMAKE_LIBS_NIS = -lnsl QMAKE_LIBS_EGL = -lEGL QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_QT = -lGL -QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM +QMAKE_LIBS_OPENGL_ES1 = -lGLESv1_CM QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 QMAKE_LIBS_OPENVG = -lOpenVG QMAKE_LIBS_THREAD = -lpthread -- cgit v1.2.3 From c343f710f4d59643ab6b6d200cff29edee482094 Mon Sep 17 00:00:00 2001 From: Hannu Lyytinen Date: Tue, 10 Apr 2012 16:12:21 +0300 Subject: Use the new plugin system in the KMS plugin. Sync up the KMS QPA plugin with the plugin system changes. Change-Id: Ifaa8be6f11aeb93acc63643c62ca15db4e9bc38f Reviewed-by: Andy Nichols --- src/plugins/platforms/kms/kms.json | 3 +++ src/plugins/platforms/kms/kms.pro | 21 +++++++-------------- src/plugins/platforms/kms/main.cpp | 6 ++++-- 3 files changed, 14 insertions(+), 16 deletions(-) create mode 100644 src/plugins/platforms/kms/kms.json diff --git a/src/plugins/platforms/kms/kms.json b/src/plugins/platforms/kms/kms.json new file mode 100644 index 0000000000..be662226ae --- /dev/null +++ b/src/plugins/platforms/kms/kms.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "kms" ] +} diff --git a/src/plugins/platforms/kms/kms.pro b/src/plugins/platforms/kms/kms.pro index 73a3fa0418..5b91326a39 100644 --- a/src/plugins/platforms/kms/kms.pro +++ b/src/plugins/platforms/kms/kms.pro @@ -1,11 +1,12 @@ TARGET = qkms - load(qt_plugin) -QTDIR_build:DESTDIR = $$QT_BUILD_TREE/plugins/platforms -QT = core-private gui-private platformsupport-private opengl-private +QT += core-private gui-private platformsupport-private opengl-private +DESTDIR = $$QT.gui.plugins/platforms + +DEFINES += MESA_EGL_NO_X11_HEADERS -CONFIG += link_pkgconfig qpa/genericunixfontdatabase +CONFIG += link_pkgconfig egl qpa/genericunixfontdatabase PKGCONFIG += libdrm egl gbm glesv2 @@ -30,13 +31,5 @@ HEADERS = qkmsintegration.h \ target.path += $$[QT_INSTALL_PLUGINS]/platforms INSTALLS += target - - - - - - - - - - +OTHER_FILES += \ + kms.json diff --git a/src/plugins/platforms/kms/main.cpp b/src/plugins/platforms/kms/main.cpp index d79d0d240f..422fc5fba6 100644 --- a/src/plugins/platforms/kms/main.cpp +++ b/src/plugins/platforms/kms/main.cpp @@ -46,6 +46,8 @@ QT_BEGIN_NAMESPACE class QKmsIntegrationPlugin : public QPlatformIntegrationPlugin { + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "kms.json") public: QStringList keys() const; QPlatformIntegration *create(const QString&, const QStringList&); @@ -67,6 +69,6 @@ QPlatformIntegration *QKmsIntegrationPlugin::create(const QString& system, const return 0; } -Q_EXPORT_PLUGIN2(kms, QKmsIntegrationPlugin) - QT_END_NAMESPACE + +#include "main.moc" -- cgit v1.2.3 From 38da61fdc025b9a88371dc616f2dfc53f4d70d3c Mon Sep 17 00:00:00 2001 From: Hannu Lyytinen Date: Tue, 10 Apr 2012 20:10:03 +0300 Subject: Release the EGL context after initialization. Threaded applications like qmlscene could not bind the EGL context if the context is already bound in the other thread. Change-Id: Ia75ef9e76ebff48aa2c9b348101ab2f388e18c5e Reviewed-by: Andy Nichols --- src/plugins/platforms/kms/qkmsbuffermanager.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/kms/qkmsbuffermanager.cpp b/src/plugins/platforms/kms/qkmsbuffermanager.cpp index 5c231e6beb..05da957af0 100644 --- a/src/plugins/platforms/kms/qkmsbuffermanager.cpp +++ b/src/plugins/platforms/kms/qkmsbuffermanager.cpp @@ -121,6 +121,8 @@ void QKmsBufferManager::setupBuffersForMode(const drmModeModeInfo &mode, int num GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, this->renderTargetBuffer()); + + eglMakeCurrent(m_screen->device()->eglDisplay(), EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); } void QKmsBufferManager::clearBuffers() -- cgit v1.2.3 From 0cd818aa7a17567bf4f100444a938fe06c9f02f5 Mon Sep 17 00:00:00 2001 From: Hannu Lyytinen Date: Tue, 10 Apr 2012 20:29:33 +0300 Subject: Use correct framebuffer object. KMS plugin deals with FBO IDs not equal to zero (the default FBO), so return the correct ID. Change-Id: I904fc0b8d732f856b4526bd7f73cc48c358c8441 Reviewed-by: Andy Nichols --- src/plugins/platforms/kms/qkmscontext.cpp | 7 +++++++ src/plugins/platforms/kms/qkmscontext.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/plugins/platforms/kms/qkmscontext.cpp b/src/plugins/platforms/kms/qkmscontext.cpp index 66829bc73a..4ae5325ca7 100644 --- a/src/plugins/platforms/kms/qkmscontext.cpp +++ b/src/plugins/platforms/kms/qkmscontext.cpp @@ -110,4 +110,11 @@ QSurfaceFormat QKmsContext::format() const return QSurfaceFormat(); } +GLuint QKmsContext::defaultFramebufferObject(QPlatformSurface *surface) const +{ + QPlatformWindow *window = static_cast(surface); + QKmsScreen *screen = static_cast (QPlatformScreen::platformScreenForWindow(window->window())); + return screen->framebufferObject(); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/kms/qkmscontext.h b/src/plugins/platforms/kms/qkmscontext.h index 57f3a1a8e5..6378780f34 100644 --- a/src/plugins/platforms/kms/qkmscontext.h +++ b/src/plugins/platforms/kms/qkmscontext.h @@ -65,6 +65,8 @@ public: EGLContext eglContext() const; + GLuint defaultFramebufferObject(QPlatformSurface *surface) const; + private: QKmsDevice *m_device; -- cgit v1.2.3 From 89f6997e805e4bc94bea4aff592b5ae93aea8e85 Mon Sep 17 00:00:00 2001 From: Hannu Lyytinen Date: Wed, 11 Apr 2012 09:41:21 +0300 Subject: Add support for QPlatformNativeInterface. Initial bits to enable figuring out the EGL display and context. Change-Id: I4b578e356dceb40b4456f0590d32c8df1f51fa53 Reviewed-by: Andy Nichols --- src/plugins/platforms/kms/kms.pro | 6 +- src/plugins/platforms/kms/qkmsintegration.cpp | 9 +- src/plugins/platforms/kms/qkmsintegration.h | 4 + src/plugins/platforms/kms/qkmsnativeinterface.cpp | 105 ++++++++++++++++++++++ src/plugins/platforms/kms/qkmsnativeinterface.h | 67 ++++++++++++++ 5 files changed, 188 insertions(+), 3 deletions(-) create mode 100644 src/plugins/platforms/kms/qkmsnativeinterface.cpp create mode 100644 src/plugins/platforms/kms/qkmsnativeinterface.h diff --git a/src/plugins/platforms/kms/kms.pro b/src/plugins/platforms/kms/kms.pro index 5b91326a39..93d972abe8 100644 --- a/src/plugins/platforms/kms/kms.pro +++ b/src/plugins/platforms/kms/kms.pro @@ -18,7 +18,8 @@ SOURCES = main.cpp \ qkmscursor.cpp \ qkmsdevice.cpp \ qkmsbuffermanager.cpp \ - qkmsbackingstore.cpp + qkmsbackingstore.cpp \ + qkmsnativeinterface.cpp HEADERS = qkmsintegration.h \ qkmsscreen.h \ qkmscontext.h \ @@ -26,7 +27,8 @@ HEADERS = qkmsintegration.h \ qkmscursor.h \ qkmsdevice.h \ qkmsbuffermanager.h \ - qkmsbackingstore.h + qkmsbackingstore.h \ + qkmsnativeinterface.h target.path += $$[QT_INSTALL_PLUGINS]/platforms INSTALLS += target diff --git a/src/plugins/platforms/kms/qkmsintegration.cpp b/src/plugins/platforms/kms/qkmsintegration.cpp index c495ca26f9..74346e8097 100644 --- a/src/plugins/platforms/kms/qkmsintegration.cpp +++ b/src/plugins/platforms/kms/qkmsintegration.cpp @@ -45,6 +45,7 @@ #include "qkmswindow.h" #include "qkmsbackingstore.h" #include "qkmscontext.h" +#include "qkmsnativeinterface.h" #include #include @@ -58,7 +59,8 @@ QT_BEGIN_NAMESPACE QKmsIntegration::QKmsIntegration() : QPlatformIntegration(), m_fontDatabase(new QGenericUnixFontDatabase()), - m_eventDispatcher(createUnixEventDispatcher()) + m_eventDispatcher(createUnixEventDispatcher()), + m_nativeInterface(new QKmsNativeInterface) { QGuiApplicationPrivate::instance()->setEventDispatcher(m_eventDispatcher); setenv("EGL_PLATFORM", "drm",1); @@ -129,4 +131,9 @@ QAbstractEventDispatcher *QKmsIntegration::guiThreadEventDispatcher() const return m_eventDispatcher; } +QPlatformNativeInterface *QKmsIntegration::nativeInterface() const +{ + return m_nativeInterface; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/kms/qkmsintegration.h b/src/plugins/platforms/kms/qkmsintegration.h index 5724471295..96d030f849 100644 --- a/src/plugins/platforms/kms/qkmsintegration.h +++ b/src/plugins/platforms/kms/qkmsintegration.h @@ -43,6 +43,7 @@ #define QPLATFORMINTEGRATION_KMS_H #include +#include QT_BEGIN_NAMESPACE @@ -66,6 +67,8 @@ public: void addScreen(QKmsScreen *screen); + QPlatformNativeInterface *nativeInterface() const; + private: QStringList findDrmDevices(); @@ -73,6 +76,7 @@ private: QList m_devices; QPlatformFontDatabase *m_fontDatabase; QAbstractEventDispatcher *m_eventDispatcher; + QPlatformNativeInterface *m_nativeInterface; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/kms/qkmsnativeinterface.cpp b/src/plugins/platforms/kms/qkmsnativeinterface.cpp new file mode 100644 index 0000000000..8e026b2503 --- /dev/null +++ b/src/plugins/platforms/kms/qkmsnativeinterface.cpp @@ -0,0 +1,105 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "qkmsnativeinterface.h" +#include "qkmsdevice.h" + +#include "qscreen.h" + +class QKmsResourceMap : public QMap +{ +public: + QKmsResourceMap() + :QMap() + { + insert("egldisplay", QKmsNativeInterface::EglDisplay); + insert("eglcontext", QKmsNativeInterface::EglContext); + } +}; + +Q_GLOBAL_STATIC(QKmsResourceMap, qKmsResourceMap) + +void *QKmsNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) +{ + QByteArray lowerCaseResource = resourceString.toLower(); + ResourceType resource = qKmsResourceMap()->value(lowerCaseResource); + void *result = 0; + switch (resource) { + case EglDisplay: + result = eglDisplayForWindow(window); + break; + case EglContext: + result = eglContextForWindow(window); + break; + default: + result = 0; + } + return result; +} + +void *QKmsNativeInterface::eglDisplayForWindow(QWindow *window) +{ + QKmsScreen *screen = qPlatformScreenForWindow(window); + if (!screen) + return 0; + QKmsDevice *device = screen->device(); + if (!device) + return 0; + return device->eglDisplay(); +} + +void *QKmsNativeInterface::eglContextForWindow(QWindow *window) +{ + QKmsScreen *screen = qPlatformScreenForWindow(window); + if (!screen) + return 0; + QKmsDevice *device = screen->device(); + if (!device) + return 0; + return device->eglContext(); +} + +QKmsScreen *QKmsNativeInterface::qPlatformScreenForWindow(QWindow *window) +{ + QScreen *screen = window ? window->screen() : QGuiApplication::primaryScreen(); + return static_cast(screen->handle()); +} diff --git a/src/plugins/platforms/kms/qkmsnativeinterface.h b/src/plugins/platforms/kms/qkmsnativeinterface.h new file mode 100644 index 0000000000..77a9573250 --- /dev/null +++ b/src/plugins/platforms/kms/qkmsnativeinterface.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QKMSNATIVEINTERFACE_H +#define QKMSNATIVEINTERFACE_H + +#include "qkmsscreen.h" + +#include + +class QKmsNativeInterface : public QPlatformNativeInterface +{ +public: + enum ResourceType { + EglDisplay, + EglContext + }; + + void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window); + + void *eglDisplayForWindow(QWindow *window); + void *eglContextForWindow(QWindow *window); + +private: + static QKmsScreen *qPlatformScreenForWindow(QWindow *window); +}; + + +#endif // QKMSNATIVEINTERFACE_H -- cgit v1.2.3 From 62cda62c0c70a75de3f87cbd802a1be24d27ef18 Mon Sep 17 00:00:00 2001 From: Qt4iOS Date: Sat, 24 Mar 2012 14:00:56 +0000 Subject: Modified project files to be iOS compatible. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed some MacOS source code files from iOS build. Use unix standard paths for now (iOS-specific implementation will come later). Change-Id: I8b2731b431b3a379a1ec4ec07d227e886209e3e9 Reviewed-by: Morten Johan Sørvig --- src/corelib/io/io.pri | 6 +++++- src/network/kernel/kernel.pri | 2 +- src/platformsupport/cglconvenience/cglconvenience.pri | 2 +- src/platformsupport/eglconvenience/eglconvenience.pri | 14 ++++++++------ src/plugins/platforms/platforms.pro | 4 +--- src/widgets/styles/styles.pri | 2 +- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index d24ea667b2..533938c057 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -103,7 +103,11 @@ win32 { SOURCES += io/qsettings_mac.cpp } macx-*: { - SOURCES += io/qstandardpaths_mac.cpp + contains(QT_CONFIG, coreservices) { + SOURCES += io/qstandardpaths_mac.cpp + } else { + SOURCES += io/qstandardpaths_unix.cpp + } } else:standardpathsjson { SOURCES += io/qstandardpaths_json.cpp } else:blackberry { diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri index f9ea6065a3..f38980910d 100644 --- a/src/network/kernel/kernel.pri +++ b/src/network/kernel/kernel.pri @@ -34,6 +34,6 @@ win32: { integrity:SOURCES += kernel/qdnslookup_unix.cpp kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_unix.cpp mac:LIBS_PRIVATE += -framework SystemConfiguration -framework CoreFoundation -framework CoreServices -mac:SOURCES += kernel/qnetworkproxy_mac.cpp +mac:contains(QT_CONFIG, coreservices):SOURCES += kernel/qnetworkproxy_mac.cpp else:win32:SOURCES += kernel/qnetworkproxy_win.cpp else:SOURCES += kernel/qnetworkproxy_generic.cpp diff --git a/src/platformsupport/cglconvenience/cglconvenience.pri b/src/platformsupport/cglconvenience/cglconvenience.pri index a367e4d053..d4c149404f 100644 --- a/src/platformsupport/cglconvenience/cglconvenience.pri +++ b/src/platformsupport/cglconvenience/cglconvenience.pri @@ -1,4 +1,4 @@ -mac { +mac:contains(QT_CONFIG, coreservices) { INCLUDEPATH += $$PWD HEADERS += \ diff --git a/src/platformsupport/eglconvenience/eglconvenience.pri b/src/platformsupport/eglconvenience/eglconvenience.pri index f8500e2de0..db3ec20685 100644 --- a/src/platformsupport/eglconvenience/eglconvenience.pri +++ b/src/platformsupport/eglconvenience/eglconvenience.pri @@ -1,10 +1,12 @@ contains(QT_CONFIG,opengles2) { - HEADERS += \ - $$PWD/qeglconvenience_p.h \ - $$PWD/qeglplatformcontext_p.h - SOURCES += \ - $$PWD/qeglconvenience.cpp \ - $$PWD/qeglplatformcontext.cpp + contains(QT_CONFIG,egl) { + HEADERS += \ + $$PWD/qeglconvenience_p.h \ + $$PWD/qeglplatformcontext_p.h + SOURCES += \ + $$PWD/qeglconvenience.cpp \ + $$PWD/qeglplatformcontext.cpp + } contains(QT_CONFIG,xlib) { HEADERS += \ diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro index 442390f6a6..1321270dc6 100644 --- a/src/plugins/platforms/platforms.pro +++ b/src/plugins/platforms/platforms.pro @@ -6,9 +6,7 @@ contains(QT_CONFIG, xcb) { SUBDIRS += xcb } -mac { - SUBDIRS += cocoa -} +mac:contains(QT_CONFIG, coreservices): SUBDIRS += cocoa win32: SUBDIRS += windows diff --git a/src/widgets/styles/styles.pri b/src/widgets/styles/styles.pri index ef6827f74f..8f6996cfa3 100644 --- a/src/widgets/styles/styles.pri +++ b/src/widgets/styles/styles.pri @@ -37,7 +37,7 @@ contains( styles, all ) { styles = mac windows windowsxp windowsvista } -!macx-*:styles -= mac +!macx-*|!contains(QT_CONFIG, coreservices):styles -= mac x11{ QMAKE_CXXFLAGS += $$QT_CFLAGS_QGTKSTYLE -- cgit v1.2.3 From 7386ab17df94e58efeb2f2fba91b9f816834c077 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 23 Mar 2012 11:01:42 +0000 Subject: Use windows API to update missing CA roots Windows ships with a minimal set of CA roots. When using windows API to verify a certificate, it will fetch the root certificate from windows update (assuming it is part of the Microsoft trust program). As we are using openssl, this does not happen transparently. If SSL errors occur which indicate a broken chain then attempt to fix it using the windows API before emitting sslErrors. If the system CA certs are not in use (a CA bundle has been set on the socket or as the global configuration), then this is skipped. This is so an application can continue to use its own cert bundle rather than trusting the system certs. Key usage is specified, so that windows will return not trusted status if the root is not suitable for SSL (server auth or client auth OID). Testability: - to test, must delete the CA cert(s) from the "third party root certification authorities" section of the cert store using mmc.exe. - If the workaround of installing the windows XP cert bundle was performed, then you also need to delete certs from the "trusted root certification authorities" section. This is dangerous, be careful not to delete the required certificates which are documented on MS website - Naturally, modifying these areas of the cert store requires elevated privilege. Task-number: QTBUG-24827 Change-Id: I5cfe71c8a10595731f6bbbbabaaefa3313496654 Reviewed-by: Richard J. Moore Reviewed-by: Thiago Macieira --- src/network/ssl/qsslsocket.h | 3 + src/network/ssl/qsslsocket_openssl.cpp | 238 +++++++++++++++++++++++++++++++-- src/network/ssl/qsslsocket_openssl_p.h | 22 +++ src/network/ssl/qsslsocket_p.h | 3 + src/network/ssl/ssl.pri | 2 + 5 files changed, 254 insertions(+), 14 deletions(-) diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h index aa16425e9a..e420972041 100644 --- a/src/network/ssl/qsslsocket.h +++ b/src/network/ssl/qsslsocket.h @@ -213,6 +213,9 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_flushWriteBuffer()) Q_PRIVATE_SLOT(d_func(), void _q_flushReadBuffer()) Q_PRIVATE_SLOT(d_func(), void _q_resumeImplementation()) +#ifdef Q_OS_WIN + Q_PRIVATE_SLOT(d_func(), void _q_caRootLoaded(QSslCertificate,QSslCertificate)) +#endif friend class QSslSocketBackendPrivate; }; diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index df60a0fcce..0e55f5134c 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -661,6 +661,15 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded() // if on-demand loading was not enabled, load the certs now if (!s_loadRootCertsOnDemand) setDefaultCaCertificates(systemCaCertificates()); +#ifdef Q_OS_WIN + //Enabled for fetching additional root certs from windows update on windows 6+ + //This flag is set false by setDefaultCaCertificates() indicating the app uses + //its own cert bundle rather than the system one. + //Same logic that disables the unix on demand cert loading. + //Unlike unix, we do preload the certificates from the cert store. + if ((QSysInfo::windowsVersion() & QSysInfo::WV_NT_based) >= QSysInfo::WV_6_0) + s_loadRootCertsOnDemand = true; +#endif } /*! @@ -1221,22 +1230,28 @@ bool QSslSocketBackendPrivate::startHandshake() if (!errors.isEmpty()) { sslErrors = errors; - emit q->sslErrors(errors); - - bool doEmitSslError = !verifyErrorsHaveBeenIgnored(); - // check whether we need to emit an SSL handshake error - if (doVerifyPeer && doEmitSslError) { - if (q->pauseMode() & QAbstractSocket::PauseOnNotify) { - pauseSocketNotifiers(q); - paused = true; - } else { - q->setErrorString(sslErrors.first().errorString()); - q->setSocketError(QAbstractSocket::SslHandshakeFailedError); - emit q->error(QAbstractSocket::SslHandshakeFailedError); - plainSocket->disconnectFromHost(); + +#ifdef Q_OS_WIN + //Skip this if not using system CAs, or if the SSL errors are configured in advance to be ignorable + if (s_loadRootCertsOnDemand + && allowRootCertOnDemandLoading + && !verifyErrorsHaveBeenIgnored()) { + //Windows desktop versions starting from vista ship with minimal set of roots + //and download on demand from the windows update server CA roots that are + //trusted by MS. + //However, this is only transparent if using WinINET - we have to trigger it + //ourselves. + for (int i=0; i< sslErrors.count(); i++) { + if (sslErrors.at(i).error() == QSslError::UnableToGetLocalIssuerCertificate) { + fetchCaRootForCert(sslErrors.at(i).certificate()); + return false; + } } - return false; } +#endif + + if (!checkSslErrors()) + return false; } else { sslErrors.clear(); } @@ -1245,6 +1260,201 @@ bool QSslSocketBackendPrivate::startHandshake() return true; } +bool QSslSocketBackendPrivate::checkSslErrors() +{ + Q_Q(QSslSocket); + if (sslErrors.isEmpty()) + return true; + + emit q->sslErrors(sslErrors); + + bool doVerifyPeer = configuration.peerVerifyMode == QSslSocket::VerifyPeer + || (configuration.peerVerifyMode == QSslSocket::AutoVerifyPeer + && mode == QSslSocket::SslClientMode); + bool doEmitSslError = !verifyErrorsHaveBeenIgnored(); + // check whether we need to emit an SSL handshake error + if (doVerifyPeer && doEmitSslError) { + if (q->pauseMode() & QAbstractSocket::PauseOnNotify) { + pauseSocketNotifiers(q); + paused = true; + } else { + q->setErrorString(sslErrors.first().errorString()); + q->setSocketError(QAbstractSocket::SslHandshakeFailedError); + emit q->error(QAbstractSocket::SslHandshakeFailedError); + plainSocket->disconnectFromHost(); + } + return false; + } + return true; +} + +#ifdef Q_OS_WIN + +void QSslSocketBackendPrivate::fetchCaRootForCert(const QSslCertificate &cert) +{ + Q_Q(QSslSocket); + //The root certificate is downloaded from windows update, which blocks for 15 seconds in the worst case + //so the request is done in a worker thread. + QWindowsCaRootFetcher *fetcher = new QWindowsCaRootFetcher(cert, mode); + QObject::connect(fetcher, SIGNAL(finished(QSslCertificate,QSslCertificate)), q, SLOT(_q_caRootLoaded(QSslCertificate,QSslCertificate)), Qt::QueuedConnection); + QMetaObject::invokeMethod(fetcher, "start", Qt::QueuedConnection); + pauseSocketNotifiers(q); + paused = true; +} + +//This is the callback from QWindowsCaRootFetcher, trustedRoot will be invalid (default constructed) if it failed. +void QSslSocketBackendPrivate::_q_caRootLoaded(QSslCertificate cert, QSslCertificate trustedRoot) +{ + Q_Q(QSslSocket); + if (trustedRoot.isValid()) { + if (s_loadRootCertsOnDemand) { + //Add the new root cert to default cert list for use by future sockets + QSslSocket::addDefaultCaCertificate(trustedRoot); + } + //Add the new root cert to this socket for future connections + q->addCaCertificate(trustedRoot); + //Remove the broken chain ssl errors (as chain is verified by windows) + for (int i=sslErrors.count() - 1; i >= 0; --i) { + if (sslErrors.at(i).certificate() == cert) { + switch (sslErrors.at(i).error()) { + case QSslError::UnableToGetLocalIssuerCertificate: + case QSslError::CertificateUntrusted: + case QSslError::UnableToVerifyFirstCertificate: + // error can be ignored if OS says the chain is trusted + sslErrors.removeAt(i); + break; + default: + // error cannot be ignored + break; + } + } + } + } + // Continue with remaining errors + if (plainSocket) + plainSocket->resume(); + paused = false; + if (checkSslErrors()) + continueHandshake(); +} + +Q_DECLARE_METATYPE(QSslCertificate); + +class QWindowsCaRootFetcherThread : public QThread +{ +public: + QWindowsCaRootFetcherThread() + { + qRegisterMetaType(); + setObjectName(QStringLiteral("QWindowsCaRootFetcher")); + start(); + } + ~QWindowsCaRootFetcherThread() + { + quit(); + wait(15500); // worst case, a running request can block for 15 seconds + } +}; + +Q_GLOBAL_STATIC(QWindowsCaRootFetcherThread, windowsCaRootFetcherThread); + +QWindowsCaRootFetcher::QWindowsCaRootFetcher(const QSslCertificate &certificate, QSslSocket::SslMode sslMode) + : cert(certificate), mode(sslMode) +{ + moveToThread(windowsCaRootFetcherThread()); +} + +QWindowsCaRootFetcher::~QWindowsCaRootFetcher() +{ +} + +void QWindowsCaRootFetcher::start() +{ + QByteArray der = cert.toDer(); + PCCERT_CONTEXT wincert = CertCreateCertificateContext(X509_ASN_ENCODING, (const BYTE *)der.constData(), der.length()); + if (!wincert) { +#ifdef QSSLSOCKET_DEBUG + qDebug("QWindowsCaRootFetcher failed to convert certificate to windows form"); +#endif + emit finished(cert, QSslCertificate()); + deleteLater(); + return; + } + + CERT_CHAIN_PARA parameters; + memset(¶meters, 0, sizeof(parameters)); + parameters.cbSize = sizeof(parameters); + // set key usage constraint + parameters.RequestedUsage.dwType = USAGE_MATCH_TYPE_AND; + parameters.RequestedUsage.Usage.cUsageIdentifier = 1; + LPSTR oid = (mode == QSslSocket::SslClientMode ? szOID_PKIX_KP_SERVER_AUTH : szOID_PKIX_KP_CLIENT_AUTH); + parameters.RequestedUsage.Usage.rgpszUsageIdentifier = &oid; + +#ifdef QSSLSOCKET_DEBUG + QElapsedTimer stopwatch; + stopwatch.start(); +#endif + PCCERT_CHAIN_CONTEXT chain; + BOOL result = CertGetCertificateChain( + 0, //default engine + wincert, + 0, //current date/time + 0, //default store + ¶meters, + 0, //default dwFlags + 0, //reserved + &chain); +#ifdef QSSLSOCKET_DEBUG + qDebug() << "QWindowsCaRootFetcher" << stopwatch.elapsed() << "ms to get chain"; +#endif + + QSslCertificate trustedRoot; + if (result) { +#ifdef QSSLSOCKET_DEBUG + qDebug() << "QWindowsCaRootFetcher - examining windows chains"; + if (chain->TrustStatus.dwErrorStatus == CERT_TRUST_NO_ERROR) + qDebug() << " - TRUSTED"; + else + qDebug() << " - NOT TRUSTED" << chain->TrustStatus.dwErrorStatus; + if (chain->TrustStatus.dwInfoStatus & CERT_TRUST_IS_SELF_SIGNED) + qDebug() << " - SELF SIGNED"; + qDebug() << "QSslSocketBackendPrivate::fetchCaRootForCert - dumping simple chains"; + for (unsigned int i = 0; i < chain->cChain; i++) { + if (chain->rgpChain[i]->TrustStatus.dwErrorStatus == CERT_TRUST_NO_ERROR) + qDebug() << " - TRUSTED SIMPLE CHAIN" << i; + else + qDebug() << " - UNTRUSTED SIMPLE CHAIN" << i << "reason:" << chain->rgpChain[i]->TrustStatus.dwErrorStatus; + for (unsigned int j = 0; j < chain->rgpChain[i]->cElement; j++) { + QSslCertificate foundCert(QByteArray((const char *)chain->rgpChain[i]->rgpElement[j]->pCertContext->pbCertEncoded + , chain->rgpChain[i]->rgpElement[j]->pCertContext->cbCertEncoded), QSsl::Der); + qDebug() << " - " << foundCert; + } + } + qDebug() << " - and" << chain->cLowerQualityChainContext << "low quality chains"; //expect 0, we haven't asked for them +#endif + + //based on http://msdn.microsoft.com/en-us/library/windows/desktop/aa377182%28v=vs.85%29.aspx + //about the final chain rgpChain[cChain-1] which must begin with a trusted root to be valid + if (chain->TrustStatus.dwErrorStatus == CERT_TRUST_NO_ERROR + && chain->cChain > 0) { + const PCERT_SIMPLE_CHAIN finalChain = chain->rgpChain[chain->cChain - 1]; + // http://msdn.microsoft.com/en-us/library/windows/desktop/aa377544%28v=vs.85%29.aspx + // rgpElement[0] is the end certificate chain element. rgpElement[cElement-1] is the self-signed "root" certificate element. + if (finalChain->TrustStatus.dwErrorStatus == CERT_TRUST_NO_ERROR + && finalChain->cElement > 0) { + trustedRoot = QSslCertificate(QByteArray((const char *)finalChain->rgpElement[finalChain->cElement - 1]->pCertContext->pbCertEncoded + , finalChain->rgpElement[finalChain->cElement - 1]->pCertContext->cbCertEncoded), QSsl::Der); + } + } + CertFreeCertificateChain(chain); + } + CertFreeCertificateContext(wincert); + + emit finished(cert, trustedRoot); + deleteLater(); +} +#endif + void QSslSocketBackendPrivate::disconnectFromHost() { if (ssl) { diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h index b31eae9c97..deeceb8d85 100644 --- a/src/network/ssl/qsslsocket_openssl_p.h +++ b/src/network/ssl/qsslsocket_openssl_p.h @@ -117,6 +117,11 @@ public: void disconnected(); QSslCipher sessionCipher() const; void continueHandshake(); + bool checkSslErrors(); +#ifdef Q_OS_WIN + void fetchCaRootForCert(const QSslCertificate &cert); + void _q_caRootLoaded(QSslCertificate,QSslCertificate); +#endif Q_AUTOTEST_EXPORT static long setupOpenSslOptions(QSsl::SslProtocol protocol, QSsl::SslOptions sslOptions); static QSslCipher QSslCipher_from_SSL_CIPHER(SSL_CIPHER *cipher); @@ -127,6 +132,23 @@ public: static QString getErrorsFromOpenSsl(); }; +#ifdef Q_OS_WIN +class QWindowsCaRootFetcher : public QObject +{ + Q_OBJECT; +public: + QWindowsCaRootFetcher(const QSslCertificate &certificate, QSslSocket::SslMode sslMode); + ~QWindowsCaRootFetcher(); +public slots: + void start(); +signals: + void finished(QSslCertificate brokenChain, QSslCertificate caroot); +private: + QSslCertificate cert; + QSslSocket::SslMode mode; +}; +#endif + QT_END_NAMESPACE #endif diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h index 44114481df..e5d1144c2c 100644 --- a/src/network/ssl/qsslsocket_p.h +++ b/src/network/ssl/qsslsocket_p.h @@ -160,6 +160,9 @@ public: void _q_flushWriteBuffer(); void _q_flushReadBuffer(); void _q_resumeImplementation(); +#ifdef Q_OS_WIN + virtual void _q_caRootLoaded(QSslCertificate,QSslCertificate) = 0; +#endif // Platform specific functions virtual void startClientEncryption() = 0; diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri index 87bcc9378a..c81e461d3f 100644 --- a/src/network/ssl/ssl.pri +++ b/src/network/ssl/ssl.pri @@ -28,4 +28,6 @@ contains(QT_CONFIG, openssl) | contains(QT_CONFIG, openssl-linked) { # Add optional SSL libs LIBS_PRIVATE += $$OPENSSL_LIBS + + windows:LIBS += -lcrypt32 } -- cgit v1.2.3 From 3ddd768504f9f55c04bec9beb8eb9bac9a7e5edc Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 10 Apr 2012 23:36:21 +0300 Subject: QChar: optimize some methods a bit for general case by reordering and regrouping conditions so that they lead to result earlier in most-common usecases (l.letters, spaces and puncts, u.letters, other); there are no title cased letters in range [0..127] -> use this in isTitleCase(); test for 0xa0 (nbsp) early in isSpace() as it is quite common in HTML, etc.; add early test to isNumber(). Change-Id: Ib415f34cb1212d9ccf8753de2d1beaece1aa2243 Reviewed-by: Lars Knoll Reviewed-by: Oswald Buddenhagen --- src/corelib/tools/qchar.cpp | 11 +++++++++-- src/corelib/tools/qchar.h | 29 +++++++++++++---------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp index 1ce19ec911..165bda7b05 100644 --- a/src/corelib/tools/qchar.cpp +++ b/src/corelib/tools/qchar.cpp @@ -557,17 +557,24 @@ bool QChar::isLetter(ushort ucs2) } /*! + \fn bool QChar::isNumber() const + Returns true if the character is a number (Number_* categories, not just 0-9); otherwise returns false. \sa isDigit() */ -bool QChar::isNumber() const + +/*! + \internal + \overload +*/ +bool QChar::isNumber(ushort ucs2) { const int test = FLAG(Number_DecimalDigit) | FLAG(Number_Letter) | FLAG(Number_Other); - return FLAG(qGetProp(ucs)->category) & test; + return FLAG(qGetProp(ucs2)->category) & test; } /*! diff --git a/src/corelib/tools/qchar.h b/src/corelib/tools/qchar.h index 3209ffb0f2..9f2ca7ae9e 100644 --- a/src/corelib/tools/qchar.h +++ b/src/corelib/tools/qchar.h @@ -233,35 +233,31 @@ public: bool isPrint() const; bool isPunct() const; inline bool isSpace() const { + // note that [0x09..0x0d] + 0x85 are exceptional Cc-s and must be handled explicitly return ucs == 0x20 || (ucs <= 0x0D && ucs >= 0x09) - || (ucs > 127 && (ucs == 0x0085 || isSpace(ucs))); + || (ucs > 127 && (ucs == 0x85 || ucs == 0xa0 || isSpace(ucs))); } bool isMark() const; inline bool isLetter() const { - return (ucs >= 'a' && ucs <= 'z') - || (ucs <= 'Z' && ucs >= 'A') + return (ucs >= 'A' && ucs <= 'z' && (ucs >= 'a' || ucs <= 'Z')) || (ucs > 127 && isLetter(ucs)); } - bool isNumber() const; + inline bool isNumber() const + { return (ucs <= '9' && ucs >= '0') || (ucs > 127 && isNumber(ucs)); } inline bool isLetterOrNumber() const { - return (ucs >= 'a' && ucs <= 'z') - || (ucs <= 'Z' && ucs >= 'A') - || (ucs <= '9' && ucs >= '0') + return (ucs >= 'A' && ucs <= 'z' && (ucs >= 'a' || ucs <= 'Z')) + || (ucs >= '0' && ucs <= '9') || (ucs > 127 && isLetterOrNumber(ucs)); } inline bool isDigit() const { return (ucs <= '9' && ucs >= '0') || (ucs > 127 && isDigit(ucs)); } bool isSymbol() const; - inline bool isLower() const { - return (ucs >= 'a' && ucs <= 'z') - || (ucs > 127 && category(ucs) == Letter_Lowercase); - } - inline bool isUpper() const { - return (ucs <= 'Z' && ucs >= 'A') - || (ucs > 127 && category(ucs) == Letter_Uppercase); - } - inline bool isTitleCase() const { return category() == Letter_Titlecase; } + inline bool isLower() const + { return (ucs <= 'z' && ucs >= 'a') || (ucs > 127 && category() == Letter_Lowercase); } + inline bool isUpper() const + { return (ucs <= 'Z' && ucs >= 'A') || (ucs > 127 && category() == Letter_Uppercase); } + inline bool isTitleCase() const { return ucs > 127 && category() == Letter_Titlecase; } inline bool isHighSurrogate() const { return ((ucs & 0xfc00) == 0xd800); @@ -331,6 +327,7 @@ public: private: static bool QT_FASTCALL isDigit(ushort ucs2); static bool QT_FASTCALL isLetter(ushort ucs2); + static bool QT_FASTCALL isNumber(ushort ucs2); static bool QT_FASTCALL isLetterOrNumber(ushort ucs2); static bool QT_FASTCALL isSpace(ushort ucs2); -- cgit v1.2.3 From b1addf36c19748a29bd9f901579a23355b081fe9 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 11 Apr 2012 12:50:22 +0200 Subject: qdoc: Fixed to report read-only QML properties correctly Now the default for a QML property is writable. If qdoc can't detect the actual read-only status, writable is assumed. There were some cases where qdoc could not determine the actual read-only/writable status for a QML property. In these cases, qdoc reported read-only because the default was read-only, which was not optimal. Change-Id: I55aeb2bedcde92a414f4d48a8d995e5e9dbca5da Reviewed-by: Casper van Donderen --- src/tools/qdoc/cppcodemarker.cpp | 14 +++- src/tools/qdoc/cppcodeparser.cpp | 16 ++-- src/tools/qdoc/ditaxmlgenerator.cpp | 30 +++---- src/tools/qdoc/generator.cpp | 2 + src/tools/qdoc/htmlgenerator.cpp | 37 +++------ src/tools/qdoc/node.cpp | 154 ++++++++++++++++-------------------- src/tools/qdoc/node.h | 80 +++++++++---------- 7 files changed, 154 insertions(+), 179 deletions(-) diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp index aea8ed2119..165a235a86 100644 --- a/src/tools/qdoc/cppcodemarker.cpp +++ b/src/tools/qdoc/cppcodemarker.cpp @@ -1258,8 +1258,20 @@ QList
CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, NodeList::ConstIterator c = qcn->childNodes().begin(); while (c != qcn->childNodes().end()) { if ((*c)->subType() == Node::QmlPropertyGroup) { + bool attached = false; const QmlPropGroupNode* pgn = static_cast(*c); - if (pgn->isAttached()) + NodeList::ConstIterator C = pgn->childNodes().begin(); + while (C != pgn->childNodes().end()) { + if ((*C)->type() == Node::QmlProperty) { + const QmlPropertyNode* pn = static_cast(*C); + if (pn->isAttached()) { + attached = true; + break; + } + } + ++C; + } + if (attached) insert(qmlattachedproperties,*c,style,Okay); else insert(qmlproperties,*c,style,Okay); diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index b08c6f901c..d0822fec1a 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -937,7 +937,7 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, if (splitQmlPropertyArg(doc,(*arg),type,module,element,property)) { QmlClassNode* qmlClass = tree_->findQmlClassNode(module,element); if (qmlClass) { - qmlPropGroup = new QmlPropGroupNode(qmlClass,property,attached); + qmlPropGroup = new QmlPropGroupNode(qmlClass,property); //,attached); } } if (qmlPropGroup) { @@ -950,7 +950,7 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, } if (correspondingProperty) { bool writableList = type.startsWith("list") && correspondingProperty->dataType().endsWith('*'); - qmlPropNode->setWritable(writableList || correspondingProperty->isWritable()); + qmlPropNode->setReadOnly(!(writableList || correspondingProperty->isWritable())); } ++arg; while (arg != args.end()) { @@ -961,7 +961,7 @@ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, attached); if (correspondingProperty) { bool writableList = type.startsWith("list") && correspondingProperty->dataType().endsWith('*'); - qmlPropNode->setWritable(writableList || correspondingProperty->isWritable()); + qmlPropNode->setReadOnly(!(writableList || correspondingProperty->isWritable())); } } ++arg; @@ -1117,7 +1117,14 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, } else if (node->type() == Node::Fake && node->subType() == Node::QmlPropertyGroup) { QmlPropGroupNode* qpgn = static_cast(node); - qpgn->setDefault(); + NodeList::ConstIterator p = qpgn->childNodes().begin(); + while (p != qpgn->childNodes().end()) { + if ((*p)->type() == Node::QmlProperty) { + QmlPropertyNode* qpn = static_cast(*p); + qpn->setDefault(); + } + ++p; + } } } else if (command == COMMAND_QMLREADONLY) { @@ -1127,7 +1134,6 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc, } else if (node->type() == Node::Fake && node->subType() == Node::QmlPropertyGroup) { QmlPropGroupNode* qpgn = static_cast(node); - qpgn->setReadOnly(1); NodeList::ConstIterator p = qpgn->childNodes().begin(); while (p != qpgn->childNodes().end()) { if ((*p)->type() == Node::QmlProperty) { diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index 3f1e8c02e9..88a5888887 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -4420,14 +4420,11 @@ void DitaXmlGenerator::generateDetailedQmlMember(Node* node, writeStartTag(DT_li); writeGuidAttribute((Node*)qpn); QString attr; - int ro = qpn->getReadOnly(); - if (ro < 0) { - if (!qpn->isWritable(tree_)) - attr = "read-only"; - } - else if (ro > 0) + if (!qpn->isReadOnlySet()) + qpn->setReadOnly(!qpn->isWritable(tree_)); + if (qpn->isReadOnly()) attr = "read-only"; - if (qpgn->isDefault()) { + if (qpn->isDefault()) { if (!attr.isEmpty()) attr += QLatin1Char(' '); attr += "default"; @@ -4462,13 +4459,11 @@ void DitaXmlGenerator::generateDetailedQmlMember(Node* node, writeStartTag(DT_li); writeGuidAttribute((Node*)qpn); QString attr; - int ro = qpn->getReadOnly(); - if (ro < 0) { - const ClassNode* cn = qpn->declarativeCppNode(); - if (cn && !qpn->isWritable(tree_)) - attr = "read-only"; + if (!qpn->isReadOnlySet()) { + if (qpn->declarativeCppNode()) + qpn->setReadOnly(!qpn->isWritable(tree_)); } - else if (ro > 0) + if (qpn->isReadOnly()) attr = "read-only"; if (qpn->isDefault()) { if (!attr.isEmpty()) @@ -4495,12 +4490,9 @@ void DitaXmlGenerator::generateDetailedQmlMember(Node* node, writeStartTag(DT_li); writeGuidAttribute((Node*)q); QString attr; - int ro = qpn->getReadOnly(); - if (ro < 0) { - if (!qpn->isWritable(tree_)) - attr = "read-only"; - } - else if (ro > 0) + if (!qpn->isReadOnlySet()) + qpn->setReadOnly(!qpn->isWritable(tree_)); + if (qpn->isReadOnly()) attr = "read-only"; if (qpn->isDefault()) { if (!attr.isEmpty()) diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index 8cda8b7667..4258bc69d0 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -611,6 +611,8 @@ void Generator::generateBody(const Node *node, CodeMarker *marker) node->doc().location().warning( tr("No such enum item '%1' in %2").arg(*a).arg(marker->plainFullName(node)), details); + if (*a == "Void") + qDebug() << "VOID:" << node->name() << definedItems; } else if (!documentedItems.contains(*a)) { node->doc().location().warning( diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 9434ced42f..8a54d630c5 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -4072,16 +4072,11 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node, out() << "

"; out() << ""; - int ro = qpn->getReadOnly(); - if (ro < 0) { - if (!qpn->isWritable(tree_)) { - out() << "read-only"; - } - } - else if (ro > 0) { + if (!qpn->isReadOnlySet()) + qpn->setReadOnly(!qpn->isWritable(tree_)); + if (qpn->isReadOnly()) out() << "read-only"; - } - if (qpgn->isDefault()) + if (qpn->isDefault()) out() << "default"; generateQmlItem(qpn, relative, marker, false); out() << "

"; @@ -4113,16 +4108,12 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node, out() << ""; out() << "

"; out() << ""; - int ro = qpn->getReadOnly(); - if (ro < 0) { - const ClassNode* cn = qpn->declarativeCppNode(); - if (cn && !qpn->isWritable(tree_)) { - out() << "read-only"; - } + if (!qpn->isReadOnlySet()) { + if (qpn->declarativeCppNode()) + qpn->setReadOnly(!qpn->isWritable(tree_)); } - else if (ro > 0) { + if (qpn->isReadOnly()) out() << "read-only"; - } if (qpn->isDefault()) out() << "default"; generateQmlItem(qpn, relative, marker, false); @@ -4145,16 +4136,10 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node, out() << ""; out() << "

"; out() << ""; - - int ro = qpn->getReadOnly(); - if (ro < 0) { - if (!qpn->isWritable(tree_)) { - out() << "read-only"; - } - } - else if (ro > 0) { + if (!qpn->isReadOnlySet()) + qpn->setReadOnly(!qpn->isWritable(tree_)); + if (qpn->isReadOnly()) out() << "read-only"; - } if (qpn->isDefault()) out() << "default"; generateQmlItem(q, relative, marker, false); diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index 703c073554..1ee4719f9a 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -327,6 +327,38 @@ void Node::setPageType(const QString& t) pageType_ = DitaMapPage; } +/*! Converts the boolean value \a b to an enum representation + of the boolean type, which includes an enum value for the + \e {default value} of the item, i.e. true, false, or default. + */ +Node::FlagValue Node::toFlagValue(bool b) +{ + return b ? FlagValueTrue : FlagValueFalse; +} + +/*! + Converts the enum \a fv back to a boolean value. + If \a fv is neither the true enum value nor the + false enum value, the boolean value returned is + \a defaultValue. + + Note that runtimeDesignabilityFunction() should be called + first. If that function returns the name of a function, it + means the function must be called at runtime to determine + whether the property is Designable. + */ +bool Node::fromFlagValue(FlagValue fv, bool defaultValue) +{ + switch (fv) { + case FlagValueTrue: + return true; + case FlagValueFalse: + return false; + default: + return defaultValue; + } +} + /*! Sets the pointer to the node that this node relates to. */ @@ -1876,11 +1908,11 @@ void FunctionNode::debug() const */ PropertyNode::PropertyNode(InnerNode *parent, const QString& name) : LeafNode(Property, parent, name), - sto(Trool_Default), - des(Trool_Default), - scr(Trool_Default), - wri(Trool_Default), - usr(Trool_Default), + stored_(FlagValueDefault), + designable_(FlagValueDefault), + scriptable_(FlagValueDefault), + writable_(FlagValueDefault), + user_(FlagValueDefault), cst(false), fnl(false), rev(-1), @@ -1905,16 +1937,16 @@ void PropertyNode::setOverriddenFrom(const PropertyNode* baseProperty) if (funcs[i].isEmpty()) funcs[i] = baseProperty->funcs[i]; } - if (sto == Trool_Default) - sto = baseProperty->sto; - if (des == Trool_Default) - des = baseProperty->des; - if (scr == Trool_Default) - scr = baseProperty->scr; - if (wri == Trool_Default) - wri = baseProperty->wri; - if (usr == Trool_Default) - usr = baseProperty->usr; + if (stored_ == FlagValueDefault) + stored_ = baseProperty->stored_; + if (designable_ == FlagValueDefault) + designable_ = baseProperty->designable_; + if (scriptable_ == FlagValueDefault) + scriptable_ = baseProperty->scriptable_; + if (writable_ == FlagValueDefault) + writable_ = baseProperty->writable_; + if (user_ == FlagValueDefault) + user_ = baseProperty->user_; overrides = baseProperty; } @@ -1940,38 +1972,6 @@ QString PropertyNode::qualifiedDataType() const } } -/*! Converts the \a boolean value to an enum representation - of the boolean type, which includes an enum value for the - \e {default value} of the item, i.e. true, false, or default. - */ -PropertyNode::Trool PropertyNode::toTrool(bool boolean) -{ - return boolean ? Trool_True : Trool_False; -} - -/*! - Converts the enum \a troolean back to a boolean value. - If \a troolean is neither the true enum value nor the - false enum value, the boolean value returned is - \a defaultValue. - - Note that runtimeDesignabilityFunction() should be called - first. If that function returns the name of a function, it - means the function must be called at runtime to determine - whether the property is Designable. - */ -bool PropertyNode::fromTrool(Trool troolean, bool defaultValue) -{ - switch (troolean) { - case Trool_True: - return true; - case Trool_False: - return false; - default: - return defaultValue; - } -} - bool QmlClassNode::qmlOnly = false; QMultiMap QmlClassNode::inheritedBy; QMap QmlClassNode::moduleMap; @@ -2181,13 +2181,14 @@ QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent, Constructor for the Qml property group node. \a parent is always a QmlClassNode. */ -QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, - const QString& name, - bool attached) - : FakeNode(parent, name, QmlPropertyGroup, Node::ApiPage), +QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, const QString& name) + //bool attached) + : FakeNode(parent, name, QmlPropertyGroup, Node::ApiPage) +#if 0 isdefault_(false), attached_(attached), readOnly_(-1) +#endif { // nothing. } @@ -2207,11 +2208,11 @@ QmlPropertyNode::QmlPropertyNode(QmlPropGroupNode *parent, bool attached) : LeafNode(QmlProperty, parent, name), type_(type), - sto(Trool_Default), - des(Trool_Default), + stored_(FlagValueDefault), + designable_(FlagValueDefault), isdefault_(false), attached_(attached), - readOnly_(-1) + readOnly_(FlagValueDefault) { setPageType(ApiPage); } @@ -2226,11 +2227,11 @@ QmlPropertyNode::QmlPropertyNode(QmlClassNode *parent, bool attached) : LeafNode(QmlProperty, parent, name), type_(type), - sto(Trool_Default), - des(Trool_Default), + stored_(FlagValueDefault), + designable_(FlagValueDefault), isdefault_(false), attached_(attached), - readOnly_(-1) + readOnly_(FlagValueDefault) { setPageType(ApiPage); } @@ -2252,38 +2253,15 @@ QmlPropertyNode::QmlPropertyNode(QmlPropertyNode* parent, bool attached) : LeafNode(parent->parent(), QmlProperty, name), type_(type), - sto(Trool_Default), - des(Trool_Default), + stored_(FlagValueDefault), + designable_(FlagValueDefault), isdefault_(false), attached_(attached), - readOnly_(-1) + readOnly_(FlagValueDefault) { setPageType(ApiPage); } -/*! - I don't know what this is. - */ -QmlPropertyNode::Trool QmlPropertyNode::toTrool(bool boolean) -{ - return boolean ? Trool_True : Trool_False; -} - -/*! - I don't know what this is either. - */ -bool QmlPropertyNode::fromTrool(Trool troolean, bool defaultValue) -{ - switch (troolean) { - case Trool_True: - return true; - case Trool_False: - return false; - default: - return defaultValue; - } -} - /*! Returns true if a QML property or attached property is read-only. The algorithm for figuring this out is long @@ -2293,14 +2271,16 @@ bool QmlPropertyNode::fromTrool(Trool troolean, bool defaultValue) */ bool QmlPropertyNode::isWritable(Tree* tree) { - if (wri != Trool_Default) - return fromTrool(wri, false); + if (readOnly_ != FlagValueDefault) { + return !fromFlagValue(readOnly_, false); + } PropertyNode* pn = correspondingProperty(tree); - if (pn) + if (pn) { return pn->isWritable(); + } else { - location().warning(tr("Can't determine read-only status of QML property %1; writable assumed.").arg(name())); + location().warning(tr("Can't detect if QML property %1 isread-only; writable assumed.").arg(name())); return true; } } diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index cfd446dd89..45b5ded640 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -156,6 +156,12 @@ public: OnBeyondZebra }; + enum FlagValue { + FlagValueDefault = -1, + FlagValueFalse = 0, + FlagValueTrue = 1 + }; + virtual ~Node(); void setAccess(Access access) { access_ = access; } @@ -239,6 +245,9 @@ public: static QString cleanId(QString str); QString idForNode() const; + static FlagValue toFlagValue(bool b); + static bool fromFlagValue(FlagValue fv, bool defaultValue); + static QString pageTypeString(unsigned t); static QString nodeTypeString(unsigned t); static QString nodeSubtypeString(unsigned t); @@ -553,9 +562,8 @@ public: class QmlPropGroupNode : public FakeNode { public: - QmlPropGroupNode(QmlClassNode* parent, - const QString& name, - bool attached); + QmlPropGroupNode(QmlClassNode* parent, const QString& name); + //bool attached); virtual ~QmlPropGroupNode() { } virtual bool isQmlNode() const { return true; } virtual bool isQtQuickNode() const { return parent()->isQtQuickNode(); } @@ -564,6 +572,7 @@ public: virtual QString qmlModuleIdentifier() const { return parent()->qmlModuleIdentifier(); } const QString& element() const { return parent()->name(); } +#if 0 void setDefault() { isdefault_ = true; } void setReadOnly(int ro) { readOnly_ = ro; } int getReadOnly() const { return readOnly_; } @@ -575,6 +584,7 @@ private: bool isdefault_; bool attached_; int readOnly_; +#endif }; class QmlPropertyNode; @@ -597,21 +607,20 @@ public: virtual ~QmlPropertyNode() { } void setDataType(const QString& dataType) { type_ = dataType; } - void setStored(bool stored) { sto = toTrool(stored); } - void setDesignable(bool designable) { des = toTrool(designable); } - void setWritable(bool writable) { wri = toTrool(writable); } + void setStored(bool stored) { stored_ = toFlagValue(stored); } + void setDesignable(bool designable) { designable_ = toFlagValue(designable); } + void setReadOnly(bool ro) { readOnly_ = toFlagValue(ro); } + void setDefault() { isdefault_ = true; } const QString &dataType() const { return type_; } QString qualifiedDataType() const { return type_; } - void setDefault() { isdefault_ = true; } - void setReadOnly(int ro) { readOnly_ = ro; } - int getReadOnly() const { return readOnly_; } + bool isReadOnlySet() const { return (readOnly_ != FlagValueDefault); } bool isDefault() const { return isdefault_; } - bool isStored() const { return fromTrool(sto,true); } - bool isDesignable() const { return fromTrool(des,false); } + bool isStored() const { return fromFlagValue(stored_,true); } + bool isDesignable() const { return fromFlagValue(designable_,false); } bool isWritable(Tree* tree); bool isAttached() const { return attached_; } - bool isReadOnly() const { return (readOnly_ > 0); } + bool isReadOnly() const { return fromFlagValue(readOnly_,false); } virtual bool isQmlNode() const { return true; } virtual bool isQtQuickNode() const { return parent()->isQtQuickNode(); } virtual QString qmlModuleName() const { return parent()->qmlModuleName(); } @@ -625,18 +634,12 @@ public: const NodeList& qmlPropNodes() const { return qmlPropNodes_; } private: - enum Trool { Trool_True, Trool_False, Trool_Default }; - - static Trool toTrool(bool boolean); - static bool fromTrool(Trool troolean, bool defaultValue); - QString type_; - Trool sto; - Trool des; - Trool wri; + FlagValue stored_; + FlagValue designable_; bool isdefault_; bool attached_; - int readOnly_; + FlagValue readOnly_; NodeList qmlPropNodes_; }; @@ -842,11 +845,11 @@ public: void setDataType(const QString& dataType) { type_ = dataType; } void addFunction(FunctionNode* function, FunctionRole role); void addSignal(FunctionNode* function, FunctionRole role); - void setStored(bool stored) { sto = toTrool(stored); } - void setDesignable(bool designable) { des = toTrool(designable); } - void setScriptable(bool scriptable) { scr = toTrool(scriptable); } - void setWritable(bool writable) { wri = toTrool(writable); } - void setUser(bool user) { usr = toTrool(user); } + void setStored(bool stored) { stored_ = toFlagValue(stored); } + void setDesignable(bool designable) { designable_ = toFlagValue(designable); } + void setScriptable(bool scriptable) { scriptable_ = toFlagValue(scriptable); } + void setWritable(bool writable) { writable_ = toFlagValue(writable); } + void setUser(bool user) { user_ = toFlagValue(user); } void setOverriddenFrom(const PropertyNode* baseProperty); void setRuntimeDesFunc(const QString& rdf) { runtimeDesFunc = rdf; } void setRuntimeScrFunc(const QString& scrf) { runtimeScrFunc = scrf; } @@ -862,13 +865,13 @@ public: NodeList setters() const { return functions(Setter); } NodeList resetters() const { return functions(Resetter); } NodeList notifiers() const { return functions(Notifier); } - bool isStored() const { return fromTrool(sto, storedDefault()); } - bool isDesignable() const { return fromTrool(des, designableDefault()); } - bool isScriptable() const { return fromTrool(scr, scriptableDefault()); } + bool isStored() const { return fromFlagValue(stored_, storedDefault()); } + bool isDesignable() const { return fromFlagValue(designable_, designableDefault()); } + bool isScriptable() const { return fromFlagValue(scriptable_, scriptableDefault()); } const QString& runtimeDesignabilityFunction() const { return runtimeDesFunc; } const QString& runtimeScriptabilityFunction() const { return runtimeScrFunc; } - bool isWritable() const { return fromTrool(wri, writableDefault()); } - bool isUser() const { return fromTrool(usr, userDefault()); } + bool isWritable() const { return fromFlagValue(writable_, writableDefault()); } + bool isUser() const { return fromFlagValue(user_, userDefault()); } bool isConstant() const { return cst; } bool isFinal() const { return fnl; } const PropertyNode* overriddenFrom() const { return overrides; } @@ -880,20 +883,15 @@ public: bool writableDefault() const { return !setters().isEmpty(); } private: - enum Trool { Trool_True, Trool_False, Trool_Default }; - - static Trool toTrool(bool boolean); - static bool fromTrool(Trool troolean, bool defaultValue); - QString type_; QString runtimeDesFunc; QString runtimeScrFunc; NodeList funcs[NumFunctionRoles]; - Trool sto; - Trool des; - Trool scr; - Trool wri; - Trool usr; + FlagValue stored_; + FlagValue designable_; + FlagValue scriptable_; + FlagValue writable_; + FlagValue user_; bool cst; bool fnl; int rev; -- cgit v1.2.3 From 1ec7843856a40752ffcb668f608611887937a242 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 11 Apr 2012 15:25:59 +0200 Subject: QDoc: Fix no-examples option. This was accidentally removed in the big change regarding searching in the internal QDoc tree. Change-Id: I2496d7497d239f1ec5fbd01be6a918c1ef29fc95 Reviewed-by: Casper van Donderen --- src/tools/qdoc/cppcodeparser.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp index d0822fec1a..d8367b3e09 100644 --- a/src/tools/qdoc/cppcodeparser.cpp +++ b/src/tools/qdoc/cppcodeparser.cpp @@ -689,9 +689,11 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, return node; } else if (command == COMMAND_EXAMPLE) { - ExampleNode* en = new ExampleNode(tree_->root(), arg); - createExampleFileNodes(en); - return en; + if (Config::generateExamples) { + ExampleNode* en = new ExampleNode(tree_->root(), arg); + createExampleFileNodes(en); + return en; + } } else if (command == COMMAND_EXTERNALPAGE) { return new FakeNode(tree_->root(), arg, Node::ExternalPage, Node::ArticlePage); -- cgit v1.2.3 From eff344ab8a509996cab491347aed4a4d8ea5b2ab Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 5 Apr 2012 11:35:09 +0200 Subject: Don't crash when comparing values containing empty arrays/objects Task-number: QTBUG-25164 Change-Id: I1fa00e359ef3583b9a7136bb888cdf5e1c3e75ac Reviewed-by: Jamey Hicks --- src/corelib/json/qjsonarray.cpp | 2 ++ src/corelib/json/qjsonvalue.cpp | 8 ++++++ tests/auto/corelib/json/tst_qtjson.cpp | 48 ++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) diff --git a/src/corelib/json/qjsonarray.cpp b/src/corelib/json/qjsonarray.cpp index d143215efd..0884f10354 100644 --- a/src/corelib/json/qjsonarray.cpp +++ b/src/corelib/json/qjsonarray.cpp @@ -87,6 +87,8 @@ QJsonArray::QJsonArray() QJsonArray::QJsonArray(QJsonPrivate::Data *data, QJsonPrivate::Array *array) : d(data), a(array) { + Q_ASSERT(data); + Q_ASSERT(array); d->ref.ref(); } diff --git a/src/corelib/json/qjsonvalue.cpp b/src/corelib/json/qjsonvalue.cpp index b4a689da60..7e8fdf8221 100644 --- a/src/corelib/json/qjsonvalue.cpp +++ b/src/corelib/json/qjsonvalue.cpp @@ -448,9 +448,17 @@ bool QJsonValue::operator==(const QJsonValue &other) const case String: return toString() == other.toString(); case Array: + if (base == other.base) + return true; + if (!base || !other.base) + return false; return QJsonArray(d, static_cast(base)) == QJsonArray(other.d, static_cast(other.base)); case Object: + if (base == other.base) + return true; + if (!base || !other.base) + return false; return QJsonObject(d, static_cast(base)) == QJsonObject(other.d, static_cast(other.base)); } diff --git a/tests/auto/corelib/json/tst_qtjson.cpp b/tests/auto/corelib/json/tst_qtjson.cpp index 4ab4b78da1..bf6a58a24b 100644 --- a/tests/auto/corelib/json/tst_qtjson.cpp +++ b/tests/auto/corelib/json/tst_qtjson.cpp @@ -123,6 +123,8 @@ private Q_SLOTS: void testTrailingComma(); void testDetachBug(); + + void valueEquals(); private: QString testDataDir; }; @@ -1845,5 +1847,51 @@ void TestQtJson::testDetachBug() QCOMPARE(local.keys().size(), 1); } +void TestQtJson::valueEquals() +{ + QVERIFY(QJsonValue() == QJsonValue()); + QVERIFY(QJsonValue() != QJsonValue(QJsonValue::Undefined)); + QVERIFY(QJsonValue() != QJsonValue(true)); + QVERIFY(QJsonValue() != QJsonValue(1.)); + QVERIFY(QJsonValue() != QJsonValue(QJsonArray())); + QVERIFY(QJsonValue() != QJsonValue(QJsonObject())); + + QVERIFY(QJsonValue(true) == QJsonValue(true)); + QVERIFY(QJsonValue(true) != QJsonValue(false)); + QVERIFY(QJsonValue(true) != QJsonValue(QJsonValue::Undefined)); + QVERIFY(QJsonValue(true) != QJsonValue()); + QVERIFY(QJsonValue(true) != QJsonValue(1.)); + QVERIFY(QJsonValue(true) != QJsonValue(QJsonArray())); + QVERIFY(QJsonValue(true) != QJsonValue(QJsonObject())); + + QVERIFY(QJsonValue(1.) == QJsonValue(1.)); + QVERIFY(QJsonValue(1.) != QJsonValue(2.)); + QVERIFY(QJsonValue(1.) != QJsonValue(QJsonValue::Undefined)); + QVERIFY(QJsonValue(1.) != QJsonValue()); + QVERIFY(QJsonValue(1.) != QJsonValue(true)); + QVERIFY(QJsonValue(1.) != QJsonValue(QJsonArray())); + QVERIFY(QJsonValue(1.) != QJsonValue(QJsonObject())); + + QVERIFY(QJsonValue(QJsonArray()) == QJsonValue(QJsonArray())); + QJsonArray nonEmptyArray; + nonEmptyArray.append(true); + QVERIFY(QJsonValue(QJsonArray()) != nonEmptyArray); + QVERIFY(QJsonValue(QJsonArray()) != QJsonValue(QJsonValue::Undefined)); + QVERIFY(QJsonValue(QJsonArray()) != QJsonValue()); + QVERIFY(QJsonValue(QJsonArray()) != QJsonValue(true)); + QVERIFY(QJsonValue(QJsonArray()) != QJsonValue(1.)); + QVERIFY(QJsonValue(QJsonArray()) != QJsonValue(QJsonObject())); + + QVERIFY(QJsonValue(QJsonObject()) == QJsonValue(QJsonObject())); + QJsonObject nonEmptyObject; + nonEmptyObject.insert("Key", true); + QVERIFY(QJsonValue(QJsonObject()) != nonEmptyObject); + QVERIFY(QJsonValue(QJsonObject()) != QJsonValue(QJsonValue::Undefined)); + QVERIFY(QJsonValue(QJsonObject()) != QJsonValue()); + QVERIFY(QJsonValue(QJsonObject()) != QJsonValue(true)); + QVERIFY(QJsonValue(QJsonObject()) != QJsonValue(1.)); + QVERIFY(QJsonValue(QJsonObject()) != QJsonValue(QJsonArray())); +} + QTEST_MAIN(TestQtJson) #include "tst_qtjson.moc" -- cgit v1.2.3 From ad1bd1563f3f65d0f7b65687af2ade42f7f9f3d9 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 28 Mar 2012 15:26:17 +0200 Subject: Implement window modality in QtGui MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QWindow already has windowModality() and setWindowModality() as part of its API from commit 516f4e283ba4626d7239630397ef867ab0366071. Platform plugins can use this already to setup modality hints on windows that they create, but it's not enough to implement modality fully. QGuiApplication gets a modalWindow() static method, which is similar to QApplication::activeModalWidget() in that it returns the last modal window to be shown. The modal window "stack" moves from QApplicationPrivate to QGuiApplicationPrivate. The enterModal*() and leaveModal*() functions in QApplicationPrivate are removed and replaced by QGuiApplicationPrivate::showModalWindow() and hideModalWindow(), which are called by QWindow::setVisible() just before calling QPlatformWindow::setVisible(). The virtual QGuiApplicationPrivate::isWindowBlocked() will tell us if a window is blocked by a modal window (and tell which modal window for any interested callers). The default implementation works on the QWindow level. QApplicationPrivate reimplements isWindowBlocked() and adds popup and WA_GroupLeader support. QGuiApplication uses the state set from isWindowBlocked() to block user-input events: mouse press, mouse move, mouse release, wheel, key presses, key releases, enter/leave events, close events, and touch begin, update, and end events. Note also that the modality helper functions in QtWidgets and QApplicationPrivate are left in place and working as they always have. The behavior of QWidget in the presence of modal windows/dialogs should not change. Change-Id: I2c89e6026d40160387787a6e009ae1fdc12dfd69 Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll Reviewed-by: Samuel Rødal Reviewed-by: Morten Johan Sørvig --- src/gui/kernel/qguiapplication.cpp | 158 ++++++++++++++++++++++++++++- src/gui/kernel/qguiapplication.h | 2 + src/gui/kernel/qguiapplication_p.h | 6 +- src/gui/kernel/qwindow.cpp | 7 ++ src/gui/kernel/qwindow_p.h | 3 + src/widgets/kernel/qapplication.cpp | 171 ++++++++++++++------------------ src/widgets/kernel/qapplication_p.h | 9 +- src/widgets/kernel/qapplication_qpa.cpp | 23 +---- src/widgets/kernel/qwidget.cpp | 23 +---- 9 files changed, 256 insertions(+), 146 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index e03fd6dba0..8dcd58a51a 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -114,7 +114,6 @@ enum ApplicationResourceFlags static unsigned applicationResourceFlags = 0; QString *QGuiApplicationPrivate::platform_name = 0; -bool QGuiApplicationPrivate::app_do_modal = false; QPalette *QGuiApplicationPrivate::app_pal = 0; // default application palette @@ -383,6 +382,132 @@ QGuiApplicationPrivate::QGuiApplicationPrivate(int &argc, char **argv, int flags application_type = QCoreApplication::GuiClient; } +/*! + Returns the most recently shown modal window. If no modal windows are + visible, this function returns zero. + + A modal window is a window which has its + \l{QWindow::windowModality}{windowModality} property set to Qt::WindowModal + or Qt::ApplicationModal. A modal window must be closed before the user can + continue with other parts of the program. + + Modal window are organized in a stack. This function returns the modal + window at the top of the stack. + + \sa Qt::WindowModality, QWindow::setWindowModality() +*/ +QWindow *QGuiApplication::modalWindow() +{ + if (QGuiApplicationPrivate::self->modalWindowList.isEmpty()) + return 0; + return QGuiApplicationPrivate::self->modalWindowList.first(); +} + +void QGuiApplicationPrivate::showModalWindow(QWindow *window) +{ + self->modalWindowList.prepend(window); + + QEvent e(QEvent::WindowBlocked); + QWindowList windows = QGuiApplication::topLevelWindows(); + for (int i = 0; i < windows.count(); ++i) { + QWindow *window = windows.at(i); + if (!window->d_func()->blockedByModalWindow && window->windowType() != Qt::Tool && self->isWindowBlocked(window)) { + window->d_func()->blockedByModalWindow = true; + QGuiApplication::sendEvent(window, &e); + } + } +} + +void QGuiApplicationPrivate::hideModalWindow(QWindow *window) +{ + self->modalWindowList.removeAll(window); + + QEvent e(QEvent::WindowUnblocked); + QWindowList windows = QGuiApplication::topLevelWindows(); + for (int i = 0; i < windows.count(); ++i) { + QWindow *window = windows.at(i); + if (window->d_func()->blockedByModalWindow && window->windowType() != Qt::Tool && !self->isWindowBlocked(window)) { + window->d_func()->blockedByModalWindow = false; + QGuiApplication::sendEvent(window, &e); + } + } +} + +/* + Returns true if \a window is blocked by a modal window. If \a + blockingWindow is non-zero, *blockingWindow will be set to the blocking + window (or to zero if \a window is not blocked). +*/ +bool QGuiApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWindow) const +{ + QWindow *unused = 0; + if (!blockingWindow) + blockingWindow = &unused; + + if (modalWindowList.isEmpty()) { + *blockingWindow = 0; + return false; + } + + for (int i = 0; i < modalWindowList.count(); ++i) { + QWindow *modalWindow = modalWindowList.at(i); + + { + // check if the modal window is our window or a (transient) parent of our window + QWindow *w = window; + while (w) { + if (w == modalWindow) { + *blockingWindow = 0; + return false; + } + QWindow *p = w->parent(); + if (!p) + p = w->transientParent(); + w = p; + } + } + + Qt::WindowModality windowModality = modalWindow->windowModality(); + switch (windowModality) { + case Qt::ApplicationModal: + { + if (modalWindow != window) { + *blockingWindow = modalWindow; + return true; + } + break; + } + case Qt::WindowModal: + { + QWindow *w = window; + do { + QWindow *m = modalWindow; + do { + if (m == w) { + *blockingWindow = m; + return true; + } + QWindow *p = m->parent(); + if (!p) + p = m->transientParent(); + m = p; + } while (m); + QWindow *p = w->parent(); + if (!p) + p = w->transientParent(); + w = p; + } while (w); + break; + } + default: + Q_ASSERT_X(false, "QGuiApplication", "internal error, a modal widget cannot be modeless"); + break; + } + } + *blockingWindow = 0; + return false; +} + /*! Returns the QWindow that receives events tied to focus, such as key events. @@ -1058,6 +1183,11 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo } if (window) { + if (window->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow mouse events through + return; + } + QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers); ev.setTimestamp(e->timestamp); #ifndef QT_NO_CURSOR @@ -1120,6 +1250,11 @@ void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wh QWindow *window = e->window.data(); if (window) { + if (window->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow wheel events through + return; + } + QWheelEvent ev(e->localPos, e->globalPos, e->pixelDelta, e->angleDelta, e->qt4Delta, e->qt4Orientation, buttons, e->modifiers); ev.setTimestamp(e->timestamp); QGuiApplication::sendSpontaneousEvent(window, &ev); @@ -1137,6 +1272,10 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE window = QGuiApplication::activeWindow(); if (!window) return; + if (window->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow key events through + return; + } QKeyEventEx ev(e->keyType, e->key, e->modifiers, e->unicode, e->repeat, e->repeatCount, e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers); @@ -1148,6 +1287,10 @@ void QGuiApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::En { if (!e->enter) return; + if (e->enter.data()->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow enter events through + return; + } QEvent event(QEvent::Enter); QCoreApplication::sendSpontaneousEvent(e->enter.data(), &event); @@ -1157,6 +1300,10 @@ void QGuiApplicationPrivate::processLeaveEvent(QWindowSystemInterfacePrivate::Le { if (!e->leave) return; + if (e->leave.data()->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow leave events through + return; + } QEvent event(QEvent::Leave); QCoreApplication::sendSpontaneousEvent(e->leave.data(), &event); @@ -1271,6 +1418,10 @@ void QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::Cl { if (e->window.isNull()) return; + if (e->window.data()->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow close events through + return; + } QCloseEvent event; QGuiApplication::sendSpontaneousEvent(e->window.data(), &event); @@ -1459,6 +1610,11 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To break; } + if (w->d_func()->blockedByModalWindow) { + // a modal window is blocking this window, don't allow touch events through + continue; + } + QTouchEvent touchEvent(eventType, e->device, e->modifiers, diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h index b58720db13..aad540d203 100644 --- a/src/gui/kernel/qguiapplication.h +++ b/src/gui/kernel/qguiapplication.h @@ -88,6 +88,8 @@ public: static QString platformName(); + static QWindow *modalWindow(); + #ifdef QT_DEPRECATED static QT_DEPRECATED QWindow *activeWindow() { return focusWindow(); } #endif diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index a686b4fd66..ca8f90ab79 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -150,7 +150,11 @@ public: static QGuiApplicationPrivate *instance() { return self; } static QString *platform_name; - static bool app_do_modal; + + QWindowList modalWindowList; + static void showModalWindow(QWindow *window); + static void hideModalWindow(QWindow *window); + virtual bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const; static Qt::MouseButtons buttons; static ulong mousePressTime; diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 519e18e940..96f7eb5428 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -241,6 +241,13 @@ void QWindow::setVisible(bool visible) QGuiApplication::sendEvent(this, &showEvent); } + if (isModal()) { + if (visible) + QGuiApplicationPrivate::showModalWindow(this); + else + QGuiApplicationPrivate::hideModalWindow(this); + } + d->platformWindow->setVisible(visible); if (!visible) { diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index 7f3958b3ff..eb4fab9013 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -79,6 +79,7 @@ public: , windowOrientation(Qt::PrimaryOrientation) , maximumSize(QWINDOWSIZE_MAX, QWINDOWSIZE_MAX) , modality(Qt::NonModal) + , blockedByModalWindow(false) , transientParent(0) , screen(0) { @@ -120,6 +121,8 @@ public: QSize sizeIncrement; Qt::WindowModality modality; + bool blockedByModalWindow; + QPointer transientParent; QScreen *screen; }; diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index a8b1fa6d1c..c560dba1b7 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -440,8 +440,6 @@ FontHash *qt_app_fonts_hash() QWidgetList *QApplicationPrivate::popupWidgets = 0; // has keyboard input focus QDesktopWidget *qt_desktopWidget = 0; // root window widgets -QWidgetList * qt_modal_stack = 0; // stack of modal widgets -bool app_do_modal = false; /*! \internal @@ -755,7 +753,8 @@ QWidget *QApplication::activePopupWidget() QWidget *QApplication::activeModalWidget() { - return qt_modal_stack && !qt_modal_stack->isEmpty() ? qt_modal_stack->first() : 0; + QWidgetWindow *widgetWindow = qobject_cast(modalWindow()); + return widgetWindow ? widgetWindow->widget() : 0; } /*! @@ -2315,31 +2314,52 @@ Q_WIDGETS_EXPORT bool qt_tryModalHelper(QWidget *widget, QWidget **rettop) bool QApplicationPrivate::isBlockedByModal(QWidget *widget) { widget = widget->window(); - if (!modalState()) + return self->isWindowBlocked(widget->windowHandle()); +} + +bool QApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blockingWindow) const +{ + QWindow *unused = 0; + if (!blockingWindow) + blockingWindow = &unused; + + if (modalWindowList.isEmpty()) { + *blockingWindow = 0; return false; - if (QApplication::activePopupWidget() == widget) + } + QWidget *popupWidget = QApplication::activePopupWidget(); + QWindow *popupWindow = popupWidget ? popupWidget->windowHandle() : 0; + if (popupWindow == window) { + *blockingWindow = 0; return false; + } - for (int i = 0; i < qt_modal_stack->size(); ++i) { - QWidget *modalWidget = qt_modal_stack->at(i); + for (int i = 0; i < modalWindowList.count(); ++i) { + QWindow *modalWindow = modalWindowList.at(i); { - // check if the active modal widget is our widget or a parent of our widget - QWidget *w = widget; + // check if the modal window is our window or a (transient) parent of our window + QWindow *w = window; while (w) { - if (w == modalWidget) + if (w == modalWindow) { + *blockingWindow = 0; return false; - w = w->parentWidget(); + } + QWindow *p = w->parent(); + if (!p) + p = w->transientParent(); + w = p; } } - Qt::WindowModality windowModality = modalWidget->windowModality(); + Qt::WindowModality windowModality = modalWindow->windowModality(); + QWidgetWindow *modalWidgetWindow = qobject_cast(modalWindow); if (windowModality == Qt::NonModal) { // determine the modality type if it hasn't been set on the - // modalWidget, this normally happens when waiting for a - // native dialog. use WindowModal if we are the child of a - // group leader; otherwise use ApplicationModal. - QWidget *m = modalWidget; + // modalWindow's widget, this normally happens when waiting for a + // native dialog. use WindowModal if we are the child of a group + // leader; otherwise use ApplicationModal. + QWidget *m = modalWidgetWindow ? modalWidgetWindow->widget() : 0; while (m && !m->testAttribute(Qt::WA_GroupLeader)) { m = m->parentWidget(); if (m) @@ -2352,97 +2372,58 @@ bool QApplicationPrivate::isBlockedByModal(QWidget *widget) switch (windowModality) { case Qt::ApplicationModal: - { - QWidget *groupLeaderForWidget = widget; - while (groupLeaderForWidget && !groupLeaderForWidget->testAttribute(Qt::WA_GroupLeader)) - groupLeaderForWidget = groupLeaderForWidget->parentWidget(); - - if (groupLeaderForWidget) { - // if \a widget has WA_GroupLeader, it can only be blocked by ApplicationModal children - QWidget *m = modalWidget; - while (m && m != groupLeaderForWidget && !m->testAttribute(Qt::WA_GroupLeader)) - m = m->parentWidget(); - if (m == groupLeaderForWidget) - return true; - } else if (modalWidget != widget) { + { + QWidgetWindow *widgetWindow = qobject_cast(window); + QWidget *groupLeaderForWidget = widgetWindow ? widgetWindow->widget() : 0; + while (groupLeaderForWidget && !groupLeaderForWidget->testAttribute(Qt::WA_GroupLeader)) + groupLeaderForWidget = groupLeaderForWidget->parentWidget(); + + if (groupLeaderForWidget) { + // if \a widget has WA_GroupLeader, it can only be blocked by ApplicationModal children + QWidget *m = modalWidgetWindow ? modalWidgetWindow->widget() : 0; + while (m && m != groupLeaderForWidget && !m->testAttribute(Qt::WA_GroupLeader)) + m = m->parentWidget(); + if (m == groupLeaderForWidget) { + *blockingWindow = m->windowHandle(); return true; } - break; + } else if (modalWindow != window) { + *blockingWindow = modalWindow; + return true; } + break; + } case Qt::WindowModal: - { - QWidget *w = widget; + { + QWindow *w = window; + do { + QWindow *m = modalWindow; do { - QWidget *m = modalWidget; - do { - if (m == w) - return true; - m = m->parentWidget(); - if (m) - m = m->window(); - } while (m); - w = w->parentWidget(); - if (w) - w = w->window(); - } while (w); - break; - } + if (m == w) { + *blockingWindow = m; + return true; + } + QWindow *p = m->parent(); + if (!p) + p = m->transientParent(); + m = p; + } while (m); + QWindow *p = w->parent(); + if (!p) + p = w->transientParent(); + w = p; + } while (w); + break; + } default: - Q_ASSERT_X(false, "QApplication", "internal error, a modal widget cannot be modeless"); + Q_ASSERT_X(false, "QApplication", "internal error, a modal window cannot be modeless"); break; } } + *blockingWindow = 0; return false; } -/*!\internal - */ -void QApplicationPrivate::enterModal(QWidget *widget) -{ - QSet blocked; - QList windows = QApplication::topLevelWidgets(); - for (int i = 0; i < windows.count(); ++i) { - QWidget *window = windows.at(i); - if (window->windowType() != Qt::Tool && isBlockedByModal(window)) - blocked.insert(window); - } - - enterModal_sys(widget); - - windows = QApplication::topLevelWidgets(); - QEvent e(QEvent::WindowBlocked); - for (int i = 0; i < windows.count(); ++i) { - QWidget *window = windows.at(i); - if (!blocked.contains(window) && window->windowType() != Qt::Tool && isBlockedByModal(window)) - QApplication::sendEvent(window, &e); - } -} - -/*!\internal - */ -void QApplicationPrivate::leaveModal(QWidget *widget) -{ - QSet blocked; - QList windows = QApplication::topLevelWidgets(); - for (int i = 0; i < windows.count(); ++i) { - QWidget *window = windows.at(i); - if (window->windowType() != Qt::Tool && isBlockedByModal(window)) - blocked.insert(window); - } - - leaveModal_sys(widget); - - windows = QApplication::topLevelWidgets(); - QEvent e(QEvent::WindowUnblocked); - for (int i = 0; i < windows.count(); ++i) { - QWidget *window = windows.at(i); - if(blocked.contains(window) && window->windowType() != Qt::Tool && !isBlockedByModal(window)) - QApplication::sendEvent(window, &e); - } -} - - - /*!\internal Called from qapplication_\e{platform}.cpp, returns true diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 74af3bca6d..8f67a29d84 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -198,10 +198,7 @@ public: static void dispatchEnterLeave(QWidget *enter, QWidget *leave); //modality - static void enterModal(QWidget*); - static void leaveModal(QWidget*); - static void enterModal_sys(QWidget*); - static void leaveModal_sys(QWidget*); + Q_DECL_OVERRIDE bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const; static bool isBlockedByModal(QWidget *widget); static bool modalState(); static bool tryModalHelper(QWidget *widget, QWidget **rettop = 0); @@ -279,10 +276,6 @@ public: static bool widgetCount; // Coupled with -widgetcount switch static bool load_testability; // Coupled with -testability switch -#ifdef Q_WS_MAC - static bool native_modal_dialog_active; -#endif - static void setSystemPalette(const QPalette &pal); static void setPalette_helper(const QPalette &palette, const char* className, bool clearWidgetPaletteHash); static void initializeWidgetPaletteHash(); diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp index bcea2676bc..92b831101f 100644 --- a/src/widgets/kernel/qapplication_qpa.cpp +++ b/src/widgets/kernel/qapplication_qpa.cpp @@ -75,8 +75,6 @@ QT_BEGIN_NAMESPACE static QString appName; static QString appFont; static bool popupGrabOk; -extern bool app_do_modal; -extern QWidgetList *qt_modal_stack; extern QWidget *qt_button_down; extern QWidget *qt_popup_down; extern bool qt_replay_popup_mouse_event; @@ -126,28 +124,9 @@ bool qt_try_modal(QWidget *widget, QEvent::Type type) return !block_event; } -void QApplicationPrivate::enterModal_sys(QWidget *widget) -{ - if (!qt_modal_stack) - qt_modal_stack = new QWidgetList; - qt_modal_stack->insert(0, widget); - app_do_modal = true; -} - -void QApplicationPrivate::leaveModal_sys(QWidget *widget) -{ - if (qt_modal_stack && qt_modal_stack->removeAll(widget)) { - if (qt_modal_stack->isEmpty()) { - delete qt_modal_stack; - qt_modal_stack = 0; - } - } - app_do_modal = qt_modal_stack != 0; -} - bool QApplicationPrivate::modalState() { - return app_do_modal; + return !self->modalWindowList.isEmpty(); } QWidget *qt_tlw_for_window(QWindow *wnd) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index cccde764ad..70839e705f 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -7080,12 +7080,6 @@ void QWidgetPrivate::show_helper() QShowEvent showEvent; QApplication::sendEvent(q, &showEvent); - if (!isEmbedded && q->isModal() && q->isWindow()) - // QApplicationPrivate::enterModal *before* show, otherwise the initial - // stacking might be wrong - QApplicationPrivate::enterModal(q); - - show_sys(); if (!isEmbedded && q->windowType() == Qt::Popup) @@ -7141,12 +7135,6 @@ void QWidgetPrivate::hide_helper() if (!isEmbedded && (q->windowType() == Qt::Popup)) qApp->d_func()->closePopup(q); - // Move test modal here. Otherwise, a modal dialog could get - // destroyed and we lose all access to its parent because we haven't - // left modality. (Eg. modal Progress Dialog) - if (!isEmbedded && q->isModal() && q->isWindow()) - QApplicationPrivate::leaveModal(q); - #if defined(Q_WS_WIN) if (q->isWindow() && !(q->windowType() == Qt::Popup) && q->parentWidget() && !q->parentWidget()->isHidden() && q->isActiveWindow()) @@ -10047,9 +10035,7 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) break; case Qt::WA_ShowModal: if (!on) { - if (isVisible()) - QApplicationPrivate::leaveModal(this); - // reset modality type to Modeless when clearing WA_ShowModal + // reset modality type to NonModal when clearing WA_ShowModal data->window_modality = Qt::NonModal; } else if (data->window_modality == Qt::NonModal) { // determine the modality type if it hasn't been set prior @@ -10067,10 +10053,9 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on) data->window_modality = (w && w->testAttribute(Qt::WA_GroupLeader)) ? Qt::WindowModal : Qt::ApplicationModal; - // Some window managers does not allow us to enter modal after the - // window is showing. Therefore, to be consistent, we cannot call - // QApplicationPrivate::enterModal(this) here. The window must be - // hidden before changing modality. + // Some window managers do not allow us to enter modality after the + // window is visible.The window must be hidden before changing the + // windowModality property and then reshown. } if (testAttribute(Qt::WA_WState_Created)) { // don't call setModal_sys() before create_sys() -- cgit v1.2.3 From a266c22bb834695c4d2d6b5a491ca6786d2b2438 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Wed, 4 Apr 2012 20:41:50 +0200 Subject: Add tst_QGuiApplication::modalWindow() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This tests that modalWindow() returns the expected value and that QEvent::WindowBlocked and QEvent::WindowUnblocked are sent correctly when modal windows are hidden and shown. Change-Id: I872f35e0240c928566ab35fa5764fad6cfda6db6 Reviewed-by: Friedemann Kleint Reviewed-by: Samuel Rødal --- .../kernel/qguiapplication/tst_qguiapplication.cpp | 179 +++++++++++++++++++++ 1 file changed, 179 insertions(+) diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp index 1dc2e551b4..c0242d95c5 100644 --- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp +++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp @@ -56,6 +56,7 @@ private slots: void abortQuitOnShow(); void changeFocusWindow(); void keyboardModifiers(); + void modalWindow(); }; class DummyWindow : public QWindow @@ -315,5 +316,183 @@ void tst_QGuiApplication::keyboardModifiers() delete window; } +class BlockableWindow : public QWindow +{ + Q_OBJECT +public: + int blocked; + + inline BlockableWindow() + : QWindow() + { + blocked = false; + } + + bool event(QEvent *e) + { + switch (e->type()) { + case QEvent::WindowBlocked: + ++blocked; + break; + case QEvent::WindowUnblocked: + --blocked; + break; + default: + break; + } + return QWindow::event(e); + } +}; + +void tst_QGuiApplication::modalWindow() +{ + int argc = 0; + QGuiApplication app(argc, 0); + + BlockableWindow *window1 = new BlockableWindow; + + BlockableWindow *window2 = new BlockableWindow; + + BlockableWindow *windowModalWindow1 = new BlockableWindow; + windowModalWindow1->setTransientParent(window1); + windowModalWindow1->setWindowModality(Qt::WindowModal); + + BlockableWindow *windowModalWindow2 = new BlockableWindow; + windowModalWindow2->setTransientParent(windowModalWindow1); + windowModalWindow2->setWindowModality(Qt::WindowModal); + + BlockableWindow *applicationModalWindow1 = new BlockableWindow; + applicationModalWindow1->setWindowModality(Qt::ApplicationModal); + + // show the 2 windows, nothing is blocked + window1->show(); + window2->show(); + QTest::qWaitForWindowShown(window1); + QTest::qWaitForWindowShown(window2); + QCOMPARE(app.modalWindow(), static_cast(0)); + QCOMPARE(window1->blocked, 0); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 0); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // show applicationModalWindow1, everything is blocked + applicationModalWindow1->show(); + QCOMPARE(app.modalWindow(), applicationModalWindow1); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 1); + QCOMPARE(windowModalWindow1->blocked, 1); + QCOMPARE(windowModalWindow2->blocked, 1); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // everything is unblocked when applicationModalWindow1 is hidden + applicationModalWindow1->hide(); + QCOMPARE(app.modalWindow(), static_cast(0)); + QCOMPARE(window1->blocked, 0); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 0); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // show the windowModalWindow1, only window1 is blocked + windowModalWindow1->show(); + QCOMPARE(app.modalWindow(), windowModalWindow1); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 0); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // show the windowModalWindow2, windowModalWindow1 is blocked as well + windowModalWindow2->show(); + QCOMPARE(app.modalWindow(), windowModalWindow2); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 1); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // hide windowModalWindow1, nothing is unblocked + windowModalWindow1->hide(); + QCOMPARE(app.modalWindow(), windowModalWindow2); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 1); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // hide windowModalWindow2, windowModalWindow1 and window1 are unblocked + windowModalWindow2->hide(); + QCOMPARE(app.modalWindow(), static_cast(0)); + QCOMPARE(window1->blocked, 0); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 0); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // show windowModalWindow1 again, window1 is blocked + windowModalWindow1->show(); + QCOMPARE(app.modalWindow(), windowModalWindow1); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 0); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // show windowModalWindow2 again, windowModalWindow1 is also blocked + windowModalWindow2->show(); + QCOMPARE(app.modalWindow(), windowModalWindow2); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 1); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // show applicationModalWindow1, everything is blocked + applicationModalWindow1->show(); + QCOMPARE(app.modalWindow(), applicationModalWindow1); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 1); + QCOMPARE(windowModalWindow1->blocked, 1); + QCOMPARE(windowModalWindow2->blocked, 1); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // hide applicationModalWindow1, windowModalWindow1 and window1 are blocked + applicationModalWindow1->hide(); + QCOMPARE(app.modalWindow(), windowModalWindow2); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 1); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // hide windowModalWindow2, window1 is blocked + windowModalWindow2->hide(); + QCOMPARE(app.modalWindow(), windowModalWindow1); + QCOMPARE(window1->blocked, 1); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 0); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + // hide windowModalWindow1, everything is unblocked + windowModalWindow1->hide(); + QCOMPARE(app.modalWindow(), static_cast(0)); + QCOMPARE(window1->blocked, 0); + QCOMPARE(window2->blocked, 0); + QCOMPARE(windowModalWindow1->blocked, 0); + QCOMPARE(windowModalWindow2->blocked, 0); + QCOMPARE(applicationModalWindow1->blocked, 0); + + window2->hide(); + window1->hide(); + + delete applicationModalWindow1; + delete windowModalWindow2; + delete windowModalWindow1; + delete window2; + delete window1; +} + QTEST_APPLESS_MAIN(tst_QGuiApplication) #include "tst_qguiapplication.moc" -- cgit v1.2.3 From 9839474e19dbef4b5b79abeaecebbf6e7bd6aed2 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 30 Mar 2012 09:53:12 +0200 Subject: QWidget: allow modal top-levels to have WA_DontShowOnScreen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a modal top-level widget has WA_DontShowOnScreen set, we need to call QGuiApplicationPrivate::showModalWindow() and hideModalWindow() ourselves, since we will not be calling QWindow::setVisible() (which would normally do the call for us). Change-Id: I1b22dd177c5956a2290f3ee031c95ab50d88f153 Reviewed-by: Friedemann Kleint Reviewed-by: Morten Johan Sørvig --- src/widgets/kernel/qwidget_qpa.cpp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 3d23b04ddf..4fe7ad6dc7 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -441,8 +441,15 @@ void QWidgetPrivate::show_sys() { Q_Q(QWidget); q->setAttribute(Qt::WA_Mapped); + + QWindow *window = q->windowHandle(); + if (q->testAttribute(Qt::WA_DontShowOnScreen)) { invalidateBuffer(q->rect()); + if (q->isWindow() && q->windowModality() != Qt::NonModal && window) { + // add our window to the modal window list + QGuiApplicationPrivate::showModalWindow(window); + } return; } @@ -451,7 +458,6 @@ void QWidgetPrivate::show_sys() if (!q->isWindow() && !q->testAttribute(Qt::WA_NativeWindow)) return; - QWindow *window = q->windowHandle(); if (window) { QRect geomRect = q->geometry(); if (q->isWindow()) { @@ -473,9 +479,7 @@ void QWidgetPrivate::show_sys() } invalidateBuffer(q->rect()); - - if (window) - window->setVisible(true); + window->setVisible(true); } } @@ -484,6 +488,17 @@ void QWidgetPrivate::hide_sys() { Q_Q(QWidget); q->setAttribute(Qt::WA_Mapped, false); + + QWindow *window = q->windowHandle(); + + if (q->testAttribute(Qt::WA_DontShowOnScreen) + && q->isWindow() + && q->windowModality() != Qt::NonModal + && window) { + // remove our window from the modal window list + QGuiApplicationPrivate::hideModalWindow(window); + } + deactivateWidgetCleanup(); if (!q->isWindow()) { QWidget *p = q->parentWidget(); @@ -492,9 +507,9 @@ void QWidgetPrivate::hide_sys() } return; } - if (QWindow *window = q->windowHandle()) { - window->setVisible(false); - } + + if (window) + window->setVisible(false); } void QWidgetPrivate::setMaxWindowState_helper() -- cgit v1.2.3 From 54f718e55287d0cfa7e7e53473b07ca68678e7f2 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 10 Apr 2012 13:52:12 +0200 Subject: XCB: Compress window state change events. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Avoid sending Window State change events from WM_STATE/NET_WM_STATE changes irrelevant to Qt::WindowState. - Introduce QFlags for the NetWmState getter and setter to avoid passing QVector<> around. Change-Id: I74730928c7fffca0fa1cab3b90ded90b06304c06 Reviewed-by: Samuel Rødal --- src/plugins/platforms/xcb/qxcbwindow.cpp | 156 ++++++++++++++++--------------- src/plugins/platforms/xcb/qxcbwindow.h | 19 +++- 2 files changed, 97 insertions(+), 78 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 5a8f90b7ad..06cc5ad123 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -149,6 +149,7 @@ QXcbWindow::QXcbWindow(QWindow *window) #if defined(XCB_USE_EGL) , m_eglSurface(0) #endif + , m_lastWindowStateEvent(-1) { m_screen = static_cast(window->screen()->handle()); @@ -636,29 +637,9 @@ static void setMotifWmHints(QXcbConnection *c, xcb_window_t window, const QtMoti } } -void QXcbWindow::printNetWmState(const QVector &state) +QXcbWindow::NetWmStates QXcbWindow::netWmStates() { - printf("_NET_WM_STATE (%d): ", state.size()); - for (int i = 0; i < state.size(); ++i) { -#define CHECK_WM_STATE(state_atom) \ - if (state.at(i) == atom(QXcbAtom::state_atom))\ - printf(#state_atom " "); - CHECK_WM_STATE(_NET_WM_STATE_ABOVE) - CHECK_WM_STATE(_NET_WM_STATE_BELOW) - CHECK_WM_STATE(_NET_WM_STATE_FULLSCREEN) - CHECK_WM_STATE(_NET_WM_STATE_MAXIMIZED_HORZ) - CHECK_WM_STATE(_NET_WM_STATE_MAXIMIZED_VERT) - CHECK_WM_STATE(_NET_WM_STATE_MODAL) - CHECK_WM_STATE(_NET_WM_STATE_STAYS_ON_TOP) - CHECK_WM_STATE(_NET_WM_STATE_DEMANDS_ATTENTION) -#undef CHECK_WM_STATE - } - printf("\n"); -} - -QVector QXcbWindow::getNetWmState() -{ - QVector result; + NetWmStates result(0); xcb_get_property_cookie_t get_cookie = xcb_get_property_unchecked(xcb_connection(), 0, m_window, atom(QXcbAtom::_NET_WM_STATE), @@ -668,15 +649,24 @@ QVector QXcbWindow::getNetWmState() xcb_get_property_reply(xcb_connection(), get_cookie, NULL); if (reply && reply->format == 32 && reply->type == XCB_ATOM_ATOM) { - result.resize(reply->length); - - memcpy(result.data(), xcb_get_property_value(reply), reply->length * sizeof(xcb_atom_t)); - -#ifdef NET_WM_STATE_DEBUG - printf("getting net wm state (%x)\n", m_window); - printNetWmState(result); -#endif - + const xcb_atom_t *states = static_cast(xcb_get_property_value(reply)); + const xcb_atom_t *statesEnd = states + reply->length; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_ABOVE))) + result |= NetWmStateAbove; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_BELOW))) + result |= NetWmStateBelow; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_FULLSCREEN))) + result |= NetWmStateFullScreen; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_HORZ))) + result |= NetWmStateMaximizedHorz; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_VERT))) + result |= NetWmStateMaximizedVert; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_MODAL))) + result |= NetWmStateModal; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_STAYS_ON_TOP))) + result |= NetWmStateStaysOnTop; + if (statesEnd != qFind(states, statesEnd, atom(QXcbAtom::_NET_WM_STATE_DEMANDS_ATTENTION))) + result |= NetWmStateDemandsAttention; free(reply); } else { #ifdef NET_WM_STATE_DEBUG @@ -687,8 +677,26 @@ QVector QXcbWindow::getNetWmState() return result; } -void QXcbWindow::setNetWmState(const QVector &atoms) +void QXcbWindow::setNetWmStates(NetWmStates states) { + QVector atoms; + if (states & NetWmStateAbove) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_ABOVE)); + if (states & NetWmStateBelow) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_BELOW)); + if (states & NetWmStateFullScreen) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_FULLSCREEN)); + if (states & NetWmStateMaximizedHorz) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_HORZ)); + if (states & NetWmStateMaximizedVert) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_VERT)); + if (states & NetWmStateModal) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_MODAL)); + if (states & NetWmStateStaysOnTop) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_STAYS_ON_TOP)); + if (states & NetWmStateDemandsAttention) + atoms.push_back(atom(QXcbAtom::_NET_WM_STATE_DEMANDS_ATTENTION)); + if (atoms.isEmpty()) { Q_XCB_CALL(xcb_delete_property(xcb_connection(), m_window, atom(QXcbAtom::_NET_WM_STATE))); } else { @@ -699,7 +707,6 @@ void QXcbWindow::setNetWmState(const QVector &atoms) xcb_flush(xcb_connection()); } - Qt::WindowFlags QXcbWindow::setWindowFlags(Qt::WindowFlags flags) { Qt::WindowType type = static_cast(int(flags & Qt::WindowType_Mask)); @@ -966,30 +973,28 @@ void QXcbWindow::updateMotifWmHintsBeforeMap() void QXcbWindow::updateNetWmStateBeforeMap() { - QVector netWmState; + NetWmStates states(0); - Qt::WindowFlags flags = window()->windowFlags(); + const Qt::WindowFlags flags = window()->windowFlags(); if (flags & Qt::WindowStaysOnTopHint) { - netWmState.append(atom(QXcbAtom::_NET_WM_STATE_ABOVE)); - netWmState.append(atom(QXcbAtom::_NET_WM_STATE_STAYS_ON_TOP)); + states |= NetWmStateAbove; + states |= NetWmStateStaysOnTop; } else if (flags & Qt::WindowStaysOnBottomHint) { - netWmState.append(atom(QXcbAtom::_NET_WM_STATE_BELOW)); + states |= NetWmStateBelow; } - if (window()->windowState() & Qt::WindowFullScreen) { - netWmState.append(atom(QXcbAtom::_NET_WM_STATE_FULLSCREEN)); - } + if (window()->windowState() & Qt::WindowFullScreen) + states |= NetWmStateFullScreen; if (window()->windowState() & Qt::WindowMaximized) { - netWmState.append(atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_HORZ)); - netWmState.append(atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_VERT)); + states |= NetWmStateMaximizedHorz; + states |= NetWmStateMaximizedVert; } - if (window()->windowModality() != Qt::NonModal) { - netWmState.append(atom(QXcbAtom::_NET_WM_STATE_MODAL)); - } + if (window()->windowModality() != Qt::NonModal) + states |= NetWmStateModal; - setNetWmState(netWmState); + setNetWmStates(states); } void QXcbWindow::updateNetWmUserTime(xcb_timestamp_t timestamp) @@ -1452,41 +1457,42 @@ void QXcbWindow::handlePropertyNotifyEvent(const xcb_property_notify_event_t *ev { connection()->setTime(event->time); - bool propertyDeleted = event->state == XCB_PROPERTY_DELETE; + const bool propertyDeleted = event->state == XCB_PROPERTY_DELETE; + const xcb_atom_t netWmStateAtom = atom(QXcbAtom::_NET_WM_STATE); + const xcb_atom_t wmStateAtom = atom(QXcbAtom::WM_STATE); - if (event->atom == atom(QXcbAtom::_NET_WM_STATE) || event->atom == atom(QXcbAtom::WM_STATE)) { + if (event->atom == netWmStateAtom || event->atom == wmStateAtom) { if (propertyDeleted) return; - xcb_get_property_cookie_t get_cookie = - xcb_get_property(xcb_connection(), 0, m_window, atom(QXcbAtom::WM_STATE), - XCB_ATOM_ANY, 0, 1024); + Qt::WindowState newState = Qt::WindowNoState; + if (event->atom == wmStateAtom) { // WM_STATE: Quick check for 'Minimize'. + const xcb_get_property_cookie_t get_cookie = + xcb_get_property(xcb_connection(), 0, m_window, wmStateAtom, + XCB_ATOM_ANY, 0, 1024); - xcb_get_property_reply_t *reply = - xcb_get_property_reply(xcb_connection(), get_cookie, NULL); + xcb_get_property_reply_t *reply = + xcb_get_property_reply(xcb_connection(), get_cookie, NULL); - xcb_atom_t wm_state = XCB_WM_STATE_WITHDRAWN; - if (reply && reply->format == 32 && reply->type == atom(QXcbAtom::WM_STATE)) { - if (reply->length != 0) - wm_state = ((long *)xcb_get_property_value(reply))[0]; - free(reply); + if (reply && reply->format == 32 && reply->type == wmStateAtom) { + const long *data = (const long *)xcb_get_property_value(reply); + if (reply->length != 0 && XCB_WM_STATE_ICONIC == data[0]) + newState = Qt::WindowMinimized; + free(reply); + } + } // WM_STATE: Quick check for 'Minimize'. + if (newState != Qt::WindowMinimized) { // Something else changed, get _NET_WM_STATE. + const NetWmStates states = netWmStates(); + if ((states & NetWmStateMaximizedHorz) && (states & NetWmStateMaximizedVert)) + newState = Qt::WindowMaximized; + else if (states & NetWmStateFullScreen) + newState = Qt::WindowFullScreen; + } + // Send Window state, compress events in case other flags (modality, etc) are changed. + if (m_lastWindowStateEvent != newState) { + QWindowSystemInterface::handleWindowStateChanged(window(), newState); + m_lastWindowStateEvent = newState; } - - QVector netWmState = getNetWmState(); - - bool maximized = netWmState.contains(atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_HORZ)) - && netWmState.contains(atom(QXcbAtom::_NET_WM_STATE_MAXIMIZED_VERT)); - bool fullscreen = netWmState.contains(atom(QXcbAtom::_NET_WM_STATE_FULLSCREEN)); - - Qt::WindowState state = Qt::WindowNoState; - if (wm_state == XCB_WM_STATE_ICONIC) - state = Qt::WindowMinimized; - else if (maximized) - state = Qt::WindowMaximized; - else if (fullscreen) - state = Qt::WindowFullScreen; - - QWindowSystemInterface::handleWindowStateChanged(window(), state); } } diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index c212095e98..d4c8804486 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -59,6 +59,19 @@ class QXcbEGLSurface; class QXcbWindow : public QXcbObject, public QPlatformWindow { public: + enum NetWmState { + NetWmStateAbove = 0x1, + NetWmStateBelow = 0x2, + NetWmStateFullScreen = 0x4, + NetWmStateMaximizedHorz = 0x8, + NetWmStateMaximizedVert = 0x10, + NetWmStateModal = 0x20, + NetWmStateStaysOnTop = 0x40, + NetWmStateDemandsAttention = 0x80 + }; + + Q_DECLARE_FLAGS(NetWmStates, NetWmState) + QXcbWindow(QWindow *window); ~QXcbWindow(); @@ -121,9 +134,8 @@ public: private: void changeNetWmState(bool set, xcb_atom_t one, xcb_atom_t two = 0); - QVector getNetWmState(); - void setNetWmState(const QVector &atoms); - void printNetWmState(const QVector &state); + NetWmStates netWmStates(); + void setNetWmStates(NetWmStates); void setNetWmWindowFlags(Qt::WindowFlags flags); void setMotifWindowFlags(Qt::WindowFlags flags); @@ -169,6 +181,7 @@ private: QRegion m_exposeRegion; xcb_visualid_t m_visualId; + int m_lastWindowStateEvent; }; QT_END_NAMESPACE -- cgit v1.2.3 From ce84af7c9b57f7f8cef5d57c5486b1409e13bcdd Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 11 Apr 2012 12:07:59 +0200 Subject: Propagate window state changes to QWidget. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apply the state in QWidgetWindow and send an event to the widget unless the code is triggered by QWidget::setWindowState(). Change-Id: Ibf2f4e730384e41636841b9216eecfdff35b7bcb Reviewed-by: Samuel Rødal --- src/widgets/kernel/qwidgetwindow_qpa.cpp | 34 +++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/widgets/kernel/qwidgetwindow_qpa.cpp b/src/widgets/kernel/qwidgetwindow_qpa.cpp index 6dbd3c1f77..3cccc52311 100644 --- a/src/widgets/kernel/qwidgetwindow_qpa.cpp +++ b/src/widgets/kernel/qwidgetwindow_qpa.cpp @@ -454,10 +454,38 @@ void QWidgetWindow::handleWindowStateChangedEvent(QWindowStateChangeEvent *event { // QWindow does currently not know 'active'. Qt::WindowStates eventState = event->oldState(); - if (m_widget->windowState() & Qt::WindowActive) + Qt::WindowStates widgetState = m_widget->windowState(); + if (widgetState & Qt::WindowActive) eventState |= Qt::WindowActive; - QWindowStateChangeEvent widgetEvent(eventState); - QGuiApplication::sendSpontaneousEvent(m_widget, &widgetEvent); + + // Determine the new widget state, remember maximized/full screen + // during minimized. + switch (windowState()) { + case Qt::WindowNoState: + widgetState &= ~(Qt::WindowMinimized | Qt::WindowMaximized | Qt::WindowFullScreen); + break; + case Qt::WindowMinimized: + widgetState |= Qt::WindowMinimized; + break; + case Qt::WindowMaximized: + widgetState &= ~Qt::WindowFullScreen; + widgetState |= Qt::WindowMaximized; + break; + case Qt::WindowFullScreen: + widgetState &= ~Qt::WindowMaximized; + widgetState |= Qt::WindowFullScreen; + break; + case Qt::WindowActive: // Not handled by QWindow + break; + } + + // Sent event if the state changed (that is, it is not triggered by + // QWidget::setWindowState(), which also sends an event to the widget). + if (widgetState != m_widget->data->window_state) { + m_widget->data->window_state = widgetState; + QWindowStateChangeEvent widgetEvent(eventState); + QGuiApplication::sendSpontaneousEvent(m_widget, &widgetEvent); + } } bool QWidgetWindow::nativeEvent(const QByteArray &eventType, void *message, long *result) -- cgit v1.2.3 From 0991eae04871f1cb4a6d149658354bf129367074 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 4 Apr 2012 15:02:11 -0700 Subject: configure: add -pkg-config option to control pkg-config usage Currently, for host builds, pkg-config usage is autodetected based on it's availability in the mkspec or the PATH. For xcompile builds, pkg-config is disabled unless -force-pkg-config is passed. -force-pkg-config is poorly named since it doesn't reflect the fact that it applies only to xplatform builds. It is in fact the only way to enable pkg-config in xcompile builds. And when passed, it doesn't actually force anything since all it does is check env variables. To add to the confusion, it prints a warning even if the env variables are setup correctly. This patch remedies the situation. It adds (-no)-pkg-config. The flag works for both host and xcompile builds. By default, the value is 'auto'. In this mode, it will try try to detect pkg-config from the path. If found, it will be used. For xcompiled builds, we use some heuristics to determine if the pkg-config is actually usable: 1. if -sysroot is not set and the environment variables PKG_CONFIG_LIBDIR or PKG_CONFIG_SYSROOT_DIR are not set, we disable pkg-config. 2. if -sysroot is set, then we setup PKG_CONFIG_LIBDIR and PKG_CONFIG_SYSROOT_DIR automatically (provided $SYSROOT/usr/lib/pkgconfig exists). If the value is 'yes', configure will error if it's heuristics fail to detect a usable pkg-config. If the value is 'no', pkg-config usage is disabled. If the value is 'force', configure will skip it's heuristics and use pkg-config anyway. This mode is useful, for example, when compiling for 32-bit on 64-bit systems. This change also removes references to PKG_CONFIG_SYSROOT (PKG_CONFIG_SYSROOT_DIR is the correct environment variable). Change-Id: I07fc8d48603c65a60de0336fc6276e90fcb41430 Reviewed-by: Oswald Buddenhagen --- configure | 132 ++++++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 86 insertions(+), 46 deletions(-) diff --git a/configure b/configure index 6ed696950b..0bd115e735 100755 --- a/configure +++ b/configure @@ -688,6 +688,7 @@ CFG_AUDIO_BACKEND=auto CFG_V8SNAPSHOT=auto CFG_QML_DEBUG=yes CFG_JAVASCRIPTCORE_JIT=auto +CFG_PKGCONFIG=auto # Target architecture CFG_ARCH= @@ -890,7 +891,7 @@ while [ "$#" -gt 0 ]; do VAL=no ;; #Qt style yes options - -profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-eglfs|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-exceptions|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-qml-debug|-javascript-jit|-rpath|-force-pkg-config|-icu|-force-asserts|-testcocoon) + -profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-eglfs|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-exceptions|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-qml-debug|-javascript-jit|-rpath|-pkg-config|-force-pkg-config|-icu|-force-asserts|-testcocoon) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL=yes ;; @@ -1080,8 +1081,15 @@ while [ "$#" -gt 0 ]; do hostbindir) QT_HOST_BINS="$VAL" ;; + pkg-config) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_PKGCONFIG="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; force-pkg-config) - QT_FORCE_PKGCONFIG=yes + CFG_PKGCONFIG="force" ;; docdir) QT_INSTALL_DOCS="$VAL" @@ -2465,50 +2473,6 @@ if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then QT_CONFIG="$QT_CONFIG build_all" fi -if [ -z "$PKG_CONFIG" ]; then - # See if PKG_CONFIG is set in the mkspec: - PKG_CONFIG=`getXQMakeConf PKG_CONFIG` -fi -if [ -z "$PKG_CONFIG" ]; then - PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null` -fi - -# Work out if we can use pkg-config -if [ "$QT_CROSS_COMPILE" = "yes" ]; then - if [ "$QT_FORCE_PKGCONFIG" = "yes" ]; then - echo >&2 "" - echo >&2 "You have asked to use pkg-config and are cross-compiling." - echo >&2 "Please make sure you have a correctly set-up pkg-config" - echo >&2 "environment!" - echo >&2 "" - if [ -z "$PKG_CONFIG_LIBDIR" ]; then - echo >&2 "" - echo >&2 "Warning: PKG_CONFIG_LIBDIR has not been set. This could mean" - echo >&2 "the host's .pc files will be used (even if you set PKG_CONFIG_PATH)." - echo >&2 "This is probably not what you want." - echo >&2 "" - elif [ -z "$PKG_CONFIG_SYSROOT" ] && [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then - echo >&2 "" - echo >&2 "Warning: PKG_CONFIG_SYSROOT/PKG_CONFIG_SYSROOT_DIR has not" - echo >&2 "been set. This means your toolchain's .pc files must contain" - echo >&2 "the paths to the toolchain's libraries & headers. If configure" - echo >&2 "tests are failing, please check these files." - echo >&2 "" - fi - else - echo >&2 "" - echo >&2 "You have not explicitly asked to use pkg-config and are cross-compiling." - echo >&2 "pkg-config will not be used to automatically query cflag/lib parameters for" - echo >&2 "dependencies" - echo >&2 "" - PKG_CONFIG="" - fi -fi - -if [ ! -n "$PKG_CONFIG" ]; then - QT_CONFIG="$QT_CONFIG no-pkg-config" -fi - # pass on $CFG_SDK to the configure tests. if [ '!' -z "$CFG_SDK" ]; then MAC_CONFIG_TEST_COMMANDLINE="$MAC_CONFIG_TEST_COMMANDLINE -sdk $CFG_SDK" @@ -3072,6 +3036,13 @@ Configure options: -I ........ Add an explicit include path. -L ........ Add an explicit library path. + + -pkg-config ........ Use pkg-config to detect include and library paths. By default, + configure determines whether to use pkg-config or not with + some heuristics such as checking the environment variables. + -no-pkg-config ..... Disable use of pkg-config. + -force-pkg-config .. Force usage of pkg-config (skips pkg-config usability + detection heuristic). + -help, -h .......... Display this information. Third Party Libraries: @@ -3643,6 +3614,70 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ]; [ "$QMAKE_BUILD_ERROR" = "yes" ] && exit 2 fi # Build qmake +#------------------------------------------------------------------------------- +# Detect pkg-config +#------------------------------------------------------------------------------- +if [ -z "$PKG_CONFIG" ]; then + # See if PKG_CONFIG is set in the mkspec: + PKG_CONFIG=`getXQMakeConf PKG_CONFIG` +fi +if [ -z "$PKG_CONFIG" ]; then + PKG_CONFIG=`"$WHICH" pkg-config 2>/dev/null` +fi + +if [ "$CFG_PKGCONFIG" = "no" ]; then + PKG_CONFIG= +elif [ "$CFG_PKGCONFIG" = "force" ]; then + echo >&2 "" + echo >&2 "You have asked to use pkg-config. Please make sure you have" + echo >&2 "a correctly setup pkg-config environment!" + echo >&2 "" +elif [ -n "$PKG_CONFIG" ]; then + # found a pkg-config + if [ "$QT_CROSS_COMPILE" = "yes" ]; then + # when xcompiling, check environment to see if it's actually usable + if [ -z "$PKG_CONFIG_LIBDIR" ]; then + if [ -n "$CFG_SYSROOT" ] && [ -d "$CFG_SYSROOT/usr/lib/pkgconfig" ]; then + PKG_CONFIG_LIBDIR=$CFG_SYSROOT/usr/lib/pkgconfig:$CFG_SYSROOT/usr/share/pkgconfig + export PKG_CONFIG_LIBDIR + echo >&2 "Note: PKG_CONFIG_LIBDIR automatically set to $PKG_CONFIG_LIBDIR" + elif [ "$CFG_PKGCONFIG" = "yes" ]; then + echo >&2 "Error: PKG_CONFIG_LIBDIR has not been set. This could mean" + echo >&2 "the host's .pc files will be used (even if you set PKG_CONFIG_PATH)." + echo >&2 "Set this variable to the directory that contains target .pc files" + echo >&2 "for pkg-config to function correctly when cross-compiling or" + echo >&2 "use -force-pkg-config to override this test." + exit 101 + else + PKG_CONFIG= + echo >&2 "Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set." + fi + fi + if [ -z "$PKG_CONFIG_SYSROOT_DIR" ]; then + if [ -n "$CFG_SYSROOT" ]; then + PKG_CONFIG_SYSROOT_DIR=$CFG_SYSROOT + export PKG_CONFIG_SYSROOT_DIR + echo >&2 "Note: PKG_CONFIG_SYSROOT_DIR automatically set to $PKG_CONFIG_SYSROOT_DIR" + elif [ "$CFG_PKGCONFIG" = "yes" ]; then + echo >&2 "Error: PKG_CONFIG_SYSROOT_DIR has not been set. Set this variable" + echo >&2 "to your sysroot for pkg-config to function correctly when cross-compiling" + echo >&2 "or use -force-pkg-config to override this test." + exit 101 + else + PKG_CONFIG= + echo >&2 "Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set." + fi + fi + fi +elif [ "$CFG_PKGCONFIG" = "yes" ]; then + echo >&2 "Could not detect pkg-config from mkspec or PATH." + exit 101 +fi + +if [ -z "$PKG_CONFIG" ]; then + QT_CONFIG="$QT_CONFIG no-pkg-config" +fi + #------------------------------------------------------------------------------- # tests that need qmake #------------------------------------------------------------------------------- @@ -5914,6 +5949,11 @@ if [ "$CFG_DEBUG_RELEASE" = "yes" ]; then else echo "Debug .................. $CFG_DEBUG" fi +if [ -n "$PKG_CONFIG" ]; then + echo "pkg-config ............. yes" +else + echo "pkg-config ............. no" +fi [ "$CFG_DBUS" = "no" ] && echo "QtDBus module .......... no" [ "$CFG_DBUS" = "yes" ] && echo "QtDBus module .......... yes (run-time)" [ "$CFG_DBUS" = "linked" ] && echo "QtDBus module .......... yes (linked)" -- cgit v1.2.3 From 5071bbf491cb067dd1f336853413a1eb2be9ca08 Mon Sep 17 00:00:00 2001 From: Julian de Bhal Date: Fri, 30 Mar 2012 10:11:54 +1000 Subject: Minor doc fix - show -> hide in QWindow::hideEvent() Change-Id: I91c5b7f7b688c4f99c6a364692fd96603a38c9bc Reviewed-by: Friedemann Kleint --- src/gui/kernel/qwindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 96f7eb5428..88ff31fe91 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1383,7 +1383,7 @@ void QWindow::resizeEvent(QResizeEvent *ev) /*! Override this to handle show events. - The show event is called when the window becomes visible in the windowing system. + This function is called when the window becomes visible in the windowing system. */ void QWindow::showEvent(QShowEvent *ev) { @@ -1391,9 +1391,9 @@ void QWindow::showEvent(QShowEvent *ev) } /*! - Override this to handle show events. + Override this to handle hide events. - The show event is called when the window becomes hidden in the windowing system. + This function is called when the window becomes hidden in the windowing system. */ void QWindow::hideEvent(QHideEvent *ev) { -- cgit v1.2.3 From d6ad749e8fdce0ebf595cc05a9367be5bf52240d Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 12 Apr 2012 00:21:42 +1000 Subject: Remove Qt 5 to-do comments from qgraphicslayoutitem.h. Neither of these comments will be actioned for Qt 5: the first because would be source-incompatible with Qt 4, the second becuase it would be a significant behavioural change. Task-number: QTBUG-25090 Change-Id: I5f8f7cce3007c3188b2f0184138fa8e55a165654 Reviewed-by: Lars Knoll --- src/widgets/graphicsview/qgraphicslayoutitem.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/widgets/graphicsview/qgraphicslayoutitem.h b/src/widgets/graphicsview/qgraphicslayoutitem.h index ef391f01a0..38f09743c0 100644 --- a/src/widgets/graphicsview/qgraphicslayoutitem.h +++ b/src/widgets/graphicsview/qgraphicslayoutitem.h @@ -96,13 +96,12 @@ public: QSizeF effectiveSizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; - virtual void updateGeometry(); //### rename to sizeHintChanged() + virtual void updateGeometry(); QGraphicsLayoutItem *parentLayoutItem() const; void setParentLayoutItem(QGraphicsLayoutItem *parent); bool isLayout() const; - // ###Qt5: Make automatic reparenting work regardless of item/object/widget type. QGraphicsItem *graphicsItem() const; bool ownedByLayout() const; -- cgit v1.2.3 From e2f2bfb8ccf6e415320cb1c6f465b3feaafa053d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 11 Apr 2012 16:53:49 +0200 Subject: Remove insignification from tst_qgraphicsgridlayout. Crash on XCB can no longer be reproduced. Task-number: QTBUG-20756 Change-Id: I057231a397573f2a28a1325c6d6f728735ebbee6 Reviewed-by: Jason McDonald --- .../widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro index b32c638948..5796cbfd73 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsgridlayout/qgraphicsgridlayout.pro @@ -4,5 +4,3 @@ TARGET = tst_qgraphicsgridlayout QT += widgets testlib SOURCES += tst_qgraphicsgridlayout.cpp CONFIG += parallel_test -# ### fixme: QTBUG-20756 crashes on xcb -contains(QT_CONFIG,xcb):CONFIG+=insignificant_test -- cgit v1.2.3 From 0fc74370b2565f8570d0b8b9be21016f78707de8 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 11 Apr 2012 18:32:13 +1000 Subject: Minimally resolve Qt 5 to-do's in QXmlSimpleReader Task-number: QTBUG-25104 Change-Id: Ic5200e2671f60f314d68ef5b341073e04d690c00 Reviewed-by: Lars Knoll --- src/xml/sax/qxml.cpp | 42 +++++++++++++++++++++++++++++++----------- src/xml/sax/qxml.h | 2 +- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp index c2205edb40..a5c206dc27 100644 --- a/src/xml/sax/qxml.cpp +++ b/src/xml/sax/qxml.cpp @@ -99,7 +99,7 @@ static const signed char cltSq = 13; // ' static const signed char cltUnknown = 14; // Hack for letting QDom know where the skipped entity occurred -// ### Qt5: the use of this variable means the code isn't reentrant. +// ### the use of this variable means the code isn't reentrant. bool qt_xml_skipped_entity_in_content; // character lookup table @@ -1330,7 +1330,7 @@ QXmlInputSource::QXmlInputSource(QIODevice *dev) */ QXmlInputSource::~QXmlInputSource() { - // ### Qt 5: close the input device. See task 153111 + // ### close the input device. #ifndef QT_NO_TEXTCODEC delete d->encMapper; #endif @@ -3133,16 +3133,17 @@ bool QXmlSimpleReader::feature(const QString& name, bool *ok) const { const QXmlSimpleReaderPrivate *d = d_func(); - // Qt5 ###: Change these strings to qt.nokia.com if (ok != 0) *ok = true; if (name == QLatin1String("http://xml.org/sax/features/namespaces")) { return d->useNamespaces; } else if (name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")) { return d->useNamespacePrefixes; - } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")) { // Shouldn't change in Qt 4 + } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData") // For compat with Qt 4 + || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")) { return d->reportWhitespaceCharData; - } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")) { // Shouldn't change in Qt 4 + } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity") // For compat with Qt 4 + || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")) { return d->reportEntities; } else { qWarning("Unknown feature %s", name.toLatin1().data()); @@ -3167,12 +3168,29 @@ bool QXmlSimpleReader::feature(const QString& name, bool *ok) const and attributes used for namespace declarations are reported. \row \li \e http://trolltech.com/xml/features/report-whitespace-only-CharData + \li true + \li Obsolete, use the following string instead. + If enabled, CharData that consist of + only whitespace characters are reported + using QXmlContentHandler::characters(). If disabled, whitespace is silently + discarded. + \row \li \e http://qt-project.org/xml/features/report-whitespace-only-CharData \li true \li If enabled, CharData that consist of only whitespace characters are reported using QXmlContentHandler::characters(). If disabled, whitespace is silently discarded. \row \li \e http://trolltech.com/xml/features/report-start-end-entity + \li false + \li Obsolete, use the following string instead. + If enabled, the parser reports + QXmlContentHandler::startEntity() and + QXmlContentHandler::endEntity() events, so character data + might be reported in chunks. + If disabled, the parser does not report these events, but + silently substitutes the entities, and reports the character + data in one chunk. + \row \li \e http://qt-project.org/xml/features/report-start-end-entity \li false \li If enabled, the parser reports QXmlContentHandler::startEntity() and @@ -3188,14 +3206,15 @@ bool QXmlSimpleReader::feature(const QString& name, bool *ok) const void QXmlSimpleReader::setFeature(const QString& name, bool enable) { Q_D(QXmlSimpleReader); - // Qt5 ###: Change these strings to qt.nokia.com if (name == QLatin1String("http://xml.org/sax/features/namespaces")) { d->useNamespaces = enable; } else if (name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")) { d->useNamespacePrefixes = enable; - } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")) { // Shouldn't change in Qt 4 + } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData") // For compat with Qt 4 + || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")) { d->reportWhitespaceCharData = enable; - } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")) { // Shouldn't change in Qt 4 + } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity") // For compat with Qt 4 + || name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")) { d->reportEntities = enable; } else { qWarning("Unknown feature %s", name.toLatin1().data()); @@ -3206,11 +3225,12 @@ void QXmlSimpleReader::setFeature(const QString& name, bool enable) */ bool QXmlSimpleReader::hasFeature(const QString& name) const { - // Qt5 ###: Change these strings to qt.nokia.com if (name == QLatin1String("http://xml.org/sax/features/namespaces") || name == QLatin1String("http://xml.org/sax/features/namespace-prefixes") - || name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData") // Shouldn't change in Qt 4 - || name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")) { // Shouldn't change in Qt 4 + || name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData") // For compat with Qt 4 + || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData") + || name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity") // For compat with Qt 4 + || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")) { return true; } else { return false; diff --git a/src/xml/sax/qxml.h b/src/xml/sax/qxml.h index 86d0956290..0113d22942 100644 --- a/src/xml/sax/qxml.h +++ b/src/xml/sax/qxml.h @@ -359,7 +359,7 @@ public: virtual bool internalEntityDecl(const QString& name, const QString& value) = 0; virtual bool externalEntityDecl(const QString& name, const QString& publicId, const QString& systemId) = 0; virtual QString errorString() const = 0; - // ### Qt 5: Conform to SAX by adding elementDecl + // ### Conform to SAX by adding elementDecl }; -- cgit v1.2.3 From 7ff5fb610c665d8aa5eb5be431e96540caeb75ef Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 11 Apr 2012 18:45:57 +1000 Subject: Update Qt 5 to-do comment in QDom. The change discussed in the comment doesn't have to be done in a major release if it isn't source-incompatible. Task-number: QTBUG-25103 Change-Id: I50036ab13611871ede01b7b7a17ce4c325476b00 Reviewed-by: Lars Knoll --- src/xml/dom/qdom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index 04efe43e35..23a9db8e3a 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -4559,14 +4559,14 @@ void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const QString qName(name); QString nsDecl(QLatin1String("")); if (!namespaceURI.isNull()) { - /** ### Qt 5: + /** ### * * If we still have QDom, optimize this so that we only declare namespaces that are not * yet declared. We loose default namespace mappings, so maybe we should rather store * the information that we get from startPrefixMapping()/endPrefixMapping() and use them. * Modifications becomes more complex then, however. * - * We cannot do this during the Qt 4 series because it would require too invasive changes, and + * We cannot do this in a patch release because it would require too invasive changes, and * hence possibly behavioral changes. */ if (prefix.isEmpty()) { -- cgit v1.2.3 From 9327bc87c3abf58bb471693b5448cd78e3db1b46 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Wed, 11 Apr 2012 17:33:22 +0300 Subject: fix QUtf8 codec to disallow codes in range [U+fdd0..U+fdef] 0xfdef-0xfdd0 is definitely 31 and not 15 :) also fix all copy-pastes of this code (greping for '0xfdd0' helps ;) Change-Id: I8f3bd4fd9d85f9de066f0f5df378b9188c12bd48 Reviewed-by: Thiago Macieira Reviewed-by: Denis Dzyubenko --- src/corelib/codecs/qutfcodec.cpp | 2 +- src/corelib/json/qjsonparser.cpp | 2 +- src/corelib/json/qjsonwriter.cpp | 2 +- tests/auto/corelib/codecs/utf8/tst_utf8.cpp | 2 +- tests/benchmarks/corelib/tools/qstring/main.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index c7076eea3a..18d063a38c 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -58,7 +58,7 @@ static inline bool isUnicodeNonCharacter(uint ucs4) // U+FDEF (inclusive) return (ucs4 & 0xfffe) == 0xfffe - || (ucs4 - 0xfdd0U) < 16; + || (ucs4 - 0xfdd0U) < 32; } QByteArray QUtf8::convertFromUnicode(const QChar *uc, int len, QTextCodec::ConverterState *state) diff --git a/src/corelib/json/qjsonparser.cpp b/src/corelib/json/qjsonparser.cpp index 9b11c9ac3e..7d25c81db2 100644 --- a/src/corelib/json/qjsonparser.cpp +++ b/src/corelib/json/qjsonparser.cpp @@ -731,7 +731,7 @@ static inline bool isUnicodeNonCharacter(uint ucs4) // U+FDEF (inclusive) return (ucs4 & 0xfffe) == 0xfffe - || (ucs4 - 0xfdd0U) < 16; + || (ucs4 - 0xfdd0U) < 32; } static inline bool scanUtf8Char(const char *&json, const char *end, uint *result) diff --git a/src/corelib/json/qjsonwriter.cpp b/src/corelib/json/qjsonwriter.cpp index d544e6154b..d392bd7529 100644 --- a/src/corelib/json/qjsonwriter.cpp +++ b/src/corelib/json/qjsonwriter.cpp @@ -61,7 +61,7 @@ static inline bool isUnicodeNonCharacter(uint ucs4) // U+FDEF (inclusive) return (ucs4 & 0xfffe) == 0xfffe - || (ucs4 - 0xfdd0U) < 16; + || (ucs4 - 0xfdd0U) < 32; } static inline uchar hexdig(uint u) diff --git a/tests/auto/corelib/codecs/utf8/tst_utf8.cpp b/tests/auto/corelib/codecs/utf8/tst_utf8.cpp index b80ba8e665..c0ed152c32 100644 --- a/tests/auto/corelib/codecs/utf8/tst_utf8.cpp +++ b/tests/auto/corelib/codecs/utf8/tst_utf8.cpp @@ -321,7 +321,7 @@ void tst_Utf8::nonCharacters_data() // U+FDEF (inclusive) // U+FDD0 through U+FDEF - for (int i = 0; i < 16; ++i) { + for (int i = 0; i < 32; ++i) { char utf8[] = { char(0357), char(0267), char(0220 + i), 0 }; QString utf16 = QChar(0xfdd0 + i); QTest::newRow(qPrintable(QString::number(0xfdd0 + i, 16))) << QByteArray(utf8) << utf16; diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp index 9b10e97f2b..40300af947 100644 --- a/tests/benchmarks/corelib/tools/qstring/main.cpp +++ b/tests/benchmarks/corelib/tools/qstring/main.cpp @@ -1944,7 +1944,7 @@ static inline bool isUnicodeNonCharacter(uint ucs4) // U+FDEF (inclusive) return (ucs4 & 0xfffe) == 0xfffe - || (ucs4 - 0xfdd0U) < 16; + || (ucs4 - 0xfdd0U) < 32; } int fromUtf8_qt47(ushort *dst, const char *chars, int len) -- cgit v1.2.3 From 638fc652f587b47e9fd99ab5c0e886baf8cc35a9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 11 Apr 2012 16:36:11 +0200 Subject: Fix tst_qtextedit and remove insignification. - The crash on XCB can no longer be reproduced. - Use QFINDTESTDATA instead of SRCDIR defines. - Remove Windows CE specific profile section. Task-number: QTBUG-20756 Change-Id: I6077b3a0daacb15ab440a90c7bda247aa3756fa5 Reviewed-by: Jason McDonald --- tests/auto/widgets/widgets/qtextedit/qtextedit.pro | 15 +--------- .../widgets/widgets/qtextedit/tst_qtextedit.cpp | 35 +++++++++++++++------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/tests/auto/widgets/widgets/qtextedit/qtextedit.pro b/tests/auto/widgets/widgets/qtextedit/qtextedit.pro index 1c2821b289..6e0fff17d5 100644 --- a/tests/auto/widgets/widgets/qtextedit/qtextedit.pro +++ b/tests/auto/widgets/widgets/qtextedit/qtextedit.pro @@ -2,18 +2,5 @@ CONFIG += testcase TARGET = tst_qtextedit QT += widgets widgets-private gui-private core-private testlib -INCLUDEPATH += ../ -HEADERS += -SOURCES += tst_qtextedit.cpp - -wince* { - addImages.files = fullWidthSelection/* - addImages.path = fullWidthSelection - DEPLOYMENT += addImages - DEFINES += SRCDIR=\\\"./\\\" -} else { - DEFINES += SRCDIR=\\\"$$PWD/\\\" -} - -contains(QT_CONFIG,xcb):CONFIG+=insignificant_test # QTBUG-20756 crashes on xcb +SOURCES += tst_qtextedit.cpp diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp index 9c5a3dbed7..a3f58c4c0d 100644 --- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp @@ -58,6 +58,7 @@ #include #include #include +#include #include #include @@ -218,6 +219,7 @@ private: QTextEdit *ed; qreal rootFrameMargin; PlatformInputContext m_platformInputContext; + const QString m_fullWidthSelectionImagesFolder; }; bool tst_QTextEdit::nativeClipboardWorking() @@ -376,13 +378,17 @@ public: int &iterationCounter; }; -tst_QTextEdit::tst_QTextEdit() -{} +tst_QTextEdit::tst_QTextEdit() : + m_fullWidthSelectionImagesFolder(QFINDTESTDATA("fullWidthSelection")) +{ + +} void tst_QTextEdit::initTestCase() { QInputMethodPrivate *inputMethodPrivate = QInputMethodPrivate::get(qApp->inputMethod()); inputMethodPrivate->testContext = &m_platformInputContext; + QVERIFY2(!m_fullWidthSelectionImagesFolder.isEmpty(), qPrintable(QString::fromLatin1("Cannot locate 'fullWidthSelection' starting from %1").arg(QDir::currentPath()))); } void tst_QTextEdit::cleanupTestCase() @@ -1934,12 +1940,18 @@ void tst_QTextEdit::fullWidthSelection_data() QTest::addColumn("cursorTo"); QTest::addColumn("imageFileName"); - QTest::newRow("centered fully selected") << 0 << 15 << QString("fullWidthSelection/centered-fully-selected.png"); - QTest::newRow("centered partly selected") << 2 << 15 << QString("fullWidthSelection/centered-partly-selected.png"); - QTest::newRow("last char on line") << 42 << 44 << QString("fullWidthSelection/last-char-on-line.png"); - QTest::newRow("last char on parag") << 545 << 548 << QString("fullWidthSelection/last-char-on-parag.png"); - QTest::newRow("multiple full width lines") << 20 << 60 << QString("fullWidthSelection/multiple-full-width-lines.png"); - QTest::newRow("single full width line") << 20 << 30 << QString("fullWidthSelection/single-full-width-line.png"); + QTest::newRow("centered fully selected") + << 0 << 15 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/centered-fully-selected.png")); + QTest::newRow("centered partly selected") + << 2 << 15 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/centered-partly-selected.png")); + QTest::newRow("last char on line") + << 42 << 44 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/last-char-on-line.png")); + QTest::newRow("last char on parag") + << 545 << 548 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/last-char-on-parag.png")); + QTest::newRow("multiple full width lines") + << 20 << 60 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/multiple-full-width-lines.png")); + QTest::newRow("single full width line") + << 20 << 30 << (m_fullWidthSelectionImagesFolder + QStringLiteral("/single-full-width-line.png")); } void tst_QTextEdit::fullWidthSelection() @@ -2053,11 +2065,12 @@ void tst_QTextEdit::compareWidgetAndImage(QTextEdit &widget, const QString &imag QPainter painter(&image); widget.viewport()->render(&painter); painter.end(); - // qDebug() << "file: " << QString(SRCDIR) + imageFileName; - QImageReader reader(QString(SRCDIR) + imageFileName, "PNG"); + QImageReader reader(imageFileName, "PNG"); + QImage original = reader.read(); - QCOMPARE(original.isNull(), false); + QVERIFY2(!original.isNull(), + qPrintable(QString::fromLatin1("Unable to read image %1: %2").arg(imageFileName, reader.errorString()))); QCOMPARE(original.size(), image.size()); QCOMPARE(image.depth(), 32); QCOMPARE(original.depth(), image.depth()); -- cgit v1.2.3 From 99a207436924aa1339f48ababa1490675c6a00d3 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 10 Apr 2012 18:46:06 +0200 Subject: qmake vc(x)project generator: fix VC++ Express detection If VC++ 2010 Express and VC# 2010 Express are installed, then the installation path is written in two places into the registry. We're now filtering detected installations with the same installation path. Task-number: QTBUG-24956 Change-Id: I401430e7aa81d96c523d8172d2a2e9d40ebdb3ce Reviewed-by: Oswald Buddenhagen --- qmake/generators/win32/msvc_vcproj.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 2f19ea4495..c2482b58a8 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -115,11 +115,13 @@ DotNET which_dotnet_version() current_version = NET2002; QStringList warnPath; + QHash installPaths; int installed = 0; int i = 0; for(; dotNetCombo[i].version; ++i) { QString path = qt_readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey); - if(!path.isEmpty()) { + if (!path.isEmpty() && installPaths.value(dotNetCombo[i].version) != path) { + installPaths.insert(dotNetCombo[i].version, path); ++installed; current_version = dotNetCombo[i].version; warnPath += QString("%1").arg(dotNetCombo[i].versionStr); -- cgit v1.2.3 From 3918386779da4bfaf65c209eea9aa64c3c5bca69 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 9 Apr 2012 14:23:45 +0100 Subject: Fix ownership / lifetime of QCocoaNativeInterface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I21dd1e3186e0dbbc60294f807de0db6aad8b9eee Reviewed-by: James Turner Reviewed-by: Sean Harmer Reviewed-by: Christoph Schleifenbaum Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoaintegration.h | 1 + src/plugins/platforms/cocoa/qcocoaintegration.mm | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h index b3eeab3f7a..a001b6234a 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.h +++ b/src/plugins/platforms/cocoa/qcocoaintegration.h @@ -113,6 +113,7 @@ private: QList mScreens; QCocoaClipboard *mCocoaClipboard; QScopedPointer mCocoaDrag; + QScopedPointer mNativeInterface; QScopedPointer mServices; }; diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index 0a3790fd72..0b87773dee 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -99,6 +99,7 @@ QCocoaIntegration::QCocoaIntegration() , mAccessibility(new QPlatformAccessibility) , mCocoaClipboard(new QCocoaClipboard) , mCocoaDrag(new QCocoaDrag) + , mNativeInterface(new QCocoaNativeInterface) , mServices(new QCocoaServices) { QCocoaAutoReleasePool pool; @@ -205,7 +206,7 @@ QPlatformFontDatabase *QCocoaIntegration::fontDatabase() const QPlatformNativeInterface *QCocoaIntegration::nativeInterface() const { - return new QCocoaNativeInterface(); + return mNativeInterface.data(); } QPlatformInputContext *QCocoaIntegration::inputContext() const -- cgit v1.2.3 From 5a2ef8ebddd5546acbf13f37af8d8ecc1178be31 Mon Sep 17 00:00:00 2001 From: Christoph Schleifenbaum Date: Tue, 10 Apr 2012 17:15:44 +0200 Subject: Cocoa: Proper handling of mDelegate mDelegate keeps the pointer to a QNSFontPanelDelegate, which reacts on the NSFontPanel used by this dialog helper. It has to be created before it can be used. On a read-only access, this has been fixed to return a default-constructed value (like QFont()). For writing access (like setting the font) the delegate was already created. The same applies to mDelegate to QNSColorPanelDelegate respective. Change-Id: I36b89c16d98db9275aa31d399fe094b1d56d800d Reviewed-by: Bradley T. Hughes --- src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | 4 ++++ src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index fd4d6605a9..405cacee01 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -395,6 +395,8 @@ void QCocoaColorDialogHelper::hide_sys() QCocoaColorDialogHelper::DialogCode QCocoaColorDialogHelper::dialogResultCode_sys() { + if (!mDelegate) + return QPlatformDialogHelper::Rejected; QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = static_cast(mDelegate); return [delegate dialogResultCode]; } @@ -429,6 +431,8 @@ void QCocoaColorDialogHelper::setCurrentColor_sys(const QColor &color) QColor QCocoaColorDialogHelper::currentColor_sys() const { + if (!mDelegate) + return QColor(); return reinterpret_cast(mDelegate)->mQtColor; } diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm index d05a0156b1..1e89270775 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm @@ -414,6 +414,8 @@ void QCocoaFontDialogHelper::hide_sys() QCocoaFontDialogHelper::DialogCode QCocoaFontDialogHelper::dialogResultCode_sys() { + if (!mDelegate) + return QPlatformDialogHelper::Rejected; QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) *delegate = static_cast(mDelegate); return [delegate dialogResultCode]; } @@ -448,6 +450,8 @@ void QCocoaFontDialogHelper::setCurrentFont_sys(const QFont &font) QFont QCocoaFontDialogHelper::currentFont_sys() const { + if (!mDelegate) + return QFont(); return reinterpret_cast(mDelegate)->mQtFont; } -- cgit v1.2.3 From ee5bd5349bb8d781524307627b205676726d09a7 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 12 Apr 2012 02:04:07 +1000 Subject: Remove Qt 5 to-do comment that will not be addressed. The suggested behavioural change had the potential to break existing code, so the change won't be made for Qt 5. Task-number: QTBUG-25119 Change-Id: Ie03271d12b21a800c998e073eeb9ca1cd03ffe19 Reviewed-by: Lars Knoll --- src/widgets/kernel/qwidget.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 70839e705f..f02a67d9ea 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -6730,7 +6730,6 @@ void QWidget::setContentsMargins(int left, int top, int right, int bottom) else updateGeometry(); - // ### Qt 5: compat, remove if (isVisible()) { update(); QResizeEvent e(data->crect.size(), data->crect.size()); -- cgit v1.2.3 From 0fdd1155e11415b5c085be432f27ef2ead25e4d2 Mon Sep 17 00:00:00 2001 From: Bhooshan Supe Date: Tue, 10 Apr 2012 18:51:42 -0700 Subject: device: Add device support for STMicroelectronic's ST7540 Add mkspec for the STMicroelectronic's ST7540 platform to be used in conjunction with the -device support in configure. This allows you to build Qt with the application libraries provided by STM SDK 36. Change-Id: I4369b23b9a0c9063417e5cc71969f65e967e4019 Reviewed-by: Girish Ramakrishnan --- .../linux-sh4-stmicro-ST7540-g++/qmake.conf | 47 ++++++++++++++++++++++ .../linux-sh4-stmicro-ST7540-g++/qplatformdefs.h | 43 ++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf create mode 100644 mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qplatformdefs.h diff --git a/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf b/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf new file mode 100644 index 0000000000..9a99a82ee3 --- /dev/null +++ b/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qmake.conf @@ -0,0 +1,47 @@ +# +# qmake configuration for linux-g++ using the sh4-linux-g++ crosscompiler +# +# http://wiki.qt-project.org/Devices/ST7540 +# + +MAKEFILE_GENERATOR = UNIX +TARGET_PLATFORM = unix +TEMPLATE = app +CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index +QT += core gui +QMAKE_INCREMENTAL_STYLE = sublib + +include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) + +load(device_config) + +isEmpty(CROSS_COMPILE): error("CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=") + +QMAKE_CC = $${CROSS_COMPILE}gcc +QMAKE_CXX = $${CROSS_COMPILE}g++ +QMAKE_LINK = $${QMAKE_CXX} +QMAKE_LINK_SHLIB = $${QMAKE_CXX} + +QMAKE_AR = $${CROSS_COMPILE}ar cqs +QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_STRIP = $${CROSS_COMPILE}strip + +deviceSanityCheckCompiler() + +QMAKE_INCDIR_EGL += $$[QT_SYSROOT]/root/modules/include/ +QMAKE_LIBDIR_EGL += $$[QT_SYSROOT]/root/modules/ + +# +# The EGL library used for ST7540 is based on DirectFB so it has to be linked with +# 1. libdirectfb.so 2. libfusion.so 3. libdirect.so +# +QMAKE_LIBS_EGL += -lMali -ldirectfb -lfusion -ldirect + +QMAKE_INCDIR_OPENGL_ES2 += $$QMAKE_INCDIR_EGL +QMAKE_LIBDIR_OPENGL_ES2 += $$QMAKE_LIBDIR_EGL +QMAKE_LIBS_OPENGL_ES2 += $$QMAKE_LIBS_EGL + +load(qt_config) + diff --git a/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qplatformdefs.h b/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qplatformdefs.h new file mode 100644 index 0000000000..e246417223 --- /dev/null +++ b/mkspecs/devices/linux-sh4-stmicro-ST7540-g++/qplatformdefs.h @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../../linux-g++/qplatformdefs.h" + -- cgit v1.2.3 From 8730c333bacd346de7f5ee9fb0b97361384b8f91 Mon Sep 17 00:00:00 2001 From: Bhooshan Supe Date: Tue, 10 Apr 2012 10:02:13 -0700 Subject: device: Add device support for STMicroelectronic's ST7108 Add mkspec for the STMicroelectronic's ST7108 platform to be used in conjunction with the -device support in configure. This allows you to build Qt with the application libraries provided by STM SDK 35. Change-Id: I36aa174200f034ccd6ee285e3f8a8ffec99b3e70 Reviewed-by: Girish Ramakrishnan --- .../linux-sh4-stmicro-ST7108-g++/qmake.conf | 35 ++++++++++++++++++ .../linux-sh4-stmicro-ST7108-g++/qplatformdefs.h | 43 ++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf create mode 100644 mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qplatformdefs.h diff --git a/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf b/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf new file mode 100644 index 0000000000..ba8ab28026 --- /dev/null +++ b/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qmake.conf @@ -0,0 +1,35 @@ +# +# qmake configuration for linux-g++ using the sh4-linux-g++ crosscompiler +# +# http://wiki.qt-project.org/Devices/ST7108 +# + +MAKEFILE_GENERATOR = UNIX +TARGET_PLATFORM = unix +TEMPLATE = app +CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index +QT += core gui +QMAKE_INCREMENTAL_STYLE = sublib + +include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) + +load(device_config) + +isEmpty(CROSS_COMPILE): error("CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=") + +QMAKE_CC = $${CROSS_COMPILE}gcc +QMAKE_CXX = $${CROSS_COMPILE}g++ +QMAKE_LINK = $${QMAKE_CXX} +QMAKE_LINK_SHLIB = $${QMAKE_CXX} + +QMAKE_AR = $${CROSS_COMPILE}ar cqs +QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_STRIP = $${CROSS_COMPILE}strip + +deviceSanityCheckCompiler() + +QMAKE_LIBS_EGL += -lMali + +load(qt_config) diff --git a/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qplatformdefs.h b/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qplatformdefs.h new file mode 100644 index 0000000000..e246417223 --- /dev/null +++ b/mkspecs/devices/linux-sh4-stmicro-ST7108-g++/qplatformdefs.h @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../../linux-g++/qplatformdefs.h" + -- cgit v1.2.3 From e78424523884f7c0ae48590322c071fb0d19a56b Mon Sep 17 00:00:00 2001 From: Bhooshan Supe Date: Mon, 9 Apr 2012 17:13:23 -0700 Subject: device: Add device support for Trident's Shiner Add mkspec for the Trident's Shiner platform to be used in conjunction with the -device support in configure. This allows you to build Qt Change-Id: I68d8e8eb78f073e98f72207e9c5de6a0da0ed35d Reviewed-by: Girish Ramakrishnan Reviewed-by: Oswald Buddenhagen --- .../linux-arm-trident-pnx8473-g++/qmake.conf | 66 ++++++++++++++++++++++ .../linux-arm-trident-pnx8473-g++/qplatformdefs.h | 43 ++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf create mode 100644 mkspecs/devices/linux-arm-trident-pnx8473-g++/qplatformdefs.h diff --git a/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf b/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf new file mode 100644 index 0000000000..fbe6ed100b --- /dev/null +++ b/mkspecs/devices/linux-arm-trident-pnx8473-g++/qmake.conf @@ -0,0 +1,66 @@ +# +# qmake configuration for building with arm-linux-uclibcgnueabi-g++ +# +# http://wiki.qt-project.org/Devices/Shiner +# + +MAKEFILE_GENERATOR = UNIX +TARGET_PLATFORM = unix +TEMPLATE = app +CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index +QT += core gui +QMAKE_INCREMENTAL_STYLE = sublib + +include(../../common/linux.conf) +include(../../common/gcc-base-unix.conf) +include(../../common/g++-unix.conf) + +load(device_config) + +# Sanity checks +isEmpty(TRIDENT_SHINER_SDK_BUILDTREE): error("TRIDENT_SHINER_SDK_BUILDTREE needs to be set via -device-option TRIDENT_SHINER_SDK_BUILDTREE=") +isEmpty(CROSS_COMPILE): error("CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=") +isEmpty(TRIDENT_SHINER_SDK_BUILDSPEC): error("TRIDENT_SHINER_SDK_BUILDSPEC needs to be set via -device-option TRIDENT_SHINER_SDK_BUILDSPEC=") +isEmpty(TRIDENT_SHINER_SDK_INCDIR_EGL_OPENGL_ES2): error("TRIDENT_SHINER_SDK_INCDIR_EGL_OPENGL_ES2 needs to be set via -device-option TRIDENT_SHINER_SDK_INCDIR_EGL_OPENGL_ES2=") +isEmpty(TRIDENT_SHINER_SDK_LIBDIR_EGL_OPENGL_ES2): error("TRIDENT_SHINER_SDK_LIBDIR_EGL_OPENGL_ES2 needs to be set via -device-option TRIDENT_SHINER_SDK_LIBDIR_EGL_OPENGL_ES2=") + +QMAKE_CC = $${CROSS_COMPILE}gcc +QMAKE_CXX = $${CROSS_COMPILE}g++ +QMAKE_LINK = $${CROSS_COMPILE}g++ +QMAKE_LINK_SHLIB = $${CROSS_COMPILE}g++ + +# +# Usage configure options "-sysroot " with "--prefix=" results into installation of Qt at "". +# Trident Shiner SDK expects all libs to be in "Application file system" which is not +# +# Because of this fact not using "-sysroot " and hence following code is required +# +QMAKE_CFLAGS += --sysroot=$${TRIDENT_SHINER_SDK_BUILDTREE}/open_source_archive/linux/toolchains/gcc-4.5.2_uclibc/ +QMAKE_CXXFLAGS += --sysroot=$${TRIDENT_SHINER_SDK_BUILDTREE}/open_source_archive/linux/toolchains/gcc-4.5.2_uclibc/ +QMAKE_LFLAGS += --sysroot=$${TRIDENT_SHINER_SDK_BUILDTREE}/open_source_archive/linux/toolchains/gcc-4.5.2_uclibc/ + +# Compiler Sanity check +deviceSanityCheckCompiler() + +QMAKE_CFLAGS_RELEASE = -O2 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard +QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE + +# modifications to linux.conf +QMAKE_AR = $${CROSS_COMPILE}ar cqs +QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy +QMAKE_STRIP = $${CROSS_COMPILE}strip + +QMAKE_INCDIR += $${TRIDENT_SHINER_SDK_BUILDTREE}/target/output/objs/$${TRIDENT_SHINER_SDK_BUILDSPEC}/comps/generic_apps/usr/include +QMAKE_LIBDIR += $${TRIDENT_SHINER_SDK_BUILDTREE}/target/output/objs/$${TRIDENT_SHINER_SDK_BUILDSPEC}/comps/generic_apps/usr/lib +QMAKE_LIBDIR += $${TRIDENT_SHINER_SDK_BUILDTREE}/target/output/objs/$${TRIDENT_SHINER_SDK_BUILDSPEC}/comps/generated/lib/armgnu_linux_el_cortex-a9 + +QMAKE_INCDIR_EGL = $${TRIDENT_SHINER_SDK_INCDIR_EGL_OPENGL_ES2} +QMAKE_LIBDIR_EGL = $${TRIDENT_SHINER_SDK_LIBDIR_EGL_OPENGL_ES2} + +QMAKE_INCDIR_OPENGL_ES2 = $${TRIDENT_SHINER_SDK_INCDIR_EGL_OPENGL_ES2} +QMAKE_LIBDIR_OPENGL_ES2 = $${TRIDENT_SHINER_SDK_LIBDIR_EGL_OPENGL_ES2} + +QMAKE_LIBS_EGL = -lEGL -lIMGegl -lsrv_um -lusc +QMAKE_LIBS_OPENGL_ES2 = $$QMAKE_LIBS_EGL -lGLESv2 -lGLES_CM + +load(qt_config) diff --git a/mkspecs/devices/linux-arm-trident-pnx8473-g++/qplatformdefs.h b/mkspecs/devices/linux-arm-trident-pnx8473-g++/qplatformdefs.h new file mode 100644 index 0000000000..e246417223 --- /dev/null +++ b/mkspecs/devices/linux-arm-trident-pnx8473-g++/qplatformdefs.h @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "../../linux-g++/qplatformdefs.h" + -- cgit v1.2.3 From 3a4ed33140bb5dc1b2bf9e783dd26d5fde7c857b Mon Sep 17 00:00:00 2001 From: Bhooshan Supe Date: Tue, 10 Apr 2012 10:57:38 -0700 Subject: Remove input plugins hard libudev dependency libudev extends the base functionality of these plugins but should not be mandatory as it is missing on many embedded devices that still actually require input devices (keyboard and/or mouse and/or touchscreen) support Change-Id: Ieeb949f1af5e774578f689a63f47a8c48f546ac1 Reviewed-by: Girish Ramakrishnan --- src/plugins/generic/evdevkeyboard/evdevkeyboard.pro | 4 +++- src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.cpp | 6 ++++++ src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.h | 4 ++++ src/plugins/generic/evdevmouse/evdevmouse.pro | 4 +++- src/plugins/generic/evdevmouse/qevdevmousehandler.cpp | 1 - src/plugins/generic/evdevmouse/qevdevmousemanager.cpp | 6 ++++++ src/plugins/generic/evdevmouse/qevdevmousemanager.h | 4 ++++ src/plugins/generic/evdevtouch/evdevtouch.pro | 4 +++- src/plugins/generic/evdevtouch/qevdevtouch.cpp | 4 ++++ src/plugins/generic/generic.pro | 4 +--- 10 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/plugins/generic/evdevkeyboard/evdevkeyboard.pro b/src/plugins/generic/evdevkeyboard/evdevkeyboard.pro index 21e4bf63ee..b632e5b7ec 100644 --- a/src/plugins/generic/evdevkeyboard/evdevkeyboard.pro +++ b/src/plugins/generic/evdevkeyboard/evdevkeyboard.pro @@ -19,4 +19,6 @@ SOURCES = main.cpp \ OTHER_FILES += \ evdevkeyboard.json -LIBS += $$QMAKE_LIBS_LIBUDEV +contains(QT_CONFIG, libudev) { + LIBS += $$QMAKE_LIBS_LIBUDEV +} diff --git a/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.cpp b/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.cpp index 0938fdc2e4..697556c4ac 100644 --- a/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.cpp +++ b/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.cpp @@ -56,7 +56,11 @@ QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString & { Q_UNUSED(key); +#ifndef QT_NO_LIBUDEV bool useUDev = true; +#else + bool useUDev = false; +#endif // QT_NO_LIBUDEV QStringList args = specification.split(QLatin1Char(':')); QStringList devices; @@ -77,6 +81,7 @@ QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString & foreach (const QString &device, devices) addKeyboard(device); +#ifndef QT_NO_LIBUDEV if (useUDev) { #ifdef QT_QPA_KEYMAP_DEBUG qWarning() << "Use UDev for device discovery"; @@ -94,6 +99,7 @@ QEvdevKeyboardManager::QEvdevKeyboardManager(const QString &key, const QString & connect(m_udeviceHelper, SIGNAL(deviceRemoved(QString,QUDeviceTypes)), this, SLOT(removeKeyboard(QString))); } } +#endif // QT_NO_LIBUDEV } QEvdevKeyboardManager::~QEvdevKeyboardManager() diff --git a/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.h b/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.h index c776af2ec5..a505ce834e 100644 --- a/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.h +++ b/src/plugins/generic/evdevkeyboard/qevdevkeyboardmanager.h @@ -44,7 +44,9 @@ #include "qevdevkeyboardhandler.h" +#ifndef QT_NO_LIBUDEV #include +#endif // QT_NO_LIBUDEV #include #include @@ -68,7 +70,9 @@ private slots: private: QString m_spec; QHash m_keyboards; +#ifndef QT_NO_LIBUDEV QUDeviceHelper *m_udeviceHelper; +#endif // QT_NO_LIBUDEV }; QT_END_HEADER diff --git a/src/plugins/generic/evdevmouse/evdevmouse.pro b/src/plugins/generic/evdevmouse/evdevmouse.pro index f322a5bd1a..fb9c0e71b8 100644 --- a/src/plugins/generic/evdevmouse/evdevmouse.pro +++ b/src/plugins/generic/evdevmouse/evdevmouse.pro @@ -17,4 +17,6 @@ SOURCES = main.cpp \ OTHER_FILES += \ evdevmouse.json -LIBS += $$QMAKE_LIBS_LIBUDEV +contains(QT_CONFIG, libudev) { + LIBS += $$QMAKE_LIBS_LIBUDEV +} diff --git a/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp b/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp index 1821c2b06b..7c05e9ff11 100644 --- a/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp +++ b/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp @@ -48,7 +48,6 @@ #include #include // overrides QT_OPEN -#include #include diff --git a/src/plugins/generic/evdevmouse/qevdevmousemanager.cpp b/src/plugins/generic/evdevmouse/qevdevmousemanager.cpp index f8e77abe55..cf3fe1f498 100644 --- a/src/plugins/generic/evdevmouse/qevdevmousemanager.cpp +++ b/src/plugins/generic/evdevmouse/qevdevmousemanager.cpp @@ -56,7 +56,11 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif { Q_UNUSED(key); +#ifndef QT_NO_LIBUDEV bool useUDev = true; +#else + bool useUDev = false; +#endif // QT_NO_LIBUDEV QStringList args = specification.split(QLatin1Char(':')); QStringList devices; @@ -77,6 +81,7 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif foreach (const QString &device, devices) addMouse(device); +#ifndef QT_NO_LIBUDEV if (useUDev) { #ifdef QT_QPA_MOUSEMANAGER_DEBUG qWarning() << "Use UDev for device discovery"; @@ -94,6 +99,7 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif connect(m_udeviceHelper, SIGNAL(deviceRemoved(QString,QUDeviceTypes)), this, SLOT(removeMouse(QString))); } } +#endif // QT_NO_LIBUDEV } QEvdevMouseManager::~QEvdevMouseManager() diff --git a/src/plugins/generic/evdevmouse/qevdevmousemanager.h b/src/plugins/generic/evdevmouse/qevdevmousemanager.h index a42257b6a2..f51bd455e8 100644 --- a/src/plugins/generic/evdevmouse/qevdevmousemanager.h +++ b/src/plugins/generic/evdevmouse/qevdevmousemanager.h @@ -44,7 +44,9 @@ #include "qevdevmousehandler.h" +#ifndef QT_NO_LIBUDEV #include +#endif // QT_NO_LIBUDEV #include #include @@ -68,7 +70,9 @@ private slots: private: QString m_spec; QHash m_mice; +#ifndef QT_NO_LIBUDEV QUDeviceHelper *m_udeviceHelper; +#endif // QT_NO_LIBUDEV }; QT_END_HEADER diff --git a/src/plugins/generic/evdevtouch/evdevtouch.pro b/src/plugins/generic/evdevtouch/evdevtouch.pro index 192a87c2a3..c7d298d534 100644 --- a/src/plugins/generic/evdevtouch/evdevtouch.pro +++ b/src/plugins/generic/evdevtouch/evdevtouch.pro @@ -16,7 +16,9 @@ QT += core-private platformsupport-private OTHER_FILES += \ evdevtouch.json -LIBS += $$QMAKE_LIBS_LIBUDEV +contains(QT_CONFIG, libudev) { + LIBS += $$QMAKE_LIBS_LIBUDEV +} # DEFINES += USE_MTDEV diff --git a/src/plugins/generic/evdevtouch/qevdevtouch.cpp b/src/plugins/generic/evdevtouch/qevdevtouch.cpp index b702807cab..c9c49839d6 100644 --- a/src/plugins/generic/evdevtouch/qevdevtouch.cpp +++ b/src/plugins/generic/evdevtouch/qevdevtouch.cpp @@ -46,7 +46,9 @@ #include #include #include +#ifndef QT_NO_LIBUDEV #include +#endif // QT_NO_LIBUDEV #include #ifdef USE_MTDEV @@ -147,6 +149,7 @@ QTouchScreenHandler::QTouchScreenHandler(const QString &spec) QString dev; +#ifndef QT_NO_LIBUDEV // try to let udev scan for already connected devices QScopedPointer udeviceHelper(QUDeviceHelper::createUDeviceHelper(QUDeviceHelper::UDev_Touchpad | QUDeviceHelper::UDev_Touchscreen, this)); if (udeviceHelper) { @@ -156,6 +159,7 @@ QTouchScreenHandler::QTouchScreenHandler(const QString &spec) if (devices.size() > 0) dev = devices[0]; } +#endif // QT_NO_LIBUDEV if (dev.isEmpty()) dev = QLatin1String("/dev/input/event0"); diff --git a/src/plugins/generic/generic.pro b/src/plugins/generic/generic.pro index 06bc0091f4..86b529b39e 100644 --- a/src/plugins/generic/generic.pro +++ b/src/plugins/generic/generic.pro @@ -3,7 +3,5 @@ TEMPLATE = subdirs linux-g++-maemo: SUBDIRS += meego contains(QT_CONFIG, evdev) { - contains(QT_CONFIG, libudev) { - SUBDIRS += evdevmouse evdevtouch evdevkeyboard - } + SUBDIRS += evdevmouse evdevtouch evdevkeyboard } -- cgit v1.2.3 From 4800a94c94bdd1491a5dba1c89cf0edbd4b84121 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 30 Mar 2012 10:11:48 +0200 Subject: Cocoa: use specified window modality in native print dialogs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't pick the modality type based on the presences of a parent widget, use QWidget::windowModality() instead. If modality hasn't been specified, then use presence of the parent to chose an appropriate modality type. Change-Id: Ib39c166ba3293174c55748f63222367e3e1c56bc Reviewed-by: Morten Johan Sørvig --- src/printsupport/dialogs/qpagesetupdialog_mac.mm | 8 ++++++-- src/printsupport/dialogs/qprintdialog_mac.mm | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/printsupport/dialogs/qpagesetupdialog_mac.mm b/src/printsupport/dialogs/qpagesetupdialog_mac.mm index e387a58607..1dded4f905 100644 --- a/src/printsupport/dialogs/qpagesetupdialog_mac.mm +++ b/src/printsupport/dialogs/qpagesetupdialog_mac.mm @@ -179,8 +179,12 @@ void QPageSetupDialog::setVisible(bool visible) QDialog::setVisible(visible); if (visible) { - d->openCocoaPageLayout(parentWidget() ? Qt::WindowModal - : Qt::ApplicationModal); + Qt::WindowModality modality = windowModality(); + if (modality == Qt::NonModal) { + // NSPrintPanels can only be modal, so we must pick a type + modality = parentWidget() ? Qt::WindowModal : Qt::ApplicationModal; + } + d->openCocoaPageLayout(modality); return; } else { if (d->pageLayout) { diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm index 8ea3c9a11d..e1d85eed59 100644 --- a/src/printsupport/dialogs/qprintdialog_mac.mm +++ b/src/printsupport/dialogs/qprintdialog_mac.mm @@ -296,8 +296,12 @@ void QPrintDialog::setVisible(bool visible) QDialog::setVisible(visible); if (visible) { - d->openCocoaPrintPanel(parentWidget() ? Qt::WindowModal - : Qt::ApplicationModal); + Qt::WindowModality modality = windowModality(); + if (modality == Qt::NonModal) { + // NSPrintPanels can only be modal, so we must pick a type + modality = parentWidget() ? Qt::WindowModal : Qt::ApplicationModal; + } + d->openCocoaPrintPanel(modality); return; } else { if (d->printPanel) { -- cgit v1.2.3 From c7da50ef8cf30558537425918cf03f5e72c680c1 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 11 Apr 2012 17:35:47 -0700 Subject: Suppress warnings caused by ignoring chdir retval MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using g++ 4.6.1, we get warnings like below: qprocess_unix.cpp:1376:69: warning: ignoring return value of ‘int chdir(const char*)’, declared with attribute warn_unused_result [-Wunused-result] g++ is pretty adamant and prints the warning even if you explicitly ignore using (void). So, just check for error and print a warning. Change-Id: Ifd6f3b6bb9e17d44aa235815b06a762131ca8751 Reviewed-by: Thiago Macieira --- src/corelib/io/qprocess_unix.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 2da2913c6f..bfa132f353 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -772,7 +772,8 @@ static pid_t doSpawn(int fd_count, int fd_map[], char **argv, char **envp, qWarning("ThreadCtl(): cannot hold threads: %s", qPrintable(qt_error_string(errno))); oldWorkingDir = QT_GETCWD(buff, PATH_MAX + 1); - QT_CHDIR(workingDir); + if (QT_CHDIR(workingDir) == -1) + qWarning("ThreadCtl(): failed to chdir to %s", workingDir); } pid_t childPid; @@ -783,7 +784,8 @@ static pid_t doSpawn(int fd_count, int fd_map[], char **argv, char **envp, } if (oldWorkingDir) { - QT_CHDIR(oldWorkingDir); + if (QT_CHDIR(oldWorkingDir) == -1) + qWarning("ThreadCtl(): failed to chdir to %s", oldWorkingDir); if (ThreadCtl(_NTO_TCTL_THREADS_CONT, 0) == -1) qFatal("ThreadCtl(): cannot resume threads: %s", qPrintable(qt_error_string(errno))); @@ -853,8 +855,10 @@ void QProcessPrivate::execChild(const char *workingDir, char **path, char **argv qt_safe_close(childStartedPipe[0]); // enter the working directory - if (workingDir) - QT_CHDIR(workingDir); + if (workingDir) { + if (QT_CHDIR(workingDir) == -1) + qWarning("QProcessPrivate::execChild() failed to chdir to %s", workingDir); + } // this is a virtual call, and it base behavior is to do nothing. q->setupChildProcess(); @@ -1372,8 +1376,10 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a if (doubleForkPid == 0) { qt_safe_close(pidPipe[1]); - if (!encodedWorkingDirectory.isEmpty()) - QT_CHDIR(encodedWorkingDirectory.constData()); + if (!encodedWorkingDirectory.isEmpty()) { + if (QT_CHDIR(encodedWorkingDirectory.constData()) == -1) + qWarning("QProcessPrivate::startDetached: failed to chdir to %s", encodedWorkingDirectory.constData()); + } char **argv = new char *[arguments.size() + 2]; for (int i = 0; i < arguments.size(); ++i) { @@ -1426,7 +1432,8 @@ bool QProcessPrivate::startDetached(const QString &program, const QStringList &a qt_safe_close(startedPipe[1]); qt_safe_write(pidPipe[1], (const char *)&doubleForkPid, sizeof(pid_t)); - QT_CHDIR("/"); + if (QT_CHDIR("/") == -1) + qWarning("QProcessPrivate::startDetached: failed to chdir to /"); ::_exit(1); } -- cgit v1.2.3 From a9cda515177db1615f8d47becf2aa781f26955ae Mon Sep 17 00:00:00 2001 From: Andreas Aardal Hanssen Date: Sun, 8 Apr 2012 11:58:30 +0200 Subject: Fixes a regression; missing cursor blink when input mask is set. I can't say for sure why q*linecontrol passes an empty rect to the updateNeeded() signal when an input mask is set; presumably the empty rect at some point has meant "full update", but there are a few problems with this. Surely a full update is wrong, even if the semantics have been lost in translation somewhere (likely the qlinecontrol refactoring). This fix ensures that empty rects from updateNeeded() are interpreted as a request to update the whole widget. A further improvement would be to ensure the line control doesn't request a full update when an input mask is set. The cursor is usually wider when a mask is set but because of QLineEdit::paintEvent()'s implementation, there is currently a mismatch between the cursor width as seen by q*linecontrol and what is actually drawn, which causes rendering artifacts if updateNeeded() sends the cursorRect(). Since QLineEdit and Q*LineControl aren't actively developed, it's best to keep this fix minimal, although the performance cost of updating the whole line edit when an input mask is set is unfortunate. Task-number: QTBUG-7174 Change-Id: Ie51e015d760915e07b0220b770f04fc958d93a12 Reviewed-by: Andy Shaw Reviewed-by: Girish Ramakrishnan --- src/widgets/widgets/qlineedit_p.cpp | 3 ++- .../widgets/widgets/qlineedit/tst_qlineedit.cpp | 25 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index 6cee96e717..d1c374a6ca 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -62,9 +62,10 @@ const int QLineEditPrivate::horizontalMargin(2); QRect QLineEditPrivate::adjustedControlRect(const QRect &rect) const { + QRect widgetRect = !rect.isEmpty() ? rect : q_func()->rect(); QRect cr = adjustedContentsRect(); int cix = cr.x() - hscroll + horizontalMargin; - return rect.translated(QPoint(cix, vscroll)); + return widgetRect.translated(QPoint(cix, vscroll)); } int QLineEditPrivate::xToPos(int x, QTextLine::CursorPosition betweenOrOn) const diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp index 06bf929e4b..22e05a8871 100644 --- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp @@ -271,6 +271,7 @@ private slots: void taskQTBUG_7395_readOnlyShortcut(); void QTBUG697_paletteCurrentColorGroup(); void QTBUG13520_textNotVisible(); + void QTBUG7174_inputMaskCursorBlink(); void bidiVisualMovement_data(); void bidiVisualMovement(); @@ -3693,6 +3694,30 @@ void tst_QLineEdit::QTBUG13520_textNotVisible() } +class UpdateRegionLineEdit : public QLineEdit +{ +public: + QRegion updateRegion; +protected: + void paintEvent(QPaintEvent *event) + { + updateRegion = event->region(); + } +}; + +void tst_QLineEdit::QTBUG7174_inputMaskCursorBlink() +{ + UpdateRegionLineEdit edit; + edit.setInputMask(QLatin1String("AAAA")); + edit.setFocus(); + edit.setText(QLatin1String("AAAA")); + edit.show(); + QRect cursorRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect(); + QTest::qWaitForWindowShown(&edit); + edit.updateRegion = QRegion(); + QTest::qWait(QApplication::cursorFlashTime()); + QVERIFY(edit.updateRegion.contains(cursorRect)); +} void tst_QLineEdit::bidiVisualMovement_data() { -- cgit v1.2.3 From c30d2c37b03f2d0ea5e41a01a9baeb86e16da7a2 Mon Sep 17 00:00:00 2001 From: Morten Sorvig Date: Wed, 28 Mar 2012 13:27:14 +0200 Subject: Use Clang by default on Mac OS 10.8 and above. Change-Id: Ieaf65a86f2a0ccc5dac007030ea345ce6ccc7185 Reviewed-by: Oswald Buddenhagen Reviewed-by: Bradley T. Hughes --- configure | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 0bd115e735..0fd371bdb5 100755 --- a/configure +++ b/configure @@ -2185,19 +2185,19 @@ if [ -z "$PLATFORM" ]; then case "$UNAME_SYSTEM:$UNAME_RELEASE" in Darwin:*) OSX_VERSION=`uname -r | cut -d. -f1` - if [ "$OSX_VERSION" -ge 11 ]; then - # We're on Lion or above. Check if we have a supported Clang version + # Select compiler. Use g++ unless we find a usable Clang version + PLATFORM=macx-g++ + if [ "$OSX_VERSION" -ge 12 ]; then + # We're on Mountain Lion or above. Use Clang. Don't advertise gcc. + PLATFORM=macx-clang + elif [ "$OSX_VERSION" -eq 11 ]; then + # We're on Lion. Check if we have a supported Clang version case "$(clang -v 2>&1 | grep -Po '(?<=version )\d[\d.]+')" in 3.*) PLATFORM=macx-clang PLATFORM_NOTES="\n - Also available for Mac OS X: macx-g++\n" ;; - *) - PLATFORM=macx-g++ - ;; esac - else - PLATFORM=macx-g++ fi ;; AIX:*) -- cgit v1.2.3 From 7ed1ab9076866d39a086fb1d364ab1903afc9a91 Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Thu, 12 Apr 2012 13:50:54 +0200 Subject: QDoc: Generate missing image error. Change-Id: I98faf3b3422fa0a7ebd3f65c7ba64e6dc31bad86 Reviewed-by: Martin Smith --- src/tools/qdoc/ditaxmlgenerator.cpp | 1 + src/tools/qdoc/htmlgenerator.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index 88a5888887..7b499a52e1 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -1206,6 +1206,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, if (atom->next() != 0) text = atom->next()->string(); if (fileName.isEmpty()) { + relative->location().warning(tr("Missing image: %1").arg(protectEnc(atom->string()))); QString images = "images"; if (!baseDir().isEmpty()) images.prepend("../"); diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 8a54d630c5..24dd31e0b5 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -775,6 +775,7 @@ int HtmlGenerator::generateAtom(const Atom *atom, if (atom->type() == Atom::Image) out() << "

"; if (fileName.isEmpty()) { + relative->location().warning(tr("Missing image: %1").arg(protectEnc(atom->string()))); out() << "[Missing image " << protectEnc(atom->string()) << "]"; } -- cgit v1.2.3 From 28675642f3445e41434b004c2a1a1d96ec0145a2 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 12 Apr 2012 12:56:20 +0200 Subject: Build manual tests. Add a toplevel manual.pro and other .pro-files to build them and fix the build. Change-Id: Ibc98a27b39dd1304edfa8a6894d62e77ce7ef387 Reviewed-by: Shane Kearns --- tests/manual/bearerex/bearerex.cpp | 9 +++-- tests/manual/bearerex/bearerex.h | 2 +- tests/manual/bearerex/bearerex.pro | 1 + tests/manual/bearerex/datatransferer.cpp | 41 ---------------------- tests/manual/bearerex/datatransferer.h | 17 --------- tests/manual/cocoa/qt_on_cocoa/window.cpp | 2 +- tests/manual/cocoa/wheelevent/main.cpp | 2 +- tests/manual/cocoa/wheelevent/window.cpp | 2 +- tests/manual/gestures/gestures.pro | 4 +++ .../manual/gestures/graphicsview/graphicsview.pro | 2 ++ tests/manual/gestures/graphicsview/main.cpp | 2 +- tests/manual/gestures/scrollarea/main.cpp | 2 +- tests/manual/gestures/scrollarea/scrollarea.pro | 2 ++ tests/manual/inputmethodhints/inputmethodhints.h | 4 +-- tests/manual/inputmethodhints/inputmethodhints.pro | 3 +- tests/manual/inputmethodhints/main.cpp | 2 +- tests/manual/keypadnavigation/keypadnavigation.pro | 1 + tests/manual/keypadnavigation/main.cpp | 2 +- tests/manual/lance/interactivewidget.cpp | 2 +- tests/manual/lance/interactivewidget.h | 2 +- tests/manual/lance/lance.pro | 4 +-- tests/manual/lance/main.cpp | 12 +++---- tests/manual/lance/widgets.h | 10 +----- tests/manual/manual.pro | 32 +++++++++++++++++ .../network_remote_stresstest.pro | 3 +- .../tst_network_remote_stresstest.cpp | 38 +++++++++++++++----- .../network_stresstest/network_stresstest.pro | 3 +- .../network_stresstest/tst_network_stresstest.cpp | 4 +-- tests/manual/qdesktopwidget/main.cpp | 2 +- tests/manual/qdesktopwidget/qdesktopwidget.pro | 1 + tests/manual/qgraphicsitemgroup/main.cpp | 2 +- .../qgraphicsitemgroup/qgraphicsitemgroup.pro | 1 + tests/manual/qgraphicslayout/flicker/flicker.pro | 1 + tests/manual/qgraphicslayout/flicker/main.cpp | 3 +- tests/manual/qgraphicslayout/flicker/window.h | 2 +- .../qhttpnetworkconnection.pro | 2 -- tests/manual/qimagereader/main.cpp | 2 +- tests/manual/qimagereader/qimagereader.pro | 1 + tests/manual/qlocale/calendar.cpp | 2 +- tests/manual/qlocale/calendar.h | 2 +- tests/manual/qlocale/currency.h | 2 +- tests/manual/qlocale/dateformats.h | 2 +- tests/manual/qlocale/info.h | 2 +- tests/manual/qlocale/languages.h | 2 +- tests/manual/qlocale/main.cpp | 2 +- tests/manual/qlocale/miscellaneous.h | 2 +- tests/manual/qlocale/numberformats.h | 2 +- tests/manual/qlocale/qlocale.pro | 1 + tests/manual/qlocale/window.h | 2 +- tests/manual/qnetworkaccessmanager/qget/qget.h | 2 ++ .../qnetworkconfigurationmanager.pro | 2 -- tests/manual/qnetworkreply/qnetworkreply.pro | 2 -- .../device_information/device_information.pro | 6 ++++ .../qtabletevent/device_information/main.cpp | 2 +- .../device_information/qtabletevent.pro | 5 --- .../event_compression/event_compression.pro | 2 +- tests/manual/qtabletevent/qtabletevent.pro | 5 +++ .../regular_widgets/regular_widgets.pro | 1 + tests/manual/qtbug-8933/main.cpp | 2 +- tests/manual/qtbug-8933/qtbug-8933.pro | 2 +- tests/manual/qtouchevent/main.cpp | 2 +- tests/manual/qtouchevent/qtouchevent.pro | 2 +- tests/manual/qwidget_zorder/main.cpp | 2 +- tests/manual/qwidget_zorder/qwidget_zorder.pro | 1 + tests/manual/repaint/mainwindow/main.cpp | 2 +- tests/manual/repaint/mainwindow/mainwindow.pro | 1 + tests/manual/repaint/repaint.pro | 9 +++++ tests/manual/repaint/scrollarea/main.cpp | 2 +- tests/manual/repaint/scrollarea/scrollarea.pro | 1 + tests/manual/repaint/shared/shared.h | 2 +- tests/manual/repaint/splitter/main.cpp | 2 +- tests/manual/repaint/splitter/splitter.pro | 1 + tests/manual/repaint/tableview/main.cpp | 2 +- tests/manual/repaint/tableview/tableview.pro | 1 + tests/manual/repaint/task141091/main.cpp | 2 +- tests/manual/repaint/task141091/task141091.pro | 2 +- tests/manual/repaint/toplevel/main.cpp | 2 +- tests/manual/repaint/toplevel/toplevel.pro | 1 + tests/manual/repaint/widget/main.cpp | 2 +- tests/manual/repaint/widget/widget.pro | 1 + tests/manual/socketengine/main.cpp | 3 +- tests/manual/socketengine/socketengine.pro | 4 +-- .../textrendering/glyphshaping/glyphshaping.pro | 1 + tests/manual/textrendering/glyphshaping/main.cpp | 2 +- .../manual/textrendering/textperformance/main.cpp | 2 +- .../textperformance/textperformance.pro | 1 + tests/manual/textrendering/textrendering.pro | 4 +++ .../manual/widgets/itemviews/delegate/delegate.pro | 3 ++ .../manual/widgets/itemviews/delegate/example.pro | 2 -- tests/manual/windowflags/controllerwindow.cpp | 12 +++++-- tests/manual/windowflags/previewwindow.cpp | 4 ++- tests/manual/windowflags/windowflags.pro | 2 ++ tests/manual/windowmodality/modality.pro | 3 -- tests/manual/windowmodality/windowmodality.pro | 3 ++ 94 files changed, 200 insertions(+), 165 deletions(-) create mode 100644 tests/manual/gestures/gestures.pro create mode 100644 tests/manual/manual.pro create mode 100644 tests/manual/qtabletevent/device_information/device_information.pro delete mode 100644 tests/manual/qtabletevent/device_information/qtabletevent.pro create mode 100644 tests/manual/qtabletevent/qtabletevent.pro create mode 100644 tests/manual/repaint/repaint.pro create mode 100644 tests/manual/textrendering/textrendering.pro create mode 100644 tests/manual/widgets/itemviews/delegate/delegate.pro delete mode 100644 tests/manual/widgets/itemviews/delegate/example.pro delete mode 100644 tests/manual/windowmodality/modality.pro create mode 100644 tests/manual/windowmodality/windowmodality.pro diff --git a/tests/manual/bearerex/bearerex.cpp b/tests/manual/bearerex/bearerex.cpp index 190be6f6b4..6826312880 100644 --- a/tests/manual/bearerex/bearerex.cpp +++ b/tests/manual/bearerex/bearerex.cpp @@ -43,6 +43,7 @@ #include "datatransferer.h" #include +#include Q_DECLARE_METATYPE(QNetworkConfiguration) @@ -284,7 +285,7 @@ SessionTab::SessionTab(QNetworkConfiguration* apNetworkConfiguration, } else if (apNetworkConfiguration->type() == QNetworkConfiguration::ServiceNetwork) { snapLineEdit->setText(apNetworkConfiguration->name()+" ("+apNetworkConfiguration->identifier()+")"); } - bearerLineEdit->setText(apNetworkConfiguration->bearerName()); + bearerLineEdit->setText(apNetworkConfiguration->bearerTypeName()); sentRecDataLineEdit->setText(QString::number(m_NetworkSession->bytesWritten())+ QString(" / ")+ QString::number(m_NetworkSession->bytesReceived())); @@ -314,8 +315,6 @@ void SessionTab::on_createQNetworkAccessManagerButton_clicked() m_dataTransferer = new DataTransfererQNam(this); } else if (type == "QTcpSocket") { m_dataTransferer = new DataTransfererQTcp(this); - } else if (type == "QHttp") { - m_dataTransferer = new DataTransfererQHttp(this); } else { qDebug("BearerEx Warning, unknown data transfer object requested, not creating anything."); return; @@ -512,10 +511,10 @@ void SessionTab::newState(QNetworkSession::State state) QNetworkConfiguration config = m_ConfigManager->configurationFromIdentifier(configId); if (config.isValid()) { iapLineEdit->setText(config.name()+" ("+config.identifier()+")"); - bearerLineEdit->setText(config.bearerName()); + bearerLineEdit->setText(config.bearerTypeName()); } } else { - bearerLineEdit->setText(m_NetworkSession->configuration().bearerName()); + bearerLineEdit->setText(m_NetworkSession->configuration().bearerTypeName()); } QString active; diff --git a/tests/manual/bearerex/bearerex.h b/tests/manual/bearerex/bearerex.h index 7ab0177128..60963e8fd2 100644 --- a/tests/manual/bearerex/bearerex.h +++ b/tests/manual/bearerex/bearerex.h @@ -42,7 +42,7 @@ #ifndef ACCESSPOINTMANAGEREX_H #define ACCESSPOINTMANAGEREX_H -#include +#include #include "ui_detailedinfodialog.h" diff --git a/tests/manual/bearerex/bearerex.pro b/tests/manual/bearerex/bearerex.pro index 123038dba4..a49c644e2e 100644 --- a/tests/manual/bearerex/bearerex.pro +++ b/tests/manual/bearerex/bearerex.pro @@ -3,6 +3,7 @@ TARGET = BearerEx QT += core \ gui \ + widgets \ network FORMS += detailedinfodialog.ui diff --git a/tests/manual/bearerex/datatransferer.cpp b/tests/manual/bearerex/datatransferer.cpp index 1380607632..648a466a30 100644 --- a/tests/manual/bearerex/datatransferer.cpp +++ b/tests/manual/bearerex/datatransferer.cpp @@ -134,47 +134,6 @@ void DataTransfererQTcp::error(QAbstractSocket::SocketError socketError) emit finished(socketError, 0, "QAbstractSocket::SocketError"); } -// -------- Based on QHttp - -DataTransfererQHttp::DataTransfererQHttp(QObject* parent) -: DataTransferer(parent) -{ - connect(&m_qhttp, SIGNAL(done(bool)), this, SLOT(done(bool))); - qDebug("BearerEx DataTransferer QHttp created."); -} - -DataTransfererQHttp::~DataTransfererQHttp() -{ - qDebug("BearerEx DataTransferer QHttp destroyed."); -} - -bool DataTransfererQHttp::transferData() -{ - qDebug("BearerEx datatransfer for QHttp requested."); - if (m_dataTransferOngoing) { - return false; - } - QString urlstring("http://www.google.com"); - QUrl url(urlstring); - m_qhttp.setHost(url.host(), QHttp::ConnectionModeHttp, url.port() == -1 ? 0 : url.port()); - m_qhttp.get(urlstring); - m_dataTransferOngoing = true; - return true; -} - -void DataTransfererQHttp::done(bool /*error*/ ) -{ - qDebug("BearerEx DatatransfererQHttp reply was finished (error code is type QHttp::Error)."); - qint64 dataReceived = 0; - quint32 errorCode = m_qhttp.error(); - if (m_qhttp.error() == QHttp::NoError) { - QString result(m_qhttp.readAll()); - dataReceived = result.length(); - } - m_dataTransferOngoing = false; - emit finished(errorCode, dataReceived, "QHttp::Error"); -} - // -------- Based on QNetworkAccessManager DataTransfererQNam::DataTransfererQNam(QObject* parent) diff --git a/tests/manual/bearerex/datatransferer.h b/tests/manual/bearerex/datatransferer.h index e657b20b38..4be8572a7c 100644 --- a/tests/manual/bearerex/datatransferer.h +++ b/tests/manual/bearerex/datatransferer.h @@ -47,7 +47,6 @@ #include #include #include -#include #include // Interface-class for data transferring object @@ -111,20 +110,4 @@ private: QNetworkAccessManager m_qnam; }; -class DataTransfererQHttp : public DataTransferer -{ - Q_OBJECT -public: - DataTransfererQHttp(QObject* parent = 0); - ~DataTransfererQHttp(); - - virtual bool transferData(); - -public slots: - void done(bool error); - -private: - QHttp m_qhttp; -}; - #endif // DATATRANSFERER_H diff --git a/tests/manual/cocoa/qt_on_cocoa/window.cpp b/tests/manual/cocoa/qt_on_cocoa/window.cpp index d68e08a9f8..c1d4401eae 100644 --- a/tests/manual/cocoa/qt_on_cocoa/window.cpp +++ b/tests/manual/cocoa/qt_on_cocoa/window.cpp @@ -45,7 +45,7 @@ #include #include -#include +#include static int colorIndexId = 0; diff --git a/tests/manual/cocoa/wheelevent/main.cpp b/tests/manual/cocoa/wheelevent/main.cpp index 979498991d..69c0960419 100644 --- a/tests/manual/cocoa/wheelevent/main.cpp +++ b/tests/manual/cocoa/wheelevent/main.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include -#include +#include #include "window.h" diff --git a/tests/manual/cocoa/wheelevent/window.cpp b/tests/manual/cocoa/wheelevent/window.cpp index b305b057bf..66c8af0ad1 100644 --- a/tests/manual/cocoa/wheelevent/window.cpp +++ b/tests/manual/cocoa/wheelevent/window.cpp @@ -45,7 +45,7 @@ #include #include -#include +#include static int colorIndexId = 0; diff --git a/tests/manual/gestures/gestures.pro b/tests/manual/gestures/gestures.pro new file mode 100644 index 0000000000..6ff914f542 --- /dev/null +++ b/tests/manual/gestures/gestures.pro @@ -0,0 +1,4 @@ +TEMPLATE=subdirs + +SUBDIRS = graphicsview \ + scrollarea diff --git a/tests/manual/gestures/graphicsview/graphicsview.pro b/tests/manual/gestures/graphicsview/graphicsview.pro index c5f6fe0764..9ecd0b372f 100644 --- a/tests/manual/gestures/graphicsview/graphicsview.pro +++ b/tests/manual/gestures/graphicsview/graphicsview.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES += main.cpp \ imageitem.cpp \ gestures.cpp \ diff --git a/tests/manual/gestures/graphicsview/main.cpp b/tests/manual/gestures/graphicsview/main.cpp index ddda06ea22..465c3a2d65 100644 --- a/tests/manual/gestures/graphicsview/main.cpp +++ b/tests/manual/gestures/graphicsview/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "imageitem.h" #include "gestures.h" diff --git a/tests/manual/gestures/scrollarea/main.cpp b/tests/manual/gestures/scrollarea/main.cpp index d77ce8e373..190441989e 100644 --- a/tests/manual/gestures/scrollarea/main.cpp +++ b/tests/manual/gestures/scrollarea/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "mousepangesturerecognizer.h" diff --git a/tests/manual/gestures/scrollarea/scrollarea.pro b/tests/manual/gestures/scrollarea/scrollarea.pro index 554810e0c3..84e2af3f49 100644 --- a/tests/manual/gestures/scrollarea/scrollarea.pro +++ b/tests/manual/gestures/scrollarea/scrollarea.pro @@ -1,3 +1,5 @@ +QT += widgets + SOURCES = main.cpp \ mousepangesturerecognizer.cpp HEADERS += mousepangesturerecognizer.h diff --git a/tests/manual/inputmethodhints/inputmethodhints.h b/tests/manual/inputmethodhints/inputmethodhints.h index 4746c9a11a..82d3e7290e 100644 --- a/tests/manual/inputmethodhints/inputmethodhints.h +++ b/tests/manual/inputmethodhints/inputmethodhints.h @@ -42,8 +42,8 @@ #ifndef INPUTMETHODHINTS_H #define INPUTMETHODHINTS_H -#include -#include "ui_tst_inputmethodhints.h" +#include +#include "ui_inputmethodhints.h" class inputmethodhints : public QMainWindow { diff --git a/tests/manual/inputmethodhints/inputmethodhints.pro b/tests/manual/inputmethodhints/inputmethodhints.pro index 171c5f1772..f253f72332 100644 --- a/tests/manual/inputmethodhints/inputmethodhints.pro +++ b/tests/manual/inputmethodhints/inputmethodhints.pro @@ -1,8 +1,7 @@ TEMPLATE = app TARGET = tst_inputmethodhints -QT += core \ - gui +QT += widgets HEADERS += inputmethodhints.h SOURCES += main.cpp \ diff --git a/tests/manual/inputmethodhints/main.cpp b/tests/manual/inputmethodhints/main.cpp index af3286df73..fcd6d16892 100644 --- a/tests/manual/inputmethodhints/main.cpp +++ b/tests/manual/inputmethodhints/main.cpp @@ -41,7 +41,7 @@ #include "inputmethodhints.h" -#include +#include #include int main(int argc, char *argv[]) diff --git a/tests/manual/keypadnavigation/keypadnavigation.pro b/tests/manual/keypadnavigation/keypadnavigation.pro index 6d12606c78..a45d38af21 100644 --- a/tests/manual/keypadnavigation/keypadnavigation.pro +++ b/tests/manual/keypadnavigation/keypadnavigation.pro @@ -1,2 +1,3 @@ +QT += widgets SOURCES += main.cpp FORMS += keypadnavigation.ui diff --git a/tests/manual/keypadnavigation/main.cpp b/tests/manual/keypadnavigation/main.cpp index 4f7224d135..964d46faf6 100644 --- a/tests/manual/keypadnavigation/main.cpp +++ b/tests/manual/keypadnavigation/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "ui_keypadnavigation.h" class KeypadNavigation : public QMainWindow diff --git a/tests/manual/lance/interactivewidget.cpp b/tests/manual/lance/interactivewidget.cpp index 55e60a8946..0b9d8ee0a4 100644 --- a/tests/manual/lance/interactivewidget.cpp +++ b/tests/manual/lance/interactivewidget.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ #include "interactivewidget.h" -#include +#include InteractiveWidget::InteractiveWidget() { diff --git a/tests/manual/lance/interactivewidget.h b/tests/manual/lance/interactivewidget.h index e9e584512e..879facac42 100644 --- a/tests/manual/lance/interactivewidget.h +++ b/tests/manual/lance/interactivewidget.h @@ -44,7 +44,7 @@ #include "widgets.h" #include "paintcommands.h" -#include +#include #include diff --git a/tests/manual/lance/lance.pro b/tests/manual/lance/lance.pro index e24d3f2fa3..4b319369e6 100644 --- a/tests/manual/lance/lance.pro +++ b/tests/manual/lance/lance.pro @@ -1,8 +1,8 @@ -LANCELOT_DIR = $$PWD/../../auto/lancelot +LANCELOT_DIR = $$PWD/../../auto/other/lancelot CONFIG+=console moc TEMPLATE = app INCLUDEPATH += . $$LANCELOT_DIR -QT += core-private gui-private +QT += core-private gui-private widgets printsupport HEADERS += widgets.h \ interactivewidget.h \ diff --git a/tests/manual/lance/main.cpp b/tests/manual/lance/main.cpp index c33cb49be9..e8bb44a221 100644 --- a/tests/manual/lance/main.cpp +++ b/tests/manual/lance/main.cpp @@ -43,7 +43,8 @@ #include "paintcommands.h" #include -#include +#include +#include #include #include @@ -612,14 +613,11 @@ int main(int argc, char **argv) pcmd.setType(type); pcmd.setCheckersBackground(checkers_background); pcmd.setContents(content); - bool ps = type == PsType; QPrinter p(highres ? QPrinter::HighResolution : QPrinter::ScreenResolution); QFileInfo input(files.at(j)); - QString file = QString("%1_%2.%3") - .arg(input.baseName()) - .arg(input.suffix()) - .arg(ps ? "ps" : "pdf"); - p.setOutputFormat(ps ? QPrinter::PdfFormat : QPrinter::PostScriptFormat); + const QString file = input.baseName() + QLatin1Char('_') + + input.suffix() + QStringLiteral(".pdf"); + p.setOutputFormat(QPrinter::PdfFormat); p.setOutputFileName(file); p.setPageSize(QPrinter::A4); QPainter pt(&p); diff --git a/tests/manual/lance/widgets.h b/tests/manual/lance/widgets.h index d8a67a7554..33115ad7b3 100644 --- a/tests/manual/lance/widgets.h +++ b/tests/manual/lance/widgets.h @@ -59,9 +59,6 @@ #include #include - -#include - #include const int CP_RADIUS = 10; @@ -236,12 +233,7 @@ public: } if (m_render_view.isNull()) { - - if (T::window()->windowSurface()) - m_render_view = T::window()->windowSurface()->grabWidget(this); - else - m_render_view = QPixmap::grabWidget(this); - + m_render_view = QPixmap::grabWidget(this); m_render_view.save("renderView.png"); } } diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro new file mode 100644 index 0000000000..9df151eee1 --- /dev/null +++ b/tests/manual/manual.pro @@ -0,0 +1,32 @@ +TEMPLATE=subdirs + +SUBDIRS = bearerex \ +gestures \ +inputmethodhints \ +keypadnavigation \ +lance \ +network_remote_stresstest \ +network_stresstest \ +qcursor \ +qdesktopwidget \ +qgraphicsitemgroup \ +qgraphicslayout/flicker \ +qhttpnetworkconnection \ +qimagereader \ +qlocale \ +qnetworkaccessmanager/qget \ +qnetworkconfigurationmanager \ +qnetworkreply \ +qssloptions \ +qtabletevent \ +qtbug-8933 \ +qtouchevent \ +qwidget_zorder \ +repaint \ +socketengine \ +textrendering \ +widgets/itemviews/delegate \ +windowflags \ +windowmodality + +!contains(QT_CONFIG, openssl):!contains(QT_CONFIG, openssl-linked):SUBDIRS -= qssloptions diff --git a/tests/manual/network_remote_stresstest/network_remote_stresstest.pro b/tests/manual/network_remote_stresstest/network_remote_stresstest.pro index 3a581e12ad..8b52240509 100644 --- a/tests/manual/network_remote_stresstest/network_remote_stresstest.pro +++ b/tests/manual/network_remote_stresstest/network_remote_stresstest.pro @@ -1,9 +1,10 @@ CONFIG += testcase TARGET = tst_network_remote_stresstest -QT = core network testlib +QT = core core-private network network-private testlib SOURCES += tst_network_remote_stresstest.cpp RESOURCES += url-list.qrc +LIBS += $$QMAKE_LIBS_NETWORK diff --git a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp index c2981c6df8..109ecbe2aa 100644 --- a/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp +++ b/tests/manual/network_remote_stresstest/tst_network_remote_stresstest.cpp @@ -235,6 +235,10 @@ void tst_NetworkRemoteStressTest::blockingSequentialRemoteHosts() QElapsedTimer outerTimer; outerTimer.start(); +#ifdef QT_NO_SSL + QVERIFY(!useSslSocket); +#endif // QT_NO_SSL + for (int i = 0; i < urlList.size(); ++i) { const QUrl &url = urlList.at(i); bool isHttps = url.scheme() == "https"; @@ -243,21 +247,24 @@ void tst_NetworkRemoteStressTest::blockingSequentialRemoteHosts() timeout.start(); QSharedPointer socket; - if (useSslSocket || isHttps) { +#ifndef QT_NO_SSL + if (useSslSocket || isHttps) socket = QSharedPointer(new QSslSocket); - } else { +#endif // QT_NO_SSL + if (socket.isNull()) socket = QSharedPointer(new QTcpSocket); - } socket->connectToHost(url.host(), url.port(isHttps ? 443 : 80)); QVERIFY2(socket->waitForConnected(10000), "Timeout connecting to " + url.encodedHost()); +#ifndef QT_NO_SSL if (isHttps) { static_cast(socket.data())->setProtocol(QSsl::TlsV1_0); static_cast(socket.data())->startClientEncryption(); static_cast(socket.data())->ignoreSslErrors(); QVERIFY2(static_cast(socket.data())->waitForEncrypted(10000), "Timeout starting TLS with " + url.encodedHost()); } +#endif // QT_NO_SSL socket->write("GET " + url.toEncoded(QUrl::RemoveScheme | QUrl::RemoveAuthority | QUrl::RemoveFragment) + " HTTP/1.0\r\n" "Connection: close\r\n" @@ -288,6 +295,10 @@ void tst_NetworkRemoteStressTest::sequentialRemoteHosts() QFETCH_GLOBAL(QVector, urlList); QFETCH_GLOBAL(bool, useSslSocket); +#ifdef QT_NO_SSL + QVERIFY(!useSslSocket); +#endif // QT_NO_SSL + qint64 totalBytes = 0; QElapsedTimer outerTimer; outerTimer.start(); @@ -300,15 +311,18 @@ void tst_NetworkRemoteStressTest::sequentialRemoteHosts() timeout.start(); QSharedPointer socket; - if (useSslSocket || isHttps) { +#ifndef QT_NO_SSL + if (useSslSocket || isHttps) socket = QSharedPointer(new QSslSocket); - } else { +#endif // QT_NO_SSL + if (socket.isNull()) socket = QSharedPointer(new QTcpSocket); - } if (isHttps) { +#ifndef QT_NO_SSL static_cast(socket.data())->setProtocol(QSsl::TlsV1_0); static_cast(socket.data())->connectToHostEncrypted(url.host(), url.port(443)); static_cast(socket.data())->ignoreSslErrors(); +#endif // QT_NO_SSL } else { socket->connectToHost(url.host(), url.port(80)); } @@ -356,6 +370,10 @@ void tst_NetworkRemoteStressTest::parallelRemoteHosts() QFETCH(int, parallelAttempts); +#ifdef QT_NO_SSL + QVERIFY(!useSslSocket); +#endif // QT_NO_SSL + qint64 totalBytes = 0; QElapsedTimer outerTimer; outerTimer.start(); @@ -371,15 +389,19 @@ void tst_NetworkRemoteStressTest::parallelRemoteHosts() for (int j = 0; j < parallelAttempts && it != urlList.constEnd(); ++j, ++it) { const QUrl &url = *it; bool isHttps = url.scheme() == "https"; - QTcpSocket *socket; + QTcpSocket *socket = 0; +#ifndef QT_NO_SSL if (useSslSocket || isHttps) socket = new QSslSocket; - else +#endif // QT_NO_SSL + if (!socket) socket = new QTcpSocket; if (isHttps) { +#ifndef QT_NO_SSL static_cast(socket)->setProtocol(QSsl::TlsV1_0); static_cast(socket)->connectToHostEncrypted(url.host(), url.port(443)); static_cast(socket)->ignoreSslErrors(); +#endif // QT_NO_SSL } else { socket->connectToHost(url.host(), url.port(isHttps ? 443 : 80)); } diff --git a/tests/manual/network_stresstest/network_stresstest.pro b/tests/manual/network_stresstest/network_stresstest.pro index caa8436cef..ebddf12961 100644 --- a/tests/manual/network_stresstest/network_stresstest.pro +++ b/tests/manual/network_stresstest/network_stresstest.pro @@ -1,7 +1,7 @@ CONFIG += testcase TARGET = tst_network_stresstest -QT = core network testlib +QT = core-private network-private testlib SOURCES += tst_network_stresstest.cpp \ minihttpserver.cpp @@ -11,3 +11,4 @@ HEADERS += \ RESOURCES += wwwfiles.qrc QMAKE_RESOURCE_FLAGS += -no-compress +LIBS += $$QMAKE_LIBS_NETWORK diff --git a/tests/manual/network_stresstest/tst_network_stresstest.cpp b/tests/manual/network_stresstest/tst_network_stresstest.cpp index 0f2673e23c..38a516af82 100644 --- a/tests/manual/network_stresstest/tst_network_stresstest.cpp +++ b/tests/manual/network_stresstest/tst_network_stresstest.cpp @@ -338,13 +338,13 @@ void tst_NetworkStressTest::nativeNonBlockingConnectDisconnect() QVERIFY(fd != INVALID_SOCKET); // set the socket to non-blocking and start connecting - unsigned long buf = v; + unsigned long buf = 0; unsigned long outBuf; DWORD sizeWritten = 0; QVERIFY(::WSAIoctl(fd, FIONBIO, &buf, sizeof(unsigned long), &outBuf, sizeof(unsigned long), &sizeWritten, 0,0) != SOCKET_ERROR); while (true) { - int connectResult = ::WSAConnect(fd, sockAddrPtr, sockAddrSize, 0,0,0,0); + int connectResult = ::WSAConnect(fd, (sockaddr *)addr.data(), addr.size(), 0,0,0,0); if (connectResult == 0 || WSAGetLastError() == WSAEISCONN) { break; // connected } else { diff --git a/tests/manual/qdesktopwidget/main.cpp b/tests/manual/qdesktopwidget/main.cpp index d693d6b67d..32137d78e3 100644 --- a/tests/manual/qdesktopwidget/main.cpp +++ b/tests/manual/qdesktopwidget/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include class DesktopView : public QGraphicsView { diff --git a/tests/manual/qdesktopwidget/qdesktopwidget.pro b/tests/manual/qdesktopwidget/qdesktopwidget.pro index 93d56eb137..8979e7ef35 100644 --- a/tests/manual/qdesktopwidget/qdesktopwidget.pro +++ b/tests/manual/qdesktopwidget/qdesktopwidget.pro @@ -1,2 +1,3 @@ TEMPLATE = app +QT += widgets SOURCES += main.cpp diff --git a/tests/manual/qgraphicsitemgroup/main.cpp b/tests/manual/qgraphicsitemgroup/main.cpp index d60941da3a..d76a3a6334 100644 --- a/tests/manual/qgraphicsitemgroup/main.cpp +++ b/tests/manual/qgraphicsitemgroup/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "widget.h" int main(int argc, char *argv[]) diff --git a/tests/manual/qgraphicsitemgroup/qgraphicsitemgroup.pro b/tests/manual/qgraphicsitemgroup/qgraphicsitemgroup.pro index 6676a2e7c1..6135f74b8b 100644 --- a/tests/manual/qgraphicsitemgroup/qgraphicsitemgroup.pro +++ b/tests/manual/qgraphicsitemgroup/qgraphicsitemgroup.pro @@ -1,4 +1,5 @@ TARGET = qgraphicsitemgroup +QT += widgets TEMPLATE = app SOURCES += main.cpp \ widget.cpp \ diff --git a/tests/manual/qgraphicslayout/flicker/flicker.pro b/tests/manual/qgraphicslayout/flicker/flicker.pro index 2e09826022..d800418f85 100644 --- a/tests/manual/qgraphicslayout/flicker/flicker.pro +++ b/tests/manual/qgraphicslayout/flicker/flicker.pro @@ -1,2 +1,3 @@ +QT += widgets HEADERS += window.h SOURCES += main.cpp window.cpp diff --git a/tests/manual/qgraphicslayout/flicker/main.cpp b/tests/manual/qgraphicslayout/flicker/main.cpp index e71915c22f..2947930895 100644 --- a/tests/manual/qgraphicslayout/flicker/main.cpp +++ b/tests/manual/qgraphicslayout/flicker/main.cpp @@ -39,8 +39,7 @@ ** ****************************************************************************/ -#include -#include +#include #include "window.h" int main(int argc, char **argv) diff --git a/tests/manual/qgraphicslayout/flicker/window.h b/tests/manual/qgraphicslayout/flicker/window.h index 4930381641..3b032c3b45 100644 --- a/tests/manual/qgraphicslayout/flicker/window.h +++ b/tests/manual/qgraphicslayout/flicker/window.h @@ -43,7 +43,7 @@ #define WINDOW_H -#include +#include struct Statistics { Statistics() : output(0), diff --git a/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro b/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro index fd21007793..8e73add252 100644 --- a/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro +++ b/tests/manual/qhttpnetworkconnection/qhttpnetworkconnection.pro @@ -5,6 +5,4 @@ TARGET = tst_qhttpnetworkconnection QT -= gui QT += network testlib -CONFIG += release - SOURCES += main.cpp diff --git a/tests/manual/qimagereader/main.cpp b/tests/manual/qimagereader/main.cpp index 44cdc6ad36..e225c1bc0b 100644 --- a/tests/manual/qimagereader/main.cpp +++ b/tests/manual/qimagereader/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include class MyWidget : public QWidget { diff --git a/tests/manual/qimagereader/qimagereader.pro b/tests/manual/qimagereader/qimagereader.pro index 28dcadcbfa..3523257f3e 100644 --- a/tests/manual/qimagereader/qimagereader.pro +++ b/tests/manual/qimagereader/qimagereader.pro @@ -1 +1,2 @@ +QT += widgets SOURCES += main.cpp diff --git a/tests/manual/qlocale/calendar.cpp b/tests/manual/qlocale/calendar.cpp index e23af4fa49..122f57fa64 100644 --- a/tests/manual/qlocale/calendar.cpp +++ b/tests/manual/qlocale/calendar.cpp @@ -38,7 +38,7 @@ ** ****************************************************************************/ -#include +#include #include "calendar.h" diff --git a/tests/manual/qlocale/calendar.h b/tests/manual/qlocale/calendar.h index bf0d5efac3..7780e82bbf 100644 --- a/tests/manual/qlocale/calendar.h +++ b/tests/manual/qlocale/calendar.h @@ -41,7 +41,7 @@ #ifndef CALENDAR_H #define CALENDAR_H -#include +#include class CalendarWidget : public QWidget { diff --git a/tests/manual/qlocale/currency.h b/tests/manual/qlocale/currency.h index 1d3d536578..f722889600 100644 --- a/tests/manual/qlocale/currency.h +++ b/tests/manual/qlocale/currency.h @@ -41,7 +41,7 @@ #ifndef CURRENCY_H #define CURRENCY_H -#include +#include class CurrencyWidget : public QWidget { diff --git a/tests/manual/qlocale/dateformats.h b/tests/manual/qlocale/dateformats.h index 78ef62343a..9355475820 100644 --- a/tests/manual/qlocale/dateformats.h +++ b/tests/manual/qlocale/dateformats.h @@ -41,7 +41,7 @@ #ifndef DATEFORMATS_H #define DATEFORMATS_H -#include +#include class DateFormatsWidget : public QWidget { diff --git a/tests/manual/qlocale/info.h b/tests/manual/qlocale/info.h index 6cd7818feb..0c74dfb8ca 100644 --- a/tests/manual/qlocale/info.h +++ b/tests/manual/qlocale/info.h @@ -41,7 +41,7 @@ #ifndef INFO_H #define INFO_H -#include +#include class InfoWidget : public QWidget { diff --git a/tests/manual/qlocale/languages.h b/tests/manual/qlocale/languages.h index 6723e0ffa7..07a86f6898 100644 --- a/tests/manual/qlocale/languages.h +++ b/tests/manual/qlocale/languages.h @@ -41,7 +41,7 @@ #ifndef LANGUAGES_H #define LANGUAGES_H -#include +#include class LanguagesWidget : public QWidget { diff --git a/tests/manual/qlocale/main.cpp b/tests/manual/qlocale/main.cpp index 337dbb6ad3..8c4e2573d5 100644 --- a/tests/manual/qlocale/main.cpp +++ b/tests/manual/qlocale/main.cpp @@ -38,7 +38,7 @@ ** ****************************************************************************/ -#include +#include #include "window.h" diff --git a/tests/manual/qlocale/miscellaneous.h b/tests/manual/qlocale/miscellaneous.h index 2548f0d8f4..61ada8a00f 100644 --- a/tests/manual/qlocale/miscellaneous.h +++ b/tests/manual/qlocale/miscellaneous.h @@ -41,7 +41,7 @@ #ifndef MISCELLANEOUS_H #define MISCELLANEOUS_H -#include +#include class MiscWidget : public QWidget { diff --git a/tests/manual/qlocale/numberformats.h b/tests/manual/qlocale/numberformats.h index 8243d1177c..bcc352a818 100644 --- a/tests/manual/qlocale/numberformats.h +++ b/tests/manual/qlocale/numberformats.h @@ -41,7 +41,7 @@ #ifndef NUMBERFORMATS_H #define NUMBERFORMATS_H -#include +#include class NumberFormatsWidget : public QWidget { diff --git a/tests/manual/qlocale/qlocale.pro b/tests/manual/qlocale/qlocale.pro index 4eaddedcf0..a5a2766e65 100644 --- a/tests/manual/qlocale/qlocale.pro +++ b/tests/manual/qlocale/qlocale.pro @@ -1,2 +1,3 @@ +QT += widgets HEADERS += currency.h calendar.h dateformats.h numberformats.h languages.h window.h miscellaneous.h info.h SOURCES += currency.cpp main.cpp calendar.cpp dateformats.cpp numberformats.cpp languages.cpp window.cpp miscellaneous.cpp info.cpp diff --git a/tests/manual/qlocale/window.h b/tests/manual/qlocale/window.h index 1b2825aa5c..524ed97845 100644 --- a/tests/manual/qlocale/window.h +++ b/tests/manual/qlocale/window.h @@ -41,7 +41,7 @@ #ifndef WINDOW_H #define WINDOW_H -#include +#include #include "calendar.h" #include "currency.h" diff --git a/tests/manual/qnetworkaccessmanager/qget/qget.h b/tests/manual/qnetworkaccessmanager/qget/qget.h index bad4f5e4d2..978212dfa8 100644 --- a/tests/manual/qnetworkaccessmanager/qget/qget.h +++ b/tests/manual/qnetworkaccessmanager/qget/qget.h @@ -113,7 +113,9 @@ private slots: void finished(QNetworkReply *reply); void authenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator); void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator); +#ifndef QT_NO_SSL void sslErrors(QNetworkReply *reply, const QList &errors); +#endif void downloadFinished(TransferItem *item); private: TransferItem *findTransfer(QNetworkReply *reply); diff --git a/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro b/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro index 7ad271ce46..9e78f91621 100644 --- a/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro +++ b/tests/manual/qnetworkconfigurationmanager/qnetworkconfigurationmanager.pro @@ -5,6 +5,4 @@ TARGET = tst_qnetworkconfigurationmanager QT -= gui QT += network testlib -CONFIG += release - SOURCES += main.cpp diff --git a/tests/manual/qnetworkreply/qnetworkreply.pro b/tests/manual/qnetworkreply/qnetworkreply.pro index 17f48c6544..e29ea7856c 100644 --- a/tests/manual/qnetworkreply/qnetworkreply.pro +++ b/tests/manual/qnetworkreply/qnetworkreply.pro @@ -5,6 +5,4 @@ TARGET = tst_qnetworkreply QT -= gui QT += network testlib -CONFIG += release - SOURCES += main.cpp diff --git a/tests/manual/qtabletevent/device_information/device_information.pro b/tests/manual/qtabletevent/device_information/device_information.pro new file mode 100644 index 0000000000..727ad34bc1 --- /dev/null +++ b/tests/manual/qtabletevent/device_information/device_information.pro @@ -0,0 +1,6 @@ +QT += widgets +SOURCES += \ + main.cpp \ + tabletwidget.cpp +HEADERS += \ + tabletwidget.h diff --git a/tests/manual/qtabletevent/device_information/main.cpp b/tests/manual/qtabletevent/device_information/main.cpp index b4eea7875b..e551ae7d8a 100644 --- a/tests/manual/qtabletevent/device_information/main.cpp +++ b/tests/manual/qtabletevent/device_information/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "tabletwidget.h" int main(int argc, char **argv) { diff --git a/tests/manual/qtabletevent/device_information/qtabletevent.pro b/tests/manual/qtabletevent/device_information/qtabletevent.pro deleted file mode 100644 index 8251d73094..0000000000 --- a/tests/manual/qtabletevent/device_information/qtabletevent.pro +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES += \ - main.cpp \ - tabletwidget.cpp -HEADERS += \ - tabletwidget.h diff --git a/tests/manual/qtabletevent/event_compression/event_compression.pro b/tests/manual/qtabletevent/event_compression/event_compression.pro index fd2521e44f..15650d6190 100644 --- a/tests/manual/qtabletevent/event_compression/event_compression.pro +++ b/tests/manual/qtabletevent/event_compression/event_compression.pro @@ -1,4 +1,4 @@ -QT += testlib +QT += widgets testlib SOURCES += main.cpp \ mousestatwidget.cpp diff --git a/tests/manual/qtabletevent/qtabletevent.pro b/tests/manual/qtabletevent/qtabletevent.pro new file mode 100644 index 0000000000..9e9fc39654 --- /dev/null +++ b/tests/manual/qtabletevent/qtabletevent.pro @@ -0,0 +1,5 @@ +TEMPLATE=subdirs + +SUBDIRS = device_information \ + event_compression \ + regular_widgets diff --git a/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro b/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro index 9f0da76c11..8f1f4342ee 100644 --- a/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro +++ b/tests/manual/qtabletevent/regular_widgets/regular_widgets.pro @@ -1,3 +1,4 @@ TEMPLATE = app +QT += widgets SOURCES += main.cpp diff --git a/tests/manual/qtbug-8933/main.cpp b/tests/manual/qtbug-8933/main.cpp index d60941da3a..d76a3a6334 100644 --- a/tests/manual/qtbug-8933/main.cpp +++ b/tests/manual/qtbug-8933/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "widget.h" int main(int argc, char *argv[]) diff --git a/tests/manual/qtbug-8933/qtbug-8933.pro b/tests/manual/qtbug-8933/qtbug-8933.pro index 8b87c8346d..4600d47cac 100644 --- a/tests/manual/qtbug-8933/qtbug-8933.pro +++ b/tests/manual/qtbug-8933/qtbug-8933.pro @@ -6,7 +6,7 @@ TARGET = qtbug-8933 TEMPLATE = app - +QT += widgets SOURCES += main.cpp\ widget.cpp diff --git a/tests/manual/qtouchevent/main.cpp b/tests/manual/qtouchevent/main.cpp index 206413bfa2..80598e477b 100644 --- a/tests/manual/qtouchevent/main.cpp +++ b/tests/manual/qtouchevent/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include #include "ui_form.h" diff --git a/tests/manual/qtouchevent/qtouchevent.pro b/tests/manual/qtouchevent/qtouchevent.pro index de1ee06f9e..6339bceb42 100644 --- a/tests/manual/qtouchevent/qtouchevent.pro +++ b/tests/manual/qtouchevent/qtouchevent.pro @@ -1,4 +1,4 @@ -QT += testlib +QT += widgets testlib SOURCES = main.cpp \ touchwidget.cpp FORMS += form.ui diff --git a/tests/manual/qwidget_zorder/main.cpp b/tests/manual/qwidget_zorder/main.cpp index dadc089ce4..8c92ac86d7 100644 --- a/tests/manual/qwidget_zorder/main.cpp +++ b/tests/manual/qwidget_zorder/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include class Widget : public QWidget { diff --git a/tests/manual/qwidget_zorder/qwidget_zorder.pro b/tests/manual/qwidget_zorder/qwidget_zorder.pro index 28dcadcbfa..3523257f3e 100644 --- a/tests/manual/qwidget_zorder/qwidget_zorder.pro +++ b/tests/manual/qwidget_zorder/qwidget_zorder.pro @@ -1 +1,2 @@ +QT += widgets SOURCES += main.cpp diff --git a/tests/manual/repaint/mainwindow/main.cpp b/tests/manual/repaint/mainwindow/main.cpp index c6f0ac646f..08b600280a 100644 --- a/tests/manual/repaint/mainwindow/main.cpp +++ b/tests/manual/repaint/mainwindow/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "../shared/shared.h" int main(int argc, char **argv) diff --git a/tests/manual/repaint/mainwindow/mainwindow.pro b/tests/manual/repaint/mainwindow/mainwindow.pro index db6b2d280c..f20e5fe402 100644 --- a/tests/manual/repaint/mainwindow/mainwindow.pro +++ b/tests/manual/repaint/mainwindow/mainwindow.pro @@ -1,2 +1,3 @@ +QT += widgets HEADERS += ../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/repaint/repaint.pro b/tests/manual/repaint/repaint.pro new file mode 100644 index 0000000000..7ad9d68260 --- /dev/null +++ b/tests/manual/repaint/repaint.pro @@ -0,0 +1,9 @@ +TEMPLATE=subdirs + +SUBDIRS = mainwindow \ + scrollarea \ + splitter \ + tableview \ + task141091 \ + toplevel \ + widget diff --git a/tests/manual/repaint/scrollarea/main.cpp b/tests/manual/repaint/scrollarea/main.cpp index 63fb755510..06d598d46b 100644 --- a/tests/manual/repaint/scrollarea/main.cpp +++ b/tests/manual/repaint/scrollarea/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "../shared/shared.h" diff --git a/tests/manual/repaint/scrollarea/scrollarea.pro b/tests/manual/repaint/scrollarea/scrollarea.pro index db6b2d280c..f20e5fe402 100644 --- a/tests/manual/repaint/scrollarea/scrollarea.pro +++ b/tests/manual/repaint/scrollarea/scrollarea.pro @@ -1,2 +1,3 @@ +QT += widgets HEADERS += ../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/repaint/shared/shared.h b/tests/manual/repaint/shared/shared.h index 861d4178aa..3489c30cd8 100644 --- a/tests/manual/repaint/shared/shared.h +++ b/tests/manual/repaint/shared/shared.h @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include class StaticWidget : public QWidget { Q_OBJECT diff --git a/tests/manual/repaint/splitter/main.cpp b/tests/manual/repaint/splitter/main.cpp index 2c4ca1d4f3..d260f00bf1 100644 --- a/tests/manual/repaint/splitter/main.cpp +++ b/tests/manual/repaint/splitter/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "../shared/shared.h" int main(int argc, char **argv) diff --git a/tests/manual/repaint/splitter/splitter.pro b/tests/manual/repaint/splitter/splitter.pro index db6b2d280c..f20e5fe402 100644 --- a/tests/manual/repaint/splitter/splitter.pro +++ b/tests/manual/repaint/splitter/splitter.pro @@ -1,2 +1,3 @@ +QT += widgets HEADERS += ../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/repaint/tableview/main.cpp b/tests/manual/repaint/tableview/main.cpp index dc25858681..227237a5e7 100644 --- a/tests/manual/repaint/tableview/main.cpp +++ b/tests/manual/repaint/tableview/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "../shared/shared.h" class CellWidget : public QWidget diff --git a/tests/manual/repaint/tableview/tableview.pro b/tests/manual/repaint/tableview/tableview.pro index 4097c95739..6a5aaad251 100644 --- a/tests/manual/repaint/tableview/tableview.pro +++ b/tests/manual/repaint/tableview/tableview.pro @@ -1,2 +1,3 @@ +QT += widgets HEADERS +=../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/repaint/task141091/main.cpp b/tests/manual/repaint/task141091/main.cpp index b2f639d411..9090a2a29d 100644 --- a/tests/manual/repaint/task141091/main.cpp +++ b/tests/manual/repaint/task141091/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include class MyWidget : public QWidget diff --git a/tests/manual/repaint/task141091/task141091.pro b/tests/manual/repaint/task141091/task141091.pro index 82ead4b6c2..b54299e540 100644 --- a/tests/manual/repaint/task141091/task141091.pro +++ b/tests/manual/repaint/task141091/task141091.pro @@ -1,3 +1,3 @@ CONFIG += console - +QT += widgets SOURCES += main.cpp diff --git a/tests/manual/repaint/toplevel/main.cpp b/tests/manual/repaint/toplevel/main.cpp index cd43fa699c..6466fe80b2 100644 --- a/tests/manual/repaint/toplevel/main.cpp +++ b/tests/manual/repaint/toplevel/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "../shared/shared.h" int main(int argc, char **argv) diff --git a/tests/manual/repaint/toplevel/toplevel.pro b/tests/manual/repaint/toplevel/toplevel.pro index c2cc19f67d..a881c24f56 100644 --- a/tests/manual/repaint/toplevel/toplevel.pro +++ b/tests/manual/repaint/toplevel/toplevel.pro @@ -1,4 +1,5 @@ CONFIG += console +QT += widgets HEADERS += ../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/repaint/widget/main.cpp b/tests/manual/repaint/widget/main.cpp index 64b9cc8a18..3ea557a642 100644 --- a/tests/manual/repaint/widget/main.cpp +++ b/tests/manual/repaint/widget/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include #include "../shared/shared.h" class Child : public StaticWidget diff --git a/tests/manual/repaint/widget/widget.pro b/tests/manual/repaint/widget/widget.pro index db6b2d280c..f20e5fe402 100644 --- a/tests/manual/repaint/widget/widget.pro +++ b/tests/manual/repaint/widget/widget.pro @@ -1,2 +1,3 @@ +QT += widgets HEADERS += ../shared/shared.h SOURCES += main.cpp diff --git a/tests/manual/socketengine/main.cpp b/tests/manual/socketengine/main.cpp index 48893f062d..349004a7d0 100644 --- a/tests/manual/socketengine/main.cpp +++ b/tests/manual/socketengine/main.cpp @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include @@ -97,7 +96,7 @@ int main(int argc, char**argv) // disconnected exit(0); } - bzero(buf, bufsize); + qFill(buf, buf + bufsize, 0); ret = socketEngine->read(buf, available); if (ret > 0) { printf("%s", buf); diff --git a/tests/manual/socketengine/socketengine.pro b/tests/manual/socketengine/socketengine.pro index 808502c22a..96831383ec 100644 --- a/tests/manual/socketengine/socketengine.pro +++ b/tests/manual/socketengine/socketengine.pro @@ -3,8 +3,6 @@ TEMPLATE = app TARGET = tst_socketengine QT -= gui -QT += network testlib - -CONFIG += release +QT += network-private core-private testlib SOURCES += main.cpp diff --git a/tests/manual/textrendering/glyphshaping/glyphshaping.pro b/tests/manual/textrendering/glyphshaping/glyphshaping.pro index 1d78aa3351..6500814423 100644 --- a/tests/manual/textrendering/glyphshaping/glyphshaping.pro +++ b/tests/manual/textrendering/glyphshaping/glyphshaping.pro @@ -1,3 +1,4 @@ +QT += widgets SOURCES = main.cpp OTHER_FILES = glyphshaping_data.xml glyphshaping_data.path = . diff --git a/tests/manual/textrendering/glyphshaping/main.cpp b/tests/manual/textrendering/glyphshaping/main.cpp index c41301f3fc..5a8cc4f12b 100644 --- a/tests/manual/textrendering/glyphshaping/main.cpp +++ b/tests/manual/textrendering/glyphshaping/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include static const int fontPixelSize = 25; static const QLatin1String fontFamily("Series 60 Sans"); diff --git a/tests/manual/textrendering/textperformance/main.cpp b/tests/manual/textrendering/textperformance/main.cpp index c6a0c73849..cff0c1afad 100644 --- a/tests/manual/textrendering/textperformance/main.cpp +++ b/tests/manual/textrendering/textperformance/main.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include +#include static const int lastMeasurementsCount = 50; diff --git a/tests/manual/textrendering/textperformance/textperformance.pro b/tests/manual/textrendering/textperformance/textperformance.pro index bba41b9c12..f07a4f0294 100644 --- a/tests/manual/textrendering/textperformance/textperformance.pro +++ b/tests/manual/textrendering/textperformance/textperformance.pro @@ -1 +1,2 @@ +QT += widgets SOURCES = main.cpp diff --git a/tests/manual/textrendering/textrendering.pro b/tests/manual/textrendering/textrendering.pro new file mode 100644 index 0000000000..92f0741bf3 --- /dev/null +++ b/tests/manual/textrendering/textrendering.pro @@ -0,0 +1,4 @@ +TEMPLATE=subdirs + +SUBDIRS = glyphshaping \ + textperformance diff --git a/tests/manual/widgets/itemviews/delegate/delegate.pro b/tests/manual/widgets/itemviews/delegate/delegate.pro new file mode 100644 index 0000000000..e5c90f18ec --- /dev/null +++ b/tests/manual/widgets/itemviews/delegate/delegate.pro @@ -0,0 +1,3 @@ +TEMPLATE = app +QT += widgets +SOURCES=example.cpp diff --git a/tests/manual/widgets/itemviews/delegate/example.pro b/tests/manual/widgets/itemviews/delegate/example.pro deleted file mode 100644 index e9f2189272..0000000000 --- a/tests/manual/widgets/itemviews/delegate/example.pro +++ /dev/null @@ -1,2 +0,0 @@ -TEMPLATE = app -SOURCES=example.cpp diff --git a/tests/manual/windowflags/controllerwindow.cpp b/tests/manual/windowflags/controllerwindow.cpp index 69535b2856..586691a37d 100644 --- a/tests/manual/windowflags/controllerwindow.cpp +++ b/tests/manual/windowflags/controllerwindow.cpp @@ -39,7 +39,14 @@ ** ****************************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include +#include #include "controllerwindow.h" @@ -72,7 +79,8 @@ ControllerWindow::ControllerWindow() mainLayout->addLayout(bottomLayout); setLayout(mainLayout); - setWindowTitle(tr("Window Flags")); + setWindowTitle(tr("Window Flags (Qt version %1, %2)") + .arg(QLatin1String(qVersion()), qApp->platformName())); updatePreview(); } diff --git a/tests/manual/windowflags/previewwindow.cpp b/tests/manual/windowflags/previewwindow.cpp index 601cc50efa..684d1ee1fe 100644 --- a/tests/manual/windowflags/previewwindow.cpp +++ b/tests/manual/windowflags/previewwindow.cpp @@ -39,7 +39,9 @@ ** ****************************************************************************/ -#include +#include +#include +#include #include "previewwindow.h" diff --git a/tests/manual/windowflags/windowflags.pro b/tests/manual/windowflags/windowflags.pro index 1b45d0d867..06def212b3 100644 --- a/tests/manual/windowflags/windowflags.pro +++ b/tests/manual/windowflags/windowflags.pro @@ -1,3 +1,5 @@ +QT += widgets + HEADERS = controllerwindow.h \ previewwindow.h SOURCES = controllerwindow.cpp \ diff --git a/tests/manual/windowmodality/modality.pro b/tests/manual/windowmodality/modality.pro deleted file mode 100644 index 973579c508..0000000000 --- a/tests/manual/windowmodality/modality.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = main.cpp -FORMS = widget.ui dialog.ui -QT += widgets printsupport diff --git a/tests/manual/windowmodality/windowmodality.pro b/tests/manual/windowmodality/windowmodality.pro new file mode 100644 index 0000000000..973579c508 --- /dev/null +++ b/tests/manual/windowmodality/windowmodality.pro @@ -0,0 +1,3 @@ +SOURCES = main.cpp +FORMS = widget.ui dialog.ui +QT += widgets printsupport -- cgit v1.2.3 From 4fac40f8b0e7b2a6f5f41eb82196e8b197bc851a Mon Sep 17 00:00:00 2001 From: Kevin Krammer Date: Tue, 10 Apr 2012 11:26:12 +0200 Subject: Refactor navigator event handling Separate PPS based navigator event notification handling and implementation of the actual event handling. Like the similar refactoring for screen events, this will allow to reuse the same event handler class for BPS driven event processing. Change-Id: I29d4a082cb01ff7943b7822ea9aa8ad622fda593 Reviewed-by: Thomas McGuire Reviewed-by: Sean Harmer Reviewed-by: Robin Burchell --- src/plugins/platforms/qnx/qnx.pro | 3 + src/plugins/platforms/qnx/qqnxintegration.cpp | 18 +- src/plugins/platforms/qnx/qqnxintegration.h | 2 + .../platforms/qnx/qqnxnavigatoreventhandler.cpp | 210 +++---------------- .../platforms/qnx/qqnxnavigatoreventhandler.h | 24 +-- .../platforms/qnx/qqnxnavigatoreventnotifier.cpp | 233 +++++++++++++++++++++ .../platforms/qnx/qqnxnavigatoreventnotifier.h | 77 +++++++ 7 files changed, 357 insertions(+), 210 deletions(-) create mode 100644 src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp create mode 100644 src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.h diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro index bdc8c38614..82c3b201c9 100644 --- a/src/plugins/platforms/qnx/qnx.pro +++ b/src/plugins/platforms/qnx/qnx.pro @@ -17,6 +17,7 @@ QT += opengl opengl-private platformsupport platformsupport-private widgets-priv #DEFINES += QQNXINPUTCONTEXT_IMF_EVENT_DEBUG #DEFINES += QQNXINTEGRATION_DEBUG #DEFINES += QQNXNAVIGATOREVENTHANDLER_DEBUG +#DEFINES += QQNXNAVIGATOREVENTNOTIFIER_DEBUG #DEFINES += QQNXRASTERBACKINGSTORE_DEBUG #DEFINES += QQNXROOTWINDOW_DEBUG #DEFINES += QQNXSCREEN_DEBUG @@ -31,6 +32,7 @@ SOURCES = main.cpp \ qqnxglbackingstore.cpp \ qqnxintegration.cpp \ qqnxnavigatoreventhandler.cpp \ + qqnxnavigatoreventnotifier.cpp \ qqnxscreen.cpp \ qqnxwindow.cpp \ qqnxrasterbackingstore.cpp \ @@ -46,6 +48,7 @@ HEADERS = qqnxbuffer.h \ qqnxkeytranslator.h \ qqnxintegration.h \ qqnxnavigatoreventhandler.h \ + qqnxnavigatoreventnotifier.h \ qqnxglcontext.h \ qqnxglbackingstore.h \ qqnxscreen.h \ diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp index f12073e367..b4112999b6 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.cpp +++ b/src/plugins/platforms/qnx/qqnxintegration.cpp @@ -45,6 +45,7 @@ #include "qqnxglcontext.h" #include "qqnxnativeinterface.h" #include "qqnxnavigatoreventhandler.h" +#include "qqnxnavigatoreventnotifier.h" #include "qqnxrasterbackingstore.h" #include "qqnxscreen.h" #include "qqnxscreeneventhandler.h" @@ -80,7 +81,8 @@ QMutex QQnxIntegration::ms_windowMapperMutex; QQnxIntegration::QQnxIntegration() : QPlatformIntegration() , m_eventThread(0) - , m_navigatorEventHandler(0) + , m_navigatorEventHandler(new QQnxNavigatorEventHandler()) + , m_navigatorEventNotifier(0) , m_virtualKeyboard(0) , m_inputContext(0) , m_fontDatabase(new QGenericUnixFontDatabase()) @@ -103,12 +105,12 @@ QQnxIntegration::QQnxIntegration() qFatal("QQnx: failed to connect to composition manager, errno=%d", errno); } - // Create/start navigator event handler - m_navigatorEventHandler = new QQnxNavigatorEventHandler; + // Create/start navigator event notifier + m_navigatorEventNotifier = new QQnxNavigatorEventNotifier(m_navigatorEventHandler); // delay invocation of start() to the time the event loop is up and running // needed to have the QThread internals of the main thread properly initialized - QMetaObject::invokeMethod(m_navigatorEventHandler, "start", Qt::QueuedConnection); + QMetaObject::invokeMethod(m_navigatorEventNotifier, "start", Qt::QueuedConnection); // Create displays for all possible screens (which may not be attached) createDisplays(); @@ -160,12 +162,12 @@ QQnxIntegration::~QQnxIntegration() delete m_clipboard; #endif - // Stop/destroy event thread - delete m_eventThread; - - // Stop/destroy navigator thread + // Stop/destroy navigator event notifier + delete m_navigatorEventNotifier; delete m_navigatorEventHandler; + // Stop/destroy event thread + delete m_eventThread; delete m_screenEventHandler; // Destroy all displays diff --git a/src/plugins/platforms/qnx/qqnxintegration.h b/src/plugins/platforms/qnx/qqnxintegration.h index f29baf1323..801bd7b6e5 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.h +++ b/src/plugins/platforms/qnx/qqnxintegration.h @@ -54,6 +54,7 @@ class QQnxEventThread; class QQnxInputContext; class QQnxNativeInterface; class QQnxNavigatorEventHandler; +class QQnxNavigatorEventNotifier; class QQnxAbstractVirtualKeyboard; class QQnxWindow; class QQnxServices; @@ -112,6 +113,7 @@ private: screen_context_t m_screenContext; QQnxEventThread *m_eventThread; QQnxNavigatorEventHandler *m_navigatorEventHandler; + QQnxNavigatorEventNotifier *m_navigatorEventNotifier; QQnxAbstractVirtualKeyboard *m_virtualKeyboard; QQnxInputContext *m_inputContext; QPlatformFontDatabase *m_fontDatabase; diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp index 9527a57ca3..72227c6089 100644 --- a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp +++ b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.cpp @@ -1,6 +1,6 @@ /*************************************************************************** ** -** Copyright (C) 2011 - 2012 Research In Motion +** Copyright (C) 2012 Research In Motion ** Contact: http://www.qt-project.org/ ** ** This file is part of the plugins of the Qt Toolkit. @@ -41,216 +41,58 @@ #include "qqnxnavigatoreventhandler.h" -#include -#include -#include +#include +#include +#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -static const char *navigatorControlPath = "/pps/services/navigator/control"; -static const int ppsBufferSize = 4096; +QT_BEGIN_NAMESPACE QQnxNavigatorEventHandler::QQnxNavigatorEventHandler(QObject *parent) - : QObject(parent), - m_fd(-1), - m_readNotifier(0) -{ -} - -QQnxNavigatorEventHandler::~QQnxNavigatorEventHandler() + : QObject(parent) { - delete m_readNotifier; - - // close connection to navigator - if (m_fd != -1) - close(m_fd); - -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "QQNX: navigator event handler stopped"; -#endif } -void QQnxNavigatorEventHandler::start() +bool QQnxNavigatorEventHandler::handleOrientationCheck(int angle) { + // reply to navigator that (any) orientation is acceptable #if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "QQNX: navigator event handler started"; + qDebug() << Q_FUNC_INFO << "angle=" << angle; #endif - // open connection to navigator - errno = 0; - m_fd = open(navigatorControlPath, O_RDWR); - if (m_fd == -1) { - qWarning("QQNX: failed to open navigator pps, errno=%d", errno); - return; - } - - m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read); - connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(readData())); + // TODO: check if top window flags prohibit orientation change + return true; } -void QQnxNavigatorEventHandler::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id) +void QQnxNavigatorEventHandler::handleOrientationChange(int angle) { + // update screen geometry and reply to navigator that we're ready #if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: data=" << ppsData; -#endif - - // tokenize pps data into lines - QList lines = ppsData.split('\n'); - - // validate pps object - if (lines.size() == 0 || lines.at(0) != "@control") { - qFatal("QQNX: unrecognized pps object, data=%s", ppsData.constData()); - } - - // parse pps object attributes and extract values - for (int i = 1; i < lines.size(); i++) { - - // tokenize current attribute - const QByteArray &attr = lines.at(i); - -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: attr=" << attr; -#endif - - int firstColon = attr.indexOf(':'); - if (firstColon == -1) { - // abort - malformed attribute - continue; - } - - int secondColon = attr.indexOf(':', firstColon + 1); - if (secondColon == -1) { - // abort - malformed attribute - continue; - } - - QByteArray key = attr.left(firstColon); - QByteArray value = attr.mid(secondColon + 1); - -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: key=" << key; - qDebug() << "PPS: val=" << value; + qDebug() << Q_FUNC_INFO << "angle=" << angle; #endif - // save attribute value - if (key == "msg") { - msg = value; - } else if (key == "dat") { - dat = value; - } else if (key == "id") { - id = value; - } else { - qFatal("QQNX: unrecognized pps attribute, attr=%s", key.constData()); - } - } + emit rotationChanged(angle); } -void QQnxNavigatorEventHandler::replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat) +void QQnxNavigatorEventHandler::handleSwipeDown() { - // construct pps message - QByteArray ppsData = "res::"; - ppsData += res; - ppsData += "\nid::"; - ppsData += id; - if (!dat.isEmpty()) { - ppsData += "\ndat::"; - ppsData += dat; - } - ppsData += "\n"; - + // simulate menu key press #if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS reply=" << ppsData; + qDebug() << Q_FUNC_INFO; #endif - // send pps message to navigator - errno = 0; - int bytes = write(m_fd, ppsData.constData(), ppsData.size()); - if (bytes == -1) { - qFatal("QQNX: failed to write navigator pps, errno=%d", errno); - } + QWindow *w = QGuiApplication::focusWindow(); + QWindowSystemInterface::handleKeyEvent(w, QEvent::KeyPress, Qt::Key_Menu, Qt::NoModifier); + QWindowSystemInterface::handleKeyEvent(w, QEvent::KeyRelease, Qt::Key_Menu, Qt::NoModifier); } -void QQnxNavigatorEventHandler::handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id) +void QQnxNavigatorEventHandler::handleExit() { + // shutdown everything #if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: msg=" << msg << ", dat=" << dat << ", id=" << id; + qDebug() << Q_FUNC_INFO; #endif - // check message type - if (msg == "orientationCheck") { - - // reply to navigator that (any) orientation is acceptable -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: orientation check, o=" << dat; -#endif - replyPPS(msg, id, "true"); - - } else if (msg == "orientation") { - - // update screen geometry and reply to navigator that we're ready -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: orientation, o=" << dat; -#endif - Q_EMIT rotationChanged(dat.toInt()); - replyPPS(msg, id, ""); - - } else if (msg == "SWIPE_DOWN") { - - // simulate menu key press -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: menu"; -#endif - QWindow *w = QGuiApplication::focusWindow(); - QWindowSystemInterface::handleKeyEvent(w, QEvent::KeyPress, Qt::Key_Menu, Qt::NoModifier); - QWindowSystemInterface::handleKeyEvent(w, QEvent::KeyRelease, Qt::Key_Menu, Qt::NoModifier); - - } else if (msg == "exit") { - - // shutdown everything -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "PPS: exit"; -#endif - QCoreApplication::quit(); - } + QCoreApplication::quit(); } -void QQnxNavigatorEventHandler::readData() -{ -#if defined(QQNXNAVIGATOREVENTHANDLER_DEBUG) - qDebug() << "QQNX: reading navigator data"; -#endif - // allocate buffer for pps data - char buffer[ppsBufferSize]; - - // attempt to read pps data - errno = 0; - int bytes = qt_safe_read(m_fd, buffer, ppsBufferSize - 1); - if (bytes == -1) { - qFatal("QQNX: failed to read navigator pps, errno=%d", errno); - } - - // check if pps data was received - if (bytes > 0) { - - // ensure data is null terminated - buffer[bytes] = '\0'; - - // process received message - QByteArray ppsData(buffer); - QByteArray msg; - QByteArray dat; - QByteArray id; - parsePPS(ppsData, msg, dat, id); - handleMessage(msg, dat, id); - } -} +QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h index 8084eba1d9..58a1ac8cb3 100644 --- a/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h +++ b/src/plugins/platforms/qnx/qqnxnavigatoreventhandler.h @@ -1,6 +1,6 @@ /*************************************************************************** ** -** Copyright (C) 2011 - 2012 Research In Motion +** Copyright (C) 2012 Research In Motion ** Contact: http://www.qt-project.org/ ** ** This file is part of the plugins of the Qt Toolkit. @@ -46,31 +46,19 @@ QT_BEGIN_NAMESPACE -class QSocketNotifier; - class QQnxNavigatorEventHandler : public QObject { Q_OBJECT public: explicit QQnxNavigatorEventHandler(QObject *parent = 0); - ~QQnxNavigatorEventHandler(); + + bool handleOrientationCheck(int angle); + void handleOrientationChange(int angle); + void handleSwipeDown(); + void handleExit(); Q_SIGNALS: void rotationChanged(int angle); - -public Q_SLOTS: - void start(); - -private Q_SLOTS: - void readData(); - -private: - void parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id); - void replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat); - void handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id); - - int m_fd; - QSocketNotifier *m_readNotifier; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp new file mode 100644 index 0000000000..d5220c936e --- /dev/null +++ b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp @@ -0,0 +1,233 @@ +/*************************************************************************** +** +** Copyright (C) 2011 - 2012 Research In Motion +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qqnxnavigatoreventnotifier.h" + +#include "qqnxnavigatoreventhandler.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +static const char *navigatorControlPath = "/pps/services/navigator/control"; +static const int ppsBufferSize = 4096; + +QT_BEGIN_NAMESPACE + +QQnxNavigatorEventNotifier::QQnxNavigatorEventNotifier(QQnxNavigatorEventHandler *eventHandler, QObject *parent) + : QObject(parent), + m_fd(-1), + m_readNotifier(0), + m_eventHandler(eventHandler) +{ +} + +QQnxNavigatorEventNotifier::~QQnxNavigatorEventNotifier() +{ + delete m_readNotifier; + + // close connection to navigator + if (m_fd != -1) + close(m_fd); + +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "QQNX: navigator event notifier stopped"; +#endif +} + +void QQnxNavigatorEventNotifier::start() +{ +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "QQNX: navigator event notifier started"; +#endif + + // open connection to navigator + errno = 0; + m_fd = open(navigatorControlPath, O_RDWR); + if (m_fd == -1) { + qWarning("QQNX: failed to open navigator pps, errno=%d", errno); + return; + } + + m_readNotifier = new QSocketNotifier(m_fd, QSocketNotifier::Read); + connect(m_readNotifier, SIGNAL(activated(int)), this, SLOT(readData())); +} + +void QQnxNavigatorEventNotifier::parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id) +{ +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "PPS: data=" << ppsData; +#endif + + // tokenize pps data into lines + QList lines = ppsData.split('\n'); + + // validate pps object + if (lines.size() == 0 || lines.at(0) != "@control") + qFatal("QQNX: unrecognized pps object, data=%s", ppsData.constData()); + + // parse pps object attributes and extract values + for (int i = 1; i < lines.size(); ++i) { + + // tokenize current attribute + const QByteArray &attr = lines.at(i); + +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "PPS: attr=" << attr; +#endif + + int firstColon = attr.indexOf(':'); + if (firstColon == -1) { + // abort - malformed attribute + continue; + } + + int secondColon = attr.indexOf(':', firstColon + 1); + if (secondColon == -1) { + // abort - malformed attribute + continue; + } + + QByteArray key = attr.left(firstColon); + QByteArray value = attr.mid(secondColon + 1); + +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "PPS: key=" << key; + qDebug() << "PPS: val=" << value; +#endif + + // save attribute value + if (key == "msg") + msg = value; + else if (key == "dat") + dat = value; + else if (key == "id") + id = value; + else + qFatal("QQNX: unrecognized pps attribute, attr=%s", key.constData()); + } +} + +void QQnxNavigatorEventNotifier::replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat) +{ + // construct pps message + QByteArray ppsData = "res::"; + ppsData += res; + ppsData += "\nid::"; + ppsData += id; + if (!dat.isEmpty()) { + ppsData += "\ndat::"; + ppsData += dat; + } + ppsData += "\n"; + +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "PPS reply=" << ppsData; +#endif + + // send pps message to navigator + errno = 0; + int bytes = write(m_fd, ppsData.constData(), ppsData.size()); + if (bytes == -1) + qFatal("QQNX: failed to write navigator pps, errno=%d", errno); +} + +void QQnxNavigatorEventNotifier::handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id) +{ +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "PPS: msg=" << msg << ", dat=" << dat << ", id=" << id; +#endif + + // check message type + if (msg == "orientationCheck") { + const bool response = m_eventHandler->handleOrientationCheck(dat.toInt()); + + // reply to navigator that (any) orientation is acceptable + replyPPS(msg, id, response ? "true" : "false"); + } else if (msg == "orientation") { + m_eventHandler->handleOrientationChange(dat.toInt()); + replyPPS(msg, id, ""); + } else if (msg == "SWIPE_DOWN") { + m_eventHandler->handleSwipeDown(); + } else if (msg == "exit") { + m_eventHandler->handleExit(); + } +} + +void QQnxNavigatorEventNotifier::readData() +{ +#if defined(QQNXNAVIGATOREVENTNOTIFIER_DEBUG) + qDebug() << "QQNX: reading navigator data"; +#endif + // allocate buffer for pps data + char buffer[ppsBufferSize]; + + // attempt to read pps data + errno = 0; + int bytes = qt_safe_read(m_fd, buffer, ppsBufferSize - 1); + if (bytes == -1) + qFatal("QQNX: failed to read navigator pps, errno=%d", errno); + + // check if pps data was received + if (bytes > 0) { + + // ensure data is null terminated + buffer[bytes] = '\0'; + + // process received message + QByteArray ppsData(buffer); + QByteArray msg; + QByteArray dat; + QByteArray id; + parsePPS(ppsData, msg, dat, id); + handleMessage(msg, dat, id); + } +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.h b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.h new file mode 100644 index 0000000000..bdf1220b56 --- /dev/null +++ b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.h @@ -0,0 +1,77 @@ +/*************************************************************************** +** +** Copyright (C) 2011 - 2012 Research In Motion +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QQNXNAVIGATOREVENTNOTIFIER_H +#define QQNXNAVIGATOREVENTNOTIFIER_H + +#include + +QT_BEGIN_NAMESPACE + +class QQnxNavigatorEventHandler; +class QSocketNotifier; + +class QQnxNavigatorEventNotifier : public QObject +{ + Q_OBJECT +public: + explicit QQnxNavigatorEventNotifier(QQnxNavigatorEventHandler *eventHandler, QObject *parent = 0); + ~QQnxNavigatorEventNotifier(); + +public Q_SLOTS: + void start(); + +private Q_SLOTS: + void readData(); + +private: + void parsePPS(const QByteArray &ppsData, QByteArray &msg, QByteArray &dat, QByteArray &id); + void replyPPS(const QByteArray &res, const QByteArray &id, const QByteArray &dat); + void handleMessage(const QByteArray &msg, const QByteArray &dat, const QByteArray &id); + + int m_fd; + QSocketNotifier *m_readNotifier; + QQnxNavigatorEventHandler *m_eventHandler; +}; + +QT_END_NAMESPACE + +#endif // QQNXNAVIGATOREVENTNOTIFIER_H -- cgit v1.2.3 From 0ac019111137b13788468ddb3c020302f1a25038 Mon Sep 17 00:00:00 2001 From: Alberto Mardegan Date: Sun, 18 Dec 2011 19:19:29 +0200 Subject: Fix QScroller diagonal scrolling Compute the time needed for the scrolling operation before computing the movement on the X and Y components. This ensures (except when overshooting or snapping to snap points) that the scrolling on the X and Y components takes the same time. That is, scrolling occurs always along a straight line. Task-number: QTBUG-23227 Change-Id: Ic3b78b8611dbcbf19711c3dd96485a0d53accaed Reviewed-by: Robin Burchell --- src/widgets/util/qscroller.cpp | 63 ++++++++++++++++++++++++++---------------- src/widgets/util/qscroller_p.h | 5 +++- 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp index 4482134c7b..e39ed9c0a5 100644 --- a/src/widgets/util/qscroller.cpp +++ b/src/widgets/util/qscroller.cpp @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -1160,11 +1161,10 @@ void QScrollerPrivate::recalcScrollingSegments(bool forceRecalc) releaseVelocity = q->velocity(); - if (forceRecalc || !scrollingSegmentsValid(Qt::Horizontal)) - createScrollingSegments(releaseVelocity.x(), contentPosition.x() + overshootPosition.x(), ppm.x(), Qt::Horizontal); - - if (forceRecalc || !scrollingSegmentsValid(Qt::Vertical)) - createScrollingSegments(releaseVelocity.y(), contentPosition.y() + overshootPosition.y(), ppm.y(), Qt::Vertical); + if (forceRecalc || + !scrollingSegmentsValid(Qt::Horizontal) || + !scrollingSegmentsValid(Qt::Vertical)) + createScrollingSegments(releaseVelocity, contentPosition + overshootPosition, ppm); } /*! \internal @@ -1256,7 +1256,9 @@ void QScrollerPrivate::createScrollToSegments(qreal v, qreal deltaTime, qreal en /*! \internal */ -void QScrollerPrivate::createScrollingSegments(qreal v, qreal startPos, qreal ppm, Qt::Orientation orientation) +void QScrollerPrivate::createScrollingSegments(qreal v, qreal startPos, + qreal deltaTime, qreal deltaPos, + Qt::Orientation orientation) { const QScrollerPropertiesPrivate *sp = properties.d.data(); @@ -1287,22 +1289,6 @@ void QScrollerPrivate::createScrollingSegments(qreal v, qreal startPos, qreal pp qScrollerDebug() << "v = " << v << ", decelerationFactor = " << sp->decelerationFactor << ", curveType = " << sp->scrollingCurve.type(); - // This is only correct for QEasingCurve::OutQuad (linear velocity, - // constant deceleration), but the results look and feel ok for OutExpo - // and OutSine as well - - // v(t) = deltaTime * a * 0.5 * differentialForProgress(t / deltaTime) - // v(0) = vrelease - // v(deltaTime) = 0 - // deltaTime = (2 * vrelease) / (a * differntial(0)) - - // pos(t) = integrate(v(t)dt) - // pos(t) = vrelease * t - 0.5 * a * t * t - // pos(t) = deltaTime * a * 0.5 * progress(t / deltaTime) * deltaTime - // deltaPos = pos(deltaTime) - - qreal deltaTime = (qreal(2) * qAbs(v)) / (sp->decelerationFactor * differentialForProgress(sp->scrollingCurve, 0)); - qreal deltaPos = qSign(v) * deltaTime * deltaTime * qreal(0.5) * sp->decelerationFactor * ppm; qreal endPos = startPos + deltaPos; qScrollerDebug() << " Real Delta:" << deltaPos; @@ -1414,6 +1400,36 @@ void QScrollerPrivate::createScrollingSegments(qreal v, qreal startPos, qreal pp } +void QScrollerPrivate::createScrollingSegments(const QPointF &v, + const QPointF &startPos, + const QPointF &ppm) +{ + const QScrollerPropertiesPrivate *sp = properties.d.data(); + + // This is only correct for QEasingCurve::OutQuad (linear velocity, + // constant deceleration), but the results look and feel ok for OutExpo + // and OutSine as well + + // v(t) = deltaTime * a * 0.5 * differentialForProgress(t / deltaTime) + // v(0) = vrelease + // v(deltaTime) = 0 + // deltaTime = (2 * vrelease) / (a * differntial(0)) + + // pos(t) = integrate(v(t)dt) + // pos(t) = vrelease * t - 0.5 * a * t * t + // pos(t) = deltaTime * a * 0.5 * progress(t / deltaTime) * deltaTime + // deltaPos = pos(deltaTime) + + QVector2D vel(v); + qreal deltaTime = (qreal(2) * vel.length()) / (sp->decelerationFactor * differentialForProgress(sp->scrollingCurve, 0)); + QPointF deltaPos = (vel.normalized() * QVector2D(ppm)).toPointF() * deltaTime * deltaTime * qreal(0.5) * sp->decelerationFactor; + + createScrollingSegments(v.x(), startPos.x(), deltaTime, deltaPos.x(), + Qt::Horizontal); + createScrollingSegments(v.y(), startPos.y(), deltaTime, deltaPos.y(), + Qt::Vertical); +} + /*! \internal Prepares scrolling by sending a QScrollPrepareEvent to the receiver widget. Returns true if the scrolling was accepted and a target was returned. @@ -1650,8 +1666,7 @@ bool QScrollerPrivate::releaseWhileDragging(const QPointF &position, qint64 time } QPointF ppm = q->pixelPerMeter(); - createScrollingSegments(releaseVelocity.x(), contentPosition.x() + overshootPosition.x(), ppm.x(), Qt::Horizontal); - createScrollingSegments(releaseVelocity.y(), contentPosition.y() + overshootPosition.y(), ppm.y(), Qt::Vertical); + createScrollingSegments(releaseVelocity, contentPosition + overshootPosition, ppm); qScrollerDebug() << "QScroller::releaseWhileDragging() -- velocity:" << releaseVelocity << "-- minimum velocity:" << sp->minimumVelocity << "overshoot" << overshootPosition; diff --git a/src/widgets/util/qscroller_p.h b/src/widgets/util/qscroller_p.h index 6463f03573..26bd64461f 100644 --- a/src/widgets/util/qscroller_p.h +++ b/src/widgets/util/qscroller_p.h @@ -131,7 +131,10 @@ public: qreal scrollingSegmentsEndPos(Qt::Orientation orientation) const; bool scrollingSegmentsValid(Qt::Orientation orientation); void createScrollToSegments(qreal v, qreal deltaTime, qreal endPos, Qt::Orientation orientation, ScrollType type); - void createScrollingSegments(qreal v, qreal startPos, qreal ppm, Qt::Orientation orientation); + void createScrollingSegments(qreal v, qreal startPos, + qreal deltaTime, qreal deltaPos, + Qt::Orientation orientation); + void createScrollingSegments(const QPointF &v, const QPointF &startPos, const QPointF &ppm); void setContentPositionHelperDragging(const QPointF &deltaPos); void setContentPositionHelperScrolling(); -- cgit v1.2.3 From 011b88a7b37680288944bde2c4769fd203ee8218 Mon Sep 17 00:00:00 2001 From: Alberto Mardegan Date: Sun, 18 Dec 2011 19:12:42 +0200 Subject: Compute overshoot condition before snap points Snap points are not needed if the overshoot condition is met; therefore, move the overshoot handling before the computation of snap points. Change-Id: I37556b10c1b1124eaed53b0f2a330085acf70776 Reviewed-by: Robin Burchell --- src/widgets/util/qscroller.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp index e39ed9c0a5..2c8b617761 100644 --- a/src/widgets/util/qscroller.cpp +++ b/src/widgets/util/qscroller.cpp @@ -1293,6 +1293,16 @@ void QScrollerPrivate::createScrollingSegments(qreal v, qreal startPos, qScrollerDebug() << " Real Delta:" << deltaPos; + // -- check if are in overshoot and end in overshoot + if ((startPos < minPos && endPos < minPos) || + (startPos > maxPos && endPos > maxPos)) { + qreal stopPos = endPos < minPos ? minPos : maxPos; + qreal oDeltaTime = sp->overshootScrollTime; + + pushSegment(ScrollTypeOvershoot, oDeltaTime * qreal(0.7), qreal(1.0), startPos, stopPos - startPos, stopPos, sp->scrollingCurve.type(), orientation); + return; + } + // -- determine snap points qreal nextSnap = nextSnapPos(endPos, 0, orientation); qreal lowerSnapPos = nextSnapPos(startPos, -1, orientation); @@ -1306,16 +1316,6 @@ void QScrollerPrivate::createScrollingSegments(qreal v, qreal startPos, if (nextSnap < lowerSnapPos || qIsNaN(lowerSnapPos)) lowerSnapPos = nextSnap; - // -- check if are in overshoot and end in overshoot - if ((startPos < minPos && endPos < minPos) || - (startPos > maxPos && endPos > maxPos)) { - qreal stopPos = endPos < minPos ? minPos : maxPos; - qreal oDeltaTime = sp->overshootScrollTime; - - pushSegment(ScrollTypeOvershoot, oDeltaTime * qreal(0.7), qreal(1.0), startPos, stopPos - startPos, stopPos, sp->scrollingCurve.type(), orientation); - return; - } - if (qAbs(v) < sp->minimumVelocity) { qScrollerDebug() << "### below minimum Vel" << orientation; -- cgit v1.2.3 From 56ff31f0c17ff7c038028c1af6afb6eab5216bd6 Mon Sep 17 00:00:00 2001 From: John Brooks Date: Tue, 10 Apr 2012 22:52:49 -0600 Subject: Support more scaling factors for JPEG decompression Since libjpeg 7, decompression scaling factors of [1,16]/8 have been supported. Upscaling is slower, but using the entire range of downscaling factors is significantly faster for sizes between the power-of-two factors. Time to decompress a 5184x3456 image and scale to 1900x1200, slightly less than 3/8ths, changes from 251ms to 203ms. libjpeg versions prior to 7 will round up to the next largest factor they support, and continue to work as before. Change-Id: I00a0655df2ef057e739927a643bfe0b0cabd5602 Reviewed-by: Robin Burchell Reviewed-by: aavit --- src/gui/image/qjpeghandler.cpp | 43 +++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/src/gui/image/qjpeghandler.cpp b/src/gui/image/qjpeghandler.cpp index 013a1a83b0..7dcbcf508f 100644 --- a/src/gui/image/qjpeghandler.cpp +++ b/src/gui/image/qjpeghandler.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include #include // jpeglib needs this to be pre-included @@ -321,27 +322,31 @@ static bool read_jpeg_image(QImage *outImage, } // Determine the scale factor to pass to libjpeg for quick downscaling. - if (!scaledSize.isEmpty()) { + if (!scaledSize.isEmpty() && info->image_width && info->image_height) { if (clipRect.isEmpty()) { - info->scale_denom = - qMin(info->image_width / scaledSize.width(), - info->image_height / scaledSize.height()); - } else { - info->scale_denom = - qMin(clipRect.width() / scaledSize.width(), - clipRect.height() / scaledSize.height()); - } - if (info->scale_denom < 2) { - info->scale_denom = 1; - } else if (info->scale_denom < 4) { - info->scale_denom = 2; - } else if (info->scale_denom < 8) { - info->scale_denom = 4; - } else { + double f = qMin(double(info->image_width) / scaledSize.width(), + double(info->image_height) / scaledSize.height()); + + // libjpeg supports M/8 scaling with M=[1,16]. All downscaling factors + // are a speed improvement, but upscaling during decode is slower. + info->scale_num = qBound(1, qCeil(8/f), 8); info->scale_denom = 8; - } - info->scale_num = 1; - if (!clipRect.isEmpty()) { + } else { + info->scale_denom = qMin(clipRect.width() / scaledSize.width(), + clipRect.height() / scaledSize.height()); + + // Only scale by powers of two when clipping so we can + // keep the exact pixel boundaries + if (info->scale_denom < 2) + info->scale_denom = 1; + else if (info->scale_denom < 4) + info->scale_denom = 2; + else if (info->scale_denom < 8) + info->scale_denom = 4; + else + info->scale_denom = 8; + info->scale_num = 1; + // Correct the scale factor so that we clip accurately. // It is recommended that the clip rectangle be aligned // on an 8-pixel boundary for best performance. -- cgit v1.2.3 From 5c9ba41f71340dd194cee5f9f5864a66b0940c9d Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sat, 7 Apr 2012 01:08:58 +0100 Subject: QRegularExpression: optimize global match PCRE doesn't like illegal Unicode sequences (it's explicitely documented in pcreunicode(3) that they trigger undefined behaviour, and the program may crash). Therefore, we always let PCRE check the validity of both the pattern and the subject string. However, when performing global matching, the subject string can be checked only once: subsequent matches can safely skip the check and avoid a huge performance hit of scanning the whole subject string for each match (!). This patch implements that behaviour internally -- it's still not possible for the user to skip the sanity check. On large subject strings, this gives a terrific performance benefit. Change-Id: Ia44cf18782e07966c9cd6ec4ccfef081ed131763 Reviewed-by: Robin Burchell Reviewed-by: Thiago Macieira --- src/corelib/tools/qregularexpression.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp index 27264f7e72..a65ac0cd2b 100644 --- a/src/corelib/tools/qregularexpression.cpp +++ b/src/corelib/tools/qregularexpression.cpp @@ -796,6 +796,7 @@ struct QRegularExpressionPrivate : QSharedData int offset, QRegularExpression::MatchType matchType, QRegularExpression::MatchOptions matchOptions, + bool checkSubjectString = true, const QRegularExpressionMatchPrivate *previous = 0) const; int captureIndexForName(const QString &name) const; @@ -1165,7 +1166,8 @@ static int pcre16SafeExec(const pcre16 *code, const pcre16_extra *extra, Performs a match of type \a matchType on the given \a subject string with options \a matchOptions and returns the QRegularExpressionMatchPrivate of the result. It also advances a match if a previous result is given as \a - previous. + previous. The \a subject string goes a Unicode validity check if + \a checkSubjectString is true (PCRE doesn't like illegal UTF-16 sequences). Advancing a match is a tricky algorithm. If the previous match matched a non-empty string, we just do an ordinary match at the offset position. @@ -1182,6 +1184,7 @@ QRegularExpressionMatchPrivate *QRegularExpressionPrivate::doMatch(const QString int offset, QRegularExpression::MatchType matchType, QRegularExpression::MatchOptions matchOptions, + bool checkSubjectString, const QRegularExpressionMatchPrivate *previous) const { if (offset < 0) @@ -1211,6 +1214,9 @@ QRegularExpressionMatchPrivate *QRegularExpressionPrivate::doMatch(const QString else if (matchType == QRegularExpression::PartialPreferFirstMatch) pcreOptions |= PCRE_PARTIAL_HARD; + if (!checkSubjectString) + pcreOptions |= PCRE_NO_UTF16_CHECK; + bool previousMatchWasEmpty = false; if (previous && previous->hasMatch && (previous->capturedOffsets.at(0) == previous->capturedOffsets.at(1))) { @@ -1318,10 +1324,15 @@ QRegularExpressionMatch QRegularExpressionMatchPrivate::nextMatch() const Q_ASSERT(isValid); Q_ASSERT(hasMatch || hasPartialMatch); + // Note the "false" passed for the check of the subject string: + // if we're advancing a match on the same subject, + // then that subject was already checked at least once (when this object + // was created, or when the object that created this one was created, etc.) QRegularExpressionMatchPrivate *nextPrivate = regularExpression.d->doMatch(subject, capturedOffsets.at(1), matchType, matchOptions, + false, this); return QRegularExpressionMatch(*nextPrivate); } -- cgit v1.2.3 From b53ea6973102e3ec2a7c84da3496b61d01070b99 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 11 Apr 2012 22:06:05 -0700 Subject: qss: fix parsing of icon style hints Use cssIconValueToIcon (see 5a0eb4e768435b9ce32b074e620fca33be4df2fb) to retrieve the QIcon value from the css parser. Task-number: QTBUG-25120 Change-Id: Ie7c6691514a4b35d416ca09ccf7966689de831c1 Reviewed-by: Friedemann Kleint --- src/widgets/styles/qstylesheetstyle.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 0e928b13c2..89e8f59315 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -991,9 +991,8 @@ QRenderRule::QRenderRule(const QVector &declarations, const QWidget hintValue = (int) decl.colorValue().rgba(); } else if (hintName.endsWith(QLatin1String("size"))) { hintValue = decl.sizeValue(); - // ### Qt5 -// } else if (hintName.endsWith(QLatin1String("icon"))) { -// hintValue = decl.iconValue(); + } else if (hintName.endsWith(QLatin1String("icon"))) { + hintValue = cssIconValueToIcon(decl.iconValue()); } else if (hintName == QLatin1String("button-layout") && decl.d->values.count() != 0 && decl.d->values.at(0).type == Value::String) { hintValue = subControlLayout(decl.d->values.at(0).variant.toString()); -- cgit v1.2.3 From 0734979976ecd12d9849bb31f67c527dca453dfc Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 12 Apr 2012 00:44:29 +1000 Subject: Remove Qt 5 to-do comment that will not be addressed. Task-number: QTBUG-25093 Change-Id: Ib78cffe06f721371ff5c16e24db3abae6dcd4984 Reviewed-by: Lars Knoll --- src/widgets/graphicsview/qgraphicswidget.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/widgets/graphicsview/qgraphicswidget.h b/src/widgets/graphicsview/qgraphicswidget.h index e0bb591231..01e3efcc58 100644 --- a/src/widgets/graphicsview/qgraphicswidget.h +++ b/src/widgets/graphicsview/qgraphicswidget.h @@ -171,7 +171,6 @@ public: void dumpFocusChain(); #endif - // ### Qt 5: Disambiguate #ifdef Q_NO_USING_KEYWORD const QObjectList &children() const { return QObject::children(); } #else -- cgit v1.2.3 From 0b2a10dce5bab23f4152a671b090ff7b57020578 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Thu, 12 Apr 2012 02:15:57 +1000 Subject: Remove a Qt 5 to-do comment that will not be addressed. Task-number: QTBUG-25102 Change-Id: I3fe1878adcf17cb95209df271d062e126e32a8fd Reviewed-by: Lars Knoll --- src/widgets/widgets/qtabbar.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 8263bf8546..f4d289241a 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -1299,7 +1299,6 @@ static QString computeElidedText(Qt::TextElideMode mode, const QString &text) QSize QTabBarPrivate::minimumTabSizeHint(int index) { Q_Q(QTabBar); - // ### Qt 5: make this a protected virtual function in QTabBar Tab &tab = tabList[index]; QString oldText = tab.text; tab.text = computeElidedText(elideMode, oldText); -- cgit v1.2.3 From dd2429551ed6fee49f092001c58b953e72d139c3 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 11 Apr 2012 19:42:54 -0700 Subject: Remove QWidget::setWindowHandle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's unused. The window (QWidgetWindow) is created and managed implicitly by QWidget. Change-Id: I28ee3f120a99c877f318e1abd7d73c9f3e542d03 Reviewed-by: Samuel Rødal --- src/widgets/kernel/qwidget.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h index 78b693c78d..64042ccc36 100644 --- a/src/widgets/kernel/qwidget.h +++ b/src/widgets/kernel/qwidget.h @@ -607,7 +607,6 @@ public: QBackingStore *backingStore() const; - void setWindowHandle(QWindow *window); QWindow *windowHandle() const; friend class QDesktopScreenWidget; -- cgit v1.2.3 From 93c960876af2aebc265ffe3ddc12a24325fc512e Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 11 Apr 2012 19:31:39 -0700 Subject: Remove redundant platformNativeInterface() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit platformNativeInterface() is already defined in QGuiApplication. Change-Id: Ice720fb6f7e4b01c4627219d66a5a3c8980a79a5 Reviewed-by: Samuel Rødal --- src/widgets/kernel/qapplication.h | 2 -- src/widgets/kernel/qapplication_qpa.cpp | 6 ------ 2 files changed, 8 deletions(-) diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h index 3e11db0863..31d228ddd5 100644 --- a/src/widgets/kernel/qapplication.h +++ b/src/widgets/kernel/qapplication.h @@ -175,8 +175,6 @@ public: static bool isEffectEnabled(Qt::UIEffect); static void setEffectEnabled(Qt::UIEffect, bool enable = true); - static QPlatformNativeInterface *platformNativeInterface(); - #ifndef QT_NO_SESSIONMANAGER // session management bool isSessionRestored() const; diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp index 92b831101f..fa84e86f29 100644 --- a/src/widgets/kernel/qapplication_qpa.cpp +++ b/src/widgets/kernel/qapplication_qpa.cpp @@ -437,12 +437,6 @@ void QApplication::alert(QWidget *, int) { } -QPlatformNativeInterface *QApplication::platformNativeInterface() -{ - QPlatformIntegration *pi = QGuiApplicationPrivate::platformIntegration(); - return pi->nativeInterface(); -} - void qt_init(QApplicationPrivate *priv, int type) { Q_UNUSED(priv); -- cgit v1.2.3 From e583ce4103e925ec7ef832d2c9e88979bc04d56c Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 11 Apr 2012 22:38:15 -0700 Subject: remove references to qws from backingstore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The backingstore code is already hard to read as-is. Let's simplify things by removing qws code. Change-Id: Ibefd3ea17d29970d1f7348461959fdc5b01c1f42 Reviewed-by: Samuel Rødal --- src/widgets/kernel/qwidgetbackingstore.cpp | 46 +----------------------------- src/widgets/kernel/qwidgetbackingstore_p.h | 11 ------- 2 files changed, 1 insertion(+), 56 deletions(-) diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index b331356e66..ef4483195e 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -57,11 +57,6 @@ #include #include -#ifdef Q_WS_QWS -#include -#include -#endif - QT_BEGIN_NAMESPACE extern QRegion qt_dirtyRegion(QWidget *); @@ -153,13 +148,6 @@ static void showYellowThing_win(QWidget *widget, const QRegion ®ion, int msec void QWidgetBackingStore::showYellowThing(QWidget *widget, const QRegion &toBePainted, int msec, bool unclipped) { -#ifdef Q_WS_QWS - Q_UNUSED(widget); - Q_UNUSED(unclipped); - static QWSYellowSurface surface(true); - surface.setDelay(msec); - surface.flush(widget, toBePainted, QPoint()); -#else QRegion paintRegion = toBePainted; QRect widgetRect = widget->rect(); @@ -224,7 +212,6 @@ void QWidgetBackingStore::showYellowThing(QWidget *widget, const QRegion &toBePa ::usleep(1000 * msec); #endif #endif // Q_WS_WIN -#endif // Q_WS_QWS } bool QWidgetBackingStore::flushPaint(QWidget *widget, const QRegion &rgn) @@ -633,7 +620,7 @@ void QWidgetBackingStore::markDirtyOnScreen(const QRegion ®ion, QWidget *widg if (!widget || widget->d_func()->paintOnScreen() || region.isEmpty()) return; -#if defined(Q_WS_QWS) || defined(Q_WS_MAC) +#if defined(Q_WS_MAC) if (!widget->testAttribute(Qt::WA_WState_InPaintEvent)) dirtyOnScreen += region.translated(topLevelOffset); return; @@ -751,11 +738,6 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy) QPoint toplevelOffset = pw->mapTo(tlw, QPoint()); QWidgetPrivate *pd = pw->d_func(); QRect clipR(pd->clipRect()); -#ifdef Q_WS_QWS - QWidgetBackingStore *wbs = x->backingStore.data(); - QWSWindowSurface *surface = static_cast(wbs->windowSurface); - clipR = clipR.intersected(surface->clipRegion().translated(-toplevelOffset).boundingRect()); -#endif const QRect newRect(rect.translated(dx, dy)); QRect destRect = rect.intersected(clipR); if (destRect.isValid()) @@ -839,26 +821,6 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy) bool accelerateScroll = accelEnv && isOpaque && !(overlapped = isOverlapped(scrollRect.translated(data.crect.topLeft()))); -#if defined(Q_WS_QWS) - QWSWindowSurface *surface; - surface = static_cast(wbs->windowSurface); - - if (accelerateScroll && !surface->isBuffered()) { - const QRegion surfaceClip = surface->clipRegion(); - const QRegion outsideClip = QRegion(rect) - surfaceClip; - if (!outsideClip.isEmpty()) { - const QVector clipped = (surfaceClip & rect).rects(); - if (clipped.size() < 8) { - for (int i = 0; i < clipped.size(); ++i) - this->scrollRect(clipped.at(i), dx, dy); - return; - } else { - accelerateScroll = false; - } - } - } -#endif // Q_WS_QWS - if (!accelerateScroll) { if (overlapped) { QRegion region(scrollRect); @@ -869,12 +831,6 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy) } } else { const QPoint toplevelOffset = q->mapTo(tlw, QPoint()); -#ifdef Q_WS_QWS - QWSWindowSurface *surface = static_cast(wbs->windowSurface); - const QRegion clip = surface->clipRegion().translated(-toplevelOffset) & scrollRect; - const QRect clipBoundingRect = clip.boundingRect(); - scrollRect &= clipBoundingRect; -#endif const QRect destRect = scrollRect.translated(dx, dy) & scrollRect; const QRect sourceRect = destRect.translated(-dx, -dy); diff --git a/src/widgets/kernel/qwidgetbackingstore_p.h b/src/widgets/kernel/qwidgetbackingstore_p.h index 7befdbeb78..56c2547d3e 100644 --- a/src/widgets/kernel/qwidgetbackingstore_p.h +++ b/src/widgets/kernel/qwidgetbackingstore_p.h @@ -87,9 +87,6 @@ public: { return !(dirtyWidgets.isEmpty() && dirty.isEmpty() && !hasDirtyFromPreviousSync && !fullUpdatePending -#if defined(Q_WS_QWS) && !defined(QT_NO_QWS_MANAGER) - && !hasDirtyWindowDecoration() -#endif ); } @@ -130,10 +127,6 @@ private: void removeDirtyWidget(QWidget *w); -#if defined(Q_WS_QWS) && !defined(QT_NO_QWS_MANAGER) - bool hasDirtyWindowDecoration() const; - void paintWindowDecoration(); -#endif void updateLists(QWidget *widget); inline void addDirtyWidget(QWidget *widget, const QRegion &rgn) @@ -199,11 +192,7 @@ private: inline QRect topLevelRect() const { -#ifdef Q_WS_QWS - return tlw->frameGeometry(); -#else return tlw->data->crect; -#endif } inline void appendDirtyOnScreenWidget(QWidget *widget) -- cgit v1.2.3 From a5dccb0ece9f10d1de4dd6083f780cb594552b67 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 11 Apr 2012 16:59:39 -0700 Subject: Move QSurface destructor to qsurface.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fa0407bdb50262f8748e955cf698181cc6906542 moved all QSurface code to a separate except the destructor. Change-Id: I2bf426a0b70cbffafae7aca8dd5550192f762aeb Reviewed-by: Samuel Rødal --- src/gui/kernel/qsurface.cpp | 4 +++- src/gui/kernel/qwindow.cpp | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/kernel/qsurface.cpp b/src/gui/kernel/qsurface.cpp index 534135cc2f..8b71fc3536 100644 --- a/src/gui/kernel/qsurface.cpp +++ b/src/gui/kernel/qsurface.cpp @@ -88,7 +88,9 @@ QSurface::QSurface(SurfaceClass type) { } - +QSurface::~QSurface() +{ +} QSurface::SurfaceClass QSurface::surfaceClass() const { diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 88ff31fe91..856dcd8426 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -181,10 +181,6 @@ QWindow::~QWindow() destroy(); } -QSurface::~QSurface() -{ -} - /*! Set the \a surfaceType of the window. -- cgit v1.2.3 From 40a1e8eccf42dad9ff70ad54658abcfc9bf896ae Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 11 Apr 2012 22:42:41 -0700 Subject: Remove hasDirtyFromPreviousSync from backingstore. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's always false (used to be some qws specific variable). Change-Id: I3dc185dba4c778797f180410ce8d293336ecfd9c Reviewed-by: Samuel Rødal --- src/widgets/kernel/qwidgetbackingstore.cpp | 6 +----- src/widgets/kernel/qwidgetbackingstore_p.h | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index ef4483195e..f9361cc357 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -696,8 +696,7 @@ void QWidgetBackingStore::updateLists(QWidget *cur) } QWidgetBackingStore::QWidgetBackingStore(QWidget *topLevel) - : tlw(topLevel), dirtyOnScreenWidgets(0), hasDirtyFromPreviousSync(false) - , fullUpdatePending(0) + : tlw(topLevel), dirtyOnScreenWidgets(0), fullUpdatePending(0) { store = tlw->backingStore(); Q_ASSERT(store); @@ -982,9 +981,6 @@ void QWidgetBackingStore::sync() if (updatesDisabled) return; - if (hasDirtyFromPreviousSync) - dirty += dirtyFromPreviousSync; - // Contains everything that needs repaint. QRegion toClean(dirty); diff --git a/src/widgets/kernel/qwidgetbackingstore_p.h b/src/widgets/kernel/qwidgetbackingstore_p.h index 56c2547d3e..7c350932ea 100644 --- a/src/widgets/kernel/qwidgetbackingstore_p.h +++ b/src/widgets/kernel/qwidgetbackingstore_p.h @@ -85,9 +85,7 @@ public: inline bool isDirty() const { - return !(dirtyWidgets.isEmpty() && dirty.isEmpty() && !hasDirtyFromPreviousSync - && !fullUpdatePending - ); + return !(dirtyWidgets.isEmpty() && dirty.isEmpty() && !fullUpdatePending); } // ### Qt 4.6: Merge into a template function (after MSVC isn't supported anymore). @@ -105,7 +103,6 @@ private: QVector *dirtyOnScreenWidgets; QList staticWidgets; QBackingStore *store; - uint hasDirtyFromPreviousSync : 1; uint fullUpdatePending : 1; QPoint tlwOffset; -- cgit v1.2.3 From dae4bd8489993a250cfd7890ec963bf8190a7a97 Mon Sep 17 00:00:00 2001 From: Yan Shapochnik Date: Wed, 11 Apr 2012 15:02:49 -0400 Subject: Fix possible crash issue when testing the state of a QAccessibleMenuItem The owner widget of a QAccessibleMenuItem may be NULL. Checking for a valid pointer before dereferncing. Port of Qt 4 patch. Change-Id: Ic3149ccc5d6ae0ebc83dae58163ae2f60397fd28 (cherry picked from commit 3f526366af14f6c640dd52cd089b00776ab06731) Reviewed-by: Frederik Gladhorn --- src/plugins/accessible/widgets/qaccessiblemenu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/accessible/widgets/qaccessiblemenu.cpp b/src/plugins/accessible/widgets/qaccessiblemenu.cpp index d3ca1629bd..6009d25977 100644 --- a/src/plugins/accessible/widgets/qaccessiblemenu.cpp +++ b/src/plugins/accessible/widgets/qaccessiblemenu.cpp @@ -249,7 +249,7 @@ QAccessible::State QAccessibleMenuItem::state() const QAccessible::State s; QWidget *own = owner(); - if (own->testAttribute(Qt::WA_WState_Visible) == false || m_action->isVisible() == false) { + if (own && own->testAttribute(Qt::WA_WState_Visible) == false || m_action->isVisible() == false) { s.invisible = true; } @@ -262,7 +262,7 @@ QAccessible::State QAccessibleMenuItem::state() const s.focused = true; #endif } - if (own->style()->styleHint(QStyle::SH_Menu_MouseTracking)) + if (own && own->style()->styleHint(QStyle::SH_Menu_MouseTracking)) s.hotTracked = true; if (m_action->isSeparator() || !m_action->isEnabled()) s.disabled = true; -- cgit v1.2.3 From 17412400dc2887ccd52014a9c261c6ab1da44e01 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 11 Apr 2012 15:16:09 +0100 Subject: Add OS version detection for windows 8 Based on consumer preview, the internal version is 6.2 Change-Id: I9d6ff6c7614f46a20d489e8a8f4aefeb60c547f6 Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.cpp | 4 ++++ src/corelib/global/qsysinfo.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 7d518cbcd8..ac0f27d397 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1711,6 +1711,8 @@ QSysInfo::WinVersion QSysInfo::windowsVersion() winver = QSysInfo::WV_VISTA; } else if (osver.dwMajorVersion == 6 && osver.dwMinorVersion == 1) { winver = QSysInfo::WV_WINDOWS7; + } else if (osver.dwMajorVersion == 6 && osver.dwMinorVersion == 2) { + winver = QSysInfo::WV_WINDOWS8; } else { qWarning("Qt: Untested Windows version %d.%d detected!", int(osver.dwMajorVersion), int(osver.dwMinorVersion)); @@ -1742,6 +1744,8 @@ QSysInfo::WinVersion QSysInfo::windowsVersion() winver = QSysInfo::WV_VISTA; else if (override == "WINDOWS7") winver = QSysInfo::WV_WINDOWS7; + else if (override == "WINDOWS8") + winver = QSysInfo::WV_WINDOWS8; } #endif diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h index 74c8d1de7f..2c9ce39430 100644 --- a/src/corelib/global/qsysinfo.h +++ b/src/corelib/global/qsysinfo.h @@ -96,6 +96,7 @@ public: WV_2003 = 0x0040, WV_VISTA = 0x0080, WV_WINDOWS7 = 0x0090, + WV_WINDOWS8 = 0x00a0, WV_NT_based = 0x00f0, /* version numbers */ @@ -105,6 +106,7 @@ public: WV_5_2 = WV_2003, WV_6_0 = WV_VISTA, WV_6_1 = WV_WINDOWS7, + WV_6_2 = WV_WINDOWS8, WV_CE = 0x0100, WV_CENET = 0x0200, -- cgit v1.2.3 From 3c0fdefc318eeeb019b3727962bea7ba7ea236d2 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 12 Apr 2012 17:28:37 +0100 Subject: Fix autotest failures in QAbstractNetworkCache The cache expiration calculation was previously removed to avoid calculating it every time an object is fetched from the cache. This is because the expiration date is calculated from max-age or expires headers when the object is added to the cache. However this broke the case where the server only provides a last-modified header. In this case, the expiration date needs to be checked at fetch time in order to add the warning if the object is >24h old. Change-Id: Iad381da0f91c27ac603abbaa94f268700ad2297f Reviewed-by: Thiago Macieira --- src/network/access/qnetworkreplyhttpimpl.cpp | 118 ++++++++++++++------------- 1 file changed, 60 insertions(+), 58 deletions(-) diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index a914ee3f04..101e1aa222 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -513,69 +513,71 @@ bool QNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed(QHttpNetworkRequest &h QDateTime currentDateTime = QDateTime::currentDateTime(); QDateTime expirationDate = metaData.expirationDate(); -#if 0 - /* - * age_value - * is the value of Age: header received by the cache with - * this response. - * date_value - * is the value of the origin server's Date: header - * request_time - * is the (local) time when the cache made the request - * that resulted in this cached response - * response_time - * is the (local) time when the cache received the - * response - * now - * is the current (local) time - */ - int age_value = 0; - it = cacheHeaders.findRawHeader("age"); - if (it != cacheHeaders.rawHeaders.constEnd()) - age_value = it->second.toInt(); - - QDateTime dateHeader; - int date_value = 0; - it = cacheHeaders.findRawHeader("date"); - if (it != cacheHeaders.rawHeaders.constEnd()) { - dateHeader = QNetworkHeadersPrivate::fromHttpDate(it->second); - date_value = dateHeader.toTime_t(); - } - - int now = currentDateTime.toUTC().toTime_t(); - int request_time = now; - int response_time = now; + bool response_is_fresh; + if (!expirationDate.isValid()) { + /* + * age_value + * is the value of Age: header received by the cache with + * this response. + * date_value + * is the value of the origin server's Date: header + * request_time + * is the (local) time when the cache made the request + * that resulted in this cached response + * response_time + * is the (local) time when the cache received the + * response + * now + * is the current (local) time + */ + int age_value = 0; + it = cacheHeaders.findRawHeader("age"); + if (it != cacheHeaders.rawHeaders.constEnd()) + age_value = it->second.toInt(); - // Algorithm from RFC 2616 section 13.2.3 - int apparent_age = qMax(0, response_time - date_value); - int corrected_received_age = qMax(apparent_age, age_value); - int response_delay = response_time - request_time; - int corrected_initial_age = corrected_received_age + response_delay; - int resident_time = now - response_time; - int current_age = corrected_initial_age + resident_time; + QDateTime dateHeader; + int date_value = 0; + it = cacheHeaders.findRawHeader("date"); + if (it != cacheHeaders.rawHeaders.constEnd()) { + dateHeader = QNetworkHeadersPrivate::fromHttpDate(it->second); + date_value = dateHeader.toTime_t(); + } - // RFC 2616 13.2.4 Expiration Calculations - if (!expirationDate.isValid()) { - if (lastModified.isValid()) { - int diff = currentDateTime.secsTo(lastModified); - expirationDate = lastModified; - expirationDate.addSecs(diff / 10); - if (httpRequest.headerField("Warning").isEmpty()) { - QDateTime dt; - dt.setTime_t(current_age); - if (dt.daysTo(currentDateTime) > 1) - httpRequest.setHeaderField("Warning", "113"); + int now = currentDateTime.toUTC().toTime_t(); + int request_time = now; + int response_time = now; + + // Algorithm from RFC 2616 section 13.2.3 + int apparent_age = qMax(0, response_time - date_value); + int corrected_received_age = qMax(apparent_age, age_value); + int response_delay = response_time - request_time; + int corrected_initial_age = corrected_received_age + response_delay; + int resident_time = now - response_time; + int current_age = corrected_initial_age + resident_time; + + // RFC 2616 13.2.4 Expiration Calculations + if (!expirationDate.isValid()) { + if (lastModified.isValid()) { + int diff = currentDateTime.secsTo(lastModified); + expirationDate = lastModified; + expirationDate.addSecs(diff / 10); + if (httpRequest.headerField("Warning").isEmpty()) { + QDateTime dt; + dt.setTime_t(current_age); + if (dt.daysTo(currentDateTime) > 1) + httpRequest.setHeaderField("Warning", "113"); + } } } - } - // the cache-saving code below sets the expirationDate with date+max_age - // if "max-age" is present, or to Expires otherwise - int freshness_lifetime = dateHeader.secsTo(expirationDate); - bool response_is_fresh = (freshness_lifetime > current_age); -#else - bool response_is_fresh = currentDateTime.secsTo(expirationDate) >= 0; -#endif + // the cache-saving code below sets the expirationDate with date+max_age + // if "max-age" is present, or to Expires otherwise + int freshness_lifetime = dateHeader.secsTo(expirationDate); + response_is_fresh = (freshness_lifetime > current_age); + } else { + // expiration date was calculated earlier (e.g. when storing object to the cache) + response_is_fresh = currentDateTime.secsTo(expirationDate) >= 0; + } if (!response_is_fresh) return false; -- cgit v1.2.3 From 71cfddeecca5c7263901505fdb655e0a9070463c Mon Sep 17 00:00:00 2001 From: Bjoern Breitmeyer Date: Thu, 12 Apr 2012 10:35:40 +0200 Subject: fixed compiling of QDnsRunner for wince and windows desktop ce only has the utf16 variant desktop has all variants of the DnsQuery call. Unified it to the utf16 variant. Change-Id: Ic126c3f53da71c85a41a5c24c85970335700bcf0 Reviewed-by: Friedemann Kleint Reviewed-by: Andreas Holzammer Reviewed-by: Shane Kearns --- src/network/kernel/qdnslookup_win.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/network/kernel/qdnslookup_win.cpp b/src/network/kernel/qdnslookup_win.cpp index 63f4377dfc..c798020f34 100644 --- a/src/network/kernel/qdnslookup_win.cpp +++ b/src/network/kernel/qdnslookup_win.cpp @@ -55,7 +55,8 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN { // Perform DNS query. PDNS_RECORD dns_records = 0; - const DNS_STATUS status = DnsQuery_UTF8(requestName, requestType, DNS_QUERY_STANDARD, NULL, &dns_records, NULL); + const QString requestNameUtf16 = QString::fromUtf8(requestName.data(), requestName.size()); + const DNS_STATUS status = DnsQuery_W(reinterpret_cast(requestNameUtf16.utf16()), requestType, DNS_QUERY_STANDARD, NULL, &dns_records, NULL); switch (status) { case ERROR_SUCCESS: break; @@ -83,7 +84,7 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN // Extract results. for (PDNS_RECORD ptr = dns_records; ptr != NULL; ptr = ptr->pNext) { - const QString name = QUrl::fromAce((char*)ptr->pName); + const QString name = QUrl::fromAce( QString::fromWCharArray( ptr->pName ).toLatin1() ); if (ptr->wType == QDnsLookup::A) { QDnsHostAddressRecord record; record.d->name = name; @@ -103,12 +104,12 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN QDnsDomainNameRecord record; record.d->name = name; record.d->timeToLive = ptr->dwTtl; - record.d->value = QUrl::fromAce((char*)ptr->Data.Cname.pNameHost); + record.d->value = QUrl::fromAce(QString::fromWCharArray(ptr->Data.Cname.pNameHost).toLatin1()); reply->canonicalNameRecords.append(record); } else if (ptr->wType == QDnsLookup::MX) { QDnsMailExchangeRecord record; record.d->name = name; - record.d->exchange = QUrl::fromAce((char*)ptr->Data.Mx.pNameExchange); + record.d->exchange = QUrl::fromAce(QString::fromWCharArray(ptr->Data.Mx.pNameExchange).toLatin1()); record.d->preference = ptr->Data.Mx.wPreference; record.d->timeToLive = ptr->dwTtl; reply->mailExchangeRecords.append(record); @@ -116,18 +117,18 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN QDnsDomainNameRecord record; record.d->name = name; record.d->timeToLive = ptr->dwTtl; - record.d->value = QUrl::fromAce((char*)ptr->Data.Ns.pNameHost); + record.d->value = QUrl::fromAce(QString::fromWCharArray(ptr->Data.Ns.pNameHost).toLatin1()); reply->nameServerRecords.append(record); } else if (ptr->wType == QDnsLookup::PTR) { QDnsDomainNameRecord record; record.d->name = name; record.d->timeToLive = ptr->dwTtl; - record.d->value = QUrl::fromAce((char*)ptr->Data.Ptr.pNameHost); + record.d->value = QUrl::fromAce(QString::fromWCharArray(ptr->Data.Ptr.pNameHost).toLatin1()); reply->pointerRecords.append(record); } else if (ptr->wType == QDnsLookup::SRV) { QDnsServiceRecord record; record.d->name = name; - record.d->target = QUrl::fromAce((char*)ptr->Data.Srv.pNameTarget); + record.d->target = QUrl::fromAce(QString::fromWCharArray(ptr->Data.Srv.pNameTarget).toLatin1()); record.d->port = ptr->Data.Srv.wPort; record.d->priority = ptr->Data.Srv.wPriority; record.d->timeToLive = ptr->dwTtl; @@ -138,7 +139,7 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN record.d->name = name; record.d->timeToLive = ptr->dwTtl; for (unsigned int i = 0; i < ptr->Data.Txt.dwStringCount; ++i) { - record.d->values << QByteArray((char*)ptr->Data.Txt.pStringArray[i]); + record.d->values << QString::fromWCharArray((ptr->Data.Txt.pStringArray[i])).toLatin1();; } reply->textRecords.append(record); } -- cgit v1.2.3 From 4b668da75025cfe00dd7a307c19f05dabc2efb7c Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 12 Apr 2012 15:34:24 +0200 Subject: Do not ignore tests/auto/corelib/io/qfile on Mac OS X This does not fail anymore, remove CONFIG+=insignificant_test Change-Id: I4f98cfad563adfa460910976317c91e852db6872 Reviewed-by: Jason McDonald --- tests/auto/corelib/io/qfile/test/test.pro | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/corelib/io/qfile/test/test.pro b/tests/auto/corelib/io/qfile/test/test.pro index dab5e4a3a5..676762da81 100644 --- a/tests/auto/corelib/io/qfile/test/test.pro +++ b/tests/auto/corelib/io/qfile/test/test.pro @@ -10,5 +10,3 @@ TESTDATA += ../dosfile.txt ../noendofline.txt ../testfile.txt \ ../resources/file1.ext1 win32: LIBS+=-lole32 -luuid - -mac*:CONFIG+=insignificant_test -- cgit v1.2.3 From 20a36364eb8949f009644bf537e7f6b8cbe81467 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 12 Apr 2012 15:50:26 +0200 Subject: Do not ignore tests/auto/corelib/io/qiodevice on Mac OS X This test no longer fails, so we can remove CONFIG+=insignificant_test Task-number: QTBUG-22766 Change-Id: I379873d5c483157e414201e5f8a13c3f4407f9fd Reviewed-by: Jason McDonald --- tests/auto/corelib/io/qiodevice/qiodevice.pro | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/corelib/io/qiodevice/qiodevice.pro b/tests/auto/corelib/io/qiodevice/qiodevice.pro index a8295ec79b..c98e3fb8c3 100644 --- a/tests/auto/corelib/io/qiodevice/qiodevice.pro +++ b/tests/auto/corelib/io/qiodevice/qiodevice.pro @@ -5,5 +5,3 @@ SOURCES = tst_qiodevice.cpp TESTDATA += tst_qiodevice.cpp MOC_DIR=tmp - -mac: CONFIG += insignificant_test # QTBUG-22766 -- cgit v1.2.3 From a387fd8ee35d6789eb718ee28bcb373891ccff61 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Thu, 12 Apr 2012 15:55:20 +0200 Subject: Do not ignore tests/auto/corelib/io/qtextstream on Mac OS X This test no longer fails, so we can remove CONFIG+=insignificant_test Task-number: QTBUG-22767 Change-Id: If3ca194fc982ad8fdc3e9a7f62fc346190ff01ea Reviewed-by: Jason McDonald --- tests/auto/corelib/io/qtextstream/test/test.pro | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/corelib/io/qtextstream/test/test.pro b/tests/auto/corelib/io/qtextstream/test/test.pro index 577f52972d..93fb6d232f 100644 --- a/tests/auto/corelib/io/qtextstream/test/test.pro +++ b/tests/auto/corelib/io/qtextstream/test/test.pro @@ -19,5 +19,3 @@ TESTDATA += \ ../qtextstream.qrc \ ../tst_qtextstream.cpp \ ../resources - -mac: CONFIG += insignificant_test # QTBUG-22767 -- cgit v1.2.3 From 8e943bbf5de795d3bffbe843f5ddb26b6943317b Mon Sep 17 00:00:00 2001 From: Sergey Gusarov Date: Thu, 12 Apr 2012 19:15:15 +0400 Subject: Apply Qt config option "-no-largefile" to SQLite make process This patch fixes compilation error if there is no 64 bit support in compiler. Task-number: QTBUG-15395 Change-Id: Ife4afb05491d36af93bf4ad3ba8fa227710655f0 Reviewed-by: Oswald Buddenhagen --- src/3rdparty/sqlite.pri | 1 + 1 file changed, 1 insertion(+) diff --git a/src/3rdparty/sqlite.pri b/src/3rdparty/sqlite.pri index 575412da09..e8fa827b13 100644 --- a/src/3rdparty/sqlite.pri +++ b/src/3rdparty/sqlite.pri @@ -1,4 +1,5 @@ CONFIG(release, debug|release):DEFINES *= NDEBUG DEFINES += SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE +!contains(CONFIG, largefile):DEFINES += SQLITE_DISABLE_LFS INCLUDEPATH += $$PWD/sqlite SOURCES += $$PWD/sqlite/sqlite3.c -- cgit v1.2.3 From b7486591cd114351c755b9e8b2bfe5d175461ec9 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Fri, 13 Apr 2012 15:14:35 +1000 Subject: test: marked tst_qlocale as insignificant on Windows This test hangs 2-3% of the time. Task-number: QTBUG-25284 Change-Id: I32e01696262be2de7e015b8f811d1666551426cc Reviewed-by: Toby Tomkins --- tests/auto/corelib/tools/qlocale/test/test.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/corelib/tools/qlocale/test/test.pro b/tests/auto/corelib/tools/qlocale/test/test.pro index 24dcc0638a..28e127e307 100644 --- a/tests/auto/corelib/tools/qlocale/test/test.pro +++ b/tests/auto/corelib/tools/qlocale/test/test.pro @@ -17,3 +17,4 @@ load(testcase) # for target.path and installTestHelperApp() installTestHelperApp("../syslocaleapp/syslocaleapp",syslocaleapp,syslocaleapp) mac: CONFIG += insignificant_test # QTBUG-22769 +win32:CONFIG+= insignificant_test # QTBUG-25284 -- cgit v1.2.3 From e9ab2dabf9827b36cb83e1e83a955866190da08d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 12 Apr 2012 16:50:52 +0200 Subject: Fix MinGW warning about qDebug() formats. Change-Id: I927d17240a7cc7b88814601b0711aa46ca166ff9 Reviewed-by: Friedemann Kleint --- src/widgets/styles/qwindowsxpstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp index 336d93e8c1..67895980b2 100644 --- a/src/widgets/styles/qwindowsxpstyle.cpp +++ b/src/widgets/styles/qwindowsxpstyle.cpp @@ -323,7 +323,7 @@ void QWindowsXPStylePrivate::cleanupHandleMap() HTHEME QWindowsXPStylePrivate::createTheme(int theme, HWND hwnd) { if (theme < 0 || theme >= NThemes || !hwnd) { - qWarning("%s: Invalid parameters #%d, %p", theme, hwnd); + qWarning("%s: Invalid parameters #%d, %p", Q_FUNC_INFO, theme, hwnd); return 0; } if (!m_themes[theme]) { -- cgit v1.2.3 From 54fe4324d8d96e17f900cdd8510ffdca5e0f976f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 12 Apr 2012 09:01:45 +0200 Subject: Fix compiler warning in evdevmouse plugin. Change-Id: I3b203b485079ff2cc96044789b06525ab2cde448 Reviewed-by: Friedemann Kleint --- src/plugins/generic/evdevmouse/qevdevmousemanager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/generic/evdevmouse/qevdevmousemanager.cpp b/src/plugins/generic/evdevmouse/qevdevmousemanager.cpp index cf3fe1f498..2120b1540f 100644 --- a/src/plugins/generic/evdevmouse/qevdevmousemanager.cpp +++ b/src/plugins/generic/evdevmouse/qevdevmousemanager.cpp @@ -81,7 +81,9 @@ QEvdevMouseManager::QEvdevMouseManager(const QString &key, const QString &specif foreach (const QString &device, devices) addMouse(device); -#ifndef QT_NO_LIBUDEV +#ifdef QT_NO_LIBUDEV + Q_UNUSED(useUDev) +#else if (useUDev) { #ifdef QT_QPA_MOUSEMANAGER_DEBUG qWarning() << "Use UDev for device discovery"; -- cgit v1.2.3 From 84e45c646dcf64d3bb692eed1b861d4f8b9ef31f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 28 Mar 2012 16:54:15 -0300 Subject: Move QFlags to qflags.h This is a verbatim copy of the source code. Change-Id: I1f7efc75cad1ba05dda31d8ccfd091ae9ae40fd5 Reviewed-by: Olivier Goffart --- src/corelib/global/global.pri | 3 +- src/corelib/global/qflags.h | 139 ++++++++++++++++++++++++++++++++++++++++++ src/corelib/global/qglobal.h | 86 +------------------------- 3 files changed, 142 insertions(+), 86 deletions(-) create mode 100644 src/corelib/global/qflags.h diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri index 58cff6b81c..28a1a390b7 100644 --- a/src/corelib/global/global.pri +++ b/src/corelib/global/global.pri @@ -13,7 +13,8 @@ HEADERS += \ global/qtypeinfo.h \ global/qsysinfo.h \ global/qisenum.h \ - global/qtypetraits.h + global/qtypetraits.h \ + global/qflags.h SOURCES += \ global/qglobal.cpp \ diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h new file mode 100644 index 0000000000..7406185520 --- /dev/null +++ b/src/corelib/global/qflags.h @@ -0,0 +1,139 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QFLAGS_H +#define QFLAGS_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class Q_CORE_EXPORT QFlag +{ + int i; +public: + inline QFlag(int i); + inline operator int() const { return i; } +}; + +inline QFlag::QFlag(int ai) : i(ai) {} + +class Q_CORE_EXPORT QIncompatibleFlag +{ + int i; +public: + inline explicit QIncompatibleFlag(int i); + inline operator int() const { return i; } +}; + +inline QIncompatibleFlag::QIncompatibleFlag(int ai) : i(ai) {} + + +#ifndef Q_NO_TYPESAFE_FLAGS + +template +class QFlags +{ + typedef void **Zero; + int i; +public: + typedef Enum enum_type; + // compiler-generated copy/move ctor/assignment operators are fine! +#ifdef qdoc + inline QFlags(const QFlags &other); + inline QFlags &operator=(const QFlags &other); +#endif + Q_DECL_CONSTEXPR inline QFlags(Enum f) : i(f) {} + Q_DECL_CONSTEXPR inline QFlags(Zero = 0) : i(0) {} + inline QFlags(QFlag f) : i(f) {} + + inline QFlags &operator&=(int mask) { i &= mask; return *this; } + inline QFlags &operator&=(uint mask) { i &= mask; return *this; } + inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; } + inline QFlags &operator|=(Enum f) { i |= f; return *this; } + inline QFlags &operator^=(QFlags f) { i ^= f.i; return *this; } + inline QFlags &operator^=(Enum f) { i ^= f; return *this; } + + Q_DECL_CONSTEXPR inline operator int() const { return i; } + + Q_DECL_CONSTEXPR inline QFlags operator|(QFlags f) const { return QFlags(Enum(i | f.i)); } + Q_DECL_CONSTEXPR inline QFlags operator|(Enum f) const { return QFlags(Enum(i | f)); } + Q_DECL_CONSTEXPR inline QFlags operator^(QFlags f) const { return QFlags(Enum(i ^ f.i)); } + Q_DECL_CONSTEXPR inline QFlags operator^(Enum f) const { return QFlags(Enum(i ^ f)); } + Q_DECL_CONSTEXPR inline QFlags operator&(int mask) const { return QFlags(Enum(i & mask)); } + Q_DECL_CONSTEXPR inline QFlags operator&(uint mask) const { return QFlags(Enum(i & mask)); } + Q_DECL_CONSTEXPR inline QFlags operator&(Enum f) const { return QFlags(Enum(i & f)); } + Q_DECL_CONSTEXPR inline QFlags operator~() const { return QFlags(Enum(~i)); } + + Q_DECL_CONSTEXPR inline bool operator!() const { return !i; } + + inline bool testFlag(Enum f) const { return (i & f) == f && (f != 0 || i == int(f) ); } +}; + +#define Q_DECLARE_FLAGS(Flags, Enum)\ +typedef QFlags Flags; + +#define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \ +inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) \ +{ return QIncompatibleFlag(int(f1) | f2); } + +#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \ +Q_DECL_CONSTEXPR inline QFlags operator|(Flags::enum_type f1, Flags::enum_type f2) \ +{ return QFlags(f1) | f2; } \ +Q_DECL_CONSTEXPR inline QFlags operator|(Flags::enum_type f1, QFlags f2) \ +{ return f2 | f1; } Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) + + +#else /* Q_NO_TYPESAFE_FLAGS */ + +#define Q_DECLARE_FLAGS(Flags, Enum)\ +typedef uint Flags; +#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) + +#endif /* Q_NO_TYPESAFE_FLAGS */ + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QFLAGS_H diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 0efcdf8c4a..f977c87a05 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1185,90 +1185,6 @@ Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n); # endif #endif -class Q_CORE_EXPORT QFlag -{ - int i; -public: - inline QFlag(int i); - inline operator int() const { return i; } -}; - -inline QFlag::QFlag(int ai) : i(ai) {} - -class Q_CORE_EXPORT QIncompatibleFlag -{ - int i; -public: - inline explicit QIncompatibleFlag(int i); - inline operator int() const { return i; } -}; - -inline QIncompatibleFlag::QIncompatibleFlag(int ai) : i(ai) {} - - -#ifndef Q_NO_TYPESAFE_FLAGS - -template -class QFlags -{ - typedef void **Zero; - int i; -public: - typedef Enum enum_type; - // compiler-generated copy/move ctor/assignment operators are fine! -#ifdef qdoc - inline QFlags(const QFlags &other); - inline QFlags &operator=(const QFlags &other); -#endif - Q_DECL_CONSTEXPR inline QFlags(Enum f) : i(f) {} - Q_DECL_CONSTEXPR inline QFlags(Zero = 0) : i(0) {} - inline QFlags(QFlag f) : i(f) {} - - inline QFlags &operator&=(int mask) { i &= mask; return *this; } - inline QFlags &operator&=(uint mask) { i &= mask; return *this; } - inline QFlags &operator|=(QFlags f) { i |= f.i; return *this; } - inline QFlags &operator|=(Enum f) { i |= f; return *this; } - inline QFlags &operator^=(QFlags f) { i ^= f.i; return *this; } - inline QFlags &operator^=(Enum f) { i ^= f; return *this; } - - Q_DECL_CONSTEXPR inline operator int() const { return i; } - - Q_DECL_CONSTEXPR inline QFlags operator|(QFlags f) const { return QFlags(Enum(i | f.i)); } - Q_DECL_CONSTEXPR inline QFlags operator|(Enum f) const { return QFlags(Enum(i | f)); } - Q_DECL_CONSTEXPR inline QFlags operator^(QFlags f) const { return QFlags(Enum(i ^ f.i)); } - Q_DECL_CONSTEXPR inline QFlags operator^(Enum f) const { return QFlags(Enum(i ^ f)); } - Q_DECL_CONSTEXPR inline QFlags operator&(int mask) const { return QFlags(Enum(i & mask)); } - Q_DECL_CONSTEXPR inline QFlags operator&(uint mask) const { return QFlags(Enum(i & mask)); } - Q_DECL_CONSTEXPR inline QFlags operator&(Enum f) const { return QFlags(Enum(i & f)); } - Q_DECL_CONSTEXPR inline QFlags operator~() const { return QFlags(Enum(~i)); } - - Q_DECL_CONSTEXPR inline bool operator!() const { return !i; } - - inline bool testFlag(Enum f) const { return (i & f) == f && (f != 0 || i == int(f) ); } -}; - -#define Q_DECLARE_FLAGS(Flags, Enum)\ -typedef QFlags Flags; - -#define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \ -inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) \ -{ return QIncompatibleFlag(int(f1) | f2); } - -#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \ -Q_DECL_CONSTEXPR inline QFlags operator|(Flags::enum_type f1, Flags::enum_type f2) \ -{ return QFlags(f1) | f2; } \ -Q_DECL_CONSTEXPR inline QFlags operator|(Flags::enum_type f1, QFlags f2) \ -{ return f2 | f1; } Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) - - -#else /* Q_NO_TYPESAFE_FLAGS */ - -#define Q_DECLARE_FLAGS(Flags, Enum)\ -typedef uint Flags; -#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) - -#endif /* Q_NO_TYPESAFE_FLAGS */ - #if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_RVCT) /* make use of typeof-extension */ template @@ -1457,7 +1373,7 @@ QT_END_HEADER // qDebug and friends #include - +#include #include #include -- cgit v1.2.3 From 53112c51674680a55bcf3104352175528af19e9f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 28 Mar 2012 16:54:52 -0300 Subject: Remove Q_CORE_EXPORT from the simple QFlag and QIncompatibleFlag Change-Id: I0302238e817fc7d3b4682c5cc4f9cb51d181a7d2 Reviewed-by: Olivier Goffart --- src/corelib/global/qflags.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h index 7406185520..349f227002 100644 --- a/src/corelib/global/qflags.h +++ b/src/corelib/global/qflags.h @@ -48,7 +48,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class Q_CORE_EXPORT QFlag +class QFlag { int i; public: @@ -58,7 +58,7 @@ public: inline QFlag::QFlag(int ai) : i(ai) {} -class Q_CORE_EXPORT QIncompatibleFlag +class QIncompatibleFlag { int i; public: -- cgit v1.2.3 From d1329e43cbb243f3b28d172569befc0c28f49b8b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Wed, 11 Apr 2012 14:10:12 +0200 Subject: moc: fix compilation of signals returning pointers. That was a regression introduced in 1c5db1aff Example: signals: int *someSignal(); would produce this code: int* _t0 = int*(); which does not compile So have special handling for pointer to change it to '= 0' Change-Id: Ie695e15e309d15c3cfd5c5a69ac8bf6d61ae9915 Reviewed-by: Stephen Kelly --- src/tools/moc/generator.cpp | 10 ++++++++-- tests/auto/corelib/kernel/qobject/tst_qobject.cpp | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index ac602fd6e8..608d53c1f2 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -1036,8 +1036,14 @@ void Generator::generateSignal(FunctionDef *def,int index) fprintf(out, "%s _t%d%s", a.type.name.constData(), offset++, a.rightType.constData()); } fprintf(out, ")%s\n{\n", constQualifier); - if (def->type.name.size() && def->normalizedType.size()) - fprintf(out, " %s _t0 = %s();\n", noRef(def->normalizedType).constData(), noRef(def->normalizedType).constData()); + if (def->type.name.size() && def->normalizedType.size()) { + QByteArray returnType = noRef(def->normalizedType); + if (returnType.endsWith('*')) { + fprintf(out, " %s _t0 = 0;\n", returnType.constData()); + } else { + fprintf(out, " %s _t0 = %s();\n", returnType.constData(), returnType.constData()); + } + } fprintf(out, " void *_a[] = { "); if (def->normalizedType.isEmpty()) { diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index a6ad1d53bc..f7f13e65ea 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -4904,6 +4904,8 @@ signals: int returnInt(int); void returnVoid(int); CustomType returnCustomType(int); + + QObject *returnPointer(); public slots: QVariant returnVariantSlot(int i) { return i; } QString returnStringSlot(int i) { return QString::number(i); } @@ -4912,6 +4914,8 @@ public slots: void returnVoidSlot() {} int return23() { return 23; } QString returnHello() { return QStringLiteral("hello"); } + QObject *returnThisSlot1() { return this; } + ReturnValue *returnThisSlot2() { return this; } public: struct VariantFunctor { QVariant operator()(int i) { return i; } @@ -4964,6 +4968,7 @@ void tst_QObject::returnValue() QCOMPARE(emit r.returnInt(45), int()); emit r.returnVoid(45); QCOMPARE((emit r.returnCustomType(45)).value(), CustomType().value()); + QCOMPARE((emit r.returnPointer()), static_cast(0)); } { // connected to a slot returning the same type CheckInstanceCount checker; @@ -4976,6 +4981,8 @@ void tst_QObject::returnValue() QCOMPARE(emit r.returnInt(45), int(45)); QVERIFY(connect(&r, &ReturnValue::returnCustomType, &receiver, &ReturnValue::returnCustomTypeSlot, type)); QCOMPARE((emit r.returnCustomType(45)).value(), CustomType(45).value()); + QVERIFY(connect(&r, &ReturnValue::returnPointer, &receiver, &ReturnValue::returnThisSlot1, type)); + QCOMPARE((emit r.returnPointer()), static_cast(&receiver)); } if (!isBlockingQueued) { // connected to simple functions or functor CheckInstanceCount checker; @@ -5004,6 +5011,8 @@ void tst_QObject::returnValue() QCOMPARE((emit r.returnCustomType(48)).value(), CustomType(48).value()); QVERIFY(connect(&r, &ReturnValue::returnVoid, &receiver, &ReturnValue::returnCustomTypeSlot, type)); emit r.returnVoid(48); + QVERIFY(connect(&r, &ReturnValue::returnPointer, &receiver, &ReturnValue::returnThisSlot2, type)); + QCOMPARE((emit r.returnPointer()), static_cast(&receiver)); } if (!isBlockingQueued) { // connected to functor with different type CheckInstanceCount checker; @@ -5028,6 +5037,8 @@ void tst_QObject::returnValue() QCOMPARE(emit r.returnInt(45), int()); QVERIFY(connect(&r, &ReturnValue::returnCustomType, &receiver, &ReturnValue::returnVoidSlot, type)); QCOMPARE((emit r.returnCustomType(45)).value(), CustomType().value()); + QVERIFY(connect(&r, &ReturnValue::returnPointer, &receiver, &ReturnValue::returnVoidSlot, type)); + QCOMPARE((emit r.returnPointer()), static_cast(0)); } if (!isBlockingQueued) { // queued connection should not forward the return value @@ -5041,6 +5052,9 @@ void tst_QObject::returnValue() QCOMPARE(emit r.returnInt(45), int()); QVERIFY(connect(&r, &ReturnValue::returnCustomType, &receiver, &ReturnValue::returnCustomTypeSlot, Qt::QueuedConnection)); QCOMPARE((emit r.returnCustomType(45)).value(), CustomType().value()); + QVERIFY(connect(&r, &ReturnValue::returnPointer, &receiver, &ReturnValue::returnThisSlot1, Qt::QueuedConnection)); + QCOMPARE((emit r.returnPointer()), static_cast(0)); + QCoreApplication::processEvents(); QVERIFY(connect(&r, &ReturnValue::returnVariant, &receiver, &ReturnValue::returnStringSlot, Qt::QueuedConnection)); -- cgit v1.2.3 From 01b54bcd84d9a2129f2db4fe03a5f331f9eec203 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 16 Mar 2012 22:50:30 +0100 Subject: device: Introduce hooks for the directfb plugin and use them The EGL integration is vendor specific, add platform hooks to the DirectFB plugin and implement them for the Broadcom 97425. The hook interface is internal and there are no ABI/API gurantees. Change-Id: I33359830c51f16895e771837fccb71e03c81cf18 Reviewed-by: Girish Ramakrishnan --- .../qdirectfbeglhooks_bcm97425.cpp | 71 ++++++++++++++++++++++ .../linux-mipsel-broadcom-97425-g++/qmake.conf | 4 ++ src/plugins/platforms/directfb/directfb.pro | 13 +++- src/plugins/platforms/directfb/qdirectfb_egl.cpp | 22 ++++++- src/plugins/platforms/directfb/qdirectfb_egl.h | 2 + src/plugins/platforms/directfb/qdirectfbeglhooks.h | 57 +++++++++++++++++ .../platforms/directfb/qdirectfbeglhooks_stub.cpp | 61 +++++++++++++++++++ 7 files changed, 226 insertions(+), 4 deletions(-) create mode 100644 mkspecs/devices/linux-mipsel-broadcom-97425-g++/qdirectfbeglhooks_bcm97425.cpp create mode 100644 src/plugins/platforms/directfb/qdirectfbeglhooks.h create mode 100644 src/plugins/platforms/directfb/qdirectfbeglhooks_stub.cpp diff --git a/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qdirectfbeglhooks_bcm97425.cpp b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qdirectfbeglhooks_bcm97425.cpp new file mode 100644 index 0000000000..16aee0c4f7 --- /dev/null +++ b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qdirectfbeglhooks_bcm97425.cpp @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the qmake spec of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qdirectfbeglhooks.h" +#include "qdirectfbconvenience.h" + +#include "default_directfb.h" + +// Exported to the directfb plugin +QDirectFBEGLHooks platform_hook; +static void *dbpl_handle; + +void QDirectFBEGLHooks::platformInit() +{ + DBPL_RegisterDirectFBDisplayPlatform(&dbpl_handle, QDirectFbConvenience::dfbInterface()); +} + +void QDirectFBEGLHooks::platformDestroy() +{ + DBPL_UnregisterDirectFBDisplayPlatform(&dbpl_handle); + dbpl_handle = 0; +} + +bool QDirectFBEGLHooks::hasCapability(QPlatformIntegration::Capability cap) const +{ + switch (cap) { + case QPlatformIntegration::ThreadedOpenGL: + return true; + default: + return false; + } +} + diff --git a/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf index 866fad639b..ced323feba 100644 --- a/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf +++ b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf @@ -62,4 +62,8 @@ DIRECTFB_LIBS = -L$${BRCM_APPLIBS_PATH}/opensource/directfb/bin/Direct QMAKE_LFLAGS += -Wl,-rpath-link,$$QMAKE_LIBDIR_OPENGL_ES2 -Wl,-rpath-link,$${BRCM_APPLIBS_PATH}/opensource/zlib/zlib-1.2.3 +# DirectFB platform hooks for this hardware +QT_CONFIG += directfb_egl +DIRECTFB_PLATFORM_HOOKS_SOURCES = $$PWD/qdirectfbeglhooks_bcm97425.cpp + load(qt_config) diff --git a/src/plugins/platforms/directfb/directfb.pro b/src/plugins/platforms/directfb/directfb.pro index ae47ec397b..2251b8f278 100644 --- a/src/plugins/platforms/directfb/directfb.pro +++ b/src/plugins/platforms/directfb/directfb.pro @@ -30,15 +30,24 @@ HEADERS = qdirectfbintegration.h \ qdirectfbinput.h \ qdirectfbcursor.h \ qdirectfbwindow.h \ - qdirectfbscreen.h + qdirectfbscreen.h \ + qdirectfbeglhooks.h # ### port the GL context -directfbegl: { +directfb_egl { HEADERS += qdirectfb_egl.h SOURCES += qdirectfb_egl.cpp DEFINES += DIRECTFB_GL_EGL } +!isEmpty(DIRECTFB_PLATFORM_HOOKS_SOURCES) { + HEADERS += $$DIRECTFB_PLATFORM_HOOKS_HEADERS + SOURCES += $$DIRECTFB_PLATFORM_HOOKS_SOURCES + DEFINES += DIRECTFB_PLATFORM_HOOKS +} else { + SOURCES += qdirectfbeglhooks_stub.cpp +} + CONFIG += qpa/genericunixfontdatabase target.path += $$[QT_INSTALL_PLUGINS]/platforms diff --git a/src/plugins/platforms/directfb/qdirectfb_egl.cpp b/src/plugins/platforms/directfb/qdirectfb_egl.cpp index ee0cbbae95..ac9142c0f4 100644 --- a/src/plugins/platforms/directfb/qdirectfb_egl.cpp +++ b/src/plugins/platforms/directfb/qdirectfb_egl.cpp @@ -42,6 +42,7 @@ #include "qdirectfb_egl.h" #include "qdirectfbwindow.h" #include "qdirectfbscreen.h" +#include "qdirectfbeglhooks.h" #include #include @@ -54,6 +55,13 @@ QT_BEGIN_NAMESPACE +#ifdef DIRECTFB_PLATFORM_HOOKS +extern QDirectFBEGLHooks platform_hook; +static QDirectFBEGLHooks *hooks = &platform_hook; +#else +static QDirectFBEGLHooks *hooks = 0; +#endif + /** * This provides OpenGL ES 2.0 integration with DirectFB. It assumes that * one can adapt a DirectFBSurface as a EGLSurface. It might need some vendor @@ -137,12 +145,14 @@ void QDirectFbScreenEGL::initializeEGL() void QDirectFbScreenEGL::platformInit() { - // Place vendor init code here. + if (hooks) + hooks->platformInit(); } void QDirectFbScreenEGL::platformDestroy() { - // Place vendor finalize code here. + if (hooks) + hooks->platformDestroy(); } QDirectFbWindowEGL::QDirectFbWindowEGL(QWindow *tlw, QDirectFbInput *input) @@ -209,4 +219,12 @@ void QDirectFbIntegrationEGL::initializeScreen() screenAdded(m_primaryScreen.data()); } +bool QDirectFbIntegrationEGL::hasCapability(QPlatformIntegration::Capability cap) const +{ + // We assume that devices will have more and not less capabilities + if (hooks && hooks->hasCapability(cap)) + return true; + return QDirectFbIntegration::hasCapability(cap); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/directfb/qdirectfb_egl.h b/src/plugins/platforms/directfb/qdirectfb_egl.h index 88f7e60e99..7781b17831 100644 --- a/src/plugins/platforms/directfb/qdirectfb_egl.h +++ b/src/plugins/platforms/directfb/qdirectfb_egl.h @@ -53,6 +53,8 @@ public: QPlatformWindow *createPlatformWindow(QWindow *window) const; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; + bool hasCapability(QPlatformIntegration::Capability cap) const; + protected: void initializeScreen(); }; diff --git a/src/plugins/platforms/directfb/qdirectfbeglhooks.h b/src/plugins/platforms/directfb/qdirectfbeglhooks.h new file mode 100644 index 0000000000..d0711b62dd --- /dev/null +++ b/src/plugins/platforms/directfb/qdirectfbeglhooks.h @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QDIRECTFBEGL_HOOKS_H +#define QDIRECTFBEGL_HOOKS_H + +#include "qplatformintegration_qpa.h" + +QT_BEGIN_NAMESPACE + +struct QDirectFBEGLHooks { + void platformInit(); + void platformDestroy(); + bool hasCapability(QPlatformIntegration::Capability) const; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/platforms/directfb/qdirectfbeglhooks_stub.cpp b/src/plugins/platforms/directfb/qdirectfbeglhooks_stub.cpp new file mode 100644 index 0000000000..753a9d4372 --- /dev/null +++ b/src/plugins/platforms/directfb/qdirectfbeglhooks_stub.cpp @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qdirectfbeglhooks.h" + +/** + * This file is compiled in case there is no platform specific hook. On an + * optimizing compiler these functions should never be called. + */ + +void QDirectFBEGLHooks::platformInit() +{ +} + +void QDirectFBEGLHooks::platformDestroy() +{ +} + +bool QDirectFBEGLHooks::hasCapability(QPlatformIntegration::Capability) const +{ + return false; +} + -- cgit v1.2.3 From 5ab6a3270d1121fb4d50c3f79f497a9c52d5afa8 Mon Sep 17 00:00:00 2001 From: Hannu Lyytinen Date: Thu, 12 Apr 2012 15:09:52 +0300 Subject: Implement basic bits for device autodetection via udev. The graphics cards and eventually the input devices need to be resolved via udev. This commit adds a listener class and an abstract base class for writing device specific handlers. Change-Id: I62784c98bc7ad4bc1431d61cd5f13c8b48edf330 Reviewed-by: Andy Nichols --- src/plugins/platforms/kms/kms.pro | 10 ++- src/plugins/platforms/kms/qkmsudevhandler.cpp | 55 ++++++++++++++ src/plugins/platforms/kms/qkmsudevhandler.h | 64 ++++++++++++++++ src/plugins/platforms/kms/qkmsudevlistener.cpp | 101 +++++++++++++++++++++++++ src/plugins/platforms/kms/qkmsudevlistener.h | 78 +++++++++++++++++++ 5 files changed, 305 insertions(+), 3 deletions(-) create mode 100644 src/plugins/platforms/kms/qkmsudevhandler.cpp create mode 100644 src/plugins/platforms/kms/qkmsudevhandler.h create mode 100644 src/plugins/platforms/kms/qkmsudevlistener.cpp create mode 100644 src/plugins/platforms/kms/qkmsudevlistener.h diff --git a/src/plugins/platforms/kms/kms.pro b/src/plugins/platforms/kms/kms.pro index 93d972abe8..7c0cc79160 100644 --- a/src/plugins/platforms/kms/kms.pro +++ b/src/plugins/platforms/kms/kms.pro @@ -8,7 +8,7 @@ DEFINES += MESA_EGL_NO_X11_HEADERS CONFIG += link_pkgconfig egl qpa/genericunixfontdatabase -PKGCONFIG += libdrm egl gbm glesv2 +PKGCONFIG += libdrm libudev egl gbm glesv2 SOURCES = main.cpp \ qkmsintegration.cpp \ @@ -19,7 +19,9 @@ SOURCES = main.cpp \ qkmsdevice.cpp \ qkmsbuffermanager.cpp \ qkmsbackingstore.cpp \ - qkmsnativeinterface.cpp + qkmsnativeinterface.cpp \ + qkmsudevlistener.cpp \ + qkmsudevhandler.cpp HEADERS = qkmsintegration.h \ qkmsscreen.h \ qkmscontext.h \ @@ -28,7 +30,9 @@ HEADERS = qkmsintegration.h \ qkmsdevice.h \ qkmsbuffermanager.h \ qkmsbackingstore.h \ - qkmsnativeinterface.h + qkmsnativeinterface.h \ + qkmsudevlistener.h \ + qkmsudevhandler.h target.path += $$[QT_INSTALL_PLUGINS]/platforms INSTALLS += target diff --git a/src/plugins/platforms/kms/qkmsudevhandler.cpp b/src/plugins/platforms/kms/qkmsudevhandler.cpp new file mode 100644 index 0000000000..c0ec4c4ba1 --- /dev/null +++ b/src/plugins/platforms/kms/qkmsudevhandler.cpp @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QT_BEGIN_NAMESPACE + +QKmsUdevHandler::QKmsUdevHandler(QObject *parent) + : QObject(parent) +{ +} + +QKmsUdevHandler::~QKmsUdevHandler() +{ +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/kms/qkmsudevhandler.h b/src/plugins/platforms/kms/qkmsudevhandler.h new file mode 100644 index 0000000000..4870809927 --- /dev/null +++ b/src/plugins/platforms/kms/qkmsudevhandler.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QKMSUDEVHANDLER_H +#define QKMSUDEVHANDLER_H + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QKmsUdevHandler : public QObject +{ + Q_OBJECT + +public: + QKmsUdevHandler(QObject *parent = 0); + virtual ~QKmsUdevHandler(); + + virtual QObject *create(struct udev_device *) = 0; +}; + +QT_END_NAMESPACE + +#endif // QKMSUDEVHANDLER_H diff --git a/src/plugins/platforms/kms/qkmsudevlistener.cpp b/src/plugins/platforms/kms/qkmsudevlistener.cpp new file mode 100644 index 0000000000..c0a933b57b --- /dev/null +++ b/src/plugins/platforms/kms/qkmsudevlistener.cpp @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QT_BEGIN_NAMESPACE + +QKmsUdevListener::QKmsUdevListener(QObject *parent) + : QObject(parent) +{ + m_udev = udev_new(); +} + +QKmsUdevListener::~QKmsUdevListener() +{ + udev_unref(m_udev); +} + +void QKmsUdevListener::addHandler(QKmsUdevHandler *handler) +{ + m_handlers.removeAll((QKmsUdevHandler *) 0); + m_handlers.removeAll(handler); + m_handlers.prepend(handler); + + scan(); +} + +bool QKmsUdevListener::create(struct udev_device *device) +{ + foreach (QKmsUdevHandler *handler, m_handlers) { + if (!handler) + continue; + + QObject *obj = handler->create(device); + if (obj) { + m_devices[udev_device_get_syspath(device)] = obj; + return true; + } + } + + return false; +} + +void QKmsUdevListener::scan() +{ + struct udev_enumerate *e; + struct udev_list_entry *entry; + + e = udev_enumerate_new(m_udev); + udev_enumerate_scan_devices(e); + udev_list_entry_foreach(entry, udev_enumerate_get_list_entry(e)) { + const char *path = udev_list_entry_get_name(entry); + if (m_devices.contains(path)) + continue; + + struct udev_device *device = udev_device_new_from_syspath(m_udev, path); + create(device); + udev_device_unref(device); + } + udev_enumerate_unref(e); +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/kms/qkmsudevlistener.h b/src/plugins/platforms/kms/qkmsudevlistener.h new file mode 100644 index 0000000000..3d87cfe662 --- /dev/null +++ b/src/plugins/platforms/kms/qkmsudevlistener.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QKMSUDEVLISTENER_H +#define QKMSUDEVLISTENER_H + +#include +#include +#include +#include +#include + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QKmsUdevListener : public QObject +{ + Q_OBJECT + +public: + QKmsUdevListener(QObject *parent = 0); + ~QKmsUdevListener(); + + void addHandler(QKmsUdevHandler *); + +private: + QList > m_handlers; + QMap > m_devices; + struct udev *m_udev; + + void scan(); + bool create(struct udev_device *); +}; + +QT_END_NAMESPACE + +#endif // QKMSUDEVLISTENER_H -- cgit v1.2.3 From 2a5ade68fd4b536c766de395d2657cd37c9bb98b Mon Sep 17 00:00:00 2001 From: Hannu Lyytinen Date: Thu, 12 Apr 2012 15:15:26 +0300 Subject: Use the new udev based framework for detecting graphics cards. Get rid of hard coded device node and support any number of graphics cards. Change-Id: I50f07fb1e6ea321a4ae751db8fb49ab439dce51e Reviewed-by: Andy Nichols --- src/plugins/platforms/kms/kms.pro | 6 ++- src/plugins/platforms/kms/qkmsintegration.cpp | 27 +++++----- src/plugins/platforms/kms/qkmsintegration.h | 9 +++- src/plugins/platforms/kms/qkmsudevdrmhandler.cpp | 66 ++++++++++++++++++++++++ src/plugins/platforms/kms/qkmsudevdrmhandler.h | 66 ++++++++++++++++++++++++ 5 files changed, 157 insertions(+), 17 deletions(-) create mode 100644 src/plugins/platforms/kms/qkmsudevdrmhandler.cpp create mode 100644 src/plugins/platforms/kms/qkmsudevdrmhandler.h diff --git a/src/plugins/platforms/kms/kms.pro b/src/plugins/platforms/kms/kms.pro index 7c0cc79160..f97973b1a1 100644 --- a/src/plugins/platforms/kms/kms.pro +++ b/src/plugins/platforms/kms/kms.pro @@ -21,7 +21,8 @@ SOURCES = main.cpp \ qkmsbackingstore.cpp \ qkmsnativeinterface.cpp \ qkmsudevlistener.cpp \ - qkmsudevhandler.cpp + qkmsudevhandler.cpp \ + qkmsudevdrmhandler.cpp HEADERS = qkmsintegration.h \ qkmsscreen.h \ qkmscontext.h \ @@ -32,7 +33,8 @@ HEADERS = qkmsintegration.h \ qkmsbackingstore.h \ qkmsnativeinterface.h \ qkmsudevlistener.h \ - qkmsudevhandler.h + qkmsudevhandler.h \ + qkmsudevdrmhandler.h target.path += $$[QT_INSTALL_PLUGINS]/platforms INSTALLS += target diff --git a/src/plugins/platforms/kms/qkmsintegration.cpp b/src/plugins/platforms/kms/qkmsintegration.cpp index 74346e8097..0405330617 100644 --- a/src/plugins/platforms/kms/qkmsintegration.cpp +++ b/src/plugins/platforms/kms/qkmsintegration.cpp @@ -46,6 +46,8 @@ #include "qkmsbackingstore.h" #include "qkmscontext.h" #include "qkmsnativeinterface.h" +#include "qkmsudevlistener.h" +#include "qkmsudevdrmhandler.h" #include #include @@ -60,14 +62,13 @@ QKmsIntegration::QKmsIntegration() : QPlatformIntegration(), m_fontDatabase(new QGenericUnixFontDatabase()), m_eventDispatcher(createUnixEventDispatcher()), - m_nativeInterface(new QKmsNativeInterface) + m_nativeInterface(new QKmsNativeInterface), + m_udevListener(new QKmsUdevListener) { QGuiApplicationPrivate::instance()->setEventDispatcher(m_eventDispatcher); setenv("EGL_PLATFORM", "drm",1); - QStringList drmDevices = findDrmDevices(); - foreach (QString path, drmDevices) { - m_devices.append(new QKmsDevice(path, this)); - } + m_drmHandler = new QKmsUdevDRMHandler(this); + m_udevListener->addHandler(m_drmHandler); } QKmsIntegration::~QKmsIntegration() @@ -79,6 +80,14 @@ QKmsIntegration::~QKmsIntegration() delete screen; } delete m_fontDatabase; + delete m_udevListener; +} + +QObject *QKmsIntegration::createDevice(const char *path) +{ + QKmsDevice *device = new QKmsDevice(path, this); + m_devices.append(device); + return device; } bool QKmsIntegration::hasCapability(QPlatformIntegration::Capability cap) const @@ -112,14 +121,6 @@ QPlatformFontDatabase *QKmsIntegration::fontDatabase() const return m_fontDatabase; } -QStringList QKmsIntegration::findDrmDevices() -{ - //Return a list addresses of DRM supported devices - //Hardcoded now, but could use udev to return a list - //of multiple devices. - return QStringList(QString::fromLatin1("/dev/dri/card0")); -} - void QKmsIntegration::addScreen(QKmsScreen *screen) { m_screens.append(screen); diff --git a/src/plugins/platforms/kms/qkmsintegration.h b/src/plugins/platforms/kms/qkmsintegration.h index 96d030f849..03fc5080a6 100644 --- a/src/plugins/platforms/kms/qkmsintegration.h +++ b/src/plugins/platforms/kms/qkmsintegration.h @@ -49,6 +49,8 @@ QT_BEGIN_NAMESPACE class QKmsScreen; class QKmsDevice; +class QKmsUdevListener; +class QKmsUdevDRMHandler; class QKmsIntegration : public QPlatformIntegration { @@ -65,10 +67,11 @@ public: QPlatformFontDatabase *fontDatabase() const; QAbstractEventDispatcher *guiThreadEventDispatcher() const; - void addScreen(QKmsScreen *screen); - QPlatformNativeInterface *nativeInterface() const; + void addScreen(QKmsScreen *screen); + QObject *createDevice(const char *); + private: QStringList findDrmDevices(); @@ -77,6 +80,8 @@ private: QPlatformFontDatabase *m_fontDatabase; QAbstractEventDispatcher *m_eventDispatcher; QPlatformNativeInterface *m_nativeInterface; + QKmsUdevListener *m_udevListener; + QKmsUdevDRMHandler *m_drmHandler; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/kms/qkmsudevdrmhandler.cpp b/src/plugins/platforms/kms/qkmsudevdrmhandler.cpp new file mode 100644 index 0000000000..0f59de4cef --- /dev/null +++ b/src/plugins/platforms/kms/qkmsudevdrmhandler.cpp @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include +#include + +QT_BEGIN_NAMESPACE + +QKmsUdevDRMHandler::QKmsUdevDRMHandler(QKmsIntegration *integration) + : m_integration(integration) +{ +} + +QObject *QKmsUdevDRMHandler::create(struct udev_device *device) +{ + if (strcmp(udev_device_get_subsystem(device), "drm")) + return 0; + + QRegExp regexp("^card\\d+$"); + if (!regexp.exactMatch(udev_device_get_sysname(device))) + return 0; + + return m_integration->createDevice(udev_device_get_devnode(device)); +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/kms/qkmsudevdrmhandler.h b/src/plugins/platforms/kms/qkmsudevdrmhandler.h new file mode 100644 index 0000000000..d627fec1c6 --- /dev/null +++ b/src/plugins/platforms/kms/qkmsudevdrmhandler.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** 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, Nokia gives you certain additional +** rights. These rights are described in the Nokia 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. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QKMSUDEVDRMHANDLER_H +#define QKMSUDEVDRMHANDLER_H + +#include + +#include + +QT_BEGIN_NAMESPACE + +class QKmsIntegration; + +class QKmsUdevDRMHandler : public QKmsUdevHandler +{ +public: + QKmsUdevDRMHandler(QKmsIntegration *integration); + + QObject *create(struct udev_device *device); + +private: + QKmsIntegration *m_integration; +}; + +QT_END_NAMESPACE + +#endif // QKMSUDEVDRMHANDLER_H -- cgit v1.2.3 From e07cadecc22b668b13e52ac85a4fddb4631aebb5 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 12 Apr 2012 15:40:00 -0300 Subject: __builtin_unreachable was added to GCC in version 4.5, so fix macros Change-Id: Ida63bb46f696ae9d60331d863bf1478415a08ff2 Reviewed-by: Olivier Goffart --- src/corelib/global/qcompilerdetection.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index a043e5e072..94befa9ab8 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -153,8 +153,10 @@ # define Q_UNREACHABLE() __builtin_unreachable() # else /* Plain GCC */ -# define Q_ASSUME(expr) if (expr){} else __builtin_unreachable() -# define Q_UNREACHABLE() __builtin_unreachable() +# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405 +# define Q_ASSUME(expr) if (expr){} else __builtin_unreachable() +# define Q_UNREACHABLE() __builtin_unreachable() +# endif # endif # define Q_ALIGNOF(type) __alignof__(type) -- cgit v1.2.3 From 58ac4658c17ae120856235bd23727564cd4f67e2 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Wed, 11 Apr 2012 20:08:29 +0200 Subject: test: Re-enabling tst_QScrollBar::task_209492() on Mac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This test has been XPASS'ing since a long time now. Change-Id: Ibfcd1b5078e0b8efed9ed0740a4238d24ef8ca33 Reviewed-by: Rohan McGovern Reviewed-by: Morten Johan Sørvig Reviewed-by: Bradley T. Hughes --- tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp index 688daf1f8a..ec48c2b680 100644 --- a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp +++ b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp @@ -136,9 +136,6 @@ void tst_QScrollBar::task_209492() QApplication::sendEvent(verticalScrollBar, &mouseReleaseEvent); // Check that the action was triggered once. -#ifdef Q_OS_MAC - QEXPECT_FAIL("", "Fix does does not work on Mac due to paint architechure differences.", Abort); -#endif QCOMPARE(scrollArea.scrollCount, 1); QCOMPARE(spy.count(), 1); } -- cgit v1.2.3 From fe0f72fa1a01c41c020afcb95acd503a8dca3a8a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 29 Mar 2012 12:55:12 +0200 Subject: Implement modality in the Windows plugin. Disable blocked windows and flash the active window if a blocked one is activated (as in Qt 4). Change-Id: I6b6d230f94a271ce2aa649e3f4e13ebd63e93da4 Reviewed-by: Bradley T. Hughes --- src/plugins/platforms/windows/qwindowscontext.cpp | 6 +++ src/plugins/platforms/windows/qwindowswindow.cpp | 60 +++++++++++++++++++++++ src/plugins/platforms/windows/qwindowswindow.h | 11 ++++- 3 files changed, 76 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 17420d271d..0075b875ce 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -791,6 +792,11 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, if (QWindowsTheme *theme = QWindowsTheme::instance()) theme->windowsThemeChanged(platformWindow->window()); return true; + case QtWindows::ActivateWindowEvent: + if (platformWindow->testFlag(QWindowsWindow::BlockedByModal)) + if (const QWindow *modalWindow = QGuiApplication::modalWindow()) + QWindowsWindow::baseWindowOf(modalWindow)->alertWindow(); + break; default: break; } diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 2b86d069ab..453838ac07 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1194,6 +1194,22 @@ void QWindowsWindow::lower() SetWindowPos(m_data.hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); } +void QWindowsWindow::windowEvent(QEvent *event) +{ + switch (event->type()) { + case QEvent::WindowBlocked: // Blocked by another modal window. + setEnabled(false); + setFlag(BlockedByModal); + break; + case QEvent::WindowUnblocked: + setEnabled(true); + clearFlag(BlockedByModal); + break; + default: + break; + } +} + void QWindowsWindow::propagateSizeHints() { if (QWindowsContext::verboseWindows) @@ -1354,6 +1370,50 @@ QWindowsWindow *QWindowsWindow::childAt(const QPoint &clientPoint, unsigned cwex return 0; } +void QWindowsWindow::alertWindow(int durationMs) +{ + DWORD timeOutMs = GetCaretBlinkTime(); + if (!timeOutMs || timeOutMs == INFINITE) + timeOutMs = 250; + + FLASHWINFO info; + info.cbSize = sizeof(info); + info.hwnd = m_data.hwnd; + info.dwFlags = FLASHW_TRAY; + info.dwTimeout = timeOutMs; + info.uCount = durationMs == 0 ? 10 : durationMs / timeOutMs; + FlashWindowEx(&info); +} + +void QWindowsWindow::stopAlertWindow() +{ + FLASHWINFO info; + info.cbSize = sizeof(info); + info.hwnd = m_data.hwnd; + info.dwFlags = FLASHW_STOP; + info.dwTimeout = 0; + info.uCount = 0; + FlashWindowEx(&info); +} + +bool QWindowsWindow::isEnabled() const +{ + return (style() & WS_DISABLED) == 0; +} + +void QWindowsWindow::setEnabled(bool enabled) +{ + const unsigned oldStyle = style(); + unsigned newStyle = oldStyle; + if (enabled) { + newStyle &= ~WS_DISABLED; + } else { + newStyle |= WS_DISABLED; + } + if (newStyle != oldStyle) + setStyle(newStyle); +} + QByteArray QWindowsWindow::debugWindowFlags(Qt::WindowFlags wf) { const int iwf = int(wf); diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index e3336d1c3a..badc229718 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -100,7 +100,8 @@ public: FrameDirty = 0x4, //! Frame outdated by setStyle, recalculate in next query. OpenGLSurface = 0x10, OpenGLDoubleBuffered = 0x20, - OpenGlPixelFormatInitialized = 0x40 + OpenGlPixelFormatInitialized = 0x40, + BlockedByModal = 0x80 }; struct WindowData @@ -137,6 +138,8 @@ public: virtual void raise(); virtual void lower(); + void windowEvent(QEvent *event); + virtual void propagateSizeHints(); virtual QMargins frameMargins() const; @@ -189,6 +192,12 @@ public: inline void setFlag(unsigned f) const { m_flags |= f; } inline void clearFlag(unsigned f) const { m_flags &= ~f; } + void setEnabled(bool enabled); + bool isEnabled() const; + + void alertWindow(int durationMs = 0); + void stopAlertWindow(); + private: inline void show_sys() const; inline void hide_sys() const; -- cgit v1.2.3 From 5bf5ace38c3e63eb9110c69c74fbf4b66542c02e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Thu, 12 Apr 2012 09:39:24 +0200 Subject: Prevent warning when using QPainter on a QGLWidget. Prevents warning "QOpenGLContext::swapBuffers() called without corresponding makeCurrent()". Change-Id: I7e4f94df8654f899c25b3f41cbf4d007ca293f16 Reviewed-by: Gunnar Sletta --- src/opengl/qglpaintdevice.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp index 66a97a2ea5..dc77c0fbbb 100644 --- a/src/opengl/qglpaintdevice.cpp +++ b/src/opengl/qglpaintdevice.cpp @@ -76,8 +76,7 @@ void QGLPaintDevice::beginPaint() { // Make sure our context is the current one: QGLContext *ctx = context(); - if (ctx != QGLContext::currentContext()) - ctx->makeCurrent(); + ctx->makeCurrent(); // Record the currently bound FBO so we can restore it again // in endPaint() and bind this device's FBO -- cgit v1.2.3 From db094dfae1d4f3577be112e0c9e595811c5125f3 Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Thu, 12 Apr 2012 10:11:59 +0200 Subject: QDoc: Fix infinite loop when finding items in ditamaps. Change-Id: Ic033676e21a252db07543fccba0d2a41f4b52294 Reviewed-by: Martin Smith --- src/tools/qdoc/ditaxmlgenerator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index 7b499a52e1..10641b0fab 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -5993,9 +5993,10 @@ void DitaXmlGenerator::writeTopicrefs(NodeMultiMap* nmm, const QString& navtitle for (int count = 0; count < dmNode->map().count(); count++) { if (dmNode->map().at(count)->navtitle() == i.key()) { foundInDitaMap = true; + break; } - ++mapIterator; } + ++mapIterator; } if (!foundInDitaMap) { writeStartTag(DT_topicref); -- cgit v1.2.3 From 75fb4efeae77896733f1991f83106697fa611c8a Mon Sep 17 00:00:00 2001 From: Qt4iOS Date: Sat, 24 Mar 2012 14:12:43 +0000 Subject: Added iOS compatibility. Put MacOS-specific code into #ifdef blocks to enable compilation on iOS. Change-Id: I0bb3846f457d1b3a56d99fe182b1718bc8429117 Reviewed-by: Shane Kearns --- src/network/ssl/qsslsocket_openssl.cpp | 6 +++--- src/network/ssl/qsslsocket_p.h | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 0e55f5134c..44d579995b 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) #define kSecTrustSettingsDomainSystem 2 // so we do not need to include the header file PtrSecCertificateGetData QSslSocketPrivate::ptrSecCertificateGetData = 0; PtrSecTrustSettingsCopyCertificates QSslSocketPrivate::ptrSecTrustSettingsCopyCertificates = 0; @@ -612,7 +612,7 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded() resetDefaultCiphers(); //load symbols needed to receive certificates from system store -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) QLibrary securityLib("/System/Library/Frameworks/Security.framework/Versions/Current/Security"); if (securityLib.load()) { ptrSecCertificateGetData = (PtrSecCertificateGetData) securityLib.resolve("SecCertificateGetData"); @@ -745,7 +745,7 @@ QList QSslSocketPrivate::systemCaCertificates() timer.start(); #endif QList systemCerts; -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) CFArrayRef cfCerts; OSStatus status = 1; diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h index e5d1144c2c..aab29a84ba 100644 --- a/src/network/ssl/qsslsocket_p.h +++ b/src/network/ssl/qsslsocket_p.h @@ -69,9 +69,11 @@ QT_BEGIN_NAMESPACE #if defined(Q_OS_MAC) #include #include +#ifndef QT_NO_CORESERVICES typedef OSStatus (*PtrSecCertificateGetData)(SecCertificateRef, CSSM_DATA_PTR); typedef OSStatus (*PtrSecTrustSettingsCopyCertificates)(int, CFArrayRef*); typedef OSStatus (*PtrSecTrustCopyAnchorCertificates)(CFArrayRef*); +#endif #elif defined(Q_OS_WIN) #include #include @@ -134,7 +136,7 @@ public: static void addDefaultCaCertificate(const QSslCertificate &cert); static void addDefaultCaCertificates(const QList &certs); -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) static PtrSecCertificateGetData ptrSecCertificateGetData; static PtrSecTrustSettingsCopyCertificates ptrSecTrustSettingsCopyCertificates; static PtrSecTrustCopyAnchorCertificates ptrSecTrustCopyAnchorCertificates; -- cgit v1.2.3 From dcd893fbf7fbbc28df13ff26888bf983e86c0dbd Mon Sep 17 00:00:00 2001 From: Qt4iOS Date: Sat, 24 Mar 2012 14:15:29 +0000 Subject: Added iOS compatibility. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified OpenGL header inclusion block to support iOS GL include paths. Removed ability to build for MacOS with GLES2, as no support on MacOS for OpenGLES. Change-Id: I2bcf302278545147632b23a86380fa3980ec10a4 Reviewed-by: Morten Johan Sørvig --- src/opengl/qgl.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h index 6903d3278c..031bdf3317 100644 --- a/src/opengl/qgl.h +++ b/src/opengl/qgl.h @@ -59,25 +59,26 @@ QT_BEGIN_HEADER #endif #if defined(Q_OS_MAC) +# if !defined(QT_NO_CORESERVICES) # include +# else +# if defined(QT_OPENGL_ES_2) +# include +# endif +# endif #elif defined(QT_OPENGL_ES_2) -# if defined(Q_OS_MAC) -# include +# include # else -# include +# include # endif + +#if defined(QT_OPENGL_ES_2) # ifndef GL_DOUBLE # define GL_DOUBLE GL_FLOAT # endif # ifndef GLdouble typedef GLfloat GLdouble; # endif -#else -# if defined(Q_OS_MAC) -# include -# else -# include -# endif #endif QT_BEGIN_NAMESPACE -- cgit v1.2.3 From affbbcd7382b645ae4c44e2813afd7275da10a20 Mon Sep 17 00:00:00 2001 From: Qt4iOS Date: Sat, 24 Mar 2012 14:18:43 +0000 Subject: Added iOS compatibility. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Put MacOS-specific code in #ifdef blocks so that it is not compiled for iOS. Add iOS implementation for MacOS-specific code, where possible. Change-Id: I3664c76fcfa8d5497ad1db676b9331e4ae0dca0e Reviewed-by: Morten Johan Sørvig --- src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm | 8 ++++++++ src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h | 2 ++ src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm | 4 ++++ src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h | 6 ++++++ 4 files changed, 20 insertions(+) diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 4063a9ec91..a774a6940e 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -39,8 +39,10 @@ ** ****************************************************************************/ +#ifndef QT_NO_CORESERVICES #import #import +#endif #include "qcoretextfontdatabase_p.h" #include "qfontengine_coretext_p.h" @@ -118,6 +120,7 @@ static NSInteger languageMapSort(id obj1, id obj2, void *context) QCoreTextFontDatabase::QCoreTextFontDatabase() { +#ifndef QT_NO_CORESERVICES QSettings appleSettings(QLatin1String("apple.com")); QVariant appleValue = appleSettings.value(QLatin1String("AppleAntiAliasingThreshold")); if (appleValue.isValid()) @@ -152,6 +155,9 @@ QCoreTextFontDatabase::QCoreTextFontDatabase() QCoreTextFontEngine::defaultGlyphFormat = (font_smoothing > 0 ? QFontEngineGlyphCache::Raster_RGBMask : QFontEngineGlyphCache::Raster_A8); +#else + QCoreTextFontEngine::defaultGlyphFormat = QFontEngineGlyphCache::Raster_A8; +#endif } QCoreTextFontDatabase::~QCoreTextFontDatabase() @@ -342,6 +348,7 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString family, cons return fallbackLists[styleHint]; } +#ifndef QT_NO_CORESERVICES OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref); QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData, const QString &fileName) { @@ -382,6 +389,7 @@ QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData return QStringList(); } +#endif QFont QCoreTextFontDatabase::defaultFont() const { diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h index 556b176b07..cbe1b28db8 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h @@ -55,7 +55,9 @@ public: QFontEngine *fontEngine(const QFontDef &fontDef, QUnicodeTables::Script script, void *handle); QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference); QStringList fallbacksForFamily(const QString family, const QFont::Style &style, const QFont::StyleHint &styleHint, const QUnicodeTables::Script &script) const; +#ifndef QT_NO_CORESERVICES QStringList addApplicationFont(const QByteArray &fontData, const QString &fileName); +#endif void releaseHandle(void *handle); QFont defaultFont() const; QList standardSizes() const; diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm index a02361be21..df6becc5e3 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm @@ -413,7 +413,11 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition QImage im(qRound(br.width)+2, qRound(br.height)+2, QImage::Format_RGB32); im.fill(0); +#ifndef QT_NO_CORESERVICES CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); +#else + CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB(); +#endif uint cgflags = kCGImageAlphaNoneSkipFirst; #ifdef kCGBitmapByteOrder32Host //only needed because CGImage.h added symbols in the minor version cgflags |= kCGBitmapByteOrder32Host; diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h index 3d286c8625..e1435c8b63 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h @@ -44,7 +44,13 @@ #include #include + +#ifndef QT_NO_CORESERVICES #include +#else +#include +#include +#endif #if !defined(Q_WS_MAC) || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) -- cgit v1.2.3 From 600943daefd05517b216bba6f773b9acabd9d1bd Mon Sep 17 00:00:00 2001 From: Qt4iOS Date: Sat, 24 Mar 2012 14:20:56 +0000 Subject: Added iOS compatibility. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Put MacOS-specific code in #ifdef blocks to disable compilation on iOS. Change-Id: I02c99c62b8ceb468b8b58e3c4ef52ca8ae2495f1 Reviewed-by: Morten Johan Sørvig --- src/gui/kernel/qkeysequence.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 153b2b5c2d..6b1f3534ba 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -55,14 +55,14 @@ #endif #include "qvariant.h" -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) #include #include #endif QT_BEGIN_NAMESPACE -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) static bool qt_sequence_no_mnemonics = true; struct MacSpecialKey { int key; @@ -976,7 +976,7 @@ QKeySequence::QKeySequence(const QKeySequence& keysequence) d->ref.ref(); } -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) static inline int maybeSwapShortcut(int shortcut) { if (qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) { @@ -1008,7 +1008,7 @@ QList QKeySequence::keyBindings(StandardKey key) QKeyBinding keyBinding = QKeySequencePrivate::keyBindings[i]; if (keyBinding.standardKey == key && (keyBinding.platform & platform)) { uint shortcut = -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) maybeSwapShortcut(QKeySequencePrivate::keyBindings[i].shortcut); #else QKeySequencePrivate::keyBindings[i].shortcut; @@ -1210,7 +1210,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence if (nativeText) { gmodifs = globalModifs(); if (gmodifs->isEmpty()) { -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) const bool dontSwap = qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta); if (dontSwap) *gmodifs << QModifKeyName(Qt::META, QChar(kCommandUnicode)); @@ -1250,7 +1250,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence modifs += *gmodifs; // Test non-translated ones last QString sl = accel; -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) for (int i = 0; i < modifs.size(); ++i) { const QModifKeyName &mkf = modifs.at(i); if (sl.contains(mkf.name)) { @@ -1302,7 +1302,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence int fnum = 0; if (accel.length() == 1) { -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) int qtKey = qtkeyForMacSymbol(accel[0]); if (qtKey != -1) { ret |= qtKey; @@ -1381,7 +1381,7 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat if (key == -1 || key == Qt::Key_unknown) return s; -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) if (nativeText) { // On Mac OS X the order (by default) is Meta, Alt, Shift, Control. // If the AA_MacDontSwapCtrlAndMeta is enabled, then the order @@ -1437,7 +1437,7 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat : QString::fromLatin1("F%1").arg(key - Qt::Key_F1 + 1); } else if (key) { int i=0; -#if defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) if (nativeText) { QChar ch = qt_macSymbolForQtKey(key); if (!ch.isNull()) @@ -1447,7 +1447,7 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat } else #endif { -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) NonSymbol: #endif while (keyname[i].name) { @@ -1473,7 +1473,7 @@ NonSymbol: } } -#ifdef Q_OS_MAC +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) if (nativeText) s += p; else -- cgit v1.2.3 -- cgit v1.2.3 From 89e5740a9567f592bedf73b25971d935a85da858 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Wed, 11 Apr 2012 11:42:31 +0300 Subject: QChar: documentation fixes Change-Id: Ic4b58ab811e53cf175ebaf0a67c40c56678f0f35 Reviewed-by: Lars Knoll Reviewed-by: Oswald Buddenhagen --- src/corelib/tools/qchar.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp index 165bda7b05..ef229fc0fc 100644 --- a/src/corelib/tools/qchar.cpp +++ b/src/corelib/tools/qchar.cpp @@ -1238,9 +1238,23 @@ ushort QChar::toCaseFolded(ushort ucs2) Returns the Latin-1 character equivalent to the QChar, or 0. This is mainly useful for non-internationalized software. + \note It is not possible to distinguish a non-Latin-1 character from a Latin-1 0 + (NUL) character. Prefer to use unicode(), which does not have this ambiguity. + \sa toAscii(), unicode() */ +/*! + \fn QChar QChar::fromLatin1(char) + + Converts the Latin-1 character \a c to its equivalent QChar. This + is mainly useful for non-internationalized software. + + An alternative is to use QLatin1Char. + + \sa fromAscii(), unicode() +*/ + /*! \fn char QChar::toAscii() const @@ -1254,6 +1268,9 @@ ushort QChar::toCaseFolded(ushort ucs2) \note It is not possible to distinguish a non-Latin 1 character from an ASCII 0 (NUL) character. Prefer to use unicode(), which does not have this ambiguity. + \note This function does not check whether the character value is inside + the valid range of US-ASCII. + \sa toLatin1(), unicode() */ @@ -1307,7 +1324,7 @@ QDataStream &operator>>(QDataStream &in, QChar &chr) /*! \fn ushort QChar::unicode() const - \overload + Returns the numeric Unicode value of the QChar. */ /***************************************************************************** -- cgit v1.2.3 From 99be6a5c12e74b54440e456c3fb550eb12730a0e Mon Sep 17 00:00:00 2001 From: Aron Rosenberg Date: Sat, 31 Mar 2012 13:03:34 -0700 Subject: Fix compiling with XCode 4.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit XCode 4.3 moved the location of the SDK dir, so change the qmake test to not use the old hardcoded location. Also change the test to look for versions before 10.6 instead of later than 10.6 so 10.8+ gets detected correctly. Change-Id: I1cb53a18c4b4f484d0d9de9c9d5e9641018f2502 Reviewed-by: Oswald Buddenhagen Reviewed-by: Morten Johan Sørvig --- src/plugins/bearer/corewlan/corewlan.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/bearer/corewlan/corewlan.pro b/src/plugins/bearer/corewlan/corewlan.pro index 82a514fb14..b60dac907c 100644 --- a/src/plugins/bearer/corewlan/corewlan.pro +++ b/src/plugins/bearer/corewlan/corewlan.pro @@ -5,7 +5,7 @@ QT = core-private network-private LIBS += -framework Foundation -framework SystemConfiguration contains(QT_CONFIG, corewlan) { - isEmpty(QMAKE_MAC_SDK)|contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10\.[67]\.sdk") { + !contains(QMAKE_MAC_SDK, ".*MacOSX10\\.[345]\\.sdk") { LIBS += -framework CoreWLAN -framework Security } } -- cgit v1.2.3 From 2f4b9b8e4226fe8d1d1f413965c2efcaed98c7d4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 11 Apr 2012 18:04:53 +0200 Subject: Fix unsigned comparison warning. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8544f47177b68cf29ce9fbebb152ca73db6e219d Reviewed-by: Jędrzej Nowacki --- src/gui/painting/qcolor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp index f531565fb9..75122571d6 100644 --- a/src/gui/painting/qcolor.cpp +++ b/src/gui/painting/qcolor.cpp @@ -2260,7 +2260,7 @@ QColor QColor::light(int factor) const QColor hsv = toHsv(); int s = hsv.ct.ahsv.saturation; - int v = hsv.ct.ahsv.value; + uint v = hsv.ct.ahsv.value; v = (factor*v)/100; if (v > USHRT_MAX) { -- cgit v1.2.3 From b317fe2a606e5b79f24b1e4a1b808f5ff66d3621 Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Wed, 11 Apr 2012 23:46:41 +1000 Subject: Merge the two overloads of QButtonGroup::addButton(). This change is source-compatible, but binary-incompatible. Task-number: QTBUG-25101 Change-Id: If67aec2ca8dd54ad9315f6497c2dafbbbc0b775f Reviewed-by: Lars Knoll --- src/widgets/widgets/qabstractbutton.cpp | 6 ------ src/widgets/widgets/qbuttongroup.cpp | 21 ++++++--------------- src/widgets/widgets/qbuttongroup.h | 3 +-- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/src/widgets/widgets/qabstractbutton.cpp b/src/widgets/widgets/qabstractbutton.cpp index 5f75bd3913..4e85eae3ff 100644 --- a/src/widgets/widgets/qabstractbutton.cpp +++ b/src/widgets/widgets/qabstractbutton.cpp @@ -219,12 +219,6 @@ void QButtonGroup::setExclusive(bool exclusive) } -// TODO: Qt 5: Merge with addButton(QAbstractButton *button, int id) -void QButtonGroup::addButton(QAbstractButton *button) -{ - addButton(button, -1); -} - void QButtonGroup::addButton(QAbstractButton *button, int id) { Q_D(QButtonGroup); diff --git a/src/widgets/widgets/qbuttongroup.cpp b/src/widgets/widgets/qbuttongroup.cpp index 381e32d96b..a5e96370cf 100644 --- a/src/widgets/widgets/qbuttongroup.cpp +++ b/src/widgets/widgets/qbuttongroup.cpp @@ -175,22 +175,13 @@ */ /*! - \fn void QButtonGroup::addButton(QAbstractButton *button); + \fn void QButtonGroup::addButton(QAbstractButton *button, int id = -1); - Adds the given \a button to the end of the group's internal list - of buttons. An id will be assigned to the button by this - QButtonGroup. Automatically assigned ids are guaranteed to be - negative, starting with -2. If you are also assigning your own - ids, use positive values to avoid conflicts. - - \sa removeButton() buttons() -*/ - -/*! - \fn void QButtonGroup::addButton(QAbstractButton *button, int id); - - Adds the given \a button to the button group, with the given \a - id. It is recommended to assign only positive ids. + Adds the given \a button to the button group. If \a id is -1, + an id will be assigned to the button by this QButtonGroup. + Automatically assigned ids are guaranteed to be negative, + starting with -2. If you are assigning your own ids, use + positive values to avoid conflicts. \sa removeButton() buttons() */ diff --git a/src/widgets/widgets/qbuttongroup.h b/src/widgets/widgets/qbuttongroup.h index e24ac8bbc3..46275d9f04 100644 --- a/src/widgets/widgets/qbuttongroup.h +++ b/src/widgets/widgets/qbuttongroup.h @@ -67,8 +67,7 @@ public: void setExclusive(bool); bool exclusive() const; - void addButton(QAbstractButton *); - void addButton(QAbstractButton *, int id); + void addButton(QAbstractButton *, int id = -1); void removeButton(QAbstractButton *); QList buttons() const; -- cgit v1.2.3 From 9fd2edb6da5f1f6d644cd7c3f35aebe3e88beee2 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Thu, 12 Apr 2012 18:21:39 +0300 Subject: replace hardcoded values with a surrogate handling methods Change-Id: Ib41e08d835f2e8ca2e32b4025c6f5a99840f2e27 Reviewed-by: Oswald Buddenhagen Reviewed-by: Lars Knoll --- src/corelib/codecs/qutfcodec.cpp | 6 +++--- src/corelib/io/qurl.cpp | 6 +++--- src/corelib/json/qjsonparser.cpp | 7 ++++--- src/corelib/json/qjsonwriter.cpp | 2 +- src/plugins/platforms/windows/qwindowsfontengine.cpp | 12 ++++++------ .../platforms/windows/qwindowsfontenginedirectwrite.cpp | 9 +++++---- src/widgets/widgets/qwidgetlinecontrol.cpp | 8 ++++---- tests/benchmarks/corelib/tools/qstring/main.cpp | 6 +++--- 8 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index 18d063a38c..9111ac6379 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -127,7 +127,7 @@ QByteArray QUtf8::convertFromUnicode(const QChar *uc, int len, QTextCodec::Conve continue; } - if (u > 0xffff) { + if (QChar::requiresSurrogates(u)) { *cursor++ = 0xf0 | ((uchar) (u >> 18)); *cursor++ = 0x80 | (((uchar) (u >> 12)) & 0x3f); } else { @@ -196,7 +196,7 @@ QString QUtf8::convertToUnicode(const char *chars, int len, QTextCodec::Converte bool nonCharacter; if (!headerdone && uc == 0xfeff) { // don't do anything, just skip the BOM - } else if (!(nonCharacter = isUnicodeNonCharacter(uc)) && uc > 0xffff && uc < 0x110000) { + } else if (!(nonCharacter = isUnicodeNonCharacter(uc)) && QChar::requiresSurrogates(uc) && uc < 0x110000) { // surrogate pair Q_ASSERT((qch - (ushort*)result.unicode()) + 2 < result.length()); *qch++ = QChar::highSurrogate(uc); @@ -487,7 +487,7 @@ QString QUtf32::convertToUnicode(const char *chars, int len, QTextCodec::Convert } } uint code = (endian == BigEndianness) ? qFromBigEndian(tuple) : qFromLittleEndian(tuple); - if (code >= 0x10000) { + if (QChar::requiresSurrogates(code)) { *qch++ = QChar::highSurrogate(code); *qch++ = QChar::lowSurrogate(code); } else { diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 0659053937..c6b5ea63eb 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -2388,7 +2388,7 @@ static void mapToLowerCase(QString *str, int from) while (l < 4 && entry->mapping[l]) ++l; if (l > 1) { - if (uc <= 0xffff) + if (!QChar::requiresSurrogates(uc)) str->replace(i, 1, reinterpret_cast(&entry->mapping[0]), l); else str->replace(i-1, 2, reinterpret_cast(&entry->mapping[0]), l); @@ -2434,7 +2434,7 @@ static void stripProhibitedOutput(QString *str, int from) uc = QChar::surrogateToUcs4(uc, low); } } - if (uc <= 0xFFFF) { + if (!QChar::requiresSurrogates(uc)) { if (uc < 0x80 || !(uc <= 0x009F || uc == 0x00A0 @@ -2991,7 +2991,7 @@ void qt_nameprep(QString *source, int from) } } if (!isMappedToNothing(uc)) { - if (uc <= 0xFFFF) { + if (!QChar::requiresSurrogates(uc)) { *out++ = *in; } else { *out++ = QChar::highSurrogate(uc); diff --git a/src/corelib/json/qjsonparser.cpp b/src/corelib/json/qjsonparser.cpp index 7d25c81db2..a17426580f 100644 --- a/src/corelib/json/qjsonparser.cpp +++ b/src/corelib/json/qjsonparser.cpp @@ -769,9 +769,10 @@ static inline bool scanUtf8Char(const char *&json, const char *end, uint *result uc = (uc << 6) | (ch & 0x3f); } - if (isUnicodeNonCharacter(uc) || uc >= 0x110000 || - (uc < min_uc) || (uc >= 0xd800 && uc <= 0xdfff)) + if (uc < min_uc || isUnicodeNonCharacter(uc) || + (uc >= 0xd800 && uc <= 0xdfff) || uc >= 0x110000) { return false; + } *result = uc; return true; @@ -850,7 +851,7 @@ bool Parser::parseString(bool *latin1) return false; } } - if (ch > 0xffff) { + if (QChar::requiresSurrogates(ch)) { int pos = reserveSpace(4); *(QJsonPrivate::qle_ushort *)(data + pos) = QChar::highSurrogate(ch); *(QJsonPrivate::qle_ushort *)(data + pos + 2) = QChar::lowSurrogate(ch); diff --git a/src/corelib/json/qjsonwriter.cpp b/src/corelib/json/qjsonwriter.cpp index d392bd7529..7cdc3f0dba 100644 --- a/src/corelib/json/qjsonwriter.cpp +++ b/src/corelib/json/qjsonwriter.cpp @@ -160,7 +160,7 @@ static QByteArray escapedString(const QString &s) continue; } - if (u > 0xffff) { + if (QChar::requiresSurrogates(u)) { *cursor++ = 0xf0 | ((uchar) (u >> 18)); *cursor++ = 0x80 | (((uchar) (u >> 12)) & 0x3f); } else { diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index 007f6d597a..94072622eb 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -179,14 +179,14 @@ void QWindowsFontEngine::getCMap() } } - +// ### Qt 5.1: replace with QStringIterator inline unsigned int getChar(const QChar *str, int &i, const int len) { - unsigned int uc = str[i].unicode(); - if (uc >= 0xd800 && uc < 0xdc00 && i < len-1) { + uint uc = str[i].unicode(); + if (QChar::isHighSurrogate(uc) && i < len-1) { uint low = str[i+1].unicode(); - if (low >= 0xdc00 && low < 0xe000) { - uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000; + if (QChar::isLowSurrogate(low)) { + uc = QChar::surrogateToUcs4(uc, low); ++i; } } @@ -402,7 +402,7 @@ void QWindowsFontEngine::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::Shape if (!ttf) { QChar ch[2] = { ushort(glyph), 0 }; int chrLen = 1; - if (glyph > 0xffff) { + if (QChar::requiresSurrogates(glyph)) { ch[0] = QChar::highSurrogate(glyph); ch[1] = QChar::lowSurrogate(glyph); ++chrLen; diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp index 82410bfb21..9c98144c4c 100644 --- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp +++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp @@ -295,13 +295,14 @@ QFixed QWindowsFontEngineDirectWrite::emSquareSize() const return QFontEngine::emSquareSize(); } +// ### Qt 5.1: replace with QStringIterator inline unsigned int getChar(const QChar *str, int &i, const int len) { - unsigned int uc = str[i].unicode(); - if (uc >= 0xd800 && uc < 0xdc00 && i < len-1) { + uint uc = str[i].unicode(); + if (QChar::isHighSurrogate(uc) && i < len-1) { uint low = str[i+1].unicode(); - if (low >= 0xdc00 && low < 0xe000) { - uc = (uc - 0xd800)*0x400 + (low - 0xdc00) + 0x10000; + if (QChar::isLowSurrogate(low)) { + uc = QChar::surrogateToUcs4(uc, low); ++i; } } diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index c9300d3cdd..017cbee219 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -103,11 +103,11 @@ void QWidgetLineControl::updateDisplayText(bool forceUpdate) int cursor = m_cursor - 1; QChar uc = m_text.at(cursor); str[cursor] = uc; - if (cursor > 0 && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) { + if (cursor > 0 && uc.isLowSurrogate()) { // second half of a surrogate, check if we have the first half as well, // if yes restore both at once uc = m_text.at(cursor - 1); - if (uc.unicode() >= 0xd800 && uc.unicode() < 0xdc00) + if (uc.isHighSurrogate()) str[cursor - 1] = uc; } } @@ -220,11 +220,11 @@ void QWidgetLineControl::backspace() if (m_maskData) m_cursor = prevMaskBlank(m_cursor); QChar uc = m_text.at(m_cursor); - if (m_cursor > 0 && uc.unicode() >= 0xdc00 && uc.unicode() < 0xe000) { + if (m_cursor > 0 && uc.isLowSurrogate()) { // second half of a surrogate, check if we have the first half as well, // if yes delete both at once uc = m_text.at(m_cursor - 1); - if (uc.unicode() >= 0xd800 && uc.unicode() < 0xdc00) { + if (uc.isHighSurrogate()) { internalDelete(true); --m_cursor; } diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp index 40300af947..9f9e7e41d5 100644 --- a/tests/benchmarks/corelib/tools/qstring/main.cpp +++ b/tests/benchmarks/corelib/tools/qstring/main.cpp @@ -1996,7 +1996,7 @@ int fromUtf8_qt47(ushort *dst, const char *chars, int len) bool nonCharacter; if (!headerdone && uc == 0xfeff) { // don't do anything, just skip the BOM - } else if (!(nonCharacter = isUnicodeNonCharacter(uc)) && uc > 0xffff && uc < 0x110000) { + } else if (!(nonCharacter = isUnicodeNonCharacter(uc)) && QChar::requiresSurrogates(uc) && uc < 0x110000) { // surrogate pair //Q_ASSERT((qch - (ushort*)result.unicode()) + 2 < result.length()); *qch++ = QChar::highSurrogate(uc); @@ -2102,7 +2102,7 @@ int fromUtf8_qt47_stateless(ushort *dst, const char *chars, int len) bool nonCharacter; if (!headerdone && uc == 0xfeff) { // don't do anything, just skip the BOM - } else if (!(nonCharacter = isUnicodeNonCharacter(uc)) && uc > 0xffff && uc < 0x110000) { + } else if (!(nonCharacter = isUnicodeNonCharacter(uc)) && QChar::requiresSurrogates(uc) && uc < 0x110000) { // surrogate pair //Q_ASSERT((qch - (ushort*)result.unicode()) + 2 < result.length()); *qch++ = QChar::highSurrogate(uc); @@ -2258,7 +2258,7 @@ static inline void extract_utf8_multibyte(ushort *&dst, const char *&chars, qptr // dst[counter] will correspond to chars[counter..counter+2], so adjust chars += 3; len -= 3; - if (trusted || (ucs >= 0x10000 && ucs < 0x110000 && !isUnicodeNonCharacter(ucs))) { + if (trusted || (QChar::requiresSurrogates(ucs) && ucs < 0x110000 && !isUnicodeNonCharacter(ucs))) { dst[counter + 0] = QChar::highSurrogate(ucs); dst[counter + 1] = QChar::lowSurrogate(ucs); counter += 2; -- cgit v1.2.3 From 87548de2ef2313f628d1ddf10ae0cebea74838b2 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Thu, 12 Apr 2012 12:23:46 +0200 Subject: test: Don't mark tst_qscrollbar as insignificant on Mac OS X Just XFAIL the failing test instead of ignoring the whole test. Task-number: QTBUG-25272 Change-Id: Iedca9913032f13c6610b049a0313c9e4336216e0 Reviewed-by: Bradley T. Hughes --- tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro | 2 -- tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro b/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro index e9436eccdc..2863dd2034 100644 --- a/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro +++ b/tests/auto/widgets/widgets/qscrollbar/qscrollbar.pro @@ -2,5 +2,3 @@ CONFIG += testcase TARGET = tst_qscrollbar QT += widgets testlib SOURCES += tst_qscrollbar.cpp - -mac*:CONFIG+=insignificant_test diff --git a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp index ec48c2b680..f568322ab7 100644 --- a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp +++ b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp @@ -99,6 +99,9 @@ void tst_QScrollBar::scrollSingleStep() QTest::mouseClick(testWidget, Qt::LeftButton, Qt::NoModifier, QPoint(sr.x(), sr.y())); QTest::qWait(510); // initial delay is 500 for setRepeatAction disconnect(testWidget, SIGNAL(actionTriggered(int)), 0, 0); +#ifdef Q_OS_MAC + QEXPECT_FAIL("", "This test fails on Mac OS X, see QTBUG-25272", Abort); +#endif QCOMPARE(testWidget->value(), testWidget->singleStep()); } -- cgit v1.2.3 From d318ea265567ab4bce8ee57a9bdbda556e47ae39 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 12 Apr 2012 15:32:45 +0200 Subject: Windows QPA plugin: Fix logging. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove frequently occurring messages. - Rename variable to QT_QPA_VERBOSE. Change-Id: Id930e1422675355a9657edae6505be87aaec98a5 Reviewed-by: Samuel Rødal --- src/plugins/platforms/windows/qwindowscontext.cpp | 2 +- src/plugins/platforms/windows/qwindowscursor.cpp | 2 -- src/plugins/platforms/windows/qwindowsintegration.cpp | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 0075b875ce..c5b1dcce9f 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -277,7 +277,7 @@ QWindowsContext::QWindowsContext() : # pragma warning( disable : 4996 ) #endif m_instance = this; - if (const char *v = getenv("QT_LIGHTHOUSE_WINDOWS_VERBOSE")) { + if (const char *v = getenv("QT_QPA_VERBOSE")) { QWindowsContext::verboseIntegration = componentVerbose(v, "integration"); QWindowsContext::verboseWindows = componentVerbose(v, "windows"); QWindowsContext::verboseEvents = componentVerbose(v, "events"); diff --git a/src/plugins/platforms/windows/qwindowscursor.cpp b/src/plugins/platforms/windows/qwindowscursor.cpp index 337ba9ab27..ebcf1172db 100644 --- a/src/plugins/platforms/windows/qwindowscursor.cpp +++ b/src/plugins/platforms/windows/qwindowscursor.cpp @@ -369,8 +369,6 @@ QPoint QWindowsCursor::mousePosition() { POINT p; GetCursorPos(&p); - if (QWindowsContext::verboseWindows) - qDebug("%s %ld,%ld", __FUNCTION__, p.x, p.y); return QPoint(p.x, p.y); } diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 47d6a2f11a..6da8932164 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -228,8 +228,6 @@ bool QWindowsIntegration::hasCapability(QPlatformIntegration::Capability cap) co QPlatformPixmap *QWindowsIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const { - if (QWindowsContext::verboseIntegration) - qDebug() << __FUNCTION__ << type; return new QRasterPlatformPixmap(type); } -- cgit v1.2.3 From 80c28fe3bd1ac62d1c29ce7e567145aea57ae8ff Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 9 Apr 2012 01:38:43 +0100 Subject: QRegularExpression: add more test data Change-Id: I44d19f976ced7b073f66d0ea943fafea37940c48 Reviewed-by: Jason McDonald Reviewed-by: Rohan McGovern --- .../qregularexpression/tst_qregularexpression.cpp | 111 +++++++++++++++++++++ 1 file changed, 111 insertions(+) diff --git a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp index a4c04d6207..f1de1722e2 100644 --- a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp +++ b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp @@ -637,6 +637,52 @@ void tst_QRegularExpression::normalMatch_data() << 0 << QRegularExpression::MatchOptions(QRegularExpression::AnchoredMatchOption) << m; + + // *** + + m.clear(); + m.isValid = true; m.hasMatch = true; + m.captured << "678"; + QTest::newRow("negativeoffset01") << QRegularExpression("\\d+") + << "abc123def678ghi" + << -6 + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << m; + + m.clear(); + m.isValid = true; m.hasMatch = true; + m.captured << "678"; + QTest::newRow("negativeoffset02") << QRegularExpression("\\d+") + << "abc123def678ghi" + << -8 + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << m; + + m.clear(); + m.isValid = true; m.hasMatch = true; + m.captured << "678ghi" << "678" << "ghi"; + QTest::newRow("negativeoffset03") << QRegularExpression("(\\d+)(\\w+)") + << "abc123def678ghi" + << -8 + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << m; + + m.clear(); + m.isValid = true; + QTest::newRow("negativeoffset04") << QRegularExpression("\\d+") + << "abc123def678ghi" + << -3 + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << m; + + m.clear(); + m.isValid = true; m.hasMatch = true; + m.captured << "678"; + QTest::newRow("negativeoffset05") << QRegularExpression("^\\d+", QRegularExpression::MultilineOption) + << "a\nbc123\ndef\n678gh\ni" + << -10 + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << m; } @@ -956,6 +1002,31 @@ void tst_QRegularExpression::globalMatch_data() << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) << matchList; + matchList.clear(); + m.clear(); + m.isValid = true; m.hasMatch = true; + m.captured = QStringList() << "ACA""GTG""CGA""AAA"; + matchList << m; + m.captured = QStringList() << "AAA"; + matchList << m; + m.captured = QStringList() << "AAG""GAA""AAG""AAA"; + matchList << m; + m.captured = QStringList() << "AAA"; + matchList << m; + QTest::newRow("globalmatch03") << QRegularExpression("\\G(?:\\w\\w\\w)*?AAA") + << "ACA""GTG""CGA""AAA""AAA""AAG""GAA""AAG""AAA""AAA" + << 0 + << QRegularExpression::NormalMatch + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << matchList; + + QTest::newRow("globalmatch04") << QRegularExpression("(?:\\w\\w\\w)*?AAA") + << "ACA""GTG""CGA""AAA""AAA""AAG""GAA""AAG""AAA""AAA" + << 0 + << QRegularExpression::NormalMatch + << QRegularExpression::MatchOptions(QRegularExpression::AnchoredMatchOption) + << matchList; + matchList.clear(); m.clear(); m.isValid = true; m.hasMatch = true; @@ -1103,6 +1174,46 @@ void tst_QRegularExpression::globalMatch_data() << QRegularExpression::NormalMatch << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) << matchList; + + matchList.clear(); + m.clear(); + m.isValid = true; m.hasMatch = true; + m.captured = QStringList() << "ABC"; + matchList << m; + m.captured = QStringList() << ""; + matchList << m; + m.captured = QStringList() << "DEF"; + matchList << m; + m.captured = QStringList() << ""; + matchList << m; + m.captured = QStringList() << "GHI"; + matchList << m; + m.captured = QStringList() << ""; + matchList << m; + QTest::newRow("globalmatch_emptycaptures07") << QRegularExpression("[\\x{0000}-\\x{FFFF}]*") + << QString::fromUtf8("ABC""\xf0\x9d\x85\x9d""DEF""\xf0\x9d\x85\x9e""GHI") + << 0 + << QRegularExpression::NormalMatch + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << matchList; + + matchList.clear(); + m.clear(); + m.isValid = true; m.hasMatch = true; + m.captured = QStringList() << QString::fromUtf8("ABC""\xc3\x80"); + matchList << m; + m.captured = QStringList() << ""; + matchList << m; + m.captured = QStringList() << QString::fromUtf8("\xc3\x80""DEF""\xc3\x80"); + matchList << m; + m.captured = QStringList() << ""; + matchList << m; + QTest::newRow("globalmatch_emptycaptures08") << QRegularExpression("[\\x{0000}-\\x{FFFF}]*") + << QString::fromUtf8("ABC""\xc3\x80""\xf0\x9d\x85\x9d""\xc3\x80""DEF""\xc3\x80") + << 0 + << QRegularExpression::NormalMatch + << QRegularExpression::MatchOptions(QRegularExpression::NoMatchOption) + << matchList; } void tst_QRegularExpression::globalMatch() -- cgit v1.2.3 From bfcfbc592c47a855c05929cfd6649003c16698c3 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 12 Apr 2012 18:42:51 +0100 Subject: re-enable qabstractnetworkcache autotest I have run the test 250 times in each of these configs with no crashes observed, so assuming the instability has been fixed by another change. ubuntu 11.10 64 bit ubuntu 10.04 32 bit windows 7 msvc2010 64 bit (debug) windows 7 msvc2010 32 bit (release) Task-number: QTBUG-20686 Change-Id: I02bab165c263cf79684c7723eae1e278839b1e37 Reviewed-by: Jason McDonald --- .../auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro b/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro index ef47a4b458..69062bc0c9 100644 --- a/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro +++ b/tests/auto/network/access/qabstractnetworkcache/qabstractnetworkcache.pro @@ -6,4 +6,3 @@ SOURCES += tst_qabstractnetworkcache.cpp TESTDATA += tests/* -CONFIG += insignificant_test # QTBUG-20686; note, assumed unstable on all platforms -- cgit v1.2.3 From 6fc44c59263a19b6697de980c70e085f0f2922c4 Mon Sep 17 00:00:00 2001 From: Jan-Arve Saether Date: Wed, 11 Apr 2012 07:58:20 +0200 Subject: Minor cleanup of the header file. Move inline implementations to iaccessible2.cpp. Makes it easier to read and navigate the source code. Change-Id: I8da44ba0d40395356f612ff6b3ce2a808105838a Reviewed-by: Mark Brand --- .../platforms/windows/accessible/iaccessible2.cpp | 68 +++++++++++++++++- .../platforms/windows/accessible/iaccessible2.h | 80 +++------------------- 2 files changed, 78 insertions(+), 70 deletions(-) diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.cpp b/src/plugins/platforms/windows/accessible/iaccessible2.cpp index be680e7d48..ddab3cb0f2 100644 --- a/src/plugins/platforms/windows/accessible/iaccessible2.cpp +++ b/src/plugins/platforms/windows/accessible/iaccessible2.cpp @@ -114,6 +114,68 @@ HRESULT STDMETHODCALLTYPE AccessibleApplication::get_toolkitVersion(/* [retval][ } +/**************************************************************\ + * AccessibleRelation * + **************************************************************/ +AccessibleRelation::AccessibleRelation(const QList &targets, + QAccessible::Relation relation) + : m_targets(targets), m_relation(relation), m_ref(1) +{ + Q_ASSERT(m_targets.count()); +} + +/* IUnknown */ +HRESULT STDMETHODCALLTYPE AccessibleRelation::QueryInterface(REFIID id, LPVOID *iface) +{ + *iface = 0; + if (id == IID_IUnknown) + *iface = (IUnknown*)this; + + if (*iface) { + AddRef(); + return S_OK; + } + + return E_NOINTERFACE; +} + +ULONG STDMETHODCALLTYPE AccessibleRelation::AddRef() +{ + return ++m_ref; +} + +ULONG STDMETHODCALLTYPE AccessibleRelation::Release() +{ + if (!--m_ref) { + delete this; + return 0; + } + return m_ref; +} + +/* IAccessibleRelation */ +HRESULT STDMETHODCALLTYPE AccessibleRelation::get_relationType( + /* [retval][out] */ BSTR *relationType) +{ + *relationType = relationToBSTR(m_relation); + return S_OK; +} + +HRESULT STDMETHODCALLTYPE AccessibleRelation::get_localizedRelationType( + /* [retval][out] */ BSTR *localizedRelationType) +{ + // Who ever needs this??? + *localizedRelationType = relationToBSTR(m_relation); + return S_OK; +} + +HRESULT STDMETHODCALLTYPE AccessibleRelation::get_nTargets( + /* [retval][out] */ long *nTargets) +{ + // ### always one target + *nTargets = m_targets.count(); + return S_OK; +} /*! \internal @@ -140,7 +202,7 @@ HRESULT STDMETHODCALLTYPE AccessibleRelation::get_target( (see "Special Consideration when using Arrays", in Accessible2.idl) */ HRESULT STDMETHODCALLTYPE AccessibleRelation::get_targets( - /* [in] */ long maxTargets, // Hmmm, ignore ??? + /* [in] */ long maxTargets, /* [length_is][size_is][out] */ IUnknown **targets, /* [retval][out] */ long *nTargets) { @@ -215,6 +277,10 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::QueryInterface(REFIID id, LPVOI return hr; } + +/* Note that IUnknown is inherited from several interfaces. Therefore we must reimplement all its + functions in the concrete class to avoid ambiguity. +*/ ULONG STDMETHODCALLTYPE QWindowsIA2Accessible::AddRef() { return QWindowsMsaaAccessible::AddRef(); diff --git a/src/plugins/platforms/windows/accessible/iaccessible2.h b/src/plugins/platforms/windows/accessible/iaccessible2.h index b33562a900..0f9d3b3c41 100644 --- a/src/plugins/platforms/windows/accessible/iaccessible2.h +++ b/src/plugins/platforms/windows/accessible/iaccessible2.h @@ -298,85 +298,27 @@ private: /**************************************************************\ - * IAccessibleRelation * + * AccessibleRelation * **************************************************************/ -struct AccessibleRelation : public IAccessibleRelation +class AccessibleRelation : public IAccessibleRelation { +public: AccessibleRelation(const QList &targets, - QAccessible::Relation relation) - : m_targets(targets), m_relation(relation), m_ref(1) - { - Q_ASSERT(m_targets.count()); - } - + QAccessible::Relation relation); virtual ~AccessibleRelation() {} /* IUnknown */ - HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, LPVOID *iface) - { - *iface = 0; - if (id == IID_IUnknown) - *iface = (IUnknown*)this; - - if (*iface) { - AddRef(); - return S_OK; - } - - return E_NOINTERFACE; - } - - ULONG STDMETHODCALLTYPE AddRef() - { - return ++m_ref; - } - - ULONG STDMETHODCALLTYPE Release() - { - if (!--m_ref) { - delete this; - return 0; - } - return m_ref; - } + HRESULT STDMETHODCALLTYPE QueryInterface(REFIID id, LPVOID *iface); + ULONG STDMETHODCALLTYPE AddRef(); + ULONG STDMETHODCALLTYPE Release(); /* IAccessibleRelation */ - HRESULT STDMETHODCALLTYPE get_relationType( - /* [retval][out] */ BSTR *relationType) - { - *relationType = relationToBSTR(m_relation); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE get_localizedRelationType( - /* [retval][out] */ BSTR *localizedRelationType) - { - // Who ever needs this??? - *localizedRelationType = relationToBSTR(m_relation); - return S_OK; - } - - HRESULT STDMETHODCALLTYPE get_nTargets( - /* [retval][out] */ long *nTargets) - { - // ### always one target - *nTargets = m_targets.count(); - return S_OK; - } - + HRESULT STDMETHODCALLTYPE get_relationType(BSTR *relationType); + HRESULT STDMETHODCALLTYPE get_localizedRelationType(BSTR *localizedRelationType); + HRESULT STDMETHODCALLTYPE get_nTargets(long *nTargets); HRESULT STDMETHODCALLTYPE get_target(long targetIndex, IUnknown **target); - - - /*! - \internal - Client allocates and deallocates \a targets array - (see "Special Consideration when using Arrays", in Accessible2.idl) - */ - HRESULT STDMETHODCALLTYPE get_targets( - /* [in] */ long maxTargets, // Hmmm, ignore ??? - /* [length_is][size_is][out] */ IUnknown **targets, - /* [retval][out] */ long *nTargets); + HRESULT STDMETHODCALLTYPE get_targets(long maxTargets, IUnknown **targets, long *nTargets); private: static BSTR relationToBSTR(QAccessible::Relation relation) -- cgit v1.2.3 From 19524b7499c0a4b6f66d4797f04f06e140234149 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 28 Feb 2012 10:00:32 +0100 Subject: directfb: Integrate building into configure. Add DirectFB buildsystem integration by adding a configure target and adding it as subdirectory to the project file. The default is to automatically build directfb. Update the Broadcom/9425 build. Change-Id: I482f865cebd9d5cd4c98c184773f8534f92db9df Reviewed-by: Girish Ramakrishnan --- configure | 42 +++++++++++++++++++--- .../linux-mipsel-broadcom-97425-g++/qmake.conf | 8 ++--- src/plugins/platforms/directfb/directfb.pro | 14 +++----- src/plugins/platforms/platforms.pro | 4 +++ 4 files changed, 50 insertions(+), 18 deletions(-) diff --git a/configure b/configure index 0fd371bdb5..75e59f4c8b 100755 --- a/configure +++ b/configure @@ -705,6 +705,7 @@ CFG_XKB=auto CFG_XCB=auto CFG_XCB_LIMITED=yes CFG_EGLFS=auto +CFG_DIRECTFB=auto CFG_LIBUDEV=auto CFG_OBSOLETE_WAYLAND=no CFG_EVDEV=auto @@ -891,7 +892,7 @@ while [ "$#" -gt 0 ]; do VAL=no ;; #Qt style yes options - -profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-eglfs|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-exceptions|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-qml-debug|-javascript-jit|-rpath|-pkg-config|-force-pkg-config|-icu|-force-asserts|-testcocoon) + -profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-xinput2|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-xcb|-eglfs|-directfb|-nis|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-debug-and-release|-exceptions|-harfbuzz|-prefix-install|-silent|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-phonon-backend|-audio-backend|-qml-debug|-javascript-jit|-rpath|-pkg-config|-force-pkg-config|-icu|-force-asserts|-testcocoon) VAR=`echo $1 | sed "s,^-\(.*\),\1,"` VAL=yes ;; @@ -1651,6 +1652,13 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; + directfb) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_DIRECTFB="$VAL" + else + UNKNOWN_OPT=yes + fi + ;; libudev) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_LIBUDEV="$VAL" @@ -2839,6 +2847,13 @@ if [ "$OPT_HELP" = "yes" ]; then EGLFSN=" " fi + if [ "$CFG_DIRECTFB" = "no"]; then + DFBY=" " + DFBN="*" + else + DFBY="*" + DFBN=" " + fi if [ "$CFG_XINPUT2" = "no" ]; then X2Y=" " X2N="*" @@ -3135,6 +3150,9 @@ Additional options: $EGLFSN -no-eglfs .......... Do not compile EGLFS (EGL Full Screen/Single Surface) support. $EGLFSY -eglfs ............. Compile EGLFS support. + $DFBN -no-directfb ....... Do not compile DirectFB support. + $DFBY -directfb .......... Compile DirectFB support. + -xplatform target ... The target platform when cross-compiling. -sysroot

...... Sets as the target compiler's and qmake's sysroot. @@ -4493,6 +4511,7 @@ fi # Save these for a check later ORIG_CFG_XCB="$CFG_XCB" ORIG_CFG_EGLFS="$CFG_EGLFS" +ORIG_CFG_DIRECTFB="$CFG_DIRECTFB" if [ "$CFG_LIBUDEV" != "no" ]; then if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists libudev 2>/dev/null; then @@ -4600,6 +4619,16 @@ if [ "$CFG_XCB" != "no" ]; then fi fi +if [ "$CFG_DIRECTFB" != "no" ]; then + if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists directfb 2>/dev/null; then + QMAKE_CFLAGS_DIRECTFB=`$PKG_CONFIG --cflags directfb 2>/dev/null` + QMAKE_LIBS_DIRECTFB=`$PKG_CONFIG --libs directfb 2>/dev/null` + QT_CONFIG="$QT_CONFIG directfb" + else + CFG_DIRECTFB=no + fi +fi + # Detect libxkbcommon if [ -n "$PKG_CONFIG" ] && $PKG_CONFIG --exists xkbcommon 2>/dev/null; then QMAKE_CFLAGS_XKBCOMMON="`$PKG_CONFIG --cflags xkbcommon 2>/dev/null`" @@ -4647,6 +4676,10 @@ if [ -n "$QMAKE_CFLAGS_XCB" ] || [ -n "$QMAKE_LIBS_XCB" ]; then QMakeVar set QMAKE_LIBS_XCB "$QMAKE_LIBS_XCB" QMakeVar set QMAKE_DEFINES_XCB "$QMAKE_DEFINES_XCB" fi +if [ -n "$QMAKE_CFLAGS_DIRECTFB" ] || [ -n "$QMAKE_LIBS_DIRECTFB" ]; then + QMakeVar set QMAKE_CFLAGS_DIRECTFB "$QMAKE_CFLAGS_DIRECTFB" + QMakeVar set QMAKE_LIBS_DIRECTFB "$QMAKE_LIBS_DIRECTFB" +fi if [ "$BUILD_ON_MAC" = "yes" ]; then if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/mac/coreservices "CoreServices" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then @@ -4657,12 +4690,12 @@ if [ "$BUILD_ON_MAC" = "yes" ]; then fi if [ "$BUILD_ON_MAC" = "no" ] && [ "$XPLATFORM_MINGW" = "no" ]; then - if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ]; then + if [ "$CFG_XCB" = "no" ] && [ "$CFG_EGLFS" = "no" ] && [ "$CFG_DIRECTFB" = "no" ]; then if [ "$QPA_PLATFORM_GUARD" = "yes" ] && - ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] ); then + ( [ "$ORIG_CFG_XCB" = "auto" ] || [ "$ORIG_CFG_EGLFS" = "auto" ] || [ "$ORIG_CFG_DIRECTFB" = "auto" ] ); then echo "No QPA platform plugin enabled!" echo " If you really want to build without a QPA platform plugin you must pass" - echo " -no-xcb and -no-eglfs to configure. Doing this will" + echo " -no-xcb, -no-eglfs and -no-directfb to configure. Doing this will" echo " produce a Qt that cannot run GUI applications." echo " The dependencies needed for xcb to build are listed in" echo " src/plugins/platforms/xcb/README" @@ -6068,6 +6101,7 @@ if [ "$XPLATFORM_MAEMO" = "yes" ] && [ "$CFG_XCB" = "yes" ]; then echo "XInput2 support ........ $CFG_XINPUT2" fi echo "EGLFS support .......... $CFG_EGLFS" +echo "DirectFB support ....... $CFG_DIRECTFB" echo # complain about not being able to use dynamic plugins if we are using a static build diff --git a/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf index ced323feba..e69a3cee4b 100644 --- a/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf +++ b/mkspecs/devices/linux-mipsel-broadcom-97425-g++/qmake.conf @@ -55,15 +55,13 @@ QMAKE_LIBS_OPENGL_ES2 = -lv3ddriver -lrt INCLUDEPATH += $${BRCM_APPLIBS_PATH}/opensource/zlib/zlib-1.2.3 QMAKE_LIBDIR += $${BRCM_APPLIBS_PATH}/opensource/zlib/zlib-1.2.3 -# DirectFB, needs to be changed once -directfb is added to configure -DIRECTFB_INCLUDEPATH = $${BRCM_APPLIBS_PATH}/opensource/directfb/bin/DirectFB-1.4.15_multi_$${BRCM_BUILD_TYPE}_build.97425B1/usr/local/include/directfb $${BRCM_ROCKFORD_PATH}/middleware/platform/directfb -DIRECTFB_LIBS = -L$${BRCM_APPLIBS_PATH}/opensource/directfb/bin/DirectFB-1.4.15_multi_$${BRCM_BUILD_TYPE}_build.97425B1/usr/local/lib -L$${BRCM_ROCKFORD_PATH}/middleware/platform/directfb/lib_$${BRCM_PLATFORM}_$${BRCM_BUILD_TYPE} -ldirectfb -lfusion -ldirect -lpthread -lnexus -ldbpl -lz - - QMAKE_LFLAGS += -Wl,-rpath-link,$$QMAKE_LIBDIR_OPENGL_ES2 -Wl,-rpath-link,$${BRCM_APPLIBS_PATH}/opensource/zlib/zlib-1.2.3 # DirectFB platform hooks for this hardware QT_CONFIG += directfb_egl DIRECTFB_PLATFORM_HOOKS_SOURCES = $$PWD/qdirectfbeglhooks_bcm97425.cpp +DIRECTFB_PLATFORM_HOOKS_INCLUDEPATH = $${BRCM_ROCKFORD_PATH}/middleware/platform/directfb +DIRECTFB_PLATFORM_HOOKS_LIBS = -ldbpl +DIRECTFB_PLATFORM_HOOKS_LIBDIR = $${BRCM_ROCKFORD_PATH}/middleware/platform/directfb/lib_$${BRCM_PLATFORM}_$${BRCM_BUILD_TYPE} load(qt_config) diff --git a/src/plugins/platforms/directfb/directfb.pro b/src/plugins/platforms/directfb/directfb.pro index 2251b8f278..5dfddeb225 100644 --- a/src/plugins/platforms/directfb/directfb.pro +++ b/src/plugins/platforms/directfb/directfb.pro @@ -4,15 +4,8 @@ DESTDIR = $$QT.gui.plugins/platforms QT += core-private gui-private platformsupport-private -isEmpty(DIRECTFB_LIBS) { - DIRECTFB_LIBS = -ldirectfb -lfusion -ldirect -lpthread -} -isEmpty(DIRECTFB_INCLUDEPATH) { - DIRECTFB_INCLUDEPATH = /usr/include/directfb -} - -INCLUDEPATH += $$DIRECTFB_INCLUDEPATH -LIBS += $$DIRECTFB_LIBS +LIBS += $$QMAKE_LIBS_DIRECTFB +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_DIRECTFB SOURCES = main.cpp \ qdirectfbintegration.cpp \ @@ -44,6 +37,9 @@ directfb_egl { HEADERS += $$DIRECTFB_PLATFORM_HOOKS_HEADERS SOURCES += $$DIRECTFB_PLATFORM_HOOKS_SOURCES DEFINES += DIRECTFB_PLATFORM_HOOKS + LIBS += $$DIRECTFB_PLATFORM_HOOKS_LIBS + QMAKE_LIBDIR += $$DIRECTFB_PLATFORM_HOOKS_LIBDIR + INCLUDEPATH += $$DIRECTFB_PLATFORM_HOOKS_INCLUDEPATH } else { SOURCES += qdirectfbeglhooks_stub.cpp } diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro index 1321270dc6..51de06f910 100644 --- a/src/plugins/platforms/platforms.pro +++ b/src/plugins/platforms/platforms.pro @@ -17,3 +17,7 @@ qnx { contains(QT_CONFIG, eglfs) { SUBDIRS += eglfs } + +contains(QT_CONFIG, directfb) { + SUBDIRS += directfb +} -- cgit v1.2.3 From 84caba25d8cc0b7a050abc4d60393fbb3ec73391 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 13 Apr 2012 09:28:44 +0200 Subject: Move QPainterPathPrivate to the private header files. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was made inline for the sake of performance, but has in hindsight proven to be not really worth it. It also prevents us from aligning the internal datastructure of QPainterPath with that of QPolygonF and the internal QVectorPath class which would make mapping between the two inside QPainter a lot faster. Making all this out-of-line now as discussed in the task https://bugreports.qt-project.org/browse/QTBUG-19998 so we can adress this in a binary compatible fashion during Qt 5.x Change-Id: I61058171ed31f8a845fa45517248367c85ce52cd Reviewed-by: Lars Knoll Reviewed-by: Samuel Rødal --- src/gui/painting/qmatrix.cpp | 1 + src/gui/painting/qpainterpath.cpp | 37 ++++++++++++++++++++- src/gui/painting/qpainterpath.h | 67 +++------------------------------------ src/gui/painting/qpainterpath_p.h | 23 ++++++++++++++ src/gui/painting/qtransform.cpp | 1 + 5 files changed, 66 insertions(+), 63 deletions(-) diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp index ced2e4548c..c26d7e5d98 100644 --- a/src/gui/painting/qmatrix.cpp +++ b/src/gui/painting/qmatrix.cpp @@ -44,6 +44,7 @@ #include "qmatrix.h" #include "qregion.h" #include "qpainterpath.h" +#include "qpainterpath_p.h" #include "qvariant.h" #include diff --git a/src/gui/painting/qpainterpath.cpp b/src/gui/painting/qpainterpath.cpp index e098e7c761..0e8811b934 100644 --- a/src/gui/painting/qpainterpath.cpp +++ b/src/gui/painting/qpainterpath.cpp @@ -478,14 +478,26 @@ static void qt_debug_path(const QPainterPath &path) \sa ElementType, elementAt(), isEmpty() */ +int QPainterPath::elementCount() const +{ + return d_ptr ? d_ptr->elements.size() : 0; +} + /*! - \fn const QPainterPath::Element &QPainterPath::elementAt(int index) const + \fn QPainterPath::Element QPainterPath::elementAt(int index) const Returns the element at the given \a index in the painter path. \sa ElementType, elementCount(), isEmpty() */ +QPainterPath::Element QPainterPath::elementAt(int i) const +{ + Q_ASSERT(d_ptr); + Q_ASSERT(i >= 0 && i < elementCount()); + return d_ptr->elements.at(i); +} + /*! \fn void QPainterPath::setElementPositionAt(int index, qreal x, qreal y) \since 4.2 @@ -494,6 +506,17 @@ static void qt_debug_path(const QPainterPath &path) x and \a y. */ +void QPainterPath::setElementPositionAt(int i, qreal x, qreal y) +{ + Q_ASSERT(d_ptr); + Q_ASSERT(i >= 0 && i < elementCount()); + detach(); + QPainterPath::Element &e = d_ptr->elements[i]; + e.x = x; + e.y = y; +} + + /*### \fn QPainterPath &QPainterPath::operator +=(const QPainterPath &other) @@ -535,6 +558,13 @@ QPainterPath::QPainterPath(const QPointF &startPoint) d_func()->elements << e; } +void QPainterPath::detach() +{ + if (d_ptr->ref.load() != 1) + detach_helper(); + setDirty(true); +} + /*! \internal */ @@ -1451,6 +1481,11 @@ QRectF QPainterPath::controlPointRect() const \sa elementCount() */ +bool QPainterPath::isEmpty() const +{ + return !d_ptr || (d_ptr->elements.size() == 1 && d_ptr->elements.first().type == MoveToElement); +} + /*! Creates and returns a reversed copy of the path. diff --git a/src/gui/painting/qpainterpath.h b/src/gui/painting/qpainterpath.h index 40456bc163..7bb52f4125 100644 --- a/src/gui/painting/qpainterpath.h +++ b/src/gui/painting/qpainterpath.h @@ -165,7 +165,7 @@ public: Qt::FillRule fillRule() const; void setFillRule(Qt::FillRule fillRule); - inline bool isEmpty() const; + bool isEmpty() const; QPainterPath toReversed() const; QList toSubpathPolygons(const QMatrix &matrix = QMatrix()) const; @@ -175,9 +175,9 @@ public: QList toFillPolygons(const QTransform &matrix) const; QPolygonF toFillPolygon(const QTransform &matrix) const; - inline int elementCount() const; - inline const QPainterPath::Element &elementAt(int i) const; - inline void setElementPositionAt(int i, qreal x, qreal y); + int elementCount() const; + QPainterPath::Element elementAt(int i) const; + void setElementPositionAt(int i, qreal x, qreal y); qreal length() const; qreal percentAtLength(qreal t) const; @@ -211,7 +211,7 @@ private: inline void ensureData() { if (!d_ptr) ensureData_helper(); } void ensureData_helper(); - inline void detach(); + void detach(); void detach_helper(); void setDirty(bool); void computeBoundingRect() const; @@ -233,29 +233,6 @@ private: #endif }; -class QPainterPathPrivate -{ -public: - friend class QPainterPath; - friend class QPainterPathData; - friend class QPainterPathStroker; - friend class QPainterPathStrokerPrivate; - friend class QMatrix; - friend class QTransform; - friend class QVectorPath; - friend struct QPainterPathPrivateDeleter; -#ifndef QT_NO_DATASTREAM - friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPainterPath &); - friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPainterPath &); -#endif - - QPainterPathPrivate() : ref(1) {} - -private: - QAtomicInt ref; - QVector elements; -}; - Q_DECLARE_TYPEINFO(QPainterPath::Element, Q_PRIMITIVE_TYPE); #ifndef QT_NO_DATASTREAM @@ -391,40 +368,6 @@ inline void QPainterPath::translate(const QPointF &offset) inline QPainterPath QPainterPath::translated(const QPointF &offset) const { return translated(offset.x(), offset.y()); } -inline bool QPainterPath::isEmpty() const -{ - return !d_ptr || (d_ptr->elements.size() == 1 && d_ptr->elements.first().type == MoveToElement); -} - -inline int QPainterPath::elementCount() const -{ - return d_ptr ? d_ptr->elements.size() : 0; -} - -inline const QPainterPath::Element &QPainterPath::elementAt(int i) const -{ - Q_ASSERT(d_ptr); - Q_ASSERT(i >= 0 && i < elementCount()); - return d_ptr->elements.at(i); -} - -inline void QPainterPath::setElementPositionAt(int i, qreal x, qreal y) -{ - Q_ASSERT(d_ptr); - Q_ASSERT(i >= 0 && i < elementCount()); - detach(); - QPainterPath::Element &e = d_ptr->elements[i]; - e.x = x; - e.y = y; -} - - -inline void QPainterPath::detach() -{ - if (d_ptr->ref.load() != 1) - detach_helper(); - setDirty(true); -} #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug, const QPainterPath &); diff --git a/src/gui/painting/qpainterpath_p.h b/src/gui/painting/qpainterpath_p.h index a9068f3855..116ea63425 100644 --- a/src/gui/painting/qpainterpath_p.h +++ b/src/gui/painting/qpainterpath_p.h @@ -65,6 +65,29 @@ QT_BEGIN_NAMESPACE +class QPainterPathPrivate +{ +public: + friend class QPainterPath; + friend class QPainterPathData; + friend class QPainterPathStroker; + friend class QPainterPathStrokerPrivate; + friend class QMatrix; + friend class QTransform; + friend class QVectorPath; + friend struct QPainterPathPrivateDeleter; +#ifndef QT_NO_DATASTREAM + friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPainterPath &); + friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPainterPath &); +#endif + + QPainterPathPrivate() : ref(1) {} + +private: + QAtomicInt ref; + QVector elements; +}; + class QPainterPathStrokerPrivate { public: diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index e5c41efc15..ba971d454d 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -45,6 +45,7 @@ #include "qmatrix.h" #include "qregion.h" #include "qpainterpath.h" +#include "qpainterpath_p.h" #include "qvariant.h" #include #include -- cgit v1.2.3 From 5a8c13a7d4420cabf0fadbed6f8cae07162a32d8 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 12 Apr 2012 22:46:01 +0200 Subject: doc: Fix QObject::connect documentation Unfortunately, qdoc is too simple to understand any pointer to member function syntax. (the ::* token is not even tokenized. And even if it was, it would be a difficult way to hack that into the parser. (there is already an ugly workaround for non-member pointer to function hat works by having '(*' as a token,but the same hack is not possible for pointer to member function)) So I just put verbatim 'PointerToMemberFunction' Also remove the obsolete mention that Qt::UniqueConnection is not supported in that overload. It is now. (And it even contradicts the previous paragraph) Change-Id: I8fc9544808c9a462b0f11ccea406e2e33dee15b1 Reviewed-by: Geir Vattekar Reviewed-by: Casper van Donderen --- src/corelib/kernel/qobject.cpp | 19 ++++++++----------- src/corelib/kernel/qobject.h | 6 +++--- src/corelib/kernel/qobjectdefs.h | 2 +- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 25adee7cc7..984624b58f 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -3872,8 +3872,8 @@ void qDeleteInEventHandler(QObject *o) } /*! - \fn QMetaObject::Connection QObject::connect(const QObject *sender, (T::*signal)(...), const QObject *receiver, (T::*method)(...), Qt::ConnectionType type) - + \fn QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) + \overload connect() \threadsafe Creates a connection of the given \a type from the \a signal in @@ -3929,18 +3929,14 @@ void qDeleteInEventHandler(QObject *o) \snippet doc/src/snippets/code/src_corelib_kernel_qobject.cpp 25 make sure to declare the argument type with Q_DECLARE_METATYPE - - A signal is emitted for every connection you make; - two signals are emitted for duplicate connections. - This overload does not support the type Qt::UniqueConnection */ /*! - \fn QMetaObject::Connection QObject::connect(const QObject *sender, (T::*signal)(...), Functor functor) + \fn QMetaObject::Connection QObject::connect(const QObject *sender, PointerToMemberFunction signal, Functor functor) \threadsafe - \overload + \overload connect() Creates a connection of the given \a type from the \a signal in the \a sender object to the \a functor and returns a handle to the connection @@ -4089,9 +4085,9 @@ bool QObject::disconnect(const QMetaObject::Connection &connection) return true; } -/*! \fn bool QObject::disconnect(const QObject *sender, (T::*signal)(...), const Qbject *receiver, (T::*method)(...)) +/*! \fn bool QObject::disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) + \overload diconnect() \threadsafe - \overload Disconnects \a signal in object \a sender from \a method in object \a receiver. Returns true if the connection is successfully broken; @@ -4148,6 +4144,7 @@ bool QObject::disconnect(const QMetaObject::Connection &connection) \sa connect() */ + bool QObject::disconnectImpl(const QObject *sender, void **signal, const QObject *receiver, void **slot, const QMetaObject *senderMetaObject) { if (sender == 0 || (receiver == 0 && slot != 0)) { @@ -4209,7 +4206,7 @@ QMetaObject::Connection::~Connection() } /*! - \fn bool QMetaObject::Connection::operator bool() + \fn QMetaObject::Connection::operator bool() const Returns true if the connection is valid. diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 9f09617071..59339da894 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -199,8 +199,8 @@ public: const char *member, Qt::ConnectionType type = Qt::AutoConnection) const; #ifdef Q_QDOC - QMetaObject::Connection QObject::connect(const QObject *sender, (T::*signal)(...), const QObject *receiver, (T::*method)(...), Qt::ConnectionType type) - QMetaObject::Connection QObject::connect(const QObject *sender, (T::*signal)(...), Functor functor) + static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type); + static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor); #else //Connect a signal to a pointer to qobject member function template @@ -279,7 +279,7 @@ public: static bool disconnect(const QMetaObject::Connection &); #ifdef Q_QDOC - bool QObject::disconnect(const QObject *sender, (T::*signal)(...), const Qbject *receiver, (T::*method)(...)) + static bool disconnect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method); #else template static inline bool disconnect(const typename QtPrivate::FunctionPointer::Object *sender, Func1 signal, diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h index 5588724d4c..d391fb94ce 100644 --- a/src/corelib/kernel/qobjectdefs.h +++ b/src/corelib/kernel/qobjectdefs.h @@ -462,7 +462,7 @@ public: Connection(); Connection(const Connection &other); Connection &operator=(const Connection &other); -#ifdef qdoc +#ifdef Q_QDOC operator bool() const; #else typedef void *Connection::*RestrictedBool; -- cgit v1.2.3 From 76f536d661d4765ef12e146fae1527dcd0508137 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 10 Apr 2012 22:58:05 +0200 Subject: Use QPointer to store accessible object. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Itemview were not following the established pattern of keeping the referenced object in a QPointer. This made them a lot more crash prone. Port of Qt 4 change. Conflicts: src/plugins/accessible/widgets/itemviews.cpp src/plugins/accessible/widgets/itemviews.h Change-Id: I210b112b9c3647b246fde2d6c69aba9ce8d25bd3 Reviewed-by: Jan-Arve Sæther (cherry picked from commit f420ab2870d3c96e9678c24c64b4e26ec8a771bd) --- src/plugins/accessible/widgets/itemviews.cpp | 167 ++++++++++++++------------- src/plugins/accessible/widgets/itemviews.h | 12 +- 2 files changed, 96 insertions(+), 83 deletions(-) diff --git a/src/plugins/accessible/widgets/itemviews.cpp b/src/plugins/accessible/widgets/itemviews.cpp index a2fe2cb7fd..c0a8ec4286 100644 --- a/src/plugins/accessible/widgets/itemviews.cpp +++ b/src/plugins/accessible/widgets/itemviews.cpp @@ -67,6 +67,12 @@ TABLE/LIST/TREE ... */ + +QAbstractItemView *QAccessibleTable::view() const +{ + return qobject_cast(object()); +} + int QAccessibleTable::logicalIndex(const QModelIndex &index) const { if (!index.isValid()) @@ -79,11 +85,14 @@ int QAccessibleTable::logicalIndex(const QModelIndex &index) const QAccessibleInterface *QAccessibleTable::childFromLogical(int logicalIndex) const { + if (!isValid()) + return 0; + logicalIndex--; // one based counting ftw int vHeader = verticalHeader() ? 1 : 0; int hHeader = horizontalHeader() ? 1 : 0; - int columns = view->model()->columnCount() + vHeader; + int columns = view()->model()->columnCount() + vHeader; int row = logicalIndex / columns; int column = logicalIndex % columns; @@ -91,32 +100,31 @@ QAccessibleInterface *QAccessibleTable::childFromLogical(int logicalIndex) const if (vHeader) { if (column == 0) { if (row == 0) { - return new QAccessibleTableCornerButton(view); + return new QAccessibleTableCornerButton(view()); } - return new QAccessibleTableHeaderCell(view, row-1, Qt::Vertical); + return new QAccessibleTableHeaderCell(view(), row-1, Qt::Vertical); } --column; } if (hHeader) { if (row == 0) { - return new QAccessibleTableHeaderCell(view, column, Qt::Horizontal); + return new QAccessibleTableHeaderCell(view(), column, Qt::Horizontal); } --row; } - return new QAccessibleTableCell(view, view->model()->index(row, column), cellRole()); + return new QAccessibleTableCell(view(), view()->model()->index(row, column), cellRole()); } QAccessibleTable::QAccessibleTable(QWidget *w) : QAccessibleObject(w) { - view = qobject_cast(w); - Q_ASSERT(view); + Q_ASSERT(view()); - if (qobject_cast(view)) { + if (qobject_cast(view())) { m_role = QAccessible::Table; - } else if (qobject_cast(view)) { + } else if (qobject_cast(view())) { m_role = QAccessible::Tree; - } else if (qobject_cast(view)) { + } else if (qobject_cast(view())) { m_role = QAccessible::List; } else { // is this our best guess? @@ -133,11 +141,11 @@ QHeaderView *QAccessibleTable::horizontalHeader() const QHeaderView *header = 0; if (false) { #ifndef QT_NO_TABLEVIEW - } else if (const QTableView *tv = qobject_cast(view)) { + } else if (const QTableView *tv = qobject_cast(view())) { header = tv->horizontalHeader(); #endif #ifndef QT_NO_TREEVIEW - } else if (const QTreeView *tv = qobject_cast(view)) { + } else if (const QTreeView *tv = qobject_cast(view())) { header = tv->header(); #endif } @@ -149,7 +157,7 @@ QHeaderView *QAccessibleTable::verticalHeader() const QHeaderView *header = 0; if (false) { #ifndef QT_NO_TABLEVIEW - } else if (const QTableView *tv = qobject_cast(view)) { + } else if (const QTableView *tv = qobject_cast(view())) { header = tv->verticalHeader(); #endif } @@ -159,16 +167,16 @@ QHeaderView *QAccessibleTable::verticalHeader() const QAccessibleTableCell *QAccessibleTable::cell(const QModelIndex &index) const { if (index.isValid()) - return new QAccessibleTableCell(view, index, cellRole()); + return new QAccessibleTableCell(view(), index, cellRole()); return 0; } QAccessibleInterface *QAccessibleTable::cellAt(int row, int column) const { Q_ASSERT(role() != QAccessible::Tree); - QModelIndex index = view->model()->index(row, column); + QModelIndex index = view()->model()->index(row, column); if (!index.isValid()) { - qWarning() << "QAccessibleTable::cellAt: invalid index: " << index << " for " << view; + qWarning() << "QAccessibleTable::cellAt: invalid index: " << index << " for " << view(); return 0; } return cell(index); @@ -181,43 +189,43 @@ QAccessibleInterface *QAccessibleTable::caption() const QString QAccessibleTable::columnDescription(int column) const { - return view->model()->headerData(column, Qt::Horizontal).toString(); + return view()->model()->headerData(column, Qt::Horizontal).toString(); } int QAccessibleTable::columnCount() const { - return view->model()->columnCount(); + return view()->model()->columnCount(); } int QAccessibleTable::rowCount() const { - return view->model()->rowCount(); + return view()->model()->rowCount(); } int QAccessibleTable::selectedCellCount() const { - return view->selectionModel()->selectedIndexes().count(); + return view()->selectionModel()->selectedIndexes().count(); } int QAccessibleTable::selectedColumnCount() const { - return view->selectionModel()->selectedColumns().count(); + return view()->selectionModel()->selectedColumns().count(); } int QAccessibleTable::selectedRowCount() const { - return view->selectionModel()->selectedRows().count(); + return view()->selectionModel()->selectedRows().count(); } QString QAccessibleTable::rowDescription(int row) const { - return view->model()->headerData(row, Qt::Vertical).toString(); + return view()->model()->headerData(row, Qt::Vertical).toString(); } QList QAccessibleTable::selectedCells() const { QList cells; - Q_FOREACH (const QModelIndex &index, view->selectionModel()->selectedIndexes()) { + Q_FOREACH (const QModelIndex &index, view()->selectionModel()->selectedIndexes()) { cells.append(cell(index)); } return cells; @@ -226,7 +234,7 @@ QList QAccessibleTable::selectedCells() const QList QAccessibleTable::selectedColumns() const { QList columns; - Q_FOREACH (const QModelIndex &index, view->selectionModel()->selectedColumns()) { + Q_FOREACH (const QModelIndex &index, view()->selectionModel()->selectedColumns()) { columns.append(index.column()); } return columns; @@ -235,7 +243,7 @@ QList QAccessibleTable::selectedColumns() const QList QAccessibleTable::selectedRows() const { QList rows; - Q_FOREACH (const QModelIndex &index, view->selectionModel()->selectedRows()) { + Q_FOREACH (const QModelIndex &index, view()->selectionModel()->selectedRows()) { rows.append(index.row()); } return rows; @@ -248,47 +256,47 @@ QAccessibleInterface *QAccessibleTable::summary() const bool QAccessibleTable::isColumnSelected(int column) const { - return view->selectionModel()->isColumnSelected(column, QModelIndex()); + return view()->selectionModel()->isColumnSelected(column, QModelIndex()); } bool QAccessibleTable::isRowSelected(int row) const { - return view->selectionModel()->isRowSelected(row, QModelIndex()); + return view()->selectionModel()->isRowSelected(row, QModelIndex()); } bool QAccessibleTable::selectRow(int row) { - QModelIndex index = view->model()->index(row, 0); - if (!index.isValid() || view->selectionMode() & QAbstractItemView::NoSelection) + QModelIndex index = view()->model()->index(row, 0); + if (!index.isValid() || view()->selectionMode() & QAbstractItemView::NoSelection) return false; - view->selectionModel()->select(index, QItemSelectionModel::Select); + view()->selectionModel()->select(index, QItemSelectionModel::Select); return true; } bool QAccessibleTable::selectColumn(int column) { - QModelIndex index = view->model()->index(0, column); - if (!index.isValid() || view->selectionMode() & QAbstractItemView::NoSelection) + QModelIndex index = view()->model()->index(0, column); + if (!index.isValid() || view()->selectionMode() & QAbstractItemView::NoSelection) return false; - view->selectionModel()->select(index, QItemSelectionModel::Select); + view()->selectionModel()->select(index, QItemSelectionModel::Select); return true; } bool QAccessibleTable::unselectRow(int row) { - QModelIndex index = view->model()->index(row, 0); - if (!index.isValid() || view->selectionMode() & QAbstractItemView::NoSelection) + QModelIndex index = view()->model()->index(row, 0); + if (!index.isValid() || view()->selectionMode() & QAbstractItemView::NoSelection) return false; - view->selectionModel()->select(index, QItemSelectionModel::Deselect); + view()->selectionModel()->select(index, QItemSelectionModel::Deselect); return true; } bool QAccessibleTable::unselectColumn(int column) { - QModelIndex index = view->model()->index(0, column); - if (!index.isValid() || view->selectionMode() & QAbstractItemView::NoSelection) + QModelIndex index = view()->model()->index(0, column); + if (!index.isValid() || view()->selectionMode() & QAbstractItemView::NoSelection) return false; - view->selectionModel()->select(index, QItemSelectionModel::Columns & QItemSelectionModel::Deselect); + view()->selectionModel()->select(index, QItemSelectionModel::Columns & QItemSelectionModel::Deselect); return true; } @@ -304,11 +312,11 @@ QAccessible::State QAccessibleTable::state() const QAccessibleInterface *QAccessibleTable::childAt(int x, int y) const { - QPoint viewportOffset = view->viewport()->mapTo(view, QPoint(0,0)); - QPoint indexPosition = view->mapFromGlobal(QPoint(x, y) - viewportOffset); + QPoint viewportOffset = view()->viewport()->mapTo(view(), QPoint(0,0)); + QPoint indexPosition = view()->mapFromGlobal(QPoint(x, y) - viewportOffset); // FIXME: if indexPosition < 0 in one coordinate, return header - QModelIndex index = view->indexAt(indexPosition); + QModelIndex index = view()->indexAt(indexPosition); if (index.isValid()) { return childFromLogical(logicalIndex(index)); } @@ -317,11 +325,11 @@ QAccessibleInterface *QAccessibleTable::childAt(int x, int y) const int QAccessibleTable::childCount() const { - if (!view->model()) + if (!view()->model()) return 0; int vHeader = verticalHeader() ? 1 : 0; int hHeader = horizontalHeader() ? 1 : 0; - return (view->model()->rowCount()+hHeader) * (view->model()->columnCount()+vHeader); + return (view()->model()->rowCount()+hHeader) * (view()->model()->columnCount()+vHeader); } int QAccessibleTable::indexOfChild(const QAccessibleInterface *iface) const @@ -335,7 +343,7 @@ int QAccessibleTable::indexOfChild(const QAccessibleInterface *iface) const return cell->index + (verticalHeader() ? 1 : 0); } else if (iface->role() == QAccessible::RowHeader){ const QAccessibleTableHeaderCell* cell = static_cast(iface); - return (cell->index+1) * (view->model()->rowCount()+1); + return (cell->index+1) * (view()->model()->rowCount()+1); } else if (iface->role() == QAccessible::Pane) { return 0; // corner button } else { @@ -349,25 +357,25 @@ int QAccessibleTable::indexOfChild(const QAccessibleInterface *iface) const QString QAccessibleTable::text(QAccessible::Text t) const { if (t == QAccessible::Description) - return view->accessibleDescription(); - return view->accessibleName(); + return view()->accessibleDescription(); + return view()->accessibleName(); } QRect QAccessibleTable::rect() const { - if (!view->isVisible()) + if (!view()->isVisible()) return QRect(); - QPoint pos = view->mapToGlobal(QPoint(0, 0)); - return QRect(pos.x(), pos.y(), view->width(), view->height()); + QPoint pos = view()->mapToGlobal(QPoint(0, 0)); + return QRect(pos.x(), pos.y(), view()->width(), view()->height()); } QAccessibleInterface *QAccessibleTable::parent() const { - if (view->parent()) { - if (qstrcmp("QComboBoxPrivateContainer", view->parent()->metaObject()->className()) == 0) { - return QAccessible::queryAccessibleInterface(view->parent()->parent()); + if (view()->parent()) { + if (qstrcmp("QComboBoxPrivateContainer", view()->parent()->metaObject()->className()) == 0) { + return QAccessible::queryAccessibleInterface(view()->parent()->parent()); } - return QAccessible::queryAccessibleInterface(view->parent()); + return QAccessible::queryAccessibleInterface(view()->parent()); } return 0; } @@ -389,42 +397,45 @@ void *QAccessibleTable::interface_cast(QAccessible::InterfaceType t) QModelIndex QAccessibleTree::indexFromLogical(int row, int column) const { - const QTreeView *treeView = qobject_cast(view); + if (!isValid()) + return QModelIndex(); + + const QTreeView *treeView = qobject_cast(view()); QModelIndex modelIndex = treeView->d_func()->viewItems.at(row).index; if (modelIndex.isValid() && column > 0) { - modelIndex = view->model()->index(modelIndex.row(), column, modelIndex.parent()); + modelIndex = view()->model()->index(modelIndex.row(), column, modelIndex.parent()); } return modelIndex; } QAccessibleInterface *QAccessibleTree::childAt(int x, int y) const { - QPoint viewportOffset = view->viewport()->mapTo(view, QPoint(0,0)); - QPoint indexPosition = view->mapFromGlobal(QPoint(x, y) - viewportOffset); + QPoint viewportOffset = view()->viewport()->mapTo(view(), QPoint(0,0)); + QPoint indexPosition = view()->mapFromGlobal(QPoint(x, y) - viewportOffset); - QModelIndex index = view->indexAt(indexPosition); + QModelIndex index = view()->indexAt(indexPosition); if (!index.isValid()) return 0; - const QTreeView *treeView = qobject_cast(view); + const QTreeView *treeView = qobject_cast(view()); int row = treeView->d_func()->viewIndex(index) + (horizontalHeader() ? 1 : 0); int column = index.column(); - int i = row * view->model()->columnCount() + column + 1; - Q_ASSERT(i > view->model()->columnCount()); + int i = row * view()->model()->columnCount() + column + 1; + Q_ASSERT(i > view()->model()->columnCount()); return child(i - 1); } int QAccessibleTree::childCount() const { - const QTreeView *treeView = qobject_cast(view); + const QTreeView *treeView = qobject_cast(view()); Q_ASSERT(treeView); - if (!view->model()) + if (!view()->model()) return 0; int hHeader = horizontalHeader() ? 1 : 0; - return (treeView->d_func()->viewItems.count() + hHeader)* view->model()->columnCount(); + return (treeView->d_func()->viewItems.count() + hHeader)* view()->model()->columnCount(); } @@ -434,15 +445,15 @@ QAccessibleInterface *QAccessibleTree::child(int index) const int hHeader = horizontalHeader() ? 1 : 0; if (hHeader) { - if (index < view->model()->columnCount()) { - return new QAccessibleTableHeaderCell(view, index, Qt::Horizontal); + if (index < view()->model()->columnCount()) { + return new QAccessibleTableHeaderCell(view(), index, Qt::Horizontal); } else { - index -= view->model()->columnCount(); + index -= view()->model()->columnCount(); } } - int row = index / view->model()->columnCount(); - int column = index % view->model()->columnCount(); + int row = index / view()->model()->columnCount(); + int column = index % view()->model()->columnCount(); QModelIndex modelIndex = indexFromLogical(row, column); if (modelIndex.isValid()) { return cell(modelIndex); @@ -452,7 +463,7 @@ QAccessibleInterface *QAccessibleTree::child(int index) const int QAccessibleTree::rowCount() const { - const QTreeView *treeView = qobject_cast(view); + const QTreeView *treeView = qobject_cast(view()); Q_ASSERT(treeView); return treeView->d_func()->viewItems.count(); } @@ -461,12 +472,12 @@ int QAccessibleTree::indexOfChild(const QAccessibleInterface *iface) const { if (iface->role() == QAccessible::TreeItem) { const QAccessibleTableCell* cell = static_cast(iface); - const QTreeView *treeView = qobject_cast(view); + const QTreeView *treeView = qobject_cast(view()); Q_ASSERT(treeView); int row = treeView->d_func()->viewIndex(cell->m_index) + (horizontalHeader() ? 1 : 0); int column = cell->m_index.column(); - int index = row * view->model()->columnCount() + column; + int index = row * view()->model()->columnCount() + column; //qDebug() << "QAccessibleTree::indexOfChild r " << row << " c " << column << "index " << index; Q_ASSERT(index >= treeView->model()->columnCount()); return index; @@ -489,7 +500,7 @@ QAccessibleInterface *QAccessibleTree::cellAt(int row, int column) const qWarning() << "Requested invalid tree cell: " << row << column; return 0; } - return new QAccessibleTableCell(view, index, cellRole()); + return new QAccessibleTableCell(view(), index, cellRole()); } QString QAccessibleTree::rowDescription(int) const @@ -500,15 +511,15 @@ QString QAccessibleTree::rowDescription(int) const bool QAccessibleTree::isRowSelected(int row) const { QModelIndex index = indexFromLogical(row); - return view->selectionModel()->isRowSelected(index.row(), index.parent()); + return view()->selectionModel()->isRowSelected(index.row(), index.parent()); } bool QAccessibleTree::selectRow(int row) { QModelIndex index = indexFromLogical(row); - if (!index.isValid() || view->selectionMode() & QAbstractItemView::NoSelection) + if (!index.isValid() || view()->selectionMode() & QAbstractItemView::NoSelection) return false; - view->selectionModel()->select(index, QItemSelectionModel::Select); + view()->selectionModel()->select(index, QItemSelectionModel::Select); return true; } diff --git a/src/plugins/accessible/widgets/itemviews.h b/src/plugins/accessible/widgets/itemviews.h index 2672cd4a16..1d42c511f0 100644 --- a/src/plugins/accessible/widgets/itemviews.h +++ b/src/plugins/accessible/widgets/itemviews.h @@ -42,11 +42,12 @@ #ifndef ACCESSIBLE_ITEMVIEWS_H #define ACCESSIBLE_ITEMVIEWS_H -#include -#include +#include "QtCore/qpointer.h" #include #include #include +#include +#include QT_BEGIN_NAMESPACE @@ -65,7 +66,6 @@ public: virtual ~QAccessibleTable(); - QObject *object() const { return view; } QAccessible::Role role() const; QAccessible::State state() const; QString text(QAccessible::Text t) const; @@ -103,9 +103,11 @@ public: virtual bool unselectRow(int row); virtual bool unselectColumn(int column); + QAbstractItemView *view() const; + protected: - QAbstractItemView* view; inline QAccessibleTableCell *cell(const QModelIndex &index) const; + inline QAccessible::Role cellRole() const { switch (m_role) { case QAccessible::List: @@ -193,7 +195,7 @@ public: private: QHeaderView *verticalHeader() const; QHeaderView *horizontalHeader() const; - QAbstractItemView *view; + QPointer view; QModelIndex m_index; QAccessible::Role m_role; -- cgit v1.2.3 From cdc221ae00260c1bea196e2728eb20b83db19bbe Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 12 Apr 2012 13:59:03 +0200 Subject: Fix warnings in manual tests. - Constructor order. - Unused variables. - size_t -> int conversions. Change-Id: Ic5b016f41d01a4d8153ae0900b607bf946523c1d Reviewed-by: Jason McDonald --- tests/manual/network_stresstest/minihttpserver.cpp | 2 +- tests/manual/network_stresstest/tst_network_stresstest.cpp | 2 +- tests/manual/qgraphicsitemgroup/customitem.cpp | 2 +- tests/manual/qgraphicslayout/flicker/window.h | 4 ++-- tests/manual/qnetworkaccessmanager/qget/downloadmanager.cpp | 6 +++--- tests/manual/qtabletevent/device_information/tabletwidget.cpp | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/manual/network_stresstest/minihttpserver.cpp b/tests/manual/network_stresstest/minihttpserver.cpp index e3473a3141..1bafe9363d 100644 --- a/tests/manual/network_stresstest/minihttpserver.cpp +++ b/tests/manual/network_stresstest/minihttpserver.cpp @@ -148,7 +148,7 @@ void MiniHttpServerConnection::handlePendingRequest() return; } - QUrl uri = QUrl::fromEncoded(request.mid(4, eol - strlen(http11) - 4)); + QUrl uri = QUrl::fromEncoded(request.mid(4, eol - int(strlen(http11)) - 4)); source.setFileName(":" + uri.path()); // connection-close? diff --git a/tests/manual/network_stresstest/tst_network_stresstest.cpp b/tests/manual/network_stresstest/tst_network_stresstest.cpp index 38a516af82..74237ea9cc 100644 --- a/tests/manual/network_stresstest/tst_network_stresstest.cpp +++ b/tests/manual/network_stresstest/tst_network_stresstest.cpp @@ -537,7 +537,7 @@ void tst_NetworkStressTest::blockingMultipleRequests() qWarning() << "no content-length:" << QString(buffer); break; } - pos += strlen("\r\ncontent-length: "); + pos += int(strlen("\r\ncontent-length: ")); int eol = buffer.indexOf("\r\n", pos + 2); if (eol == -1) { diff --git a/tests/manual/qgraphicsitemgroup/customitem.cpp b/tests/manual/qgraphicsitemgroup/customitem.cpp index 6f3f1e0522..eab218e9a0 100644 --- a/tests/manual/qgraphicsitemgroup/customitem.cpp +++ b/tests/manual/qgraphicsitemgroup/customitem.cpp @@ -80,7 +80,7 @@ CustomGroup::CustomGroup() : setFlag(QGraphicsItem::ItemIsSelectable); } -void CustomGroup::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +void CustomGroup::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *) { if (option->state & QStyle::State_Selected) painter->setOpacity(1.); diff --git a/tests/manual/qgraphicslayout/flicker/window.h b/tests/manual/qgraphicslayout/flicker/window.h index 3b032c3b45..51bf0e0733 100644 --- a/tests/manual/qgraphicslayout/flicker/window.h +++ b/tests/manual/qgraphicslayout/flicker/window.h @@ -46,8 +46,8 @@ #include struct Statistics { - Statistics() : output(0), - setGeometryCount(0), currentBenchmarkIteration(0), relayoutClicked(false), sleepMsecs(0) + Statistics() : setGeometryCount(0), sleepMsecs(0), output(0), + currentBenchmarkIteration(0), relayoutClicked(false) { } QMap setGeometryTracker; diff --git a/tests/manual/qnetworkaccessmanager/qget/downloadmanager.cpp b/tests/manual/qnetworkaccessmanager/qget/downloadmanager.cpp index e3ba3ca88f..5eab6d43bd 100644 --- a/tests/manual/qnetworkaccessmanager/qget/downloadmanager.cpp +++ b/tests/manual/qnetworkaccessmanager/qget/downloadmanager.cpp @@ -83,7 +83,7 @@ void DownloadManager::upload(const QUrl &url, const QString &user, const QString connect(ul, SIGNAL(downloadFinished(TransferItem*)), SLOT(downloadFinished(TransferItem*))); } -void DownloadManager::finished(QNetworkReply *reply) +void DownloadManager::finished(QNetworkReply *) { } @@ -121,7 +121,7 @@ void DownloadManager::authenticationRequired(QNetworkReply *reply, QAuthenticato qDebug() << "authenticationRequired" << reply; TransferItem *transfer = findTransfer(reply); //provide the credentials exactly once, so that it fails if credentials are incorrect. - if (transfer && !transfer->user.isEmpty() || !transfer->password.isEmpty()) { + if ((transfer && !transfer->user.isEmpty()) || !transfer->password.isEmpty()) { auth->setUser(transfer->user); auth->setPassword(transfer->password); transfer->user.clear(); @@ -129,7 +129,7 @@ void DownloadManager::authenticationRequired(QNetworkReply *reply, QAuthenticato } } -void DownloadManager::proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *auth) +void DownloadManager::proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *auth) { //provide the credentials exactly once, so that it fails if credentials are incorrect. if (!proxyUser.isEmpty() || !proxyPassword.isEmpty()) { diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.cpp b/tests/manual/qtabletevent/device_information/tabletwidget.cpp index d12da6c886..bc0c63bbb1 100644 --- a/tests/manual/qtabletevent/device_information/tabletwidget.cpp +++ b/tests/manual/qtabletevent/device_information/tabletwidget.cpp @@ -94,7 +94,7 @@ bool TabletWidget::eventFilter(QObject *, QEvent *ev) return false; } -void TabletWidget::paintEvent(QPaintEvent *event) +void TabletWidget::paintEvent(QPaintEvent *) { QPainter painter(this); -- cgit v1.2.3 From 13ebff81d034579c3686aa1e1f6aa1f8a0dfcb93 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 12 Apr 2012 16:30:23 +0200 Subject: Windows: Determine suitable font engine from application. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Freetype engine currently works better for QML2, whereas the native engine is better suited to the widgets. Task-number: QTBUG-24205 Change-Id: I76de98c3e7c84a2d72542ea9860b8be1e67f7e04 Reviewed-by: Jan-Arve Sæther --- .../platforms/windows/qwindowsintegration.cpp | 41 ++++++++++++++++++---- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index 6da8932164..d8d04fc1b6 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -277,17 +277,44 @@ QPlatformOpenGLContext return 0; } +/* Workaround for QTBUG-24205: In 'Auto', pick the FreeType engine for + * QML2 applications. */ + +enum FontDatabaseOption { + FontDatabaseAuto, + FontDatabaseFreeType, + FontDatabaseNative +}; + +static inline FontDatabaseOption fontDatabaseOption(const QObject &nativeInterface) +{ + const QVariant argumentV = nativeInterface.property("fontengine"); + if (argumentV.isValid()) { + const QString argument = argumentV.toString(); + if (argument == QLatin1String("freetype")) + return FontDatabaseFreeType; + if (argument == QLatin1String("native")) + return FontDatabaseNative; + } + return FontDatabaseAuto; +} + QPlatformFontDatabase *QWindowsIntegration::fontDatabase() const { if (!d->m_fontDatabase) { -#ifndef QT_NO_FREETYPE - const QVariant argument = d->m_nativeInterface.property("fontengine"); - if (argument.isValid() && argument.toString() == QLatin1String("freetype")) - d->m_fontDatabase = new QWindowsFontDatabaseFT(); - else - d->m_fontDatabase = new QWindowsFontDatabase(); -#else +#ifdef QT_NO_FREETYPE d->m_fontDatabase = new QWindowsFontDatabase(); +#else + FontDatabaseOption option = fontDatabaseOption(d->m_nativeInterface); + if (option == FontDatabaseAuto) { + option = QCoreApplication::applicationName() == QStringLiteral("QtQmlViewer") ? + FontDatabaseFreeType : FontDatabaseNative; + } + if (option == FontDatabaseFreeType) { + d->m_fontDatabase = new QWindowsFontDatabaseFT; + } else { + d->m_fontDatabase = new QWindowsFontDatabase; + } #endif } return d->m_fontDatabase; -- cgit v1.2.3 From cf52540dfbf320e3d5cb9f7546542233c170af80 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Thu, 12 Apr 2012 12:49:03 +0200 Subject: QTBUG-1363: fix QSqlField.length() for ODBC Applied Bill King's suggestion in QTBUG-1363. Columns of hStmt must be accessed in order. Verified using ODBC driver on SQL Server 2005 on Windows 7. Added test for length of text field for MS SQL Server over ODBC. Task-Id: QTBUG-1363 Change-Id: I6673dafe75e3ef394d41e439adb45096c1421068 Reviewed-by: Bill King Reviewed-by: Mark Brand --- src/sql/drivers/odbc/qsql_odbc.cpp | 10 +++++----- tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 40cd2e6f75..d8015c7cdc 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -573,6 +573,11 @@ static QSqlField qMakeFieldInfo(const SQLHANDLE hStmt, const QODBCDriverPrivate* QString fname = qGetStringData(hStmt, 3, -1, p->unicode); int type = qGetIntData(hStmt, 4).toInt(); // column type QSqlField f(fname, qDecodeODBCType(type, p)); + QVariant var = qGetIntData(hStmt, 6); + f.setLength(var.isNull() ? -1 : var.toInt()); // column size + var = qGetIntData(hStmt, 8).toInt(); + f.setPrecision(var.isNull() ? -1 : var.toInt()); // precision + f.setSqlType(type); int required = qGetIntData(hStmt, 10).toInt(); // nullable-flag // required can be SQL_NO_NULLS, SQL_NULLABLE or SQL_NULLABLE_UNKNOWN if (required == SQL_NO_NULLS) @@ -580,11 +585,6 @@ static QSqlField qMakeFieldInfo(const SQLHANDLE hStmt, const QODBCDriverPrivate* else if (required == SQL_NULLABLE) f.setRequired(false); // else we don't know - QVariant var = qGetIntData(hStmt, 6); - f.setLength(var.isNull() ? -1 : var.toInt()); // column size - var = qGetIntData(hStmt, 8).toInt(); - f.setPrecision(var.isNull() ? -1 : var.toInt()); // precision - f.setSqlType(type); return f; } diff --git a/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp b/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp index 68a347ebdb..7d34981a73 100644 --- a/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp +++ b/tests/auto/sql/kernel/qsqldriver/tst_qsqldriver.cpp @@ -129,6 +129,10 @@ void tst_QSqlDriver::record() QSqlRecord rec = db.driver()->record(tablename); QCOMPARE(rec.count(), 4); + // QTBUG-1363: QSqlField::length() always return -1 when using QODBC3 driver and QSqlDatabase::record() + if (db.driverName().startsWith("QODBC") && tst_Databases::isSqlServer(db)) + QCOMPARE(rec.field(1).length(), 20); + if (db.driverName().startsWith("QIBASE")|| db.driverName().startsWith("QOCI") || db.driverName().startsWith("QDB2")) for(int i = 0; i < fields.count(); ++i) fields[i] = fields[i].toUpper(); -- cgit v1.2.3 From d80b00f3206291dc90433a95bd6c6aadc17be0bb Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 13 Apr 2012 09:39:15 -0700 Subject: Fix header inclusion guards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _QPA_ should only be used for qpa (plugin specific api) files. Change-Id: I1fb6cd5973fcabec4c7e87eb6ccb048f825e2aad Reviewed-by: Holger Freyther Reviewed-by: Samuel Rødal --- src/gui/kernel/qguiapplication.h | 6 +++--- src/gui/kernel/qwindow.h | 6 +++--- src/gui/kernel/qwindow_p.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h index aad540d203..8ae0e6dfc5 100644 --- a/src/gui/kernel/qguiapplication.h +++ b/src/gui/kernel/qguiapplication.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QGUIAPPLICATION_QPA_H -#define QGUIAPPLICATION_QPA_H +#ifndef QGUIAPPLICATION_H +#define QGUIAPPLICATION_H #include #include @@ -170,4 +170,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QGUIAPPLICATION_QPA_H +#endif // QGUIAPPLICATION_H diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h index 315c403d20..71ae9686b3 100644 --- a/src/gui/kernel/qwindow.h +++ b/src/gui/kernel/qwindow.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QWINDOW_QPA_H -#define QWINDOW_QPA_H +#ifndef QWINDOW_H +#define QWINDOW_H #include #include @@ -310,4 +310,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QWINDOW_QPA_H +#endif // QWINDOW_H diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index eb4fab9013..b665298ce0 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QWINDOW_QPA_P_H -#define QWINDOW_QPA_P_H +#ifndef QWINDOW_P_H +#define QWINDOW_P_H #include #include @@ -132,4 +132,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QWINDOW_QPA_P_H +#endif // QWINDOW_P_H -- cgit v1.2.3 From eb52d31ddf59d43c2f8cd1e85613b60213fd6696 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 20 Jan 2012 19:07:54 +0100 Subject: Update accessibility selections in QTextControl. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Forwardport from Qt 4. Change-Id: Iae0c2792b64b8ec2736a9ff621cf7c313a394093 Reviewed-by: Jan-Arve Sæther (cherry picked from commit d5649547d641b9c5af3c3f814caf8e1ab5bf9f47) --- src/widgets/widgets/qwidgettextcontrol.cpp | 20 +++++++++++++++++--- .../auto/other/qaccessibility/tst_qaccessibility.cpp | 17 ++++++++++++++++- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index d602d6daa5..91864b6608 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -79,6 +79,7 @@ #include #include #include +#include #ifndef QT_NO_SHORTCUT #include "private/qapplication_p.h" @@ -577,8 +578,15 @@ void QWidgetTextControlPrivate::repaintOldAndNewSelection(const QTextCursor &old void QWidgetTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged /*=false*/) { Q_Q(QWidgetTextControl); - if (forceEmitSelectionChanged) + if (forceEmitSelectionChanged) { emit q->selectionChanged(); +#ifndef QT_NO_ACCESSIBILITY + if (q->parent()) { + QAccessibleTextSelectionEvent ev(q->parent(), cursor.anchor(), cursor.position()); + QAccessible::updateAccessibility(&ev); + } +#endif + } if (cursor.position() == lastSelectionPosition && cursor.anchor() == lastSelectionAnchor) @@ -593,9 +601,15 @@ void QWidgetTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged && (selectionStateChange || (cursor.hasSelection() && (cursor.position() != lastSelectionPosition - || cursor.anchor() != lastSelectionAnchor)))) + || cursor.anchor() != lastSelectionAnchor)))) { emit q->selectionChanged(); - +#ifndef QT_NO_ACCESSIBILITY + if (q->parent()) { + QAccessibleTextSelectionEvent ev(q->parent(), cursor.anchor(), cursor.position()); + QAccessible::updateAccessibility(&ev); + } +#endif + } emit q->microFocusChanged(); lastSelectionPosition = cursor.position(); lastSelectionAnchor = cursor.anchor(); diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index fa8d45c203..8384c9a295 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -1590,6 +1590,22 @@ void tst_QAccessibility::textEditTest() iface->editableTextInterface()->cutText(12, 16); QCOMPARE(QApplication::clipboard()->text(), QLatin1String("how ")); QCOMPARE(iface->textInterface()->text(12, 15), QLatin1String("are")); + + QTestAccessibility::clearEvents(); + + // select text + QTextCursor c = edit.textCursor(); + c.setPosition(2); + c.setPosition(4, QTextCursor::KeepAnchor); + edit.setTextCursor(c); + QAccessibleTextSelectionEvent sel(&edit, 2, 4); + QVERIFY_EVENT(&sel); + + edit.selectAll(); + int end = edit.textCursor().position(); + sel.setCursorPosition(end); + sel.setSelection(0, end); + QVERIFY_EVENT(&sel); } QTestAccessibility::clearEvents(); } @@ -1923,7 +1939,6 @@ void tst_QAccessibility::lineEditTest() QVERIFY_EVENT(&cursor); lineEdit->setText("foo"); - qDebug() << QTestAccessibility::events(); cursorEvent.setCursorPosition(3); QVERIFY_EVENT(&cursorEvent); -- cgit v1.2.3 From aabd54b8bbac44ddaf05ca42cc8cdf5d31f3972b Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 13 Apr 2012 12:55:56 +0200 Subject: qdoc: Fixed bugs causing invalid DITA XML Fixed a bug in qdoc that caused too many end elements to be generated. Also fixed some doc errors that caused invalid DITA to be generated. Task nr: QTBUG-25302 Change-Id: Ifbbf457d28c51c2691a252888447739da7713bc9 Reviewed-by: Martin Smith Reviewed-by: Casper van Donderen --- src/corelib/tools/qregularexpression.cpp | 2 +- src/tools/qdoc/ditaxmlgenerator.cpp | 330 +++++++++++++++++-------------- src/tools/qdoc/ditaxmlgenerator.h | 1 + src/tools/qdoc/doc/qdoc-manual.qdoc | 7 + src/tools/qdoc/node.cpp | 2 +- 5 files changed, 187 insertions(+), 155 deletions(-) diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp index a65ac0cd2b..393b2bbb7d 100644 --- a/src/corelib/tools/qregularexpression.cpp +++ b/src/corelib/tools/qregularexpression.cpp @@ -288,7 +288,7 @@ QT_BEGIN_NAMESPACE Partial matching is mainly useful in two scenarios: validating user input in real time and incremental/multi-segment matching. - \target + \target validating user input \section2 Validating user input Suppose that we would like the user to input a date in a specific diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index 10641b0fab..1f986e35ff 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -249,6 +249,14 @@ QString DitaXmlGenerator::ditaTags[] = "" }; +void DitaXmlGenerator::debugPara(const QString& t) +{ + writeStartTag(DT_p); + xmlWriter().writeAttribute("outputclass",t); + xmlWriter().writeCharacters(t); + writeEndTag(); //

+} + static bool showBrokenLinks = false; /*! @@ -693,6 +701,13 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, static bool in_para = false; QString guid, hc, attr; +#if 0 + // Leave this here for debugging. + if (outFileName() == "modules.dita") { + QString comment = "ATOM:" + atom->typeString(); + xmlWriter().writeComment(comment); + } +#endif switch (atom->type()) { case Atom::AbstractLeft: break; @@ -721,6 +736,7 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, { Node::Type t = relative->type(); if (inSection()) { + in_para = true; writeStartTag(DT_p); xmlWriter().writeAttribute("outputclass","brief"); } @@ -756,6 +772,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, case Atom::BriefRight: // if (relative->type() != Node::Fake) writeEndTag(); // or

+ if (in_para) + in_para = false; noLinks = false; break; case Atom::C: @@ -769,13 +787,13 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, writeEndTag(); // see writeStartElement() above break; case Atom::Code: - { - writeStartTag(DT_codeblock); - xmlWriter().writeAttribute("outputclass","cpp"); - QString chars = trimmedTrailing(atom->string()); - writeText(chars, marker, relative); - writeEndTag(); // - } + { + writeStartTag(DT_codeblock); + xmlWriter().writeAttribute("outputclass","cpp"); + QString chars = trimmedTrailing(atom->string()); + writeText(chars, marker, relative); + writeEndTag(); // + } break; case Atom::Qml: writeStartTag(DT_codeblock); @@ -866,71 +884,71 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, case Atom::FormatIf: break; case Atom::FormattingLeft: - { - DitaTag t = DT_LAST; - if (atom->string() == ATOM_FORMATTING_BOLD) - t = DT_b; - else if (atom->string() == ATOM_FORMATTING_PARAMETER) - t = DT_i; - else if (atom->string() == ATOM_FORMATTING_ITALIC) - t = DT_i; - else if (atom->string() == ATOM_FORMATTING_TELETYPE) - t = DT_tt; - else if (atom->string().startsWith("span ")) { - t = DT_keyword; - } - else if (atom->string() == ATOM_FORMATTING_UICONTROL) - t = DT_uicontrol; - else if (atom->string() == ATOM_FORMATTING_UNDERLINE) - t = DT_u; - else if (atom->string() == ATOM_FORMATTING_INDEX) - t = DT_comment; - else if (atom->string() == ATOM_FORMATTING_SUBSCRIPT) - t = DT_sub; - else if (atom->string() == ATOM_FORMATTING_SUPERSCRIPT) - t = DT_sup; - else - qDebug() << "DT_LAST"; - writeStartTag(t); - if (atom->string() == ATOM_FORMATTING_PARAMETER) { - if (atom->next() != 0 && atom->next()->type() == Atom::String) { - QRegExp subscriptRegExp("([a-z]+)_([0-9n])"); - if (subscriptRegExp.exactMatch(atom->next()->string())) { - xmlWriter().writeCharacters(subscriptRegExp.cap(1)); - writeStartTag(DT_sub); - xmlWriter().writeCharacters(subscriptRegExp.cap(2)); - writeEndTag(); // - skipAhead = 1; + { + DitaTag t = DT_LAST; + if (atom->string() == ATOM_FORMATTING_BOLD) + t = DT_b; + else if (atom->string() == ATOM_FORMATTING_PARAMETER) + t = DT_i; + else if (atom->string() == ATOM_FORMATTING_ITALIC) + t = DT_i; + else if (atom->string() == ATOM_FORMATTING_TELETYPE) + t = DT_tt; + else if (atom->string().startsWith("span ")) { + t = DT_keyword; + } + else if (atom->string() == ATOM_FORMATTING_UICONTROL) + t = DT_uicontrol; + else if (atom->string() == ATOM_FORMATTING_UNDERLINE) + t = DT_u; + else if (atom->string() == ATOM_FORMATTING_INDEX) + t = DT_comment; + else if (atom->string() == ATOM_FORMATTING_SUBSCRIPT) + t = DT_sub; + else if (atom->string() == ATOM_FORMATTING_SUPERSCRIPT) + t = DT_sup; + else + qDebug() << "DT_LAST"; + writeStartTag(t); + if (atom->string() == ATOM_FORMATTING_PARAMETER) { + if (atom->next() != 0 && atom->next()->type() == Atom::String) { + QRegExp subscriptRegExp("([a-z]+)_([0-9n])"); + if (subscriptRegExp.exactMatch(atom->next()->string())) { + xmlWriter().writeCharacters(subscriptRegExp.cap(1)); + writeStartTag(DT_sub); + xmlWriter().writeCharacters(subscriptRegExp.cap(2)); + writeEndTag(); // + skipAhead = 1; + } } } - } - else if (t == DT_keyword) { - QString attr = atom->string().mid(5); - if (!attr.isEmpty()) { - if (attr.contains('=')) { - int index = 0; - int from = 0; - QString values; - while (index >= 0) { - index = attr.indexOf('"',from); - if (index >= 0) { - ++index; - from = index; + else if (t == DT_keyword) { + QString attr = atom->string().mid(5); + if (!attr.isEmpty()) { + if (attr.contains('=')) { + int index = 0; + int from = 0; + QString values; + while (index >= 0) { index = attr.indexOf('"',from); - if (index > from) { - if (!values.isEmpty()) - values.append(' '); - values += attr.mid(from,index-from); - from = index+1; + if (index >= 0) { + ++index; + from = index; + index = attr.indexOf('"',from); + if (index > from) { + if (!values.isEmpty()) + values.append(' '); + values += attr.mid(from,index-from); + from = index+1; + } } } + attr = values; } - attr = values; } + xmlWriter().writeAttribute("outputclass", attr); } - xmlWriter().writeAttribute("outputclass", attr); } - } break; case Atom::FormattingRight: if (atom->string() == ATOM_FORMATTING_LINK) { @@ -941,17 +959,17 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, } break; case Atom::AnnotatedList: - { - QList values = tree_->groups().values(atom->string()); - NodeMap nodeMap; - for (int i = 0; i < values.size(); ++i) { - const Node* n = values.at(i); - if ((n->status() != Node::Internal) && (n->access() != Node::Private)) { - nodeMap.insert(n->nameForLists(),n); + { + QList values = tree_->groups().values(atom->string()); + NodeMap nodeMap; + for (int i = 0; i < values.size(); ++i) { + const Node* n = values.at(i); + if ((n->status() != Node::Internal) && (n->access() != Node::Private)) { + nodeMap.insert(n->nameForLists(),n); + } } + generateAnnotatedList(relative, marker, nodeMap); } - generateAnnotatedList(relative, marker, nodeMap); - } break; case Atom::GeneratedList: if (atom->string() == "annotatedclasses") { @@ -1270,34 +1288,34 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, //xmlWriter().writeEmptyElement("br"); break; case Atom::Link: - { - const Node *node = 0; - QString myLink = getLink(atom, relative, marker, &node); - if (myLink.isEmpty()) { - myLink = getCollisionLink(atom); - } - if (myLink.isEmpty()) { - relative->doc().location().warning(tr("Can't link to '%1'") - .arg(atom->string())); - } - else if (!inSectionHeading) { - beginLink(myLink); + { + const Node *node = 0; + QString myLink = getLink(atom, relative, marker, &node); + if (myLink.isEmpty()) { + myLink = getCollisionLink(atom); + } + if (myLink.isEmpty()) { + relative->doc().location().warning(tr("Can't link to '%1'") + .arg(atom->string())); + } + else if (!inSectionHeading) { + beginLink(myLink); + } + skipAhead = 1; } - skipAhead = 1; - } break; case Atom::GuidLink: - { - beginLink(atom->string()); - skipAhead = 1; - } + { + beginLink(atom->string()); + skipAhead = 1; + } break; case Atom::LinkNode: - { - const Node* node = CodeMarker::nodeForString(atom->string()); - beginLink(linkForNode(node, relative)); - skipAhead = 1; - } + { + const Node* node = CodeMarker::nodeForString(atom->string()); + beginLink(linkForNode(node, relative)); + skipAhead = 1; + } break; case Atom::ListLeft: if (in_para) { @@ -1353,8 +1371,13 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, else // (atom->string() == ATOM_LIST_NUMERIC) xmlWriter().writeAttribute("outputclass","numeric"); if (atom->next() != 0 && atom->next()->string().toInt() != 1) { - // I don't think this attribute is supported. - xmlWriter().writeAttribute("start",atom->next()->string()); + /* + This attribute is not supported in DITA, and at the + moment, including it is causing a validation error + wherever it is used. I think it is onlym used in the + qdoc manual. + */ + //xmlWriter().writeAttribute("start",atom->next()->string()); } } break; @@ -1629,47 +1652,48 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, writeEndTag(); // break; case Atom::TableItemLeft: - { - QString values; - writeStartTag(DT_entry); - for (int i=0; icount(); ++i) { - attr = atom->string(i); - if (attr.contains('=')) { - int index = 0; - int from = 0; - while (index >= 0) { - index = attr.indexOf('"',from); - if (index >= 0) { - ++index; - from = index; + { + QString values; + writeStartTag(DT_entry); + for (int i=0; icount(); ++i) { + attr = atom->string(i); + if (attr.contains('=')) { + int index = 0; + int from = 0; + while (index >= 0) { index = attr.indexOf('"',from); - if (index > from) { - if (!values.isEmpty()) - values.append(' '); - values += attr.mid(from,index-from); - from = index+1; + if (index >= 0) { + ++index; + from = index; + index = attr.indexOf('"',from); + if (index > from) { + if (!values.isEmpty()) + values.append(' '); + values += attr.mid(from,index-from); + from = index+1; + } } } } - } - else { - QStringList spans = attr.split(QLatin1Char(',')); - if (spans.size() == 2) { - if ((spans[0].toInt()>1) || (spans[1].toInt()>1)) { - values += "span(" + spans[0] + QLatin1Char(',') + spans[1] + QLatin1Char(')'); + else { + QStringList spans = attr.split(QLatin1Char(',')); + if (spans.size() == 2) { + if ((spans[0].toInt()>1) || (spans[1].toInt()>1)) { + values += "span(" + spans[0] + QLatin1Char(',') + spans[1] + QLatin1Char(')'); + } } } } + if (!values.isEmpty()) + xmlWriter().writeAttribute("outputclass",values); + if (matchAhead(atom, Atom::ParaLeft)) + skipAhead = 1; } - if (!values.isEmpty()) - xmlWriter().writeAttribute("outputclass",values); - if (matchAhead(atom, Atom::ParaLeft)) - skipAhead = 1; - } break; case Atom::TableItemRight: - if (inTableHeader) + if (inTableHeader) { writeEndTag(); // + } else { writeEndTag(); // } @@ -1677,33 +1701,33 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, skipAhead = 1; break; case Atom::TableOfContents: - { - int numColumns = 1; - const Node* node = relative; + { + int numColumns = 1; + const Node* node = relative; - Doc::Sections sectionUnit = Doc::Section4; - QStringList params = atom->string().split(QLatin1Char(',')); - QString columnText = params.at(0); - QStringList pieces = columnText.split(QLatin1Char(' '), QString::SkipEmptyParts); - if (pieces.size() >= 2) { - columnText = pieces.at(0); - pieces.pop_front(); - QString path = pieces.join(" ").trimmed(); - node = findNodeForTarget(path, relative, marker, atom); - } + Doc::Sections sectionUnit = Doc::Section4; + QStringList params = atom->string().split(QLatin1Char(',')); + QString columnText = params.at(0); + QStringList pieces = columnText.split(QLatin1Char(' '), QString::SkipEmptyParts); + if (pieces.size() >= 2) { + columnText = pieces.at(0); + pieces.pop_front(); + QString path = pieces.join(" ").trimmed(); + node = findNodeForTarget(path, relative, marker, atom); + } - if (params.size() == 2) { - numColumns = qMax(columnText.toInt(), numColumns); - sectionUnit = (Doc::Sections)params.at(1).toInt(); - } + if (params.size() == 2) { + numColumns = qMax(columnText.toInt(), numColumns); + sectionUnit = (Doc::Sections)params.at(1).toInt(); + } - if (node) - generateTableOfContents(node, - marker, - sectionUnit, - numColumns, - relative); - } + if (node) + generateTableOfContents(node, + marker, + sectionUnit, + numColumns, + relative); + } break; case Atom::Target: if (in_para) { @@ -2278,7 +2302,7 @@ void DitaXmlGenerator::generateFakeNode(FakeNode* fake, CodeMarker* marker) writeProlog(fake); writeStartTag(DT_body); - enterSection(QString(),QString()); + enterSection("",""); if (fake->subType() == Node::Module) { generateStatus(fake, marker); if (moduleNamespaceMap.contains(fake->name())) { @@ -6412,7 +6436,7 @@ void DitaXmlGenerator::generateCollisionPages() generateHeader(ncn, ditaTitle); writeProlog(ncn); writeStartTag(DT_body); - enterSection(QString(),QString()); + enterSection("",""); NodeMap nm; for (int i=0; iisWritable(); } else { - location().warning(tr("Can't detect if QML property %1 isread-only; writable assumed.").arg(name())); + location().warning(tr("Can't detect if QML property %1 is read-only; writable assumed.").arg(name())); return true; } } -- cgit v1.2.3 From 48e092574a2d12b0fbc1992aa3aa9be3ca2669b9 Mon Sep 17 00:00:00 2001 From: Casper van Donderen Date: Fri, 13 Apr 2012 12:04:55 +0200 Subject: QDoc: add missing newline characters in qdoc -help. Change-Id: Ibd50091693be393c6b479d6ca8927ba1ed578709 Reviewed-by: Martin Smith --- src/tools/qdoc/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp index de268e1177..f7985bd389 100644 --- a/src/tools/qdoc/main.cpp +++ b/src/tools/qdoc/main.cpp @@ -115,13 +115,13 @@ static void printHelp() " -highlighting " "Turn on syntax highlighting (makes qdoc run slower)\n" " -no-examples " - "Do not generate documentation for examples" + "Do not generate documentation for examples\n" " -obsoletelinks " "Report links from obsolete items to non-obsolete items\n" " -outputdir " "Specify output directory, overrides setting in qdocconf file\n" " -outputformat " - "Specify output format, overrides setting in qdocconf file" + "Specify output format, overrides setting in qdocconf file\n" " -showinternal " "Include content marked internal\n" " -version " -- cgit v1.2.3 From 033eff02fe505ec9ccc74563e69ff67fb6e2cb1b Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 13 Apr 2012 09:14:59 -0700 Subject: doc: QWindowSurface is dead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It goes by the name of QBackingStore these days. Change-Id: Id46254e47ee0abf9e669862eec6c2205d9634368 Reviewed-by: Holger Freyther Reviewed-by: Samuel Rødal --- src/gui/image/qpixmap_raster.cpp | 2 +- src/gui/kernel/qplatformwindow_qpa.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp index 7c7c4652e3..27f472d842 100644 --- a/src/gui/image/qpixmap_raster.cpp +++ b/src/gui/image/qpixmap_raster.cpp @@ -151,7 +151,7 @@ void QRasterPlatformPixmap::fromImageReader(QImageReader *imageReader, createPixmapForImage(image, flags, /* inplace = */true); } -// from qwindowsurface.cpp +// from qbackingstore.cpp extern void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset); void QRasterPlatformPixmap::copy(const QPlatformPixmap *data, const QRect &rect) diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp index 973c641ad1..d5f0277ccd 100644 --- a/src/gui/kernel/qplatformwindow_qpa.cpp +++ b/src/gui/kernel/qplatformwindow_qpa.cpp @@ -327,7 +327,7 @@ bool QPlatformWindow::setMouseGrabEnabled(bool grab) However, it is not concerned with how Qt renders into the window it represents. Visible QWindows will always have a QPlatformWindow. However, it is not necessary for - all windows to have a QWindowSurface. This is the case for QOpenGLWidget. And could be the case for + all windows to have a QBackingStore. This is the case for QOpenGLWidget. And could be the case for windows where some 3.party renders into it. The platform specific window handle can be retrieved by the winId function. @@ -338,7 +338,7 @@ bool QPlatformWindow::setMouseGrabEnabled(bool grab) The only way to retrieve a QPlatformOpenGLContext in QPA is by calling the glContext() function on QPlatformWindow. - \sa QWindowSurface, QWindow + \sa QBackingStore, QWindow */ QT_END_NAMESPACE -- cgit v1.2.3 From 70cb9598af116360702eb71868957400f67d8003 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Sat, 14 Apr 2012 14:19:45 -0700 Subject: Fix tst_QMdiSubWindow::emittingOfSignals CI failures The test fails consistently on the CI (but never fails on any of the developer machines). This is possibly a timing issue. Change-Id: Ie40d9c38c3128a93898b0e50bfde5a754bd2b7fb Reviewed-by: Giuseppe D'Angelo Reviewed-by: Robin Burchell --- tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp index 53e0a5494a..eb433786f2 100644 --- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp +++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp @@ -98,10 +98,9 @@ static inline void triggerSignal(QMdiSubWindow *window, QMdiArea *workspace, window->showMaximized(); qApp->processEvents(); window->showNormal(); - qApp->processEvents(); - QVERIFY(!window->isMinimized()); - QVERIFY(!window->isMaximized()); - QVERIFY(!window->isShaded()); + QTRY_VERIFY(!window->isMinimized()); + QTRY_VERIFY(!window->isMaximized()); + QTRY_VERIFY(!window->isShaded()); } else if (signal == SIGNAL(aboutToActivate())) { if (window->parent()) { workspace->setActiveSubWindow(window); -- cgit v1.2.3 From 763de6965cb967ad2432420e05788b2df16e9367 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 13 Apr 2012 16:28:26 -0700 Subject: Fix header inclusion guard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Icc537d5b52315b9563078da9fa69ddd67b567f76 Reviewed-by: Samuel Rødal --- src/gui/kernel/qguiapplication_p.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index ca8f90ab79..c0cee51832 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QGUIAPPLICATION_QPA_P_H -#define QGUIAPPLICATION_QPA_P_H +#ifndef QGUIAPPLICATION_P_H +#define QGUIAPPLICATION_P_H #include @@ -233,4 +233,4 @@ QT_END_NAMESPACE QT_END_HEADER -#endif // QGUIAPPLICATION_QPA_P_H +#endif // QGUIAPPLICATION_P_H -- cgit v1.2.3 From a9a1bf3359cf25482eba300097cad7b81a237b04 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 13 Apr 2012 17:02:37 -0700 Subject: Fold qpaintdevice_qpa.cpp into qpaintdevice.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I274508826b9be4eb00f67fccae5a18ecbdf41a36 Reviewed-by: Samuel Rødal --- src/gui/painting/painting.pri | 1 - src/gui/painting/qpaintdevice.cpp | 16 +++++++++ src/gui/painting/qpaintdevice_qpa.cpp | 65 ----------------------------------- 3 files changed, 16 insertions(+), 66 deletions(-) delete mode 100644 src/gui/painting/qpaintdevice_qpa.cpp diff --git a/src/gui/painting/painting.pri b/src/gui/painting/painting.pri index 977aea26e3..a79c247e16 100644 --- a/src/gui/painting/painting.pri +++ b/src/gui/painting/painting.pri @@ -53,7 +53,6 @@ SOURCES += \ painting/qoutlinemapper.cpp \ painting/qpagedpaintdevice.cpp \ painting/qpaintdevice.cpp \ - painting/qpaintdevice_qpa.cpp \ painting/qpaintengine.cpp \ painting/qpaintengineex.cpp \ painting/qpainter.cpp \ diff --git a/src/gui/painting/qpaintdevice.cpp b/src/gui/painting/qpaintdevice.cpp index d1dfa7001f..afbd86601d 100644 --- a/src/gui/painting/qpaintdevice.cpp +++ b/src/gui/painting/qpaintdevice.cpp @@ -76,4 +76,20 @@ Q_GUI_EXPORT int qt_paint_device_metric(const QPaintDevice *device, QPaintDevice return device->metric(metric); } +int QPaintDevice::metric(PaintDeviceMetric m) const +{ + qWarning("QPaintDevice::metrics: Device has no metric information"); + if (m == PdmDpiX) { + return 72; + } else if (m == PdmDpiY) { + return 72; + } else if (m == PdmNumColors) { + // FIXME: does this need to be a real value? + return 256; + } else { + qDebug("Unrecognised metric %d!",m); + return 0; + } +} + QT_END_NAMESPACE diff --git a/src/gui/painting/qpaintdevice_qpa.cpp b/src/gui/painting/qpaintdevice_qpa.cpp deleted file mode 100644 index e469a5f10f..0000000000 --- a/src/gui/painting/qpaintdevice_qpa.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** 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, Nokia gives you certain additional -** rights. These rights are described in the Nokia 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. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qpaintdevice.h" -#include "qpainter.h" -#include "qbitmap.h" -#include "qguiapplication.h" - -QT_BEGIN_NAMESPACE - -int QPaintDevice::metric(PaintDeviceMetric m) const -{ - qWarning("QPaintDevice::metrics: Device has no metric information"); - if (m == PdmDpiX) { - return 72; - } else if (m == PdmDpiY) { - return 72; - } else if (m == PdmNumColors) { - // FIXME: does this need to be a real value? - return 256; - } else { - qDebug("Unrecognised metric %d!",m); - return 0; - } -} - -QT_END_NAMESPACE -- cgit v1.2.3 From d357b74493c737a51f6a81dcaf30b4433ce22af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 13 Apr 2012 20:31:41 +0200 Subject: Fixed broken logic in evdev input plugins. If we do multiple reads we need to accumulate the total amount of bytes read, instead of just taking the last read amount into account. Change-Id: Iaa9b90c269f3ed9d09dae67452ca816d9db6217f Reviewed-by: Johannes Zellner Reviewed-by: Girish Ramakrishnan --- .../evdevkeyboard/qevdevkeyboardhandler.cpp | 18 +++++++----- .../generic/evdevmouse/qevdevmousehandler.cpp | 18 +++++++----- src/plugins/generic/evdevtouch/qevdevtouch.cpp | 34 ++++++++++++---------- 3 files changed, 41 insertions(+), 29 deletions(-) diff --git a/src/plugins/generic/evdevkeyboard/qevdevkeyboardhandler.cpp b/src/plugins/generic/evdevkeyboard/qevdevkeyboardhandler.cpp index 73aa6419d3..eb29b853e7 100644 --- a/src/plugins/generic/evdevkeyboard/qevdevkeyboardhandler.cpp +++ b/src/plugins/generic/evdevkeyboard/qevdevkeyboardhandler.cpp @@ -168,16 +168,20 @@ void QEvdevKeyboardHandler::readKeycode() int n = 0; forever { - n = qt_safe_read(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); + int result = qt_safe_read(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); - if (n == 0) { + if (result == 0) { qWarning("Got EOF from the input device."); return; - } else if (n < 0 && (errno != EINTR && errno != EAGAIN)) { - qWarning("Could not read from input device: %s", strerror(errno)); - return; - } else if (n % sizeof(buffer[0]) == 0) { - break; + } else if (result < 0) { + if (errno != EINTR && errno != EAGAIN) { + qWarning("Could not read from input device: %s", strerror(errno)); + return; + } + } else { + n += result; + if (n % sizeof(buffer[0]) == 0) + break; } } diff --git a/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp b/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp index 7c05e9ff11..5e2911a806 100644 --- a/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp +++ b/src/plugins/generic/evdevmouse/qevdevmousehandler.cpp @@ -145,16 +145,20 @@ void QEvdevMouseHandler::readMouseData() bool pendingMouseEvent = false; int eventCompressCount = 0; forever { - n = QT_READ(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); + int result = QT_READ(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); - if (n == 0) { + if (result == 0) { qWarning("Got EOF from the input device."); return; - } else if (n < 0 && (errno != EINTR && errno != EAGAIN)) { - qWarning("Could not read from input device: %s", strerror(errno)); - return; - } else if (n % sizeof(buffer[0]) == 0) { - break; + } else if (result < 0) { + if (errno != EINTR && errno != EAGAIN) { + qWarning("Could not read from input device: %s", strerror(errno)); + return; + } + } else { + n += result; + if (n % sizeof(buffer[0]) == 0) + break; } } diff --git a/src/plugins/generic/evdevtouch/qevdevtouch.cpp b/src/plugins/generic/evdevtouch/qevdevtouch.cpp index c9c49839d6..1c3e8952e9 100644 --- a/src/plugins/generic/evdevtouch/qevdevtouch.cpp +++ b/src/plugins/generic/evdevtouch/qevdevtouch.cpp @@ -253,26 +253,30 @@ void QTouchScreenHandler::readData() int n = 0; for (; ;) { #ifdef USE_MTDEV - n = mtdev_get(m_mtdev, m_fd, buffer, sizeof(buffer) / sizeof(::input_event)); - if (n > 0) - n *= sizeof(::input_event); + int result = mtdev_get(m_mtdev, m_fd, buffer, sizeof(buffer) / sizeof(::input_event)); + if (result > 0) + result *= sizeof(::input_event); #else - n = QT_READ(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); + int result = QT_READ(m_fd, reinterpret_cast(buffer) + n, sizeof(buffer) - n); #endif - if (!n) { + if (!result) { qWarning("Got EOF from input device"); return; - } else if (n < 0 && (errno != EINTR && errno != EAGAIN)) { - qWarning("Could not read from input device: %s", strerror(errno)); - if (errno == ENODEV) { // device got disconnected -> stop reading - delete m_notify; - m_notify = 0; - QT_CLOSE(m_fd); - m_fd = -1; + } else if (result < 0) { + if (errno != EINTR && errno != EAGAIN) { + qWarning("Could not read from input device: %s", strerror(errno)); + if (errno == ENODEV) { // device got disconnected -> stop reading + delete m_notify; + m_notify = 0; + QT_CLOSE(m_fd); + m_fd = -1; + } + return; } - return; - } else if (n % sizeof(::input_event) == 0) { - break; + } else { + n += result; + if (n % sizeof(::input_event) == 0) + break; } } -- cgit v1.2.3 From 73b24486edd6b64165821bfb587cec9c9b078796 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 10 Apr 2012 23:39:40 +0300 Subject: UCD-5.0: apply Corrigendum #6 http://unicode.org/versions/corrigendum6.html: > in Unicode 5.0, the list of characters with the Bidi_Mirrored property > was made consistent for brackets and quotation marks, in preparation for > new constraints on bidi mirroring. However, after publication of > Unicode 5.0.0 it was discovered that this change adversely affected > several quotation mark characters in deployed data. Task-number: QTBUG-25169 Change-Id: Id49caf401af2d5a1e6dbcc32b2f350aa20b7f901 Reviewed-by: Lars Knoll --- src/corelib/tools/qunicodetables.cpp | 1577 +++++++++++++------------- tests/auto/corelib/tools/qchar/tst_qchar.cpp | 21 + util/unicode/data/BidiMirroring.txt | 17 +- util/unicode/data/UnicodeData.txt | 22 +- 4 files changed, 824 insertions(+), 813 deletions(-) diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/tools/qunicodetables.cpp index 507186dd24..9504e7168e 100644 --- a/src/corelib/tools/qunicodetables.cpp +++ b/src/corelib/tools/qunicodetables.cpp @@ -1788,31 +1788,31 @@ static const unsigned short uc_property_trie[] = { 585, 585, 585, 585, 585, 585, 585, 586, 585, 585, 585, 587, 588, 589, 590, 591, 592, 593, 592, 592, 594, 595, 14, 14, - 596, 597, 598, 599, 596, 600, 598, 599, + 596, 597, 598, 596, 596, 599, 598, 596, - 14, 14, 14, 14, 601, 601, 601, 602, - 603, 604, 605, 606, 607, 608, 609, 610, - 13, 13, 13, 13, 13, 611, 611, 611, - 14, 596, 600, 14, 612, 612, 14, 43, + 14, 14, 14, 14, 600, 600, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, + 13, 13, 13, 13, 13, 610, 610, 610, + 14, 611, 612, 14, 613, 613, 14, 43, - 43, 14, 14, 14, 613, 16, 17, 614, - 615, 615, 432, 432, 432, 432, 616, 616, - 616, 616, 185, 617, 618, 619, 620, 616, - 620, 620, 620, 620, 619, 620, 620, 621, + 43, 14, 14, 14, 614, 16, 17, 615, + 616, 616, 432, 432, 432, 432, 617, 617, + 617, 617, 185, 618, 619, 620, 621, 617, + 621, 621, 621, 621, 620, 621, 621, 622, - 622, 623, 623, 623, 160, 160, 160, 160, - 160, 160, 624, 624, 624, 624, 624, 624, - 625, 626, 160, 160, 627, 628, 629, 630, - 631, 632, 633, 633, 36, 16, 17, 50, + 623, 624, 624, 624, 160, 160, 160, 160, + 160, 160, 625, 625, 625, 625, 625, 625, + 626, 627, 160, 160, 628, 629, 630, 631, + 632, 633, 634, 634, 36, 16, 17, 50, - 625, 60, 55, 56, 627, 628, 629, 630, - 631, 632, 633, 633, 36, 16, 17, 160, + 626, 60, 55, 56, 628, 629, 630, 631, + 632, 633, 634, 634, 36, 16, 17, 160, 484, 484, 484, 484, 484, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 12, 12, 12, 12, 12, 12, 12, 48, - 12, 12, 12, 634, 635, 429, 429, 429, - 636, 636, 637, 637, 637, 637, 160, 160, + 12, 12, 12, 635, 636, 429, 429, 429, + 637, 637, 638, 638, 638, 638, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -1820,32 +1820,32 @@ static const unsigned short uc_property_trie[] = { 139, 139, 144, 144, 139, 139, 139, 139, 144, 144, 144, 139, 139, 273, 273, 273, - 273, 139, 195, 195, 638, 639, 639, 159, - 640, 159, 639, 641, 299, 299, 299, 299, + 273, 139, 195, 195, 639, 640, 640, 159, + 641, 159, 640, 642, 299, 299, 299, 299, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 49, 49, 175, 642, 49, 49, 49, 175, - 49, 642, 50, 175, 175, 175, 50, 50, - 175, 175, 175, 50, 49, 175, 643, 49, + 49, 49, 175, 643, 49, 49, 49, 175, + 49, 643, 50, 175, 175, 175, 50, 50, + 175, 175, 175, 50, 49, 175, 644, 49, 49, 175, 175, 175, 175, 175, 49, 49, - 49, 49, 49, 49, 175, 49, 644, 49, - 175, 49, 645, 646, 175, 175, 647, 50, - 175, 175, 648, 175, 50, 90, 90, 90, - 90, 131, 649, 239, 103, 626, 650, 650, + 49, 49, 49, 49, 175, 49, 645, 49, + 175, 49, 646, 647, 175, 175, 648, 50, + 175, 175, 649, 175, 50, 90, 90, 90, + 90, 131, 650, 239, 103, 627, 651, 651, - 185, 185, 185, 185, 185, 650, 626, 626, - 626, 626, 651, 185, 418, 301, 652, 160, + 185, 185, 185, 185, 185, 651, 627, 627, + 627, 627, 652, 185, 418, 301, 653, 160, 160, 160, 160, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 653, 653, 653, 653, 653, 653, 653, 653, - 653, 653, 653, 653, 653, 653, 653, 653, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, + 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, - 655, 655, 655, 99, 109, 160, 160, 160, + 656, 656, 656, 99, 109, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 36, 36, 36, 36, 36, 49, 49, 49, 49, 49, 36, 36, 49, 49, 49, 49, @@ -1861,52 +1861,52 @@ static const unsigned short uc_property_trie[] = { 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 649, 649, 649, 649, 649, - 649, 649, 649, 649, 185, 185, 185, 185, + 49, 49, 49, 650, 650, 650, 650, 650, + 650, 650, 650, 650, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 36, 36, 36, 36, 36, 36, 36, 36, - 656, 656, 656, 657, 657, 657, 36, 36, - 36, 36, 18, 54, 36, 658, 36, 36, + 657, 657, 657, 658, 658, 658, 36, 36, + 36, 36, 18, 54, 36, 659, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 659, 660, 36, 36, + 36, 36, 36, 36, 660, 661, 36, 36, - 36, 36, 36, 661, 36, 36, 36, 36, + 36, 36, 36, 662, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 659, 660, 659, 660, 36, 36, + 36, 36, 660, 661, 660, 661, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 659, 660, 659, 660, - 659, 660, 659, 660, 36, 36, 659, 660, - 659, 660, 659, 660, 659, 660, 659, 660, - 659, 660, 659, 660, 659, 660, 659, 660, + 36, 36, 36, 36, 660, 661, 660, 661, + 660, 661, 660, 661, 36, 36, 660, 661, + 660, 661, 660, 661, 660, 661, 660, 661, + 660, 661, 660, 661, 660, 661, 660, 661, - 659, 660, 659, 660, 659, 660, 659, 660, - 659, 660, 659, 660, 36, 36, 36, 659, - 660, 659, 660, 36, 36, 36, 36, 36, - 662, 36, 36, 36, 36, 36, 36, 36, + 660, 661, 660, 661, 660, 661, 660, 661, + 660, 661, 660, 661, 36, 36, 36, 660, + 661, 660, 661, 36, 36, 36, 36, 36, + 663, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 659, 660, 36, 36, 663, 36, - 664, 665, 36, 665, 36, 36, 36, 36, - 659, 660, 659, 660, 659, 660, 659, 660, + 36, 36, 660, 661, 36, 36, 664, 36, + 665, 666, 36, 666, 36, 36, 36, 36, + 660, 661, 660, 661, 660, 661, 660, 661, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 659, 660, 659, 660, 666, 36, 36, - 659, 660, 36, 36, 36, 36, 659, 660, - 659, 660, 659, 660, 659, 660, 659, 660, + 36, 660, 661, 660, 661, 667, 36, 36, + 660, 661, 36, 36, 36, 36, 660, 661, + 660, 661, 660, 661, 660, 661, 660, 661, - 659, 660, 659, 660, 659, 660, 659, 660, - 659, 660, 659, 660, 659, 660, 36, 36, - 659, 660, 667, 667, 667, 185, 668, 668, - 185, 185, 669, 669, 669, 670, 670, 185, + 660, 661, 660, 661, 660, 661, 660, 661, + 660, 661, 660, 661, 660, 661, 36, 36, + 660, 661, 668, 668, 668, 185, 669, 669, + 185, 185, 670, 670, 670, 671, 671, 185, - 49, 649, 49, 49, 49, 49, 49, 49, - 659, 660, 659, 660, 49, 49, 49, 49, + 49, 650, 49, 49, 49, 49, 49, 49, + 660, 661, 660, 661, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, @@ -1923,24 +1923,24 @@ static const unsigned short uc_property_trie[] = { 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 649, 185, 649, 649, 649, + 194, 194, 194, 650, 185, 650, 650, 650, - 649, 649, 649, 649, 649, 649, 649, 649, - 649, 649, 649, 649, 649, 649, 649, 649, - 649, 649, 649, 649, 649, 381, 649, 649, - 649, 649, 649, 185, 185, 185, 185, 185, + 650, 650, 650, 650, 650, 650, 650, 650, + 650, 650, 650, 650, 650, 650, 650, 650, + 650, 650, 650, 650, 650, 381, 650, 650, + 650, 650, 650, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 651, 651, 651, 651, - 651, 651, 651, 651, 651, 651, 651, 651, + 185, 185, 185, 185, 652, 652, 652, 652, + 652, 652, 652, 652, 652, 652, 652, 652, - 651, 651, 651, 651, 651, 651, 651, 651, - 651, 651, 651, 651, 651, 651, 651, 239, + 652, 652, 652, 652, 652, 652, 652, 652, + 652, 652, 652, 652, 652, 652, 652, 239, 239, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 418, 671, 671, 671, 671, + 418, 418, 418, 418, 672, 672, 672, 672, - 671, 671, 301, 301, 301, 301, 301, 301, + 672, 672, 301, 301, 301, 301, 301, 301, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -1950,7 +1950,7 @@ static const unsigned short uc_property_trie[] = { 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 649, 649, 160, + 49, 49, 49, 49, 49, 650, 650, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -1960,35 +1960,35 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 672, 673, 674, 675, 676, 677, 678, 679, - 680, 62, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 62, 672, 673, 674, 675, - 676, 677, 678, 679, 680, 62, 62, 62, + 673, 674, 675, 676, 677, 678, 679, 680, + 681, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 60, 55, 56, 627, 628, 629, 630, 631, - 632, 681, 681, 681, 681, 681, 681, 681, - 681, 681, 681, 681, 194, 194, 194, 194, + 60, 55, 56, 628, 629, 630, 631, 632, + 633, 682, 682, 682, 682, 682, 682, 682, + 682, 682, 682, 682, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, + 194, 194, 194, 194, 194, 194, 683, 683, + 683, 683, 683, 683, 683, 683, 683, 683, - 682, 682, 682, 682, 682, 682, 682, 682, - 682, 682, 682, 682, 682, 682, 682, 682, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, 683, + 684, 684, 684, 684, 684, 684, 684, 684, + 684, 684, 684, 684, 684, 684, 684, 684, - 683, 683, 683, 683, 683, 683, 683, 683, - 683, 683, 684, 685, 685, 685, 685, 685, - 685, 685, 685, 685, 685, 686, 687, 688, - 689, 690, 691, 692, 693, 694, 685, 695, + 684, 684, 684, 684, 684, 684, 684, 684, + 684, 684, 685, 686, 686, 686, 686, 686, + 686, 686, 686, 686, 686, 687, 688, 689, + 690, 691, 692, 693, 694, 695, 686, 696, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 651, 651, - 651, 651, 651, 651, 651, 651, 651, 651, + 49, 49, 49, 49, 49, 49, 652, 652, + 652, 652, 652, 652, 652, 652, 652, 652, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, @@ -2002,21 +2002,21 @@ static const unsigned short uc_property_trie[] = { 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 649, 649, 649, 649, 649, 649, 649, 649, + 650, 650, 650, 650, 650, 650, 650, 650, 185, 185, 185, 185, 185, 185, 185, 185, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 239, 239, 651, 651, - 418, 649, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 239, 239, 652, 652, + 418, 650, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 36, - 649, 649, 651, 651, 651, 651, 651, 651, - 651, 651, 651, 651, 651, 651, 418, 418, + 650, 650, 652, 652, 652, 652, 652, 652, + 652, 652, 652, 652, 652, 652, 418, 418, - 651, 651, 651, 651, 651, 651, 651, 651, - 651, 651, 239, 239, 239, 239, 239, 239, + 652, 652, 652, 652, 652, 652, 652, 652, + 652, 652, 239, 239, 239, 239, 239, 239, 239, 239, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 160, 160, 160, @@ -2038,16 +2038,16 @@ static const unsigned short uc_property_trie[] = { 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 160, 49, 160, 49, 49, 49, 49, 160, 160, 160, 49, 160, - 49, 49, 49, 696, 696, 696, 696, 160, + 49, 49, 49, 697, 697, 697, 697, 160, - 160, 49, 697, 697, 49, 49, 49, 49, - 698, 699, 698, 699, 698, 699, 698, 699, - 698, 699, 698, 699, 698, 699, 672, 673, - 674, 675, 676, 677, 678, 679, 680, 62, + 160, 49, 698, 698, 49, 49, 49, 49, + 699, 700, 699, 700, 699, 700, 699, 700, + 699, 700, 699, 700, 699, 700, 673, 674, + 675, 676, 677, 678, 679, 680, 681, 62, - 672, 673, 674, 675, 676, 677, 678, 679, - 680, 62, 672, 673, 674, 675, 676, 677, - 678, 679, 680, 62, 49, 160, 160, 160, + 673, 674, 675, 676, 677, 678, 679, 680, + 681, 62, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 62, 49, 160, 160, 160, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, @@ -2055,13 +2055,13 @@ static const unsigned short uc_property_trie[] = { 160, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 160, - 700, 700, 700, 701, 702, 703, 704, 671, - 671, 671, 671, 160, 160, 160, 160, 160, - 185, 185, 185, 185, 185, 705, 706, 185, - 185, 185, 185, 185, 185, 705, 706, 185, + 701, 701, 701, 702, 703, 704, 705, 672, + 672, 672, 672, 160, 160, 160, 160, 160, + 185, 185, 185, 185, 185, 706, 707, 185, + 185, 185, 185, 185, 185, 706, 707, 185, - 185, 185, 705, 706, 705, 706, 698, 699, - 698, 699, 698, 699, 160, 160, 160, 160, + 185, 185, 706, 707, 706, 707, 699, 700, + 699, 700, 699, 700, 160, 160, 160, 160, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, @@ -2075,55 +2075,55 @@ static const unsigned short uc_property_trie[] = { 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 698, 699, 698, 699, 698, - 699, 698, 699, 698, 699, 707, 708, 709, - 710, 698, 699, 698, 699, 698, 699, 698, - 699, 185, 185, 185, 185, 185, 185, 185, + 185, 185, 185, 699, 700, 699, 700, 699, + 700, 699, 700, 699, 700, 708, 709, 710, + 711, 699, 700, 699, 700, 699, 700, 699, + 700, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 711, 185, 185, 185, 185, 185, 185, 185, + 712, 185, 185, 185, 185, 185, 185, 185, - 705, 706, 185, 185, 705, 706, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 705, - 706, 705, 706, 185, 705, 706, 185, 185, - 698, 699, 698, 699, 185, 185, 185, 185, + 706, 707, 185, 185, 706, 707, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 706, + 707, 706, 707, 185, 706, 707, 185, 185, + 699, 700, 699, 700, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 712, 185, 185, - 705, 706, 185, 185, 698, 699, 185, 185, + 185, 185, 185, 185, 185, 713, 185, 185, + 706, 707, 185, 185, 699, 700, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 705, 706, 705, 706, 185, - 185, 185, 185, 185, 705, 706, 185, 185, - 185, 185, 185, 185, 705, 706, 185, 185, + 185, 185, 185, 706, 707, 706, 707, 185, + 185, 185, 185, 185, 706, 707, 185, 185, + 185, 185, 185, 185, 706, 707, 185, 185, - 185, 185, 185, 185, 705, 706, 185, 185, + 185, 185, 185, 185, 706, 707, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 705, 706, 185, 185, 705, 706, 705, + 185, 706, 707, 185, 185, 706, 707, 706, - 706, 705, 706, 705, 706, 185, 185, 185, - 185, 185, 185, 705, 706, 185, 185, 185, - 185, 705, 706, 705, 706, 705, 706, 705, - 706, 705, 706, 705, 706, 185, 185, 185, + 707, 706, 707, 706, 707, 185, 185, 185, + 185, 185, 185, 706, 707, 185, 185, 185, + 185, 706, 707, 706, 707, 706, 707, 706, + 707, 706, 707, 706, 707, 185, 185, 185, - 185, 705, 706, 185, 185, 185, 705, 706, - 705, 706, 705, 706, 705, 706, 185, 705, - 706, 185, 185, 705, 706, 185, 185, 185, - 185, 185, 185, 705, 706, 705, 706, 705, + 185, 706, 707, 185, 185, 185, 706, 707, + 706, 707, 706, 707, 706, 707, 185, 706, + 707, 185, 185, 706, 707, 185, 185, 185, + 185, 185, 185, 706, 707, 706, 707, 706, - 706, 705, 706, 705, 706, 705, 706, 185, - 185, 185, 185, 185, 185, 705, 706, 705, - 706, 705, 706, 705, 706, 705, 706, 185, - 185, 185, 185, 185, 185, 185, 713, 185, + 707, 706, 707, 706, 707, 706, 707, 185, + 185, 185, 185, 185, 185, 706, 707, 706, + 707, 706, 707, 706, 707, 706, 707, 185, + 185, 185, 185, 185, 185, 185, 714, 185, - 185, 185, 185, 714, 715, 714, 185, 185, - 185, 185, 185, 185, 705, 706, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 705, - 706, 705, 706, 185, 185, 185, 185, 185, + 185, 185, 185, 715, 716, 715, 185, 185, + 185, 185, 185, 185, 706, 707, 185, 185, + 185, 185, 185, 185, 185, 185, 185, 706, + 707, 706, 707, 185, 185, 185, 185, 185, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 418, 418, @@ -2135,24 +2135,24 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, - - 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 160, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, - 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, + 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 717, 160, + 718, 718, 718, 718, 718, 718, 718, 718, + 718, 718, 718, 718, 718, 718, 718, 718, + + 718, 718, 718, 718, 718, 718, 718, 718, + 718, 718, 718, 718, 718, 718, 718, 718, + 718, 718, 718, 718, 718, 718, 718, 718, + 718, 718, 718, 718, 718, 718, 718, 160, - 113, 109, 718, 719, 720, 721, 722, 113, + 113, 109, 719, 720, 721, 722, 723, 113, 109, 113, 109, 113, 109, 160, 160, 160, - 160, 160, 160, 160, 723, 113, 109, 723, + 160, 160, 160, 160, 724, 113, 109, 724, 160, 160, 160, 160, 160, 160, 160, 160, 105, 106, 105, 106, 105, 106, 105, 106, @@ -2163,14 +2163,14 @@ static const unsigned short uc_property_trie[] = { 105, 106, 105, 106, 103, 418, 418, 418, 418, 418, 418, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 620, 620, 620, 620, 724, 620, 620, + 160, 621, 621, 621, 621, 725, 621, 621, - 725, 725, 725, 725, 725, 725, 725, 725, - 725, 725, 725, 725, 725, 725, 725, 725, - 725, 725, 725, 725, 725, 725, 725, 725, - 725, 725, 725, 725, 725, 725, 725, 725, + 726, 726, 726, 726, 726, 726, 726, 726, + 726, 726, 726, 726, 726, 726, 726, 726, + 726, 726, 726, 726, 726, 726, 726, 726, + 726, 726, 726, 726, 726, 726, 726, 726, - 725, 725, 725, 725, 725, 725, 160, 160, + 726, 726, 726, 726, 726, 726, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, @@ -2195,227 +2195,227 @@ static const unsigned short uc_property_trie[] = { 323, 323, 323, 323, 323, 323, 323, 160, 323, 323, 323, 323, 323, 323, 323, 160, - 726, 726, 727, 728, 727, 728, 726, 726, - 726, 727, 728, 726, 727, 728, 620, 620, - 620, 620, 620, 620, 620, 620, 619, 729, - 160, 160, 160, 160, 727, 728, 160, 160, + 727, 727, 728, 729, 728, 729, 727, 727, + 727, 728, 729, 727, 728, 729, 621, 621, + 621, 621, 621, 621, 621, 621, 620, 730, + 160, 160, 160, 160, 728, 729, 160, 160, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 160, 730, 730, 730, 730, 730, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 160, 731, 731, 731, 731, 731, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 160, 160, 160, 160, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 160, 160, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 160, 160, 160, 160, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 160, 160, 160, 160, - 731, 732, 733, 734, 735, 736, 737, 738, + 732, 733, 734, 735, 736, 737, 738, 739, 16, 17, 16, 17, 16, 17, 16, 17, - 16, 17, 735, 735, 16, 17, 16, 17, - 16, 17, 16, 17, 739, 16, 17, 740, - - 735, 738, 738, 738, 738, 738, 738, 738, - 738, 738, 741, 742, 140, 743, 744, 744, - 745, 746, 746, 746, 746, 746, 735, 735, - 747, 747, 747, 748, 749, 750, 730, 735, - - 160, 751, 737, 751, 737, 751, 737, 751, - 737, 751, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - - 737, 737, 737, 751, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - - 737, 737, 737, 751, 737, 751, 737, 751, - 737, 737, 737, 737, 737, 737, 751, 737, - 737, 737, 737, 737, 737, 752, 752, 160, - 160, 753, 753, 754, 754, 755, 755, 756, - - 757, 758, 759, 758, 759, 758, 759, 758, - 759, 758, 759, 759, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, + 16, 17, 736, 736, 16, 17, 16, 17, + 16, 17, 16, 17, 740, 598, 741, 741, + + 736, 739, 739, 739, 739, 739, 739, 739, + 739, 739, 742, 743, 140, 744, 745, 745, + 746, 747, 747, 747, 747, 747, 736, 736, + 748, 748, 748, 749, 750, 751, 731, 736, + + 160, 752, 738, 752, 738, 752, 738, 752, + 738, 752, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, + + 738, 738, 738, 752, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, + + 738, 738, 738, 752, 738, 752, 738, 752, + 738, 738, 738, 738, 738, 738, 752, 738, + 738, 738, 738, 738, 738, 753, 753, 160, + 160, 754, 754, 755, 755, 756, 756, 757, + + 758, 759, 760, 759, 760, 759, 760, 759, + 760, 759, 760, 760, 760, 760, 760, 760, + 760, 760, 760, 760, 760, 760, 760, 760, + 760, 760, 760, 760, 760, 760, 760, 760, + + 760, 760, 760, 759, 760, 760, 760, 760, + 760, 760, 760, 760, 760, 760, 760, 760, + 760, 760, 760, 760, 760, 760, 760, 760, + 760, 760, 760, 760, 760, 760, 760, 760, + + 760, 760, 760, 759, 760, 759, 760, 759, + 760, 760, 760, 760, 760, 760, 759, 760, + 760, 760, 760, 760, 760, 759, 759, 760, + 760, 760, 760, 761, 762, 762, 762, 763, + + 160, 160, 160, 160, 160, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, - 759, 759, 759, 758, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, - 759, 759, 759, 759, 759, 759, 759, 759, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 160, 160, 160, + 160, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, - 759, 759, 759, 758, 759, 758, 759, 758, - 759, 759, 759, 759, 759, 759, 758, 759, - 759, 759, 759, 759, 759, 758, 758, 759, - 759, 759, 759, 760, 761, 761, 761, 762, - - 160, 160, 160, 160, 160, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 160, 160, 160, - 160, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 763, - - 763, 763, 763, 763, 763, 763, 763, 763, - 763, 763, 763, 763, 763, 763, 763, 160, - 764, 764, 765, 765, 765, 765, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, 764, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 160, 160, 160, 160, 160, 160, 160, 160, + 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 764, 764, 764, 764, 764, 160, + 765, 765, 766, 766, 766, 766, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 767, 160, 160, 160, 160, 160, 160, 160, 160, + + 768, 768, 768, 768, 768, 768, 768, 768, + 768, 768, 768, 768, 768, 768, 768, 768, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 768, 768, 768, 768, 768, 768, 768, 768, - 768, 768, 768, 768, 768, 768, 768, 768, + 769, 769, 769, 769, 769, 769, 769, 769, + 769, 769, 769, 769, 769, 769, 769, 769, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 769, 769, 160, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 770, 770, 160, + 766, 766, 766, 766, 766, 766, 766, 766, + 766, 766, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, 765, 765, 765, 765, 765, 765, 765, 765, - 765, 765, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 160, 160, 160, 160, + 765, 765, 765, 765, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 769, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, + 770, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 769, 769, 767, 764, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 770, 770, 768, 765, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 770, 770, 770, 770, 770, 770, 770, - 770, 770, 770, 770, 770, 770, 770, 770, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 771, 771, 771, 771, 771, 771, 771, + 771, 771, 771, 771, 771, 771, 771, 771, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 769, 769, 769, 769, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 770, 770, 770, 770, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 160, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 160, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 769, - 769, 769, 769, 764, 764, 764, 764, 764, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 770, + 770, 770, 770, 765, 765, 765, 765, 765, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 769, 769, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 770, 770, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 764, - 764, 764, 764, 764, 764, 764, 764, 769, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 765, + 765, 765, 765, 765, 765, 765, 765, 770, - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772, - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 160, 160, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, + 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 738, 738, - 737, 737, 737, 737, 737, 737, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 160, 160, 160, 160, + 738, 738, 738, 738, 738, 738, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 160, 160, 160, 160, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 773, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 774, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 767, 767, 767, - 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 160, 160, 160, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, + 767, 767, 767, 767, 767, 767, 767, 767, + 767, 767, 767, 767, 767, 160, 160, 160, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, - 730, 730, 774, 774, 730, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, - 730, 730, 730, 730, 774, 730, 730, 730, - 730, 730, 730, 730, 730, 730, 730, 730, + 731, 731, 775, 775, 731, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, + 731, 731, 731, 731, 775, 731, 731, 731, + 731, 731, 731, 731, 731, 731, 731, 731, - 730, 774, 730, 730, 730, 774, 730, 160, + 731, 775, 731, 731, 731, 775, 731, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 776, - 776, 776, 776, 160, 160, 160, 160, 160, + 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 777, + 777, 777, 777, 160, 160, 160, 160, 160, - 777, 777, 160, 160, 160, 160, 160, 160, + 778, 778, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 323, 323, 778, 323, 323, 323, 779, 323, - 323, 323, 323, 780, 323, 323, 323, 323, + 323, 323, 779, 323, 323, 323, 780, 323, + 323, 323, 323, 781, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, - 323, 323, 323, 464, 464, 780, 780, 464, + 323, 323, 323, 464, 464, 781, 781, 464, 418, 418, 418, 418, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -2427,91 +2427,91 @@ static const unsigned short uc_property_trie[] = { 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, 322, - 322, 322, 322, 322, 781, 781, 304, 304, + 322, 322, 322, 322, 782, 782, 304, 304, 160, 160, 160, 160, 160, 160, 160, 160, - 782, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 782, 783, 783, 783, + 783, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 783, 784, 784, 784, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 782, 783, 783, 783, 783, 783, 783, 783, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 783, 784, 784, 784, 784, 784, 784, 784, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 782, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 783, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 782, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 783, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 782, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 783, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, - 783, 783, 783, 783, 783, 783, 783, 783, - 782, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, + 784, 784, 784, 784, 784, 784, 784, 784, + 783, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, - 783, 783, 783, 783, 782, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, - 783, 783, 783, 783, 783, 783, 783, 783, + 784, 784, 784, 784, 783, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, + 784, 784, 784, 784, 784, 784, 784, 784, - 783, 783, 783, 783, 160, 160, 160, 160, + 784, 784, 784, 784, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 784, 784, 784, - 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, 785, - 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 160, 160, - 786, 786, 786, 786, 786, 786, 786, 786, - 786, 786, 786, 786, 786, 786, 786, 786, - 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, 786, - 786, 786, 786, 786, 786, 786, 786, 786, - 786, 786, 786, 160, 160, 160, 160, 160, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, + 738, 738, 738, 738, 738, 738, 738, 738, + 738, 738, 738, 738, 738, 738, 160, 160, + 787, 787, 787, 787, 787, 787, 787, 787, + 787, 787, 787, 787, 787, 787, 787, 787, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, + 787, 787, 787, 787, 787, 787, 787, 787, + 787, 787, 787, 787, 787, 787, 787, 787, + 787, 787, 787, 787, 787, 787, 787, 787, + 787, 787, 787, 787, 787, 787, 787, 787, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 772, 772, 772, 772, 772, 772, - 772, 772, 160, 160, 160, 160, 160, 160, + 787, 787, 787, 787, 787, 787, 787, 787, + 787, 787, 787, 160, 160, 160, 160, 160, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, - 787, 788, 789, 790, 791, 792, 792, 160, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 160, 160, 160, 160, 160, 160, + + 788, 789, 790, 791, 792, 793, 793, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 793, 794, 795, 796, 797, - 160, 160, 160, 160, 160, 798, 799, 231, + 160, 160, 160, 794, 795, 796, 797, 798, + 160, 160, 160, 160, 160, 799, 800, 231, 231, 231, 231, 231, 231, 231, 231, 231, - 231, 633, 231, 231, 231, 231, 231, 231, + 231, 634, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 205, 231, 231, 231, 231, 231, 205, 231, 205, @@ -2538,7 +2538,7 @@ static const unsigned short uc_property_trie[] = { 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 598, 740, + 243, 243, 243, 243, 243, 243, 598, 741, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, @@ -2552,63 +2552,63 @@ static const unsigned short uc_property_trie[] = { 243, 243, 243, 243, 243, 243, 243, 243, 235, 235, 235, 235, 235, 235, 235, 235, - 800, 800, 800, 800, 800, 800, 800, 800, - 800, 800, 800, 800, 800, 800, 800, 800, + 801, 801, 801, 801, 801, 801, 801, 801, + 801, 801, 801, 801, 801, 801, 801, 801, - 800, 800, 800, 800, 800, 800, 800, 800, - 800, 800, 800, 800, 800, 800, 800, 800, + 801, 801, 801, 801, 801, 801, 801, 801, + 801, 801, 801, 801, 801, 801, 801, 801, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 801, 239, 235, 235, + 243, 243, 243, 243, 802, 239, 235, 235, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, - 802, 803, 803, 802, 802, 804, 804, 805, - 806, 807, 160, 160, 160, 160, 160, 160, + 803, 804, 804, 803, 803, 805, 805, 806, + 807, 808, 160, 160, 160, 160, 160, 160, 139, 139, 139, 139, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 734, 745, 745, 808, 808, 598, 740, 598, - 740, 598, 740, 598, 740, 598, 740, 598, + 735, 746, 746, 809, 809, 598, 741, 598, + 741, 598, 741, 598, 741, 598, 741, 598, - 740, 598, 740, 598, 740, 750, 750, 809, - 810, 734, 734, 734, 734, 808, 808, 808, - 811, 734, 812, 160, 760, 813, 9, 9, - 745, 16, 17, 16, 17, 16, 17, 814, + 741, 598, 741, 598, 741, 751, 751, 810, + 811, 735, 735, 735, 735, 809, 809, 809, + 812, 735, 813, 160, 761, 814, 9, 9, + 746, 16, 17, 16, 17, 16, 17, 815, - 734, 734, 815, 816, 817, 818, 819, 160, - 734, 12, 13, 734, 160, 160, 160, 160, + 735, 735, 816, 817, 818, 819, 820, 160, + 735, 12, 13, 735, 160, 160, 160, 160, 243, 243, 243, 286, 243, 235, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 235, 235, 820, - - 160, 9, 734, 814, 12, 13, 734, 734, - 16, 17, 734, 815, 811, 816, 812, 821, - 822, 823, 824, 825, 826, 827, 828, 829, - 830, 831, 813, 760, 832, 819, 833, 9, - - 734, 834, 834, 834, 834, 834, 834, 834, - 834, 834, 834, 834, 834, 834, 834, 834, - 834, 834, 834, 834, 834, 834, 834, 834, - 834, 834, 834, 39, 734, 41, 835, 808, - - 835, 836, 836, 836, 836, 836, 836, 836, - 836, 836, 836, 836, 836, 836, 836, 836, - 836, 836, 836, 836, 836, 836, 836, 836, - 836, 836, 836, 39, 819, 41, 819, 698, - - 699, 733, 16, 17, 732, 760, 837, 758, - 758, 758, 758, 758, 758, 758, 758, 758, - 761, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, + 243, 243, 243, 243, 243, 235, 235, 821, + 160, 9, 735, 815, 12, 13, 735, 735, + 16, 17, 735, 816, 812, 817, 813, 822, + 823, 824, 825, 826, 827, 828, 829, 830, + 831, 832, 814, 761, 833, 820, 834, 9, + + 735, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 39, 735, 41, 836, 809, + + 836, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 761, 761, + 837, 837, 837, 39, 820, 41, 820, 699, + + 700, 734, 16, 17, 733, 761, 838, 759, + 759, 759, 759, 759, 759, 759, 759, 759, + 762, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 838, 838, + 838, 838, 838, 838, 838, 838, 762, 762, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, @@ -2620,10 +2620,10 @@ static const unsigned short uc_property_trie[] = { 160, 160, 90, 90, 90, 90, 90, 90, 160, 160, 90, 90, 90, 160, 160, 160, - 48, 12, 819, 835, 735, 12, 12, 160, + 48, 12, 820, 836, 736, 12, 12, 160, 49, 36, 36, 36, 36, 49, 49, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 838, 838, 838, 839, 49, 840, 840, + 160, 839, 839, 839, 840, 49, 841, 841, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 160, 308, 308, 308, @@ -2650,68 +2650,68 @@ static const unsigned short uc_property_trie[] = { 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 160, 160, 160, 160, 160, - 841, 842, 843, 160, 160, 160, 160, 844, - 844, 844, 844, 844, 844, 844, 844, 844, - 844, 844, 844, 844, 844, 844, 844, 844, - 844, 844, 844, 844, 844, 844, 844, 844, - - 844, 844, 844, 844, 844, 844, 844, 844, - 844, 844, 844, 844, 844, 844, 844, 844, - 844, 844, 844, 844, 160, 160, 160, 845, + 842, 843, 844, 160, 160, 160, 160, 845, + 845, 845, 845, 845, 845, 845, 845, 845, + 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, - 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 846, 846, 846, + 845, 845, 845, 845, 845, 845, 845, 845, + 845, 845, 845, 845, 845, 845, 845, 845, + 845, 845, 845, 845, 160, 160, 160, 846, 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 846, 846, 846, - 846, 846, 846, 846, 846, 724, 724, 724, - 724, 418, 418, 418, 418, 418, 418, 418, + 847, 847, 847, 847, 847, 847, 847, 847, + 847, 847, 847, 847, 847, 847, 847, 847, + 847, 847, 847, 847, 847, 847, 847, 847, + 847, 847, 847, 847, 847, 847, 847, 847, + + 847, 847, 847, 847, 847, 847, 847, 847, + 847, 847, 847, 847, 847, 847, 847, 847, + 847, 847, 847, 847, 847, 725, 725, 725, + 725, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 724, 160, 160, 160, 160, 160, + 418, 418, 725, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 847, 847, 847, 847, 847, 847, 847, 847, - 847, 847, 847, 847, 847, 847, 847, 847, - 847, 847, 847, 847, 847, 847, 847, 847, - 847, 847, 847, 847, 847, 847, 847, 160, + 848, 848, 848, 848, 848, 848, 848, 848, + 848, 848, 848, 848, 848, 848, 848, 848, + 848, 848, 848, 848, 848, 848, 848, 848, + 848, 848, 848, 848, 848, 848, 848, 160, - 848, 848, 848, 848, 160, 160, 160, 160, + 849, 849, 849, 849, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 847, 847, 847, 847, 847, 847, 847, 847, - 847, 847, 847, 847, 847, 847, 847, 847, + 848, 848, 848, 848, 848, 848, 848, 848, + 848, 848, 848, 848, 848, 848, 848, 848, - 847, 849, 847, 847, 847, 847, 847, 847, - 847, 847, 849, 160, 160, 160, 160, 160, + 848, 850, 848, 848, 848, 848, 848, 848, + 848, 848, 850, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 308, 308, 308, 308, 160, 841, + 308, 308, 308, 308, 308, 308, 160, 842, 323, 323, 323, 323, 160, 160, 160, 160, 323, 323, 323, 323, 323, 323, 323, 323, - 465, 850, 850, 850, 850, 850, 160, 160, + 465, 851, 851, 851, 851, 851, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 851, 851, 851, 851, 851, 851, 851, 851, - 851, 851, 851, 851, 851, 851, 851, 851, - 851, 851, 851, 851, 851, 851, 851, 851, - 851, 851, 851, 851, 851, 851, 851, 851, + 852, 852, 852, 852, 852, 852, 852, 852, + 852, 852, 852, 852, 852, 852, 852, 852, + 852, 852, 852, 852, 852, 852, 852, 852, + 852, 852, 852, 852, 852, 852, 852, 852, - 851, 851, 851, 851, 851, 851, 852, 852, - 853, 853, 853, 853, 853, 853, 853, 853, - 853, 853, 853, 853, 853, 853, 853, 853, - 853, 853, 853, 853, 853, 853, 853, 853, + 852, 852, 852, 852, 852, 852, 853, 853, + 854, 854, 854, 854, 854, 854, 854, 854, + 854, 854, 854, 854, 854, 854, 854, 854, + 854, 854, 854, 854, 854, 854, 854, 854, - 853, 853, 853, 853, 853, 853, 853, 853, - 853, 853, 853, 853, 853, 853, 854, 854, + 854, 854, 854, 854, 854, 854, 854, 854, + 854, 854, 854, 854, 854, 854, 855, 855, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, @@ -2725,35 +2725,35 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 855, 855, 855, 855, 855, 855, 205, 205, - 855, 205, 855, 855, 855, 855, 855, 855, - 855, 855, 855, 855, 855, 855, 855, 855, - 855, 855, 855, 855, 855, 855, 855, 855, - - 855, 855, 855, 855, 855, 855, 855, 855, - 855, 855, 855, 855, 855, 855, 855, 855, - 855, 855, 855, 855, 855, 855, 205, 855, - 855, 205, 205, 205, 855, 205, 205, 855, + 856, 856, 856, 856, 856, 856, 205, 205, + 856, 205, 856, 856, 856, 856, 856, 856, + 856, 856, 856, 856, 856, 856, 856, 856, + 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, 856, - 856, 856, 856, 856, 856, 856, 857, 857, - 857, 857, 205, 205, 205, 205, 205, 858, + 856, 856, 856, 856, 856, 856, 205, 856, + 856, 205, 205, 205, 856, 205, 205, 856, - 859, 780, 780, 780, 205, 780, 780, 205, - 205, 205, 205, 205, 780, 152, 780, 153, - 859, 859, 859, 859, 205, 859, 859, 859, - 205, 859, 859, 859, 859, 859, 859, 859, + 857, 857, 857, 857, 857, 857, 857, 857, + 857, 857, 857, 857, 857, 857, 857, 857, + 857, 857, 857, 857, 857, 857, 858, 858, + 858, 858, 205, 205, 205, 205, 205, 859, - 859, 859, 859, 859, 859, 859, 859, 859, - 859, 859, 859, 859, 859, 859, 859, 859, - 859, 859, 859, 859, 205, 205, 205, 205, - 153, 641, 152, 205, 205, 205, 205, 779, + 860, 781, 781, 781, 205, 781, 781, 205, + 205, 205, 205, 205, 781, 152, 781, 153, + 860, 860, 860, 860, 205, 860, 860, 860, + 205, 860, 860, 860, 860, 860, 860, 860, - 860, 861, 862, 863, 864, 864, 864, 864, + 860, 860, 860, 860, 860, 860, 860, 860, + 860, 860, 860, 860, 860, 860, 860, 860, + 860, 860, 860, 860, 205, 205, 205, 205, + 153, 642, 152, 205, 205, 205, 205, 780, + + 861, 862, 863, 864, 865, 865, 865, 865, 205, 205, 205, 205, 205, 205, 205, 205, - 865, 865, 865, 865, 865, 865, 865, 865, - 866, 205, 205, 205, 205, 205, 205, 205, + 866, 866, 866, 866, 866, 866, 866, 866, + 867, 205, 205, 205, 205, 205, 205, 205, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -2854,19 +2854,19 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 867, 867, 867, 867, 867, - 867, 867, 867, 160, 160, 160, 160, 160, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 868, 868, 868, 868, 868, + 868, 868, 868, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 481, 481, 481, 481, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -2887,67 +2887,67 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 160, 160, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 160, - 160, 160, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 869, 870, 871, - 871, 871, 868, 868, 868, 872, 869, 869, - 869, 869, 869, 873, 873, 873, 873, 873, - 873, 873, 873, 874, 874, 874, 874, 874, - 874, 874, 874, 868, 868, 875, 875, 875, - 875, 875, 874, 874, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 875, 875, 875, 875, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 160, 160, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 160, + 160, 160, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 870, 871, 872, + 872, 872, 869, 869, 869, 873, 870, 870, + 870, 870, 870, 874, 874, 874, 874, 874, + 874, 874, 874, 875, 875, 875, 875, 875, + 875, 875, 875, 869, 869, 876, 876, 876, + 876, 876, 875, 875, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 876, 876, 876, 876, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 869, 869, + 869, 869, 869, 869, 869, 869, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -2998,9 +2998,9 @@ static const unsigned short uc_property_trie[] = { 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 876, 876, 876, 876, 876, 876, 876, 876, - 876, 876, 876, 876, 876, 876, 876, 876, - 876, 876, 160, 160, 160, 160, 160, 160, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 877, 877, 877, 877, 877, 877, + 877, 877, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -3019,137 +3019,137 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, - 878, 878, 878, 878, 878, 160, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 879, 879, + 879, 879, 879, 879, 879, 160, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 160, 877, 877, - 160, 160, 877, 160, 160, 877, 877, 160, - 160, 877, 877, 877, 877, 160, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, - 878, 878, 160, 878, 160, 878, 878, 878, - 878, 102, 878, 878, 160, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 878, 160, 878, 878, + 160, 160, 878, 160, 160, 878, 878, 160, + 160, 878, 878, 878, 878, 160, 878, 878, + 878, 878, 878, 878, 878, 878, 879, 879, + 879, 879, 160, 879, 160, 879, 879, 879, + 879, 102, 879, 879, 160, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, - - 878, 878, 878, 878, 877, 877, 160, 877, - 877, 877, 877, 160, 160, 877, 877, 877, - 877, 877, 877, 877, 877, 160, 877, 877, - 877, 877, 877, 877, 877, 160, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + + 879, 879, 879, 879, 878, 878, 160, 878, + 878, 878, 878, 160, 160, 878, 878, 878, + 878, 878, 878, 878, 878, 160, 878, 878, + 878, 878, 878, 878, 878, 160, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 878, 878, 160, 878, 878, 878, 878, 160, + 878, 878, 878, 878, 878, 160, 878, 160, + 160, 160, 878, 878, 878, 878, 878, 878, + 878, 160, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 160, 877, 877, 877, 877, 160, - 877, 877, 877, 877, 877, 160, 877, 160, - 160, 160, 877, 877, 877, 877, 877, 877, - 877, 160, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + + 879, 879, 879, 879, 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - + 878, 878, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 103, 103, 160, 160, 878, 878, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 103, 103, 160, 160, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 879, 878, 878, 878, 878, 878, 878, + 878, 880, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 880, 879, 879, 879, 879, + 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 879, 878, 878, 878, 878, - 878, 878, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 879, 878, 878, 878, 878, + 878, 878, 878, 880, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 880, 879, 879, + 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 879, 878, 878, - 878, 878, 878, 878, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 879, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 878, 878, 878, 878, 879, - 878, 878, 878, 878, 878, 878, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 879, + 878, 878, 878, 878, 878, 880, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 880, + 879, 879, 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, + 878, 878, 878, 878, 878, 878, 878, 880, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 880, 879, 879, 879, 879, 879, 879, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 879, 878, 878, 878, 878, 878, 878, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 877, 877, 877, 877, 877, 877, 877, - 877, 879, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, 878, - 878, 878, 878, 879, 878, 878, 878, 878, - 878, 878, 880, 723, 160, 160, 881, 882, - 883, 884, 885, 886, 887, 888, 889, 890, - 881, 882, 883, 884, 885, 886, 887, 888, - 889, 890, 881, 882, 883, 884, 885, 886, - 887, 888, 889, 890, 881, 882, 883, 884, - 885, 886, 887, 888, 889, 890, 881, 882, - 883, 884, 885, 886, 887, 888, 889, 890, + 878, 880, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 879, 879, 879, 879, 879, + 879, 879, 879, 880, 879, 879, 879, 879, + 879, 879, 881, 724, 160, 160, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, + 882, 883, 884, 885, 886, 887, 888, 889, + 890, 891, 882, 883, 884, 885, 886, 887, + 888, 889, 890, 891, 882, 883, 884, 885, + 886, 887, 888, 889, 890, 891, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -3182,78 +3182,78 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 160, 160, 160, 160, 160, 891, 891, + 160, 160, 160, 160, 160, 160, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 160, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 160, 160, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 893, 893, + 893, 893, 893, 893, 893, 893, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -3283,22 +3283,22 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 160, 873, 160, 160, 160, 160, 160, 160, + 160, 874, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, - 873, 873, 873, 873, 873, 873, 873, 873, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, + 874, 874, 874, 874, 874, 874, 874, 874, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, @@ -3349,71 +3349,71 @@ static const unsigned short uc_property_trie[] = { 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, - 893, 893, 893, 893, 893, 893, 891, 891, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 894, 894, + 894, 894, 894, 894, 894, 894, 892, 892, }; #define GET_PROP_INDEX(ucs4) \ @@ -4021,11 +4021,10 @@ static const QUnicodeTables::Properties uc_properties[] = { { 20, 3, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 20, 17, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 20, 11, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 23, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 }, - { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 4, 10 }, - { 21, 0, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 }, { 23, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 }, - { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 }, + { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 10 }, + { 21, 0, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 }, + { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10 }, { 25, 13, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 25, 15, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0 }, { 7, 31, 9, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1 }, @@ -4037,6 +4036,8 @@ static const QUnicodeTables::Properties uc_properties[] = { { 10, 19, 15, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 2 }, { 6, 3, 6, 0, 0, -1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 }, { 25, 9, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 23, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 10 }, + { 24, 2, 10, 0, 0, -1, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 10 }, { 25, 4, 10, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 }, { 26, 7, 6, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0 }, { 25, 4, 10, 0, 0, -1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9 }, diff --git a/tests/auto/corelib/tools/qchar/tst_qchar.cpp b/tests/auto/corelib/tools/qchar/tst_qchar.cpp index 6632776a86..14c43d0088 100644 --- a/tests/auto/corelib/tools/qchar/tst_qchar.cpp +++ b/tests/auto/corelib/tools/qchar/tst_qchar.cpp @@ -77,6 +77,7 @@ private slots: void joining(); void combiningClass(); void digitValue(); + void mirroredChar(); void decomposition(); void lineBreakClass(); void normalization_data(); @@ -528,6 +529,26 @@ void tst_QChar::digitValue() QVERIFY(QChar::digitValue((uint)UNICODE_LAST_CODEPOINT + 1) == -1); } +void tst_QChar::mirroredChar() +{ + QVERIFY(QChar(0x169B).hasMirrored()); + QVERIFY(QChar(0x169B).mirroredChar() == QChar(0x169C)); + QVERIFY(QChar(0x169C).hasMirrored()); + QVERIFY(QChar(0x169C).mirroredChar() == QChar(0x169B)); + + QVERIFY(QChar(0x301A).hasMirrored()); + QVERIFY(QChar(0x301A).mirroredChar() == QChar(0x301B)); + QVERIFY(QChar(0x301B).hasMirrored()); + QVERIFY(QChar(0x301B).mirroredChar() == QChar(0x301A)); + + if (QChar::currentUnicodeVersion() <= QChar::Unicode_5_0) { + QVERIFY(!QChar(0x201C).hasMirrored()); + QVERIFY(QChar(0x201C).mirroredChar() != QChar(0x201D)); + QVERIFY(!QChar(0x201D).hasMirrored()); + QVERIFY(QChar(0x201D).mirroredChar() != QChar(0x201C)); + } +} + void tst_QChar::decomposition() { QVERIFY(QChar((ushort)0xa0).decompositionTag() == QChar::NoBreak); diff --git a/util/unicode/data/BidiMirroring.txt b/util/unicode/data/BidiMirroring.txt index f9a09c1345..9a1b25fa4d 100644 --- a/util/unicode/data/BidiMirroring.txt +++ b/util/unicode/data/BidiMirroring.txt @@ -1,12 +1,12 @@ # BidiMirroring-5.0.0.txt -# Date: 2006-02-16, 16:11:00 PST [KW] +# Date: 2007-08-22, 14:40:00 PDT [KW] # -# Bidi_Mirroring_Glyph Property +# Bidi_Mirroring_Glyph Property (Corrigendum #6 applied) # # This file is an informative contributory data file in the # Unicode Character Database. # -# Copyright (c) 1991-2006 Unicode, Inc. +# Copyright (c) 1991-2007 Unicode, Inc. # For terms of use, see http://www.unicode.org/terms_of_use.html # # This data file lists characters that have the mirrored property @@ -52,10 +52,6 @@ 0F3D; 0F3C # TIBETAN MARK ANG KHANG GYAS 169B; 169C # OGHAM FEATHER MARK 169C; 169B # OGHAM REVERSED FEATHER MARK -2018; 2019 # [BEST FIT] LEFT SINGLE QUOTATION MARK -2019; 2018 # [BEST FIT] RIGHT SINGLE QUOTATION MARK -201C; 201D # [BEST FIT] LEFT DOUBLE QUOTATION MARK -201D; 201C # [BEST FIT] RIGHT DOUBLE QUOTATION MARK 2039; 203A # SINGLE LEFT-POINTING ANGLE QUOTATION MARK 203A; 2039 # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK 2045; 2046 # LEFT SQUARE BRACKET WITH QUILL @@ -366,8 +362,6 @@ 3019; 3018 # RIGHT WHITE TORTOISE SHELL BRACKET 301A; 301B # LEFT WHITE SQUARE BRACKET 301B; 301A # RIGHT WHITE SQUARE BRACKET -301D; 301E # REVERSED DOUBLE PRIME QUOTATION MARK -301E; 301D # DOUBLE PRIME QUOTATION MARK FE59; FE5A # SMALL LEFT PARENTHESIS FE5A; FE59 # SMALL RIGHT PARENTHESIS FE5B; FE5C # SMALL LEFT CURLY BRACKET @@ -393,10 +387,6 @@ FF63; FF62 # [BEST FIT] HALFWIDTH RIGHT CORNER BRACKET # For these characters it is up to the rendering system # to provide mirrored glyphs. -# 201A; SINGLE LOW-9 QUOTATION MARK -# 201B; SINGLE HIGH-REVERSED-9 QUOTATION MARK -# 201E; DOUBLE LOW-9 QUOTATION MARK -# 201F; DOUBLE HIGH-REVERSED-9 QUOTATION MARK # 2140; DOUBLE-STRUCK N-ARY SUMMATION # 2201; COMPLEMENT # 2202; PARTIAL DIFFERENTIAL @@ -572,7 +562,6 @@ FF63; FF62 # [BEST FIT] HALFWIDTH RIGHT CORNER BRACKET # 2AF3; PARALLEL WITH TILDE OPERATOR # 2AFB; TRIPLE SOLIDUS BINARY RELATION # 2AFD; DOUBLE SOLIDUS OPERATOR -# 301F; LOW DOUBLE PRIME QUOTATION MARK # 1D6DB; MATHEMATICAL BOLD PARTIAL DIFFERENTIAL # 1D715; MATHEMATICAL ITALIC PARTIAL DIFFERENTIAL # 1D74F; MATHEMATICAL BOLD ITALIC PARTIAL DIFFERENTIAL diff --git a/util/unicode/data/UnicodeData.txt b/util/unicode/data/UnicodeData.txt index 299f0e57d1..1588852004 100644 --- a/util/unicode/data/UnicodeData.txt +++ b/util/unicode/data/UnicodeData.txt @@ -6118,14 +6118,14 @@ 2015;HORIZONTAL BAR;Pd;0;ON;;;;;N;QUOTATION DASH;;;; 2016;DOUBLE VERTICAL LINE;Po;0;ON;;;;;N;DOUBLE VERTICAL BAR;;;; 2017;DOUBLE LOW LINE;Po;0;ON; 0020 0333;;;;N;SPACING DOUBLE UNDERSCORE;;;; -2018;LEFT SINGLE QUOTATION MARK;Pi;0;ON;;;;;Y;SINGLE TURNED COMMA QUOTATION MARK;;;; -2019;RIGHT SINGLE QUOTATION MARK;Pf;0;ON;;;;;Y;SINGLE COMMA QUOTATION MARK;;;; -201A;SINGLE LOW-9 QUOTATION MARK;Ps;0;ON;;;;;Y;LOW SINGLE COMMA QUOTATION MARK;;;; -201B;SINGLE HIGH-REVERSED-9 QUOTATION MARK;Pi;0;ON;;;;;Y;SINGLE REVERSED COMMA QUOTATION MARK;;;; -201C;LEFT DOUBLE QUOTATION MARK;Pi;0;ON;;;;;Y;DOUBLE TURNED COMMA QUOTATION MARK;;;; -201D;RIGHT DOUBLE QUOTATION MARK;Pf;0;ON;;;;;Y;DOUBLE COMMA QUOTATION MARK;;;; -201E;DOUBLE LOW-9 QUOTATION MARK;Ps;0;ON;;;;;Y;LOW DOUBLE COMMA QUOTATION MARK;;;; -201F;DOUBLE HIGH-REVERSED-9 QUOTATION MARK;Pi;0;ON;;;;;Y;DOUBLE REVERSED COMMA QUOTATION MARK;;;; +2018;LEFT SINGLE QUOTATION MARK;Pi;0;ON;;;;;N;SINGLE TURNED COMMA QUOTATION MARK;;;; +2019;RIGHT SINGLE QUOTATION MARK;Pf;0;ON;;;;;N;SINGLE COMMA QUOTATION MARK;;;; +201A;SINGLE LOW-9 QUOTATION MARK;Ps;0;ON;;;;;N;LOW SINGLE COMMA QUOTATION MARK;;;; +201B;SINGLE HIGH-REVERSED-9 QUOTATION MARK;Pi;0;ON;;;;;N;SINGLE REVERSED COMMA QUOTATION MARK;;;; +201C;LEFT DOUBLE QUOTATION MARK;Pi;0;ON;;;;;N;DOUBLE TURNED COMMA QUOTATION MARK;;;; +201D;RIGHT DOUBLE QUOTATION MARK;Pf;0;ON;;;;;N;DOUBLE COMMA QUOTATION MARK;;;; +201E;DOUBLE LOW-9 QUOTATION MARK;Ps;0;ON;;;;;N;LOW DOUBLE COMMA QUOTATION MARK;;;; +201F;DOUBLE HIGH-REVERSED-9 QUOTATION MARK;Pi;0;ON;;;;;N;DOUBLE REVERSED COMMA QUOTATION MARK;;;; 2020;DAGGER;Po;0;ON;;;;;N;;;;; 2021;DOUBLE DAGGER;Po;0;ON;;;;;N;;;;; 2022;BULLET;Po;0;ON;;;;;N;;;;; @@ -9480,9 +9480,9 @@ 301A;LEFT WHITE SQUARE BRACKET;Ps;0;ON;;;;;Y;OPENING WHITE SQUARE BRACKET;;;; 301B;RIGHT WHITE SQUARE BRACKET;Pe;0;ON;;;;;Y;CLOSING WHITE SQUARE BRACKET;;;; 301C;WAVE DASH;Pd;0;ON;;;;;N;;;;; -301D;REVERSED DOUBLE PRIME QUOTATION MARK;Ps;0;ON;;;;;Y;;;;; -301E;DOUBLE PRIME QUOTATION MARK;Pe;0;ON;;;;;Y;;;;; -301F;LOW DOUBLE PRIME QUOTATION MARK;Pe;0;ON;;;;;Y;;;;; +301D;REVERSED DOUBLE PRIME QUOTATION MARK;Ps;0;ON;;;;;N;;;;; +301E;DOUBLE PRIME QUOTATION MARK;Pe;0;ON;;;;;N;;;;; +301F;LOW DOUBLE PRIME QUOTATION MARK;Pe;0;ON;;;;;N;;;;; 3020;POSTAL MARK FACE;So;0;ON;;;;;N;;;;; 3021;HANGZHOU NUMERAL ONE;Nl;0;L;;;;1;N;;;;; 3022;HANGZHOU NUMERAL TWO;Nl;0;L;;;;2;N;;;;; -- cgit v1.2.3 From 5cb2fbe088ee5b15c2a35ba175e3c39a2fac5c03 Mon Sep 17 00:00:00 2001 From: ABBAPOH Date: Sat, 25 Feb 2012 23:52:09 +0400 Subject: Now QSplitter can have 0-pixel handle Change-Id: Iad920ffcd5d7f4c01504d41d1740f130b7aa53dd Reviewed-by: Thiago Macieira Reviewed-by: Girish Ramakrishnan --- src/widgets/widgets/qsplitter.cpp | 8 ++++---- src/widgets/widgets/qsplitter_p.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp index 285099a4cb..44c450ca47 100644 --- a/src/widgets/widgets/qsplitter.cpp +++ b/src/widgets/widgets/qsplitter.cpp @@ -232,14 +232,14 @@ void QSplitterHandle::resizeEvent(QResizeEvent *event) { Q_D(const QSplitterHandle); - // When splitters are only 1 pixel large we increase the + // When splitters are only 1 or 0 pixel large we increase the // actual grab area to five pixels // Note that QSplitter uses contentsRect for layouting // and ensures that handles are drawn on top of widgets // We simply use the contents margins for draggin and only // paint the mask area - bool useTinyMode = (d->s->handleWidth() == 1); + bool useTinyMode = (d->s->handleWidth() <= 1); setAttribute(Qt::WA_MouseNoMask, useTinyMode); if (useTinyMode) { if (orientation() == Qt::Horizontal) @@ -1528,14 +1528,14 @@ void QSplitter::setSizes(const QList &list) By default, this property contains a value that depends on the user's platform and style preferences. - If you set handleWidth to 1, the actual grab area will grow to overlap a + If you set handleWidth to 1 or 0, the actual grab area will grow to overlap a few pixels of it's respective widgets. */ int QSplitter::handleWidth() const { Q_D(const QSplitter); - if (d->handleWidth > 0) { + if (d->handleWidth >= 0) { return d->handleWidth; } else { return style()->pixelMetric(QStyle::PM_SplitterWidth, 0, this); diff --git a/src/widgets/widgets/qsplitter_p.h b/src/widgets/widgets/qsplitter_p.h index c9db6ef9af..d9a0cdecb7 100644 --- a/src/widgets/widgets/qsplitter_p.h +++ b/src/widgets/widgets/qsplitter_p.h @@ -83,7 +83,7 @@ class QSplitterPrivate : public QFramePrivate Q_DECLARE_PUBLIC(QSplitter) public: QSplitterPrivate() : rubberBand(0), opaque(true), firstShow(true), - childrenCollapsible(true), compatMode(false), handleWidth(0), blockChildAdd(false) {} + childrenCollapsible(true), compatMode(false), handleWidth(-1), blockChildAdd(false) {} QPointer rubberBand; mutable QList list; -- cgit v1.2.3 From 83fc52e3b4005d946c731577f8f49becae948c39 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 2 Apr 2012 11:59:04 +0200 Subject: widgets: Fix painting to a fully transparent top level widget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QWS used to have a line to change the composite mode from SourceOver to Source for the top level widget. This wasn't used with QPA and I removed the internal DontSetCompositionMode in qtbase. It turns out that the QWS way is the most efficient one to initialize the background of the widget. The alternative is to have the QPlatformBackingStore::beginPaint always clear the entire to be painted area and then paint the background of the widget. The difference of painting each pixel once or twice is noticable on embedded platforms and in the range of one to two fps. Reproduce the issue with: echo "QWidget {background: transparent}" > style.css ./examples/widgets/wiggly/wiggly -stylesheet style.css Task-number: QTBUG-24526 Change-Id: Ica4c980bb3bf6eb87ddb5b510ac7493292d01543 Reviewed-by: Samuel Rødal Reviewed-by: Girish Ramakrishnan --- src/gui/painting/qplatformbackingstore_qpa.cpp | 3 --- src/widgets/kernel/qwidget.cpp | 12 +++++++++++- src/widgets/kernel/qwidget_p.h | 3 ++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/gui/painting/qplatformbackingstore_qpa.cpp b/src/gui/painting/qplatformbackingstore_qpa.cpp index ff7d91ccea..485190d301 100644 --- a/src/gui/painting/qplatformbackingstore_qpa.cpp +++ b/src/gui/painting/qplatformbackingstore_qpa.cpp @@ -114,9 +114,6 @@ QWindow* QPlatformBackingStore::window() const This function is called before painting onto the surface begins, with the \a region in which the painting will occur. - \note A platform providing a backing store with an alpha channel - needs to properly initialize the region to be painted. - \sa endPaint(), paintDevice() */ diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index f02a67d9ea..662c9b7403 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -2137,7 +2137,15 @@ void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, int if ((flags & DrawAsRoot) && !(q->autoFillBackground() && autoFillBrush.isOpaque())) { const QBrush bg = q->palette().brush(QPalette::Window); - fillRegion(painter, rgn, bg); + if (!(flags & DontSetCompositionMode)) { + //copy alpha straight in + QPainter::CompositionMode oldMode = painter->compositionMode(); + painter->setCompositionMode(QPainter::CompositionMode_Source); + fillRegion(painter, rgn, bg); + painter->setCompositionMode(oldMode); + } else { + fillRegion(painter, rgn, bg); + } } if (q->autoFillBackground()) @@ -5229,6 +5237,8 @@ void QWidgetPrivate::render(QPaintDevice *target, const QPoint &targetOffset, else flags |= DontSubtractOpaqueChildren; + flags |= DontSetCompositionMode; + if (target->devType() == QInternal::Printer) { QPainter p(target); render_helper(&p, targetOffset, paintRegion, renderFlags); diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index 8107b6ca74..d3fcdce6a8 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -284,7 +284,8 @@ public: DrawInvisible = 0x08, DontSubtractOpaqueChildren = 0x10, DontDrawOpaqueChildren = 0x20, - DontDrawNativeChildren = 0x40 + DontDrawNativeChildren = 0x40, + DontSetCompositionMode = 0x80 }; enum CloseMode { -- cgit v1.2.3 From d2090e19a93fca9b5015d3a6978d7079e1414e13 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 10 Apr 2012 13:38:41 +0200 Subject: moc: Fix parsing of the empty preprocessor command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When encountering a null preprocessing directive (which is supposed to be ignored), the moc preprocessor will leave a PP_NEWLINE token in the token stream. That will confuse the parser. The PP_NEWLINE token need to be ignored in the preprocessing phase. Task-number: QTBUG-22717 Change-Id: I1e502a7e5bc6fa8ce2f82109ba7199b95747ff0a Reviewed-by: João Abecasis Reviewed-by: Bradley T. Hughes --- src/tools/moc/preprocessor.cpp | 2 ++ tests/auto/tools/moc/tst_moc.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp index 07986a71e6..091f62b379 100644 --- a/src/tools/moc/preprocessor.cpp +++ b/src/tools/moc/preprocessor.cpp @@ -915,6 +915,8 @@ void Preprocessor::preprocess(const QByteArray &filename, Symbols &preprocessed) case PP_ENDIF: until(PP_NEWLINE); continue; + case PP_NEWLINE: + continue; case SIGNALS: case SLOTS: { Symbol sym = symbol(); diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 49095048bf..ecd9dc599e 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -368,6 +368,13 @@ signals: void signalInIf3(); #endif +# //QTBUG-22717 + # /* */ +# + + # \ + +// public slots: void const slotWithSillyConst() {} -- cgit v1.2.3 From 73db181e83c305b34c34d0aba914a1faffd8942e Mon Sep 17 00:00:00 2001 From: Jason McDonald Date: Fri, 13 Apr 2012 17:59:37 +1000 Subject: Put bug numbers on same line as insignificant_test markers. This makes it easier to find insignificant tests that have no associated bug report. Change-Id: Ia71d59da062818d3860b0365d063e044705267fd Reviewed-by: Rohan McGovern --- tests/auto/network/access/qftp/qftp.pro | 2 +- tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro | 3 +-- tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro | 2 +- tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro | 3 +-- tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro | 3 +-- tests/auto/widgets/itemviews/qtreeview/qtreeview.pro | 3 +-- tests/auto/widgets/widgets/qcombobox/qcombobox.pro | 3 +-- tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro | 3 +-- tests/auto/widgets/widgets/qmenubar/qmenubar.pro | 3 +-- 9 files changed, 9 insertions(+), 16 deletions(-) diff --git a/tests/auto/network/access/qftp/qftp.pro b/tests/auto/network/access/qftp/qftp.pro index 0f5bd5fe17..7fdf3a46f0 100644 --- a/tests/auto/network/access/qftp/qftp.pro +++ b/tests/auto/network/access/qftp/qftp.pro @@ -14,4 +14,4 @@ wince*: { DEFINES += SRCDIR=\\\"$$PWD/\\\" } -CONFIG+=insignificant_test # uses live qt-test-server, inherently unstable +CONFIG+=insignificant_test # QTBUG-15111: uses live qt-test-server, inherently unstable diff --git a/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro b/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro index 389c8ca4dc..9e37aec5ce 100644 --- a/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro +++ b/tests/auto/network/socket/qsocks5socketengine/qsocks5socketengine.pro @@ -10,7 +10,6 @@ MOC_DIR=tmp QT = core-private network-private testlib -# QTBUG-23380 - udpTest failing on Ubuntu 11.10 x64 -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test # QTBUG-23380 requires(contains(QT_CONFIG,private_tests)) diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro index 2f479151dc..59ad89ed1f 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro +++ b/tests/auto/widgets/graphicsview/qgraphicsview/qgraphicsview.pro @@ -7,6 +7,6 @@ QT += core-private gui-private SOURCES += tst_qgraphicsview.cpp tst_qgraphicsview_2.cpp DEFINES += QT_NO_CAST_TO_ASCII -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test # QTBUG-16063 win32|mac:CONFIG += insignificant_test # QTBUG-24296 diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro b/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro index ca796647c1..2fc45b48de 100644 --- a/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro +++ b/tests/auto/widgets/graphicsview/qgraphicswidget/qgraphicswidget.pro @@ -6,5 +6,4 @@ QT += core-private gui-private SOURCES += tst_qgraphicswidget.cpp -# QTBUG-23616 - unstable test -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test # QTBUG-23616 diff --git a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro index d47b3bfa31..d1a7686637 100644 --- a/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro +++ b/tests/auto/widgets/itemviews/qitemdelegate/qitemdelegate.pro @@ -5,5 +5,4 @@ SOURCES += tst_qitemdelegate.cpp win32:!wince*: LIBS += -lUser32 -# QTBUG-23637 -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test # QTBUG-23637 diff --git a/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro b/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro index 95d1ba1c2f..8102b6b95d 100644 --- a/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro +++ b/tests/auto/widgets/itemviews/qtreeview/qtreeview.pro @@ -4,5 +4,4 @@ QT += widgets testlib QT += widgets-private gui-private core-private SOURCES += tst_qtreeview.cpp -# QTBUG-23638 -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG+=insignificant_test # QTBUG-23638 diff --git a/tests/auto/widgets/widgets/qcombobox/qcombobox.pro b/tests/auto/widgets/widgets/qcombobox/qcombobox.pro index 03bb91f4c0..e0545630c5 100644 --- a/tests/auto/widgets/widgets/qcombobox/qcombobox.pro +++ b/tests/auto/widgets/widgets/qcombobox/qcombobox.pro @@ -3,5 +3,4 @@ TARGET = tst_qcombobox QT += widgets widgets-private gui-private core-private testlib SOURCES += tst_qcombobox.cpp -# QTBUG-23639 - unstable test (related QTBUG-1071) -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test # QTBUG-23639, (related QTBUG-1071) diff --git a/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro b/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro index 4dd0890fc0..183210b597 100644 --- a/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro +++ b/tests/auto/widgets/widgets/qdoublespinbox/qdoublespinbox.pro @@ -3,5 +3,4 @@ TARGET = tst_qdoublespinbox QT += widgets testlib SOURCES += tst_qdoublespinbox.cpp -# QTBUG-23641 - unstable test -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test # QTBUG-23641 diff --git a/tests/auto/widgets/widgets/qmenubar/qmenubar.pro b/tests/auto/widgets/widgets/qmenubar/qmenubar.pro index 6bacaa0d37..c74c9e84c1 100644 --- a/tests/auto/widgets/widgets/qmenubar/qmenubar.pro +++ b/tests/auto/widgets/widgets/qmenubar/qmenubar.pro @@ -3,5 +3,4 @@ TARGET = tst_qmenubar QT += widgets testlib SOURCES += tst_qmenubar.cpp -# QTBUG-4965, QTBUG-11823 - unstable tests -linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test +linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):CONFIG += insignificant_test # QTBUG-4965, QTBUG-11823 -- cgit v1.2.3 From b3670edba4bb46389b0005f506c524ea132aac69 Mon Sep 17 00:00:00 2001 From: Pasi Matilainen Date: Thu, 2 Feb 2012 08:18:50 +0200 Subject: Fix incorrect state of show/hide menu items in Mac application menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "Hide ", "Hide Others" and "Show All" menu items in Mac application menu are always enabled, and do not get disabled correctly. Fix by turning on autoenable for the menu in qt_menu.nib, and by implementing menu item validation in QCocoaMenuLoader. Task-number: QTBUG-10705 Change-Id: Ic181dfa26a71acad0067f5269c72517b50b17362 Reviewed-by: Morten Johan Sørvig (cherry picked from commit 8f23a6be1069455e609e8bea7527726c24bebb36) --- src/plugins/platforms/cocoa/qcocoamenuloader.h | 1 + src/plugins/platforms/cocoa/qcocoamenuloader.mm | 12 ++++++++++++ .../platforms/cocoa/qt_menu.nib/keyedobjects.nib | Bin 5560 -> 5560 bytes 3 files changed, 13 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoamenuloader.h b/src/plugins/platforms/cocoa/qcocoamenuloader.h index 128792410b..b0d61fa541 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuloader.h +++ b/src/plugins/platforms/cocoa/qcocoamenuloader.h @@ -88,6 +88,7 @@ - (IBAction)qtDispatcherToQAction:(id)sender; - (void)qtUpdateMenubar; - (void)orderFrontCharacterPalette:(id)sender; +- (BOOL)validateMenuItem:(NSMenuItem*)menuItem; @end void qt_mac_loadMenuNib(QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *qtMenuLoader); diff --git a/src/plugins/platforms/cocoa/qcocoamenuloader.mm b/src/plugins/platforms/cocoa/qcocoamenuloader.mm index 4993937b91..2fdc28de1e 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuloader.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuloader.mm @@ -310,4 +310,16 @@ void qt_mac_loadMenuNib(QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *qtMenuLoader) { [NSApp orderFrontCharacterPalette:sender]; } + +- (BOOL)validateMenuItem:(NSMenuItem*)menuItem +{ + if ([menuItem action] == @selector(hide:) + || [menuItem action] == @selector(hideOtherApplications:) + || [menuItem action] == @selector(unhideAllApplications:)) { + return [NSApp validateMenuItem:menuItem]; + } else { + return [menuItem isEnabled]; + } +} + @end diff --git a/src/plugins/platforms/cocoa/qt_menu.nib/keyedobjects.nib b/src/plugins/platforms/cocoa/qt_menu.nib/keyedobjects.nib index 3edb0ed2eb..67207ca628 100644 Binary files a/src/plugins/platforms/cocoa/qt_menu.nib/keyedobjects.nib and b/src/plugins/platforms/cocoa/qt_menu.nib/keyedobjects.nib differ -- cgit v1.2.3 From f609035fc1bbac810e0d6194621227cb71dd1d67 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Wed, 21 Mar 2012 10:39:55 +0000 Subject: Adding support for obtaining an OpenGL Core Profile context on Mac OSX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I08048ecee9b243b122ee93fce316e498aa7e2d51 Reviewed-by: James Turner Reviewed-by: Samuel Rødal Reviewed-by: Morten Johan Sørvig --- src/platformsupport/cglconvenience/cglconvenience.mm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/platformsupport/cglconvenience/cglconvenience.mm b/src/platformsupport/cglconvenience/cglconvenience.mm index 5c57457e87..325f5c5770 100644 --- a/src/platformsupport/cglconvenience/cglconvenience.mm +++ b/src/platformsupport/cglconvenience/cglconvenience.mm @@ -89,6 +89,18 @@ void *qcgl_createNSOpenGLPixelFormat(const QSurfaceFormat &format) attrs.append(NSOpenGLPFADoubleBuffer); + if (format.profile() == QSurfaceFormat::CoreProfile) { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if ((format.majorVersion() == 3 && format.minorVersion() >= 2) + || format.majorVersion() > 3 ) { + attrs << NSOpenGLPFAOpenGLProfile; + attrs << NSOpenGLProfileVersion3_2Core; + } +#else + qWarning("Mac OSX >= 10.7 is needed for OpenGL Core Profile support"); +#endif + } + if (format.depthBufferSize() > 0) attrs << NSOpenGLPFADepthSize << format.depthBufferSize(); if (format.stencilBufferSize() > 0) -- cgit v1.2.3 From 41673c45dde2eb95ee21dd918235218399f2be2c Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Sun, 15 Apr 2012 04:02:31 -0700 Subject: qmenu.h includes private headers qpa includes are considered private and should not be included in public header files. Change-Id: I26c744ec1d8ddef7b0c11c3d26b593be05f5aa54 Reviewed-by: Thiago Macieira --- src/widgets/widgets/qmenu.h | 2 +- src/widgets/widgets/qmenu_p.h | 2 ++ src/widgets/widgets/qmenubar.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h index 1fa7195170..9f17d2e63c 100644 --- a/src/widgets/widgets/qmenu.h +++ b/src/widgets/widgets/qmenu.h @@ -46,7 +46,6 @@ #include #include #include -#include #ifdef Q_OS_WINCE #include // for HMENU @@ -61,6 +60,7 @@ QT_BEGIN_NAMESPACE class QMenuPrivate; class QStyleOptionMenuItem; +class QPlatformMenu; class Q_WIDGETS_EXPORT QMenu : public QWidget { diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h index ee6e62653f..d637a9be8f 100644 --- a/src/widgets/widgets/qmenu_p.h +++ b/src/widgets/widgets/qmenu_p.h @@ -61,6 +61,8 @@ #include "QtCore/qbasictimer.h" #include "private/qwidget_p.h" +#include + QT_BEGIN_NAMESPACE #ifndef QT_NO_MENU diff --git a/src/widgets/widgets/qmenubar.h b/src/widgets/widgets/qmenubar.h index 9818526543..c1272c45ce 100644 --- a/src/widgets/widgets/qmenubar.h +++ b/src/widgets/widgets/qmenubar.h @@ -54,6 +54,7 @@ QT_BEGIN_NAMESPACE class QMenuBarPrivate; class QStyleOptionMenuItem; class QWindowsStyle; +class QPlatformMenuBar; class Q_WIDGETS_EXPORT QMenuBar : public QWidget { -- cgit v1.2.3