From febeb2d9cd88e6ff2330c0e6b51ea50516b4333f Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Thu, 24 Oct 2013 11:36:32 +0200 Subject: [PATCH 001/494] Doc: Added iOS examples to manifest-meta.qdocconf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-33593 Change-Id: I7aaa1230d7ed6294ddd5a3db6466894522136393 Reviewed-by: Topi Reiniö Reviewed-by: Jerome Pasion --- doc/global/manifest-meta.qdocconf | 85 ++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/doc/global/manifest-meta.qdocconf b/doc/global/manifest-meta.qdocconf index 93cd7ddc555..d6d44ab340d 100644 --- a/doc/global/manifest-meta.qdocconf +++ b/doc/global/manifest-meta.qdocconf @@ -32,7 +32,7 @@ # manifestmeta.global.names = * # manifestmeta.global.tags = qt5 -manifestmeta.filters = highlighted webkit1 webkit2 android thumbnail +manifestmeta.filters = highlighted webkit1 webkit2 android thumbnail ios manifestmeta.highlighted.names = "QtQuick/Qt Quick Demo - Same Game" \ "QtQuick/Qt Quick Demo - Photo Surface" \ @@ -169,6 +169,89 @@ manifestmeta.android.names = "QtQuick/Qt Quick Demo - Maroon*" \ manifestmeta.android.tags = android +manifestmeta.ios.names = "QtCore/Contiguous Cache Example" \ + "QtCore/Mandelbrot Example" \ + "QtCore/Queued Custom Type Example" \ + "QtGui/Analog Clock Window Example" \ + "QtGui/OpenGL Window Example" \ + "QtGui/Raster Window Example" \ + "QtNetwork/Loopback Example" \ + "QtNetwork/Network Chat Example" \ + "QtNetwork/Torrent Example" \ + "QtOpenGL/2D Painting Example" \ + "QtOpenGL/Textures Example" \ + "QtWidgets/Animated Tiles Example" \ + "QtWidgets/Application Chooser Example" \ + "QtWidgets/Easing Curves Example" \ + "QtWidgets/Move Blocks Example" \ + "QtWidgets/States Example" \ + "QtWidgets/Class Wizard Example" \ + "QtWidgets/Find Files Example" \ + "QtWidgets/License Wizard Example" \ + "QtWidgets/Standard Dialogs Example" \ + "QtWidgets/Tab Dialog Example" \ + "QtWidgets/Trivial Wizard Example" \ + "QtWidgets/Draggable Text Example" \ + "QtWidgets/Fridge Magnets Example" \ + "QtWidgets/Blur Picker Effect Example" \ + "QtWidgets/Fade Message Effect Example" \ + "QtWidgets/Lighting Effect Example" \ + "QtWidgets/Anchor Layout Example" \ + "QtWidgets/Basic Graphics Layouts Example" \ + "QtWidgets/40000 Chips" \ + "QtWidgets/Colliding Mice Example" \ + "QtWidgets/Diagram Scene Example" \ + "QtWidgets/Elastic Nodes Example" \ + "QtWidgets/Embedded Dialogs" \ + "QtWidgets/Graphics View Flow Layout Example" \ + "QtWidgets/Simple Anchor Layout Example" \ + "QtWidgets/Weather Anchor Layout Example" \ + "QtWidgets/Address Book Example" \ + "QtWidgets/Basic Sort/Filter Model Example" \ + "QtWidgets/Chart Example" \ + "QtWidgets/Custom Sort/Filter Model Example" \ + "QtWidgets/Dir View Example" \ + "QtWidgets/Editable Tree Model Example" \ + "QtWidgets/Frozen Column Example" \ + "QtWidgets/Interview" \ + "QtWidgets/Simple Tree Model Example" \ + "QtWidgets/Simple Widget Mapper Example" \ + "QtWidgets/Basic Layouts Example" \ + "QtWidgets/Border Layout Example" \ + "QtWidgets/Flow Layout Example" \ + "QtWidgets/Basic Drawing Example" \ + "QtWidgets/Concentric Circles Example" \ + "QtWidgets/Font Sampler Example" \ + "QtWidgets/Gradients" \ + "QtWidgets/Image Composition Example" \ + "QtWidgets/Painter Paths Example" \ + "QtWidgets/Transformations Example" \ + "QtWidgets/Calendar Example" \ + "QtWidgets/Order Form Example" \ + "QtWidgets/Syntax Highlighter Example" \ + "QtWidgets/Text Edit" \ + "QtWidgets/Traffic Light Example" \ + "QtWidgets/Two-way Button Example" \ + "QtWidgets/Completer Example" \ + "QtWidgets/Custom Completer Example" \ + "QtWidgets/Undo Framework" \ + "QtWidgets/Analog Clock Example" \ + "QtWidgets/Calculator Example" \ + "QtWidgets/Calendar Widget Example" \ + "QtWidgets/Character Map Example" \ + "QtWidgets/Code Editor Example" \ + "QtWidgets/Digital Clock Example" \ + "QtWidgets/Elided Label Example" \ + "QtWidgets/Line Edits Example" \ + "QtWidgets/Scribble Example" \ + "QtWidgets/Shaped Clock Example" \ + "QtWidgets/Sliders Example" \ + "QtWidgets/Validators Example" \ + "QtWidgets/Wiggly Example" \ + "QtWidgets/Window Flags Example" + +manifestmeta.ios.tags = ios + # add a generic thumbnail image to examples that do not have any images in their documentation manifestmeta.thumbnail.attributes = "imageUrl:qthelp\://org.qt-project.qtdoc.$QT_VERSION_TAG/qtdoc/images/qt-codesample.png" From 9ae94806addcc9d736eafd01a5841fbc23f58728 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 24 Oct 2013 12:37:10 +0300 Subject: [PATCH 002/494] ANGLE: Fix fxc path setting for MSVC 2013. Change-Id: I7be4dbd948052d069bb1b97d759d6fc5099236f9 Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- src/angle/src/common/common.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri index a94b9a6fc37..e5b01d50519 100644 --- a/src/angle/src/common/common.pri +++ b/src/angle/src/common/common.pri @@ -7,7 +7,7 @@ INCLUDEPATH += \ LIBS = $$QMAKE_LIBS_CORE $$QMAKE_LIBS_GUI # DirectX is included in the Windows 8 Kit, but everything else requires the DX SDK. -win32-msvc2012 { +win32-msvc2012|win32-msvc2013 { FXC = fxc.exe } else { DX_DIR = $$(DXSDK_DIR) From b66a217a1c0517376a730c391c2c1bb45c7eb271 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 24 Oct 2013 12:49:59 +0300 Subject: [PATCH 003/494] ANGLE: Fix compilation with MSVC2013. Add missing include for std::min(), std::max(). Change-Id: I740e5db94f9f958ac65de8dd7baab7e203482637 Reviewed-by: Joerg Bornemann Reviewed-by: Oliver Wolff --- src/3rdparty/angle/src/libEGL/Surface.cpp | 2 ++ ...-ANGLE-Fix-compilation-with-MSVC2013.patch | 28 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/angle/patches/0001-ANGLE-Fix-compilation-with-MSVC2013.patch diff --git a/src/3rdparty/angle/src/libEGL/Surface.cpp b/src/3rdparty/angle/src/libEGL/Surface.cpp index b47a7bcc201..83fbbf5b071 100644 --- a/src/3rdparty/angle/src/libEGL/Surface.cpp +++ b/src/3rdparty/angle/src/libEGL/Surface.cpp @@ -20,6 +20,8 @@ #include "libEGL/main.h" #include "libEGL/Display.h" +#include + namespace egl { diff --git a/src/angle/patches/0001-ANGLE-Fix-compilation-with-MSVC2013.patch b/src/angle/patches/0001-ANGLE-Fix-compilation-with-MSVC2013.patch new file mode 100644 index 00000000000..cf32a20d460 --- /dev/null +++ b/src/angle/patches/0001-ANGLE-Fix-compilation-with-MSVC2013.patch @@ -0,0 +1,28 @@ +From 4863cf64cd332a5fcefe453634c3c5ef62cb758c Mon Sep 17 00:00:00 2001 +From: Friedemann Kleint +Date: Thu, 24 Oct 2013 12:49:59 +0300 +Subject: [PATCH] ANGLE: Fix compilation with MSVC2013. + +Add missing include for std::min(), std::max(). + +Change-Id: I740e5db94f9f958ac65de8dd7baab7e203482637 +--- + src/3rdparty/angle/src/libEGL/Surface.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/3rdparty/angle/src/libEGL/Surface.cpp b/src/3rdparty/angle/src/libEGL/Surface.cpp +index b47a7bc..83fbbf5 100644 +--- a/src/3rdparty/angle/src/libEGL/Surface.cpp ++++ b/src/3rdparty/angle/src/libEGL/Surface.cpp +@@ -20,6 +20,8 @@ + #include "libEGL/main.h" + #include "libEGL/Display.h" + ++#include ++ + namespace egl + { + +-- +1.8.3.msysgit.0 + From 363cebe6b197e228d9f4bbb37566c9a594c122d7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 21 Oct 2013 16:16:57 +0200 Subject: [PATCH 004/494] purge auto_use_privates module option it was introduced as a hack to simplify writing tests, but the change to make use of it was backed out of testlib and nobody seems to care. Change-Id: Icc86621b865276e86593afdb923247bbdca19d49 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt.prf | 2 +- mkspecs/features/qt_functions.prf | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index 04375d4ce19..d13b9bb8d5a 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -62,7 +62,7 @@ qaxserver { unset(using_privates) qtAddModules(QT, LIBS) qtAddModules(QT_PRIVATE, LIBS_PRIVATE) -!isEmpty(using_privates):!auto_use_privates:!no_private_qt_headers_warning:if(!debug_and_release|!build_pass) { +!isEmpty(using_privates):!no_private_qt_headers_warning:if(!debug_and_release|!build_pass) { message("This project is using private headers and will therefore be tied to this specific Qt module build version.") message("Running this project against other versions of the Qt modules may crash at any arbitrary point.") message("This is not a bug, but a result of using Qt internals. You have been warned!") diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index f1f7c00b9ec..4f4f4e00c00 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -61,7 +61,7 @@ defineTest(qtAddModule) { MODULE_CONFIG = $$eval(QT.$${1}.module_config) MODULE_MAJOR_VERSION = $$eval(QT.$${1}.MAJOR_VERSION) - contains(MODULE_CONFIG, internal_module):!if(auto_use_privates|isEqual(2, UsePrivate)): \ + contains(MODULE_CONFIG, internal_module):!isEqual(2, UsePrivate): \ error("Module $$1 has no public API.") qtProcessModuleFlags(CONFIG, QT.$${1}.CONFIG) @@ -77,7 +77,7 @@ defineTest(qtAddModule) { !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) { INCLUDEPATH *= $$FRAMEWORK_INCLUDE } - auto_use_privates|isEqual(2, UsePrivate): \ + isEqual(2, UsePrivate): \ INCLUDEPATH += \ $$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION) \ $$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION)/$$MODULE_NAME @@ -85,7 +85,7 @@ defineTest(qtAddModule) { LINKAGE += -framework $${MODULE_NAME}$${QT_LIBINFIX} } else { INCLUDEPATH *= $$MODULE_INCLUDES - auto_use_privates|isEqual(2, UsePrivate): \ + isEqual(2, UsePrivate): \ INCLUDEPATH += $$eval(QT.$${1}.private_includes) } @@ -147,7 +147,6 @@ defineTest(qtAddModules) { NEWQT += $$eval(QT.$${QTLIBRAW}.private_depends) } NEWQT += $$QTLIBRAW - contains(QT.$${QTLIBRAW}.CONFIG, auto_use_privates): CONFIG += auto_use_privates } # Topological resolution of modules based on their QT..depends variable $$1 = $$resolve_depends(NEWQT, "QT.") From c9ae85641775b5fd93648e95f13e982d5f9ca73f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 23 Oct 2013 13:59:39 +0200 Subject: [PATCH 005/494] document format of entries Change-Id: I94c169b03844a7091ab98a9689a19ef27e665509 Reviewed-by: Joerg Bornemann Reviewed-by: Tasuku Suzuki --- src/corelib/global/qfeatures.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index ec54c7bdbfe..44a4f8a33bc 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -1,3 +1,11 @@ +# Generic entry format +#Feature: UPPERCASENAME (for the #define) +#Description: One sentence description of what this does. +#Section: Categorization +#Requires: UPPERCASENAME... +#Name: CamelCaseName (often a class name) +#SeeAlso: UPPERCASENAME... (currently unused) + # Kernel Feature: PROPERTIES From 75454e84eabbf8ace89abe22fc19ff981f2ef07b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 23 Oct 2013 14:00:43 +0200 Subject: [PATCH 006/494] remove pointless "SeeAlso: ???" entries Change-Id: Iaca0a4f81720b3c20291e91a08fbb617b104330e Reviewed-by: Joerg Bornemann Reviewed-by: Tasuku Suzuki --- src/corelib/global/qfeatures.txt | 153 ------------------------------- 1 file changed, 153 deletions(-) diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index 44a4f8a33bc..4d07c798c8c 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -13,147 +13,126 @@ Description: Supports scripting Qt-based applications. Section: Kernel Requires: Name: Properties -SeeAlso: ??? Feature: TEXTHTMLPARSER Description: Parser for HTML Section: Kernel Requires: Name: HtmlParser -SeeAlso: ??? Feature: TEXTODFWRITER Description: Provides an ODF writer Section: Kernel Requires: XMLSTREAMWRITER Name: OdfWriter -SeeAlso: ??? Feature: CSSPARSER Description: Parser for Style Sheets Section: Kernel Requires: Name: CssParser -SeeAlso: ??? Feature: REGULAREXPRESSION Description: Perl-compatible regular expression APIs Section: Kernel Requires: Name: QRegularExpression -SeeAlso: ??? Feature: CONCURRENT Description: Provides a high-level multi-threaded APIs Section: Kernel Requires: Name: QtConcurrent -SeeAlso: ??? Feature: DRAGANDDROP Description: Supports the drag and drop mechansim. Section: Kernel Requires: IMAGEFORMAT_XPM Name: Drag and drop -SeeAlso: ??? Feature: SESSIONMANAGER Description: Supports session management. Section: Kernel Requires: Name: Session Manager -SeeAlso: ??? Feature: SHORTCUT Description: Supports keyboard accelerators and shortcuts. Section: Kernel Requires: Name: QShortcut -SeeAlso: ??? Feature: ACTION Description: Supports widget actions. Section: Kernel Requires: Name: QAction -SeeAlso: ??? Feature: CURSOR Description: Supports mouse cursors. Section: Kernel Requires: Name: QCursor -SeeAlso: ??? Feature: CLIPBOARD Description: Supports cut and paste operations. Section: Kernel Requires: Name: QClipboard -SeeAlso: ??? Feature: WHEELEVENT Description: Supports wheel events. Section: Kernel Requires: Name: QWheelEvent -SeeAlso: ??? Feature: TABLETEVENT Description: Supports tablet events. Section: Kernel Requires: Name: QTabletEvent -SeeAlso: ??? Feature: EFFECTS Description: Supports special widget effects (e.g. fading and scrolling). Section: Kernel Requires: Name: Effects -SeeAlso: ??? Feature: SHAREDMEMORY Description: Provides access to a shared memory segment. Section: Kernel Requires: Name: QSharedMemory -SeeAlso: ??? Feature: SYSTEMSEMAPHORE Description: Provides a general counting system semaphore. Section: Kernel Requires: Name: QSystemSemaphore -SeeAlso: ??? Feature: XMLSTREAM Description: Provides a simple streaming API for XML. Section: Kernel Requires: Name: -SeeAlso: ??? Feature: XMLSTREAMREADER Description: Provides a well-formed XML parser with a simple streaming API. Section: Kernel Requires: XMLSTREAM Name: QXmlStreamReader -SeeAlso: ??? Feature: XMLSTREAMWRITER Description: Provides a XML writer with a simple streaming API. Section: Kernel Requires: XMLSTREAM Name: QXmlStreamWriter -SeeAlso: ??? Feature: IM Description: Inputmethods with QInputContext Section: Kernel Requires: LIBRARY Name: QInputContext -SeeAlso: ??? # Data structures Feature: TEXTDATE @@ -161,14 +140,12 @@ Description: Supports month and day names in dates. Section: Data structures Requires: Name: Text Date -SeeAlso: ??? Feature: DATESTRING Description: Supports convertion between dates and strings. Section: Data structures Requires: TEXTDATE Name: QDate/QTime/QDateTime -SeeAlso: ??? # File I/O @@ -177,42 +154,36 @@ Description: Supports external process invocation. Section: File I/O Requires: Name: QProcess -SeeAlso: ??? Feature: TEMPORARYFILE Description: Provides an I/O device that operates on temporary files. Section: File I/O Requires: Name: QTemporaryFile -SeeAlso: ??? Feature: LIBRARY Description: Supports a shared library wrapper. Section: File I/O Requires: Name: QLibrary -SeeAlso: ??? Feature: SETTINGS Description: Supports persistent application settings. Section: File I/O Requires: Name: QSettings -SeeAlso: ??? Feature: DOM Description: Supports the Document Object Model. Section: File I/O Requires: Name: Document Object Model -SeeAlso: ??? Feature: FILESYSTEMMODEL Description: Provides a data model for the local filesystem. Section: File I/O Requires: Name: QFileSystemModel -SeeAlso: ??? Feature: FILESYSTEMWATCHER Description: Provides an interface for monitoring files and directories @@ -220,7 +191,6 @@ for modications. Section: File I/O Requires: Name: QFileSystemWatcher -SeeAlso: ??? Feature: FILESYSTEMITERATOR Description: Provides fast file-system iteration. @@ -228,7 +198,6 @@ for modications. Section: File I/O Requires: Name: QFileSystemIterator -SeeAlso: ??? # Widgets @@ -237,154 +206,132 @@ Description: Supports views using tree models. Section: Widgets Requires: TREEVIEW Name: QTreeWidget -SeeAlso: ??? Feature: LISTWIDGET Description: Supports item-based list widgets. Section: Widgets Requires: LISTVIEW Name: QListWidget -SeeAlso: ??? Feature: TABLEWIDGET Description: Supports item-based table views. Section: Widgets Requires: TABLEVIEW Name: QTableWidget -SeeAlso: ??? Feature: DATETIMEEDIT Description: Supports editing dates and times. Section: Widgets Requires: CALENDARWIDGET DATESTRING Name: QDateTimeEdit -SeeAlso: ??? Feature: STACKEDWIDGET Description: Supports stacked widgets. Section: Widgets Requires: Name: QStackedWidget -SeeAlso: ??? Feature: TEXTBROWSER Description: Supports HTML document browsing. Section: Widgets Requires: TEXTEDIT Name: QTextBrowser -SeeAlso: ??? Feature: SPLASHSCREEN Description: Supports splash screens that can be shown during application startup. Section: Widgets Requires: Name: Splash screen widget -SeeAlso: ??? Feature: SPLITTER Description: Supports user controlled splitter widgets. Section: Widgets Requires: RUBBERBAND Name: QSplitter -SeeAlso: ??? Feature: LCDNUMBER Description: Supports LCD-like digits. Section: Widgets Requires: Name: QLCDNumber -SeeAlso: ??? Feature: MENU Description: Supports popup-menus. Section: Widgets Requires: ACTION Name: QMenu -SeeAlso: ??? Feature: LINEEDIT Description: Supports single-line edits. Section: Widgets Requires: Name: QLineEdit -SeeAlso: ??? Feature: SPINBOX Description: Supports spin boxes handling integers and discrete sets of values. Section: Widgets Requires: SPINWIDGET LINEEDIT VALIDATOR Name: QSpinBox -SeeAlso: ??? Feature: TABBAR Description: Supports tab bars, e.g. for use in tabbed dialogs. Section: Widgets Requires: TOOLBUTTON Name: QTabBar -SeeAlso: ??? Feature: TABWIDGET Description: Supports stacking tabbed widgets. Section: Widgets Requires: TABBAR STACKEDWIDGET Name: QTabWidget -SeeAlso: ??? Feature: COMBOBOX Description: Supports comboboxes presenting a list of options to the user. Section: Widgets Requires: LINEEDIT STANDARDITEMMODEL LISTVIEW Name: QComboBox -SeeAlso: ??? Feature: FONTCOMBOBOX Description: Supports a combobox that lets the user select a font family. Section: Widgets Requires: COMBOBOX STRINGLISTMODEL Name: QFontComboBox -SeeAlso: ??? Feature: TOOLBUTTON Description: Supports quick-access buttons to commands and options. Section: Widgets Requires: ACTION Name: QToolButton -SeeAlso: ??? Feature: TOOLBAR Description: Supports movable panels containing a set of controls. Section: Widgets Requires: MAINWINDOW Name: QToolBar -SeeAlso: ??? Feature: TOOLBOX Description: Supports columns of tabbed widget items. Section: Widgets Requires: TOOLBUTTON SCROLLAREA Name: QToolBox -SeeAlso: ??? Feature: GROUPBOX Description: Supports group box frames. Section: Widgets Requires: Name: QGroupBox -SeeAlso: ??? Feature: BUTTONGROUP Description: Supports organizing groups of button widgets. Section: Widgets Requires: GROUPBOX Name: QButtonGroup -SeeAlso: ??? Feature: MAINWINDOW Description: Supports main application windows. Section: Widgets Requires: MENU RESIZEHANDLER TOOLBUTTON Name: QMainWindow -SeeAlso: ??? Feature: DOCKWIDGET Description: Supports docking widgets inside a QMainWindow or floated as @@ -392,56 +339,48 @@ a top-level window on the desktop. Section: Widgets Requires: RUBBERBAND MAINWINDOW Name: QDockwidget -SeeAlso: ??? Feature: MDIAREA Description: Provides an area in which MDI windows are displayed. Section: Widgets Requires: SCROLLAREA Name: QMdiArea -SeeAlso: ??? Feature: RESIZEHANDLER Description: Supports an internal resize handler. Section: Widgets Requires: Name: Resize Handler -SeeAlso: ??? Feature: STATUSBAR Description: Supports presentation of status information. Section: Widgets Requires: Name: QStatusBar -SeeAlso: ??? Feature: MENUBAR Description: Supports pull-down menu items. Section: Widgets Requires: MENU TOOLBUTTON Name: QMenuBar -SeeAlso: ??? Feature: CONTEXTMENU Description: Supports pop-up menus on right mouse click Section: Widgets Requires: MENU Name: Context menu -SeeeAlso: ??? Feature: PROGRESSBAR Description: Supports presentation of operation progress. Section: Widgets Requires: Name: QProgressBar -SeeAlso: ??? Feature: SLIDER Description: Supports sliders controlling a bounded value. Section: Widgets Requires: Name: QSlider -SeeAlso: ??? Feature: SCROLLBAR Description: Supports scrollbars allowing the user access parts of a @@ -449,98 +388,84 @@ document that is larger than the widget used to display it. Section: Widgets Requires: SLIDER Name: QScrollBar -SeeAlso: ??? Feature: DIAL Description: Supports rounded range control, e.g. like a speedometer. Section: Widgets Requires: SLIDER Name: QDial -SeeAlso: ??? Feature: SCROLLAREA Description: Supports scrolling views onto widgets. Section: Widgets Requires: SCROLLBAR Name: QScrollArea -SeeAlso: ??? Feature: GRAPHICSVIEW Description: Supports the graphicsview classes. Section: Widgets Requires: SCROLLAREA Name: QGraphicsView -SeeAlso: ??? Feature: GRAPHICSEFFECT Description: Supports the graphicseffect classes. Section: Widgets Requires: GRAPHICSVIEW Name: QGraphicsEffect -SeeAlso: ??? Feature: SPINWIDGET Description: Supports spinbox control widgets. Section: Widgets Requires: Name: Spin Widget -SeeAlso: ??? Feature: TEXTEDIT Description: Supports rich text editing. Section: Widgets Requires: SCROLLAREA PROPERTIES Name: QTextEdit -SeeAlso: ??? Feature: SYNTAXHIGHLIGHTER Description: Supports custom syntax highlighting. Section: Widgets Requires: TEXTEDIT Name: QSyntaxHighlighter -SeeAlso: ??? Feature: RUBBERBAND Description: Supports using rubberbands to indicate selections and boundaries. Section: Widgets Requires: Name: QRubberBand -SeeAlso: ??? Feature: TOOLTIP Description: Supports presentation of tooltips. Section: Widgets Requires: Name: QToolTip -SeeAlso: ??? Feature: STATUSTIP Description: Supports status tip functionality and events. Section: Widgets Requires: Name: Status Tip -SeeAlso: ??? Feature: WHATSTHIS Description: Supports displaying "What's this" help. Section: Widgets Requires: TOOLBUTTON Name: QWhatsThis -SeeAlso: ??? Feature: VALIDATOR Description: Supports validation of input text. Section: Widgets Requires: Name: QValidator -SeeAlso: ??? Feature: SIZEGRIP Description: Supports corner-grips for resizing a top-level windows. Section: Widgets Requires: Name: QSizeGrip -SeeAlso: ??? Feature: CALENDARWIDGET Description: Provides a monthly based calendar widget allowing the user to select @@ -548,7 +473,6 @@ a date. Section: Widgets Requires: TABLEVIEW MENU TEXTDATE SPINBOX TOOLBUTTON Name: QCalendarWidget -SeeAlso: ??? Feature: PRINTPREVIEWWIDGET Description: Provides a widget for previewing page layouts for printer output. @@ -556,7 +480,6 @@ a date. Section: Widgets Requires: GRAPHICSVIEW PRINTER MAINWINDOW Name: QPrintPreviewWidget -SeeAlso: ??? # Dialogs @@ -566,70 +489,60 @@ informative messages and simple questions. Section: Dialogs Requires: Name: QMessageBox -SeeAlso: ??? Feature: COLORDIALOG Description: Supports a dialog widget for specifying colors. Section: Dialogs Requires: SPINBOX Name: QColorDialog -SeeAlso: ??? Feature: FILEDIALOG Description: Supports a dialog widget for selecting files or directories. Section: Dialogs Requires: DIRMODEL TREEVIEW COMBOBOX TOOLBUTTON BUTTONGROUP TOOLTIP SPLITTER STACKEDWIDGET PROXYMODEL Name: QFileDialog -SeeAlso: ??? Feature: FONTDIALOG Description: Supports a dialog widget for selecting fonts. Section: Dialogs Requires: STRINGLISTMODEL COMBOBOX VALIDATOR GROUPBOX Name: QFontDialog -SeeAlso: ??? Feature: PRINTDIALOG Description: Supports a dialog widget for specifying printer configuration. Section: Dialogs Requires: PRINTER COMBOBOX BUTTONGROUP SPINBOX TREEVIEW TABWIDGET Name: QPrintDialog -SeeAlso: ??? Feature: PRINTPREVIEWDIALOG Description: Provides a dialog for previewing and configuring page layouts for printer output. Section: Dialogs Requires: PRINTPREVIEWWIDGET PRINTDIALOG TOOLBAR Name: QPrintPreviewDialog -SeeAlso: ??? Feature: PROGRESSDIALOG Description: Supports feedback on the progress of a slow operation. Section: Dialogs Requires: PROGRESSBAR Name: QProgressDialog -SeeAlso: ??? Feature: INPUTDIALOG Description: Supports a simple convenience dialog to get a single value from the user. Section: Dialogs Requires: COMBOBOX SPINBOX STACKEDWIDGET Name: QInputDialog -SeeAlso: ??? Feature: ERRORMESSAGE Description: Supports an error message display dialog. Section: Dialogs Requires: TEXTEDIT Name: QErrorMessage -SeeAlso: ??? Feature: WIZARD Description: Provides a framework for wizards. Section: Dialogs Requires: PROPERTIES Name: QWizard -SeeAlso: ??? # ItemViews @@ -639,28 +552,24 @@ between data and the way it is presented to the user. Section: ItemViews Requires: RUBBERBAND SCROLLAREA Name: The Model/View Framework -SeeAlso: ??? Feature: DIRMODEL Description: Supports a data model for the local filesystem. Section: ItemViews Requires: ITEMVIEWS FILESYSTEMMODEL Name: QDirModel -SeeAlso: ??? Feature: STANDARDITEMMODEL Description: Supports a generic model for storing custom data. Section: ItemViews Requires: ITEMVIEWS Name: QStandardItemModel -SeeAlso: ??? Feature: PROXYMODEL Description: Supports processing of data passed between another model and a view. Section: ItemViews Requires: ITEMVIEWS Name: QAbstractProxyModel -SeeAlso: ??? Feature: SORTFILTERPROXYMODEL Description: Supports sorting and filtering of data passed between @@ -668,56 +577,48 @@ another model and a view. Section: ItemViews Requires: PROXYMODEL Name: QSortFilterProxyModel -SeeAlso: ??? Feature: IDENTITYPROXYMODEL Description: Supports proxying a source model unmodified. Section: ItemViews Requires: PROXYMODEL Name: QIdentityProxyModel -SeeAlso: ??? Feature: STRINGLISTMODEL Description: Supports a model that supplies strings to views. Section: ItemViews Requires: ITEMVIEWS Name: QStringListModel -SeeAlso: ??? Feature: LISTVIEW Description: Supports a list or icon view onto a model. Section: ItemViews Requires: ITEMVIEWS Name: QListView -SeeAlso: ??? Feature: TABLEVIEW Description: Supports a default model/view implementation of a table view. Section: ItemViews Requires: ITEMVIEWS Name: QTableView -SeeAlso: ??? Feature: TREEVIEW Description: Supports a default model/view implementation of a tree view. Section: ItemViews Requires: ITEMVIEWS Name: QTreeView -SeeAlso: ??? Feature: DATAWIDGETMAPPER Description: Provides mapping between a section of a data model to widgets. Section: ItemViews Requires: ITEMVIEWS PROPERTIES Name: QDataWidgetMapper -SeeAlso: ??? Feature: COLUMNVIEW Description: Provides a model/view implementation of a column view. Section: ItemViews Requires: LISTVIEW Name: QColumnView -SeeAlso: ??? # Styles @@ -726,49 +627,42 @@ Description: Supports a Microsoft Windows-like look and feel. Section: Styles Requires: Name: QWindowsStyle -SeeAlso: ??? Feature: STYLE_FUSION Description: Supports a modern platform independent widget style. Section: Styles Requires: IMAGEFORMAT_XPM Name: QFusionStyle -SeeAlso: ??? Feature: STYLE_WINDOWSXP Description: Supports a Microsoft WindowsXP-like look and feel. Section: Styles Requires: STYLE_WINDOWS Name: QWindowsXPStyle -SeeAlso: ??? Feature: STYLE_WINDOWSVISTA Description: Supports a Microsoft WindowsVista-like look and feel. Section: Styles Requires: STYLE_WINDOWSXP Name: QWindowsVistaStyle -SeeAlso: ??? Feature: STYLE_WINDOWSCE Description: WindowsCE look and feel Section: Styles Requires: STYLE_WINDOWS IMAGEFORMAT_XPM Name: QWindowsCEStyle -SeeAlso: ??? Feature: STYLE_WINDOWSMOBILE Description: WindowsMobile look and feel Section: Styles Requires: STYLE_WINDOWS IMAGEFORMAT_XPM Name: QWindowsMobileStyle -SeeAlso: ??? Feature: STYLE_STYLESHEET Description: Section: Styles Requires: STYLE_WINDOWS PROPERTIES CSSPARSER Name: QStyleSheetStyle -SeeAlso: ??? # Images @@ -777,70 +671,60 @@ Description: Supports writing an image format plugin. Section: Images Requires: LIBRARY Name: QImageIOPlugin -SeeAlso: ??? Feature: MOVIE Description: Supports animated images. Section: Images Requires: Name: QMovie -SeeAlso: ??? Feature: IMAGEFORMAT_BMP Description: Supports Microsoft's Bitmap image file format. Section: Images Requires: Name: BMP Image Format -SeeAlso: ??? Feature: IMAGEFORMAT_PPM Description: Supports the Portable Pixmap image file format. Section: Images Requires: Name: PPM Image Format -SeeAlso: ??? Feature: IMAGEFORMAT_XBM Description: Supports the X11 Bitmap image file format. Section: Images Requires: Name: XBM Image Format -SeeAlso: ??? Feature: IMAGEFORMAT_XPM Description: Supports the X11 Pixmap image file format. Section: Images Requires: Name: XPM Image Format -SeeAlso: ??? Feature: IMAGEFORMAT_PNG Description: Supports the Portable Network Graphics image file format. Section: Images Requires: Name: PNG Image Format -SeeAlso: ??? Feature: IMAGEFORMAT_JPEG Description: Supports the Joint Photographic Experts Group image file format. Section: Images Requires: Name: JPEG Image Format -SeeAlso: ??? Feature: IMAGE_HEURISTIC_MASK Description: Supports creating a 1-bpp heuristic mask for images. Section: Images Requires: Name: QImage::createHeuristicMask() -SeeAlso: ??? Feature: IMAGE_TEXT Description: Supports image file text strings. Section: Images Requires: Name: Image Text -SeeAlso: ??? # Painting @@ -849,7 +733,6 @@ Description: Supports recording and replaying QPainter commands. Section: Painting Requires: Name: QPicture -SeeAlso: ??? Feature: COLORNAMES Description: Supports color names such as "red", used by QColor @@ -857,42 +740,36 @@ and by some HTML documents. Section: Painting Requires: Name: Color Names -SeeAlso: ??? Feature: PDF Description: Supports pdf format Section: Painting Requires: TEMPORARYFILE Name: QPdf -SeeAlso: ??? Feature: PRINTER Description: Supports printing Section: Painting Requires: PICTURE TEMPORARYFILE Name: QPrinter -SeeAlso: ??? Feature: CUPS Description Supports the Common UNIX Printing System Section: Painting Requires: PRINTER LIBRARY Name: Common UNIX Printing System -SeeAlso: ??? Feature: PAINTONSCREEN Description: Supports the Qt::WA_PaintOnScreen widget attribute. Section: Painting Requires: Name: Qt::WA_PaintOnScreen -SeeAlso: ??? Feature: PAINT_DEBUG Description: Debug painting with the environment variables QT_FLUSH_UPDATE and QT_FLUSH_PAINT Section: Painting Requires: Name: Painting Debug Utilities -SeeAlso: ??? # Fonts @@ -901,7 +778,6 @@ Description: Supports the FreeType 2 font engine (and its supported font formats Section: Fonts Requires: Name: Freetype Font Engine -SeeAlso: ??? # Internationalization @@ -910,42 +786,36 @@ Description: Supports translations using QObject::tr(). Section: Internationalization Requires: Name: Translation -SeeAlso: ??? Feature: TRANSLATION_UTF8 Description: Supports translations using QObject::trUtf8(). Section: Internationalization Requires: TRANSLATION TEXTCODEC Name: Translation (UTF-8 representation) -SeeAlso: ??? Feature: TEXTCODEC Description: Supports conversions between text encodings. Section: Internationalization Requires: Name: QTextCodec -SeeAlso: ??? Feature: CODECS Description: Supports non-unicode text conversions. Section: Internationalization Requires: TEXTCODEC Name: Codecs -SeeAlso: ??? Feature: BIG_CODECS Description: Supports big codecs, e.g. CJK. Section: Internationalization Requires: TEXTCODEC Name: Big Codecs -SeeAlso: ??? Feature: ICONV Description: Supports conversions between text encodings using iconv. Section: Internationalization Requires: TEXTCODEC Name: iconv -SeeAlso: ??? # Networking @@ -954,70 +824,60 @@ Description: Supports host name lookups. Section: Networking Requires: Name: QHostInfo -SeeAlso: ??? Feature: FTP Description: Supports FTP file access. Section: Networking Requires: TEXTDATE Name: File Transfer Protocol -SeeAlso: ??? Feature: HTTP Description: Supports HTTP file access. Section: Networking Requires: HOSTINFO Name: Hyper Text Transfer Protocol -SeeAlso: ??? Feature: UDPSOCKET Description: Supports User Datagram Protocol sockets. Section: Networking Requires: Name: QUdpSocket -SeeAlso: ??? Feature: NETWORKPROXY Description: Supports configuring network layer proxy support to the Qt network classes. Section: Networking Requires: Name: QNetworkProxy -SeeAlso: ??? Feature: SOCKS5 Description: Supports SOCKS v5 network proxy. Section: Networking Requires: NETWORKPROXY Name: SOCKS5 -SeeAlso: ??? Feature: NETWORKINTERFACE Description: Supports listing the host's IP addresses and network interfaces Section: Networking Requires: Name: QNetworkInterface -SeeAlso: ??? Feature: NETWORKDISKCACHE Description: Supports a disk cache for network resources Section: Networking Requires: TEMPORARYFILE Name: QNetworkDiskCache -SeeAlso: ??? Feature: BEARERMANAGEMENT Description: Provides bearer management support Section: Networking Requires: LIBRARY NETWORKINTERFACE PROPERTIES Name: Bearer Management -SeeAlso: ??? Feature: LOCALSERVER Description: Supports a local socket based server Section: Networking Requires: TEMPORARYFILE Name: QLocalServer -SeeAlso: ??? # Utilities @@ -1026,84 +886,72 @@ Description: Provides completions based on an item model. Section: Utilities Requires: PROXYMODEL Name: QCompleter -SeeAlso: ??? Feature: FSCOMPLETER Description: Provides completions based on an item model. Section: Utilities Requires: FILESYSTEMMODEL COMPLETER Name: QCompleter -SeeAlso: ??? Feature: DESKTOPSERVICES Description: Provides methods for accessing common desktop services. Section: Utilities Requires: Name: QDesktopServices -SeeAlso: ??? Feature: SYSTEMTRAYICON Description: Provides an icon for an application in the system tray. Section: Utilities Requires: Name: QSystemTrayIcon -SeeAlso: ??? Feature: UNDOCOMMAND Description: Applies (redo or) undo of a single change in a document. Section: Utilities Requires: Name: QUndoCommand -SeeAlso: ??? Feature: UNDOSTACK Description: Provides the ability to (redo or) undo a list of changes in a document. Section: Utilities Requires: UNDOCOMMAND Name: QUndoStack -SeeAlso: ??? Feature: UNDOGROUP Description: Section: Utilities Requires: UNDOSTACK Name: QUndoGroup -SeeAlso: ??? Feature: UNDOVIEW Description: A widget which shows the contents of an undo stack. Section: Utilities Requires: UNDOSTACK LISTVIEW Name: QUndoView -SeeAlso: ??? Feature: ACCESSIBILITY Description: Provides accessibility support. Section: Utilities Requires: PROPERTIES MENUBAR Name: Accessibility -SeeAlso: ??? Feature: ANIMATION Description: Provides a framework for animations. Section: Utilities Requires: PROPERTIES Name: Animation -SeeAlso: ??? Feature: STATEMACHINE Description: Provides hierarchical finite state machines. Section: Utilities Requires: PROPERTIES Name: State machine -SeeAlso: ??? Feature: GESTURES Description: Provides a framework for gestures. Section: Utilities Requires: Name: Gesture -SeeAlso: ??? # D-Bus @@ -1112,5 +960,4 @@ Description: Provides classes for D-Bus. Section: D-Bus Requires: PROPERTIES XMLSTREAMREADER Name: Qt D-Bus module -SeeAlso: ??? From e658f70b852c4c618e330a06a45670d0d342ff6b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 23 Oct 2013 15:08:26 +0200 Subject: [PATCH 007/494] don't explicitly exclude qconfig.h when building moc it excludes itself for bootstrapped builds. Change-Id: I22fa969c47ff69eab8c96bf0917b0859c65b2fd9 Reviewed-by: Joerg Bornemann --- src/corelib/global/qglobal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index d7253c39c62..1d19a6cf6fe 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -55,7 +55,7 @@ */ #define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) -#if !defined(QT_BUILD_MOC) && !defined(QT_BUILD_QMAKE) && !defined(QT_BUILD_CONFIGURE) +#if !defined(QT_BUILD_QMAKE) && !defined(QT_BUILD_CONFIGURE) #include #endif From c584f3d9a8e9dec113d9036729a6fbee77d4976f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 24 Oct 2013 13:15:17 +0200 Subject: [PATCH 008/494] Fix check for ICU on MinGW Newer ICU versions do not generate a .lib file any more ... Also the check doesn't take e.g. static debug builds into account. Instead of trying to enumerate all possible variations, just rely on the header check. That's what we're doing for the other libs, too. Change-Id: Idc0527f0e8ad90f298337d4ab635c7aa6a35c351 Reviewed-by: Jonathan Liu Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index c3382a5e0a8..15c35a630fe 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2103,9 +2103,7 @@ bool Configure::checkAvailability(const QString &part) available = findFile("pcre.h"); else if (part == "ICU") - available = findFile("unicode/utypes.h") && findFile("unicode/ucol.h") && findFile("unicode/ustring.h") - && (findFile("icuin.lib") || findFile("sicuin.lib") - || findFile("libicuin.lib") || findFile("libsicuin.lib")); // "lib" prefix for mingw, 's' prefix for static + available = findFile("unicode/utypes.h") && findFile("unicode/ucol.h") && findFile("unicode/ustring.h"); else if (part == "ANGLE") { available = checkAngleAvailability(); From 1cdbe4752bef972db5471e811e9a781749cd0380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 23 Oct 2013 14:02:59 +0200 Subject: [PATCH 009/494] qmake: Expose qmake arguments as QMAKE_ARGS Allows project files or mkspecs to call qmake recursively using system() with the right arguments, which we use to fix the ios default_post.prf. Change-Id: I90d69e2b156bb0f0af1279188b11f81c84c24fb8 Reviewed-by: Oswald Buddenhagen --- mkspecs/macx-ios-clang/features/default_post.prf | 6 +++++- qmake/generators/makefile.cpp | 2 +- qmake/library/qmakeevaluator.cpp | 2 ++ qmake/library/qmakeglobals.h | 1 + qmake/option.cpp | 3 +-- qmake/option.h | 1 - 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf index 0d38c058c91..5121de1d127 100644 --- a/mkspecs/macx-ios-clang/features/default_post.prf +++ b/mkspecs/macx-ios-clang/features/default_post.prf @@ -27,7 +27,11 @@ equals(TEMPLATE, app) { TARGET_XCODE_PROJECT_DIR = $${TARGET}.xcodeproj - system("cd $$system_quote($$OUT_PWD) && $${QMAKE_QMAKE} $$system_quote($$_PRO_FILE_) -spec macx-xcode") + args = + for(arg, QMAKE_ARGS): \ + args += $$system_quote($$arg) + + system("cd $$system_quote($$OUT_PWD) && $$QMAKE_QMAKE $$args $$system_quote($$_PRO_FILE_) -spec macx-xcode") # We use xcodebuild to do the actual build, but filter out the verbose # output that shows all environment variables for each build step. diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 9ebaf608434..f567b6c6942 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2261,7 +2261,7 @@ QString MakefileGenerator::buildArgs() { QString ret; - foreach (const QString &arg, Option::qmake_args) + foreach (const QString &arg, Option::globals->qmake_args) ret += " " + escapeFilePath(arg); return ret; } diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index c4dca129005..703c13a61a9 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -982,6 +982,8 @@ void QMakeEvaluator::loadDefaults() vars[ProKey("_DATE_")] << ProString(QDateTime::currentDateTime().toString()); if (!m_option->qmake_abslocation.isEmpty()) vars[ProKey("QMAKE_QMAKE")] << ProString(m_option->qmake_abslocation); + if (!m_option->qmake_args.isEmpty()) + vars[ProKey("QMAKE_ARGS")] = ProStringList(m_option->qmake_args); #if defined(Q_OS_WIN32) vars[ProKey("QMAKE_HOST.os")] << ProString("Windows"); diff --git a/qmake/library/qmakeglobals.h b/qmake/library/qmakeglobals.h index b305b495bca..e9ba95b5a3c 100644 --- a/qmake/library/qmakeglobals.h +++ b/qmake/library/qmakeglobals.h @@ -117,6 +117,7 @@ public: QProcessEnvironment environment; #endif QString qmake_abslocation; + QStringList qmake_args; QString qmakespec, xqmakespec; QString user_template, user_template_prefix; diff --git a/qmake/option.cpp b/qmake/option.cpp index da52542a7df..86d55835f87 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -82,7 +82,6 @@ char Option::field_sep; Option::QMAKE_MODE Option::qmake_mode = Option::QMAKE_GENERATE_NOTHING; //all modes -QStringList Option::qmake_args; int Option::warn_level = WarnLogic | WarnDeprecated; int Option::debug_level = 0; QFile Option::output; @@ -436,7 +435,7 @@ Option::init(int argc, char **argv) return ret; //return ret == QMAKE_CMDLINE_SHOW_USAGE ? usage(argv[0]) : false; } - Option::qmake_args = args; + globals->qmake_args = args; } globals->commitCommandLineArguments(cmdstate); globals->debugLevel = Option::debug_level; diff --git a/qmake/option.h b/qmake/option.h index af8e3b7ab84..d0436fe844b 100644 --- a/qmake/option.h +++ b/qmake/option.h @@ -178,7 +178,6 @@ struct Option static QMAKE_MODE qmake_mode; //all modes - static QStringList qmake_args; static QFile output; static QString output_dir; static int debug_level; From c0e826e244632d340d4bd4892ba450d19a70fca2 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 24 Oct 2013 15:14:59 +0200 Subject: [PATCH 010/494] Set PRIVATE includes variable to empty, not undefined. This is necessary so that list(REMOVE_DUPLICATES) works properly. Change-Id: Id268637d76b1a8785c9ff0c6e09e9ad8a62bbfb6 Reviewed-by: Stephen Kelly --- mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index 0cdaafee7fb..296ea2cd3b5 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -95,7 +95,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\" ) !!ELSE - set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS) + set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\") !!ENDIF !!ELSE !!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE) @@ -106,7 +106,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\" ) !!ELSE - set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS) + set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\") !!ENDIF !!ELSE set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_INCLUDE_DIR}Qt$${CMAKE_MODULE_NAME}\") @@ -116,7 +116,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) \"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\" ) !!ELSE - set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS) + set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\") !!ENDIF !!ENDIF !!ENDIF @@ -124,8 +124,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) include(\"${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake\" OPTIONAL) !!ENDIF !!ELSE - set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS) - set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS) + set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"\") + set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\") !!ENDIF foreach(_dir ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS}) From 3a7025ffacec188f4f6d0f6bc44a021ce6fdd3db Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 24 Oct 2013 15:17:33 +0200 Subject: [PATCH 011/494] CMake: Ensure that the EXECUTABLE_COMPILE_FLAGS list exists This is needed to ensure that list(REMOVE_DUPLICATES) can work. Change-Id: I3d992aa244fcdfbda7e3b48ce416e0ba5ffcde96 Reviewed-by: Stephen Kelly --- mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index 296ea2cd3b5..dce981e059f 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -163,6 +163,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) set(_Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT EXACT) endif() + set(Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS \"\") + foreach(_module_dep ${_Qt5$${CMAKE_MODULE_NAME}_MODULE_DEPENDENCIES}) if (NOT Qt5${_module_dep}_FOUND) find_package(Qt5${_module_dep} @@ -188,9 +190,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME}) list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS) list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS) list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS) - if (Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS) - list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS) - endif() + list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS) set(_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES \"$${CMAKE_QT5_MODULE_DEPS}\") From dff6d73d6c37c40790d90bfdf3cb2f6e75c5bfa4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 24 Oct 2013 15:05:34 +0200 Subject: [PATCH 012/494] Introduce Windows version 8.1 and detect by checking the version. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I04012218c34f7a95a87fcf2dc7fc095f0e743e67 Reviewed-by: Joerg Bornemann Reviewed-by: Oliver Wolff Reviewed-by: Andrew Knight Reviewed-by: Björn Breitmeyer --- src/corelib/global/qglobal.cpp | 40 +++++++++++++++++++++++++++++++--- src/corelib/global/qsysinfo.h | 2 ++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 1dd77c5859c..51cf91a77de 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1018,6 +1018,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \value WV_VISTA Windows Vista, Windows Server 2008 (operating system version 6.0) \value WV_WINDOWS7 Windows 7, Windows Server 2008 R2 (operating system version 6.1) \value WV_WINDOWS8 Windows 8 (operating system version 6.2) + \value WV_WINDOWS8_1 Windows 8.1 (operating system version 6.3), introduced in Qt 5.2 Alternatively, you may use the following macros which correspond directly to the Windows operating system version number: @@ -1028,6 +1029,7 @@ bool qSharedBuild() Q_DECL_NOTHROW \value WV_6_0 Operating system version 6.0, corresponds to Windows Vista and Windows Server 2008 \value WV_6_1 Operating system version 6.1, corresponds to Windows 7 and Windows Server 2008 R2 \value WV_6_2 Operating system version 6.2, corresponds to Windows 8 + \value WV_6_3 Operating system version 6.3, corresponds to Windows 8.1, introduced in Qt 5.2 CE-based versions: @@ -1744,6 +1746,38 @@ QT_BEGIN_INCLUDE_NAMESPACE #include "qt_windows.h" QT_END_INCLUDE_NAMESPACE +#ifndef Q_OS_WINRT +static inline OSVERSIONINFO winOsVersion() +{ + OSVERSIONINFO result = { sizeof(OSVERSIONINFO), 0, 0, 0, 0, {'\0'}}; + // GetVersionEx() has been deprecated in Windows 8.1 and will return + // only Windows 8 from that version on. +# if defined(_MSC_VER) && _MSC_VER >= 1800 +# pragma warning( push ) +# pragma warning( disable : 4996 ) +# endif + GetVersionEx(&result); +# if defined(_MSC_VER) && _MSC_VER >= 1800 +# pragma warning( pop ) +# endif +# ifndef Q_OS_WINCE + if (result.dwMajorVersion == 6 && result.dwMinorVersion == 2) { + // This could be Windows 8.1 or higher. Note that as of Windows 9, + // the major version needs to be checked as well. + DWORDLONG conditionMask = 0; + VER_SET_CONDITION(conditionMask, VER_MAJORVERSION, VER_GREATER_EQUAL); + VER_SET_CONDITION(conditionMask, VER_MINORVERSION, VER_GREATER_EQUAL); + VER_SET_CONDITION(conditionMask, VER_PLATFORMID, VER_EQUAL); + OSVERSIONINFOEX checkVersion = { sizeof(OSVERSIONINFOEX), result.dwMajorVersion, result.dwMinorVersion, + result.dwBuildNumber, result.dwPlatformId, {'\0'}, 0, 0, 0, 0, 0 }; + for ( ; VerifyVersionInfo(&checkVersion, VER_MAJORVERSION | VER_MINORVERSION | VER_PLATFORMID, conditionMask); ++checkVersion.dwMinorVersion) + result.dwMinorVersion = checkVersion.dwMinorVersion; + } +# endif // !Q_OS_WINCE + return result; +} +#endif // !Q_OS_WINRT + QSysInfo::WinVersion QSysInfo::windowsVersion() { #ifndef VER_PLATFORM_WIN32s @@ -1766,9 +1800,7 @@ QSysInfo::WinVersion QSysInfo::windowsVersion() winver = QSysInfo::WV_WINDOWS8; #else winver = QSysInfo::WV_NT; - OSVERSIONINFO osver; - osver.dwOSVersionInfoSize = sizeof(osver); - GetVersionEx(&osver); + const OSVERSIONINFO osver = winOsVersion(); #ifdef Q_OS_WINCE DWORD qt_cever = 0; qt_cever = osver.dwMajorVersion * 100; @@ -1814,6 +1846,8 @@ QSysInfo::WinVersion QSysInfo::windowsVersion() winver = QSysInfo::WV_WINDOWS7; } else if (osver.dwMajorVersion == 6 && osver.dwMinorVersion == 2) { winver = QSysInfo::WV_WINDOWS8; + } else if (osver.dwMajorVersion == 6 && osver.dwMinorVersion == 3) { + winver = QSysInfo::WV_WINDOWS8_1; } else { qWarning("Qt: Untested Windows version %d.%d detected!", int(osver.dwMajorVersion), int(osver.dwMinorVersion)); diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h index a6accdfebc8..bd76f908e7f 100644 --- a/src/corelib/global/qsysinfo.h +++ b/src/corelib/global/qsysinfo.h @@ -96,6 +96,7 @@ public: WV_VISTA = 0x0080, WV_WINDOWS7 = 0x0090, WV_WINDOWS8 = 0x00a0, + WV_WINDOWS8_1 = 0x00b0, WV_NT_based = 0x00f0, /* version numbers */ @@ -106,6 +107,7 @@ public: WV_6_0 = WV_VISTA, WV_6_1 = WV_WINDOWS7, WV_6_2 = WV_WINDOWS8, + WV_6_3 = WV_WINDOWS8_1, WV_CE = 0x0100, WV_CENET = 0x0200, From 16f4bc5b63c3944846ca17314adeea1bdfed566c Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 21 Oct 2013 21:05:35 +0200 Subject: [PATCH 013/494] rewrite handling of private modules instead of being magic attributes of the main modules, the privates are now proper modules of their own. this cleans up some code paths, is more mappable to other build tools, and enables private modules to depend on other private modules. note that the library path is needed even in the "empty" private modules, as in the framework case that's where headers are found. consequently, the modules need to be explicitly marked with the new "no_link" flag. this required some reorganization of qtAddModule(). Change-Id: I8e4f44a609f8d639cc01bcb658256870a627eb63 Reviewed-by: Joerg Bornemann --- mkspecs/features/create_cmake.prf | 2 +- mkspecs/features/qt_functions.prf | 128 ++++++++++++++-------------- mkspecs/features/qt_installs.prf | 7 +- mkspecs/features/qt_module.prf | 11 ++- mkspecs/features/qt_module_pris.prf | 122 ++++++++++++++------------ mkspecs/features/qt_tool.prf | 2 +- 6 files changed, 146 insertions(+), 126 deletions(-) diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index 4643c3915ca..2f61df761ad 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -51,7 +51,7 @@ contains(CMAKE_INCLUDE_DIR, "^\\.\\./.*") { CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True } -!exists($$first(QT.$${MODULE}.private_includes)): CMAKE_NO_PRIVATE_INCLUDES = true +!exists($$first(QT.$${MODULE}_private.includes)): CMAKE_NO_PRIVATE_INCLUDES = true CMAKE_LIB_DIR = $$cmakeRelativePath($$[QT_INSTALL_LIBS], $$[QT_INSTALL_PREFIX]) contains(CMAKE_LIB_DIR,"^\\.\\./.*") { diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 4f4f4e00c00..86b1ad43145 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -28,7 +28,7 @@ defineTest(qtAddLibrary) { # Reverse-engineer the module name from the library name. for(var, QT_MODULES) { isEqual(QT.$${var}.name, $$1) { - qtAddModule($$var, , LIBS) + qtAddModule($$var, LIBS) return(true) } } @@ -53,7 +53,7 @@ defineTest(qtHaveModule) { return(false) } -# qt module, UsePrivate flag, libs variable +# qt module, libs variable defineTest(qtAddModule) { MODULE_NAME = $$eval(QT.$${1}.name) MODULE_INCLUDES = $$eval(QT.$${1}.includes) @@ -61,8 +61,10 @@ defineTest(qtAddModule) { MODULE_CONFIG = $$eval(QT.$${1}.module_config) MODULE_MAJOR_VERSION = $$eval(QT.$${1}.MAJOR_VERSION) - contains(MODULE_CONFIG, internal_module):!isEqual(2, UsePrivate): \ - error("Module $$1 has no public API.") + contains(MODULE_CONFIG, internal_module) { + using_privates = true + export(using_privates) + } qtProcessModuleFlags(CONFIG, QT.$${1}.CONFIG) qtProcessModuleFlags(DEFINES, QT.$${1}.DEFINES) @@ -77,79 +79,75 @@ defineTest(qtAddModule) { !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) { INCLUDEPATH *= $$FRAMEWORK_INCLUDE } - isEqual(2, UsePrivate): \ + contains(MODULE_CONFIG, internal_module): \ INCLUDEPATH += \ $$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION) \ $$FRAMEWORK_INCLUDE/$$eval(QT.$${1}.VERSION)/$$MODULE_NAME QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS} - LINKAGE += -framework $${MODULE_NAME}$${QT_LIBINFIX} + export(QMAKE_FRAMEWORKPATH) + !contains(MODULE_CONFIG, no_link): \ + LINKAGE += -framework $${MODULE_NAME}$${QT_LIBINFIX} } else { INCLUDEPATH *= $$MODULE_INCLUDES - isEqual(2, UsePrivate): \ - INCLUDEPATH += $$eval(QT.$${1}.private_includes) } + export(INCLUDEPATH) - # Re-insert the major version in the library name (cf qtLibraryTarget above) - # unless it's a framework build - !mac|!contains(MODULE_CONFIG, lib_bundle): \ - MODULE_NAME ~= s,^Qt,Qt$$MODULE_MAJOR_VERSION, - - win32 { - # Make sure the version number isn't appended again to the lib name - ver_var = QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}_VERSION_OVERRIDE - dver_var = QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}D_VERSION_OVERRIDE - $$ver_var = 0 - $$dver_var = 0 - export($$ver_var) - export($$dver_var) - } - - isEmpty(LINKAGE) { - !isEmpty(MODULE_LIBS_ADD): LINKAGE = -L$$MODULE_LIBS_ADD - lib = $${MODULE_NAME}$${QT_LIBINFIX}$$qtPlatformTargetSuffix() - LINKAGE += -l$$lib - - contains(QT_CONFIG, rpath): QMAKE_RPATHDIR *= $$eval(QT.$${1}.rpath) - - contains(MODULE_CONFIG, staticlib): \ - PRE_TARGETDEPS *= $$MODULE_LIBS/$${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB} - } # Only link to this module if a libs directory is set, else this is just a module # to give access to sources or include files, and not for linking. - !isEmpty(MODULE_LIBS) { - !isEmpty(QMAKE_LSB) { - !isEmpty(MODULE_LIBS_ADD): QMAKE_LFLAGS *= --lsb-libpath=$$MODULE_LIBS_ADD - QMAKE_LIBDIR *= /opt/lsb/lib - QMAKE_LFLAGS *= --lsb-shared-libs=$${MODULE_NAME}$${QT_LIBINFIX} + !isEmpty(MODULE_LIBS):!contains(MODULE_CONFIG, no_link) { + + # Re-insert the major version in the library name (cf qtLibraryTarget above) + # unless it's a framework build + !mac|!contains(MODULE_CONFIG, lib_bundle): \ + MODULE_NAME ~= s,^Qt,Qt$$MODULE_MAJOR_VERSION, + + win32 { + # Make sure the version number isn't appended again to the lib name + ver_var = QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}_VERSION_OVERRIDE + dver_var = QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}D_VERSION_OVERRIDE + $$ver_var = 0 + $$dver_var = 0 + export($$ver_var) + export($$dver_var) + } + + isEmpty(LINKAGE) { + !isEmpty(MODULE_LIBS_ADD): \ + LINKAGE = -L$$MODULE_LIBS_ADD + lib = $${MODULE_NAME}$${QT_LIBINFIX}$$qtPlatformTargetSuffix() + LINKAGE += -l$$lib + + contains(QT_CONFIG, rpath) { + QMAKE_RPATHDIR *= $$eval(QT.$${1}.rpath) + export(QMAKE_RPATHDIR) + } + + contains(MODULE_CONFIG, staticlib) { + PRE_TARGETDEPS *= $$MODULE_LIBS/$${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB} + export(PRE_TARGETDEPS) + } + } + + $$2 += $$LINKAGE + export($$2) + + !isEmpty(QMAKE_LSB) { + !isEmpty(MODULE_LIBS_ADD): \ + QMAKE_LFLAGS *= --lsb-libpath=$$MODULE_LIBS_ADD + QMAKE_LFLAGS *= --lsb-shared-libs=$${MODULE_NAME}$${QT_LIBINFIX} + QMAKE_LIBDIR *= /opt/lsb/lib + export(QMAKE_LFLAGS) + export(QMAKE_LIBDIR) } - $$3 += $$LINKAGE } - export($$3) - export(INCLUDEPATH) - export(QMAKE_FRAMEWORKPATH) - export(QMAKE_LFLAGS) - export(QMAKE_LIBDIR) - export(QMAKE_RPATHDIR) - export(QMAKE_RPATHLINKDIR) - export(PRE_TARGETDEPS) } # qt variable, libs variable defineTest(qtAddModules) { - # Figure out from which modules we're wanting to use the private headers - NEWQT = - for(QTLIB, $$1) { - QTLIBRAW = $$replace(QTLIB, -private$, ) - !isEqual(QTLIBRAW, $$QTLIB) { - want_var = QT.$${QTLIBRAW}.want_private - $$want_var = UsePrivate - using_privates = true - NEWQT += $$eval(QT.$${QTLIBRAW}.private_depends) - } - NEWQT += $$QTLIBRAW - } + # qmake variables cannot contain dashes, so normalize the names first + $$1 = $$replace($$1, -private$, _private) # Topological resolution of modules based on their QT..depends variable - $$1 = $$resolve_depends(NEWQT, "QT.") + $$1 = $$resolve_depends($$1, "QT.") # Finally actually add the modules unset(BAD_QT) for(QTLIB, $$1) { @@ -164,11 +162,9 @@ defineTest(qtAddModules) { next() } - qtAddModule($$QTLIB, $$eval(QT.$${QTLIB}.want_private), $$2) + qtAddModule($$QTLIB, $$2) } - !isEmpty(BAD_QT):error("Unknown module(s) in $$1: $$BAD_QT") - - export(using_privates) + !isEmpty(BAD_QT):error("Unknown module(s) in $$1: $$replace(BAD_QT, _private$, -private)") } defineTest(qtAddRpathLink) { @@ -177,7 +173,7 @@ defineTest(qtAddRpathLink) { # This means that paths of direct dependencies (QT & QT_PRIVATE) # don't need to appear here. However, their private dependencies' # paths OTOH need to be put there. - pubqt = $$replace(1, -private$, ) + pubqt = $$replace(1, -private$, _private) pubdep = $$resolve_depends(pubqt, "QT.") privdep = $$resolve_depends(pubqt, "QT.", ".depends" ".private_depends" ".run_depends") privdep -= $$pubdep @@ -245,7 +241,7 @@ defineTest(qtAddToolEnv) { # target variable, dependency var name, [non-empty: prepare for system(), not make] defineTest(qtAddTargetEnv) { - deps = $$replace($$2, -private$, ) + deps = $$replace($$2, -private$, _private) deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends") !isEmpty(deps) { for(dep, deps) { diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf index e82b4990093..7cacca99350 100644 --- a/mkspecs/features/qt_installs.prf +++ b/mkspecs/features/qt_installs.prf @@ -50,7 +50,12 @@ qt_install_module { pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules pritarget.files = $$MODULE_PRI INSTALLS += pritarget - } else { + } else: isEmpty(MODULE_PRIVATE_PRI) { warning("Project $$basename(_PRO_FILE_) is a module, but has not defined MODULE_PRI, which is required for Qt to expose the module to other projects.") } + !isEmpty(MODULE_PRIVATE_PRI) { + privpritarget.path = $$[QT_HOST_DATA]/mkspecs/modules + privpritarget.files = $$MODULE_PRIVATE_PRI + INSTALLS += privpritarget + } } diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf index b614112fd7a..1bada0722c4 100644 --- a/mkspecs/features/qt_module.prf +++ b/mkspecs/features/qt_module.prf @@ -44,7 +44,10 @@ ucmodule = $$upper($$MODULE) isEmpty(MODULE_INCNAME): MODULE_INCNAME = $$TARGET -MODULE_DEPENDS = $$replace(QT, -private$, ) +internal_module: \ + MODULE_DEPENDS = $$replace(QT, -private$, _private) +else: \ + MODULE_DEPENDS = $$replace(QT, -private$, ) MODULE_DEPENDS = $$unique(MODULE_DEPENDS) contains(TARGET, QtAddOn.*): \ @@ -55,14 +58,14 @@ MODULE_DEFINES = $$MODULE_DEFINE $$MODULE_DEFINES load(qt_module_pris) -INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}.private_includes) +INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}_private.includes) !no_module_headers: load(qt_module_headers) #other TEMPLATE = lib -DESTDIR = $$eval(QT.$${MODULE}.libs) -win32:!wince*:!prefix_build: DLLDESTDIR = $$eval(QT.$${MODULE}.bins) +DESTDIR = $$eval(QT.$${MODULE_ID}.libs) +win32:!wince*:!prefix_build: DLLDESTDIR = $$eval(QT.$${MODULE_ID}.bins) CONFIG += qmake_cache target_qt diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 90e52885249..2e57f498e31 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -19,11 +19,25 @@ load(qt_build_paths) CONFIG += split_incpath force_independent|split_incpath: \ CONFIG += need_fwd_pri -MODULE_FWD_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_lib_$${MODULE}.pri +mod_work_pfx = $$MODULE_QMAKE_OUTDIR/mkspecs/modules need_fwd_pri: \ - MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst/qt_lib_$${MODULE}.pri + mod_inst_pfx = $$MODULE_QMAKE_OUTDIR/mkspecs/modules-inst else: \ - MODULE_PRI = $$MODULE_FWD_PRI + mod_inst_pfx = $$mod_work_pfx +!internal_module { + MODULE_ID = $$MODULE + MODULE_PRIVATE_PRI = $$mod_inst_pfx/qt_lib_$${MODULE}_private.pri + mods_to_load = $$MODULE $${MODULE}_private +} else { + MODULE_ID = $${MODULE}_private + mods_to_load = $${MODULE}_private +} +need_fwd_pri: \ + pris_to_load = $$MODULE_ID +else: \ + pris_to_load = $$mods_to_load +MODULE_PRI = $$mod_inst_pfx/qt_lib_$${MODULE_ID}.pri +MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri !build_pass { @@ -34,20 +48,14 @@ else: \ module_libs = "\$\$QT_MODULE_LIB_BASE" unix:!static { host_build: \ - module_rpath = "QT.$${MODULE}.rpath = $$[QT_HOST_LIBS]" + module_rpath = "QT.$${MODULE_ID}.rpath = $$[QT_HOST_LIBS]" else: \ - module_rpath = "QT.$${MODULE}.rpath = $$[QT_INSTALL_LIBS/raw]" + module_rpath = "QT.$${MODULE_ID}.rpath = $$[QT_INSTALL_LIBS/raw]" } else { module_rpath = } - !isEmpty(QT_FOR_PRIVATE) { - contains(QT_FOR_PRIVATE, .*-private$):error("QT_FOR_PRIVATE may not contain *-private.") - module_privdep = "QT.$${MODULE}.private_depends = $$QT_FOR_PRIVATE" - } else { - module_privdep = - } !isEmpty(QT_PRIVATE): \ - module_rundep = "QT.$${MODULE}.run_depends = $$unique($$list($$replace(QT_PRIVATE, -private$, )))" + module_rundep = "QT.$${MODULE_ID}.run_depends = $$replace(QT_PRIVATE, -private$, _private)" else: \ module_rundep = static: \ @@ -58,10 +66,8 @@ else: \ module_build_type = internal_module: \ module_build_type += internal_module - !isEmpty(module_build_type): \ - module_build_type = "QT.$${MODULE}.module_config = $$module_build_type" !isEmpty(MODULE_CONFIG): \ - module_config = "QT.$${MODULE}.CONFIG = $$MODULE_CONFIG" + module_config = "QT.$${MODULE_ID}.CONFIG = $$MODULE_CONFIG" else: \ module_config = !no_module_headers:!minimal_syncqt { @@ -74,46 +80,51 @@ else: \ $$MODULE_BASE_OUTDIR/include) MODULE_INCLUDES += $$MODULE_AUX_INCLUDES MODULE_PRIVATE_INCLUDES += $$MODULE_PRIVATE_AUX_INCLUDES - internal_module { - MODULE_PRIVATE_INCLUDES = $$MODULE_INCLUDES $$MODULE_PRIVATE_INCLUDES - MODULE_INCLUDES = - MODULE_PRIVATE_SHADOW_INCLUDES = $$MODULE_SHADOW_INCLUDES - MODULE_SHADOW_INCLUDES = - } - split_incpath { - !isEmpty(MODULE_SHADOW_INCLUDES): \ - MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE}.includes += $$MODULE_SHADOW_INCLUDES" - !isEmpty(MODULE_PRIVATE_SHADOW_INCLUDES): \ - MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE}.private_includes += $$MODULE_PRIVATE_SHADOW_INCLUDES" - } + internal_module: \ + MODULE_INCLUDES += $$MODULE_PRIVATE_INCLUDES + split_incpath: \ + MODULE_FWD_PRI_CONT_SUFFIX += "QT.$${MODULE_ID}.includes += $$MODULE_SHADOW_INCLUDES" MODULE_PRI_CONT = \ - "QT.$${MODULE}.VERSION = $${VERSION}" \ - "QT.$${MODULE}.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \ - "QT.$${MODULE}.MINOR_VERSION = $$section(VERSION, ., 1, 1)" \ - "QT.$${MODULE}.PATCH_VERSION = $$section(VERSION, ., 2, 2)" \ + "QT.$${MODULE_ID}.VERSION = $${VERSION}" \ + "QT.$${MODULE_ID}.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \ + "QT.$${MODULE_ID}.MINOR_VERSION = $$section(VERSION, ., 1, 1)" \ + "QT.$${MODULE_ID}.PATCH_VERSION = $$section(VERSION, ., 2, 2)" \ "" \ - "QT.$${MODULE}.name = $$TARGET" \ - "QT.$${MODULE}.libs = $$module_libs" \ + "QT.$${MODULE_ID}.name = $$TARGET" \ + "QT.$${MODULE_ID}.libs = $$module_libs" \ $$module_rpath \ - "QT.$${MODULE}.private_includes = $$MODULE_PRIVATE_INCLUDES" + "QT.$${MODULE_ID}.includes = $$MODULE_INCLUDES" !host_build: MODULE_PRI_CONT += \ - "QT.$${MODULE}.includes = $$MODULE_INCLUDES" \ - "QT.$${MODULE}.bins = \$\$QT_MODULE_BIN_BASE" \ - "QT.$${MODULE}.libexecs = \$\$QT_MODULE_LIBEXEC_BASE" \ - "QT.$${MODULE}.plugins = \$\$QT_MODULE_PLUGIN_BASE" \ - "QT.$${MODULE}.imports = \$\$QT_MODULE_IMPORT_BASE" \ - "QT.$${MODULE}.qml = \$\$QT_MODULE_QML_BASE" + "QT.$${MODULE_ID}.bins = \$\$QT_MODULE_BIN_BASE" \ + "QT.$${MODULE_ID}.libexecs = \$\$QT_MODULE_LIBEXEC_BASE" \ + "QT.$${MODULE_ID}.plugins = \$\$QT_MODULE_PLUGIN_BASE" \ + "QT.$${MODULE_ID}.imports = \$\$QT_MODULE_IMPORT_BASE" \ + "QT.$${MODULE_ID}.qml = \$\$QT_MODULE_QML_BASE" MODULE_PRI_CONT += \ - "QT.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" \ - $$module_privdep \ + "QT.$${MODULE_ID}.depends =$$join(MODULE_DEPENDS, " ", " ")" \ $$module_rundep \ - $$module_build_type \ + "QT.$${MODULE_ID}.module_config =$$join(module_build_type, " ", " ")" \ $$module_config \ - "QT.$${MODULE}.DEFINES = $$MODULE_DEFINES" \ # assume sufficient quoting + "QT.$${MODULE_ID}.DEFINES = $$MODULE_DEFINES" \ # assume sufficient quoting "" \ "QT_MODULES += $$MODULE" write_file($$MODULE_PRI, MODULE_PRI_CONT)|error("Aborting.") - MODULE_PRI_FILES = $$MODULE_PRI + !internal_module { + module_build_type += internal_module no_link + MODULE_PRIVATE_PRI_CONT = \ + "QT.$${MODULE}_private.VERSION = $${VERSION}" \ + "QT.$${MODULE}_private.MAJOR_VERSION = $$section(VERSION, ., 0, 0)" \ + "QT.$${MODULE}_private.MINOR_VERSION = $$section(VERSION, ., 1, 1)" \ + "QT.$${MODULE}_private.PATCH_VERSION = $$section(VERSION, ., 2, 2)" \ + "" \ + "QT.$${MODULE}_private.name = $${TARGET}" \ # Same name as base module + "QT.$${MODULE}_private.libs = $$module_libs" \ + "QT.$${MODULE}_private.includes = $$MODULE_PRIVATE_INCLUDES" \ + "QT.$${MODULE}_private.depends = $$replace($$list($$MODULE $$QT_FOR_PRIVATE), -private$, _private)" \ + "QT.$${MODULE}_private.module_config =$$join(module_build_type, " ", " ")" + write_file($$MODULE_PRIVATE_PRI, MODULE_PRIVATE_PRI_CONT)|error("Aborting.") + } + MODULE_PRI_FILES = $$MODULE_PRI $$MODULE_PRIVATE_PRI need_fwd_pri { @@ -132,8 +143,10 @@ else: \ "QT_MODULE_HOST_LIB_BASE = $$MODULE_BASE_OUTDIR/lib" \ "QT_MODULE_LIBEXEC_BASE = $$MODULE_BASE_OUTDIR/libexec" \ "QT_MODULE_PLUGIN_BASE = $$MODULE_BASE_OUTDIR/plugins" \ - "include($$MODULE_PRI)" \ - $$MODULE_FWD_PRI_CONT_SUFFIX + "include($$MODULE_PRI)" + !internal_module: MODULE_FWD_PRI_CONT += \ + "include($$MODULE_PRIVATE_PRI)" + MODULE_FWD_PRI_CONT += $$MODULE_FWD_PRI_CONT_SUFFIX write_file($$MODULE_FWD_PRI, MODULE_FWD_PRI_CONT)|error("Aborting.") touch($$MODULE_FWD_PRI, $$MODULE_PRI) MODULE_PRI_FILES += $$MODULE_FWD_PRI @@ -155,12 +168,15 @@ else: \ # Then, inject the new module into the current cache state !contains(QMAKE_INTERNAL_INCLUDED_FILES, $$MODULE_PRI): \ # before the actual include()! cache(QMAKE_INTERNAL_INCLUDED_FILES, add transient, MODULE_PRI_FILES) - include($$MODULE_FWD_PRI) - for(var, $$list(VERSION MAJOR_VERSION MINOR_VERSION PATCH_VERSION \ - name depends private_depends module_config CONFIG DEFINES sources \ - includes private_includes bins libs libexecs plugins imports qml \ - rpath_link rpath_link_private \ - )):defined(QT.$${MODULE}.$$var, var):cache(QT.$${MODULE}.$$var, transient) + for(pri, pris_to_load): \ + include($$mod_work_pfx/qt_lib_$${pri}.pri) + for(mod, mods_to_load) { + for(var, $$list(VERSION MAJOR_VERSION MINOR_VERSION PATCH_VERSION \ + name depends module_config CONFIG DEFINES sources \ + includes bins libs libexecs plugins imports qml \ + rpath_link \ + )):defined(QT.$${mod}.$$var, var):cache(QT.$${mod}.$$var, transient) + } cache(QT_MODULES, transient) } # !build_pass diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf index f0f0fe567bb..f0864f9e74f 100644 --- a/mkspecs/features/qt_tool.prf +++ b/mkspecs/features/qt_tool.prf @@ -19,7 +19,7 @@ CONFIG += console !build_pass:if(!host_build|!force_bootstrap|force_independent) { isEmpty(MODULE):MODULE = $$TARGET - !host_build|!force_bootstrap: MODULE_DEPENDS = $$replace(QT, -private$, ) + !host_build|!force_bootstrap: MODULE_DEPENDS = $$replace(QT, -private$, _private) load(qt_build_paths) From 48b107ecfe216b93361ee162999e0cd0ee1cee41 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 23 Oct 2013 12:40:05 +0200 Subject: [PATCH 014/494] make better use of $$MODULE_PLUGIN_TYPES the module project files declare what plugins they need, as that is necessary for automatic android deployment. enable wider usage of this by making the information available from the module .pri files. caveat: the variable is called "types", but is in fact paths, so there can be particular plugins named. use this new facility to replace the egregious hard-coded list of plugin-to-module mappings from create_cmake. possible todo: automate populating DEPLOYMENT (for wince, and whatever else). Change-Id: Ibb9c07cfe2b0008905204cbeb81e9c8e2ae4dc69 Reviewed-by: Joerg Bornemann --- mkspecs/features/create_cmake.prf | 18 +++++++++--------- mkspecs/features/qt_module_pris.prf | 3 ++- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index 2f61df761ad..19b26460a0d 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -111,15 +111,15 @@ if(build_all|CONFIG(debug, debug|release)): CMAKE_DEBUG_TYPE = debug if(build_all|CONFIG(release, debug|release)): CMAKE_RELEASE_TYPE = release contains(CONFIG, plugin) { - equals(PLUGIN_TYPE, bearer): PLUGIN_MODULE_NAME = network - else:equals(PLUGIN_TYPE, sqldrivers): PLUGIN_MODULE_NAME = sql - else:equals(PLUGIN_TYPE, accessible): PLUGIN_MODULE_NAME = widgets - else:equals(PLUGIN_TYPE, imageformats): PLUGIN_MODULE_NAME = gui - else:equals(PLUGIN_TYPE, platforminputcontexts): PLUGIN_MODULE_NAME = gui - else:equals(PLUGIN_TYPE, platformthemes): PLUGIN_MODULE_NAME = gui - else:equals(PLUGIN_TYPE, generic): PLUGIN_MODULE_NAME = gui - else:equals(PLUGIN_TYPE, platforms): PLUGIN_MODULE_NAME = gui - else: return() + PLUGIN_MODULE_NAME = + for (mod, QT_MODULES) { + types = $$replace(QT.$${mod}.plugin_types, /.*$, ) + contains(types, $$PLUGIN_TYPE) { + PLUGIN_MODULE_NAME = $$mod + break() + } + } + isEmpty(PLUGIN_MODULE_NAME): return() CMAKE_MODULE_NAME = $$cmakeModuleName($$PLUGIN_MODULE_NAME) diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf index 2e57f498e31..900ade9b6e1 100644 --- a/mkspecs/features/qt_module_pris.prf +++ b/mkspecs/features/qt_module_pris.prf @@ -99,7 +99,8 @@ MODULE_FWD_PRI = $$mod_work_pfx/qt_lib_$${MODULE_ID}.pri "QT.$${MODULE_ID}.libexecs = \$\$QT_MODULE_LIBEXEC_BASE" \ "QT.$${MODULE_ID}.plugins = \$\$QT_MODULE_PLUGIN_BASE" \ "QT.$${MODULE_ID}.imports = \$\$QT_MODULE_IMPORT_BASE" \ - "QT.$${MODULE_ID}.qml = \$\$QT_MODULE_QML_BASE" + "QT.$${MODULE_ID}.qml = \$\$QT_MODULE_QML_BASE" \ + $$join(MODULE_PLUGIN_TYPES, " ", "QT.$${MODULE_ID}.plugin_types = ") MODULE_PRI_CONT += \ "QT.$${MODULE_ID}.depends =$$join(MODULE_DEPENDS, " ", " ")" \ $$module_rundep \ From e25a4faf4a33a758a51c1b96dfdead2f1675ccd7 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Thu, 24 Oct 2013 11:10:01 +0200 Subject: [PATCH 015/494] Remove gstreamer configure test. Nothing in qtbase uses gstreamer, so this is just a red herring. Change-Id: I93fb20a70928d84fed8f33ca4c5df38779928f1a Reviewed-by: Oswald Buddenhagen --- config.tests/unix/gstreamer/gstreamer.cpp | 55 ----------------------- config.tests/unix/gstreamer/gstreamer.pro | 3 -- configure | 40 ----------------- 3 files changed, 98 deletions(-) delete mode 100644 config.tests/unix/gstreamer/gstreamer.cpp delete mode 100644 config.tests/unix/gstreamer/gstreamer.pro diff --git a/config.tests/unix/gstreamer/gstreamer.cpp b/config.tests/unix/gstreamer/gstreamer.cpp deleted file mode 100644 index 3864cdcb9f4..00000000000 --- a/config.tests/unix/gstreamer/gstreamer.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the config.tests of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -#include - -#if !defined(GST_VERSION_MAJOR) \ - || !defined(GST_VERSION_MINOR) -# error "No GST_VERSION_* macros" -#elif GST_VERION_MAJOR != 0 && GST_VERSION_MINOR != 10 -# error "Incompatible version of GStreamer found (Version 0.10.x is required)." -#endif - -int main(int argc, char **argv) -{ -} diff --git a/config.tests/unix/gstreamer/gstreamer.pro b/config.tests/unix/gstreamer/gstreamer.pro deleted file mode 100644 index 7d4aa8e2e5e..00000000000 --- a/config.tests/unix/gstreamer/gstreamer.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = gstreamer.cpp -CONFIG -= qt -LIBS += -lgstinterfaces-0.10 -lgstvideo-0.10 -lgstbase-0.10 diff --git a/configure b/configure index fcd9f08ed1a..36c125e891f 100755 --- a/configure +++ b/configure @@ -938,7 +938,6 @@ CFG_CUPS=auto CFG_ICONV=auto CFG_DBUS=auto CFG_GLIB=auto -CFG_GSTREAMER=auto CFG_QGTKSTYLE=auto CFG_LARGEFILE=auto CFG_OPENSSL=auto @@ -1044,10 +1043,6 @@ QT_LIBS_DBUS= QT_CFLAGS_GLIB= QT_LIBS_GLIB= -# flags for GStreamer (X11 only) -QT_CFLAGS_GSTREAMER= -QT_LIBS_GSTREAMER= - # default qpa platform QT_QPA_DEFAULT_PLATFORM= @@ -2036,13 +2031,6 @@ while [ "$#" -gt 0 ]; do UNKNOWN_OPT=yes fi ;; - gstreamer) - if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then - CFG_GSTREAMER="$VAL" - else - UNKNOWN_OPT=yes - fi - ;; gtkstyle) if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then CFG_QGTKSTYLE="$VAL" @@ -5032,31 +5020,6 @@ elif [ "$CFG_GLIB" = "no" ]; then CFG_QGTKSTYLE=no fi -# ### Vestige -if [ "$CFG_GLIB" = "yes" -a "$CFG_GSTREAMER" != "no" ]; then - if [ -n "$PKG_CONFIG" ]; then - QT_CFLAGS_GSTREAMER=`$PKG_CONFIG --cflags gstreamer-0.10 gstreamer-plugins-base-0.10 2>/dev/null` - QT_LIBS_GSTREAMER=`$PKG_CONFIG --libs gstreamer-0.10 gstreamer-plugins-base-0.10 2>/dev/null` - fi - if compileTest unix/gstreamer "GStreamer" $QT_CFLAGS_GSTREAMER $QT_LIBS_GSTREAMER; then - CFG_GSTREAMER=yes - QMakeVar set QT_CFLAGS_GSTREAMER "$QT_CFLAGS_GSTREAMER" - QMakeVar set QT_LIBS_GSTREAMER "$QT_LIBS_GSTREAMER" - else - if [ "$CFG_GSTREAMER" = "yes" ] && [ "$CFG_CONFIGURE_EXIT_ON_ERROR" = "yes" ]; then - echo "Gstreamer support cannot be enabled due to functionality tests!" - echo " Turn on verbose messaging (-v) to $0 to see the final report." - echo " If you believe this message is in error you may use the continue" - echo " switch (-continue) to $0 to continue." - exit 101 - else - CFG_GSTREAMER=no - fi - fi -elif [ "$CFG_GLIB" = "no" ]; then - CFG_GSTREAMER=no -fi - # auto-detect libicu support if [ "$CFG_ICU" != "no" ]; then if compileTest unix/icu "ICU"; then @@ -6089,7 +6052,6 @@ fi [ "$CFG_ICONV" = "sun" ] && QT_CONFIG="$QT_CONFIG sun-libiconv" [ "$CFG_ICONV" = "gnu" ] && QT_CONFIG="$QT_CONFIG gnu-libiconv" [ "$CFG_GLIB" = "yes" ] && QT_CONFIG="$QT_CONFIG glib" -[ "$CFG_GSTREAMER" = "yes" ] && QT_CONFIG="$QT_CONFIG gstreamer" [ "$CFG_DBUS" = "yes" ] && QT_CONFIG="$QT_CONFIG dbus" [ "$CFG_DBUS" = "linked" ] && QT_CONFIG="$QT_CONFIG dbus dbus-linked" [ "$CFG_OPENSSL" = "yes" ] && QT_CONFIG="$QT_CONFIG openssl" @@ -6478,7 +6440,6 @@ QMakeVar set sql-plugins "$SQL_PLUGINS" [ "$CFG_CUPS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CUPS" [ "$CFG_ICONV" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ICONV" [ "$CFG_GLIB" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GLIB" -[ "$CFG_GSTREAMER" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GSTREAMER" [ "$CFG_QGTKSTYLE" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_GTK" [ "$CFG_CLOCK_MONOTONIC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CLOCK_MONOTONIC" [ "$CFG_MREMAP" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MREMAP" @@ -6915,7 +6876,6 @@ report_support_plugin " GIF .................." "$CFG_GIF" qt QtGui report_support_plugin " JPEG ................." "$CFG_JPEG" "$CFG_LIBJPEG" QtGui report_support_plugin " PNG .................." "$CFG_PNG" "$CFG_LIBPNG" QtGui report_support " Glib ..................." "$CFG_GLIB" -report_support " GStreamer .............." "$CFG_GSTREAMER" report_support " GTK theme .............." "$CFG_QGTKSTYLE" report_support " Large File ............." "$CFG_LARGEFILE" report_support " libudev ................" "$CFG_LIBUDEV" From f609e65a911efad7472a18fcbed983936af116b8 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 13 Oct 2013 23:24:43 +0200 Subject: [PATCH 016/494] QImageWriter: add a forgotten #ifndef QT_NO_IMAGEFORMAT_BPM The equivalent code in qimagereader.cpp has this, so add here, too. Change-Id: I0313727f009db5cb00ee9ce0540ba2674da49ccd Reviewed-by: Friedemann Kleint --- src/gui/image/qimagewriter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp index e4065724beb..900093b51bc 100644 --- a/src/gui/image/qimagewriter.cpp +++ b/src/gui/image/qimagewriter.cpp @@ -772,7 +772,9 @@ QList QImageWriter::supportedImageFormats() QList QImageWriter::supportedMimeTypes() { QSet mimeTypes; +#ifndef QT_NO_IMAGEFORMAT_BMP mimeTypes << "image/bmp"; +#endif #ifndef QT_NO_IMAGEFORMAT_PPM mimeTypes << "image/x-portable-bitmap"; mimeTypes << "image/x-portable-graymap"; From 8fd9fe209934ac92210ed3b81723ad5e21a98a30 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 18 Oct 2013 12:42:42 +0200 Subject: [PATCH 017/494] Android: Fix repaint on rotation After f89f099c55576992b39a8021aace64ff32747624, we no longer post a geometry-change and expose event when calling setGeometry, which the Android plugin depended on. This caused the window to stay the same size when it was resized by orientation changes. We put back the events in the code that calls setGeometry() instead. Task-number: QTBUG-32878 Change-Id: I449515dda07c839e0991c5a7031a972ca9c74dff Reviewed-by: BogDan Vatra --- .../platforms/android/src/androidjnimain.cpp | 15 +++------------ .../platforms/android/src/androidjnimain.h | 1 - .../android/src/opengl/qandroidopenglcontext.cpp | 2 ++ .../src/opengl/qandroidopenglplatformwindow.cpp | 5 ++++- .../android/src/opengl/qeglfshooks_android.cpp | 2 +- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/plugins/platforms/android/src/androidjnimain.cpp b/src/plugins/platforms/android/src/androidjnimain.cpp index 5c9ca798a80..34413ae5097 100644 --- a/src/plugins/platforms/android/src/androidjnimain.cpp +++ b/src/plugins/platforms/android/src/androidjnimain.cpp @@ -247,17 +247,6 @@ namespace QtAndroid m_surfaceMutex.unlock(); return m_nativeWindow; } - - QSize nativeWindowSize() - { - if (m_nativeWindow == 0) - return QAndroidPlatformIntegration::defaultDesktopSize(); - - int width = ANativeWindow_getWidth(m_nativeWindow); - int height = ANativeWindow_getHeight(m_nativeWindow); - - return QSize(width, height); - } #endif void setAndroidPlatformIntegration(QAndroidPlatformIntegration *androidPlatformIntegration) @@ -564,7 +553,9 @@ static void setSurface(JNIEnv *env, jobject /*thiz*/, jobject jSurface) m_waitForWindowSemaphore.release(); if (m_androidPlatformIntegration) { - QSize size = QtAndroid::nativeWindowSize(); + // Use the desktop size. + // On some devices, the getters for the native window size gives wrong values + QSize size = QAndroidPlatformIntegration::defaultDesktopSize(); QPlatformScreen *screen = m_androidPlatformIntegration->screen(); QRect geometry(QPoint(0, 0), size); diff --git a/src/plugins/platforms/android/src/androidjnimain.h b/src/plugins/platforms/android/src/androidjnimain.h index 9a3d8a9607a..b530aac8849 100644 --- a/src/plugins/platforms/android/src/androidjnimain.h +++ b/src/plugins/platforms/android/src/androidjnimain.h @@ -75,7 +75,6 @@ namespace QtAndroid void flushImage(const QPoint &pos, const QImage &image, const QRect &rect); #else EGLNativeWindowType nativeWindow(bool waitToCreate = true); - QSize nativeWindowSize(); #endif QWindow *topLevelWindowAt(const QPoint &globalPos); diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp b/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp index 9d6d4003f7c..6431914812b 100644 --- a/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp +++ b/src/plugins/platforms/android/src/opengl/qandroidopenglcontext.cpp @@ -71,6 +71,8 @@ void QAndroidOpenGLContext::swapBuffers(QPlatformSurface *surface) if (size.isValid()) { QRect geometry(QPoint(0, 0), size); window->setGeometry(geometry); + QWindowSystemInterface::handleGeometryChange(window->window(), geometry); + QWindowSystemInterface::handleExposeEvent(window->window(), QRegion(geometry)); window->scheduleResize(QSize()); } window->unlock(); diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp index 4934047af9e..258a0968e87 100644 --- a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp +++ b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp @@ -41,6 +41,7 @@ #include "qandroidopenglplatformwindow.h" #include "androidjnimain.h" +#include "qandroidplatformintegration.h" #include QT_BEGIN_NAMESPACE @@ -110,7 +111,9 @@ void QAndroidOpenGLPlatformWindow::resetSurface() { lock(); - scheduleResize(QtAndroid::nativeWindowSize()); + // Use the desktop size. + // On some devices, the getters for the native window size gives wrong values + scheduleResize(QAndroidPlatformIntegration::defaultDesktopSize()); QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry())); // Expose event unlock(); } diff --git a/src/plugins/platforms/android/src/opengl/qeglfshooks_android.cpp b/src/plugins/platforms/android/src/opengl/qeglfshooks_android.cpp index 338966eb40c..e7e53e72a2a 100644 --- a/src/plugins/platforms/android/src/opengl/qeglfshooks_android.cpp +++ b/src/plugins/platforms/android/src/opengl/qeglfshooks_android.cpp @@ -82,7 +82,7 @@ EGLNativeDisplayType QEglFSAndroidHooks::platformDisplay() const QSize QEglFSAndroidHooks::screenSize() const { - return QtAndroid::nativeWindowSize(); + return QAndroidPlatformIntegration::defaultDesktopSize(); } QSizeF QEglFSAndroidHooks::physicalScreenSize() const From 9a369a25ddfac9352cabde65c8476c7433dc6c3a Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Mon, 21 Oct 2013 14:53:16 +0200 Subject: [PATCH 018/494] Accessibility: Make it possible to send events with no QObject MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Icbb9d15ec52ff5f7718eaf3600cab140971274aa Reviewed-by: Jan Arve Sæther --- src/gui/accessible/qaccessible.cpp | 41 +++++++++-- src/gui/accessible/qaccessible.h | 72 ++++++++++++++++++- .../platforms/cocoa/qcocoaaccessibility.mm | 10 +-- 3 files changed, 110 insertions(+), 13 deletions(-) diff --git a/src/gui/accessible/qaccessible.cpp b/src/gui/accessible/qaccessible.cpp index b8771ec583d..5d28512697c 100644 --- a/src/gui/accessible/qaccessible.cpp +++ b/src/gui/accessible/qaccessible.cpp @@ -1270,8 +1270,16 @@ QAccessibleInterface::~QAccessibleInterface() /*! \fn QAccessibleEvent::QAccessibleEvent(QObject *object, QAccessible::Event type) Constructs a QAccessibleEvent to notify that \a object has changed. - The event \a type explains what changed. - */ + The event \a type describes what changed. +*/ + +/*! \fn QAccessibleEvent::QAccessibleEvent(QAccessibleInterface *interface, QAccessible::Event type) + + Constructs a QAccessibleEvent to notify that \a interface has changed. + The event \a type describes what changed. + Use this function if you already have a QAccessibleInterface or no QObject, otherwise consider + the overload taking a \l QObject parameter as it might be cheaper. +*/ /*! \fn QAccessibleEvent::~QAccessibleEvent() Destroys the event. @@ -1293,6 +1301,22 @@ QAccessibleInterface::~QAccessibleInterface() Returns the child index. */ +/*! + \internal + Returns the uniqueId of the QAccessibleInterface represented by this event. + + In case the object() function returns 0 this is the only way to access the + interface. +*/ +QAccessible::Id QAccessibleEvent::uniqueId() const +{ + if (!m_object) + return m_uniqueId; + QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(m_object); + if (m_child != -1) + iface = iface->child(m_child); + return QAccessible::uniqueId(iface); +} /*! \class QAccessibleValueChangeEvent @@ -1530,6 +1554,9 @@ QAccessibleInterface::~QAccessibleInterface() */ QAccessibleInterface *QAccessibleEvent::accessibleInterface() const { + if (m_object == 0) + return QAccessible::accessibleInterface(m_uniqueId); + QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(m_object); if (!iface || !iface->isValid()) { static bool hasWarned = false; @@ -1681,9 +1708,13 @@ QDebug operator<<(QDebug d, const QAccessibleEvent &ev) d << "QAccessibleEvent(null)"; return d; } - d.nospace() << "QAccessibleEvent(object=" << hex << ev.object(); - d.nospace() << dec; - d.nospace() << "child=" << ev.child(); + d.nospace() << "QAccessibleEvent("; + if (ev.object()) { + d.nospace() << "object=" << hex << ev.object() << dec; + d.nospace() << "child=" << ev.child(); + } else { + d.nospace() << "no object, uniqueId=" << ev.uniqueId(); + } d << " event=" << qAccessibleEventString(ev.type()); if (ev.type() == QAccessible::StateChanged) { QAccessible::State changed = static_cast(&ev)->changedStates(); diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index d5b0af550ed..25ce1619400 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -597,6 +597,7 @@ class Q_GUI_EXPORT QAccessibleEvent { Q_DISABLE_COPY(QAccessibleEvent) public: + inline QAccessibleEvent(QObject *obj, QAccessible::Event typ) : m_type(typ), m_object(obj), m_child(-1) { @@ -613,11 +614,27 @@ public: Q_ASSERT(m_type != QAccessible::TableModelChanged); } + inline QAccessibleEvent(QAccessibleInterface *iface, QAccessible::Event typ) + : m_type(typ), m_object(0) + { + Q_ASSERT(iface); + Q_ASSERT(m_type != QAccessible::ValueChanged); + Q_ASSERT(m_type != QAccessible::StateChanged); + Q_ASSERT(m_type != QAccessible::TextCaretMoved); + Q_ASSERT(m_type != QAccessible::TextSelectionChanged); + Q_ASSERT(m_type != QAccessible::TextInserted); + Q_ASSERT(m_type != QAccessible::TextRemoved); + Q_ASSERT(m_type != QAccessible::TextUpdated); + Q_ASSERT(m_type != QAccessible::TableModelChanged); + m_uniqueId = QAccessible::uniqueId(iface); + } + virtual ~QAccessibleEvent() {} QAccessible::Event type() const { return m_type; } QObject *object() const { return m_object; } + QAccessible::Id uniqueId() const; void setChild(int chld) { m_child = chld; } int child() const { return m_child; } @@ -627,7 +644,11 @@ public: protected: QAccessible::Event m_type; QObject *m_object; - int m_child; + union { + int m_child; + QAccessible::Id m_uniqueId; + }; + }; class Q_GUI_EXPORT QAccessibleStateChangeEvent :public QAccessibleEvent @@ -638,6 +659,11 @@ public: { m_type = QAccessible::StateChanged; } + inline QAccessibleStateChangeEvent(QAccessibleInterface *iface, QAccessible::State state) + : QAccessibleEvent(iface, QAccessible::InvalidEvent), m_changedStates(state) + { + m_type = QAccessible::StateChanged; + } QAccessible::State changedStates() const { return m_changedStates; @@ -657,6 +683,12 @@ public: { m_type = QAccessible::TextCaretMoved; } + inline QAccessibleTextCursorEvent(QAccessibleInterface *iface, int cursorPos) + : QAccessibleEvent(iface, QAccessible::InvalidEvent) + , m_cursorPosition(cursorPos) + { + m_type = QAccessible::TextCaretMoved; + } void setCursorPosition(int position) { m_cursorPosition = position; } int cursorPosition() const { return m_cursorPosition; } @@ -675,6 +707,12 @@ public: { m_type = QAccessible::TextSelectionChanged; } + inline QAccessibleTextSelectionEvent(QAccessibleInterface *iface, int start, int end) + : QAccessibleTextCursorEvent(iface, (start == -1) ? 0 : end) + , m_selectionStart(start), m_selectionEnd(end) + { + m_type = QAccessible::TextSelectionChanged; + } void setSelection(int start, int end) { m_selectionStart = start; @@ -698,6 +736,12 @@ public: { m_type = QAccessible::TextInserted; } + inline QAccessibleTextInsertEvent(QAccessibleInterface *iface, int position, const QString &text) + : QAccessibleTextCursorEvent(iface, position + text.length()) + , m_position(position), m_text(text) + { + m_type = QAccessible::TextInserted; + } QString textInserted() const { return m_text; @@ -720,6 +764,12 @@ public: { m_type = QAccessible::TextRemoved; } + inline QAccessibleTextRemoveEvent(QAccessibleInterface *iface, int position, const QString &text) + : QAccessibleTextCursorEvent(iface, position) + , m_position(position), m_text(text) + { + m_type = QAccessible::TextRemoved; + } QString textRemoved() const { return m_text; @@ -742,6 +792,12 @@ public: { m_type = QAccessible::TextUpdated; } + inline QAccessibleTextUpdateEvent(QAccessibleInterface *iface, int position, const QString &oldText, const QString &text) + : QAccessibleTextCursorEvent(iface, position + text.length()) + , m_position(position), m_oldText(oldText), m_text(text) + { + m_type = QAccessible::TextUpdated; + } QString textRemoved() const { return m_oldText; } @@ -767,6 +823,12 @@ public: { m_type = QAccessible::ValueChanged; } + inline QAccessibleValueChangeEvent(QAccessibleInterface *iface, const QVariant &val) + : QAccessibleEvent(iface, QAccessible::InvalidEvent) + , m_value(val) + { + m_type = QAccessible::ValueChanged; + } void setValue(const QVariant & val) { m_value= val; } QVariant value() const { return m_value; } @@ -794,6 +856,14 @@ public: { m_type = QAccessible::TableModelChanged; } + inline QAccessibleTableModelChangeEvent(QAccessibleInterface *iface, ModelChangeType changeType) + : QAccessibleEvent(iface, QAccessible::InvalidEvent) + , m_modelChangeType(changeType) + , m_firstRow(-1), m_firstColumn(-1), m_lastRow(-1), m_lastColumn(-1) + { + m_type = QAccessible::TableModelChanged; + } + void setModelChangeType(ModelChangeType changeType) { m_modelChangeType = changeType; } ModelChangeType modelChangeType() const { return m_modelChangeType; } diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm index e135f36e786..f43beb1bb54 100644 --- a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm +++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm @@ -56,12 +56,8 @@ QCocoaAccessibility::~QCocoaAccessibility() void QCocoaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event) { - QObject *object = event->object(); - if (!object) - return; - - QAccessibleInterface *interface = event->accessibleInterface(); - if (!interface) + QAccessible::Id interfaceId = event->uniqueId(); + if (!interfaceId) return; switch (event->type()) { @@ -69,7 +65,7 @@ void QCocoaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event) case QAccessible::TextInserted : case QAccessible::TextRemoved : case QAccessible::TextUpdated : { - QCocoaAccessibleElement *element = [QCocoaAccessibleElement createElementWithId : QAccessible::uniqueId(interface) parent : nil]; + QCocoaAccessibleElement *element = [QCocoaAccessibleElement createElementWithId : interfaceId parent : nil]; [element autorelease]; NSAccessibilityPostNotification(element, NSAccessibilityValueChangedNotification); break; } From 59ae8323b7a57cc04d19fc1f552aeaeda9dad3f7 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 24 Oct 2013 10:34:32 +0200 Subject: [PATCH 019/494] win32-msvc2013: force synchronous writes to .pdb files Synchronize .pdb file writing, otherwise parallel builds will fail, when different compiler instances try to access the same .pdb file. See also http://msdn.microsoft.com/en-us/library/vstudio/dn502518.aspx Change-Id: I4998f10458d320fd98d633eded02d90bf25ed884 Reviewed-by: Oliver Wolff Reviewed-by: Oswald Buddenhagen --- mkspecs/win32-msvc2013/qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/win32-msvc2013/qmake.conf b/mkspecs/win32-msvc2013/qmake.conf index 89d2dd45a44..7ca261f1d4b 100644 --- a/mkspecs/win32-msvc2013/qmake.conf +++ b/mkspecs/win32-msvc2013/qmake.conf @@ -21,7 +21,7 @@ QMAKE_LEX = flex QMAKE_LEXFLAGS = QMAKE_YACC = byacc QMAKE_YACCFLAGS = -d -QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t +QMAKE_CFLAGS = -nologo -Zm200 -Zc:wchar_t -FS QMAKE_CFLAGS_WARN_ON = -W3 QMAKE_CFLAGS_WARN_OFF = -W0 QMAKE_CFLAGS_RELEASE = -O2 -MD From 27f2b971550ceafc7810a5a2d25450319ab0ccc5 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Thu, 24 Oct 2013 13:16:36 +0300 Subject: [PATCH 020/494] Cleanup java files. Remove unused imports Change-Id: I9752ff3593cf97153133381736ef3c8c62898bd7 Reviewed-by: Paul Olav Tvete --- .../jar/src/org/qtproject/qt5/android/QtActivityDelegate.java | 2 +- .../jar/src/org/qtproject/qt5/android/QtInputConnection.java | 1 - src/android/jar/src/org/qtproject/qt5/android/QtNative.java | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index 11af4d42802..503b38ae794 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -362,7 +362,7 @@ public class QtActivityDelegate + "\tNECESSITAS_API_LEVEL=" + necessitasApiLevel + "\tHOME=" + m_activity.getFilesDir().getAbsolutePath() + "\tTMPDIR=" + m_activity.getFilesDir().getAbsolutePath(); - if (android.os.Build.VERSION.SDK_INT < 14) + if (Build.VERSION.SDK_INT < 14) additionalEnvironmentVariables += "\tQT_ANDROID_FONTS=Droid Sans;Droid Sans Fallback"; else additionalEnvironmentVariables += "\tQT_ANDROID_FONTS=Roboto;Droid Sans;Droid Sans Fallback"; diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java b/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java index f251369737c..3aba42642a9 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java @@ -43,7 +43,6 @@ package org.qtproject.qt5.android; import android.content.Context; -import android.os.Build; import android.view.View; import android.view.inputmethod.BaseInputConnection; import android.view.inputmethod.CompletionInfo; diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java index 1385c90e3e6..b37f1e87fd2 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -50,7 +50,6 @@ import android.app.Activity; import android.content.Context; import android.content.Intent; import android.net.Uri; -import android.os.Build; import android.text.ClipboardManager; import android.util.Log; import android.view.ContextMenu; From 42e68018438b225ae68eecd3e36338e11dd177b8 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 22 Oct 2013 12:56:14 +0200 Subject: [PATCH 021/494] iOS (OSX): rework how to bundle QML import folders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this patch, we would copy "$QTDIR/qml" directly into the bundle as "qml". This would cause problems if the user also tried to deploy qml files to a "qml" folder, or if any other file in the bundle ended up with the name "qml" (which is the case for QtDeclarative/tools/qml, where the executable is called "qml"). This patch will instead copy the contents of each import folder into QMAKE_QML_BUNDLE_PATH, which will default to "qt_qml" on iOS and "Resources/qt_qml" on OSX. We also change the implementation to use a post script rather then QMAKE_BUNDLE_DATA for two reasons: 1. Xcode does not like "copy build phases" to copy folders, only files (You cannot even create such a phase from Xcode, although it is possible to force it the way we create project.pbx. But this was error prone) 2. We need to strip away unneeded files from the bundle, like archives (which are linked in statically, not dlopened run-time). Using rsync lets us copy and strip in one operation. Change-Id: I7c2117f6cfbe11efdc272dff71adb0b1e619a5ff Reviewed-by: Oswald Buddenhagen Reviewed-by: Morten Johan Sørvig --- mkspecs/features/qt.prf | 50 ++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index d13b9bb8d5a..279540c384c 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -124,33 +124,37 @@ if(contains(QT, qml)|contains(QT_PRIVATE, qml)): \ QMAKE_CLEAN += $$QML_IMPORT_CPP # copy qml files. this part is platform spesific. - macx { - # copy to Contents/Resources in the bundle. - QmlImports.path = Contents/Resources/ - QmlImports.files *= $$QMLPATHS - QMAKE_BUNDLE_DATA += QmlImports + mac { + osx { + # Note: user can override QMAKE_BUNDLE_QML from pro file to change target bundle path + isEmpty(QMAKE_QML_BUNDLE_PATH):QMAKE_QML_BUNDLE_PATH = "Resources/qt_qml" + qmlTargetPath = $$OUT_PWD/$${TARGET}.app/Contents/$$QMAKE_QML_BUNDLE_PATH + qtconfTargetPath = $$OUT_PWD/$${TARGET}.app/Contents/Resources/qt.conf + } else { + # iOS: flat bundle layout (no Contents/Resources) + isEmpty(QMAKE_QML_BUNDLE_PATH):QMAKE_QML_BUNDLE_PATH = "qt_qml" + qmlTargetPath = $CODESIGNING_FOLDER_PATH/$$QMAKE_QML_BUNDLE_PATH + qtconfTargetPath = $CODESIGNING_FOLDER_PATH/qt.conf + } - # place qt.conf in Contents/Resources in the app bundle + # set import path in qt.conf to point to the bundeled qml: QT_CONF_CONTENTS = \ "[Paths]" \ - "Imports = Resources/qml" \ - "Qml2Imports = Resources/qml" - QT_CONF = "$$OUT_PWD/$${TARGET}.app/Contents/Resources/qt.conf" - write_file($$QT_CONF, QT_CONF_CONTENTS)|error("Aborting.") - } else: ios { - # flat bundle layout (no Contents/Resources) - QmlImports.files *= $$QMLPATHS - QMAKE_BUNDLE_DATA += QmlImports + "Imports = $$QMAKE_QML_BUNDLE_PATH" \ + "Qml2Imports = $$QMAKE_QML_BUNDLE_PATH" + write_file("$$OUT_PWD/qt.conf", QT_CONF_CONTENTS)|error("Aborting.") - # write qt.conf to OUT_PWD and make xcode copy it via QMAKE_BUNDLE_DATA - QT_CONF_CONTENTS = \ - "[Paths]" \ - "Imports = qml" \ - "Qml2Imports = qml" - QT_CONF = "$$OUT_PWD/qt.conf" - write_file($$QT_CONF, QT_CONF_CONTENTS)|error("Aborting.") - QtConf.files = $$QT_CONF - QMAKE_BUNDLE_DATA += QtConf + # write qt.conf and copy each qml import dir into the bundle. + # But strip away archives and other files that are not needed: + !isEmpty(QMAKE_POST_LINK): QMAKE_POST_LINK += ";" + QMAKE_POST_LINK += \ + "cp $$OUT_PWD/qt.conf $$qtconfTargetPath; " \ + "test -d $$qmlTargetPath && rm -r $$qmlTargetPath; " \ + "mkdir -p $$qmlTargetPath && " \ + "for p in $$QMLPATHS; do" \ + "rsync -r --exclude='*.a' --exclude='*.prl' --exclude='*.qmltypes' " + macx-xcode: QMAKE_POST_LINK += "$p/ $$qmlTargetPath; done" + else: QMAKE_POST_LINK += "\$\$p/ $$qmlTargetPath; done" } } } From c1815a7b3f842041b88dafc3b3c0ffeff3e6cb10 Mon Sep 17 00:00:00 2001 From: Morten Johan Sorvig Date: Fri, 25 Oct 2013 08:41:19 +0200 Subject: [PATCH 022/494] Fix compile warnings on 10.6 Apple clang 3.0 complains about missing function declarations. Add them. Change-Id: Ib9c3c238c94e8649844cf3e67a659875ad549ecb Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | 1 + src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm | 1 + src/plugins/platforms/cocoa/qcocoamenu.mm | 1 + 3 files changed, 3 insertions(+) diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index d90d77ec1d2..be2bab8ce76 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -82,6 +82,7 @@ static NSButton *macCreateButton(const char *text, NSView *superview) BOOL mDialogIsExecuting; BOOL mResultSet; }; +- (void)restoreOriginalContentView; - (void)relayout; - (void)updateQtColor; - (void)finishOffWithCode:(NSInteger)code; diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm index 91fb52eb6d0..dc22da09832 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm @@ -121,6 +121,7 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont) BOOL mDialogIsExecuting; BOOL mResultSet; }; +- (void)restoreOriginalContentView; - (void)relayout; - (void)relayoutToContentSize:(NSSize)frameSize; - (void)updateQtFont; diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index 14b8dee101d..16b02a93f59 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -84,6 +84,7 @@ static inline QCocoaMenuLoader *getMenuLoader() } - (id) initWithMenu:(QCocoaMenu*) m; +- (BOOL)hasShortcut:(NSMenu *)menu forKey:(NSString *)key forModifiers:(NSUInteger)modifier; @end From 39cffc4e347ee65fa2bd9707475f05915235e170 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 21 Oct 2013 13:01:16 +0200 Subject: [PATCH 023/494] Remove superfluous 'libudev ...' line Status for LIBUDEV printed again in the configure output under 'udev ....' Change-Id: I3e0beca4c6de315dc2dfbdc24d83f4d9cd2b8856 Reviewed-by: Oswald Buddenhagen --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index 36c125e891f..3180d35c644 100755 --- a/configure +++ b/configure @@ -6878,7 +6878,6 @@ report_support_plugin " PNG .................." "$CFG_PNG" "$CFG_LIBPNG" QtGu report_support " Glib ..................." "$CFG_GLIB" report_support " GTK theme .............." "$CFG_QGTKSTYLE" report_support " Large File ............." "$CFG_LARGEFILE" -report_support " libudev ................" "$CFG_LIBUDEV" report_support " Networking:" [ "$BUILD_ON_MAC" = "yes" ] && \ report_support " CoreWlan ............." "$CFG_COREWLAN" From c3f6a5d93b2439fc7a821e1b9d83f0aa996805bf Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 23 Oct 2013 15:23:35 +0200 Subject: [PATCH 024/494] kill unix_to_dos script there is really no point in having such a thing here. Change-Id: I2ffa2e911fadda1db2e402c05d59a7c88ddb30b9 Reviewed-by: Joerg Bornemann --- util/scripts/unix_to_dos | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100755 util/scripts/unix_to_dos diff --git a/util/scripts/unix_to_dos b/util/scripts/unix_to_dos deleted file mode 100755 index 510037c2f79..00000000000 --- a/util/scripts/unix_to_dos +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/perl - -undef $/; - -foreach $f ( @ARGV ) { - if ( open( F, "< $f" ) ) { - $i = ; - close F; - $i =~ s/\n/\r\n/g; - $i =~ s/\r+/\r/g; - if ( open( F, "> $f" ) ) { - print F $i; - close F; - } - } -} From fcebbaeba37422780afd58a1a63954bdbf1a67e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Boya=20Garc=C3=ADa?= Date: Wed, 16 Oct 2013 17:34:52 +0200 Subject: [PATCH 025/494] Fix virtual key mapping on MS Windows In order to map MS Windows virtual keys to Qt keys without messing with dead keys now I use the built-in keyMap structure of QWindowsKeyMapper and assert every cell in the keymap is properly updated. In order to guarantee this even when the user changes the keyboard layout, WndProc now manages the WM_INPUTLANGCHANGE message, which is handled by QWindowsKeyMapper, resetting the layout structure. I don't fully understand yet some things about QWindowsKeyMapper, i.e. how QWindowsKeyMapper::updatePossibleKeyCodes workarounds the dead key issue with ToAscii; but it seems to work fine in all the tests I've done. Any further testing is highly appreciated, though. [ChangeLog][[QtGui][Platform Specific Changes][Windows] Fixed virtual key mapping on Windows. Task-number: QTBUG-33409 Task-number: QTBUG-8764 Task-number: QTBUG-10032 Change-Id: I4f7709a90906b03f4504deea1ff5c361e9f94b3f Reviewed-by: Friedemann Kleint --- src/corelib/kernel/qcoreapplication_win.cpp | 5 +++ .../platforms/windows/qtwindowsglobal.h | 5 +++ .../platforms/windows/qwindowscontext.cpp | 1 + .../platforms/windows/qwindowskeymapper.cpp | 45 ++++++++----------- 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/src/corelib/kernel/qcoreapplication_win.cpp b/src/corelib/kernel/qcoreapplication_win.cpp index 418074dc7ac..65ca6b0dcb7 100644 --- a/src/corelib/kernel/qcoreapplication_win.cpp +++ b/src/corelib/kernel/qcoreapplication_win.cpp @@ -831,6 +831,11 @@ QString decodeMSG(const MSG& msg) } break; #endif +#ifdef WM_INPUTLANGCHANGE + case WM_INPUTLANGCHANGE: + parameters = QStringLiteral("Keyboard layout changed"); + break; +#endif // WM_INPUTLANGCHANGE #ifdef WM_NCACTIVATE case WM_NCACTIVATE: { diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h index f6ed9447ef8..7b574b0a56b 100644 --- a/src/plugins/platforms/windows/qtwindowsglobal.h +++ b/src/plugins/platforms/windows/qtwindowsglobal.h @@ -93,6 +93,7 @@ enum WindowsEventType // Simplify event types NonClientHitTest = NonClientEventFlag + 2, KeyEvent = KeyEventFlag + 1, KeyDownEvent = KeyEventFlag + KeyDownEventFlag + 1, + KeyboardLayoutChangeEvent = KeyEventFlag + 2, InputMethodKeyEvent = InputMethodEventFlag + KeyEventFlag + 1, InputMethodKeyDownEvent = InputMethodEventFlag + KeyEventFlag + KeyDownEventFlag + 1, ClipboardEvent = ClipboardEventFlag + 1, @@ -165,6 +166,10 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI return QtWindows::InputMethodKeyEvent; case WM_IME_KEYDOWN: return QtWindows::InputMethodKeyDownEvent; +#ifdef WM_INPUTLANGCHANGE + case WM_INPUTLANGCHANGE: + return QtWindows::KeyboardLayoutChangeEvent; +#endif // WM_INPUTLANGCHANGE case WM_TOUCH: return QtWindows::TouchEvent; case WM_CHANGECBCHAIN: diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 85b03673ac1..174b3312d2a 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -842,6 +842,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, case QtWindows::KeyEvent: case QtWindows::InputMethodKeyEvent: case QtWindows::InputMethodKeyDownEvent: + case QtWindows::KeyboardLayoutChangeEvent: #if !defined(Q_OS_WINCE) && !defined(QT_NO_SESSIONMANAGER) return platformSessionManager()->isInterractionBlocked() ? true : d->m_keyMapper.translateKeyEvent(platformWindow->window(), hwnd, msg, result); #else diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index 47c136991a4..994128738bc 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -574,7 +574,7 @@ void QWindowsKeyMapper::updateKeyMap(const MSG &msg) { unsigned char kbdBuffer[256]; // Will hold the complete keyboard state GetKeyboardState(kbdBuffer); - quint32 scancode = (msg.lParam >> 16) & 0xfff; + const quint32 scancode = (msg.lParam >> 16) & 0xff; updatePossibleKeyCodes(kbdBuffer, scancode, msg.wParam); } @@ -742,12 +742,21 @@ bool QWindowsKeyMapper::translateKeyEvent(QWindow *widget, HWND hwnd, const MSG &msg, LRESULT *result) { *result = 0; + + // Reset layout map when system keyboard layout is changed + if (msg.message == WM_INPUTLANGCHANGE) { + deleteLayouts(); + return true; + } + + // Add this key to the keymap if it is not present yet. + updateKeyMap(msg); + MSG peekedMsg; // consume dead chars?(for example, typing '`','a' resulting in a-accent). if (PeekMessage(&peekedMsg, hwnd, 0, 0, PM_NOREMOVE) && peekedMsg.message == WM_DEADCHAR) return true; - if (msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN) - updateKeyMap(msg); + return translateKeyEventInternal(widget, msg, false); } @@ -755,9 +764,8 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms { const int msgType = msg.message; - const quint32 scancode = (msg.lParam >> 16) & 0xfff; - const quint32 vk_key = MapVirtualKey(scancode, 1); - const bool isNumpad = (msg.wParam >= VK_NUMPAD0 && msg.wParam <= VK_NUMPAD9); + const quint32 scancode = (msg.lParam >> 16) & 0xff; + const quint32 vk_key = msg.wParam; quint32 nModifiers = 0; QWindow *receiver = m_keyGrabber ? m_keyGrabber : window; @@ -786,10 +794,6 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms state |= (nModifiers & AltAny ? int(Qt::AltModifier) : 0); state |= (nModifiers & MetaAny ? int(Qt::MetaModifier) : 0); - // Now we know enough to either have MapVirtualKey or our own keymap tell us if it's a deadkey - const bool isDeadKey = isADeadKey(msg.wParam, state) - || MapVirtualKey(msg.wParam, 2) & 0x80000000; - // A multi-character key or a Input method character // not found by our look-ahead if (msgType == WM_CHAR || msgType == WM_IME_CHAR) { @@ -849,23 +853,12 @@ bool QWindowsKeyMapper::translateKeyEventInternal(QWindow *window, const MSG &ms return true; // Translate VK_* (native) -> Key_* (Qt) keys - // If it's a dead key, we cannot use the toKeyOrUnicode() function, since that will change - // the internal state of the keyboard driver, resulting in that dead keys no longer works. - // ..also if we're typing numbers on the keypad, while holding down the Alt modifier. - int code = 0; - if (isNumpad && (nModifiers & AltAny)) { - code = winceKeyBend(msg.wParam); - } else if (!isDeadKey) { - // QTBUG-8764, QTBUG-10032 - // Can't call toKeyOrUnicode because that would call ToUnicode, and, if a dead key - // is pressed at the moment, Windows would NOT use it to compose a character for the next - // WM_CHAR event. + int modifiersIndex = 0; + modifiersIndex |= (nModifiers & ShiftAny ? 0x1 : 0); + modifiersIndex |= (nModifiers & ControlAny ? 0x2 : 0); + modifiersIndex |= (nModifiers & AltAny ? 0x4 : 0); - // Instead, use MapVirtualKey, which will provide adequate values. - code = MapVirtualKey(msg.wParam, MAPVK_VK_TO_CHAR); - if (code < 0x20 || code == 0x7f) // The same logic as in toKeyOrUnicode() - code = winceKeyBend(msg.wParam); - } + int code = keyLayout[vk_key].qtKey[modifiersIndex]; // Invert state logic: // If the key actually pressed is a modifier key, then we remove its modifier key from the From c15e8517ef877a141df7cd5d4767d19ac81e7c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Boya=20Garc=C3=ADa?= Date: Wed, 23 Oct 2013 12:34:02 +0200 Subject: [PATCH 026/494] Fix bug in updatePossibleKeyCodes() with dead keys and modifiers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As it was until now, QWindowsKeyMapper::updatePossibleKeyCodes() tested using ToUnicode for which characters produce a key with every possible combination of modifiers. Calling ToUnicode with a dead key is dangerous, because MS Windows keeps it in the driver buffer, so if you call ToUnicode with acute key and then you press a, you get an á. To prevent this, updatePossibleKeyCodes() checked if the key that was being tested was a dead key. If true, it inserted an space and then repeated the key in order to reset the system internal buffers to the same state they were before the call. The problem with this is if the dead key is really two keys (like ^ or ´ in US International keyboard layout) and you press one of those keys without the modifier to make it a dead key (i.e. 6 in US International): Since updatePossibleKeyCodes() only tests for the key that was pressed it gets 6 is not a dead key, and thus it does not execute the workaround. Thus, the next time the user presses 'a' they get 'â' instead because updatePossibleKeyCodes() set the dead key on the keyboard buffer and did not run the workaround. This patch makes updatePossibleKeyCodes() run the workaround if any possible combination of modifiers with the key being examinated makes a dead key. Task-number: QTBUG-33591 Change-Id: I8c0b27586f7c62798986258b1b84aa90e4c5d64c Reviewed-by: Oliver Wolff Reviewed-by: Friedemann Kleint --- src/plugins/platforms/windows/qwindowskeymapper.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index 994128738bc..02795283b23 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -635,8 +635,8 @@ void QWindowsKeyMapper::updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32 } keyLayout[vk_key].qtKey[8] = fallbackKey; - // If this vk_key a Dead Key - if (MapVirtualKey(vk_key, 2) & 0x80000000) { + // If this vk_key makes a dead key with any combination of modifiers + if (keyLayout[vk_key].deadkeys) { // Push a Space, then the original key through the low-level ToAscii functions. // We do this because these functions (ToAscii / ToUnicode) will alter the internal state of // the keyboard driver By doing the following, we set the keyboard driver state back to what From 910573f8e6d9230cb62cb5b2e31e556e67e114a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 24 Oct 2013 14:47:26 +0200 Subject: [PATCH 027/494] xcode: Move Qt preprocessor steps to separate target Xcode resolves dependencies at the beginning of each target, so if a Qt preprocessor such as moc or rcc updates a cpp file Xcode will not rebuild the cpp file until the next build. We solve this by moving the Qt proceprocesor handling to a separate aggregate build tool target, which the main application target then depends on. Change-Id: I8f9225b9603dc5f279b1cb60976fe709bd97963e Reviewed-by: Andy Shaw Reviewed-by: Oswald Buddenhagen Reviewed-by: Richard Moe Gustavsen --- qmake/generators/mac/pbuilder_pbx.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 524603aa637..7a7d42f2971 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1260,11 +1260,33 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) << "\t\t\t" << writeSettings("sourceTree", "") << ";\n" << "\t\t};\n"; + { + QString aggregate_target_key = keyFor(pbx_dir + "QMAKE_PBX_AGGREGATE_TARGET"); + project->values("QMAKE_PBX_TARGETS").append(aggregate_target_key); + t << "\t\t" << aggregate_target_key << " = {\n" + << "\t\t\t" << writeSettings("buildPhases", project->values("QMAKE_PBX_PRESCRIPT_BUILDPHASES"), SettingsAsList, 4) << ";\n" + << "\t\t\t" << writeSettings("dependencies", ProStringList(), SettingsAsList, 4) << ";\n" + << "\t\t\t" << writeSettings("buildConfigurationList", keyFor("QMAKE_PBX_BUILDCONFIG_LIST_TARGET"), SettingsNoQuote) << ";\n" + << "\t\t\t" << writeSettings("isa", "PBXAggregateTarget", SettingsNoQuote) << ";\n" + << "\t\t\t" << writeSettings("buildRules", ProStringList(), SettingsAsList) << ";\n" + << "\t\t\t" << writeSettings("productName", "Qt Preprocess") << ";\n" + << "\t\t\t" << writeSettings("name", "Qt Preprocess") << ";\n" + << "\t\t};\n"; + + QString aggregate_target_dep_key = keyFor(pbx_dir + "QMAKE_PBX_AGGREGATE_TARGET_DEP"); + t << "\t\t" << aggregate_target_dep_key << " = {\n" + << "\t\t\t" << writeSettings("isa", "PBXTargetDependency", SettingsNoQuote) << ";\n" + << "\t\t\t" << writeSettings("target", aggregate_target_key) << ";\n" + << "\t\t};\n"; + + project->values("QMAKE_PBX_TARGET_DEPENDS").append(aggregate_target_dep_key); + } + //TARGET QString target_key = keyFor(pbx_dir + "QMAKE_PBX_TARGET"); - project->values("QMAKE_PBX_TARGETS").append(target_key); + project->values("QMAKE_PBX_TARGETS").prepend(target_key); t << "\t\t" << target_key << " = {\n" - << "\t\t\t" << writeSettings("buildPhases", project->values("QMAKE_PBX_PRESCRIPT_BUILDPHASES") + project->values("QMAKE_PBX_BUILDPHASES"), + << "\t\t\t" << writeSettings("buildPhases", project->values("QMAKE_PBX_BUILDPHASES"), SettingsAsList, 4) << ";\n"; t << "\t\t\t" << writeSettings("dependencies", project->values("QMAKE_PBX_TARGET_DEPENDS"), SettingsAsList, 4) << ";\n" << "\t\t\t" << writeSettings("productReference", keyFor(pbx_dir + "QMAKE_PBX_REFERENCE")) << ";\n"; From 788b8aa29d9f7c13ba3755a0b3ffa2dc7833732d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 25 Oct 2013 12:24:20 +0200 Subject: [PATCH 028/494] support cleanly querying private modules in qtHaveModule() module names use dashes, but the internal module representation uses underscores, so we must translate. Change-Id: Ib6983d3731e7dae2a4d6232f8a5202390fd425e9 Reviewed-by: Friedemann Kleint --- mkspecs/features/qt_functions.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 86b1ad43145..d01c25c06d7 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -48,7 +48,7 @@ defineTest(qtProcessModuleFlags) { # qt module defineTest(qtHaveModule) { - !isEmpty(QT.$${1}.name): \ + !isEmpty(QT.$$replace(1, -, _).name): \ return(true) return(false) } From e1325cf26e146b68725cc1a0a02b274ce3dfbe5c Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 24 Oct 2013 19:50:34 +0200 Subject: [PATCH 029/494] Do not byteswap RGBA8888 formats The three RGBA8888 formats was introduced to make it possible to have QImages and QPixmaps in native OpenGL formats, but uploaded textures of these types are still converted to ARGB first and then swapped back. This patch detects the formats and ensures the unneeded back-and-forth conversion does not take place. It also replaces a seemingly unused private API meant for the same goal. Change-Id: Id69d6973bb9c13d1052f2a1b0c516183f63421c2 Reviewed-by: Gunnar Sletta --- src/gui/opengl/qopengltexturecache.cpp | 30 ++------------------- src/gui/opengl/qopengltexturecache_p.h | 3 +-- src/opengl/qgl.cpp | 36 +++++++++++++++++++++++--- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/src/gui/opengl/qopengltexturecache.cpp b/src/gui/opengl/qopengltexturecache.cpp index 94b82885ffb..4238f63cd87 100644 --- a/src/gui/opengl/qopengltexturecache.cpp +++ b/src/gui/opengl/qopengltexturecache.cpp @@ -95,10 +95,9 @@ void QOpenGLTextureCacheWrapper::cleanupTexturesForPixmapData(QPlatformPixmap *p cleanupTexturesForCacheKey(pmd->cacheKey()); } -QOpenGLTextureCache::QOpenGLTextureCache(QOpenGLContext *ctx, bool useByteSwapImage) +QOpenGLTextureCache::QOpenGLTextureCache(QOpenGLContext *ctx) : QOpenGLSharedResource(ctx->shareGroup()) , m_cache(64 * 1024) // 64 MB cache - , m_useByteSwapImage(useByteSwapImage) { } @@ -152,38 +151,13 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QImage &i return id; } -static inline void qgl_byteSwapImage(QImage &img) -{ - const int width = img.width(); - const int height = img.height(); - - if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) - { - for (int i = 0; i < height; ++i) { - uint *p = (uint *) img.scanLine(i); - for (int x = 0; x < width; ++x) - p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00); - } - } else { - for (int i = 0; i < height; ++i) { - uint *p = (uint *) img.scanLine(i); - for (int x = 0; x < width; ++x) - p[x] = (p[x] << 8) | (p[x] >> 24); - } - } -} - GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, qint64 key, const QImage &image) { GLuint id; glGenTextures(1, &id); glBindTexture(GL_TEXTURE_2D, id); - QImage tx = image.convertToFormat(QImage::Format_ARGB32_Premultiplied); - - // Performance could be improved by skipping qgl_byteSwapImage(). - if (m_useByteSwapImage) - qgl_byteSwapImage(tx); + QImage tx = image.convertToFormat(QImage::Format_RGBA8888_Premultiplied); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tx.width(), tx.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, const_cast(tx).bits()); diff --git a/src/gui/opengl/qopengltexturecache_p.h b/src/gui/opengl/qopengltexturecache_p.h index d4d3f00069a..2e82d5f3734 100644 --- a/src/gui/opengl/qopengltexturecache_p.h +++ b/src/gui/opengl/qopengltexturecache_p.h @@ -78,7 +78,7 @@ class Q_GUI_EXPORT QOpenGLTextureCache : public QOpenGLSharedResource public: static QOpenGLTextureCache *cacheForContext(QOpenGLContext *context); - QOpenGLTextureCache(QOpenGLContext *, bool useByteSwapImage = true); + QOpenGLTextureCache(QOpenGLContext *); ~QOpenGLTextureCache(); GLuint bindTexture(QOpenGLContext *context, const QPixmap &pixmap); @@ -94,7 +94,6 @@ private: QMutex m_mutex; QCache m_cache; - bool m_useByteSwapImage; }; QT_END_NAMESPACE diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 8ee0a8b2903..16044df8b12 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2308,10 +2308,18 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G QImage::Format target_format = img.format(); bool premul = options & QGLContext::PremultipliedAlphaBindOption; + bool needsbyteswap = true; GLenum externalFormat; GLuint pixel_type; - if (qgl_extensions()->hasOpenGLExtension(QOpenGLExtensions::BGRATextureFormat)) { + if (target_format == QImage::Format_RGBA8888 + || target_format == QImage::Format_RGBA8888_Premultiplied + || target_format == QImage::Format_RGBX8888) { + externalFormat = GL_RGBA; + pixel_type = GL_UNSIGNED_BYTE; + needsbyteswap = false; + } else if (qgl_extensions()->hasOpenGLExtension(QOpenGLExtensions::BGRATextureFormat)) { externalFormat = GL_BGRA; + needsbyteswap = false; if (QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_2) pixel_type = GL_UNSIGNED_INT_8_8_8_8_REV; else @@ -2335,6 +2343,22 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G img = img.convertToFormat(target_format = QImage::Format_ARGB32); #ifdef QGL_BIND_TEXTURE_DEBUG printf(" - converted ARGB32_Premultiplied -> ARGB32 (%d ms)\n", time.elapsed()); +#endif + } + break; + case QImage::Format_RGBA8888: + if (premul) { + img = img.convertToFormat(target_format = QImage::Format_RGBA8888_Premultiplied); +#ifdef QGL_BIND_TEXTURE_DEBUG + printf(" - converted RGBA8888 -> RGBA8888_Premultiplied (%d ms) \n", time.elapsed()); +#endif + } + break; + case QImage::Format_RGBA8888_Premultiplied: + if (!premul) { + img = img.convertToFormat(target_format = QImage::Format_RGBA8888); +#ifdef QGL_BIND_TEXTURE_DEBUG + printf(" - converted RGBA8888_Premultiplied -> RGBA8888 (%d ms) \n", time.elapsed()); #endif } break; @@ -2342,10 +2366,14 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G pixel_type = GL_UNSIGNED_SHORT_5_6_5; externalFormat = GL_RGB; internalFormat = GL_RGB; + needsbyteswap = false; break; case QImage::Format_RGB32: + case QImage::Format_RGBX8888: break; default: + // Ideally more formats would be converted directly to an RGBA8888 format, + // but we are only guaranteed to have a fast conversion to an ARGB format. if (img.hasAlphaChannel()) { img = img.convertToFormat(premul ? QImage::Format_ARGB32_Premultiplied @@ -2383,10 +2411,10 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G #endif } - if (externalFormat == GL_RGBA) { + if (needsbyteswap) { // The only case where we end up with a depth different from - // 32 in the switch above is for the RGB16 case, where we set - // the format to GL_RGB + // 32 in the switch above is for the RGB16 case, where we do + // not need a byteswap. Q_ASSERT(img.depth() == 32); qgl_byteSwapImage(img, pixel_type); #ifdef QGL_BIND_TEXTURE_DEBUG From 746f7a5b28d92d962ae261c52da4d750ea3b50f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Thu, 24 Oct 2013 16:24:48 +0200 Subject: [PATCH 030/494] QJNI: Don't detach from the thread as long as the thread is alive. Attaching and detaching the current thread to/from the VM on each jni call, causes a new thread object to be created and triggers GC when detaching (GC alone takes anything between 10-30 ms to finish on the test device). Instead of detaching when the environment object goes out of scope, we now detach when the thread exits. Task-number: QTBUG-34279 Change-Id: Ia613934e61f914d4be63bfa1be8fdecf849928b0 Reviewed-by: Yoann Lopes --- src/corelib/kernel/qjni.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp index 54cd2b5a75c..cf839cfaef2 100644 --- a/src/corelib/kernel/qjni.cpp +++ b/src/corelib/kernel/qjni.cpp @@ -162,24 +162,31 @@ static jfieldID getCachedFieldID(JNIEnv *env, return id; } -Q_GLOBAL_STATIC(QThreadStorage, refCount) +class QJNIEnvironmentPrivateTLS +{ +public: + inline ~QJNIEnvironmentPrivateTLS() + { + QtAndroidPrivate::javaVM()->DetachCurrentThread(); + } +}; + +Q_GLOBAL_STATIC(QThreadStorage, jniEnvTLS) QJNIEnvironmentPrivate::QJNIEnvironmentPrivate() : jniEnv(0) { JavaVM *vm = QtAndroidPrivate::javaVM(); if (vm->GetEnv((void**)&jniEnv, JNI_VERSION_1_6) == JNI_EDETACHED) { - if (vm->AttachCurrentThread(&jniEnv, 0) < 0) + if (vm->AttachCurrentThread(&jniEnv, 0) != JNI_OK) return; } if (!jniEnv) return; - if (!refCount->hasLocalData()) - refCount->setLocalData(1); - else - refCount->setLocalData(refCount->localData() + 1); + if (!jniEnvTLS->hasLocalData()) + jniEnvTLS->setLocalData(new QJNIEnvironmentPrivateTLS); } JNIEnv *QJNIEnvironmentPrivate::operator->() @@ -194,16 +201,6 @@ QJNIEnvironmentPrivate::operator JNIEnv* () const QJNIEnvironmentPrivate::~QJNIEnvironmentPrivate() { - if (!jniEnv) - return; - - const int newRef = refCount->localData() - 1; - refCount->setLocalData(newRef); - - if (newRef == 0) - QtAndroidPrivate::javaVM()->DetachCurrentThread(); - - jniEnv = 0; } QJNIObjectData::QJNIObjectData() From 9b9c63c27d6f9945d0b662a4a931750d775e1955 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Fri, 25 Oct 2013 16:34:33 +0300 Subject: [PATCH 031/494] Android: Fix the QSlider handler position. Change-Id: I300f187a94d6c2b6b385c5a129150344f6b805ea Reviewed-by: Paul Olav Tvete --- src/widgets/styles/qandroidstyle.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/widgets/styles/qandroidstyle.cpp b/src/widgets/styles/qandroidstyle.cpp index afd6c3024cd..9595e49f400 100644 --- a/src/widgets/styles/qandroidstyle.cpp +++ b/src/widgets/styles/qandroidstyle.cpp @@ -696,7 +696,10 @@ int QAndroidStyle::styleHint(QStyle::StyleHint hint, const QStyleOption *option, { switch (hint) { case SH_Slider_AbsoluteSetButtons: - return 1; + return Qt::LeftButton; + + case SH_Slider_PageSetButtons: + return 0; case SH_RequestSoftwareInputPanel: return RSIP_OnMouseClick; @@ -1776,9 +1779,9 @@ QRect QAndroidStyle::AndroidSeekBarControl::subControlRect(const QStyleOptionCom drawable = static_cast(m_seekBarThumb)->bestAndroidStateMatch(option); QRect r(option->rect); - double factor = double(styleOption->sliderPosition/(styleOption->maximum-styleOption->minimum)); - int pos=(double(option->rect.width()*factor - drawable->size().width()) / 2); - r.setX(r.x()+pos); + double factor = double(styleOption->sliderPosition) / (styleOption->maximum - styleOption->minimum); + int pos = option->rect.width() * factor - double(drawable->size().width() / 2); + r.setX(r.x() + pos); r.setSize(drawable->size()); return r; } From b01ec07a061f53776a0a178f7fe24f5321122f06 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Thu, 17 Oct 2013 16:52:29 +0300 Subject: [PATCH 032/494] Remove sunken state for Android. Only QLineEdit always sets the sunken state and on some Android devices (e.g HTC) the line edit is painted as it is pressed. Task-number: QTBUG-29565 Change-Id: I25031ffaadba85cae6b6ff17c0847cb706e23503 Reviewed-by: Paul Olav Tvete --- src/widgets/styles/qandroidstyle.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/widgets/styles/qandroidstyle.cpp b/src/widgets/styles/qandroidstyle.cpp index 9595e49f400..ceb95aa1258 100644 --- a/src/widgets/styles/qandroidstyle.cpp +++ b/src/widgets/styles/qandroidstyle.cpp @@ -515,8 +515,15 @@ void QAndroidStyle::drawPrimitive(PrimitiveElement pe, AndroidControlsHash::const_iterator it = itemType != QC_UnknownType ? m_androidControlsHash.find(itemType) : m_androidControlsHash.end(); - if (it != m_androidControlsHash.end()) - it.value()->drawControl(opt, p, w); + if (it != m_androidControlsHash.end()) { + if (itemType != QC_EditText) + it.value()->drawControl(opt, p, w); + else { + QStyleOption copy(*opt); + copy.state &= ~QStyle::State_Sunken; + it.value()->drawControl(©, p, w); + } + } else QFusionStyle::drawPrimitive(pe, opt, p, w); } From 054f357b695cfb2ef4a3c20e2bb617f23a00172a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 25 Oct 2013 13:26:00 +0200 Subject: [PATCH 033/494] CMake: Fix quoting issue with quoted paths in strings. Create a local CMake variable instead and use that in the search paths argument and in the message string. Resolves a warning that can appear with CMake 2.8.12. Task-number: QTBUG-34115 Change-Id: I04c67668586a9ad6584b7f6e91ee65351c86389c Reviewed-by: James Turner Reviewed-by: Stephen Kelly --- src/gui/Qt5GuiConfigExtras.cmake.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index 77e456df536..f2f75d0ea07 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -54,12 +54,14 @@ set(Qt5Gui_OPENGL_LIBRARIES Qt5::Gui_GLESv2) !!IF !isEmpty(CMAKE_GL_INCDIRS) +set(_GL_INCDIRS $$CMAKE_GL_INCDIRS) find_path(_qt5gui_OPENGL_INCLUDE_DIR $$CMAKE_GL_HEADER_NAME - PATHS $$CMAKE_GL_INCDIRS + PATHS ${_GL_INCDIRS} NO_DEFAULT_PATH) if (NOT _qt5gui_OPENGL_INCLUDE_DIR) - message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"$$CMAKE_GL_INCDIRS\\\".\") + message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"${_GL_INCDIRS}\\\".\") endif() +unset(_GL_INCDIRS) _qt5_Gui_check_file_exists(${_qt5gui_OPENGL_INCLUDE_DIR}) From 25650923b10bfd9a5f6b7c05c365eeb602023357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 25 Oct 2013 17:00:10 +0200 Subject: [PATCH 034/494] xcode: Set QMAKE_XCODE_LIBRARY_SUFFIX from default_post MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we won't pick up CONFIG+= changes on the command line or from the project file. Change-Id: I6f7e9380f971e6271de5659534e9565024fe041d Reviewed-by: Tor Arne Vestbø Reviewed-by: Oswald Buddenhagen --- mkspecs/features/mac/default_post.prf | 2 ++ mkspecs/features/mac/default_pre.prf | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index b183814e630..5d0fdb092f8 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -27,6 +27,8 @@ isEmpty(_QMAKE_CACHE_) { cache(QMAKE_XCODE_VERSION) } +QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix() + # Ensure that we process sdk.prf first, as it will update QMAKE_CXX # and friends that other features/extra compilers may depend on. sdk: load(sdk) diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf index c0596d5ef04..98caf54f8ab 100644 --- a/mkspecs/features/mac/default_pre.prf +++ b/mkspecs/features/mac/default_pre.prf @@ -24,8 +24,7 @@ isEmpty(QMAKE_XCODE_VERSION) { unset(xcode_version) } -# These two variables are used by the xcode_dynamic_library_suffix +# This variable is used by the xcode_dynamic_library_suffix # feature, which allows Xcode to choose the Qt libraries to link to # at build time, depending on the current Xcode SDK and configuration. -QMAKE_XCODE_LIBRARY_SUFFIX = $$qtPlatformTargetSuffix() QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX From c760d2dbfdaf743052be620f58c1f123420e9086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 8 Oct 2013 19:41:16 +0200 Subject: [PATCH 035/494] Rewrite qmake's exclusive-build feature We used to compute the default exclusive build directory, eg 'debug', at configure time, and then set OBJECTS_DIR, MOC_DIR, etc to include this hard-coded default exclusive build directory. We then had to run a post- process step where we replaced the 'debug' part with the current actual exclusive build pass, eg 'release', resulting in long-standing bugs such as QTBUG-491 where we end up replacing parts of the build output dirs that were not part of the original exclusive build directory. We now set the OBJECTS_DIR, MOC_DIR, etc defaults in configure like before, but they do not include any exclusive-build information. The exclusive build directory is handled as a separate step in default_post where we adjust all entries in QMAKE_DIR_REPLACE to be exclusive directories. For backwards compatibility the new exclusive build behavior is only enabled for variables named by QMAKE_DIR_REPLACE_SANE, which for Qt itself applies globally to everything but DESTDIR, and for libs and tools also applies to DESTDIR. The reason for leaving out DESTDIR in the general case is because many tests and examples assume the old behavior for DESTDIR. A side effect of including all the other variables for Qt libs and tools is that the PCH output dir will be uniformly set, which has been an issue on Windows in the past. The addExclusiveBuilds function now takes two or more arguments, each argument being the key for an exclusive build, which can be customized eg. using $$key.{name,target,dir_affix}. Passing more than two arguments results in three/four/etc-way exclusive builds, eg debug/release/profile. Exclusive builds can also be combined, eg static/shared + debug/release by making two calls to the function. We also handle individual targets of combined exclusive builds, eg static/shared + debug/release, meaning it is possible to run 'make debug' to build both static-debug and shared-debug. Task-number: QTBUG-491 Change-Id: I02841dbbd065ac07d413dfb45cfcfe4c013674ac Reviewed-by: Oswald Buddenhagen --- configure | 17 --- mkspecs/features/default_post.prf | 2 + mkspecs/features/exclusive_builds.prf | 111 ++++---------- mkspecs/features/exclusive_builds_post.prf | 160 +++++++++++++++++++++ mkspecs/features/qt_build_config.prf | 8 ++ mkspecs/features/qt_common.prf | 3 + mkspecs/features/resolve_config.prf | 19 +-- mkspecs/features/resolve_target.prf | 2 + tools/configure/configureapp.cpp | 8 -- 9 files changed, 206 insertions(+), 124 deletions(-) create mode 100644 mkspecs/features/exclusive_builds_post.prf diff --git a/configure b/configure index 3180d35c644..6f56d42d363 100755 --- a/configure +++ b/configure @@ -5895,18 +5895,10 @@ if [ "$CFG_OPENGL" = "es2" ]; then QT_CONFIG="$QT_CONFIG opengles2" fi -# build up the variables for output -if [ "$CFG_DEBUG" = "yes" ]; then - QMAKE_OUTDIR="${QMAKE_OUTDIR}debug" -elif [ "$CFG_DEBUG" = "no" ]; then - QMAKE_OUTDIR="${QMAKE_OUTDIR}release" -fi if [ "$CFG_SHARED" = "yes" ]; then - QMAKE_OUTDIR="${QMAKE_OUTDIR}-shared" QT_CONFIG="$QT_CONFIG shared" QTCONFIG_CONFIG="$QTCONFIG_CONFIG shared" elif [ "$CFG_SHARED" = "no" ]; then - QMAKE_OUTDIR="${QMAKE_OUTDIR}-static" QT_CONFIG="$QT_CONFIG static" QTCONFIG_CONFIG="$QTCONFIG_CONFIG static" fi @@ -5916,15 +5908,6 @@ QMAKE_CONFIG="$QMAKE_CONFIG qpa" QT_CONFIG="$QT_CONFIG qpa" QTCONFIG_CONFIG="$QTCONFIG_CONFIG qpa" -if [ "$XPLATFORM_MINGW" != "yes" ]; then - # Do not set this here for Windows. Let qmake do it so - # debug and release precompiled headers are kept separate. - QMakeVar set PRECOMPILED_DIR ".pch/$QMAKE_OUTDIR" -fi -QMakeVar set OBJECTS_DIR ".obj/$QMAKE_OUTDIR" -QMakeVar set MOC_DIR ".moc/$QMAKE_OUTDIR" -QMakeVar set RCC_DIR ".rcc/$QMAKE_OUTDIR" -QMakeVar set UI_DIR ".uic/$QMAKE_OUTDIR" if [ "$CFG_LARGEFILE" = "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then QMAKE_CONFIG="$QMAKE_CONFIG largefile" fi diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf index 4501b2a568b..8eb7101acc7 100644 --- a/mkspecs/features/default_post.prf +++ b/mkspecs/features/default_post.prf @@ -6,6 +6,8 @@ contains(TEMPLATE, ".*(lib|app)"):CONFIG += have_target load(resolve_config) +exclusive_builds: load(exclusive_builds_post) + # If the TARGET looks like a path, split it into DESTDIR and the resulting TARGET target_dir_part = $$dirname(TARGET) !isEmpty(target_dir_part) { diff --git a/mkspecs/features/exclusive_builds.prf b/mkspecs/features/exclusive_builds.prf index c45ff22c061..4d88dcd15e4 100644 --- a/mkspecs/features/exclusive_builds.prf +++ b/mkspecs/features/exclusive_builds.prf @@ -1,92 +1,37 @@ -# fixExclusiveOutputDirs(1config, 2config) -# Change all output paths that references 2config to have the string 1config in them -defineTest(fixExclusiveOutputDirs) { - firstBuild = $$1 - secondBuild = $$2 - count(ARGS, 2, greaterThan):isEqual($$list($$lower($$3)), false):appendFirstBuild = false - else:appendFirstBuild = true - isEmpty(QMAKE_DIR_REPLACE):QMAKE_DIR_REPLACE += OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR - lessThan(firstBuild, $$secondBuild):eval($${firstBuild}_and_$${secondBuild}_target:QMAKE_DIR_REPLACE += DESTDIR) - else:eval($${secondBuild}_and_$${firstBuild}_target:QMAKE_DIR_REPLACE += DESTDIR) - for(fix, QMAKE_DIR_REPLACE) { - isEmpty($$fix)|isEqual($$fix, .) { - eval($$fix = $${firstBuild}) - } else:contains($$list($$first($$fix)), .*$${secondBuild}.*) { - eval($$fix ~= s/$${secondBuild}/$${firstBuild}/gi) - } else:isEqual(appendFirstBuild, true):!contains($$list($$first($$fix)), .*$${firstBuild}.*) { - contains($$list($${first($$fix)}), .*/$):eval($$fix = $${first($$fix)}$${firstBuild}) - else:eval($$fix = $${first($$fix)}-$${firstBuild}) - } - export($$fix) - } - return(true) -} - -# addExclusiveBuilds(1config, 1name, 2config, 2name) -# Adds two BUILDS which are exclusive to each other. defineTest(addExclusiveBuilds) { - firstBuild = $$1 - firstBuildName = $$2 - secondBuild = $$3 - secondBuildName = $$4 + lessThan(ARGC, 2): \ + error("addExclusiveBuilds() requires at least two arguments") - contains(TEMPLATE, subdirs) { - eval(sub_$${firstBuildName}.target = $$firstBuild) - export(sub_$${firstBuildName}.target) - eval(sub_$${firstBuildName}.CONFIG = recursive) - export(sub_$${firstBuildName}.CONFIG) - eval(sub_$${secondBuildName}.target = $$secondBuild) - export(sub_$${secondBuildName}.target) - eval(sub_$${secondBuildName}.CONFIG = recursive) - export(sub_$${secondBuildName}.CONFIG) - QMAKE_EXTRA_TARGETS += sub_$${firstBuildName} sub_$${secondBuildName} - export(QMAKE_EXTRA_TARGETS) - } else:!build_pass { - first_BUILDS = - second_BUILDS = - suffix_BUILDS = Build + !$$join(ARGS, _and_):!fix_output_dirs: \ + return(true) - isEmpty(BUILDS): BUILDPERMUTATIONS = $$suffix_BUILDS - else: BUILDPERMUTATIONS = $$BUILDS - - for(permutation, BUILDPERMUTATIONS) { - permutation ~= s/$${suffix_BUILDS}$// - isEmpty(permutation): permutationName = - else: permutationName = -$$permutation - # Makefile target rule - eval($${firstBuildName}$${permutation}.target = $${firstBuild}$$lower($${permutationName})) - export($${firstBuildName}$${permutation}.target) - # IDE name - eval($${firstBuildName}$${permutation}.name = $${firstBuildName}$${permutationName}) - export($${firstBuildName}$${permutation}.name) - # prl import CONFIG option - eval($${firstBuildName}$${permutation}.PRL_CONFIG = $${firstBuild}$${permutation}) - export($${firstBuildName}$${permutation}.PRL_CONFIG) - # Individual CONFIG option - eval($${firstBuildName}$${permutation}.CONFIG = $${firstBuild} $${firstBuildName}Build $$eval($${permutation}.CONFIG)) - export($${firstBuildName}$${permutation}.CONFIG) - - eval($${secondBuildName}$${permutation}.target = $${secondBuild}$$lower($${permutationName})) - export($${secondBuildName}$${permutation}.target) - eval($${secondBuildName}$${permutation}.name = $${secondBuildName}$${permutationName}) - export($${secondBuildName}$${permutation}.name) - eval($${secondBuildName}$${permutation}.PRL_CONFIG = $${secondBuild}$${permutation}) - export($${secondBuildName}$${permutation}.PRL_CONFIG) - eval($${secondBuildName}$${permutation}.CONFIG = $${secondBuild} $${secondBuildName}Build $$eval($${permutation}.CONFIG)) - export($${secondBuildName}$${permutation}.CONFIG) - - first_BUILDS += $${firstBuildName}$${permutation} - second_BUILDS += $${secondBuildName}$${permutation} + for(build, ARGS) { + isEmpty($${build}.name) { + $${build}.name = $$title($$build) + export($${build}.name) + } + isEmpty($${build}.target) { + $${build}.target = $$lower($$build) + export($${build}.target) + } + isEmpty($${build}.dir_affix) { + $${build}.dir_affix = $$lower($$build) + export($${build}.dir_affix) } - # A mutual exclusive block. - CONFIG($${firstBuild}, $${firstBuild}|$${secondBuild}): BUILDS = $$first_BUILDS $$second_BUILDS - else: BUILDS = $$second_BUILDS $$first_BUILDS - export(BUILDS) - } else { - eval($${firstBuildName}Build:fixExclusiveOutputDirs($$firstBuild, $$secondBuild, false)) - eval($${secondBuildName}Build:fixExclusiveOutputDirs($$secondBuild, $$firstBuild, false)) + $${build}.exclusive = $$ARGS + export($${build}.exclusive) + + QMAKE_EXCLUSIVE_BUILDS += $$build } + + CONFIG *= exclusive_builds + export(CONFIG) + + export(QMAKE_EXCLUSIVE_BUILDS) return(true) } + +# Default directories to process +QMAKE_DIR_REPLACE = OBJECTS_DIR MOC_DIR RCC_DIR PRECOMPILED_DIR DESTDIR diff --git a/mkspecs/features/exclusive_builds_post.prf b/mkspecs/features/exclusive_builds_post.prf new file mode 100644 index 00000000000..936085af0bd --- /dev/null +++ b/mkspecs/features/exclusive_builds_post.prf @@ -0,0 +1,160 @@ + +contains(TEMPLATE, subdirs) { + for(build, QMAKE_EXCLUSIVE_BUILDS) { + prepareRecursiveTarget($$build) + QMAKE_EXTRA_TARGETS += $$build + } +} else { + # Recursively combines a list of exclusive builds into combinations + # of non-exclusive builds (separated by a ':' character), eg the + # list [debug, release, static, shared] will result in the four + # combinations [debug:static, debug:shared, release:static, + # release:shared]. + defineReplace(combineExclusiveBuilds) { + permutationBuilds = $$1 + existingBuilds = $$2 + + isEmpty(permutationBuilds): \ + # Exit-condition, no more recursing + return($$existingBuilds) + + # Choose the first build of the permutations and use the set of exclusive + # builds associated with that build as the list of existing builds. This + # partitions the permutations into one set of exclusive builds + the rest + # of the unknown permutations. + newExistingBuilds = $$eval($$first(permutationBuilds).exclusive) + permutationBuilds -= $$newExistingBuilds + + # Recursively compute the combination of these two sets + recursiveCombination = $$combineExclusiveBuilds($$permutationBuilds, $$newExistingBuilds) + + isEmpty(existingBuilds): \ + # No need to combine further + return($$recursiveCombination) + + result = + for(existingBuild, existingBuilds) { + for(combination, recursiveCombination): \ + result += "$${existingBuild}:$${combination}" + } + return($$result) + } + + buildCombinations = $$combineExclusiveBuilds($$QMAKE_EXCLUSIVE_BUILDS) + + for(combination, buildCombinations) { + builds = $$split(combination, :) + key = + config = + target = + priority = + for(build, builds) { + key = $${key}$$eval($${build}.name) + config *= $$eval($${build}.CONFIG) $${build} $$eval($${build}.name)Build + target += $$eval($${build}.target) + + # If a build has been prioritized through CONFIG we prefer that + CONFIG($$build, $$join($${build}.exclusive, |)): \ + priority += 1 + } + + $${key}.name = $$key + $${key}.target = $$join(target, -) + $${key}.CONFIG = $$config + $${key}.builds = $$builds + + BUILDS.$$size(priority) += $$key + + # Add makefile targets for each exclusive build that will aggregate all targets + # that include the exclusive build. This matches the targets in the SUBDIR files + # so that you can recursivly build a single exclusive build. + !build_pass:count(builds, 1, >) { + for(build, builds) { + $${build}.depends += $$eval($${key}.target) + QMAKE_EXTRA_TARGETS *= $$build + } + } + } + + BUILDS = + priority = + for(ever) { + # Keep the order in BUILDS matching the priority from CONFIG, so that the first + # entry in BUILDS will be the first/default target when not CONFIG(build_all). + BUILDS = $$eval(BUILDS.$$size(priority)) $$BUILDS + count(BUILDS, $$size(buildCombinations), >=): break() + priority += 1 + } + + build_pass|fix_output_dirs { + !build_pass { + # The builds are sorted by priority based on the current config + # so choosing the first one gives us the most appropriate build. + BUILD_PASS = $$first(BUILDS) + } + + for(dir, QMAKE_DIR_REPLACE) { + + # Limit builds to ones that should affect the current $$dir + builds = + for(build, $${BUILD_PASS}.builds) { + equals(dir, DESTDIR) { + !$$join($${build}.exclusive, _and_)_target: \ + next() + } + + builds += $$build + } + + isEmpty(builds): \ + next() + + affixes = + for(build, builds): \ + affixes += $$eval($${build}.dir_affix) + full_dir_affix = $$join(affixes, -) + + isEmpty($$dir)|isEqual($$dir, .) { + # Use affix directly + $$dir = $$full_dir_affix + next() + } + + contains(QMAKE_DIR_REPLACE_SANE, $$dir) { + # Suffix output dir + $$dir = $$clean_path($$eval($$dir)/$$full_dir_affix) + } else { + # "Compatibility mode" with QTBUG-491 + for(build, builds) { + did_replace = false + build_affix = $$eval($${build}.dir_affix) + for(exclusive, $${build}.exclusive) { + equals(exclusive, $$build): \ + next() + + exclusive_affix = $$eval($${exclusive}.dir_affix) + contains($$dir, .*$${exclusive_affix}.*) { + $$dir ~= s/$${exclusive_affix}/$${build_affix}/gi + did_replace = true + } + } + $$did_replace: next() + + # Append (as subdir or as suffix) + !build_pass { + dir_affix = $$eval($${build}.dir_affix) + !contains($$dir, .*$${dir_affix}.*) { + contains($$dir, .*/$) { + # Subdir + $$dir = $$eval($$dir)$$dir_affix + } else { + # Suffix + $$dir = $$eval($$dir)-$${dir_affix} + } + } + } + } + } + } + } +} diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf index a29e09cbc56..faa7a44f67a 100644 --- a/mkspecs/features/qt_build_config.prf +++ b/mkspecs/features/qt_build_config.prf @@ -20,6 +20,14 @@ debug(1, "Not loading qmodule.pri twice") } +PRECOMPILED_DIR = .pch +OBJECTS_DIR = .obj +MOC_DIR = .moc +RCC_DIR = .rcc +UI_DIR = .uic + +QMAKE_DIR_REPLACE_SANE = PRECOMPILED_DIR OBJECTS_DIR MOC_DIR RCC_DIR UI_DIR + # force_independent can be set externally. prefix_build not. !exists($$[QT_HOST_DATA]/.qmake.cache): \ CONFIG += prefix_build force_independent diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf index 746e2878a70..22d66e89077 100644 --- a/mkspecs/features/qt_common.prf +++ b/mkspecs/features/qt_common.prf @@ -9,6 +9,9 @@ # We mean it. # +QMAKE_DIR_REPLACE_SANE += DESTDIR +CONFIG -= debug_and_release_target + contains(QT_CONFIG, c++11): CONFIG += c++11 contains(TEMPLATE, .*lib) { # module and plugins diff --git a/mkspecs/features/resolve_config.prf b/mkspecs/features/resolve_config.prf index 3884598a941..7835fe4f7c0 100644 --- a/mkspecs/features/resolve_config.prf +++ b/mkspecs/features/resolve_config.prf @@ -22,14 +22,8 @@ CONFIG(static, static|shared) { contains(TEMPLATE, ".*lib"): CONFIG += dll } -static_and_shared { - !macx-xcode: addExclusiveBuilds(static, Static, shared, Shared) -} else: fix_output_dirs { - static: \ - fixExclusiveOutputDirs(static, shared) - else: \ - fixExclusiveOutputDirs(shared, static) -} +!macx-xcode: \ + addExclusiveBuilds(shared, static) CONFIG(debug, debug|release): \ CONFIG -= release @@ -37,14 +31,7 @@ else: \ CONFIG -= debug !macx-xcode { - debug_and_release { - addExclusiveBuilds(debug, Debug, release, Release) - } else: fix_output_dirs { - debug: \ - fixExclusiveOutputDirs(debug, release) - else: \ - fixExclusiveOutputDirs(release, debug) - } + addExclusiveBuilds(debug, release) } else { # The Xcode generator always generates project files with # debug and release configurations, regardless of whether diff --git a/mkspecs/features/resolve_target.prf b/mkspecs/features/resolve_target.prf index 22d7722ce3e..fe5808940a7 100644 --- a/mkspecs/features/resolve_target.prf +++ b/mkspecs/features/resolve_target.prf @@ -11,6 +11,8 @@ load(resolve_config) +exclusive_builds: load(exclusive_builds_post) + QMAKE_RESOLVED_TARGET = $$absolute_path($$DESTDIR, $$OUT_PWD)/ win32 { diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 15c35a630fe..cc35b425a66 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2613,7 +2613,6 @@ void Configure::generateOutputVars() if (dictionary[ "FORCEDEBUGINFO" ] == "yes") qmakeConfig += "force_debug_info"; qmakeConfig += dictionary[ "BUILD" ]; - dictionary[ "QMAKE_OUTDIR" ] = dictionary[ "BUILD" ]; if (buildParts.isEmpty()) { buildParts = defaultBuildParts; @@ -2638,9 +2637,6 @@ void Configure::generateOutputVars() qmakeVars += "QMAKE_QT_VERSION_OVERRIDE = " + version.left(version.indexOf('.')); version.remove(QLatin1Char('.')); } - dictionary[ "QMAKE_OUTDIR" ] += "_shared"; - } else { - dictionary[ "QMAKE_OUTDIR" ] += "_static"; } if (dictionary[ "ACCESSIBILITY" ] == "yes") @@ -2771,10 +2767,6 @@ void Configure::generateOutputVars() if (dictionary.contains("XQMAKESPEC") && dictionary[ "XQMAKESPEC" ].startsWith("linux")) qtConfig += "rpath"; - qmakeVars += QString("OBJECTS_DIR = ") + formatPath(".obj/" + dictionary["QMAKE_OUTDIR"]); - qmakeVars += QString("MOC_DIR = ") + formatPath(".moc/" + dictionary["QMAKE_OUTDIR"]); - qmakeVars += QString("RCC_DIR = ") + formatPath(".rcc/" + dictionary["QMAKE_OUTDIR"]); - if (!qmakeDefines.isEmpty()) qmakeVars += QString("DEFINES += ") + qmakeDefines.join(' '); if (!qmakeIncludes.isEmpty()) From a0da5290ff1898c456e34e03cc7a994984172880 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Fri, 25 Oct 2013 14:43:42 +0100 Subject: [PATCH 036/494] QWindowsKeyMapper: Added some comments about functionality + cleanup Change-Id: Ieabdea7601ea0eba08eac701b2fdf27b4cd2ff45 Reviewed-by: Friedemann Kleint --- .../platforms/windows/qwindowskeymapper.cpp | 38 +++++++------------ .../platforms/windows/qwindowskeymapper.h | 2 - 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index 02795283b23..e2594207fed 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -97,6 +97,8 @@ struct KeyRecord { QString text; }; +// We need to record the pressed keys in order to decide, whether the key event is an autorepeat +// event. As soon as its state changes, the chain of autorepeat events will be broken. static const int QT_MAX_KEY_RECORDINGS = 64; // User has LOTS of fingers... struct KeyRecorder { @@ -503,12 +505,6 @@ static inline int toKeyOrUnicode(int vk, int scancode, unsigned char *kbdBuffer, return code == Qt::Key_unknown ? 0 : code; } -int qt_translateKeyCode(int vk) -{ - int code = winceKeyBend((vk < 0 || vk > 255) ? 0 : vk); - return code == Qt::Key_unknown ? 0 : code; -} - static inline int asciiToKeycode(char a, int state) { if (a >= 'a' && a <= 'z') @@ -554,12 +550,8 @@ void QWindowsKeyMapper::changeKeyboard() keyboardInputDirection = bidi ? Qt::RightToLeft : Qt::LeftToRight; } -void QWindowsKeyMapper::clearRecordedKeys() -{ - key_recorder.clearKeys(); -} - - +// Helper function that is used when obtaining the list of characters that can be produced by one key and +// every possible combination of modifiers inline void setKbdState(unsigned char *kbd, bool shift, bool ctrl, bool alt) { kbd[VK_LSHIFT ] = (shift ? 0x80 : 0); @@ -570,6 +562,7 @@ inline void setKbdState(unsigned char *kbd, bool shift, bool ctrl, bool alt) kbd[VK_MENU ] = (alt ? 0x80 : 0); } +// Adds the msg's key to keyLayout if it is not yet present there void QWindowsKeyMapper::updateKeyMap(const MSG &msg) { unsigned char kbdBuffer[256]; // Will hold the complete keyboard state @@ -578,6 +571,9 @@ void QWindowsKeyMapper::updateKeyMap(const MSG &msg) updatePossibleKeyCodes(kbdBuffer, scancode, msg.wParam); } +// Fills keyLayout for that vk_key. Values are all characters one can type using that key +// (in connection with every combination of modifiers) and whether these "characters" are +// dead keys. void QWindowsKeyMapper::updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32 scancode, quint32 vk_key) { @@ -598,6 +594,10 @@ void QWindowsKeyMapper::updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32 buffer[VK_RCONTROL] = 0; buffer[VK_LMENU ] = 0; // Use right Alt, since left Ctrl + right Alt is considered AltGraph + // keyLayout contains the actual characters which can be written using the vk_key together with the + // different modifiers. '2' together with shift will for example cause the character + // to be @ for a US key layout (thus keyLayout[vk_key].qtKey[1] will be @). In addition to that + // it stores whether the resulting key is a dead key as these keys have to be handled later. bool isDeadKey = false; keyLayout[vk_key].deadkeys = 0; keyLayout[vk_key].dirty = false; @@ -635,7 +635,8 @@ void QWindowsKeyMapper::updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32 } keyLayout[vk_key].qtKey[8] = fallbackKey; - // If this vk_key makes a dead key with any combination of modifiers + // If one of the values inserted into the keyLayout above, can be considered a dead key, we have + // to run the workaround below. if (keyLayout[vk_key].deadkeys) { // Push a Space, then the original key through the low-level ToAscii functions. // We do this because these functions (ToAscii / ToUnicode) will alter the internal state of @@ -661,17 +662,6 @@ void QWindowsKeyMapper::updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32 } } -bool QWindowsKeyMapper::isADeadKey(unsigned int vk_key, unsigned int modifiers) -{ - if ((vk_key < NumKeyboardLayoutItems) && keyLayout[vk_key].exists) { - for (size_t i = 0; i < NumMods; ++i) { - if (uint(ModsTbl[i]) == modifiers) - return bool(keyLayout[vk_key].deadkeys & 1< Date: Thu, 24 Oct 2013 11:32:15 +0200 Subject: [PATCH 037/494] eglfs: Perform initialization in initialize() instead of the constructor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move (almost) everything to initialize(). Doing so allows the QEglFSScreen constructor, the hooks' platformInit() and others to perform tasks that need the event dispatcher. Task-number: QTBUG-34208 Change-Id: If64e3d1691c41752c53968f8d4fb063b45345680 Reviewed-by: Tor Arne Vestbø --- .../platforms/eglfs/qeglfsintegration.cpp | 47 ++++++++++--------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 67f0c35ed7e..8a526dbff5f 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -79,30 +79,9 @@ QT_BEGIN_NAMESPACE QEglFSIntegration::QEglFSIntegration() : mFontDb(new QGenericUnixFontDatabase) , mServices(new QGenericUnixServices) + , mScreen(0) , mInputContext(0) { - QEglFSHooks::hooks()->platformInit(); - - EGLint major, minor; - - if (!eglBindAPI(EGL_OPENGL_ES_API)) { - qWarning("Could not bind GL_ES API\n"); - qFatal("EGL error"); - } - - mDisplay = eglGetDisplay(QEglFSHooks::hooks() ? QEglFSHooks::hooks()->platformDisplay() : EGL_DEFAULT_DISPLAY); - if (mDisplay == EGL_NO_DISPLAY) { - qWarning("Could not open egl display\n"); - qFatal("EGL error"); - } - - if (!eglInitialize(mDisplay, &major, &minor)) { - qWarning("Could not initialize egl display\n"); - qFatal("EGL error"); - } - - mScreen = new QEglFSScreen(mDisplay); - screenAdded(mScreen); } QEglFSIntegration::~QEglFSIntegration() @@ -166,7 +145,31 @@ QAbstractEventDispatcher *QEglFSIntegration::createEventDispatcher() const void QEglFSIntegration::initialize() { + QEglFSHooks::hooks()->platformInit(); + + EGLint major, minor; + + if (!eglBindAPI(EGL_OPENGL_ES_API)) { + qWarning("Could not bind GL_ES API\n"); + qFatal("EGL error"); + } + + mDisplay = eglGetDisplay(QEglFSHooks::hooks() ? QEglFSHooks::hooks()->platformDisplay() : EGL_DEFAULT_DISPLAY); + if (mDisplay == EGL_NO_DISPLAY) { + qWarning("Could not open egl display\n"); + qFatal("EGL error"); + } + + if (!eglInitialize(mDisplay, &major, &minor)) { + qWarning("Could not initialize egl display\n"); + qFatal("EGL error"); + } + + mScreen = new QEglFSScreen(mDisplay); + screenAdded(mScreen); + mInputContext = QPlatformInputContextFactory::create(); + createInputHandlers(); } From 1d039184543c3c1079a56e98ca22d9774166ed3f Mon Sep 17 00:00:00 2001 From: Cristian Tarsoaga Date: Sun, 13 Oct 2013 23:33:15 +0300 Subject: [PATCH 038/494] Fix - psql driver must format qdatetime using iso QDateTime must be formatted as ISO8601 specifies, date/month must pe padded with 0 until width is 2 Task-number:QTBUG-33389 Change-Id: If07bcaa976ea3583369da3fd21ce442ee30e8c1f Reviewed-by: Lars Knoll --- src/sql/drivers/psql/qsql_psql.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp index 9331f5c3714..fd5990f3ee4 100644 --- a/src/sql/drivers/psql/qsql_psql.cpp +++ b/src/sql/drivers/psql/qsql_psql.cpp @@ -1253,8 +1253,8 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const QTime tm = field.value().toDateTime().time(); // msecs need to be right aligned otherwise psql interprets them wrong r = QLatin1Char('\'') + QString::number(dt.year()) + QLatin1Char('-') - + QString::number(dt.month()) + QLatin1Char('-') - + QString::number(dt.day()) + QLatin1Char(' ') + + QString::number(dt.month()).rightJustified(2, QLatin1Char('0')) + QLatin1Char('-') + + QString::number(dt.day()).rightJustified(2, QLatin1Char('0')) + QLatin1Char(' ') + tm.toString() + QLatin1Char('.') + QString::number(tm.msec()).rightJustified(3, QLatin1Char('0')) + QLatin1Char('\''); From 942a59d8fbb1ab6956887f6caa3c0595798b8afc Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 25 Oct 2013 14:05:16 +0200 Subject: [PATCH 039/494] remove some vestiges of QFontEngineQPF amends d7e424ee66. Change-Id: I9aaef14f8ecba78685ce5f7e908a0b42e554434f Reviewed-by: thiago Reviewed-by: paulot Reviewed-by: Konstantin Ritt Reviewed-by: Lars Knoll --- src/gui/painting/qpaintengine.h | 6 --- src/gui/text/qfontengine_ft.cpp | 1 - src/gui/text/qpfutil.cpp | 66 --------------------------------- 3 files changed, 73 deletions(-) delete mode 100644 src/gui/text/qpfutil.cpp diff --git a/src/gui/painting/qpaintengine.h b/src/gui/painting/qpaintengine.h index b4dec2929d1..18b6d84146e 100644 --- a/src/gui/painting/qpaintengine.h +++ b/src/gui/painting/qpaintengine.h @@ -247,12 +247,6 @@ private: friend class QFontEngineBox; friend class QFontEngineMac; friend class QFontEngineWin; -#ifndef QT_NO_QWS_QPF - friend class QFontEngineQPF1; -#endif -#ifndef QT_NO_QWS_QPF2 - friend class QFontEngineQPF; -#endif friend class QMacPrintEngine; friend class QMacPrintEnginePrivate; friend class QFontEngineQPA; diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 328931e1ebc..8c266fe7b68 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -699,7 +699,6 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format, line_thickness = QFixed::fromFixed(FT_MulFix(face->underline_thickness, face->size->metrics.y_scale)); underline_position = QFixed::fromFixed(-FT_MulFix(face->underline_position, face->size->metrics.y_scale)); } else { - // copied from QFontEngineQPF // ad hoc algorithm int score = fontDef.weight * fontDef.pixelSize; line_thickness = score / 700; diff --git a/src/gui/text/qpfutil.cpp b/src/gui/text/qpfutil.cpp deleted file mode 100644 index cf955e91e5b..00000000000 --- a/src/gui/text/qpfutil.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -static const QFontEngineQPF::TagType tagTypes[QFontEngineQPF::NumTags] = { - QFontEngineQPF::StringType, // FontName - QFontEngineQPF::StringType, // FileName - QFontEngineQPF::UInt32Type, // FileIndex - QFontEngineQPF::UInt32Type, // FontRevision - QFontEngineQPF::StringType, // FreeText - QFontEngineQPF::FixedType, // Ascent - QFontEngineQPF::FixedType, // Descent - QFontEngineQPF::FixedType, // Leading - QFontEngineQPF::FixedType, // XHeight - QFontEngineQPF::FixedType, // AverageCharWidth - QFontEngineQPF::FixedType, // MaxCharWidth - QFontEngineQPF::FixedType, // LineThickness - QFontEngineQPF::FixedType, // MinLeftBearing - QFontEngineQPF::FixedType, // MinRightBearing - QFontEngineQPF::FixedType, // UnderlinePosition - QFontEngineQPF::UInt8Type, // GlyphFormat - QFontEngineQPF::UInt8Type, // PixelSize - QFontEngineQPF::UInt8Type, // Weight - QFontEngineQPF::UInt8Type, // Style - QFontEngineQPF::StringType, // EndOfHeader - QFontEngineQPF::BitFieldType// WritingSystems -}; - - From d5a16e4a3c02bd273e1d7329eb02e3e7f60c0b7f Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 22 Oct 2013 06:28:27 +0300 Subject: [PATCH 040/494] Add QMAKE_PKGCONFIG_VERSION variable to allow version overriding Change-Id: Ibba50c74f308d81e0058e4dacec7ed84e738473e Reviewed-by: Oswald Buddenhagen --- qmake/generators/makefile.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index f567b6c6942..3093c834cc9 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -3270,7 +3270,11 @@ MakefileGenerator::writePkgConfigFile() } } t << "Description: " << desc << endl; - t << "Version: " << project->first("VERSION") << endl; + ProString version = project->first("QMAKE_PKGCONFIG_VERSION"); + if (version.isEmpty()) + version = project->first("VERSION"); + if (!version.isEmpty()) + t << "Version: " << version << endl; // libs t << "Libs: "; From 338da730e8bc23e227e26b094cba6bb6233c42de Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Fri, 25 Oct 2013 10:56:01 +0200 Subject: [PATCH 041/494] network: fix multi-phased NTLM authentication tested manually with internal NTLM proxy. Patch-by: Jonathan Lauvernier Change-Id: Ib3ed7aff12cb8d59ffc2b11ecc1c4fdc04acb368 Reviewed-by: Richard J. Moore --- src/network/kernel/qauthenticator.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp index e1a24a226ff..8c16486878c 100644 --- a/src/network/kernel/qauthenticator.cpp +++ b/src/network/kernel/qauthenticator.cpp @@ -189,7 +189,7 @@ QAuthenticator &QAuthenticator::operator=(const QAuthenticator &other) d->realm = other.d->realm; d->method = other.d->method; d->options = other.d->options; - } else { + } else if (d->phase == QAuthenticatorPrivate::Start) { delete d; d = 0; } @@ -267,7 +267,8 @@ void QAuthenticator::detach() return; } - d->phase = QAuthenticatorPrivate::Start; + if (d->phase == QAuthenticatorPrivate::Done) + d->phase = QAuthenticatorPrivate::Start; } /*! From 862a8d46c3cb0b59100e4fa9bb1e34b517df78ee Mon Sep 17 00:00:00 2001 From: Geir Vattekar Date: Fri, 25 Oct 2013 13:24:07 +0200 Subject: [PATCH 042/494] Doc: Added a new Qt Creator \externalpage Change-Id: I9408e4e2c78b6e734b1478d570a5fc3d382fe124 Reviewed-by: Jerome Pasion Reviewed-by: Leena Miettinen --- doc/global/externalsites/qtcreator.qdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/global/externalsites/qtcreator.qdoc b/doc/global/externalsites/qtcreator.qdoc index 9ac80eb831e..d6b19083037 100644 --- a/doc/global/externalsites/qtcreator.qdoc +++ b/doc/global/externalsites/qtcreator.qdoc @@ -369,6 +369,12 @@ \externalpage http://qt-project.org/doc/qtcreator/creator-deploying-android.html \title Qt Creator: Deploying Applications to Android Devices */ + +/*! + \externalpage http://qt-project.org/doc/qtcreator/creator-developing-ios.html + \title Qt Creator: Connecting iOS devices +*/ + /*! \externalpage http://qt-project.org/doc/qtcreator/creator-developing-android.html \title Qt Creator: Connecting Android Devices From 1ea191276ea49ce2334d21b1f4a2c66ee8889466 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 8 Oct 2013 13:31:19 +0200 Subject: [PATCH 043/494] QWizard: give all buttons an objectName Only Commit, Finish and Cancel didn't have an object name, yet. Also Extract Method on the switch statement, add a test, and use QStringBuilder. Task-number: QTBUG-29924 Reported-by: Leo Arias Change-Id: I8c29606bc53e9d4caab631da2089e971a9da2d75 Reviewed-by: Friedemann Kleint --- src/widgets/dialogs/qwizard.cpp | 29 +++++++------ .../widgets/dialogs/qwizard/tst_qwizard.cpp | 42 +++++++++++++++++++ 2 files changed, 58 insertions(+), 13 deletions(-) diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index 02ad5a3be5f..4e82167049a 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -1345,6 +1345,21 @@ void QWizardPrivate::updateCurrentPage() updateButtonTexts(); } +static QString object_name_for_button(QWizard::WizardButton which) +{ + switch (which) { + case QWizard::CommitButton: + return QLatin1String("qt_wizard_") + QLatin1String("commit"); + case QWizard::FinishButton: + return QLatin1String("qt_wizard_") + QLatin1String("finish"); + case QWizard::CancelButton: + return QLatin1String("qt_wizard_") + QLatin1String("cancel"); + default: + // Make navigation buttons detectable as passive interactor in designer + return QLatin1String("__qt__passive_wizardbutton") + QString::number(which); + } +} + bool QWizardPrivate::ensureButton(QWizard::WizardButton which) const { Q_Q(const QWizard); @@ -1356,19 +1371,7 @@ bool QWizardPrivate::ensureButton(QWizard::WizardButton which) const QStyle *style = q->style(); if (style != QApplication::style()) // Propagate style pushButton->setStyle(style); - // Make navigation buttons detectable as passive interactor in designer - switch (which) { - case QWizard::CommitButton: - case QWizard::FinishButton: - case QWizard::CancelButton: - break; - default: { - QString objectName = QLatin1String("__qt__passive_wizardbutton"); - objectName += QString::number(which); - pushButton->setObjectName(objectName); - } - break; - } + pushButton->setObjectName(object_name_for_button(which)); #ifdef Q_OS_MACX pushButton->setAutoDefault(false); #endif diff --git a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp index 4506d0af141..a711bc28e3b 100644 --- a/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp +++ b/tests/auto/widgets/dialogs/qwizard/tst_qwizard.cpp @@ -52,6 +52,8 @@ #include #include +Q_DECLARE_METATYPE(QWizard::WizardButton); + static QImage grabWidget(QWidget *window) { return window->grab().toImage(); @@ -100,6 +102,8 @@ private slots: void setWizardStyle(); void removePage(); void sideWidget(); + void objectNames_data(); + void objectNames(); // task-specific tests below me: void task177716_disableCommitButton(); @@ -2384,6 +2388,44 @@ void tst_QWizard::sideWidget() QVERIFY(wizard.sideWidget() == 0); } +void tst_QWizard::objectNames_data() +{ + QTest::addColumn("wizardButton"); + QTest::addColumn("buttonName"); + + QTest::newRow("BackButton") << QWizard::BackButton << QStringLiteral("__qt__passive_wizardbutton0"); + QTest::newRow("NextButton") << QWizard::NextButton << QStringLiteral("__qt__passive_wizardbutton1"); + QTest::newRow("CommitButton") << QWizard::CommitButton << QStringLiteral("qt_wizard_commit"); + QTest::newRow("FinishButton") << QWizard::FinishButton << QStringLiteral("qt_wizard_finish"); + QTest::newRow("CancelButton") << QWizard::CancelButton << QStringLiteral("qt_wizard_cancel"); + QTest::newRow("HelpButton") << QWizard::HelpButton << QStringLiteral("__qt__passive_wizardbutton5"); + QTest::newRow("CustomButton1") << QWizard::CustomButton1 << QStringLiteral("__qt__passive_wizardbutton6"); + QTest::newRow("CustomButton2") << QWizard::CustomButton2 << QStringLiteral("__qt__passive_wizardbutton7"); + QTest::newRow("CustomButton3") << QWizard::CustomButton3 << QStringLiteral("__qt__passive_wizardbutton8"); +} + +void tst_QWizard::objectNames() +{ + QFETCH(QWizard::WizardButton, wizardButton); + QFETCH(QString, buttonName); + + QWizard wizard; + QList buttons = QList() + << QWizard::BackButton + << QWizard::NextButton + << QWizard::CommitButton + << QWizard::FinishButton + << QWizard::CancelButton + << QWizard::HelpButton + << QWizard::CustomButton1 + << QWizard::CustomButton2 + << QWizard::CustomButton3 + ; + QVERIFY(buttons.contains(wizardButton)); + QVERIFY(wizard.button(wizardButton)); + QCOMPARE(wizard.button(wizardButton)->objectName(), buttonName); +} + class task177716_CommitPage : public QWizardPage { Q_OBJECT From 269590516d89a35ea3121366f7d4bf43b0d391ca Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 25 Oct 2013 19:17:28 +0200 Subject: [PATCH 044/494] QWizard: provoke 'enum value not handled in switch' warnings in object_name_for_button This is strictly speaking a behavior change, since we're no longer returning something for Stretch and NoButton, but - guessing here - that shouldn't matter. Yet, better safe than sorry, thus submitted as a separate patch. Change-Id: I20cb084147f8c9257ce37d1e87ea38febabec28d Reviewed-by: Friedemann Kleint --- src/widgets/dialogs/qwizard.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index 4e82167049a..a667f299e84 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -1354,10 +1354,22 @@ static QString object_name_for_button(QWizard::WizardButton which) return QLatin1String("qt_wizard_") + QLatin1String("finish"); case QWizard::CancelButton: return QLatin1String("qt_wizard_") + QLatin1String("cancel"); - default: + case QWizard::BackButton: + case QWizard::NextButton: + case QWizard::HelpButton: + case QWizard::CustomButton1: + case QWizard::CustomButton2: + case QWizard::CustomButton3: // Make navigation buttons detectable as passive interactor in designer return QLatin1String("__qt__passive_wizardbutton") + QString::number(which); + case QWizard::Stretch: + case QWizard::NoButton: + //case QWizard::NStandardButtons: + //case QWizard::NButtons: + ; } + Q_UNREACHABLE(); + return QString(); } bool QWizardPrivate::ensureButton(QWizard::WizardButton which) const From eb921e6edc3906ac90e8155f063b6c71df6386be Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 28 Oct 2013 09:47:34 +0100 Subject: [PATCH 045/494] Remove unused static function systemtimeToMsecs() See also commit 660aed3516f91c that removed the reverse method. Change-Id: Ib20c5be863ba6644485c581e3ece47a390ce467d Reviewed-by: Friedemann Kleint --- src/corelib/tools/qtimezoneprivate_win.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/corelib/tools/qtimezoneprivate_win.cpp b/src/corelib/tools/qtimezoneprivate_win.cpp index c219a49e1ee..efdd6676fb1 100644 --- a/src/corelib/tools/qtimezoneprivate_win.cpp +++ b/src/corelib/tools/qtimezoneprivate_win.cpp @@ -106,14 +106,6 @@ static QDate msecsToDate(qint64 msecs) return QDate::fromJulianDay(jd); } -static qint64 systemtimeToMsecs(const SYSTEMTIME &systemtime) -{ - FILETIME utcFileTime; - SystemTimeToFileTime(&systemtime, &utcFileTime); - ULONGLONG utcNSecs = (((ULONGLONG) utcFileTime.dwHighDateTime) << 32) + utcFileTime.dwLowDateTime; - return (utcNSecs - FILETIME_UNIX_EPOCH) / 10000; -} - static bool equalSystemtime(const SYSTEMTIME &t1, const SYSTEMTIME &t2) { return (t1.wYear == t2.wYear From 3567f4c2fc9ee45898ed9a0784051d4fa64897e2 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Fri, 25 Oct 2013 22:23:30 +0800 Subject: [PATCH 046/494] Doc: Update boost::bind()/std::tr1::bind() to std::bind() boost::bind() became part of the C++11 standard with minor modifications. Present the standard version as the main one to use, but list the others as alternatives. Change-Id: If419d8d24c0925119d3b9f7ff76be44981351bc0 Reviewed-by: Olivier Goffart Reviewed-by: Jerome Pasion --- .../code/src_concurrent_qtconcurrentfilter.cpp | 4 ++-- .../code/src_concurrent_qtconcurrentmap.cpp | 4 ++-- .../code/src_concurrent_qtconcurrentrun.cpp | 2 +- src/concurrent/qtconcurrentfilter.cpp | 14 +++++--------- src/concurrent/qtconcurrentmap.cpp | 14 +++++--------- src/concurrent/qtconcurrentrun.cpp | 13 +++++-------- 6 files changed, 20 insertions(+), 31 deletions(-) diff --git a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp index 7160f80b34a..9afcdc9740f 100644 --- a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp +++ b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentfilter.cpp @@ -136,7 +136,7 @@ bool QString::contains(const QRegExp ®exp) const; //! [10] -boost::bind(&QString::contains, QRegExp("^\\S+$")); // matches strings without whitespace +std::bind(&QString::contains, QRegExp("^\\S+$")); // matches strings without whitespace //! [10] @@ -147,7 +147,7 @@ bool contains(const QString &string) //! [12] QStringList strings = ...; -boost::bind(static_cast( &QString::contains ), QRegExp("..." )); +std::bind(static_cast( &QString::contains ), QRegExp("..." )); //! [12] //! [13] diff --git a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp index 756ca3902c9..634c03e8084 100644 --- a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp +++ b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentmap.cpp @@ -149,7 +149,7 @@ QImage QImage::scaledToWidth(int width, Qt::TransformationMode) const; //! [11] -boost::bind(&QImage::scaledToWidth, 100, Qt::SmoothTransformation) +std::bind(&QImage::scaledToWidth, 100, Qt::SmoothTransformation) //! [11] @@ -160,7 +160,7 @@ QImage scaledToWith(const QImage &image) //! [13] QList images = ...; -QFuture thumbnails = QtConcurrent::mapped(images, boost::bind(&QImage::scaledToWidth, 100 Qt::SmoothTransformation)); +QFuture thumbnails = QtConcurrent::mapped(images, std::bind(&QImage::scaledToWidth, 100 Qt::SmoothTransformation)); //! [13] //! [14] diff --git a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentrun.cpp b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentrun.cpp index 7288fc642b8..8922e41f340 100644 --- a/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentrun.cpp +++ b/src/concurrent/doc/snippets/code/src_concurrent_qtconcurrentrun.cpp @@ -93,6 +93,6 @@ future.waitForFinished(); //! [6] void someFunction(int arg1, double arg2); -QFuture future = QtConcurrent::run(boost::bind(someFunction, 1, 2.0)); +QFuture future = QtConcurrent::run(std::bind(someFunction, 1, 2.0)); ... //! [6] diff --git a/src/concurrent/qtconcurrentfilter.cpp b/src/concurrent/qtconcurrentfilter.cpp index 22a1243c187..a58c52edc13 100644 --- a/src/concurrent/qtconcurrentfilter.cpp +++ b/src/concurrent/qtconcurrentfilter.cpp @@ -155,15 +155,11 @@ \section2 Using Bound Function Arguments - Note that Qt does not provide support for bound functions. This is - provided by 3rd party libraries like - \l{http://www.boost.org/libs/bind/bind.html}{Boost} or - \l{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf} - {C++ TR1 Library Extensions}. - If you want to use a filter function takes more than one argument, you can - use boost::bind() or std::tr1::bind() to transform it onto a function that - takes one argument. + use std::bind() to transform it onto a function that takes one argument. If + C++11 support is not available, \l{http://www.boost.org/libs/bind/bind.html} + {boost::bind()} or \l{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf} + {std::tr1::bind()} are suitable replacements. As an example, we use QString::contains(): @@ -177,7 +173,7 @@ \snippet code/src_concurrent_qtconcurrentfilter.cpp 10 - The return value from boost::bind() is a function object (functor) with + The return value from std::bind() is a function object (functor) with the following signature: \snippet code/src_concurrent_qtconcurrentfilter.cpp 11 diff --git a/src/concurrent/qtconcurrentmap.cpp b/src/concurrent/qtconcurrentmap.cpp index da2a601ae27..5233a9db457 100644 --- a/src/concurrent/qtconcurrentmap.cpp +++ b/src/concurrent/qtconcurrentmap.cpp @@ -204,15 +204,11 @@ \section2 Using Bound Function Arguments - Note that Qt does not provide support for bound functions. This is - provided by 3rd party libraries like - \l{http://www.boost.org/libs/bind/bind.html}{Boost} or - \l{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf}{C++ - TR1 Library Extensions}. - If you want to use a map function that takes more than one argument you can - use boost::bind() or std::tr1::bind() to transform it onto a function that - takes one argument. + use std::bind() to transform it onto a function that takes one argument. If + C++11 support is not available, \l{http://www.boost.org/libs/bind/bind.html} + {boost::bind()} or \l{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf} + {std::tr1::bind()} are suitable replacements. As an example, we'll use QImage::scaledToWidth(): @@ -226,7 +222,7 @@ \snippet code/src_concurrent_qtconcurrentmap.cpp 11 - The return value from boost::bind() is a function object (functor) with + The return value from std::bind() is a function object (functor) with the following signature: \snippet code/src_concurrent_qtconcurrentmap.cpp 12 diff --git a/src/concurrent/qtconcurrentrun.cpp b/src/concurrent/qtconcurrentrun.cpp index 4398e1a91fe..c60fa147773 100644 --- a/src/concurrent/qtconcurrentrun.cpp +++ b/src/concurrent/qtconcurrentrun.cpp @@ -110,15 +110,12 @@ \section2 Using Bound Function Arguments - Note that Qt does not provide support for bound functions. This is - provided by 3rd party libraries like - \l{http://www.boost.org/libs/bind/bind.html}{Boost} or - \l{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf} - {C++ TR1 Library Extensions}. + You can use std::bind() to \e bind a number of arguments to a function when + called. If C++11 support is not available, \l{http://www.boost.org/libs/bind/bind.html} + {boost::bind()} or \l{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf} + {std::tr1::bind()} are suitable replacements. - You can use boost::bind() or std::tr1::bind() to \e bind a number of - arguments to a function when called. There are number of reasons for doing - this: + There are number of reasons for binding: \list \li To call a function that takes more than 5 arguments. From 40e69879a2ea2b3f8590075660d94e1ab85c8f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 25 Oct 2013 14:42:48 +0200 Subject: [PATCH 047/494] iOS: Set ARCHS in Xcode project for both simulator and device SDKs Removes the need to pass ARCHS to xcodebuild for simulator builds. Change-Id: If15e9d387c416c5c9f83c50f5903ae0cd517ff34 Reviewed-by: Oswald Buddenhagen Reviewed-by: Richard Moe Gustavsen --- .../macx-ios-clang/features/default_post.prf | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf index 5121de1d127..dc41047b641 100644 --- a/mkspecs/macx-ios-clang/features/default_post.prf +++ b/mkspecs/macx-ios-clang/features/default_post.prf @@ -61,15 +61,21 @@ macx-xcode { QMAKE_MAC_XCODE_SETTINGS += ios_device_family } -# Be more specific about which architecture we're targeting -equals(QT_ARCH, arm): \ - actual_archs = $$QMAKE_IOS_DEVICE_ARCHS -else: \ - actual_archs = $$QMAKE_IOS_SIMULATOR_ARCHS - macx-xcode { - QMAKE_XCODE_ARCHS = $$actual_archs + arch_iphoneos.name = "ARCHS[sdk=iphoneos*]" + arch_iphoneos.value = $$QMAKE_IOS_DEVICE_ARCHS + arch_iphonesimulator.name = "ARCHS[sdk=iphonesimulator*]" + arch_iphonesimulator.value = $$QMAKE_IOS_SIMULATOR_ARCHS + + QMAKE_MAC_XCODE_SETTINGS += arch_iphoneos arch_iphonesimulator + unset(QMAKE_XCODE_ARCHS) } else { +# Be more specific about which architecture we're targeting + equals(QT_ARCH, arm): \ + actual_archs = $$QMAKE_IOS_DEVICE_ARCHS + else: \ + actual_archs = $$QMAKE_IOS_SIMULATOR_ARCHS + for(arch, actual_archs): \ arch_flags += -arch $$arch From 8d1ab25ed2864bda530aec5ca76ad3ba35b2a55f Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Sat, 26 Oct 2013 20:14:26 +0300 Subject: [PATCH 048/494] Android: Remove unneeded dependency Change-Id: Ie4daa618efb6fbc29656cc3d25837478d9d690f4 Reviewed-by: Paul Olav Tvete --- src/corelib/corelib.pro | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 1ed55bb0c89..bc618ed8435 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -20,8 +20,7 @@ ANDROID_JAR_DEPENDENCIES = \ jar/QtAndroid.jar \ jar/QtAndroidAccessibility.jar ANDROID_LIB_DEPENDENCIES = \ - plugins/platforms/android/libqtforandroid.so \ - libs/libgnustl_shared.so + plugins/platforms/android/libqtforandroid.so ANDROID_BUNDLED_JAR_DEPENDENCIES = \ jar/QtAndroid-bundled.jar \ jar/QtAndroidAccessibility-bundled.jar From 684a952edbf5ec5bd70c7edae7c8eff8e87cf2de Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Sun, 27 Oct 2013 10:20:32 +0200 Subject: [PATCH 049/494] Android: Don't crash if the screen is not yet initialized. Change-Id: I4751c2dec5780f42b348a8a8ea628f65d548dcec Reviewed-by: Paul Olav Tvete --- src/plugins/platforms/android/src/androidjnimain.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/android/src/androidjnimain.cpp b/src/plugins/platforms/android/src/androidjnimain.cpp index 34413ae5097..abfc2fa19c0 100644 --- a/src/plugins/platforms/android/src/androidjnimain.cpp +++ b/src/plugins/platforms/android/src/androidjnimain.cpp @@ -559,8 +559,10 @@ static void setSurface(JNIEnv *env, jobject /*thiz*/, jobject jSurface) QPlatformScreen *screen = m_androidPlatformIntegration->screen(); QRect geometry(QPoint(0, 0), size); - QWindowSystemInterface::handleScreenAvailableGeometryChange(screen->screen(), geometry); - QWindowSystemInterface::handleScreenGeometryChange(screen->screen(), geometry); + if (screen) { + QWindowSystemInterface::handleScreenAvailableGeometryChange(screen->screen(), geometry); + QWindowSystemInterface::handleScreenGeometryChange(screen->screen(), geometry); + } if (!sameNativeWindow) { m_surfaceMutex.unlock(); From 00bf148b07cb7771136ed472766400336ab4d2bf Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 28 Oct 2013 10:27:53 +0100 Subject: [PATCH 050/494] Fix compilation with MinGW gcc 64 bit Fix compilation of ANGLE with gcc 4.8.0 64 bit: The reinterpret_cast(void*) was causing error: cast from 'const void*' to 'long unsigned int' loses precision Task-number: QTBUG-34395 Change-Id: Ibde75dd4b5536f3827bdf0ab02a15e93a1a8a4f0 Reviewed-by: Friedemann Kleint --- .../src/third_party/trace_event/trace_event.h | 2 +- ...ix-compilation-with-MinGW-gcc-64-bit.patch | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/angle/patches/0001-Fix-compilation-with-MinGW-gcc-64-bit.patch diff --git a/src/3rdparty/angle/src/third_party/trace_event/trace_event.h b/src/3rdparty/angle/src/third_party/trace_event/trace_event.h index 113b126a77c..72d354dd640 100644 --- a/src/3rdparty/angle/src/third_party/trace_event/trace_event.h +++ b/src/3rdparty/angle/src/third_party/trace_event/trace_event.h @@ -589,7 +589,7 @@ const unsigned long long noEventId = 0; class TraceID { public: explicit TraceID(const void* id, unsigned char* flags) : - m_data(static_cast(reinterpret_cast(id))) + m_data(reinterpret_cast(id)) { *flags |= TRACE_EVENT_FLAG_MANGLE_ID; } diff --git a/src/angle/patches/0001-Fix-compilation-with-MinGW-gcc-64-bit.patch b/src/angle/patches/0001-Fix-compilation-with-MinGW-gcc-64-bit.patch new file mode 100644 index 00000000000..0420694c911 --- /dev/null +++ b/src/angle/patches/0001-Fix-compilation-with-MinGW-gcc-64-bit.patch @@ -0,0 +1,35 @@ +From 821c28d387b332bf16b6ea35ec22a77d3ba41632 Mon Sep 17 00:00:00 2001 +From: Kai Koehne +Date: Mon, 28 Oct 2013 10:27:53 +0100 +Subject: [PATCH] Fix compilation with MinGW gcc 64 bit + +Fix compilation of ANGLE with gcc 4.8.0 64 bit: The + + reinterpret_cast(void*) + +was causing + + error: cast from 'const void*' to 'long unsigned int' loses precision + +Task-number: QTBUG-34395 +Change-Id: Ibde75dd4b5536f3827bdf0ab02a15e93a1a8a4f0 +--- + src/3rdparty/angle/src/third_party/trace_event/trace_event.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/3rdparty/angle/src/third_party/trace_event/trace_event.h b/src/3rdparty/angle/src/third_party/trace_event/trace_event.h +index 113b126..72d354d 100644 +--- a/src/3rdparty/angle/src/third_party/trace_event/trace_event.h ++++ b/src/3rdparty/angle/src/third_party/trace_event/trace_event.h +@@ -589,7 +589,7 @@ const unsigned long long noEventId = 0; + class TraceID { + public: + explicit TraceID(const void* id, unsigned char* flags) : +- m_data(static_cast(reinterpret_cast(id))) ++ m_data(reinterpret_cast(id)) + { + *flags |= TRACE_EVENT_FLAG_MANGLE_ID; + } +-- +1.8.3.msysgit.0 + From 6ea7336e4aed916c5c9602c51d7d9646a289e83b Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 29 Oct 2013 12:16:30 +0100 Subject: [PATCH 051/494] eglfs: Make backingstore handle unexpected scenarios gracefully On platforms other than Android eglfs does not allow having multiple windows when one of the windows is OpenGL. On Android however this has to be handled silently, without aborting the application. The backingstore lacked the necessary checks so QGLWidget-based apps were crashing. This is now corrected. Task-number: QTBUG-34412 Change-Id: Ifb469fa9ef391b24aed3942430c0347276809ba5 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/eglfs/qeglfsbackingstore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp index 8de82686166..9de5960fdbe 100644 --- a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp +++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp @@ -113,7 +113,7 @@ void QEglFSBackingStore::flush(QWindow *window, const QRegion ®ion, const QPo #endif QEglFSWindow *rootWin = m_window->screen()->rootWindow(); - if (!rootWin) + if (!rootWin || !rootWin->isRaster()) return; m_window->create(); @@ -132,7 +132,7 @@ void QEglFSBackingStore::resize(const QSize &size, const QRegion &staticContents Q_UNUSED(staticContents); QEglFSWindow *rootWin = m_window->screen()->rootWindow(); - if (!rootWin) + if (!rootWin || !rootWin->isRaster()) return; m_image = QImage(size, QImage::Format_RGB32); From 0731dbcd19e4a6978f50bb6f104df49b81f5e649 Mon Sep 17 00:00:00 2001 From: Andreas Holzammer Date: Tue, 29 Oct 2013 14:50:46 +0100 Subject: [PATCH 052/494] Fail when QT_POINTER_SIZE is not set Some cross compile setups don't have special treatment and don't have a configure check. To notice this early in the build fail at this state. One example is to cross compile from Windows for eg QNX or even linux embedded. If QT_POINTER_SIZE is not set, later v4 build in qtdeclarative is failing with a unmeaningful compile error. Change-Id: Iff9498d916371241b0b044b9543f9cd2946ecf42 Reviewed-by: Simon Hausmann --- src/corelib/global/qglobal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 1d19a6cf6fe..c430da80fd0 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -198,6 +198,8 @@ typedef quint64 qulonglong; # define QT_POINTER_SIZE 4 # elif defined(Q_OS_ANDROID) # define QT_POINTER_SIZE 4 // ### Add auto-detection to Windows configure +# elif !defined(QT_BUILD_MOC) && !defined(QT_BUILD_QMAKE) && !defined(QT_BUILD_CONFIGURE) +# error could not determine QT_POINTER_SIZE # endif #endif From 4d5bf32c20078dc4fb186e9a7b4969f01ebdc7e5 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 28 Oct 2013 12:22:50 +0100 Subject: [PATCH 053/494] Re-enable NonFullScreenWindows on Android This flag was created because the eglfs plugin did not support non-fullscreen raster windows. Now that it does, we can remove it again. Turns out this also fixes several issues with positioning and sizing of dialogs due to bugs in the implementation of the flag. Task-number: QTBUG-33846, QTBUG-33499, QTBUG-32537, QTBUG-32297, QTBUG-31457 Change-Id: I3902ae57d49d77e3c1046ec57b6f6926f70ec6a4 Reviewed-by: BogDan Vatra --- .../platforms/android/src/qandroidplatformintegration.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp index a3db421de9f..e48a3c9ebe1 100644 --- a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp @@ -123,7 +123,6 @@ bool QAndroidPlatformIntegration::hasCapability(Capability cap) const switch (cap) { case ThreadedPixmaps: return true; case ApplicationState: return true; - case NonFullScreenWindows: return false; case NativeWidgets: return false; default: #ifndef ANDROID_PLUGIN_OPENGL From d536713e96725a7767787b011b7454079f641f72 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Fri, 25 Oct 2013 14:47:01 +0300 Subject: [PATCH 054/494] Allow the user to specify a theme list. Cleanup the theme handling. Set default theme, needed by native dialogs. Needs Ministro v9.6+. Change-Id: Ia131edd8712b7737d3118d714c7772adb8f27acd Reviewed-by: Paul Olav Tvete --- .../qt5/android/bindings/QtActivity.java | 85 +++++++++++++------ 1 file changed, 58 insertions(+), 27 deletions(-) diff --git a/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java b/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java index 9c7b57a4f5d..4c5d4798009 100644 --- a/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java +++ b/src/android/java/src/org/qtproject/qt5/android/bindings/QtActivity.java @@ -56,6 +56,7 @@ import android.content.res.AssetManager; import android.graphics.Bitmap; import android.graphics.Canvas; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; @@ -113,13 +114,15 @@ public class QtActivity extends Activity // for more details. private static final String REPOSITORY_KEY = "repository"; // use this key to overwrite the default ministro repsitory + private static final String ANDROID_THEMES_KEY = "android.themes"; // themes that your application uses - private static final String APPLICATION_PARAMETERS = null; // use this variable to pass any parameters to your application, + + public String APPLICATION_PARAMETERS = null; // use this variable to pass any parameters to your application, // the parameters must not contain any white spaces // and must be separated with "\t" // e.g "-param1\t-param2=value2\t-param3\tvalue3" - private String ENVIRONMENT_VARIABLES = "QT_USE_ANDROID_NATIVE_STYLE=1\t"; + public String ENVIRONMENT_VARIABLES = "QT_USE_ANDROID_NATIVE_STYLE=1\t"; // use this variable to add any environment variables to your application. // the env vars must be separated with "\t" // e.g. "ENV_VAR1=1\tENV_VAR2=2\t" @@ -127,14 +130,21 @@ public class QtActivity extends Activity // * QT_USE_ANDROID_NATIVE_STYLE - 1 to use the android widget style if available, // note that the android style plugin in Qt 5.1 is not fully functional. - private static final String QT_ANDROID_THEME = "light"; // sets the default theme to light. Possible values are: - // * "" - for the device default dark theme - // * "light" - for the device default light theme - // * "holo" - for the holo dark theme - // * "holo_light" - for the holo light theme + public String[] QT_ANDROID_THEMES = null; // A list with all themes that your application want to use. + // The name of the theme must be the same with any theme from + // http://developer.android.com/reference/android/R.style.html + // The most used themes are: + // * "Theme" - (fallback) check http://developer.android.com/reference/android/R.style.html#Theme + // * "Theme_Black" - check http://developer.android.com/reference/android/R.style.html#Theme_Black + // * "Theme_Light" - (default for API <=10) check http://developer.android.com/reference/android/R.style.html#Theme_Light + // * "Theme_Holo" - check http://developer.android.com/reference/android/R.style.html#Theme_Holo + // * "Theme_Holo_Light" - (default for API 11-13) check http://developer.android.com/reference/android/R.style.html#Theme_Holo_Light + // * "Theme_DeviceDefault" - check http://developer.android.com/reference/android/R.style.html#Theme_DeviceDefault + // * "Theme_DeviceDefault_Light" - (default for API 14+) check http://developer.android.com/reference/android/R.style.html#Theme_DeviceDefault_Light + + public String QT_ANDROID_DEFAULT_THEME = null; // sets the default theme. private static final int INCOMPATIBLE_MINISTRO_VERSION = 1; // Incompatible Ministro version. Ministro needs to be upgraded. - private static final String DISPLAY_DPI_KEY = "display.dpi"; private static final int BUFFER_SIZE = 1024; private ActivityInfo m_activityInfo = null; // activity info object, used to access the libs and the strings @@ -153,6 +163,21 @@ public class QtActivity extends Activity // this repository is used to push Qt snapshots. private String[] m_qtLibs = null; // required qt libs + public QtActivity() + { + if (Build.VERSION.SDK_INT <= 10) { + QT_ANDROID_THEMES = new String[] {"Theme_Light"}; + QT_ANDROID_DEFAULT_THEME = "Theme_Light"; + } + else if (Build.VERSION.SDK_INT >= 11 && Build.VERSION.SDK_INT <= 13) { + QT_ANDROID_THEMES = new String[] {"Theme_Holo_Light"}; + QT_ANDROID_DEFAULT_THEME = "Theme_Holo_Light"; + } else { + QT_ANDROID_THEMES = new String[] {"Theme_DeviceDefault_Light"}; + QT_ANDROID_DEFAULT_THEME = "Theme_DeviceDefault_Light"; + } + } + // this function is used to load and start the loader private void loadApplication(Bundle loaderParams) { @@ -237,23 +262,24 @@ public class QtActivity extends Activity private ServiceConnection m_ministroConnection=new ServiceConnection() { private IMinistro m_service = null; - @Override + @Override public void onServiceConnected(ComponentName name, IBinder service) { m_service = IMinistro.Stub.asInterface(service); try { - if (m_service!=null) { - Bundle parameters= new Bundle(); + if (m_service != null) { + Bundle parameters = new Bundle(); parameters.putStringArray(REQUIRED_MODULES_KEY, m_qtLibs); parameters.putString(APPLICATION_TITLE_KEY, (String)QtActivity.this.getTitle()); parameters.putInt(MINIMUM_MINISTRO_API_KEY, MINISTRO_API_LEVEL); parameters.putInt(MINIMUM_QT_VERSION_KEY, QT_VERSION); parameters.putString(ENVIRONMENT_VARIABLES_KEY, ENVIRONMENT_VARIABLES); - if (null!=APPLICATION_PARAMETERS) + if (APPLICATION_PARAMETERS != null) parameters.putString(APPLICATION_PARAMETERS_KEY, APPLICATION_PARAMETERS); parameters.putStringArray(SOURCES_KEY, m_sources); parameters.putString(REPOSITORY_KEY, m_repository); - parameters.putInt(DISPLAY_DPI_KEY, QtActivity.this.getResources().getDisplayMetrics().densityDpi); + if (QT_ANDROID_THEMES != null) + parameters.putStringArray(ANDROID_THEMES_KEY, QT_ANDROID_THEMES); m_service.requestLoader(m_ministroCallback, parameters); } } catch (RemoteException e) { @@ -261,19 +287,19 @@ public class QtActivity extends Activity } } - private IMinistroCallback m_ministroCallback = new IMinistroCallback.Stub() { - // this function is called back by Ministro. - @Override - public void loaderReady(final Bundle loaderParams) throws RemoteException { - runOnUiThread(new Runnable() { - @Override - public void run() { - unbindService(m_ministroConnection); - loadApplication(loaderParams); - } - }); - } - }; + private IMinistroCallback m_ministroCallback = new IMinistroCallback.Stub() { + // this function is called back by Ministro. + @Override + public void loaderReady(final Bundle loaderParams) throws RemoteException { + runOnUiThread(new Runnable() { + @Override + public void run() { + unbindService(m_ministroConnection); + loadApplication(loaderParams); + } + }); + } + }; @Override public void onServiceDisconnected(ComponentName name) { @@ -683,11 +709,16 @@ public class QtActivity extends Activity public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + try { + setTheme(Class.forName("android.R$style").getDeclaredField(QT_ANDROID_DEFAULT_THEME).getInt(null)); + } catch (Exception e) { + e.printStackTrace(); + } if (QtApplication.m_delegateObject != null && QtApplication.onCreate != null) { QtApplication.invokeDelegateMethod(QtApplication.onCreate, savedInstanceState); return; } - ENVIRONMENT_VARIABLES += "\tQT_ANDROID_THEME=" + QT_ANDROID_THEME + ENVIRONMENT_VARIABLES += "\tQT_ANDROID_THEME=" + QT_ANDROID_DEFAULT_THEME + "/\tQT_ANDROID_THEME_DISPLAY_DPI=" + getResources().getDisplayMetrics().densityDpi + "\t"; requestWindowFeature(Window.FEATURE_NO_TITLE); try { From 472e448d6a71f679dd022f7405564c42d8f47916 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Mon, 28 Oct 2013 17:09:59 +0200 Subject: [PATCH 055/494] Fix the show/hide logic. Make sure the back key event is not sent to applicaton as long as the keyboard is still visible. Task-number: QTBUG-30803 Change-Id: I8063981a96ddb8e065c1281b1bdc0fb4a2895bc2 Reviewed-by: Paul Olav Tvete --- .../qt5/android/QtActivityDelegate.java | 52 +++++++++++++++---- .../qt5/android/QtInputConnection.java | 8 ++- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index 503b38ae794..1f994404286 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -57,6 +57,8 @@ import android.content.res.Configuration; import android.graphics.Rect; import android.os.Build; import android.os.Bundle; +import android.os.Handler; +import android.os.ResultReceiver; import android.text.method.MetaKeyKeyListener; import android.util.DisplayMetrics; import android.util.Log; @@ -110,7 +112,8 @@ public class QtActivityDelegate private Process m_debuggerProcess = null; // debugger process public boolean m_keyboardIsVisible = false; - public boolean m_keyboardIsHiding = false; + public boolean m_backKeyPressedSent = false; + public QtLayout getQtLayout() { @@ -253,9 +256,21 @@ public class QtActivityDelegate m_editText.postDelayed(new Runnable() { @Override public void run() { - m_imm.showSoftInput(m_editText, 0); - m_keyboardIsVisible = true; - m_keyboardIsHiding = false; + m_imm.showSoftInput(m_editText, 0, new ResultReceiver( new Handler()){ + @Override + protected void onReceiveResult(int resultCode, Bundle resultData) { + switch (resultCode) { + case InputMethodManager.RESULT_SHOWN: + case InputMethodManager.RESULT_UNCHANGED_SHOWN: + m_keyboardIsVisible = true; + break; + case InputMethodManager.RESULT_HIDDEN: + case InputMethodManager.RESULT_UNCHANGED_HIDDEN: + m_keyboardIsVisible = false; + break; + } + } + }) ; m_editText.postDelayed(new Runnable() { @Override public void run() { @@ -270,9 +285,21 @@ public class QtActivityDelegate { if (m_imm == null) return; - m_imm.hideSoftInputFromWindow(m_editText.getWindowToken(), 0); - m_keyboardIsVisible = false; - m_keyboardIsHiding = false; + m_imm.hideSoftInputFromWindow(m_editText.getWindowToken(), 0, new ResultReceiver( new Handler()){ + @Override + protected void onReceiveResult(int resultCode, Bundle resultData) { + switch (resultCode) { + case InputMethodManager.RESULT_SHOWN: + case InputMethodManager.RESULT_UNCHANGED_SHOWN: + m_keyboardIsVisible = true; + break; + case InputMethodManager.RESULT_HIDDEN: + case InputMethodManager.RESULT_UNCHANGED_HIDDEN: + m_keyboardIsVisible = false; + break; + } + } + }); } public boolean isSoftwareKeyboardVisible() @@ -717,8 +744,12 @@ public class QtActivityDelegate } m_lastChar = lc; - if (keyCode != KeyEvent.KEYCODE_BACK) - QtNative.keyDown(keyCode, c, event.getMetaState()); + if (keyCode == KeyEvent.KEYCODE_BACK) { + m_backKeyPressedSent = !m_keyboardIsVisible; + if (!m_backKeyPressedSent) + return true; + } + QtNative.keyDown(keyCode, c, event.getMetaState()); return true; } @@ -737,8 +768,9 @@ public class QtActivityDelegate } } - if (keyCode == KeyEvent.KEYCODE_BACK && m_keyboardIsVisible && !m_keyboardIsHiding) { + if (keyCode == KeyEvent.KEYCODE_BACK && !m_backKeyPressedSent) { hideSoftwareKeyboard(); + m_keyboardIsVisible = false; return true; } diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java b/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java index 3aba42642a9..f28ea3be83d 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java @@ -139,15 +139,13 @@ public class QtInputConnection extends BaseInputConnection public boolean finishComposingText() { if (m_closing) { - QtNative.activityDelegate().m_keyboardIsHiding = true; m_view.postDelayed(new Runnable() { @Override public void run() { - if (QtNative.activityDelegate().m_keyboardIsHiding) QtNative.activityDelegate().m_keyboardIsVisible=false; - } - }, 5000); // it seems finishComposingText comes musch faster than onKeyUp event, - // so we must delay hide notification + } + }, 100); // it seems finishComposingText comes much faster than onKeyUp event, + // so we must delay hide notification m_closing = false; } else { m_closing = true; From fc98d027c00aeff0dc8062492683e4952126bb1b Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 23 Apr 2013 10:47:55 +0200 Subject: [PATCH 056/494] Android: handle keyPress event for Key_Back Added logic so that accepting either the press or the release will keep the app running. This makes it possible to use the onBackPressed functionality in QML. This functionality is only intended for running in a complete Android environment, so make sure that we don't terminate the application in the NO_SDK case. Task-number: QTBUG-30803 Change-Id: I2546eea73bf6a6ee8b196125b7556479b9b10a9c Reviewed-by: BogDan Vatra --- src/gui/kernel/qguiapplication.cpp | 43 +++++++++++++----------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index d254f7c9bcc..2e6000625e3 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1666,41 +1666,36 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE QWindow *window = e->window.data(); modifier_buttons = e->modifiers; if (e->nullWindow -#ifdef Q_OS_ANDROID - || (e->keyType == QEvent::KeyRelease && e->key == Qt::Key_Back) || e->key == Qt::Key_Menu +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) + || e->key == Qt::Key_Back || e->key == Qt::Key_Menu #endif ) { window = QGuiApplication::focusWindow(); } - if (!window -#ifdef Q_OS_ANDROID - && e->keyType != QEvent::KeyRelease && e->key != Qt::Key_Back -#endif - ) { - return; - } - if (window && window->d_func()->blockedByModalWindow) { - // a modal window is blocking this window, don't allow key events through - return; - } QKeyEvent ev(e->keyType, e->key, e->modifiers, e->nativeScanCode, e->nativeVirtualKey, e->nativeModifiers, e->unicode, e->repeat, e->repeatCount); ev.setTimestamp(e->timestamp); -#ifdef Q_OS_ANDROID - if (e->keyType == QEvent::KeyRelease && e->key == Qt::Key_Back) { - if (!window) { - qApp->quit(); - } else { - QGuiApplication::sendEvent(window, &ev); - if (!ev.isAccepted() && e->key == Qt::Key_Back) - QWindowSystemInterface::handleCloseEvent(window); - } - } else -#endif + // only deliver key events when we have a window, and no modal window is blocking this window + + if (window && !window->d_func()->blockedByModalWindow) QGuiApplication::sendSpontaneousEvent(window, &ev); +#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK) + else + ev.setAccepted(false); + + static bool backKeyPressAccepted = false; + if (e->keyType == QEvent::KeyPress) { + backKeyPressAccepted = e->key == Qt::Key_Back && ev.isAccepted(); + } else if (e->keyType == QEvent::KeyRelease && e->key == Qt::Key_Back && !backKeyPressAccepted && !ev.isAccepted()) { + if (!window) + qApp->quit(); + else + QWindowSystemInterface::handleCloseEvent(window); + } +#endif } void QGuiApplicationPrivate::processEnterEvent(QWindowSystemInterfacePrivate::EnterEvent *e) From 8b61ec579693b4420f62e9563c61035659de7ffe Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 26 Oct 2013 10:59:54 +0200 Subject: [PATCH 057/494] remove dead code this file is not built as part of the xml library for years, so the condition was never true. Change-Id: Ifdc044b6a8044c5093a3f7c268505527dd53f134 Reviewed-by: Joerg Bornemann --- src/corelib/xml/qxmlstream.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/corelib/xml/qxmlstream.cpp b/src/corelib/xml/qxmlstream.cpp index 75ccea94e0f..2a26c2ede43 100644 --- a/src/corelib/xml/qxmlstream.cpp +++ b/src/corelib/xml/qxmlstream.cpp @@ -41,13 +41,6 @@ #include "QtCore/qxmlstream.h" -#if defined(QT_BUILD_XML_LIB) && defined(Q_OS_MAC64) -// No need to define this in the 64-bit Mac libraries. -// Since Qt 4.4 and previous weren't supported in 64-bit, there are -// no QXmlStream* symbols to keep compatibility with -# define QT_NO_XMLSTREAM -#endif - #ifndef QT_NO_XMLSTREAM #include "qxmlutils_p.h" From f6a5e3d1e843a6417d03f8146269aeb97ae8f728 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 25 Oct 2013 21:20:54 +0200 Subject: [PATCH 058/494] remove remaining non-concurrent branches from concurrent samples amends 677825f0bad9. Change-Id: I8bc3ade3a1602b9a2c0bdc837f4b19c67b2e0dba Reviewed-by: Joerg Bornemann --- .../imagescaling/imagescaling.cpp | 4 ---- .../qtconcurrent/imagescaling/imagescaling.h | 16 -------------- examples/qtconcurrent/imagescaling/main.cpp | 20 ----------------- examples/qtconcurrent/progressdialog/main.cpp | 21 ------------------ examples/qtconcurrent/runfunction/main.cpp | 22 ------------------- examples/qtconcurrent/wordcount/main.cpp | 22 ------------------- 6 files changed, 105 deletions(-) diff --git a/examples/qtconcurrent/imagescaling/imagescaling.cpp b/examples/qtconcurrent/imagescaling/imagescaling.cpp index 01083edb4ee..9cc8ef655d5 100644 --- a/examples/qtconcurrent/imagescaling/imagescaling.cpp +++ b/examples/qtconcurrent/imagescaling/imagescaling.cpp @@ -40,8 +40,6 @@ #include "imagescaling.h" #include "math.h" -#ifndef QT_NO_CONCURRENT - const int imageSize = 100; QImage scale(const QString &imageFileName) @@ -141,5 +139,3 @@ void Images::finished() cancelButton->setEnabled(false); pauseButton->setEnabled(false); } - -#endif // QT_NO_CONCURRENT diff --git a/examples/qtconcurrent/imagescaling/imagescaling.h b/examples/qtconcurrent/imagescaling/imagescaling.h index 3c02db05b91..a84e2bdb6d6 100644 --- a/examples/qtconcurrent/imagescaling/imagescaling.h +++ b/examples/qtconcurrent/imagescaling/imagescaling.h @@ -43,8 +43,6 @@ #include #include -#ifndef QT_NO_CONCURRENT - class Images : public QWidget { Q_OBJECT @@ -65,18 +63,4 @@ private: QFutureWatcher *imageScaling; }; -#else - -// Dummy class required because QT_NO_CONCURRENT is not set when moc is run. -class Images : public QWidget -{ -Q_OBJECT -public Q_SLOTS: - void open() {} - void showImage(int) {} - void finished() {} -}; - -#endif // QT_NO_CONCURRENT - #endif // IMAGESCALING_H diff --git a/examples/qtconcurrent/imagescaling/main.cpp b/examples/qtconcurrent/imagescaling/main.cpp index ccdea2e7716..442c8a47716 100644 --- a/examples/qtconcurrent/imagescaling/main.cpp +++ b/examples/qtconcurrent/imagescaling/main.cpp @@ -40,8 +40,6 @@ #include #include -#ifndef QT_NO_CONCURRENT - #include "imagescaling.h" int main(int argc, char *argv[]) @@ -53,21 +51,3 @@ int main(int argc, char *argv[]) return app.exec(); } - -#else - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QString text("Qt Concurrent is not supported on this platform"); - - QLabel *label = new QLabel(text); - label->setWordWrap(true); - - label->show(); - qDebug() << text; - - app.exec(); -} - -#endif diff --git a/examples/qtconcurrent/progressdialog/main.cpp b/examples/qtconcurrent/progressdialog/main.cpp index c646105db69..01d4aef2566 100644 --- a/examples/qtconcurrent/progressdialog/main.cpp +++ b/examples/qtconcurrent/progressdialog/main.cpp @@ -41,8 +41,6 @@ #include #include -#ifndef QT_NO_CONCURRENT - using namespace QtConcurrent; const int iterations = 20; @@ -88,22 +86,3 @@ int main(int argc, char **argv) // Query the future to check if was canceled. qDebug() << "Canceled?" << futureWatcher.future().isCanceled(); } - -#else - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QString text("Qt Concurrent is not yet supported on this platform"); - - QLabel *label = new QLabel(text); - label->setWordWrap(true); - - label->show(); - qDebug() << text; - - app.exec(); -} - -#endif - diff --git a/examples/qtconcurrent/runfunction/main.cpp b/examples/qtconcurrent/runfunction/main.cpp index 0e62bd0a75a..85c5e1267a2 100644 --- a/examples/qtconcurrent/runfunction/main.cpp +++ b/examples/qtconcurrent/runfunction/main.cpp @@ -44,8 +44,6 @@ #include #include -#ifndef QT_NO_CONCURRENT - using namespace QtConcurrent; void hello(QString name) @@ -61,23 +59,3 @@ int main(int argc, char **argv) f1.waitForFinished(); f2.waitForFinished(); } - -#else - -#include - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QString text("Qt Concurrent is not yet supported on this platform"); - - QLabel *label = new QLabel(text); - label->setWordWrap(true); - - label->show(); - qDebug() << text; - - app.exec(); -} - -#endif diff --git a/examples/qtconcurrent/wordcount/main.cpp b/examples/qtconcurrent/wordcount/main.cpp index 635951fd4aa..408e92dbb38 100644 --- a/examples/qtconcurrent/wordcount/main.cpp +++ b/examples/qtconcurrent/wordcount/main.cpp @@ -50,8 +50,6 @@ #include -#ifndef QT_NO_CONCURRENT - using namespace QtConcurrent; /* @@ -155,23 +153,3 @@ int main(int argc, char** argv) } qDebug() << "MapReduce speedup x" << ((double)singleThreadTime - (double)mapReduceTime) / (double)mapReduceTime + 1; } - -#else - -#include - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QString text("Qt Concurrent is not yet supported on this platform"); - - QLabel *label = new QLabel(text); - label->setWordWrap(true); - - label->show(); - qDebug() << text; - - app.exec(); -} - -#endif From 95156cfff75398d8e920f2aee5abef42dd07c0b3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 25 Oct 2013 14:49:16 +0200 Subject: [PATCH 059/494] purge vestiges of dead QT_NO_* defines Change-Id: I6be54e8ce4c2522b3907a645506b695fab3aebd9 Reviewed-by: Tasuku Suzuki Reviewed-by: Joerg Bornemann --- src/corelib/global/qconfig-large.h | 28 ------- src/corelib/global/qconfig-medium.h | 40 ---------- src/corelib/global/qconfig-minimal.h | 89 ---------------------- src/corelib/global/qconfig-nacl.h | 106 --------------------------- src/corelib/global/qconfig-small.h | 26 ------- src/corelib/global/qfeatures.txt | 20 +---- 6 files changed, 1 insertion(+), 308 deletions(-) diff --git a/src/corelib/global/qconfig-large.h b/src/corelib/global/qconfig-large.h index 584be07067b..0c1fcbf7daf 100644 --- a/src/corelib/global/qconfig-large.h +++ b/src/corelib/global/qconfig-large.h @@ -56,11 +56,6 @@ # define QT_NO_PROGRESSDIALOG #endif -/* Fonts */ -#ifndef QT_NO_QWS_QPF -# define QT_NO_QWS_QPF -#endif - /* Images */ #ifndef QT_NO_IMAGEFORMAT_BMP # define QT_NO_IMAGEFORMAT_BMP @@ -76,9 +71,6 @@ #ifndef QT_NO_TRANSLATION # define QT_NO_TRANSLATION #endif -#ifndef QT_NO_TRANSLATION_UTF8 -# define QT_NO_TRANSLATION_UTF8 -#endif /* ItemViews */ #ifndef QT_NO_TABLEVIEW @@ -101,23 +93,14 @@ #ifndef QT_NO_PROPERTIES # define QT_NO_PROPERTIES #endif -#ifndef QT_NO_SOUND -# define QT_NO_SOUND -#endif /* Networking */ -#ifndef QT_NO_HOSTINFO -# define QT_NO_HOSTINFO -#endif #ifndef QT_NO_HTTP # define QT_NO_HTTP #endif #ifndef QT_NO_UDPSOCKET # define QT_NO_UDPSOCKET #endif -#ifndef QT_NO_URLINFO -# define QT_NO_URLINFO -#endif #ifndef QT_NO_FTP # define QT_NO_FTP #endif @@ -136,18 +119,7 @@ # define QT_NO_CUPS #endif -/* Qt for Embedded Linux */ -#ifndef QT_NO_QWS_SOUNDSERVER -# define QT_NO_QWS_SOUNDSERVER -#endif - /* Styles */ -#ifndef QT_NO_STYLE_MOTIF -# define QT_NO_STYLE_MOTIF -#endif -#ifndef QT_NO_STYLE_CDE -# define QT_NO_STYLE_CDE -#endif #ifndef QT_NO_STYLE_STYLESHEET # define QT_NO_STYLE_STYLESHEET #endif diff --git a/src/corelib/global/qconfig-medium.h b/src/corelib/global/qconfig-medium.h index 132c8ce45c3..5ad2610f681 100644 --- a/src/corelib/global/qconfig-medium.h +++ b/src/corelib/global/qconfig-medium.h @@ -58,14 +58,6 @@ #ifndef QT_NO_PROGRESSDIALOG # define QT_NO_PROGRESSDIALOG #endif -#ifndef QT_NO_TABDIALOG -# define QT_NO_TABDIALOG -#endif - -/* Fonts */ -#ifndef QT_NO_QWS_QPF -# define QT_NO_QWS_QPF -#endif /* Images */ #ifndef QT_NO_IMAGEFORMAT_BMP @@ -91,9 +83,6 @@ #ifndef QT_NO_TRANSLATION # define QT_NO_TRANSLATION #endif -#ifndef QT_NO_TRANSLATION_UTF8 -# define QT_NO_TRANSLATION_UTF8 -#endif /* ItemViews */ #ifndef QT_NO_TABLEVIEW @@ -125,20 +114,11 @@ #ifndef QT_NO_SHORTCUT # define QT_NO_SHORTCUT #endif -#ifndef QT_NO_SOUND -# define QT_NO_SOUND -#endif #ifndef QT_NO_WHEELEVENT # define QT_NO_WHEELEVENT #endif /* Networking */ -#ifndef QT_NO_COP -# define QT_NO_COP -#endif -#ifndef QT_NO_HOSTINFO -# define QT_NO_HOSTINFO -#endif #ifndef QT_NO_HTTP # define QT_NO_HTTP #endif @@ -151,9 +131,6 @@ #ifndef QT_NO_UDPSOCKET # define QT_NO_UDPSOCKET #endif -#ifndef QT_NO_URLINFO -# define QT_NO_URLINFO -#endif #ifndef QT_NO_FTP # define QT_NO_FTP #endif @@ -172,24 +149,7 @@ # define QT_NO_CUPS #endif -/* Qt for Embedded Linux */ -#ifndef QT_NO_QWSEMBEDWIDGET -# define QT_NO_QWSEMBEDWIDGET -#endif -#ifndef QT_NO_QWS_SOUNDSERVER -# define QT_NO_QWS_SOUNDSERVER -#endif -#ifndef QT_NO_QWS_PROPERTIES -# define QT_NO_QWS_PROPERTIES -#endif - /* Styles */ -#ifndef QT_NO_STYLE_MOTIF -# define QT_NO_STYLE_MOTIF -#endif -#ifndef QT_NO_STYLE_CDE -# define QT_NO_STYLE_CDE -#endif #ifndef QT_NO_STYLE_STYLESHEET # define QT_NO_STYLE_STYLESHEET #endif diff --git a/src/corelib/global/qconfig-minimal.h b/src/corelib/global/qconfig-minimal.h index cc5ac9987c7..5ef83669033 100644 --- a/src/corelib/global/qconfig-minimal.h +++ b/src/corelib/global/qconfig-minimal.h @@ -75,9 +75,6 @@ #ifndef QT_NO_PROGRESSDIALOG # define QT_NO_PROGRESSDIALOG #endif -#ifndef QT_NO_TABDIALOG -# define QT_NO_TABDIALOG -#endif #ifndef QT_NO_WIZARD # define QT_NO_WIZARD #endif @@ -109,9 +106,6 @@ #ifndef QT_NO_FREETYPE # define QT_NO_FREETYPE #endif -#ifndef QT_NO_QWS_QPF2 -# define QT_NO_QWS_QPF2 -#endif /* Images */ #ifndef QT_NO_IMAGEFORMATPLUGIN @@ -146,9 +140,6 @@ #ifndef QT_NO_BIG_CODECS # define QT_NO_BIG_CODECS #endif -#ifndef QT_NO_QWS_INPUTMETHODS -# define QT_NO_QWS_INPUTMETHODS -#endif #ifndef QT_NO_TEXTCODEC # define QT_NO_TEXTCODEC #endif @@ -158,9 +149,6 @@ #ifndef QT_NO_TRANSLATION # define QT_NO_TRANSLATION #endif -#ifndef QT_NO_TRANSLATION_UTF8 -# define QT_NO_TRANSLATION_UTF8 -#endif /* ItemViews */ #ifndef QT_NO_ITEMVIEWS @@ -228,9 +216,6 @@ #ifndef QT_NO_SHORTCUT # define QT_NO_SHORTCUT #endif -#ifndef QT_NO_SOUND -# define QT_NO_SOUND -#endif #ifndef QT_NO_SYSTEMSEMAPHORE # define QT_NO_SYSTEMSEMAPHORE #endif @@ -257,12 +242,6 @@ #endif /* Networking */ -#ifndef QT_NO_COP -# define QT_NO_COP -#endif -#ifndef QT_NO_HOSTINFO -# define QT_NO_HOSTINFO -#endif #ifndef QT_NO_HTTP # define QT_NO_HTTP #endif @@ -275,9 +254,6 @@ #ifndef QT_NO_UDPSOCKET # define QT_NO_UDPSOCKET #endif -#ifndef QT_NO_URLINFO -# define QT_NO_URLINFO -#endif #ifndef QT_NO_FTP # define QT_NO_FTP #endif @@ -286,12 +262,6 @@ #ifndef QT_NO_COLORNAMES # define QT_NO_COLORNAMES #endif -#ifndef QT_NO_DIRECTPAINTER -# define QT_NO_DIRECTPAINTER -#endif -#ifndef QT_NO_PAINTONSCREEN -# define QT_NO_PAINTONSCREEN -#endif #ifndef QT_NO_PAINT_DEBUG # define QT_NO_PAINT_DEBUG #endif @@ -305,63 +275,10 @@ # define QT_NO_CUPS #endif -/* Qt for Embedded Linux */ -#ifndef QT_NO_QWSEMBEDWIDGET -# define QT_NO_QWSEMBEDWIDGET -#endif -#ifndef QT_NO_QWS_ALPHA_CURSOR -# define QT_NO_QWS_ALPHA_CURSOR -#endif -#ifndef QT_NO_QWS_CURSOR -# define QT_NO_QWS_CURSOR -#endif -#ifndef QT_NO_QWS_DECORATION_DEFAULT -# define QT_NO_QWS_DECORATION_DEFAULT -#endif -#ifndef QT_NO_QWS_DECORATION_STYLED -# define QT_NO_QWS_DECORATION_STYLED -#endif -#ifndef QT_NO_QWS_DECORATION_WINDOWS -# define QT_NO_QWS_DECORATION_WINDOWS -#endif -#ifndef QT_NO_QWS_MANAGER -# define QT_NO_QWS_MANAGER -#endif -#ifndef QT_NO_QWS_KEYBOARD -# define QT_NO_QWS_KEYBOARD -#endif -#ifndef QT_NO_QWS_MOUSE -# define QT_NO_QWS_MOUSE -#endif -#ifndef QT_NO_QWS_MOUSE_AUTO -# define QT_NO_QWS_MOUSE_AUTO -#endif -#ifndef QT_NO_QWS_MOUSE_MANUAL -# define QT_NO_QWS_MOUSE_MANUAL -#endif -#ifndef QT_NO_QWS_MULTIPROCESS -# define QT_NO_QWS_MULTIPROCESS -#endif -#ifndef QT_NO_QWS_SOUNDSERVER -# define QT_NO_QWS_SOUNDSERVER -#endif -#ifndef QT_NO_QWS_PROPERTIES -# define QT_NO_QWS_PROPERTIES -#endif -#ifndef QT_NO_QWS_PROXYSCREEN -# define QT_NO_QWS_PROXYSCREEN -#endif -#ifndef QT_NO_QWS_DYNAMICSCREENTRANSFORMATION -# define QT_NO_QWS_DYNAMICSCREENTRANSFORMATION -#endif - /* SVG */ #ifndef QT_NO_SVG # define QT_NO_SVG #endif -#ifndef QT_NO_GRAPHICSSVGITEM -# define QT_NO_GRAPHICSSVGITEM -#endif #ifndef QT_NO_SVGGENERATOR # define QT_NO_SVGGENERATOR #endif @@ -402,9 +319,6 @@ #ifndef QT_NO_DESKTOPSERVICES # define QT_NO_DESKTOPSERVICES #endif -#ifndef QT_NO_SCRIPT -# define QT_NO_SCRIPT -#endif #ifndef QT_NO_SYSTEMTRAYICON # define QT_NO_SYSTEMTRAYICON #endif @@ -485,9 +399,6 @@ #ifndef QT_NO_SPLITTER # define QT_NO_SPLITTER #endif -#ifndef QT_NO_SIGNALMAPPER -# define QT_NO_SIGNALMAPPER -#endif #ifndef QT_NO_SIZEGRIP # define QT_NO_SIZEGRIP #endif diff --git a/src/corelib/global/qconfig-nacl.h b/src/corelib/global/qconfig-nacl.h index c2854b26c39..4773c5ec260 100644 --- a/src/corelib/global/qconfig-nacl.h +++ b/src/corelib/global/qconfig-nacl.h @@ -72,9 +72,6 @@ #ifndef QT_NO_FILESYSTEMWATCHER # define QT_NO_FILESYSTEMWATCHER #endif -#ifndef QT_NO_FSFILEENGINE -# define QT_NO_FSFILEENGINE -#endif #ifndef QT_NO_FILESYSTEMMODEL # define QT_NO_FILESYSTEMMODEL #endif @@ -94,11 +91,6 @@ # define QT_NO_LIBRARY #endif -/* Fonts */ -#ifndef QT_NO_QWS_QPF2 -# define QT_NO_QWS_QPF2 -#endif - /* Images */ #ifndef QT_NO_IMAGEFORMATPLUGIN # define QT_NO_IMAGEFORMATPLUGIN @@ -114,9 +106,6 @@ #ifndef QT_NO_BIG_CODECS # define QT_NO_BIG_CODECS #endif -#ifndef QT_NO_QWS_INPUTMETHODS -# define QT_NO_QWS_INPUTMETHODS -#endif #ifndef QT_NO_TEXTCODEC # define QT_NO_TEXTCODEC #endif @@ -126,9 +115,6 @@ #ifndef QT_NO_TRANSLATION # define QT_NO_TRANSLATION #endif -#ifndef QT_NO_TRANSLATION_UTF8 -# define QT_NO_TRANSLATION_UTF8 -#endif /* ItemViews */ @@ -158,9 +144,6 @@ #ifndef QT_NO_SHAREDMEMORY # define QT_NO_SHAREDMEMORY #endif -#ifndef QT_NO_SOUND -# define QT_NO_SOUND -#endif #ifndef QT_NO_SYSTEMLOCALE # define QT_NO_SYSTEMSEMAPHORE #endif @@ -187,12 +170,6 @@ #endif /* Networking */ -#ifndef QT_NO_COP -# define QT_NO_COP -#endif -#ifndef QT_NO_HOSTINFO -# define QT_NO_HOSTINFO -#endif #ifndef QT_NO_HTTP # define QT_NO_HTTP #endif @@ -205,9 +182,6 @@ #ifndef QT_NO_UDPSOCKET # define QT_NO_UDPSOCKET #endif -#ifndef QT_NO_URLINFO -# define QT_NO_URLINFO -#endif #ifndef QT_NO_FTP # define QT_NO_FTP #endif @@ -216,12 +190,6 @@ #ifndef QT_NO_COLORNAMES # define QT_NO_COLORNAMES #endif -#ifndef QT_NO_DIRECTPAINTER -# define QT_NO_DIRECTPAINTER -#endif -#ifndef QT_NO_PAINTONSCREEN -# define QT_NO_PAINTONSCREEN -#endif #ifndef QT_NO_PAINT_DEBUG # define QT_NO_PAINT_DEBUG #endif @@ -235,75 +203,10 @@ # define QT_NO_CUPS #endif -/* Qt for Embedded Linux */ -#ifndef QT_NO_QWSEMBEDWIDGET -# define QT_NO_QWSEMBEDWIDGET -#endif -#ifndef QT_NO_QWS_ALPHA_CURSOR -# define QT_NO_QWS_ALPHA_CURSOR -#endif -#ifndef QT_NO_QWS_CURSOR -# define QT_NO_QWS_CURSOR -#endif -#ifndef QT_NO_QWS_DECORATION_DEFAULT -# define QT_NO_QWS_DECORATION_DEFAULT -#endif -#ifndef QT_NO_QWS_DECORATION_STYLED -# define QT_NO_QWS_DECORATION_STYLED -#endif -#ifndef QT_NO_QWS_DECORATION_WINDOWS -# define QT_NO_QWS_DECORATION_WINDOWS -#endif -#ifndef QT_NO_QWS_MANAGER -# define QT_NO_QWS_MANAGER -#endif -#ifndef QT_NO_QWS_KEYBOARD -# define QT_NO_QWS_KEYBOARD -#endif -#ifndef QT_NO_QWS_MOUSE -# define QT_NO_QWS_MOUSE -#endif -#ifndef QT_NO_QWS_MOUSE_AUTO -# define QT_NO_QWS_MOUSE_AUTO -#endif -#ifndef QT_NO_QWS_MOUSE_MANUAL -# define QT_NO_QWS_MOUSE_MANUAL -#endif -#ifndef QT_NO_QWS_MULTIPROCESS -# define QT_NO_QWS_MULTIPROCESS -#endif -#ifndef QT_NO_QWS_SOUNDSERVER -# define QT_NO_QWS_SOUNDSERVER -#endif -#ifndef QT_NO_QWS_PROPERTIES -# define QT_NO_QWS_PROPERTIES -#endif -#ifndef QT_NO_QWS_PROXYSCREEN -# define QT_NO_QWS_PROXYSCREEN -#endif -#ifndef QT_NO_QWS_DYNAMICSCREENTRANSFORMATION -# define QT_NO_QWS_DYNAMICSCREENTRANSFORMATION -#endif -#ifndef QT_NO_QWS_LINUXFB -# define QT_NO_QWS_LINUXFB -#endif -#ifndef QT_NO_QWS_MOUSE_PC -# define QT_NO_QWS_MOUSE_PC -#endif -#ifndef QT_NO_QWS_MOUSE_LINUXTP -# define QT_NO_QWS_MOUSE_LINUXTP -#endif -#ifndef QT_NO_QWS_QPF -# define QT_NO_QWS_QPF -#endif - /* SVG */ #ifndef QT_NO_SVG # define QT_NO_SVG #endif -#ifndef QT_NO_GRAPHICSSVGITEM -# define QT_NO_GRAPHICSSVGITEM -#endif #ifndef QT_NO_SVGGENERATOR # define QT_NO_SVGGENERATOR #endif @@ -315,12 +218,6 @@ #endif /* Styles */ -#ifndef QT_NO_STYLE_MOTIF -# define QT_NO_STYLE_MOTIF -#endif -#ifndef QT_NO_STYLE_CDE -# define QT_NO_STYLE_CDE -#endif #ifndef QT_NO_STYLE_STYLESHEET # define QT_NO_STYLE_STYLESHEET #endif @@ -347,9 +244,6 @@ #ifndef QT_NO_DESKTOPSERVICES # define QT_NO_DESKTOPSERVICES #endif -#ifndef QT_NO_SCRIPT -# define QT_NO_SCRIPT -#endif #ifndef QT_NO_SYSTEMTRAYICON # define QT_NO_SYSTEMTRAYICON #endif diff --git a/src/corelib/global/qconfig-small.h b/src/corelib/global/qconfig-small.h index f730b3d5d28..8a0e769383b 100644 --- a/src/corelib/global/qconfig-small.h +++ b/src/corelib/global/qconfig-small.h @@ -64,9 +64,6 @@ #ifndef QT_NO_PROGRESSDIALOG # define QT_NO_PROGRESSDIALOG #endif -#ifndef QT_NO_TABDIALOG -# define QT_NO_TABDIALOG -#endif /* File I/O */ #ifndef QT_NO_SETTINGS @@ -105,9 +102,6 @@ #endif /* Internationalization */ -#ifndef QT_NO_QWS_INPUTMETHODS -# define QT_NO_QWS_INPUTMETHODS -#endif #ifndef QT_NO_TEXTCODEC # define QT_NO_TEXTCODEC #endif @@ -117,9 +111,6 @@ #ifndef QT_NO_TRANSLATION # define QT_NO_TRANSLATION #endif -#ifndef QT_NO_TRANSLATION_UTF8 -# define QT_NO_TRANSLATION_UTF8 -#endif /* ItemViews */ #ifndef QT_NO_DIRMODEL @@ -163,20 +154,11 @@ #ifndef QT_NO_SHORTCUT # define QT_NO_SHORTCUT #endif -#ifndef QT_NO_SOUND -# define QT_NO_SOUND -#endif #ifndef QT_NO_WHEELEVENT # define QT_NO_WHEELEVENT #endif /* Networking */ -#ifndef QT_NO_COP -# define QT_NO_COP -#endif -#ifndef QT_NO_HOSTINFO -# define QT_NO_HOSTINFO -#endif #ifndef QT_NO_HTTP # define QT_NO_HTTP #endif @@ -195,14 +177,6 @@ # define QT_NO_CUPS #endif -/* Qt for Embedded Linux */ -#ifndef QT_NO_QWS_SOUNDSERVER -# define QT_NO_QWS_SOUNDSERVER -#endif -#ifndef QT_NO_QWS_PROPERTIES -# define QT_NO_QWS_PROPERTIES -#endif - /* Styles */ #ifndef QT_NO_STYLE_FUSION # define QT_NO_STYLE_FUSION diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index 4d07c798c8c..50b803c912a 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -759,12 +759,6 @@ Section: Painting Requires: PRINTER LIBRARY Name: Common UNIX Printing System -Feature: PAINTONSCREEN -Description: Supports the Qt::WA_PaintOnScreen widget attribute. -Section: Painting -Requires: -Name: Qt::WA_PaintOnScreen - Feature: PAINT_DEBUG Description: Debug painting with the environment variables QT_FLUSH_UPDATE and QT_FLUSH_PAINT Section: Painting @@ -787,12 +781,6 @@ Section: Internationalization Requires: Name: Translation -Feature: TRANSLATION_UTF8 -Description: Supports translations using QObject::trUtf8(). -Section: Internationalization -Requires: TRANSLATION TEXTCODEC -Name: Translation (UTF-8 representation) - Feature: TEXTCODEC Description: Supports conversions between text encodings. Section: Internationalization @@ -819,12 +807,6 @@ Name: iconv # Networking -Feature: HOSTINFO -Description: Supports host name lookups. -Section: Networking -Requires: -Name: QHostInfo - Feature: FTP Description: Supports FTP file access. Section: Networking @@ -834,7 +816,7 @@ Name: File Transfer Protocol Feature: HTTP Description: Supports HTTP file access. Section: Networking -Requires: HOSTINFO +Requires: Name: Hyper Text Transfer Protocol Feature: UDPSOCKET From 6f0c88f6c36030c91b1d54e00989cc9f39529951 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 25 Oct 2013 21:28:28 +0200 Subject: [PATCH 060/494] purge references to non-features due to modularization, svg and activeqt do not belong here any more. note that concurrent and dbus are staying for the time being, because being part of qtbase and configure lacking support to switch them off, this is the only way to disable the modules. Change-Id: Idbc0d2f7db23f7e797fc301ab1136f69f9049b27 Reviewed-by: Tasuku Suzuki Reviewed-by: Joerg Bornemann --- src/corelib/global/qconfig-medium.h | 5 ----- src/corelib/global/qconfig-minimal.h | 19 ------------------- src/corelib/global/qconfig-nacl.h | 19 ------------------- 3 files changed, 43 deletions(-) diff --git a/src/corelib/global/qconfig-medium.h b/src/corelib/global/qconfig-medium.h index 5ad2610f681..e5ab33faed4 100644 --- a/src/corelib/global/qconfig-medium.h +++ b/src/corelib/global/qconfig-medium.h @@ -241,8 +241,3 @@ #ifndef QT_NO_TREEWIDGET # define QT_NO_TREEWIDGET #endif - -/* Windows */ -#ifndef QT_NO_WIN_ACTIVEQT -# define QT_NO_WIN_ACTIVEQT -#endif diff --git a/src/corelib/global/qconfig-minimal.h b/src/corelib/global/qconfig-minimal.h index 5ef83669033..b27f3271c11 100644 --- a/src/corelib/global/qconfig-minimal.h +++ b/src/corelib/global/qconfig-minimal.h @@ -275,20 +275,6 @@ # define QT_NO_CUPS #endif -/* SVG */ -#ifndef QT_NO_SVG -# define QT_NO_SVG -#endif -#ifndef QT_NO_SVGGENERATOR -# define QT_NO_SVGGENERATOR -#endif -#ifndef QT_NO_SVGRENDERER -# define QT_NO_SVGRENDERER -#endif -#ifndef QT_NO_SVGWIDGET -# define QT_NO_SVGWIDGET -#endif - /* Styles */ #ifndef QT_NO_STYLE_FUSION # define QT_NO_STYLE_FUSION @@ -474,8 +460,3 @@ #ifndef QT_NO_VALIDATOR # define QT_NO_VALIDATOR #endif - -/* Windows */ -#ifndef QT_NO_WIN_ACTIVEQT -# define QT_NO_WIN_ACTIVEQT -#endif diff --git a/src/corelib/global/qconfig-nacl.h b/src/corelib/global/qconfig-nacl.h index 4773c5ec260..22dd56e772a 100644 --- a/src/corelib/global/qconfig-nacl.h +++ b/src/corelib/global/qconfig-nacl.h @@ -203,20 +203,6 @@ # define QT_NO_CUPS #endif -/* SVG */ -#ifndef QT_NO_SVG -# define QT_NO_SVG -#endif -#ifndef QT_NO_SVGGENERATOR -# define QT_NO_SVGGENERATOR -#endif -#ifndef QT_NO_SVGRENDERER -# define QT_NO_SVGRENDERER -#endif -#ifndef QT_NO_SVGWIDGET -# define QT_NO_SVGWIDGET -#endif - /* Styles */ #ifndef QT_NO_STYLE_STYLESHEET # define QT_NO_STYLE_STYLESHEET @@ -247,8 +233,3 @@ #ifndef QT_NO_SYSTEMTRAYICON # define QT_NO_SYSTEMTRAYICON #endif - -/* Windows */ -#ifndef QT_NO_WIN_ACTIVEQT -# define QT_NO_WIN_ACTIVEQT -#endif From 192a6fb82f44c065a56a824d7726718e59d4b438 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 25 Oct 2013 21:37:03 +0200 Subject: [PATCH 061/494] fix "markup" Change-Id: I447175adf1c00e4e20b36747ee035e30a74a50f8 Reviewed-by: Tasuku Suzuki Reviewed-by: Joerg Bornemann --- src/corelib/global/qfeatures.txt | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index 50b803c912a..ed8b7972138 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -133,6 +133,7 @@ Description: Inputmethods with QInputContext Section: Kernel Requires: LIBRARY Name: QInputContext + # Data structures Feature: TEXTDATE @@ -186,15 +187,13 @@ Requires: Name: QFileSystemModel Feature: FILESYSTEMWATCHER -Description: Provides an interface for monitoring files and directories -for modications. +Description: Provides an interface for monitoring files and directories for modications. Section: File I/O Requires: Name: QFileSystemWatcher Feature: FILESYSTEMITERATOR Description: Provides fast file-system iteration. -for modications. Section: File I/O Requires: Name: QFileSystemIterator @@ -310,7 +309,7 @@ Requires: MAINWINDOW Name: QToolBar Feature: TOOLBOX -Description: Supports columns of tabbed widget items. +Description: Supports columns of tabbed widget items. Section: Widgets Requires: TOOLBUTTON SCROLLAREA Name: QToolBox @@ -334,8 +333,7 @@ Requires: MENU RESIZEHANDLER TOOLBUTTON Name: QMainWindow Feature: DOCKWIDGET -Description: Supports docking widgets inside a QMainWindow or floated as -a top-level window on the desktop. +Description: Supports docking widgets inside a QMainWindow or floated as a top-level window on the desktop. Section: Widgets Requires: RUBBERBAND MAINWINDOW Name: QDockwidget @@ -383,8 +381,7 @@ Requires: Name: QSlider Feature: SCROLLBAR -Description: Supports scrollbars allowing the user access parts of a -document that is larger than the widget used to display it. +Description: Supports scrollbars allowing the user access parts of a document that is larger than the widget used to display it. Section: Widgets Requires: SLIDER Name: QScrollBar @@ -468,15 +465,13 @@ Requires: Name: QSizeGrip Feature: CALENDARWIDGET -Description: Provides a monthly based calendar widget allowing the user to select -a date. +Description: Provides a monthly based calendar widget allowing the user to select a date. Section: Widgets Requires: TABLEVIEW MENU TEXTDATE SPINBOX TOOLBUTTON Name: QCalendarWidget Feature: PRINTPREVIEWWIDGET Description: Provides a widget for previewing page layouts for printer output. -a date. Section: Widgets Requires: GRAPHICSVIEW PRINTER MAINWINDOW Name: QPrintPreviewWidget @@ -533,7 +528,7 @@ Requires: COMBOBOX SPINBOX STACKEDWIDGET Name: QInputDialog Feature: ERRORMESSAGE -Description: Supports an error message display dialog. +Description: Supports an error message display dialog. Section: Dialogs Requires: TEXTEDIT Name: QErrorMessage @@ -547,8 +542,7 @@ Name: QWizard # ItemViews Feature: ITEMVIEWS -Description: Supports the model/view architecture managing the relationship -between data and the way it is presented to the user. +Description: Supports the model/view architecture managing the relationship between data and the way it is presented to the user. Section: ItemViews Requires: RUBBERBAND SCROLLAREA Name: The Model/View Framework @@ -572,8 +566,7 @@ Requires: ITEMVIEWS Name: QAbstractProxyModel Feature: SORTFILTERPROXYMODEL -Description: Supports sorting and filtering of data passed between -another model and a view. +Description: Supports sorting and filtering of data passed between another model and a view. Section: ItemViews Requires: PROXYMODEL Name: QSortFilterProxyModel @@ -679,7 +672,7 @@ Requires: Name: QMovie Feature: IMAGEFORMAT_BMP -Description: Supports Microsoft's Bitmap image file format. +Description: Supports Microsoft's Bitmap image file format. Section: Images Requires: Name: BMP Image Format @@ -735,8 +728,7 @@ Requires: Name: QPicture Feature: COLORNAMES -Description: Supports color names such as "red", used by QColor -and by some HTML documents. +Description: Supports color names such as "red", used by QColor and by some HTML documents. Section: Painting Requires: Name: Color Names @@ -835,7 +827,7 @@ Feature: SOCKS5 Description: Supports SOCKS v5 network proxy. Section: Networking Requires: NETWORKPROXY -Name: SOCKS5 +Name: SOCKS5 Feature: NETWORKINTERFACE Description: Supports listing the host's IP addresses and network interfaces From 569ec1ab346e786e98a8e6884ed40a063a740832 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 25 Oct 2013 21:31:01 +0200 Subject: [PATCH 062/494] give XMLSTREAM a Name Change-Id: I4759d8d64f90db580cd15cad6edeed77411c0c33 Reviewed-by: Tasuku Suzuki Reviewed-by: Joerg Bornemann --- src/corelib/global/qfeatures.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt index ed8b7972138..ce0076bce5f 100644 --- a/src/corelib/global/qfeatures.txt +++ b/src/corelib/global/qfeatures.txt @@ -114,7 +114,7 @@ Feature: XMLSTREAM Description: Provides a simple streaming API for XML. Section: Kernel Requires: -Name: +Name: XML Streaming APIs Feature: XMLSTREAMREADER Description: Provides a well-formed XML parser with a simple streaming API. From 08a737def9145a53615871bb5900f9794bf699f5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 23 Oct 2013 15:24:03 +0200 Subject: [PATCH 063/494] generate qfeatures.h at build time much more elegant than the checked in file. and less chance to get it wrong, as people often enough do. Change-Id: I975a62dfd83ce4f15947ce54f3c40931b1badae0 Reviewed-by: Tasuku Suzuki Reviewed-by: Joerg Bornemann --- qtbase.pro | 47 ++ src/corelib/global/global.pri | 1 + src/corelib/global/qfeatures.h | 686 ------------------------------ src/corelib/global/qglobal.h | 3 +- sync.profile | 2 +- util/scripts/make_qfeatures_dot_h | 198 --------- 6 files changed, 50 insertions(+), 887 deletions(-) delete mode 100644 src/corelib/global/qfeatures.h delete mode 100755 util/scripts/make_qfeatures_dot_h diff --git a/qtbase.pro b/qtbase.pro index d3b03d1fbae..afdeed853c0 100644 --- a/qtbase.pro +++ b/qtbase.pro @@ -103,6 +103,53 @@ prefix_build|!equals(PWD, $$OUT_PWD) { } +# Generate qfeatures.h +features = +lines = $$cat("src/corelib/global/qfeatures.txt", lines) +for (line, lines) { + t = $$replace(line, "^Feature: (\\S+)\\s*$", "\\1") + !isEqual(t, $$line) { + feature = $$t + features += $$t + } else { + t = $$replace(line, "^Requires: (.*)$", "\\1") + !isEqual(t, $$line) { + features.$${feature}.depends = $$replace(t, \\s+$, ) + } else { + t = $$replace(line, "^Name: (.*)$", "\\1") + !isEqual(t, $$line) { + features.$${feature}.name = $$replace(t, \\s+$, ) + } + } + } +} +features = $$sort_depends(features, features.) +features = $$reverse(features) +FEATURES_H = \ + "/*" \ + " * All features and their dependencies." \ + " *" \ + " * This list is generated by qmake from /src/corelib/global/qfeatures.txt" \ + " */" +for (ft, features) { + FEATURES_H += \ + "$$escape_expand(\\n)// $$eval(features.$${ft}.name)" + isEmpty(features.$${ft}.depends) { + FEATURES_H += \ + "//$${LITERAL_HASH}define QT_NO_$$ft" + } else { + FEATURES_H += \ + "$${LITERAL_HASH}if !defined(QT_NO_$$ft) && ($$join($$list($$split(features.$${ft}.depends)), ") || defined(QT_NO_", "defined(QT_NO_", ")"))" \ + "$${LITERAL_HASH} define QT_NO_$$ft" \ + "$${LITERAL_HASH}endif" + } +} +write_file($$OUT_PWD/src/corelib/global/qfeatures.h, FEATURES_H)|error("Aborting.") +# Create forwarding header +FWD_FEATURES_H = \ + '$${LITERAL_HASH}include "../../src/corelib/global/qfeatures.h"' +write_file($$OUT_PWD/include/QtCore/qfeatures.h, FWD_FEATURES_H)|error("Aborting.") + #mkspecs mkspecs.path = $$[QT_HOST_DATA]/mkspecs mkspecs.files = \ diff --git a/src/corelib/global/global.pri b/src/corelib/global/global.pri index a0842a946d0..fd031469f6e 100644 --- a/src/corelib/global/global.pri +++ b/src/corelib/global/global.pri @@ -31,6 +31,7 @@ INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global # configure creates these, not syncqt, so we need to manually inject them qconfig_h_files = \ + $$OUT_PWD/global/qfeatures.h \ $$OUT_PWD/global/qconfig.h \ $$QT_BUILD_TREE/include/QtCore/QtConfig targ_headers.files += $$qconfig_h_files diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h deleted file mode 100644 index 17dd6002657..00000000000 --- a/src/corelib/global/qfeatures.h +++ /dev/null @@ -1,686 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - * All features and their dependencies. - * - * This list is generated from $QTDIR/src/corelib/global/qfeatures.txt - * by $QTSRCDIR/util/scripts/make_qfeatures_dot_h - */ - -// QAction -//#define QT_NO_ACTION - -// QClipboard -//#define QT_NO_CLIPBOARD - -// Color Names -//#define QT_NO_COLORNAMES - -// QtConcurrent -//#define QT_NO_CONCURRENT - -// CssParser -//#define QT_NO_CSSPARSER - -// QCursor -//#define QT_NO_CURSOR - -// QDesktopServices -//#define QT_NO_DESKTOPSERVICES - -// Document Object Model -//#define QT_NO_DOM - -// Effects -//#define QT_NO_EFFECTS - -// QFileSystemIterator -//#define QT_NO_FILESYSTEMITERATOR - -// QFileSystemWatcher -//#define QT_NO_FILESYSTEMWATCHER - -// Freetype Font Engine -//#define QT_NO_FREETYPE - -// Gesture -//#define QT_NO_GESTURES - -// QGroupBox -//#define QT_NO_GROUPBOX - -// QHostInfo -//#define QT_NO_HOSTINFO - -// BMP Image Format -//#define QT_NO_IMAGEFORMAT_BMP - -// JPEG Image Format -//#define QT_NO_IMAGEFORMAT_JPEG - -// PNG Image Format -//#define QT_NO_IMAGEFORMAT_PNG - -// PPM Image Format -//#define QT_NO_IMAGEFORMAT_PPM - -// XBM Image Format -//#define QT_NO_IMAGEFORMAT_XBM - -// XPM Image Format -//#define QT_NO_IMAGEFORMAT_XPM - -// QImage::createHeuristicMask() -//#define QT_NO_IMAGE_HEURISTIC_MASK - -// Image Text -//#define QT_NO_IMAGE_TEXT - -// QKeySequenceEdit -//#define QT_NO_KEYSEQUENCEEDIT - -// QLCDNumber -//#define QT_NO_LCDNUMBER - -// QLibrary -//#define QT_NO_LIBRARY - -// QLineEdit -//#define QT_NO_LINEEDIT - -// QMessageBox -//#define QT_NO_MESSAGEBOX - -// QMovie -//#define QT_NO_MOVIE - -// QNetworkInterface -//#define QT_NO_NETWORKINTERFACE - -// QNetworkProxy -//#define QT_NO_NETWORKPROXY - -// Qt::WA_PaintOnScreen -//#define QT_NO_PAINTONSCREEN - -// Painting Debug Utilities -//#define QT_NO_PAINT_DEBUG - -// QPicture -//#define QT_NO_PICTURE - -// QProcess -//#define QT_NO_PROCESS - -// QProgressBar -//#define QT_NO_PROGRESSBAR - -// Properties -//#define QT_NO_PROPERTIES - -// QRegularExpression -//#define QT_NO_REGULAREXPRESSION - -// Resize Handler -//#define QT_NO_RESIZEHANDLER - -// QRubberBand -//#define QT_NO_RUBBERBAND - -// Session Manager -//#define QT_NO_SESSIONMANAGER - -// QSettings -//#define QT_NO_SETTINGS - -// QSharedMemory -//#define QT_NO_SHAREDMEMORY - -// QShortcut -//#define QT_NO_SHORTCUT - -// QSizeGrip -//#define QT_NO_SIZEGRIP - -// QSlider -//#define QT_NO_SLIDER - -// Spin Widget -//#define QT_NO_SPINWIDGET - -// Splash screen widget -//#define QT_NO_SPLASHSCREEN - -// QStackedWidget -//#define QT_NO_STACKEDWIDGET - -// QStatusBar -//#define QT_NO_STATUSBAR - -// Status Tip -//#define QT_NO_STATUSTIP - -// QWindowsStyle -//#define QT_NO_STYLE_WINDOWS - -// QSystemSemaphore -//#define QT_NO_SYSTEMSEMAPHORE - -// QSystemTrayIcon -//#define QT_NO_SYSTEMTRAYICON - -// QTabletEvent -//#define QT_NO_TABLETEVENT - -// QTemporaryFile -//#define QT_NO_TEMPORARYFILE - -// QTextCodec -//#define QT_NO_TEXTCODEC - -// Text Date -//#define QT_NO_TEXTDATE - -// HtmlParser -//#define QT_NO_TEXTHTMLPARSER - -// QToolTip -//#define QT_NO_TOOLTIP - -// Translation -//#define QT_NO_TRANSLATION - -// QUdpSocket -//#define QT_NO_UDPSOCKET - -// QUndoCommand -//#define QT_NO_UNDOCOMMAND - -// QValidator -//#define QT_NO_VALIDATOR - -// QWheelEvent -//#define QT_NO_WHEELEVENT - -// -//#define QT_NO_XMLSTREAM - -// Animation -#if !defined(QT_NO_ANIMATION) && (defined(QT_NO_PROPERTIES)) -#define QT_NO_ANIMATION -#endif - -// Big Codecs -#if !defined(QT_NO_BIG_CODECS) && (defined(QT_NO_TEXTCODEC)) -#define QT_NO_BIG_CODECS -#endif - -// QButtonGroup -#if !defined(QT_NO_BUTTONGROUP) && (defined(QT_NO_GROUPBOX)) -#define QT_NO_BUTTONGROUP -#endif - -// Codecs -#if !defined(QT_NO_CODECS) && (defined(QT_NO_TEXTCODEC)) -#define QT_NO_CODECS -#endif - -// QDate/QTime/QDateTime -#if !defined(QT_NO_DATESTRING) && (defined(QT_NO_TEXTDATE)) -#define QT_NO_DATESTRING -#endif - -// QDial -#if !defined(QT_NO_DIAL) && (defined(QT_NO_SLIDER)) -#define QT_NO_DIAL -#endif - -// Drag and drop -#if !defined(QT_NO_DRAGANDDROP) && (defined(QT_NO_IMAGEFORMAT_XPM)) -#define QT_NO_DRAGANDDROP -#endif - -// File Transfer Protocol -#if !defined(QT_NO_FTP) && (defined(QT_NO_TEXTDATE)) -#define QT_NO_FTP -#endif - -// Hyper Text Transfer Protocol -#if !defined(QT_NO_HTTP) && (defined(QT_NO_HOSTINFO)) -#define QT_NO_HTTP -#endif - -// iconv -#if !defined(QT_NO_ICONV) && (defined(QT_NO_TEXTCODEC)) -#define QT_NO_ICONV -#endif - -// QInputContext -#if !defined(QT_NO_IM) && (defined(QT_NO_LIBRARY)) -#define QT_NO_IM -#endif - -// QImageIOPlugin -#if !defined(QT_NO_IMAGEFORMATPLUGIN) && (defined(QT_NO_LIBRARY)) -#define QT_NO_IMAGEFORMATPLUGIN -#endif - -// QKeySequenceEdit -#if !defined(QT_NO_KEYSEQUENCEEDIT) && (defined(QT_NO_SHORTCUT)) -#define QT_NO_KEYSEQUENCEEDIT -#endif - -// QLocalServer -#if !defined(QT_NO_LOCALSERVER) && (defined(QT_NO_TEMPORARYFILE)) -#define QT_NO_LOCALSERVER -#endif - -// QPdf -#if !defined(QT_NO_PDF) && (defined(QT_NO_TEMPORARYFILE)) -#define QT_NO_PDF -#endif - -// QMenu -#if !defined(QT_NO_MENU) && (defined(QT_NO_ACTION)) -#define QT_NO_MENU -#endif - -// QNetworkDiskCache -#if !defined(QT_NO_NETWORKDISKCACHE) && (defined(QT_NO_TEMPORARYFILE)) -#define QT_NO_NETWORKDISKCACHE -#endif - -// QProgressDialog -#if !defined(QT_NO_PROGRESSDIALOG) && (defined(QT_NO_PROGRESSBAR)) -#define QT_NO_PROGRESSDIALOG -#endif - -// QScrollBar -#if !defined(QT_NO_SCROLLBAR) && (defined(QT_NO_SLIDER)) -#define QT_NO_SCROLLBAR -#endif - -// SOCKS5 -#if !defined(QT_NO_SOCKS5) && (defined(QT_NO_NETWORKPROXY)) -#define QT_NO_SOCKS5 -#endif - -// QSplitter -#if !defined(QT_NO_SPLITTER) && (defined(QT_NO_RUBBERBAND)) -#define QT_NO_SPLITTER -#endif - -// State machine -#if !defined(QT_NO_STATEMACHINE) && (defined(QT_NO_PROPERTIES)) -#define QT_NO_STATEMACHINE -#endif - -// QFusionStyle -#if !defined(QT_NO_STYLE_FUSION) && (defined(QT_NO_IMAGEFORMAT_XPM)) -#define QT_NO_STYLE_FUSION -#endif - -// QWindowsXPStyle -#if !defined(QT_NO_STYLE_WINDOWSXP) && (defined(QT_NO_STYLE_WINDOWS)) -#define QT_NO_STYLE_WINDOWSXP -#endif - -// QToolButton -#if !defined(QT_NO_TOOLBUTTON) && (defined(QT_NO_ACTION)) -#define QT_NO_TOOLBUTTON -#endif - -// QUndoStack -#if !defined(QT_NO_UNDOSTACK) && (defined(QT_NO_UNDOCOMMAND)) -#define QT_NO_UNDOSTACK -#endif - -// QWizard -#if !defined(QT_NO_WIZARD) && (defined(QT_NO_PROPERTIES)) -#define QT_NO_WIZARD -#endif - -// QXmlStreamReader -#if !defined(QT_NO_XMLSTREAMREADER) && (defined(QT_NO_XMLSTREAM)) -#define QT_NO_XMLSTREAMREADER -#endif - -// QXmlStreamWriter -#if !defined(QT_NO_XMLSTREAMWRITER) && (defined(QT_NO_XMLSTREAM)) -#define QT_NO_XMLSTREAMWRITER -#endif - -// Context menu -#if !defined(QT_NO_CONTEXTMENU) && (defined(QT_NO_MENU)) -#define QT_NO_CONTEXTMENU -#endif - -// QPrinter -#if !defined(QT_NO_PRINTER) && (defined(QT_NO_PICTURE) || defined(QT_NO_TEMPORARYFILE)) -#define QT_NO_PRINTER -#endif - -// QScrollArea -#if !defined(QT_NO_SCROLLAREA) && (defined(QT_NO_SCROLLBAR)) -#define QT_NO_SCROLLAREA -#endif - -// QWindowsCEStyle -#if !defined(QT_NO_STYLE_WINDOWSCE) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_IMAGEFORMAT_XPM)) -#define QT_NO_STYLE_WINDOWSCE -#endif - -// QWindowsMobileStyle -#if !defined(QT_NO_STYLE_WINDOWSMOBILE) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_IMAGEFORMAT_XPM)) -#define QT_NO_STYLE_WINDOWSMOBILE -#endif - -// QWindowsVistaStyle -#if !defined(QT_NO_STYLE_WINDOWSVISTA) && (defined(QT_NO_STYLE_WINDOWSXP)) -#define QT_NO_STYLE_WINDOWSVISTA -#endif - -// QTabBar -#if !defined(QT_NO_TABBAR) && (defined(QT_NO_TOOLBUTTON)) -#define QT_NO_TABBAR -#endif - -// OdfWriter -#if !defined(QT_NO_TEXTODFWRITER) && (defined(QT_NO_XMLSTREAMWRITER)) -#define QT_NO_TEXTODFWRITER -#endif - -// Translation (UTF-8 representation) -#if !defined(QT_NO_TRANSLATION_UTF8) && (defined(QT_NO_TRANSLATION) || defined(QT_NO_TEXTCODEC)) -#define QT_NO_TRANSLATION_UTF8 -#endif - -// QUndoGroup -#if !defined(QT_NO_UNDOGROUP) && (defined(QT_NO_UNDOSTACK)) -#define QT_NO_UNDOGROUP -#endif - -// QWhatsThis -#if !defined(QT_NO_WHATSTHIS) && (defined(QT_NO_TOOLBUTTON)) -#define QT_NO_WHATSTHIS -#endif - -// Bearer Management -#if !defined(QT_NO_BEARERMANAGEMENT) && (defined(QT_NO_LIBRARY) || defined(QT_NO_NETWORKINTERFACE) || defined(QT_NO_PROPERTIES)) -#define QT_NO_BEARERMANAGEMENT -#endif - -// Qt D-Bus module -#if !defined(QT_NO_DBUS) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_XMLSTREAMREADER)) -#define QT_NO_DBUS -#endif - -// QGraphicsView -#if !defined(QT_NO_GRAPHICSVIEW) && (defined(QT_NO_SCROLLAREA)) -#define QT_NO_GRAPHICSVIEW -#endif - -// QMdiArea -#if !defined(QT_NO_MDIAREA) && (defined(QT_NO_SCROLLAREA)) -#define QT_NO_MDIAREA -#endif - -// QSpinBox -#if !defined(QT_NO_SPINBOX) && (defined(QT_NO_SPINWIDGET) || defined(QT_NO_LINEEDIT) || defined(QT_NO_VALIDATOR)) -#define QT_NO_SPINBOX -#endif - -// QStyleSheetStyle -#if !defined(QT_NO_STYLE_STYLESHEET) && (defined(QT_NO_STYLE_WINDOWS) || defined(QT_NO_PROPERTIES) || defined(QT_NO_CSSPARSER)) -#define QT_NO_STYLE_STYLESHEET -#endif - -// QColorDialog -#if !defined(QT_NO_COLORDIALOG) && (defined(QT_NO_SPINBOX)) -#define QT_NO_COLORDIALOG -#endif - -// Common UNIX Printing System -#if !defined(QT_NO_CUPS) && (defined(QT_NO_PRINTER) || defined(QT_NO_LIBRARY)) -#define QT_NO_CUPS -#endif - -// QGraphicsEffect -#if !defined(QT_NO_GRAPHICSEFFECT) && (defined(QT_NO_GRAPHICSVIEW)) -#define QT_NO_GRAPHICSEFFECT -#endif - -// The Model/View Framework -#if !defined(QT_NO_ITEMVIEWS) && (defined(QT_NO_RUBBERBAND) || defined(QT_NO_SCROLLAREA)) -#define QT_NO_ITEMVIEWS -#endif - -// QMenuBar -#if !defined(QT_NO_MENUBAR) && (defined(QT_NO_MENU) || defined(QT_NO_TOOLBUTTON)) -#define QT_NO_MENUBAR -#endif - -// QTabWidget -#if !defined(QT_NO_TABWIDGET) && (defined(QT_NO_TABBAR) || defined(QT_NO_STACKEDWIDGET)) -#define QT_NO_TABWIDGET -#endif - -// QTextEdit -#if !defined(QT_NO_TEXTEDIT) && (defined(QT_NO_SCROLLAREA) || defined(QT_NO_PROPERTIES)) -#define QT_NO_TEXTEDIT -#endif - -// QErrorMessage -#if !defined(QT_NO_ERRORMESSAGE) && (defined(QT_NO_TEXTEDIT)) -#define QT_NO_ERRORMESSAGE -#endif - -// QListView -#if !defined(QT_NO_LISTVIEW) && (defined(QT_NO_ITEMVIEWS)) -#define QT_NO_LISTVIEW -#endif - -// QMainWindow -#if !defined(QT_NO_MAINWINDOW) && (defined(QT_NO_MENU) || defined(QT_NO_RESIZEHANDLER) || defined(QT_NO_TOOLBUTTON)) -#define QT_NO_MAINWINDOW -#endif - -// QAbstractProxyModel -#if !defined(QT_NO_PROXYMODEL) && (defined(QT_NO_ITEMVIEWS)) -#define QT_NO_PROXYMODEL -#endif - -// QStandardItemModel -#if !defined(QT_NO_STANDARDITEMMODEL) && (defined(QT_NO_ITEMVIEWS)) -#define QT_NO_STANDARDITEMMODEL -#endif - -// QStringListModel -#if !defined(QT_NO_STRINGLISTMODEL) && (defined(QT_NO_ITEMVIEWS)) -#define QT_NO_STRINGLISTMODEL -#endif - -// QSyntaxHighlighter -#if !defined(QT_NO_SYNTAXHIGHLIGHTER) && (defined(QT_NO_TEXTEDIT)) -#define QT_NO_SYNTAXHIGHLIGHTER -#endif - -// QTableView -#if !defined(QT_NO_TABLEVIEW) && (defined(QT_NO_ITEMVIEWS)) -#define QT_NO_TABLEVIEW -#endif - -// QTextBrowser -#if !defined(QT_NO_TEXTBROWSER) && (defined(QT_NO_TEXTEDIT)) -#define QT_NO_TEXTBROWSER -#endif - -// QToolBox -#if !defined(QT_NO_TOOLBOX) && (defined(QT_NO_TOOLBUTTON) || defined(QT_NO_SCROLLAREA)) -#define QT_NO_TOOLBOX -#endif - -// QTreeView -#if !defined(QT_NO_TREEVIEW) && (defined(QT_NO_ITEMVIEWS)) -#define QT_NO_TREEVIEW -#endif - -// Accessibility -#if !defined(QT_NO_ACCESSIBILITY) && (defined(QT_NO_PROPERTIES) || defined(QT_NO_MENUBAR)) -#define QT_NO_ACCESSIBILITY -#endif - -// QColumnView -#if !defined(QT_NO_COLUMNVIEW) && (defined(QT_NO_LISTVIEW)) -#define QT_NO_COLUMNVIEW -#endif - -// QCompleter -#if !defined(QT_NO_COMPLETER) && (defined(QT_NO_PROXYMODEL)) -#define QT_NO_COMPLETER -#endif - -// QDataWidgetMapper -#if !defined(QT_NO_DATAWIDGETMAPPER) && (defined(QT_NO_ITEMVIEWS) || defined(QT_NO_PROPERTIES)) -#define QT_NO_DATAWIDGETMAPPER -#endif - -// QIdentityProxyModel -#if !defined(QT_NO_IDENTITYPROXYMODEL) && (defined(QT_NO_PROXYMODEL)) -#define QT_NO_IDENTITYPROXYMODEL -#endif - -// QListWidget -#if !defined(QT_NO_LISTWIDGET) && (defined(QT_NO_LISTVIEW)) -#define QT_NO_LISTWIDGET -#endif - -// QSortFilterProxyModel -#if !defined(QT_NO_SORTFILTERPROXYMODEL) && (defined(QT_NO_PROXYMODEL)) -#define QT_NO_SORTFILTERPROXYMODEL -#endif - -// QTableWidget -#if !defined(QT_NO_TABLEWIDGET) && (defined(QT_NO_TABLEVIEW)) -#define QT_NO_TABLEWIDGET -#endif - -// QToolBar -#if !defined(QT_NO_TOOLBAR) && (defined(QT_NO_MAINWINDOW)) -#define QT_NO_TOOLBAR -#endif - -// QTreeWidget -#if !defined(QT_NO_TREEWIDGET) && (defined(QT_NO_TREEVIEW)) -#define QT_NO_TREEWIDGET -#endif - -// QDirModel -#if !defined(QT_NO_DIRMODEL) && (defined(QT_NO_ITEMVIEWS) || defined(QT_NO_FILESYSTEMMODEL)) -#define QT_NO_DIRMODEL -#endif - -// QDockwidget -#if !defined(QT_NO_DOCKWIDGET) && (defined(QT_NO_RUBBERBAND) || defined(QT_NO_MAINWINDOW)) -#define QT_NO_DOCKWIDGET -#endif - -// QUndoView -#if !defined(QT_NO_UNDOVIEW) && (defined(QT_NO_UNDOSTACK) || defined(QT_NO_LISTVIEW)) -#define QT_NO_UNDOVIEW -#endif - -// QCompleter -#if !defined(QT_NO_FSCOMPLETER) && (defined(QT_NO_FILESYSTEMMODEL) || defined(QT_NO_COMPLETER)) -#define QT_NO_FSCOMPLETER -#endif - -// QComboBox -#if !defined(QT_NO_COMBOBOX) && (defined(QT_NO_LINEEDIT) || defined(QT_NO_STANDARDITEMMODEL) || defined(QT_NO_LISTVIEW)) -#define QT_NO_COMBOBOX -#endif - -// QPrintPreviewWidget -#if !defined(QT_NO_PRINTPREVIEWWIDGET) && (defined(QT_NO_GRAPHICSVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_MAINWINDOW)) -#define QT_NO_PRINTPREVIEWWIDGET -#endif - -// QCalendarWidget -#if !defined(QT_NO_CALENDARWIDGET) && (defined(QT_NO_TABLEVIEW) || defined(QT_NO_MENU) || defined(QT_NO_TEXTDATE) || defined(QT_NO_SPINBOX) || defined(QT_NO_TOOLBUTTON)) -#define QT_NO_CALENDARWIDGET -#endif - -// QDateTimeEdit -#if !defined(QT_NO_DATETIMEEDIT) && (defined(QT_NO_CALENDARWIDGET) || defined(QT_NO_DATESTRING)) -#define QT_NO_DATETIMEEDIT -#endif - -// QInputDialog -#if !defined(QT_NO_INPUTDIALOG) && (defined(QT_NO_COMBOBOX) || defined(QT_NO_SPINBOX) || defined(QT_NO_STACKEDWIDGET)) -#define QT_NO_INPUTDIALOG -#endif - -// QFontComboBox -#if !defined(QT_NO_FONTCOMBOBOX) && (defined(QT_NO_COMBOBOX) || defined(QT_NO_STRINGLISTMODEL)) -#define QT_NO_FONTCOMBOBOX -#endif - -// QFontDialog -#if !defined(QT_NO_FONTDIALOG) && (defined(QT_NO_STRINGLISTMODEL) || defined(QT_NO_COMBOBOX) || defined(QT_NO_VALIDATOR) || defined(QT_NO_GROUPBOX)) -#define QT_NO_FONTDIALOG -#endif - -// QPrintDialog -#if !defined(QT_NO_PRINTDIALOG) && (defined(QT_NO_PRINTER) || defined(QT_NO_COMBOBOX) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_SPINBOX) || defined(QT_NO_TREEVIEW) || defined(QT_NO_TABWIDGET)) -#define QT_NO_PRINTDIALOG -#endif - -// QFileDialog -#if !defined(QT_NO_FILEDIALOG) && (defined(QT_NO_DIRMODEL) || defined(QT_NO_TREEVIEW) || defined(QT_NO_COMBOBOX) || defined(QT_NO_TOOLBUTTON) || defined(QT_NO_BUTTONGROUP) || defined(QT_NO_TOOLTIP) || defined(QT_NO_SPLITTER) || defined(QT_NO_STACKEDWIDGET) || defined(QT_NO_PROXYMODEL)) -#define QT_NO_FILEDIALOG -#endif - -// QPrintPreviewDialog -#if !defined(QT_NO_PRINTPREVIEWDIALOG) && (defined(QT_NO_PRINTPREVIEWWIDGET) || defined(QT_NO_PRINTDIALOG) || defined(QT_NO_TOOLBAR)) -#define QT_NO_PRINTPREVIEWDIALOG -#endif - diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index c430da80fd0..0fd9bab9790 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -57,10 +57,9 @@ #if !defined(QT_BUILD_QMAKE) && !defined(QT_BUILD_CONFIGURE) #include -#endif - #include #define QT_SUPPORTS(FEATURE) (!defined(QT_NO_##FEATURE)) +#endif /* These two macros makes it possible to turn the builtin line expander into a * string literal. */ diff --git a/sync.profile b/sync.profile index 74e29a7acff..7bd10b48652 100644 --- a/sync.profile +++ b/sync.profile @@ -59,7 +59,7 @@ my @zlib_headers = ( "zconf.h", "zlib.h" ); @ignore_headers = ( @internal_zlib_headers ); @ignore_for_include_check = ( "qsystemdetection.h", "qcompilerdetection.h", "qprocessordetection.h", @zlib_headers, @angle_headers); @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h", @zlib_headers, @angle_headers); -%inject_headers = ( "$basedir/src/corelib/global" => [ "qconfig.h" ] ); +%inject_headers = ( "$basedir/src/corelib/global" => [ "qconfig.h", "qfeatures.h" ] ); # Module dependencies. # Every module that is required to build this module should have one entry. # Each of the module version specifiers can take one of the following values: diff --git a/util/scripts/make_qfeatures_dot_h b/util/scripts/make_qfeatures_dot_h deleted file mode 100755 index 20999a239bd..00000000000 --- a/util/scripts/make_qfeatures_dot_h +++ /dev/null @@ -1,198 +0,0 @@ -#!/usr/bin/perl -############################################################################# -## -## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -## Contact: http://www.qt-project.org/legal -## -## This file is part of the test suite of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and Digia. For licensing terms and -## conditions see http://qt.digia.com/licensing. For further information -## use the contact form at http://qt.digia.com/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 as published by the Free Software -## Foundation and appearing in the file LICENSE.LGPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU Lesser General Public License version 2.1 requirements -## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## In addition, as a special exception, Digia gives you certain additional -## rights. These rights are described in the Digia Qt LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3.0 as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL included in the -## packaging of this file. Please review the following information to -## ensure the GNU General Public License version 3.0 requirements will be -## met: http://www.gnu.org/copyleft/gpl.html. -## -## -## $QT_END_LICENSE$ -## -############################################################################# - -# -# Usage: make_qfeatures_dot_h -# -# Generates src/corelib/global/qfeatures.h from src/corelib/global/qfeatures.txt. -# -# The qfeatures.txt file can contain redundancies, and this program -# will show them. -# - -if ($ENV{QTSRCDIR} ne '') { - $qtbase=$ENV{QTSRCDIR}; -} else { - $qtbase=$ENV{QTDIR}; -} - -open FL, "$qtbase/src/corelib/global/qfeatures.txt" - or die "Cannot open $qtbase/src/corelib/global/qfeatures.txt"; - -while () { - if ( /^Feature: (\S*)/ ) { - print STDERR "Duplicate: $1\n" if $macro{$1}; - $macro{$macro=$1}=1; - } elsif ( /^Requires: (.*?)\s*$/ ) { - $deps{$macro}=$1; - map { $dep{"$macro $_"}=1 } split /\s+/, $1; - } elsif ( /^Name: (.*?)\s*$/ ) { - $label{$macro}=$1; - } -} - -close FL; - -sub depends { - my($x,$y) = @_; - return 1 if $dep{"$x $y"}; - return 0 if $dep{"$y $x"}; - return 0 if $x eq $y; - my $d; - for $d (split /\s+/, $deps{$x}) { - return 1 if depends($d,$y); - } - return 0; -} -sub dependants_rec { - my($x) = @_; - my $n = 0; - my $d = 0; - $dependants_rec_count++; - if ( $dependants_rec_count > $dependants_rec_limit ) { - if ( $circularity_start eq $x ) { - print STDERR "Circular dependency: $circularity\n"; - exit; - } - $circularity_start=$x if !$circularity_start; - $circularity="$x $circularity"; - } - for $d (split /\s+/, $deps{$x}) { - $n += 1 + dependants_rec($d); - } - $dependants_rec_count--; - return $n; -} -sub dependants { - $dependants_rec_limit=keys %macro if !$dependants_rec_limit; - $dependants_rec_count=0; - return dependants_rec @_; -} -sub dependencysort { - my($x, $y) = @_; - my $xd = dependants($x); - my $yd = dependants($y); - return $xd-$yd if $xd != $yd; - return $x cmp $y; -} - -@macros = sort { dependencysort($a,$b) } keys %macro; - -for $macro ( @macros ) { - for $d1 (split /\s+/, $deps{$macro} ) { - for $d2 (split /\s+/, $deps{$macro} ) { - print STDERR "Redundancy in $macro - $d1 depends on $d2\n" if depends($d1,$d2); - } - print STDERR "Unknown in $macro - $d1\n" if !$macro{$d1}; - } -} - -open OUT, ">$qtbase/src/corelib/global/qfeatures.h" - or die "Cannot open $qtbase/src/corelib/global/qfeatures.h for writing"; - -print OUT -'/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/* - * All features and their dependencies. - * - * This list is generated from $QTDIR/src/corelib/global/qfeatures.txt - * by $QTSRCDIR/util/scripts/make_qfeatures_dot_h - */ - -'; - - -for $macro ( @macros ) { - print OUT "// $label{$macro}\n"; - if ( $deps{$macro} ) { - print OUT "#if !defined(QT_NO_$macro)"; - print OUT " && (", (join " || ", map { "defined(QT_NO_$_)" } split /\s+/, $deps{$macro}), ")"; - print OUT "\n"; - print OUT "#define QT_NO_$macro\n"; - print OUT "#endif\n"; - } else { - print OUT "//#define QT_NO_$macro\n"; - } - print OUT "\n"; -} - -close OUT; From f37ed85a55f977159ea79d6ecbefd857d7d6cb63 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 24 Oct 2013 20:54:49 +0200 Subject: [PATCH 064/494] don't emit comments to generated qfeatures.h the file is not meant to be human-readable and even less editable, so there is no point in having comments in it. also, it was completely inconsistent to start with: features without dependencies were listed as "templates" in form of commented out #defines to disable them manually, while features with dependencies had a respective #ifdef block to be automatically disabled, but no "template" to disable them manually. now only the #ifdef blocks remain. the actual configuration is done by configure via qconfig.h. Change-Id: I8b9e56ba570908dad4cc6dfcd24bf0e1da8b290f Reviewed-by: Tasuku Suzuki Reviewed-by: Joerg Bornemann --- qtbase.pro | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/qtbase.pro b/qtbase.pro index afdeed853c0..3fc759615b2 100644 --- a/qtbase.pro +++ b/qtbase.pro @@ -127,17 +127,12 @@ features = $$sort_depends(features, features.) features = $$reverse(features) FEATURES_H = \ "/*" \ - " * All features and their dependencies." \ + " * All feature dependencies." \ " *" \ " * This list is generated by qmake from /src/corelib/global/qfeatures.txt" \ " */" for (ft, features) { - FEATURES_H += \ - "$$escape_expand(\\n)// $$eval(features.$${ft}.name)" - isEmpty(features.$${ft}.depends) { - FEATURES_H += \ - "//$${LITERAL_HASH}define QT_NO_$$ft" - } else { + !isEmpty(features.$${ft}.depends) { FEATURES_H += \ "$${LITERAL_HASH}if !defined(QT_NO_$$ft) && ($$join($$list($$split(features.$${ft}.depends)), ") || defined(QT_NO_", "defined(QT_NO_", ")"))" \ "$${LITERAL_HASH} define QT_NO_$$ft" \ From d7a0d243a984f032a8f838e7b44297eac81ef190 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 25 Oct 2013 21:04:35 +0200 Subject: [PATCH 065/494] validate qconfig-*.h against qfeatures.txt Change-Id: I59b7e30cfaa2b1bf2c5d4a3e04b5169f3c9439b5 Reviewed-by: Joerg Bornemann --- configure | 1 + qtbase.pro | 11 +++++++++++ tools/configure/configureapp.cpp | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/configure b/configure index 6f56d42d363..36f3bb522fe 100755 --- a/configure +++ b/configure @@ -6670,6 +6670,7 @@ echo "QT_BUILD_PARTS += $CFG_BUILD_PARTS" >> "$QTMODULE.tmp" if [ -n "$CFG_SKIP_MODULES" ]; then echo "QT_SKIP_MODULES += $CFG_SKIP_MODULES" >> "$QTMODULE.tmp" fi +echo "QT_QCONFIG_PATH = ${CFG_QCONFIG_PATH#$relpath/src/corelib/global/}" >> "$QTMODULE.tmp" cat >>"$QTMODULE.tmp" < Date: Tue, 29 Oct 2013 15:55:29 +0200 Subject: [PATCH 066/494] Fix QCommonStyle::subControlRect(SC_GroupBoxCheckBox) Make sure the groupbox check indicator doesn't get placed in negative coordinates when font height is smaller than the indicator height. Task-number: QTBUG-33610 Change-Id: Ifad0016e9311f1212cccb6d5971343beb68517c4 Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qcommonstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 7f0813c303a..a9f1c3bbbc8 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -4251,7 +4251,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex if (sc == SC_GroupBoxCheckBox) { int indicatorHeight = proxy()->pixelMetric(PM_IndicatorHeight, opt, widget); left = ltr ? totalRect.left() : (totalRect.right() - indicatorWidth); - int top = totalRect.top() + (fontMetrics.height() - indicatorHeight) / 2; + int top = totalRect.top() + qMax(0, fontMetrics.height() - indicatorHeight) / 2; totalRect.setRect(left, top, indicatorWidth, indicatorHeight); // Adjust for label } else { From 11e93372df2ebe8700ebb39fca3709e3a6c3d399 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 9 Oct 2013 11:40:05 -0700 Subject: [PATCH 067/494] Make the localHostName() copy function return QByteArray This avoids one extra memory allocation when creating the lock file. The number of memory allocations when checking the file are still the same. Change-Id: I16a2fdb7a5458bdc66f8ad1c602582b5698a5b5c Reviewed-by: Oswald Buddenhagen Reviewed-by: Kevin Ottens Reviewed-by: Thiago Macieira --- src/corelib/io/qlockfile_unix.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp index dc8817706ce..d1dbb51e760 100644 --- a/src/corelib/io/qlockfile_unix.cpp +++ b/src/corelib/io/qlockfile_unix.cpp @@ -57,13 +57,13 @@ QT_BEGIN_NAMESPACE -static QString localHostName() // from QHostInfo::localHostName() +static QByteArray localHostName() // from QHostInfo::localHostName(), modified to return a QByteArray { - char hostName[512]; - if (gethostname(hostName, sizeof(hostName)) == -1) - return QString(); - hostName[sizeof(hostName) - 1] = '\0'; - return QString::fromLocal8Bit(hostName); + QByteArray hostName(512, Qt::Uninitialized); + if (gethostname(hostName.data(), hostName.size()) == -1) + return QByteArray(); + hostName.truncate(strlen(hostName.data())); + return hostName; } // ### merge into qt_safe_write? @@ -145,7 +145,7 @@ QLockFile::LockError QLockFilePrivate::tryLock_sys() // Use operator% from the fast builder to avoid multiple memory allocations. QByteArray fileData = QByteArray::number(QCoreApplication::applicationPid()) % '\n' % qAppName().toUtf8() % '\n' - % localHostName().toUtf8() % '\n'; + % localHostName() % '\n'; const QByteArray lockFileName = QFile::encodeName(fileName); const int fd = qt_safe_open(lockFileName.constData(), O_WRONLY | O_CREAT | O_EXCL, 0644); @@ -190,7 +190,7 @@ bool QLockFilePrivate::isApparentlyStale() const QString hostname, appname; if (!getLockInfo(&pid, &hostname, &appname)) return false; - if (hostname == localHostName()) { + if (hostname == QString::fromLocal8Bit(localHostName())) { if (::kill(pid, 0) == -1 && errno == ESRCH) return true; // PID doesn't exist anymore } From 2a704239eaf6edd40b2686c3a4ce9be20f95c53b Mon Sep 17 00:00:00 2001 From: El Mehdi Fekari Date: Mon, 28 Oct 2013 17:11:44 +0100 Subject: [PATCH 068/494] QLocale: Add auto tests for Poruguese(Brazil) and Greek locales Change-Id: Ib1b553efb39a150710ceb609d2cb099f19f73e35 Reviewed-by: Lars Knoll --- tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index d6dea057555..028cea3d628 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -1733,6 +1733,11 @@ void tst_QLocale::dayName() QLocale ir("ga_IE"); QCOMPARE(ir.dayName(1, QLocale::ShortFormat), QLatin1String("Luan")); QCOMPARE(ir.dayName(7, QLocale::ShortFormat), QLatin1String("Domh")); + + QLocale gr("el_GR"); + QCOMPARE(gr.dayName(2, QLocale::ShortFormat), QString::fromUtf8("\316\244\317\201\316\257")); + QCOMPARE(gr.dayName(4, QLocale::ShortFormat), QString::fromUtf8("\316\240\316\255\316\274")); + QCOMPARE(gr.dayName(6, QLocale::ShortFormat), QString::fromUtf8("\316\243\316\254\316\262")); } void tst_QLocale::standaloneDayName_data() @@ -1903,6 +1908,10 @@ void tst_QLocale::timeFormat() const QLocale cat("ca_ES"); QCOMPARE(cat.timeFormat(QLocale::ShortFormat), QLatin1String("H.mm")); QCOMPARE(cat.timeFormat(QLocale::LongFormat), QLatin1String("H.mm.ss t")); + + const QLocale bra("pt_BR"); + QCOMPARE(bra.timeFormat(QLocale::ShortFormat), QLatin1String("HH:mm")); + QCOMPARE(bra.timeFormat(QLocale::LongFormat), QLatin1String("HH:mm:ss t")); } void tst_QLocale::dateTimeFormat() From 175489f10200518d9b216266b7a469666a0e96c8 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 29 Oct 2013 14:38:11 +0100 Subject: [PATCH 069/494] fix /SAFESEH linker option for VS >= 2010 In VS 2010 and newer the /SAFESEH linker option is not passed as additional option but is represented by the property ImageHasSafeExceptionHandlers. Task-number: QTBUG-34392 Change-Id: I3bd19078e695716050dd20736b6bc589bcb1cefd Reviewed-by: Andy Shaw --- qmake/generators/win32/msbuild_objectmodel.cpp | 2 ++ qmake/generators/win32/msvc_objectmodel.cpp | 10 ++++++---- qmake/generators/win32/msvc_objectmodel.h | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index a83f8f364b0..3f16a7625e9 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -147,6 +147,7 @@ const char _HeapReserveSize[] = "HeapReserveSize"; const char _IgnoreAllDefaultLibraries[] = "IgnoreAllDefaultLibraries"; const char _IgnoreEmbeddedIDL[] = "IgnoreEmbeddedIDL"; const char _IgnoreImportLibrary[] = "IgnoreImportLibrary"; +const char _ImageHasSafeExceptionHandlers[] = "ImageHasSafeExceptionHandlers"; const char _IgnoreSpecificDefaultLibraries[] = "IgnoreSpecificDefaultLibraries"; const char _IgnoreStandardIncludePath[] = "IgnoreStandardIncludePath"; const char _ImportLibrary[] = "ImportLibrary"; @@ -1494,6 +1495,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCLinkerTool &tool) << attrTagT(_IgnoreAllDefaultLibraries, tool.IgnoreAllDefaultLibraries) << attrTagT(_IgnoreEmbeddedIDL, tool.IgnoreEmbeddedIDL) << attrTagT(_IgnoreImportLibrary, tool.IgnoreImportLibrary) + << attrTagT(_ImageHasSafeExceptionHandlers, tool.ImageHasSafeExceptionHandlers) << attrTagX(_IgnoreSpecificDefaultLibraries, tool.IgnoreDefaultLibraryNames, ";") << attrTagS(_ImportLibrary, tool.ImportLibrary) << attrTagS(_KeyContainer, tool.KeyContainer) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 09213bec8e3..fa0426a894a 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -1172,6 +1172,7 @@ VCLinkerTool::VCLinkerTool() IgnoreAllDefaultLibraries(unset), IgnoreEmbeddedIDL(unset), IgnoreImportLibrary(_True), + ImageHasSafeExceptionHandlers(unset), LargeAddressAware(addrAwareDefault), LinkDLL(unset), LinkIncremental(linkIncrementalDefault), @@ -1654,11 +1655,12 @@ bool VCLinkerTool::parseOption(const char* option) StackCommitSize = both[1].toLongLong(); } break; - case 0x75AA4D8: // /SAFESH:{NO} - { + case 0x75AA4D8: // /SAFESEH:{NO} + if (config->CompilerVersion >= NET2010) + ImageHasSafeExceptionHandlers = (option[8] == ':') ? _False : _True; + else AdditionalOptions += option; - break; - } + break; case 0x9B3C00D: case 0x78dc00d: // /SUBSYSTEM:{CONSOLE|EFI_APPLICATION|EFI_BOOT_SERVICE_DRIVER|EFI_ROM|EFI_RUNTIME_DRIVER|NATIVE|POSIX|WINDOWS|WINDOWSCE}[,major[.minor]] { diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 4e19a43a8c1..58b528301c5 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -615,6 +615,7 @@ public: QStringList IgnoreDefaultLibraryNames; triState IgnoreEmbeddedIDL; triState IgnoreImportLibrary; + triState ImageHasSafeExceptionHandlers; QString ImportLibrary; addressAwarenessType LargeAddressAware; triState LinkDLL; From d7f8f7e0783a5e2d6e2324e7bb16001d23f3d7bf Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 29 Oct 2013 09:41:08 +0100 Subject: [PATCH 070/494] qdbusxml2cpp: Fix warnings about writing to closed devices. Unearthed by fe1cbe9ca78619b54b08e4ec1155d7e6e4e0640a while building QPlatformSupport. Change-Id: Ife56efe111dda6bcf9f11f9c144a4d1dc1651380 Reviewed-by: Laszlo Papp Reviewed-by: Thiago Macieira --- src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp | 29 +++++++++++++++---------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp index f2b9441ea4e..6dd88824b56 100644 --- a/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp +++ b/src/tools/qdbusxml2cpp/qdbusxml2cpp.cpp @@ -509,10 +509,10 @@ static QString stringify(const QString &data) return retval; } -static void openFile(const QString &fileName, QFile &file) +static bool openFile(const QString &fileName, QFile &file) { if (fileName.isEmpty()) - return; + return false; bool isOk = false; if (fileName == QLatin1String("-")) { @@ -525,6 +525,7 @@ static void openFile(const QString &fileName, QFile &file) if (!isOk) fprintf(stderr, "Unable to open '%s': %s\n", qPrintable(fileName), qPrintable(file.errorString())); + return isOk; } static void writeProxy(const QString &filename, const QDBusIntrospection::Interfaces &interfaces) @@ -821,15 +822,17 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf hs.flush(); QFile file; - openFile(headerName, file); - file.write(headerData); + const bool headerOpen = openFile(headerName, file); + if (headerOpen) + file.write(headerData); if (headerName == cppName) { - file.write(cppData); + if (headerOpen) + file.write(cppData); } else { QFile cppFile; - openFile(cppName, cppFile); - cppFile.write(cppData); + if (openFile(cppName, cppFile)) + cppFile.write(cppData); } } @@ -1125,15 +1128,17 @@ static void writeAdaptor(const QString &filename, const QDBusIntrospection::Inte hs.flush(); QFile file; - openFile(headerName, file); - file.write(headerData); + const bool headerOpen = openFile(headerName, file); + if (headerOpen) + file.write(headerData); if (headerName == cppName) { - file.write(cppData); + if (headerOpen) + file.write(cppData); } else { QFile cppFile; - openFile(cppName, cppFile); - cppFile.write(cppData); + if (openFile(cppName, cppFile)) + cppFile.write(cppData); } } From 12981e70a8b7a193ad5ed6449ffd1f8f62d799a2 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 21 Oct 2013 14:59:17 +0200 Subject: [PATCH 071/494] MacGui tests: Remove references to CGPostMouseEvent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CGPostMouseEvent is obsolete and known to have "undocumented special cases and undesirable side effects." The newer Quatz API doesn't allow neither multiple mouse button events nor preserving the mouse cursor location. Change-Id: I121b02fd01e2990488b05e45431cbdc13589656e Reviewed-by: Morten Johan Sørvig --- tests/auto/other/macgui/guitest.cpp | 23 +++++++++++++---------- tests/auto/other/macgui/guitest.h | 3 +-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/auto/other/macgui/guitest.cpp b/tests/auto/other/macgui/guitest.cpp index d7431dd88e1..3359e7d935f 100644 --- a/tests/auto/other/macgui/guitest.cpp +++ b/tests/auto/other/macgui/guitest.cpp @@ -144,22 +144,25 @@ WidgetNavigator::~WidgetNavigator() namespace NativeEvents { #ifdef Q_OS_MAC - void mouseClick(const QPoint &globalPos, Qt::MouseButtons buttons, MousePosition updateMouse) + void mouseClick(const QPoint &globalPos, Qt::MouseButtons buttons) { CGPoint position; position.x = globalPos.x(); position.y = globalPos.y(); - const bool updateMousePosition = (updateMouse == UpdatePosition); + CGEventType mouseDownType = (buttons & Qt::LeftButton) ? kCGEventLeftMouseDown : + (buttons & Qt::RightButton) ? kCGEventRightMouseDown : + kCGEventOtherMouseDown; + CGMouseButton mouseButton = mouseDownType == kCGEventOtherMouseDown ? kCGMouseButtonCenter : kCGEventLeftMouseDown; + CGEventRef mouseEvent = CGEventCreateMouseEvent(NULL, mouseDownType, position, mouseButton); + CGEventPost(kCGHIDEventTap, mouseEvent); - // Mouse down. - CGPostMouseEvent(position, updateMousePosition, 3, - (buttons & Qt::LeftButton) ? true : false, - (buttons & Qt::MidButton/* Middlebutton! */) ? true : false, - (buttons & Qt::RightButton) ? true : false); - - // Mouse up. - CGPostMouseEvent(position, updateMousePosition, 3, false, false, false); + CGEventType mouseUpType = (buttons & Qt::LeftButton) ? kCGEventLeftMouseUp : + (buttons & Qt::RightButton) ? kCGEventRightMouseUp : + kCGEventOtherMouseUp; + CGEventSetType(mouseEvent, mouseUpType); + CGEventPost(kCGHIDEventTap, mouseEvent); + CFRelease(mouseEvent); } #else # error Oops, NativeEvents::mouseClick() is not implemented on this platform. diff --git a/tests/auto/other/macgui/guitest.h b/tests/auto/other/macgui/guitest.h index 569a67d7fe9..6fc4eac59fd 100644 --- a/tests/auto/other/macgui/guitest.h +++ b/tests/auto/other/macgui/guitest.h @@ -86,11 +86,10 @@ private: (Implemented so far: mouseClick on Mac) */ namespace NativeEvents { - enum MousePosition { UpdatePosition, DontUpdatePosition }; /* Simulates a mouse click with button at globalPos. */ - void mouseClick(const QPoint &globalPos, Qt::MouseButtons buttons, MousePosition updateMouse = DontUpdatePosition); + void mouseClick(const QPoint &globalPos, Qt::MouseButtons buttons); }; class ColorWidget : public QWidget From 5dfda7a556485ff07448f5bc2006ac4132e33e7d Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 11 Oct 2013 12:03:02 +0200 Subject: [PATCH 072/494] Cocoa: Fix mouse event coordinates transform to window space MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We pass the mouse screen coordinates that we convert to window space instead of the other way around. This makes sure the original mouse coordinates are not bound to any moving window. Task-number: QTBUG-29583 Task-number: QTBUG-32221 Change-Id: I8f9ada6e8c0d20af8e85e88ee39190d23e58977f Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qnsview.mm | 43 +++++++++++++------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index f90fc6b2055..8f839384dfa 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -496,7 +496,7 @@ static QTouchDevice *touchDevice = 0; return YES; } -- (void)convertFromEvent:(NSEvent *)event toWindowPoint:(QPointF *)qtWindowPoint andScreenPoint:(QPointF *)qtScreenPoint +- (void)convertFromScreen:(NSPoint)mouseLocation toWindowPoint:(QPointF *)qtWindowPoint andScreenPoint:(QPointF *)qtScreenPoint { // Calculate the mouse position in the QWindow and Qt screen coordinate system, // starting from coordinates in the NSWindow coordinate system. @@ -516,23 +516,22 @@ static QTouchDevice *touchDevice = 0; // NSView and QWindow are equal coordinate systems: the QWindow covers the // entire NSView, and we've set the NSView's isFlipped property to true. - NSPoint nsWindowPoint = [event locationInWindow]; // NSWindow coordinates - - NSPoint nsViewPoint = [self convertPoint: nsWindowPoint fromView: nil]; // NSView/QWindow coordinates - *qtWindowPoint = QPointF(nsViewPoint.x, nsViewPoint.y); // NSView/QWindow coordinates - NSWindow *window = [self window]; + NSPoint nsWindowPoint; // Use convertRectToScreen if available (added in 10.7). #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 - if ([window respondsToSelector:@selector(convertRectToScreen:)]) { - NSRect screenRect = [window convertRectToScreen : NSMakeRect(nsWindowPoint.x, nsWindowPoint.y, 0, 0)]; // OS X screen coordinates - *qtScreenPoint = QPointF(screenRect.origin.x, qt_mac_flipYCoordinate(screenRect.origin.y)); // Qt screen coordinates + if ([window respondsToSelector:@selector(convertRectFromScreen:)]) { + NSRect windowRect = [window convertRectFromScreen:NSMakeRect(mouseLocation.x, mouseLocation.y, 1, 1)]; + nsWindowPoint = windowRect.origin; // NSWindow coordinates } else #endif { - NSPoint screenPoint = [window convertBaseToScreen : NSMakePoint(nsWindowPoint.x, nsWindowPoint.y)]; - *qtScreenPoint = QPointF(screenPoint.x, qt_mac_flipYCoordinate(screenPoint.y)); + nsWindowPoint = [window convertScreenToBase:mouseLocation]; // NSWindow coordinates } + NSPoint nsViewPoint = [self convertPoint: nsWindowPoint fromView: nil]; // NSView/QWindow coordinates + *qtWindowPoint = QPointF(nsViewPoint.x, nsViewPoint.y); // NSView/QWindow coordinates + + *qtScreenPoint = QPointF(mouseLocation.x, qt_mac_flipYCoordinate(mouseLocation.y)); // Qt screen coordinates } - (void)resetMouseButtons @@ -546,7 +545,7 @@ static QTouchDevice *touchDevice = 0; QPointF qtWindowPoint; QPointF qtScreenPoint; - [self convertFromEvent:theEvent toWindowPoint:&qtWindowPoint andScreenPoint:&qtScreenPoint]; + [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&qtWindowPoint andScreenPoint:&qtScreenPoint]; ulong timestamp = [theEvent timestamp] * 1000; QCocoaDrag* nativeDrag = static_cast(QGuiApplicationPrivate::platformIntegration()->drag()); @@ -688,7 +687,7 @@ static QTouchDevice *touchDevice = 0; QPointF windowPoint; QPointF screenPoint; - [self convertFromEvent:theEvent toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; + [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; QWindow *childWindow = m_platformWindow->childWindowAt(windowPoint.toPoint()); // Top-level windows generate enter-leave events for sub-windows. @@ -722,7 +721,7 @@ static QTouchDevice *touchDevice = 0; QPointF windowPoint; QPointF screenPoint; - [self convertFromEvent:theEvent toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; + [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; m_platformWindow->m_underMouseWindow = m_platformWindow->childWindowAt(windowPoint.toPoint()); QWindowSystemInterface::handleEnterEvent(m_platformWindow->m_underMouseWindow, windowPoint, screenPoint); } @@ -812,7 +811,7 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash) QPointF windowPoint; QPointF screenPoint; - [self convertFromEvent: theEvent toWindowPoint: &windowPoint andScreenPoint: &screenPoint]; + [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint: &windowPoint andScreenPoint: &screenPoint]; uint deviceId = [theEvent deviceID]; if (!tabletDeviceDataHash->contains(deviceId)) { @@ -985,7 +984,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) const NSTimeInterval timestamp = [event timestamp]; QPointF windowPoint; QPointF screenPoint; - [self convertFromEvent:event toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; + [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; QWindowSystemInterface::handleGestureEventWithRealValue(m_window, timestamp, Qt::ZoomNativeGesture, [event magnification], windowPoint, screenPoint); } @@ -1000,7 +999,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) const NSTimeInterval timestamp = [event timestamp]; QPointF windowPoint; QPointF screenPoint; - [self convertFromEvent:event toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; + [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; QWindowSystemInterface::handleGestureEventWithRealValue(m_window, timestamp, Qt::SmartZoomNativeGesture, zoomIn ? 1.0f : 0.0f, windowPoint, screenPoint); zoomIn = !zoomIn; @@ -1015,7 +1014,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) const NSTimeInterval timestamp = [event timestamp]; QPointF windowPoint; QPointF screenPoint; - [self convertFromEvent:event toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; + [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; QWindowSystemInterface::handleGestureEventWithRealValue(m_window, timestamp, Qt::RotateNativeGesture, -[event rotation], windowPoint, screenPoint); } @@ -1028,7 +1027,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) const NSTimeInterval timestamp = [event timestamp]; QPointF windowPoint; QPointF screenPoint; - [self convertFromEvent:event toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; + [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; qreal angle = 0.0f; if ([event deltaX] == 1) @@ -1052,7 +1051,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) const NSTimeInterval timestamp = [event timestamp]; QPointF windowPoint; QPointF screenPoint; - [self convertFromEvent:event toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; + [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; QWindowSystemInterface::handleGestureEvent(m_window, timestamp, Qt::BeginNativeGesture, windowPoint, screenPoint); } @@ -1065,7 +1064,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) const NSTimeInterval timestamp = [event timestamp]; QPointF windowPoint; QPointF screenPoint; - [self convertFromEvent:event toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; + [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; QWindowSystemInterface::handleGestureEvent(m_window, timestamp, Qt::EndNativeGesture, windowPoint, screenPoint); } @@ -1125,7 +1124,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) QPointF qt_windowPoint; QPointF qt_screenPoint; - [self convertFromEvent:theEvent toWindowPoint:&qt_windowPoint andScreenPoint:&qt_screenPoint]; + [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&qt_windowPoint andScreenPoint:&qt_screenPoint]; NSTimeInterval timestamp = [theEvent timestamp]; ulong qt_timestamp = timestamp * 1000; From 721ec985011489b35ec9fd4f3c3cb9d51864f003 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 23 Oct 2013 14:50:45 +0200 Subject: [PATCH 073/494] remove qt_windows.h include from qwineventnotifier.h We must not include qt_windows.h in public headers, otherwise we're cluttering the environment with a colorful bouquet of Windows API preprocessor macros and typedefs. Task-number: QTBUG-34058 Change-Id: I415717ea2a47f39e7f4b7ce1c1df9d49afc99278 Reviewed-by: Olivier Goffart --- src/corelib/kernel/qwineventnotifier.h | 2 +- .../corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp | 1 + tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qwineventnotifier.h b/src/corelib/kernel/qwineventnotifier.h index 56605d9aaae..cddb9d73be8 100644 --- a/src/corelib/kernel/qwineventnotifier.h +++ b/src/corelib/kernel/qwineventnotifier.h @@ -45,7 +45,6 @@ #include "QtCore/qobject.h" #ifdef Q_OS_WIN -#include "QtCore/qt_windows.h" QT_BEGIN_NAMESPACE @@ -54,6 +53,7 @@ class Q_CORE_EXPORT QWinEventNotifier : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QWinEventNotifier) + typedef Qt::HANDLE HANDLE; public: explicit QWinEventNotifier(QObject *parent = 0); diff --git a/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp b/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp index 8a0ff162c6a..952cb031b87 100644 --- a/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp +++ b/tests/auto/corelib/kernel/qwineventnotifier/tst_qwineventnotifier.cpp @@ -42,6 +42,7 @@ #include #include #include +#include class tst_QWinEventNotifier : public QObject { diff --git a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp index 0ee40713aa4..1e2b0ed6494 100644 --- a/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp @@ -48,7 +48,7 @@ #include #ifdef Q_OS_WIN -# include +# include #endif class tst_QDateTime : public QObject From ae52bba5d441ea5fa1a56b956e90e00e2f688765 Mon Sep 17 00:00:00 2001 From: Chris Gilbert Date: Thu, 24 Oct 2013 13:52:14 -0700 Subject: [PATCH 074/494] Fix msvc project dependencies as specificed by .depends Previously, the full path to the qmake project file was specified as the key for projGuids when inserting the project GUID into this hash table. The only place that items are inserted into projGuids is in VcprojGenerator::collectDependencies at: projGuids.insert(val.first, newDep->target); In this case, val.first contains the full path for the given project being processed at this point. (e.g.: c:\testproject\testproject.pro) Further in sln/vcproj generation, projGuids is queried with the contents of .depends so that users may specify another qmake project as a dependency for a given target. This occurs in two places, in two ways: 1) In VcprojGenerator::collectDependencies() at: QString depend = dep.toQString(); if (!projGuids[depend].isEmpty()) { ... In this case QString depend contains whatever is put into .depends. Typically this is the plain name of the project you depend on. (e.g.: testproj) 2) In VcprojGenerator::writeSubDirs(QTextStream &t) by proxy of extraSubdirs which is a QStringList of the project depends should the mapping in case 1 fail. This case works much like the above case, attempting to use each QString entry of the extraSubdirs list as a key in projGuids. If either of the above two attempts are successful, the msvc solution is configured in a way that creates a project dependency, ensuring correct compilation order and other related behavior. The fix here stores the target project (e.g.: testproject) as opposed to the full project path, as that is what is expected in the .depends statements contained in the qmake project. Change-Id: Iee05661a64d7a3e4467c5ade48d801fbbfe981b5 Reviewed-by: Andy Shaw Reviewed-by: Chris Gilbert --- qmake/generators/win32/msvc_vcproj.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index a30129fa27b..8a5c5b70323 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -514,7 +514,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHashtarget.endsWith(".dll")) newDep->target = newDep->target.left(newDep->target.length()-3) + "lib"; - projGuids.insert(val.first, newDep->target); + projGuids.insert(newDep->orig_target, newDep->target); if (val.second.size()) { const ProStringList depends = val.second; From cf239f69e1873573da1d17d1eeed326686f7cbef Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Fri, 18 Oct 2013 18:36:23 -0300 Subject: [PATCH 075/494] QNX: Manage foreign mmrenderer windows Manage and correctly set the z-order of a foreign created mmrenderer window by QtMultimedia Task-number: QTBUG-33816 Change-Id: I46273b945bf10991462fa72eb1ec8d00b0648988 Reviewed-by: Thomas McGuire --- .../platforms/qnx/qqnxnativeinterface.cpp | 9 +++ .../platforms/qnx/qqnxnativeinterface.h | 1 + src/plugins/platforms/qnx/qqnxscreen.cpp | 77 ++++++++++++++++++- src/plugins/platforms/qnx/qqnxscreen.h | 1 + src/plugins/platforms/qnx/qqnxwindow.cpp | 37 +++++++-- src/plugins/platforms/qnx/qqnxwindow.h | 10 +++ 6 files changed, 125 insertions(+), 10 deletions(-) diff --git a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp index 4dd3444832a..8958a5c1e26 100644 --- a/src/plugins/platforms/qnx/qqnxnativeinterface.cpp +++ b/src/plugins/platforms/qnx/qqnxnativeinterface.cpp @@ -42,6 +42,7 @@ #include "qqnxnativeinterface.h" #include "qqnxscreen.h" +#include "qqnxwindow.h" #include #include @@ -70,4 +71,12 @@ void *QQnxNativeInterface::nativeResourceForScreen(const QByteArray &resource, Q return 0; } +void QQnxNativeInterface::setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value) +{ + if (name == QStringLiteral("mmRendererWindowName")) { + QQnxWindow *qnxWindow = static_cast(window); + qnxWindow->setMMRendererWindowName(value.toString()); + } +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxnativeinterface.h b/src/plugins/platforms/qnx/qqnxnativeinterface.h index 6692da25768..b61f6a56cc2 100644 --- a/src/plugins/platforms/qnx/qqnxnativeinterface.h +++ b/src/plugins/platforms/qnx/qqnxnativeinterface.h @@ -51,6 +51,7 @@ class QQnxNativeInterface : public QPlatformNativeInterface public: void *nativeResourceForWindow(const QByteArray &resource, QWindow *window); void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen); + void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value); }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index dd8cf2131a7..3dab2b3bc9f 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -119,6 +119,38 @@ static QSize determineScreenSize(screen_display_t display, bool primaryScreen) { #endif } +static QQnxWindow *findMultimediaWindow(const QList windows, + const QByteArray &mmWindowId) +{ + Q_FOREACH (QQnxWindow *sibling, windows) { + if (sibling->mmRendererWindowName() == mmWindowId) + return sibling; + + QQnxWindow *mmWindow = findMultimediaWindow(sibling->children(), mmWindowId); + + if (mmWindow) + return mmWindow; + } + + return 0; +} + +static QQnxWindow *findMultimediaWindow(const QList windows, + screen_window_t mmWindowId) +{ + Q_FOREACH (QQnxWindow *sibling, windows) { + if (sibling->mmRendererWindow() == mmWindowId) + return sibling; + + QQnxWindow *mmWindow = findMultimediaWindow(sibling->children(), mmWindowId); + + if (mmWindow) + return mmWindow; + } + + return 0; +} + QQnxScreen::QQnxScreen(screen_context_t screenContext, screen_display_t display, bool primaryScreen) : m_screenContext(screenContext), m_display(display), @@ -585,6 +617,19 @@ void QQnxScreen::addUnderlayWindow(screen_window_t window) updateHierarchy(); } +void QQnxScreen::addMultimediaWindow(const QByteArray &id, screen_window_t window) +{ + // find the QnxWindow this mmrenderer window is related to + QQnxWindow *mmWindow = findMultimediaWindow(m_childWindows, id); + + if (!mmWindow) + return; + + mmWindow->setMMRendererWindow(window); + + updateHierarchy(); +} + void QQnxScreen::removeOverlayOrUnderlayWindow(screen_window_t window) { const int numRemoved = m_overlays.removeAll(window) + m_underlays.removeAll(window); @@ -610,17 +655,35 @@ void QQnxScreen::newWindowCreated(void *window) zorder = 0; } + char windowNameBuffer[256] = { 0 }; + QByteArray windowName; + + if (screen_get_window_property_cv(windowHandle, SCREEN_PROPERTY_ID_STRING, + sizeof(windowNameBuffer) - 1, windowNameBuffer) != 0) { + qWarning("QQnx: Failed to get id for window, errno=%d", errno); + } + + windowName = QByteArray(windowNameBuffer); + if (display == nativeDisplay()) { // A window was created on this screen. If we don't know about this window yet, it means // it was not created by Qt, but by some foreign library like the multimedia renderer, which // creates an overlay window when playing a video. // - // Treat all foreign windows as overlays or underlays here. + // Treat all foreign windows as overlays, underlays or as windows + // created by the BlackBerry QtMultimedia plugin. // - // Assume that if a foreign window already has a Z-Order both negative and + // In the case of the BlackBerry QtMultimedia plugin, we need to + // "attach" the foreign created mmrenderer window to the correct + // platform window (usually the one belonging to QVideoWidget) to + // ensure proper z-ordering. + // + // Otherwise, assume that if a foreign window already has a Z-Order both negative and // less than the default Z-Order installed by mmrender on windows it creates, // the windows should be treated as an underlay. Otherwise, we treat it as an overlay. - if (!findWindow(windowHandle)) { + if (!windowName.isEmpty() && windowName.startsWith("BbVideoWindowControl")) { + addMultimediaWindow(windowName, windowHandle); + } else if (!findWindow(windowHandle)) { if (zorder <= MAX_UNDERLAY_ZORDER) addUnderlayWindow(windowHandle); else @@ -634,7 +697,13 @@ void QQnxScreen::windowClosed(void *window) { Q_ASSERT(thread() == QThread::currentThread()); const screen_window_t windowHandle = reinterpret_cast(window); - removeOverlayOrUnderlayWindow(windowHandle); + + QQnxWindow *mmWindow = findMultimediaWindow(m_childWindows, windowHandle); + + if (mmWindow) + mmWindow->clearMMRendererWindow(); + else + removeOverlayOrUnderlayWindow(windowHandle); } void QQnxScreen::windowGroupStateChanged(const QByteArray &id, Qt::WindowState state) diff --git a/src/plugins/platforms/qnx/qqnxscreen.h b/src/plugins/platforms/qnx/qqnxscreen.h index e11030ea0ad..014f7905f39 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.h +++ b/src/plugins/platforms/qnx/qqnxscreen.h @@ -119,6 +119,7 @@ private: void resizeWindows(const QRect &previousScreenGeometry); void addOverlayWindow(screen_window_t window); void addUnderlayWindow(screen_window_t window); + void addMultimediaWindow(const QByteArray &id, screen_window_t window); void removeOverlayOrUnderlayWindow(screen_window_t window); QWindow *topMostChildWindow() const; diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp index 3969a090981..749a336fcc6 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxwindow.cpp @@ -77,7 +77,8 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context) m_parentWindow(0), m_visible(false), m_exposed(true), - m_windowState(Qt::WindowNoState) + m_windowState(Qt::WindowNoState), + m_mmRendererWindow(0) { qWindowDebug() << Q_FUNC_INFO << "window =" << window << ", size =" << window->size(); int result; @@ -489,6 +490,22 @@ void QQnxWindow::gainedFocus() QWindowSystemInterface::handleWindowActivated(window()); } +void QQnxWindow::setMMRendererWindowName(const QString &name) +{ + m_mmRendererWindowName = name; +} + +void QQnxWindow::setMMRendererWindow(screen_window_t handle) +{ + m_mmRendererWindow = handle; +} + +void QQnxWindow::clearMMRendererWindow() +{ + m_mmRendererWindowName.clear(); + m_mmRendererWindow = 0; +} + QQnxWindow *QQnxWindow::findWindow(screen_window_t windowHandle) { if (m_window == windowHandle) @@ -583,17 +600,25 @@ void QQnxWindow::initWindow() void QQnxWindow::updateZorder(int &topZorder) { - errno = 0; - int result = screen_set_window_property_iv(m_window, SCREEN_PROPERTY_ZORDER, &topZorder); - topZorder++; + updateZorder(m_window, topZorder); - if (result != 0) - qFatal("QQnxWindow: failed to set window z-order=%d, errno=%d, mWindow=%p", topZorder, errno, m_window); + if (m_mmRendererWindow) + updateZorder(m_mmRendererWindow, topZorder); Q_FOREACH (QQnxWindow *childWindow, m_childWindows) childWindow->updateZorder(topZorder); } +void QQnxWindow::updateZorder(screen_window_t window, int &topZorder) +{ + errno = 0; + int result = screen_set_window_property_iv(window, SCREEN_PROPERTY_ZORDER, &topZorder); + topZorder++; + + if (result != 0) + qFatal("QQnxWindow: failed to set window z-order=%d, errno=%d, mWindow=%p", topZorder, errno, window); +} + void QQnxWindow::applyWindowState() { switch (m_windowState) { diff --git a/src/plugins/platforms/qnx/qqnxwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h index f96280848af..52d22235a24 100644 --- a/src/plugins/platforms/qnx/qqnxwindow.h +++ b/src/plugins/platforms/qnx/qqnxwindow.h @@ -99,6 +99,9 @@ public: void propagateSizeHints(); void gainedFocus(); + void setMMRendererWindowName(const QString &name); + void setMMRendererWindow(screen_window_t handle); + void clearMMRendererWindow(); QQnxScreen *screen() const { return m_screen; } const QList& children() const { return m_childWindows; } @@ -107,6 +110,10 @@ public: void minimize(); + QString mmRendererWindowName() const { return m_mmRendererWindowName; } + + screen_window_t mmRendererWindow() const { return m_mmRendererWindow; } + virtual WindowType windowType() const = 0; protected: virtual int pixelFormat() const = 0; @@ -123,6 +130,7 @@ private: void setOffset(const QPoint &setOffset); void updateVisibility(bool parentVisible); void updateZorder(int &topZorder); + void updateZorder(screen_window_t window, int &zOrder); void applyWindowState(); screen_window_t m_window; @@ -135,6 +143,8 @@ private: bool m_exposed; QRect m_unmaximizedGeometry; Qt::WindowState m_windowState; + QString m_mmRendererWindowName; + screen_window_t m_mmRendererWindow; }; QT_END_NAMESPACE From 9087d4ed7bd81b97de90e0aa1844e9944c9d9be6 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 28 Oct 2013 10:29:02 +0100 Subject: [PATCH 076/494] Don't support threaded GL on chromium (virtual box GL) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I84f89450e3fce1cbbafd19dbf4509b1911e06b19 Reviewed-by: Jørgen Lind --- src/plugins/platforms/xcb/qglxintegration.cpp | 32 +++++++++++++++++++ src/plugins/platforms/xcb/qglxintegration.h | 6 ++++ src/plugins/platforms/xcb/qxcbintegration.cpp | 2 +- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index cbfbdf495f5..2c418cbebe8 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -408,6 +408,38 @@ bool QGLXContext::isValid() const return m_context != 0; } +bool QGLXContext::m_queriedDummyContext = false; +bool QGLXContext::m_supportsThreading = true; + +void QGLXContext::queryDummyContext() +{ + if (m_queriedDummyContext) + return; + m_queriedDummyContext = true; + + static bool skip = qEnvironmentVariableIsSet("QT_OPENGL_NO_SANITY_CHECK"); + if (skip) + return; + + QOffscreenSurface surface; + surface.create(); + QOpenGLContext context; + context.create(); + context.makeCurrent(&surface); + + const char *renderer = (const char *) glGetString(GL_RENDERER); + if (QByteArray(renderer).contains("Chromium")) + m_supportsThreading = false; + else + m_supportsThreading = true; +} + +bool QGLXContext::supportsThreading() +{ + if (!m_queriedDummyContext) + queryDummyContext(); + return m_supportsThreading; +} QGLXPbuffer::QGLXPbuffer(QOffscreenSurface *offscreenSurface) : QPlatformOffscreenSurface(offscreenSurface) diff --git a/src/plugins/platforms/xcb/qglxintegration.h b/src/plugins/platforms/xcb/qglxintegration.h index 7116b2389d2..dcc7fe88557 100644 --- a/src/plugins/platforms/xcb/qglxintegration.h +++ b/src/plugins/platforms/xcb/qglxintegration.h @@ -72,12 +72,18 @@ public: GLXContext glxContext() const { return m_context; } + static bool supportsThreading(); + static void queryDummyContext(); + private: QXcbScreen *m_screen; GLXContext m_context; GLXContext m_shareContext; QSurfaceFormat m_format; bool m_isPBufferCurrent; + + static bool m_queriedDummyContext; + static bool m_supportsThreading; }; diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 5168bd818b8..6b5ea936388 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -278,7 +278,7 @@ bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const #else case OpenGL: return false; #endif - case ThreadedOpenGL: return m_connections.at(0)->supportsThreadedRendering(); + case ThreadedOpenGL: return m_connections.at(0)->supportsThreadedRendering() && QGLXContext::supportsThreading(); case WindowMasks: return true; case MultipleWindows: return true; case ForeignWindows: return true; From 89ab2671051671ecf440ba480caf0b6b6768b1a9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 28 Oct 2013 14:41:43 +0100 Subject: [PATCH 077/494] Keep web fontdata alive as long as CG uses it With OS X 10.9 font decoding appears to happen lazily, this means we have to ensure the data we provide CG is kept alive until it dereferences it itself. Task-number: QTBUG-34332 Change-Id: I8fc38fafba746b062c4ad16314b0a410fd0b668d Reviewed-by: Erik Verbruggen --- .../fontdatabases/mac/qcoretextfontdatabase.mm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 72486c097d4..38c44e3f35f 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -305,12 +305,20 @@ QFontEngine *QCoreTextFontDatabase::fontEngine(const QFontDef &f, QChar::Script return NULL; } +static void releaseFontData(void* info, const void* data, size_t size) +{ + Q_UNUSED(data); + Q_UNUSED(size); + delete (QByteArray*)info; +} + QFontEngine *QCoreTextFontDatabase::fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) { Q_UNUSED(hintingPreference); - QCFType dataProvider = CGDataProviderCreateWithData(NULL, - fontData.constData(), fontData.size(), NULL); + QByteArray* fontDataCopy = new QByteArray(fontData); + QCFType dataProvider = CGDataProviderCreateWithData(fontDataCopy, + fontDataCopy->constData(), fontDataCopy->size(), releaseFontData); CGFontRef cgFont = CGFontCreateWithDataProvider(dataProvider); @@ -474,8 +482,9 @@ QStringList QCoreTextFontDatabase::addApplicationFont(const QByteArray &fontData CTFontRef font = NULL; if (!fontData.isEmpty()) { - QCFType dataProvider = CGDataProviderCreateWithData(NULL, - fontData.constData(), fontData.size(), NULL); + QByteArray* fontDataCopy = new QByteArray(fontData); + QCFType dataProvider = CGDataProviderCreateWithData(fontDataCopy, + fontDataCopy->constData(), fontDataCopy->size(), releaseFontData); CGFontRef cgFont = CGFontCreateWithDataProvider(dataProvider); if (cgFont) { CFErrorRef error; From aceb854bbb6582cbdecb4da94b64782c76a653cb Mon Sep 17 00:00:00 2001 From: Christoph Schleifenbaum Date: Mon, 28 Oct 2013 17:11:10 +0100 Subject: [PATCH 078/494] Different native Cocoa menu fixes. - Fix location of NSMenu when no NSView is given. - Fix shortcut when given in text with tab. Change-Id: Iec21cf3d12084db1e70c1a8779d5482c78285796 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoamenu.mm | 26 +++++++++++-------- src/plugins/platforms/cocoa/qcocoamenuitem.mm | 4 +++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index 16b02a93f59..329c7a264a3 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -466,17 +466,21 @@ void QCocoaMenu::showPopup(const QWindow *parentWindow, QPoint pos, const QPlatf nsPos.y = screen->availableVirtualSize().height() - nsPos.y; } - // Finally, we need to synthesize an event. - NSEvent *menuEvent = [NSEvent mouseEventWithType:NSRightMouseDown - location:nsPos - modifierFlags:0 - timestamp:0 - windowNumber:view ? view.window.windowNumber : 0 - context:nil - eventNumber:0 - clickCount:1 - pressure:1.0]; - [NSMenu popUpContextMenu:m_nativeMenu withEvent:menuEvent forView:view]; + if (view) { + // Finally, we need to synthesize an event. + NSEvent *menuEvent = [NSEvent mouseEventWithType:NSRightMouseDown + location:nsPos + modifierFlags:0 + timestamp:0 + windowNumber:view ? view.window.windowNumber : 0 + context:nil + eventNumber:0 + clickCount:1 + pressure:1.0]; + [NSMenu popUpContextMenu:m_nativeMenu withEvent:menuEvent forView:view]; + } else { + [m_nativeMenu popUpMenuPositioningItem:nsItem atLocation:nsPos inView:0]; + } } // The calls above block, and also swallow any mouse release event, diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm index 013f9931ff8..3bba1ee1d51 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm @@ -338,6 +338,8 @@ QString QCocoaMenuItem::mergeText() return qt_mac_applicationmenu_string(4); } else if (m_native == [loader quitMenuItem]) { return qt_mac_applicationmenu_string(5).arg(qt_mac_applicationName()); + } else if (m_text.contains('\t')) { + return m_text.left(m_text.indexOf('\t')); } return m_text; } @@ -349,6 +351,8 @@ QKeySequence QCocoaMenuItem::mergeAccel() return QKeySequence(QKeySequence::Preferences); else if (m_native == [loader quitMenuItem]) return QKeySequence(QKeySequence::Quit); + else if (m_text.contains('\t')) + return QKeySequence(m_text.mid(m_text.indexOf('\t') + 1), QKeySequence::NativeText); return m_shortcut; } From bec8d2e0891344f44cd2f57b40fdd286c2361b18 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Thu, 24 Oct 2013 19:50:12 +0800 Subject: [PATCH 079/494] Doc: Remove unofficial Qt Concurrent headers , , and are not official headers. Developers should use instead. As a side-effect, this patch also stops the function documentation from being duplicated (one copy in the QtConcurrent namespace page, one copy in the \headerfile pages) (For some reason, \brief doesn't work on standalone pages like these) Change-Id: I9482f014acf52ba734a3fa597cdcc5931fcd7ecf Reviewed-by: Jerome Pasion Reviewed-by: Stephen Kelly --- src/concurrent/qtconcurrentfilter.cpp | 14 +++----------- src/concurrent/qtconcurrentmap.cpp | 20 +++----------------- src/concurrent/qtconcurrentrun.cpp | 13 ++++--------- 3 files changed, 10 insertions(+), 37 deletions(-) diff --git a/src/concurrent/qtconcurrentfilter.cpp b/src/concurrent/qtconcurrentfilter.cpp index a58c52edc13..ab0227983da 100644 --- a/src/concurrent/qtconcurrentfilter.cpp +++ b/src/concurrent/qtconcurrentfilter.cpp @@ -40,15 +40,10 @@ ****************************************************************************/ /*! - \headerfile + \page qtconcurrentfilter.html \title Concurrent Filter and Filter-Reduce \ingroup thread - \brief The header provides concurrent Filter and - Filter-Reduce. - - These functions are a part of the \l {Qt Concurrent} framework. - The QtConcurrent::filter(), QtConcurrent::filtered() and QtConcurrent::filteredReduced() functions filter items in a sequence such as a QList or a QVector in parallel. QtConcurrent::filter() modifies a @@ -56,6 +51,8 @@ containing the filtered content, and QtConcurrent::filteredReduced() returns a single result. + These functions are a part of the \l {Qt Concurrent} framework. + Each of the above functions have a blocking variant that returns the final result instead of a QFuture. You use them in the same way as the asynchronous variants. @@ -186,7 +183,6 @@ /*! \fn QFuture QtConcurrent::filter(Sequence &sequence, FilterFunction filterFunction) - \relates Calls \a filterFunction once for each item in \a sequence. If \a filterFunction returns \c true, the item is kept in \a sequence; @@ -195,7 +191,6 @@ /*! \fn QFuture QtConcurrent::filtered(const Sequence &sequence, FilterFunction filterFunction) - \relates Calls \a filterFunction once for each item in \a sequence and returns a new Sequence of kept items. If \a filterFunction returns \c true, a copy of @@ -205,7 +200,6 @@ /*! \fn QFuture QtConcurrent::filtered(ConstIterator begin, ConstIterator end, FilterFunction filterFunction) - \relates Calls \a filterFunction once for each item from \a begin to \a end and returns a new Sequence of kept items. If \a filterFunction returns \c true, a @@ -215,7 +209,6 @@ /*! \fn QFuture QtConcurrent::filteredReduced(const Sequence &sequence, FilterFunction filterFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions) - \relates Calls \a filterFunction once for each item in \a sequence. If \a filterFunction returns \c true for an item, that item is then passed to @@ -232,7 +225,6 @@ /*! \fn QFuture QtConcurrent::filteredReduced(ConstIterator begin, ConstIterator end, FilterFunction filterFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions) - \relates Calls \a filterFunction once for each item from \a begin to \a end. If \a filterFunction returns \c true for an item, that item is then passed to diff --git a/src/concurrent/qtconcurrentmap.cpp b/src/concurrent/qtconcurrentmap.cpp index 5233a9db457..fc904a4d59d 100644 --- a/src/concurrent/qtconcurrentmap.cpp +++ b/src/concurrent/qtconcurrentmap.cpp @@ -68,14 +68,10 @@ */ /*! - \headerfile + \page qtconcurrentmap.html \title Concurrent Map and Map-Reduce \ingroup thread - \brief The header provides concurrent Map and MapReduce. - - These functions are a part of the \l {Qt Concurrent} framework. - The QtConcurrent::map(), QtConcurrent::mapped() and QtConcurrent::mappedReduced() functions run computations in parallel on the items in a sequence such as a QList or a QVector. QtConcurrent::map() @@ -83,6 +79,8 @@ sequence containing the modified content, and QtConcurrent::mappedReduced() returns a single result. + These functions are a part of the \l {Qt Concurrent} framework. + Each of the above functions has a blocking variant that returns the final result instead of a QFuture. You use them in the same way as the asynchronous variants. @@ -235,7 +233,6 @@ /*! \fn QFuture QtConcurrent::map(Sequence &sequence, MapFunction function) - \relates Calls \a function once for each item in \a sequence. The \a function is passed a reference to the item, so that any modifications done to the item @@ -244,7 +241,6 @@ /*! \fn QFuture QtConcurrent::map(Iterator begin, Iterator end, MapFunction function) - \relates Calls \a function once for each item from \a begin to \a end. The \a function is passed a reference to the item, so that any modifications @@ -253,7 +249,6 @@ /*! \fn QFuture QtConcurrent::mapped(const Sequence &sequence, MapFunction function) - \relates Calls \a function once for each item in \a sequence and returns a future with each mapped item as a result. You can use QFuture::const_iterator or @@ -262,7 +257,6 @@ /*! \fn QFuture QtConcurrent::mapped(ConstIterator begin, ConstIterator end, MapFunction function) - \relates Calls \a function once for each item from \a begin to \a end and returns a future with each mapped item as a result. You can use @@ -274,8 +268,6 @@ MapFunction mapFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions) - \relates - Calls \a mapFunction once for each item in \a sequence. The return value of each \a mapFunction is passed to \a reduceFunction. @@ -289,8 +281,6 @@ ConstIterator end, MapFunction mapFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions) - \relates - Calls \a mapFunction once for each item from \a begin to \a end. The return value of each \a mapFunction is passed to \a reduceFunction. @@ -357,8 +347,6 @@ /*! \fn T QtConcurrent::blockingMappedReduced(const Sequence &sequence, MapFunction mapFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions) - \relates - Calls \a mapFunction once for each item in \a sequence. The return value of each \a mapFunction is passed to \a reduceFunction. @@ -374,8 +362,6 @@ /*! \fn T QtConcurrent::blockingMappedReduced(ConstIterator begin, ConstIterator end, MapFunction mapFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions) - \relates - Calls \a mapFunction once for each item from \a begin to \a end. The return value of each \a mapFunction is passed to \a reduceFunction. diff --git a/src/concurrent/qtconcurrentrun.cpp b/src/concurrent/qtconcurrentrun.cpp index c60fa147773..c71fc9048f4 100644 --- a/src/concurrent/qtconcurrentrun.cpp +++ b/src/concurrent/qtconcurrentrun.cpp @@ -40,19 +40,15 @@ ****************************************************************************/ /*! - \headerfile - \title Asynchronous Run - - \brief The header provides a way to run a function in a - separate thread. - + \page qtconcurrentrun.html + \title Concurrent Run \ingroup thread - This function is a part of the \l {Qt Concurrent} framework. - The QtConcurrent::run() function runs a function in a separate thread. The return value of the function is made available through the QFuture API. + This function is a part of the \l {Qt Concurrent} framework. + \section1 Running a Function in a Separate Thread To run a function in another thread, use QtConcurrent::run(): @@ -133,7 +129,6 @@ /*! \fn QFuture QtConcurrent::run(Function function, ...); - \relates Runs \a function in a separate thread. The thread is taken from the global QThreadPool. Note that the function may not run immediately; the function From c3c1faafe63d19039ccab3c5829561ce7a24fdfb Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Mon, 28 Oct 2013 19:18:19 +0800 Subject: [PATCH 080/494] Issue correct warnings with QObject::startTimer() These are not specific to QTimer Change-Id: Idcffab51a3277413889a727afa1cf7ce15171ec9 Reviewed-by: Olivier Goffart --- src/corelib/kernel/qobject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index a52fd25e088..8ee43f2e979 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -1484,12 +1484,12 @@ int QObject::startTimer(int interval, Qt::TimerType timerType) Q_D(QObject); if (interval < 0) { - qWarning("QObject::startTimer: QTimer cannot have a negative interval"); + qWarning("QObject::startTimer: Timers cannot have negative intervals"); return 0; } if (!d->threadData->eventDispatcher.load()) { - qWarning("QObject::startTimer: QTimer can only be used with threads started with QThread"); + qWarning("QObject::startTimer: Timers can only be used with threads started with QThread"); return 0; } int timerId = d->threadData->eventDispatcher.load()->registerTimer(interval, timerType, this); From 0d7d5ff5d050537e33bc35d56c5214063821a1a4 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Tue, 29 Oct 2013 00:07:56 +0800 Subject: [PATCH 081/494] Doc: Fix miscellaneous typos Change-Id: Iaf0dd8974c3ad78beffa995c596a76fb3e4cceab Reviewed-by: Jerome Pasion Reviewed-by: Kurt Pattyn --- .../doc/snippets/code/src_corelib_tools_qbytearray.cpp | 4 ++-- src/corelib/doc/src/threads.qdoc | 4 ++-- src/corelib/io/qfileinfo.cpp | 2 +- src/corelib/thread/qreadwritelock.cpp | 2 +- src/network/bearer/qnetworkconfiguration.cpp | 1 - src/sql/models/qsqltablemodel.cpp | 2 +- src/widgets/itemviews/qabstractitemview.cpp | 2 +- src/widgets/itemviews/qlistwidget.cpp | 2 +- src/widgets/itemviews/qtablewidget.cpp | 2 +- 9 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp index 003fce580b5..9210d2737f6 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearray.cpp @@ -416,7 +416,7 @@ text.data(); // returns "Qt is great!" //! [46] QString tmp = "test"; QByteArray text = tmp.toLocal8Bit(); -char *data = new char[text.size()] +char *data = new char[text.size()]; strcpy(data, text.data()); delete [] data; //! [46] @@ -424,7 +424,7 @@ delete [] data; //! [47] QString tmp = "test"; QByteArray text = tmp.toLocal8Bit(); -char *data = new char[text.size() + 1] +char *data = new char[text.size() + 1]; strcpy(data, text.data()); delete [] data; //! [47] diff --git a/src/corelib/doc/src/threads.qdoc b/src/corelib/doc/src/threads.qdoc index 890fd9f6ffe..25276404b0a 100644 --- a/src/corelib/doc/src/threads.qdoc +++ b/src/corelib/doc/src/threads.qdoc @@ -395,7 +395,7 @@ If a thread locks a resource but does not unlock it, the application may freeze because the resource will become permanently unavailable to other threads. - This can happen, for example, if a an exception is thrown and forces the current + This can happen, for example, if an exception is thrown and forces the current function to return without releasing its lock. Another similar scenario is a \e{deadlock}. For example, suppose that @@ -408,7 +408,7 @@ QMutexLocker, QReadLocker and QWriteLocker are convenience classes that make it easier to use QMutex and QReadWriteLock. They lock a resource when they are constructed, and automatically unlock it when they are destroyed. They are - designed to simplify code that use QMutex and QReadWriteLocker, thus reducing + designed to simplify code that use QMutex and QReadWriteLock, thus reducing the chances that a resource becomes permanently locked by accident. \section1 High-Level Event Queues diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 897af352c93..2cf97ef94eb 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -682,7 +682,7 @@ bool QFileInfo::exists() const \note If \a file is a symlink that points to a non-existing file, false is returned. - \note Using this function is faster for than using + \note Using this function is faster than using \c QFileInfo(file).exists() for file system access. */ bool QFileInfo::exists(const QString &file) diff --git a/src/corelib/thread/qreadwritelock.cpp b/src/corelib/thread/qreadwritelock.cpp index e4cdf7a9859..ffda3c4fadf 100644 --- a/src/corelib/thread/qreadwritelock.cpp +++ b/src/corelib/thread/qreadwritelock.cpp @@ -98,7 +98,7 @@ QT_BEGIN_NAMESPACE \since 4.4 \value Recursive In this mode, a thread can lock the same - QReadWriteLock multiple times and the mutex won't be unlocked + QReadWriteLock multiple times. The QReadWriteLock won't be unlocked until a corresponding number of unlock() calls have been made. \value NonRecursive In this mode, a thread may only lock a diff --git a/src/network/bearer/qnetworkconfiguration.cpp b/src/network/bearer/qnetworkconfiguration.cpp index 8d34db19cd0..a66b39f7333 100644 --- a/src/network/bearer/qnetworkconfiguration.cpp +++ b/src/network/bearer/qnetworkconfiguration.cpp @@ -591,7 +591,6 @@ QNetworkConfiguration::BearerType QNetworkConfiguration::bearerTypeFamily() cons \li Value \row \li BearerUnknown - \li \li The session is based on an unknown or unspecified bearer type. The value of the string returned describes the bearer type. \row diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp index da9b96a6257..7367f6e7f4f 100644 --- a/src/sql/models/qsqltablemodel.cpp +++ b/src/sql/models/qsqltablemodel.cpp @@ -204,7 +204,7 @@ bool QSqlTableModelPrivate::exec(const QString &stmt, bool prepStatement, \inmodule QtSql QSqlTableModel is a high-level interface for reading and writing - database records from a single table. It is build on top of the + database records from a single table. It is built on top of the lower-level QSqlQuery and can be used to provide data to view classes such as QTableView. For example: diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 726c2704c4a..fd704e479b2 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -1042,7 +1042,7 @@ QAbstractItemView::SelectionBehavior QAbstractItemView::selectionBehavior() cons Sets the current item to be the item at \a index. Unless the current selection mode is - \l{QAbstractItemView::}{NoSelection}, the item is also be selected. + \l{QAbstractItemView::}{NoSelection}, the item is also selected. Note that this function also updates the starting position for any new selections the user performs. diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp index aa1dbf1de3a..5040192f31f 100644 --- a/src/widgets/itemviews/qlistwidget.cpp +++ b/src/widgets/itemviews/qlistwidget.cpp @@ -1456,7 +1456,7 @@ QListWidgetItem *QListWidget::currentItem() const Sets the current item to \a item. Unless the selection mode is \l{QAbstractItemView::}{NoSelection}, - the item is also be selected. + the item is also selected. */ void QListWidget::setCurrentItem(QListWidgetItem *item) { diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp index 43b6b62cc11..71034f6165c 100644 --- a/src/widgets/itemviews/qtablewidget.cpp +++ b/src/widgets/itemviews/qtablewidget.cpp @@ -2125,7 +2125,7 @@ QTableWidgetItem *QTableWidget::currentItem() const Sets the current item to \a item. Unless the selection mode is \l{QAbstractItemView::}{NoSelection}, - the item is also be selected. + the item is also selected. \sa currentItem(), setCurrentCell() */ From 396aa7fadee47fc2081abbb224e93ac8d668daa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 25 Oct 2013 17:20:05 +0200 Subject: [PATCH 082/494] iOS: Build simulator libraries with suffix Makes it possible to join two separate builds, and opens up for using exclusive builds to do this. Change-Id: I87ccbdd55511fdfbef3fe8b581f40525ebf077ed Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_functions.prf | 11 ++++++++--- mkspecs/macx-ios-clang/features/default_pre.prf | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index d01c25c06d7..1dacfedd028 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -1,11 +1,16 @@ defineReplace(qtPlatformTargetSuffix) { + ios:CONFIG(iphonesimulator, iphonesimulator|iphoneos): \ + suffix = _iphonesimulator + else: \ + suffix = + CONFIG(debug, debug|release) { !debug_and_release|build_pass { - mac:return(_debug) - win32:return(d) + mac: return($${suffix}_debug) + win32: return($${suffix}d) } } - return() + return($$suffix) } defineReplace(qtLibraryTarget) { diff --git a/mkspecs/macx-ios-clang/features/default_pre.prf b/mkspecs/macx-ios-clang/features/default_pre.prf index b37f67495c3..3501f5eae00 100644 --- a/mkspecs/macx-ios-clang/features/default_pre.prf +++ b/mkspecs/macx-ios-clang/features/default_pre.prf @@ -1,6 +1,10 @@ load(default_pre) +# In case Qt was built for a specific SDK +!iphonesimulator_and_iphoneos:contains(QMAKE_MAC_SDK, ^iphonesimulator.*): \ + CONFIG += iphonesimulator + # Check for supported Xcode versions lessThan(QMAKE_XCODE_VERSION, "4.3"): \ error("This mkspec requires Xcode 4.3 or later") From ac693bf7541552fad9cb216e200c85b441fcde58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 25 Oct 2013 14:19:10 +0200 Subject: [PATCH 083/494] Add QGuiApplication::sync() function This will allow applications to make sure Qt has the same state as the window system at any given point. The use of this function is discouraged but it is very useful for auto tests. Change-Id: I691bff365fc391e9d7213f2607008983505bb774 Reviewed-by: Paul Olav Tvete --- src/gui/kernel/qguiapplication.cpp | 21 +++++++++++++++++++ src/gui/kernel/qguiapplication.h | 1 + src/gui/kernel/qplatformintegration.cpp | 15 +++++++++++++ src/gui/kernel/qplatformintegration.h | 5 ++++- src/plugins/platforms/xcb/qxcbintegration.cpp | 8 +++++++ src/plugins/platforms/xcb/qxcbintegration.h | 1 + 6 files changed, 50 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 2e6000625e3..077084b80fe 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2801,6 +2801,27 @@ bool QGuiApplication::isSavingSession() const return d->is_saving_session; } +/*! + \since 5.2 + + Function that can be used to sync Qt state with the Window Systems state. + + This function will first empty Qts events by calling QCoreApplication::processEvents(), + then the platform plugin will sync up with the windowsystem, and finally Qts events + will be delived by another call to QCoreApplication::processEvents(); + + This function is timeconsuming and its use is discouraged. +*/ +void QGuiApplication::sync() +{ + QCoreApplication::processEvents(); + if (QGuiApplicationPrivate::platform_integration + && QGuiApplicationPrivate::platform_integration->hasCapability(QPlatformIntegration::SyncState)) { + QGuiApplicationPrivate::platform_integration->sync(); + QCoreApplication::processEvents(); + } +} + void QGuiApplicationPrivate::commitData() { Q_Q(QGuiApplication); diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h index bd42f184184..0089d48fa6f 100644 --- a/src/gui/kernel/qguiapplication.h +++ b/src/gui/kernel/qguiapplication.h @@ -155,6 +155,7 @@ public: bool isSavingSession() const; #endif + static void sync(); Q_SIGNALS: void fontDatabaseChanged(); void screenAdded(QScreen *screen); diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index 49ac7836cb9..e583606e416 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -435,4 +435,19 @@ QPlatformSessionManager *QPlatformIntegration::createPlatformSessionManager(cons } #endif +/*! + \since 5.2 + + Function to sync the platform integrations state with the window system. + + This is often implemented as a roundtrip from the platformintegration to the window system. + + This function should not call QWindowSystemInterface::flushWindowSystemEvents() or + QCoreApplication::processEvents() +*/ +void QPlatformIntegration::sync() +{ + +} + QT_END_NAMESPACE diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h index d3189f8641b..4be675a37a9 100644 --- a/src/gui/kernel/qplatformintegration.h +++ b/src/gui/kernel/qplatformintegration.h @@ -94,7 +94,8 @@ public: ForeignWindows, NonFullScreenWindows, NativeWidgets, - WindowManagement + WindowManagement, + SyncState }; virtual ~QPlatformIntegration() { } @@ -162,6 +163,8 @@ public: #ifndef QT_NO_SESSIONMANAGER virtual QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const; #endif + + virtual void sync(); protected: void screenAdded(QPlatformScreen *screen); }; diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 6b5ea936388..d794065d45e 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -282,6 +282,7 @@ bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const case WindowMasks: return true; case MultipleWindows: return true; case ForeignWindows: return true; + case SyncState: return true; default: return QPlatformIntegration::hasCapability(cap); } } @@ -458,4 +459,11 @@ QPlatformSessionManager *QXcbIntegration::createPlatformSessionManager(const QSt } #endif +void QXcbIntegration::sync() +{ + for (int i = 0; i < m_connections.size(); i++) { + m_connections.at(i)->sync(); + } +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h index 79fb1965c4a..6ae23125c85 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.h +++ b/src/plugins/platforms/xcb/qxcbintegration.h @@ -106,6 +106,7 @@ public: QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; #endif + void sync(); private: QList m_connections; From 43002e25723e923f035f1507eb5b66312ab708cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 25 Oct 2013 12:02:21 +0200 Subject: [PATCH 084/494] Silence the _COMPIZ_DECOR_* warnings on Ubuntu Earliest occurrence is to my knowledge in 12.04. It is still unclear how to act on those messages Change-Id: I7da48281c6bec973448a1d4cd800d445a80695a2 Reviewed-by: Gatis Paeglis Reviewed-by: Gunnar Sletta --- src/plugins/platforms/xcb/qxcbconnection.cpp | 5 ++++- src/plugins/platforms/xcb/qxcbconnection.h | 4 ++++ src/plugins/platforms/xcb/qxcbwindow.cpp | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index e6ef6b2a09a..cc8c42f96b4 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -1438,7 +1438,10 @@ static const char * xcb_atomnames = { #if XCB_USE_MAEMO_WINDOW_PROPERTIES "_MEEGOTOUCH_ORIENTATION_ANGLE\0" #endif - "_XSETTINGS_SETTINGS\0" // \0\0 terminates loop. + "_XSETTINGS_SETTINGS\0" + "_COMPIZ_DECOR_PENDING\0" + "_COMPIZ_DECOR_REQUEST\0" + "_COMPIZ_DECOR_DELETE_PIXMAP\0" // \0\0 terminates loop. }; QXcbAtom::Atom QXcbConnection::qatom(xcb_atom_t xatom) const diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 0e52b2ec463..ff7a6dd6066 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -277,6 +277,10 @@ namespace QXcbAtom { #endif _XSETTINGS_SETTINGS, + _COMPIZ_DECOR_PENDING, + _COMPIZ_DECOR_REQUEST, + _COMPIZ_DECOR_DELETE_PIXMAP, + NPredefinedAtoms, _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index aa53093868e..c1650f65760 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1549,6 +1549,10 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even || event->type == atom(QXcbAtom::WM_CHANGE_STATE)) { // Ignore _NET_ACTIVE_WINDOW, _NET_WM_STATE, MANAGER which are relate to tray icons // and other messages. + } else if (event->type == atom(QXcbAtom::_COMPIZ_DECOR_PENDING) + || event->type == atom(QXcbAtom::_COMPIZ_DECOR_REQUEST) + || event->type == atom(QXcbAtom::_COMPIZ_DECOR_DELETE_PIXMAP)) { + //silence the _COMPIZ messages for now } else { qWarning() << "QXcbWindow: Unhandled client message:" << connection()->atomName(event->type); } From f18fd0450c2490bbbe1f59a99580139815a82e2f Mon Sep 17 00:00:00 2001 From: Joshua Grauman Date: Sat, 26 Oct 2013 15:25:03 -0700 Subject: [PATCH 085/494] Fix finding cursor position in words with accents In positionInLigature() we were mixing indexes into the script item with indexes into the entire string. The getClusterLength() function would expect an attributes array for the current script item and it thus needs to be adjusted by si->position. In addition, when looking for the next grapheme boundary, we were comparing pos (which indexed the string) with end (which indexed the script item). This has also now been fixed by adjusting for si->position as well. Task-number: QTBUG-30123 Change-Id: Id02e2eddcc5b7888eacb34bd1e39cc6911880ca1 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextengine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 2b0f9ffeb6f..6345ed76820 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -3100,7 +3100,7 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end, glyph_pos--; } - const QCharAttributes *attrs = attributes(); + const QCharAttributes *attrs = attributes() + si->position; logClusters = this->logClusters(si); clusterLength = getClusterLength(logClusters, attrs, 0, end, glyph_pos, &clusterStart); @@ -3117,11 +3117,11 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end, int closestItem = dist > (perItemWidth / 2) ? n + 1 : n; if (cursorOnCharacter && closestItem > 0) closestItem--; - int pos = si->position + clusterStart + closestItem; + int pos = clusterStart + closestItem; // Jump to the next grapheme boundary while (pos < end && !attrs[pos].graphemeBoundary) pos++; - return pos; + return si->position + pos; } return si->position + end; } From f0625d2b88b1bf15379f17932a36ad5824ad8a14 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 18 Oct 2013 14:43:27 +0200 Subject: [PATCH 086/494] Use Q_UNLIKELY in qCDebug, qCTrace By default debug, trace is disabled, so this can be marked as unlikely. Change-Id: I221a688c953c1ff1fdfda65d2d99457785d3ff47 Reviewed-by: hjk Reviewed-by: Thiago Macieira --- src/corelib/io/qloggingcategory.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qloggingcategory.h b/src/corelib/io/qloggingcategory.h index 7a119f4937a..da96dee12ed 100644 --- a/src/corelib/io/qloggingcategory.h +++ b/src/corelib/io/qloggingcategory.h @@ -154,7 +154,7 @@ private: } #define qCDebug(category) \ - for (bool enabled = category().isDebugEnabled(); enabled; enabled = false) \ + for (bool enabled = category().isDebugEnabled(); Q_UNLIKELY(enabled); enabled = false) \ QMessageLogger(__FILE__, __LINE__, Q_FUNC_INFO, category().categoryName()).debug() #define qCWarning(category) \ for (bool enabled = category().isWarningEnabled(); enabled; enabled = false) \ @@ -163,7 +163,7 @@ private: for (bool enabled = category().isCriticalEnabled(); enabled; enabled = false) \ QMessageLogger(__FILE__, __LINE__, Q_FUNC_INFO, category().categoryName()).critical() #define qCTrace(category) \ - for (bool enabled = category.isTraceEnabled(); enabled; enabled = false) \ + for (bool enabled = category.isTraceEnabled(); Q_UNLIKELY(enabled); enabled = false) \ QTraceGuard(category) From fae95d5da36f4011525a96b69187805db770e04a Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 25 Oct 2013 17:00:17 +0200 Subject: [PATCH 087/494] Test that Qt tools can handle ' as a digit separator. Change-Id: I0a3446d02184989c32367e66d4f5d9e464a56ec6 Reviewed-by: Thiago Macieira --- tests/auto/tools/moc/moc.pro | 3 +- .../moc/single-quote-digit-separator-n3781.h | 58 +++++++++++++++++++ tests/auto/tools/qdbuscpp2xml/test1.h | 11 ++++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 tests/auto/tools/moc/single-quote-digit-separator-n3781.h diff --git a/tests/auto/tools/moc/moc.pro b/tests/auto/tools/moc/moc.pro index 0d25131c479..779e9928816 100644 --- a/tests/auto/tools/moc/moc.pro +++ b/tests/auto/tools/moc/moc.pro @@ -23,7 +23,8 @@ HEADERS += using-namespaces.h no-keywords.h task87883.h c-comments.h backslash-n forward-declared-param.h \ parse-defines.h \ function-with-attributes.h \ - plugin_metadata.h + plugin_metadata.h \ + single-quote-digit-separator-n3781.h if(*-g++*|*-icc*|*-clang*|*-llvm):!irix-*:!win32-*: HEADERS += os9-newlines.h win-newlines.h diff --git a/tests/auto/tools/moc/single-quote-digit-separator-n3781.h b/tests/auto/tools/moc/single-quote-digit-separator-n3781.h new file mode 100644 index 00000000000..0b234011d58 --- /dev/null +++ b/tests/auto/tools/moc/single-quote-digit-separator-n3781.h @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +class KDAB : public QObject +{ + Q_OBJECT +public: + // C++1y allows use of single quote as a digit separator, useful for large + // numbers. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3781.pdf + // Ensure that moc does not get confused with this. + enum Salaries { + Steve +#ifdef Q_MOC_RUN + = 1'234'567 +#endif + }; + Q_ENUMS(Salaries) +}; diff --git a/tests/auto/tools/qdbuscpp2xml/test1.h b/tests/auto/tools/qdbuscpp2xml/test1.h index d4a7d1dab36..b08115e1939 100644 --- a/tests/auto/tools/qdbuscpp2xml/test1.h +++ b/tests/auto/tools/qdbuscpp2xml/test1.h @@ -54,7 +54,18 @@ class Test1 : public QObject Q_CLASSINFO("D-Bus Interface", "org.qtProject.qdbuscpp2xmlTests.Test1") Q_PROPERTY(int numProperty1 READ numProperty1 CONSTANT) Q_PROPERTY(int numProperty2 READ numProperty2 WRITE setNumProperty2) + Q_ENUMS(Salaries) public: + // C++1y allows use of single quote as a digit separator, useful for large + // numbers. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3781.pdf + // Ensure that qdbuscpp2xml does not get confused with this appearing. + enum Salaries { + Steve +#ifdef Q_MOC_RUN + = 1'234'567 +#endif + }; + Test1(QObject *parent = 0) : QObject(parent) {} int numProperty1() { return 42; } From c1f76a3347f23792110c19508b166d60dedb3dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simo=20F=C3=A4lt?= Date: Tue, 29 Oct 2013 11:41:20 +0200 Subject: [PATCH 088/494] Adding CI utilities to Android test script It is now configurable if test results are stored in xml, plain text or in both formats. Default is xml, like it was, Max runtime is also configurable so that we can reduce the CI round. With default setting it takes more than eight hours within current CI node. The latest test result dir is linked as latest. Change-Id: I5d27cefe17e4f86648132db7ec104711d993c3de Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../auto/android/runtests_androiddeployqt.pl | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/tests/auto/android/runtests_androiddeployqt.pl b/tests/auto/android/runtests_androiddeployqt.pl index d3c9a7bc110..1cc52d0495c 100755 --- a/tests/auto/android/runtests_androiddeployqt.pl +++ b/tests/auto/android/runtests_androiddeployqt.pl @@ -53,6 +53,8 @@ use Pod::Usage; my @stack = cwd; my $device_serial=""; # "-s device_serial"; my $deployqt_device_serial=""; # "-device device_serial"; +my $log_out="xml"; +my $max_runtime = 5; my $className="org.qtproject.qt5.android.bindings.QtActivity"; my $jobs = 4; my $testsubset = ""; @@ -75,6 +77,8 @@ GetOptions('h|help' => \$help , 't|test=s' => \$testsubset , 'c|clean' => \$make_clean , 'j|jobs=i' => \$jobs + , 'logtype=s' => \$log_out + , 'runtime=i' => \$max_runtime , 'sdk=s' => \$android_sdk_dir , 'ndk=s' => \$android_ndk_dir , 'toolchain=s' => \$android_toolchain_version @@ -102,7 +106,6 @@ if ($android_to_connect ne ""){ $device_serial =$android_to_connect; } - system("$adb_tool devices") == 0 or die "No device found, please plug/start at least one device/emulator\n"; # make sure we have at least on device attached $deployqt_device_serial = "--device $device_serial" if ($device_serial); @@ -171,6 +174,8 @@ my $temp_dir=tempdir(CLEANUP => 1); my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); my $output_dir=$stack[0]."/".(1900+$year)."-$mon-$mday-$hour:$min"; mkdir($output_dir); +unlink("latest"); +system(" ln -s $output_dir latest"); my $sdk_api=0; my $output = `$adb_tool $device_serial shell getprop`; # get device properties if ($output =~ m/.*\[ro.build.version.sdk\]: \[(\d+)\]/) @@ -186,8 +191,22 @@ sub startTest my $packageName = "org.qtproject.example.tst_$testName"; my $intentName = "$packageName/org.qtproject.qt5.android.bindings.QtActivity"; my $output_file = shift; + my $get_xml= 0; + my $get_txt= 0; + my $testLib =""; + if ($log_out eq "xml") { + $testLib="-o /data/data/$packageName/output.xml,xml"; + $get_xml = 1; + } elsif ($log_out eq "txt") { + $testLib="-o /data/data/$packageName/output.txt,txt"; + $get_txt = 1; + } else { + $testLib="-o /data/data/$packageName/output.xml,xml -o /data/data/$packageName/output.txt,txt"; + $get_xml = 1; + $get_txt = 1; + } - system("$adb_tool $device_serial shell am start -e applicationArguments \"-o /data/data/$packageName/output.xml\" -n $intentName"); # start intent + system("$adb_tool $device_serial shell am start -e applicationArguments \"$testLib\" -n $intentName"); # start intent #wait to start (if it has not started and quit already) waitForProcess($packageName,1,10); @@ -198,7 +217,8 @@ sub startTest print "Someone should kill $packageName\n"; return 1; } - system("$adb_tool $device_serial pull /data/data/$packageName/output.xml $output_dir/$output_file"); + system("$adb_tool $device_serial pull /data/data/$packageName/output.xml $output_dir/$output_file.xml") if ($get_xml); + system("$adb_tool $device_serial pull /data/data/$packageName/output.txt $output_dir/$output_file.txt") if ($get_txt); return 1; } @@ -228,7 +248,7 @@ foreach (split("\n",$testsFiles)) $output_name =~ s/\///; # remove first "/" character $output_name =~ s/\//_/g; # replace all "/" with "_" $output_name=$application unless($output_name); - $time_out=5*60/5; # 5 minutes time out for a normal test + $time_out=$max_runtime*60/5; # 5 minutes time out for a normal test $applicationLibrary = `find $temp_dir -name libtst_bench_$application.so`; @@ -248,7 +268,7 @@ foreach (split("\n",$testsFiles)) } else { - startTest($application, "$output_name.xml") or warn "Can't run $application ...\n"; + startTest($application, "$output_name") or warn "Can't run $application ...\n"; } popd(); @@ -306,6 +326,14 @@ Android strip tool path, used to deploy qt libs. Android readelf tool path, used to check if a test application uses qt OpenGL. +=item B<--logtype = xml|txt|both> + +The format of log file, default is xml. + +=item B<--runtime = minutes> + +The timeout period before stopping individual tests from running. + =item B<-h --help> Print a brief help message and exits. From 3655d71719a4746938f364bfe0d82c1609c3eacb Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 18 Jul 2013 18:20:42 +0200 Subject: [PATCH 089/494] Fix the network proxy code for windows to detect properly services This patch makes it so even sub processes of services are also detected to be running in the context of a service. With the previous code it would only detect that the current process is a service and not the sub processes. This fix makes sure we detect properly if the current process is running in the context of a service. This is important to detect properly the proxy configuration of the current user. Change-Id: I110dee62597aec3f8e2f6925166a428f72d14fd0 Reviewed-by: Joerg Bornemann Reviewed-by: Friedemann Kleint --- src/network/kernel/qnetworkproxy_win.cpp | 50 +++++++++--------------- 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/src/network/kernel/qnetworkproxy_win.cpp b/src/network/kernel/qnetworkproxy_win.cpp index f1893ae3226..e16d7e557e6 100644 --- a/src/network/kernel/qnetworkproxy_win.cpp +++ b/src/network/kernel/qnetworkproxy_win.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #include "qnetworkfunctions_wince.h" /* @@ -115,48 +116,38 @@ typedef HINTERNET (WINAPI * PtrWinHttpOpen)(LPCWSTR, DWORD, LPCWSTR, LPCWSTR,DWO typedef BOOL (WINAPI * PtrWinHttpGetDefaultProxyConfiguration)(WINHTTP_PROXY_INFO*); typedef BOOL (WINAPI * PtrWinHttpGetIEProxyConfigForCurrentUser)(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG*); typedef BOOL (WINAPI * PtrWinHttpCloseHandle)(HINTERNET); -typedef SC_HANDLE (WINAPI * PtrOpenSCManager)(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess); -typedef BOOL (WINAPI * PtrEnumServicesStatusEx)(SC_HANDLE hSCManager, SC_ENUM_TYPE InfoLevel, DWORD dwServiceType, DWORD dwServiceState, LPBYTE lpServices, DWORD cbBufSize, LPDWORD pcbBytesNeeded, - LPDWORD lpServicesReturned, LPDWORD lpResumeHandle, LPCWSTR pszGroupName); typedef BOOL (WINAPI * PtrCloseServiceHandle)(SC_HANDLE hSCObject); static PtrWinHttpGetProxyForUrl ptrWinHttpGetProxyForUrl = 0; static PtrWinHttpOpen ptrWinHttpOpen = 0; static PtrWinHttpGetDefaultProxyConfiguration ptrWinHttpGetDefaultProxyConfiguration = 0; static PtrWinHttpGetIEProxyConfigForCurrentUser ptrWinHttpGetIEProxyConfigForCurrentUser = 0; static PtrWinHttpCloseHandle ptrWinHttpCloseHandle = 0; -static PtrOpenSCManager ptrOpenSCManager = 0; -static PtrEnumServicesStatusEx ptrEnumServicesStatusEx = 0; -static PtrCloseServiceHandle ptrCloseServiceHandle = 0; +#ifndef Q_OS_WINCE static bool currentProcessIsService() { - if (!ptrOpenSCManager || !ptrEnumServicesStatusEx|| !ptrCloseServiceHandle) - return false; + typedef BOOL (WINAPI *PtrGetUserName)(LPTSTR lpBuffer, LPDWORD lpnSize); + typedef BOOL (WINAPI *PtrLookupAccountName)(LPCTSTR lpSystemName, LPCTSTR lpAccountName, PSID Sid, + LPDWORD cbSid, LPTSTR ReferencedDomainName, LPDWORD cchReferencedDomainName, PSID_NAME_USE peUse); + static PtrGetUserName ptrGetUserName = (PtrGetUserName)QSystemLibrary::resolve(QLatin1String("Advapi32"), "GetUserNameW"); + static PtrLookupAccountName ptrLookupAccountName = (PtrLookupAccountName)QSystemLibrary::resolve(QLatin1String("Advapi32"), "LookupAccountNameW"); - SC_HANDLE hSCM = ptrOpenSCManager(0, 0, SC_MANAGER_ENUMERATE_SERVICE | SC_MANAGER_CONNECT); - if (!hSCM) - return false; - - ULONG bufSize = 0; - ULONG nbServices = 0; - if (ptrEnumServicesStatusEx(hSCM, SC_ENUM_PROCESS_INFO, SERVICE_WIN32, SERVICE_ACTIVE, 0, bufSize, &bufSize, &nbServices, 0, 0)) - return false; //error case - - LPENUM_SERVICE_STATUS_PROCESS info = reinterpret_cast(malloc(bufSize)); - bool foundService = false; - if (ptrEnumServicesStatusEx(hSCM, SC_ENUM_PROCESS_INFO, SERVICE_WIN32, SERVICE_ACTIVE, (LPBYTE)info, bufSize, &bufSize, &nbServices, 0, 0)) { - DWORD currProcId = GetCurrentProcessId(); - for (ULONG i = 0; i < nbServices && !foundService; i++) { - if (info[i].ServiceStatusProcess.dwProcessId == currProcId) - foundService = true; + if (ptrGetUserName && ptrLookupAccountName) { + wchar_t userName[UNLEN + 1] = L""; + DWORD size = UNLEN; + if (ptrGetUserName(userName, &size)) { + SID_NAME_USE type = SidTypeUser; + DWORD dummy = MAX_PATH; + wchar_t dummyStr[MAX_PATH] = L""; + PSID psid = 0; + if (ptrLookupAccountName(NULL, userName, &psid, &dummy, dummyStr, &dummy, &type)) + return type != SidTypeUser; //returns true if the current user is not a user } } - - ptrCloseServiceHandle(hSCM); - free(info); - return foundService; + return false; } +#endif // ! Q_OS_WINCE static QStringList splitSpaceSemicolon(const QString &source) { @@ -418,9 +409,6 @@ void QWindowsSystemProxy::init() ptrWinHttpGetProxyForUrl = (PtrWinHttpGetProxyForUrl)lib.resolve("WinHttpGetProxyForUrl"); ptrWinHttpGetDefaultProxyConfiguration = (PtrWinHttpGetDefaultProxyConfiguration)lib.resolve("WinHttpGetDefaultProxyConfiguration"); ptrWinHttpGetIEProxyConfigForCurrentUser = (PtrWinHttpGetIEProxyConfigForCurrentUser)lib.resolve("WinHttpGetIEProxyConfigForCurrentUser"); - ptrOpenSCManager = (PtrOpenSCManager) QSystemLibrary(L"advapi32").resolve("OpenSCManagerW"); - ptrEnumServicesStatusEx = (PtrEnumServicesStatusEx) QSystemLibrary(L"advapi32").resolve("EnumServicesStatusExW"); - ptrCloseServiceHandle = (PtrCloseServiceHandle) QSystemLibrary(L"advapi32").resolve("CloseServiceHandle"); // Try to obtain the Internet Explorer configuration. WINHTTP_CURRENT_USER_IE_PROXY_CONFIG ieProxyConfig; From e7bda8ee1084e24710e91a32b5ff1434a368cf4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 15 Oct 2013 16:19:26 +0200 Subject: [PATCH 090/494] iOS: Build libs (including Qt itself) for both simulator and device Conceptually a Qt for iOS SDK or source build should support building for both simulator and device, based on the same qmake binary and Qt libraries. Qt Creator or Xcode should then be able to use the same Qt version while still building for a single target at a time. This applies to user libraries as well, which shouldn't require switching to a different Qt when changing target platform from simulator to device. We achieve this by using Qt's exclusive_build feature, where we build for the two targets in parallel, and then teach Xcode how to choose the right library dynamically at build time. Change-Id: I06d60e120d986085fb8686ced98f22f7047c4f23 Reviewed-by: Oswald Buddenhagen Reviewed-by: Richard Moe Gustavsen --- configure | 9 + .../macx-ios-clang/features/default_post.prf | 190 ++++++++++++++---- 2 files changed, 161 insertions(+), 38 deletions(-) diff --git a/configure b/configure index 36f3bb522fe..d74d811546f 100755 --- a/configure +++ b/configure @@ -999,6 +999,7 @@ QPA_PLATFORM_GUARD=yes CFG_CXX11=auto CFG_DIRECTWRITE=no CFG_WERROR=auto +OPT_MAC_SDK= # initalize variables used for installation QT_INSTALL_PREFIX= @@ -1482,6 +1483,7 @@ while [ "$#" -gt 0 ]; do sdk) if [ "$BUILD_ON_MAC" = "yes" ]; then DeviceVar set !host_build:QMAKE_MAC_SDK "$VAL" + OPT_MAC_SDK="$VAL" else UNKNOWN_OPT=yes fi @@ -2871,6 +2873,13 @@ if [ "$XPLATFORM_IOS" = "yes" ]; then CFG_SHARED="no" # iOS builds should be static to be able to submit to the App Store CFG_CXX11="no" # C++11 support disabled for now CFG_SKIP_MODULES="$CFG_SKIP_MODULES qtconnectivity qtdoc qtgraphicaleffects qtlocation qtmacextras qtmultimedia qtquickcontrols qtserialport qttools qtwebkit qtwebkit-examples" + + # If the user passes -sdk on the command line we build a SDK-specific Qt build. + # Otherwise we build a joined simulator and device build, which is the default. + if [ -z "$OPT_MAC_SDK" ]; then + QT_CONFIG="$QT_CONFIG build_all" + QTCONFIG_CONFIG="$QTCONFIG_CONFIG iphonesimulator_and_iphoneos" + fi fi # disable GTK style support auto-detection on Mac diff --git a/mkspecs/macx-ios-clang/features/default_post.prf b/mkspecs/macx-ios-clang/features/default_post.prf index dc41047b641..0a35b1167db 100644 --- a/mkspecs/macx-ios-clang/features/default_post.prf +++ b/mkspecs/macx-ios-clang/features/default_post.prf @@ -1,6 +1,21 @@ +# In case the user sets the SDK manually +contains(QMAKE_MAC_SDK, ^iphonesimulator.*) { + iphonesimulator_and_iphoneos: \ + error("iOS simulator is handled automatically for iphonesimulator_and_iphoneos") + + CONFIG += iphonesimulator +} + +# Resolve config so we don't need to use CONFIG() later on +CONFIG(iphonesimulator, iphonesimulator|iphoneos) { + CONFIG -= iphoneos +} else { + CONFIG -= iphonesimulator + CONFIG += iphoneos +} + equals(TEMPLATE, app) { - # If the application uses Qt, it needs to be an application bundle # to be able to deploy and run on iOS. The only exception to this # is if you're working with a jailbroken device and can run the @@ -8,51 +23,150 @@ equals(TEMPLATE, app) { # use-case we care about, so no need to complicate the logic. qt: CONFIG *= app_bundle - # Application bundles require building through Xcode - app_bundle:!macx-xcode { - # For Qt applications we want Xcode project files as the generated output, - # but since qmake doesn't handle the transition between makefiles and Xcode - # project files (which happens when using subdirs), we create a wrapper - # makefile that takes care of generating the Xcode project, and allows - # building by calling out to xcodebuild. - TEMPLATE = aux + app_bundle { + macx-xcode { + # There is no way to genereate Xcode projects that are limited to either + # simulator or device builds, so iphonesimulator_and_iphoneos is always + # effectivly active, even if the user disabled it explicitly. + # The Xcode generator doesn't support multiple BUILDS though (exclusive + # builds), so we have to manually set up the simulator suffix. + library_suffix_iphonesimulator.name = "$${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING}[sdk=iphonesimulator*]" + library_suffix_iphonesimulator.value = "_iphonesimulator$($${QMAKE_XCODE_LIBRARY_SUFFIX_SETTING})" + QMAKE_MAC_XCODE_SETTINGS += library_suffix_iphonesimulator + CONFIG *= xcode_dynamic_library_suffix + } else { + # For Qt applications we want Xcode project files as the generated output, + # but since qmake doesn't handle the transition between makefiles and Xcode + # project files (which happens when using subdirs), we create a wrapper + # makefile that takes care of generating the Xcode project, and allows + # building by calling out to xcodebuild. + TEMPLATE = aux - CONFIG = - SOURCES = - OBJECTIVE_SOURCES = - RESOURCES = - INSTALLS = - QMAKE_EXTRA_COMPILERS = - QMAKE_EXTRA_TARGETS = + SOURCES = + OBJECTIVE_SOURCES = + RESOURCES = + INSTALLS = + QMAKE_EXTRA_COMPILERS = + QMAKE_EXTRA_TARGETS = - TARGET_XCODE_PROJECT_DIR = $${TARGET}.xcodeproj + !build_pass { + CONFIG += debug_and_release + load(resolve_config) - args = - for(arg, QMAKE_ARGS): \ - args += $$system_quote($$arg) + CONFIG += iphonesimulator_and_iphoneos + iphonesimulator.name = Simulator + iphoneos.name = Device + addExclusiveBuilds(iphonesimulator, iphoneos) - system("cd $$system_quote($$OUT_PWD) && $$QMAKE_QMAKE $$args $$system_quote($$_PRO_FILE_) -spec macx-xcode") + load(exclusive_builds_post) - # We use xcodebuild to do the actual build, but filter out the verbose - # output that shows all environment variables for each build step. - xcodebuild_build.commands = "@bash -o pipefail -c 'xcodebuild | grep -v setenv'" - QMAKE_EXTRA_TARGETS += xcodebuild_build - all.depends = xcodebuild_build - QMAKE_EXTRA_TARGETS += all + xcode_distclean.commands = "$(DEL_FILE) -R $${TARGET}.xcodeproj" + xcode_distclean.depends = \ + debug-iphonesimulator-distclean debug-iphoneos-distclean \ + release-iphonesimulator-distclean release-iphoneos-distclean + QMAKE_EXTRA_TARGETS += xcode_distclean + distclean.depends = xcode_distclean + QMAKE_EXTRA_TARGETS += distclean - # We do the same for the clean action - xcodebuild_clean.commands = "@xcodebuild clean" - QMAKE_EXTRA_TARGETS += xcodebuild_clean - clean.depends = xcodebuild_clean - QMAKE_EXTRA_TARGETS += clean + args = + for(arg, QMAKE_ARGS): \ + args += $$system_quote($$arg) + system("cd $$system_quote($$OUT_PWD) && $$QMAKE_QMAKE $$args $$system_quote($$_PRO_FILE_) -spec macx-xcode") - # And distclean - xcodebuild_distclean.commands = "$(DEL_FILE) -R $$TARGET_XCODE_PROJECT_DIR" - xcodebuild_distclean.depends = xcodebuild_clean - QMAKE_EXTRA_TARGETS += xcodebuild_distclean - distclean.depends = xcodebuild_distclean - QMAKE_EXTRA_TARGETS += distclean + } else { + load(resolve_config) + + iphonesimulator: \ + sdk = iphonesimulator + else: \ + sdk = iphoneos + + debug: \ + cfg = debug + else: \ + cfg = release + + for(action, $$list(build install clean)) { + equals(action, build) { + action_target_suffix = + action_target = all + } else { + action_target_suffix = -$$action + action_target = $$action + } + + target = $${sdk}-$${cfg}$${action_target_suffix} + + $${target}.commands = "@bash -o pipefail -c 'xcodebuild $$action -sdk $$sdk -configuration $$title($$cfg) | grep -v setenv'" + QMAKE_EXTRA_TARGETS += $$target + + $${action_target}.depends += $$target + QMAKE_EXTRA_TARGETS *= $${action_target} + } + + xcode_build_dir_distclean.commands = "$(DEL_FILE) -R $$title($$cfg)-$${sdk}" + xcode_build_dir_distclean.depends = clean + QMAKE_EXTRA_TARGETS += xcode_build_dir_distclean + distclean.depends = xcode_build_dir_distclean + QMAKE_EXTRA_TARGETS += distclean + } + + CONFIG = + } } +} else: equals(TEMPLATE, lib) { + iphonesimulator.name = Simulator + iphoneos.name = Device + addExclusiveBuilds(iphonesimulator, iphoneos) + + iphonesimulator_and_iphoneos:iphonesimulator { + QT_ARCH = i386 + QMAKE_MAC_SDK ~= s,^iphoneos,iphonesimulator, + + # Since the CPU feature detection done by configure is limited to one + # target at the moment, we disable SIMD support for simulator. + CONFIG -= simd + } +} else: equals(TEMPLATE, subdirs) { + # Prevent recursion into host_builds + for(subdir, SUBDIRS) { + contains($${subdir}.CONFIG, host_build) { + $${subdir}.CONFIG += no_iphoneos_target no_iphonesimulator_target + + # Other targets which we do want to recurse into may depend on this target, + # for example corelib depends on moc, rcc, bootstrap, etc, and other libs + # may depend on host-tools that are needed to build the lib, so we resolve + # the final target name and redirect it to the base target, so that the + # dependency chain is not broken for the other targets. + + !isEmpty($${subdir}.target) { + target = $$eval($${subdir}.target) + } else { + !isEmpty($${subdir}.file): \ + file = $$eval($${subdir}.file) + else: !isEmpty($${subdir}.subdir): \ + file = $$eval($${subdir}.subdir) + else: \ + file = $$subdir + + target = sub-$$file + } + + target ~= s,[^a-zA-Z0-9_],-, + + $${target}-iphonesimulator.depends = $$target + $${target}-iphoneos.depends = $$target + QMAKE_EXTRA_TARGETS += $${target}-iphonesimulator $${target}-iphoneos + } + } + + prepareRecursiveTarget(iphonesimulator) + prepareRecursiveTarget(iphoneos) + QMAKE_EXTRA_TARGETS += iphonesimulator iphoneos + +} else: equals(TEMPLATE, aux) { + # Dummy targets for the 'aux' TEMPLATE, so we can always recurse + QMAKE_EXTRA_TARGETS *= iphonesimulator iphoneos } macx-xcode { From 105e228d1c733e20787fd80e669be22064149c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 30 Oct 2013 10:44:40 +0100 Subject: [PATCH 091/494] xcb: Act on the _NET_ACTIVE_WINDOW event It happens that we don't get a focus inn event for top level windows when focus goes from a window mapped. But we do get a _NET_ACTIVE_WINDOW event. Task-number: QTBUG-34426 Change-Id: Id1d9eb708a968e0e8934e56dec19abe2dd203bc7 Reviewed-by: Gunnar Sletta --- src/plugins/platforms/xcb/qxcbwindow.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index c1650f65760..dd404d044df 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1544,10 +1544,13 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even #endif } else if (event->type == atom(QXcbAtom::_XEMBED)) { handleXEmbedMessage(event); - } else if (event->type == atom(QXcbAtom::MANAGER) || event->type == atom(QXcbAtom::_NET_ACTIVE_WINDOW) - || event->type == atom(QXcbAtom::_NET_WM_STATE) || event->type == atom(QXcbAtom::MANAGER) + } else if (event->type == atom(QXcbAtom::_NET_ACTIVE_WINDOW)) { + connection()->setFocusWindow(this); + QWindowSystemInterface::handleWindowActivated(window()); + } else if (event->type == atom(QXcbAtom::MANAGER) + || event->type == atom(QXcbAtom::_NET_WM_STATE) || event->type == atom(QXcbAtom::WM_CHANGE_STATE)) { - // Ignore _NET_ACTIVE_WINDOW, _NET_WM_STATE, MANAGER which are relate to tray icons + // Ignore _NET_WM_STATE, MANAGER which are relate to tray icons // and other messages. } else if (event->type == atom(QXcbAtom::_COMPIZ_DECOR_PENDING) || event->type == atom(QXcbAtom::_COMPIZ_DECOR_REQUEST) From f1927370cbb89438c95d56e9fb4556e7c2f4f666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 30 Oct 2013 12:06:17 +0100 Subject: [PATCH 092/494] xcb: Compilefix #ifdef glx code Change-Id: I4204cab76b2621318dda909d24ceb2abab6e0ba3 Reviewed-by: Gunnar Sletta --- src/plugins/platforms/xcb/qxcbintegration.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index d794065d45e..ecbf28bab9e 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -278,7 +278,11 @@ bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const #else case OpenGL: return false; #endif +#if defined(XCB_USE_GLX) case ThreadedOpenGL: return m_connections.at(0)->supportsThreadedRendering() && QGLXContext::supportsThreading(); +#else + case ThreadedOpenGL: return m_connections.at(0)->supportsThreadedRendering(); +#endif case WindowMasks: return true; case MultipleWindows: return true; case ForeignWindows: return true; From aa92cab34664143aa92ed6808ec925466de6f1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Wed, 30 Oct 2013 12:41:12 +0100 Subject: [PATCH 093/494] remove compiler warning Change-Id: I40750320d21165333b195aca7564a6f4ee9d9eef Reviewed-by: Gunnar Sletta --- tests/auto/opengl/qglthreads/tst_qglthreads.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp index c74edab9a23..f5923764b8f 100644 --- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp +++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp @@ -346,12 +346,12 @@ void renderAScene(int w, int h) for (int i=0; i<1000; ++i) { GLfloat pos[] = { - (rand() % 100) / 100., - (rand() % 100) / 100., - (rand() % 100) / 100., - (rand() % 100) / 100., - (rand() % 100) / 100., - (rand() % 100) / 100. + (rand() % 100) / 100.f, + (rand() % 100) / 100.f, + (rand() % 100) / 100.f, + (rand() % 100) / 100.f, + (rand() % 100) / 100.f, + (rand() % 100) / 100.f }; glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, pos); From fb5036b7f12dd648340aaa7f90245afd353759e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Tue, 29 Oct 2013 17:40:56 +0100 Subject: [PATCH 094/494] Android: Fix problem with leaking local refs. In some cases we where not releasing the local references and since we no longer disconnect from the VM on each call, the number of local refs. would accumulating until it hit the hard-limit of 512. Change-Id: I6826620e4cb61a37af26d276667489e876080076 Reviewed-by: Yoann Lopes --- src/corelib/kernel/qjni.cpp | 29 ++++++++++++++++++++++------- src/corelib/kernel/qjni_p.h | 4 +++- src/corelib/kernel/qjnihelpers.cpp | 2 ++ 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp index cf839cfaef2..4e06d12aee8 100644 --- a/src/corelib/kernel/qjni.cpp +++ b/src/corelib/kernel/qjni.cpp @@ -351,7 +351,9 @@ QJNIObjectPrivate::QJNIObjectPrivate(jobject obj) QJNIEnvironmentPrivate env; d->m_jobject = env->NewGlobalRef(obj); - d->m_jclass = static_cast(env->NewGlobalRef(env->GetObjectClass(d->m_jobject))); + jclass objectClass = env->GetObjectClass(d->m_jobject); + d->m_jclass = static_cast(env->NewGlobalRef(objectClass)); + env->DeleteLocalRef(objectClass); } template <> @@ -1262,7 +1264,10 @@ QJNIObjectPrivate QJNIObjectPrivate::callObjectMethod(const char *methodName, if (id) { res = env->CallObjectMethodV(d->m_jobject, id, args); } - return res; + + QJNIObjectPrivate obj(res); + env->DeleteLocalRef(res); + return obj; } QJNIObjectPrivate QJNIObjectPrivate::callObjectMethod(const char *methodName, @@ -1339,7 +1344,9 @@ QJNIObjectPrivate QJNIObjectPrivate::callStaticObjectMethod(const char *classNam } } - return res; + QJNIObjectPrivate obj(res); + env->DeleteLocalRef(res); + return obj; } QJNIObjectPrivate QJNIObjectPrivate::callStaticObjectMethod(const char *className, @@ -1366,7 +1373,9 @@ QJNIObjectPrivate QJNIObjectPrivate::callStaticObjectMethod(jclass clazz, res = env->CallStaticObjectMethodV(clazz, id, args); } - return res; + QJNIObjectPrivate obj(res); + env->DeleteLocalRef(res); + return obj; } QJNIObjectPrivate QJNIObjectPrivate::callStaticObjectMethod(jclass clazz, @@ -1678,7 +1687,9 @@ QJNIObjectPrivate QJNIObjectPrivate::getObjectField(const char *fieldName, if (id) res = env->GetObjectField(d->m_jobject, id); - return res; + QJNIObjectPrivate obj(res); + env->DeleteLocalRef(res); + return obj; } QJNIObjectPrivate QJNIObjectPrivate::getStaticObjectField(const char *className, @@ -1704,7 +1715,9 @@ QJNIObjectPrivate QJNIObjectPrivate::getStaticObjectField(jclass clazz, if (id) res = env->GetStaticObjectField(clazz, id); - return res; + QJNIObjectPrivate obj(res); + env->DeleteLocalRef(res); + return obj; } template <> @@ -2106,7 +2119,9 @@ QJNIObjectPrivate QJNIObjectPrivate::fromString(const QString &string) QJNIEnvironmentPrivate env; jstring res = env->NewString(reinterpret_cast(string.constData()), string.length()); - return res; + QJNIObjectPrivate obj(res); + env->DeleteLocalRef(res); + return obj; } QString QJNIObjectPrivate::toString() const diff --git a/src/corelib/kernel/qjni_p.h b/src/corelib/kernel/qjni_p.h index c5bbae26b93..ab98aec1bfa 100644 --- a/src/corelib/kernel/qjni_p.h +++ b/src/corelib/kernel/qjni_p.h @@ -180,7 +180,9 @@ public: d = QSharedPointer(new QJNIObjectData()); QJNIEnvironmentPrivate env; d->m_jobject = env->NewGlobalRef(jobj); - d->m_jclass = static_cast(env->NewGlobalRef(env->GetObjectClass(jobj))); + jclass objectClass = env->GetObjectClass(jobj); + d->m_jclass = static_cast(env->NewGlobalRef(objectClass)); + env->DeleteLocalRef(objectClass); } return *this; diff --git a/src/corelib/kernel/qjnihelpers.cpp b/src/corelib/kernel/qjnihelpers.cpp index fbcd0606e68..9ec491f6a91 100644 --- a/src/corelib/kernel/qjnihelpers.cpp +++ b/src/corelib/kernel/qjnihelpers.cpp @@ -94,7 +94,9 @@ jint QtAndroidPrivate::initJNI(JavaVM *vm, JNIEnv *env) return JNI_ERR; g_jClassLoader = env->NewGlobalRef(classLoader); + env->DeleteLocalRef(classLoader); g_jActivity = env->NewGlobalRef(activity); + env->DeleteLocalRef(activity); g_javaVM = vm; return JNI_OK; From b280182053a8ccd912eb165b59928e88a6d62c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Tue, 29 Oct 2013 15:06:34 +0100 Subject: [PATCH 095/494] Android: Don't rely on QIcon::isNull() to validate icon data. QIcon::isNull() only checks if it has a valid d pointer and not if it actually contains any image data. The result is that the QImage create from the icon would be invalid, and later cause an exception to be thrown. To avoid this we should check the QImage as well. Task-number: QTBUG-34416 Change-Id: I9dd0a2387d73bfc2c27ceb9df247ddc186dd659f Reviewed-by: BogDan Vatra --- src/plugins/platforms/android/src/androidjnimenu.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/android/src/androidjnimenu.cpp b/src/plugins/platforms/android/src/androidjnimenu.cpp index bb180347c1c..8964995832b 100644 --- a/src/plugins/platforms/android/src/androidjnimenu.cpp +++ b/src/plugins/platforms/android/src/androidjnimenu.cpp @@ -197,16 +197,18 @@ namespace QtAndroidMenu env->CallObjectMethod(menuItem, setCheckedMenuItemMethodID, checked); env->CallObjectMethod(menuItem, setEnabledMenuItemMethodID, enabled); - if (!icon.isNull()) { + if (!icon.isNull()) { // isNull() only checks the d pointer, not the actual image data. int sz = qMax(36, qgetenv("QT_ANDROID_APP_ICON_SIZE").toInt()); QImage img = icon.pixmap(QSize(sz,sz), enabled ? QIcon::Normal : QIcon::Disabled, QIcon::On).toImage(); - env->CallObjectMethod(menuItem, - setIconMenuItemMethodID, - createBitmapDrawable(createBitmap(img, env), env)); + if (!img.isNull()) { // Make sure we have a valid image. + env->CallObjectMethod(menuItem, + setIconMenuItemMethodID, + createBitmapDrawable(createBitmap(img, env), env)); + } } env->CallObjectMethod(menuItem, setVisibleMenuItemMethodID, visible); From ebf0524186177158edde1de01c44aacae8e51d19 Mon Sep 17 00:00:00 2001 From: Michael Krasnyk Date: Tue, 29 Oct 2013 09:42:20 +0200 Subject: [PATCH 096/494] dbuscommon.pri: Fix source file dependency Make already the creation of the generated cpp file depend on the creation of the generated h file, which transitively ensures that the cpp won't be compiled before the h is there. Change-Id: Idd3aec8d72dac341e835a3d1ef8f2986dbc1ab9f Reviewed-by: Oswald Buddenhagen --- mkspecs/features/dbuscommon.pri | 1 + 1 file changed, 1 insertion(+) diff --git a/mkspecs/features/dbuscommon.pri b/mkspecs/features/dbuscommon.pri index 6e1e5659c36..2f2e6b831f6 100644 --- a/mkspecs/features/dbuscommon.pri +++ b/mkspecs/features/dbuscommon.pri @@ -67,6 +67,7 @@ for(group, groups) { $${group}_source.name = DBUSXML2CPP $${dbus_TYPE} SOURCE ${QMAKE_FILE_IN} $${group}_source.variable_out = SOURCES $${group}_source.input = $$input_list + $${group}_source.depends = $$eval($${group}_header.output) # this actually belongs to the object file $${group}_moc.commands = $$moc_header.commands $${group}_moc.output = $$moc_header.output From 195cd51f7d1d853220c16d043f1dfabd852de98b Mon Sep 17 00:00:00 2001 From: Caroline Chao Date: Mon, 28 Oct 2013 09:21:33 +0100 Subject: [PATCH 097/494] Fix QSpinBox size calculation problem with empty stylesheets Task-number: QTBUG-34305 Change-Id: I3e89dc66446e9f5e9e1810be367830b9df98ab0b Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qstylesheetstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 417e092e118..ab98dfbdcfe 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -4821,7 +4821,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op QSize defaultUpSize = defaultSize(w, subRule.size(), spinbox->rect, PseudoElement_SpinBoxUpButton); sz += QSize(defaultUpSize.width(), 0); } - if (rule.hasBox() || !rule.hasNativeBorder()) + if (rule.hasBox() || rule.hasBorder() || !rule.hasNativeBorder()) sz = rule.boxSize(sz); return sz; } From a3d72efc650db6b0663e11e3448b77ba93a0a925 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 30 Oct 2013 14:03:19 +0100 Subject: [PATCH 098/494] Consider multi-monitor setups in QPlatformWindow::initialGeometry(). Task-number: QTBUG-34204 Change-Id: Id79efe33ece071ad94578b6ac0370b0f040d1c3c Reviewed-by: Andy Shaw Reviewed-by: Laszlo Agocs --- src/gui/kernel/qplatformwindow.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index 1f9183db44f..954d47f18c9 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -487,6 +487,27 @@ bool QPlatformWindow::isAlertState() const return false; } +// Return the effective screen for the initial geometry of a window. In a +// multimonitor-setup, try to find the right screen by checking the transient +// parent or the mouse cursor for parentless windows (cf QTBUG-34204, +// QDialog::adjustPosition()). +static inline const QScreen *effectiveScreen(const QWindow *window) +{ + if (!window) + return QGuiApplication::primaryScreen(); + const QScreen *screen = window->screen(); + if (!screen) + return QGuiApplication::primaryScreen(); + const QList siblings = screen->virtualSiblings(); + if (siblings.size() > 1) { + const QPoint referencePoint = window->transientParent() ? window->transientParent()->geometry().center() : QCursor::pos(); + foreach (const QScreen *sibling, siblings) + if (sibling->geometry().contains(referencePoint)) + return sibling; + } + return screen; +} + /*! Helper function to get initial geometry on windowing systems which do not do smart positioning and also do not provide a means of centering a @@ -511,8 +532,8 @@ QRect QPlatformWindow::initialGeometry(const QWindow *w, } if (w->isTopLevel() && qt_window_private(const_cast(w))->positionAutomatic && w->type() != Qt::Popup) { - if (const QPlatformScreen *platformScreen = QPlatformScreen::platformScreenForWindow(w)) { - const QRect availableGeometry = platformScreen->availableGeometry(); + if (const QScreen *screen = effectiveScreen(w)) { + const QRect availableGeometry = screen->availableGeometry(); // Center unless the geometry ( + unknown window frame) is too large for the screen). if (rect.height() < (availableGeometry.height() * 8) / 9 && rect.width() < (availableGeometry.width() * 8) / 9) { From a959beeeeca33b69ae51f4a030510df3fe4f13a5 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 17 Oct 2013 22:11:53 +0200 Subject: [PATCH 099/494] xcode generator: resolve QMAKE_INFO_PLIST from source dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If QMAKE_INFO_PLIST is set, check if the file it points to is located inside the project source dir rather than the build dir. Change-Id: I6fb176349dae8e841b5e2dfdb9f9cb87f51a1e76 Reviewed-by: Oswald Buddenhagen Reviewed-by: Tor Arne Vestbø --- qmake/generators/mac/pbuilder_pbx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 7a7d42f2971..99373a0b8a5 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1389,7 +1389,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) if ((project->first("TEMPLATE") == "app" && project->isActiveConfig("app_bundle")) || (project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") && project->isActiveConfig("lib_bundle"))) { - QString plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString()); + QString plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString(), Option::output_dir, input_dir); if (plist.isEmpty()) plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE"); if (exists(plist)) { From d2580054f9d63b1045790b5bd530f02f090dd60a Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 30 Oct 2013 07:00:10 -0700 Subject: [PATCH 100/494] Update the ICC spec on Linux to actually compile stuff I had the -fPIE option in my personalised "linux-icc-optimised" spec, so I never noticed it was missing in the standard one. I have no idea when -rpath-link is necessary. It isn't for me. Task-number: QTBUG-34425 Change-Id: I54b2fb8cda10b9197d81b5630b1d29b8c338d96a Reviewed-by: Oswald Buddenhagen --- mkspecs/linux-icc/qmake.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf index 7876ef1c347..ee5f1f0ea45 100644 --- a/mkspecs/linux-icc/qmake.conf +++ b/mkspecs/linux-icc/qmake.conf @@ -13,6 +13,7 @@ QMAKE_LEXFLAGS = QMAKE_YACC = yacc QMAKE_YACCFLAGS = -d QMAKE_CFLAGS = +QMAKE_CFLAGS_APP = -fPIE QMAKE_CFLAGS_DEPS = -M QMAKE_CFLAGS_WARN_ON = -w1 -Wall -Wcheck -wd1572,873,2259,2261 QMAKE_CFLAGS_WARN_OFF = -w @@ -33,6 +34,7 @@ QMAKE_CFLAGS_AVX2 += -xCORE-AVX2 QMAKE_CXX = icpc QMAKE_CXXFLAGS = $$QMAKE_CFLAGS +QMAKE_CXXFLAGS_APP = $$QMAKE_CFLAGS_APP QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF @@ -63,6 +65,7 @@ QMAKE_LFLAGS_SONAME = -Wl,-soname, QMAKE_LFLAGS_THREAD = QMAKE_LFLAGS_NOUNDEF = -Wl,-z,defs QMAKE_LFLAGS_RPATH = -Wl,-rpath, +QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link, QMAKE_LFLAGS_CXX11 = QMAKE_LIBS = From 769abe8d2f34fdd5c67f82cd104187c4ca377f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 29 Oct 2013 15:56:24 +0100 Subject: [PATCH 101/494] iOS: Fix logic for determining whether to exit the root event loop Instead of trying to hook into various places where we might be in a situation where the root event loop should exit, and then enabling the runloop-observer, we always keep the observer active, and then do the relevant checks whenever the run-loop exits. The reason for checking if the event loop is running is that iOS will enter and exit the root runloop as part of normal operation, eg due to flicking a scroll view and switching the runloop mode, so we need to ensure that we're actually supposed to exit the root event loop. Change-Id: I9b84b47ee45e0c9e2b1d2ebb5a432ea92700b324 Reviewed-by: Richard Moe Gustavsen --- .../platforms/ios/qioseventdispatcher.h | 2 - .../platforms/ios/qioseventdispatcher.mm | 38 ++++--------------- 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/src/plugins/platforms/ios/qioseventdispatcher.h b/src/plugins/platforms/ios/qioseventdispatcher.h index f2272ecd682..5caa7f5d2d7 100644 --- a/src/plugins/platforms/ios/qioseventdispatcher.h +++ b/src/plugins/platforms/ios/qioseventdispatcher.h @@ -54,11 +54,9 @@ public: explicit QIOSEventDispatcher(QObject *parent = 0); bool processEvents(QEventLoop::ProcessEventsFlags flags) Q_DECL_OVERRIDE; - void interrupt() Q_DECL_OVERRIDE; void handleRunLoopExit(CFRunLoopActivity activity); - void checkIfEventLoopShouldExit(); void interruptEventLoopExec(); private: diff --git a/src/plugins/platforms/ios/qioseventdispatcher.mm b/src/plugins/platforms/ios/qioseventdispatcher.mm index 3dd9c7ad9f3..51eb10d385a 100644 --- a/src/plugins/platforms/ios/qioseventdispatcher.mm +++ b/src/plugins/platforms/ios/qioseventdispatcher.mm @@ -446,6 +446,8 @@ bool __attribute__((returns_twice)) QIOSEventDispatcher::processEvents(QEventLoo if (!m_processEventCallsAfterExec && (flags & QEventLoop::EventLoopExec)) { ++m_processEventCallsAfterExec; + m_runLoopExitObserver.addToMode(kCFRunLoopCommonModes); + // We set a new jump point here that we can return to when the event loop // is asked to exit, so that we can return from QEventLoop::exec(). switch (setjmp(processEventExitJumpPoint)) { @@ -475,44 +477,18 @@ bool __attribute__((returns_twice)) QIOSEventDispatcher::processEvents(QEventLoo if (m_processEventCallsAfterExec) --m_processEventCallsAfterExec; - // If we're running with nested event loops and the application is quit, - // then the forwarded interrupt call will happen while our processEvent - // counter is still 2, and we won't detect that we're about to fall down - // to the root iOS run-loop. We do an extra check here to catch that case. - checkIfEventLoopShouldExit(); - return processedEvents; } -void QIOSEventDispatcher::interrupt() -{ - QEventDispatcherCoreFoundation::interrupt(); - - if (!rootLevelRunLoopIntegration()) - return; - - // If an interrupt happens as part of a non-nested event loop, that is, - // by processing an event or timer in the root iOS run-loop, we'll be - // able to detect it here. - checkIfEventLoopShouldExit(); -} - -void QIOSEventDispatcher::checkIfEventLoopShouldExit() -{ - if (m_processEventCallsAfterExec == 1) { - qEventDispatcherDebug() << "Hit root runloop level, watching for runloop exit"; - m_runLoopExitObserver.addToMode(kCFRunLoopCommonModes); - } -} - void QIOSEventDispatcher::handleRunLoopExit(CFRunLoopActivity activity) { Q_UNUSED(activity); Q_ASSERT(activity == kCFRunLoopExit); - m_runLoopExitObserver.removeFromMode(kCFRunLoopCommonModes); - - interruptEventLoopExec(); + if (m_processEventCallsAfterExec == 1 && !QThreadData::current()->eventLoops.top()->isRunning()) { + qEventDispatcherDebug() << "Root runloop level exited"; + interruptEventLoopExec(); + } } void QIOSEventDispatcher::interruptEventLoopExec() @@ -521,6 +497,8 @@ void QIOSEventDispatcher::interruptEventLoopExec() --m_processEventCallsAfterExec; + m_runLoopExitObserver.removeFromMode(kCFRunLoopCommonModes); + // We re-set applicationProcessEventsReturnPoint here so that future // calls to QEventLoop::exec() will end up back here after entering // processEvents, instead of back in didFinishLaunchingWithOptions. From 44e68b90266336d3d46279eddcbb2a4a775f0d2a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 30 Oct 2013 13:19:26 +0200 Subject: [PATCH 102/494] Windows: Do not use blend function for GL windows with alpha. Task-number: QTBUG-34376 Change-Id: I81a5ee6ff14e5472eb1f3846577d86b615be34e0 Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 1909e0313ba..d3d381ae285 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -305,7 +305,7 @@ bool QWindowsWindow::setWindowLayered(HWND hwnd, Qt::WindowFlags flags, bool has #endif // Q_OS_WINCE } -static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qreal level) +static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, bool openGL, qreal level) { #ifdef Q_OS_WINCE // WINCE does not support that feature and microsoft explicitly warns to use those calls Q_UNUSED(hwnd); @@ -314,8 +314,8 @@ static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qr Q_UNUSED(level); #else if (QWindowsWindow::setWindowLayered(hwnd, flags, hasAlpha, level)) { - if (hasAlpha && (flags & Qt::FramelessWindowHint)) { - // Windows with alpha: Use blend function to update. + if (hasAlpha && !openGL && (flags & Qt::FramelessWindowHint)) { + // Non-GL windows with alpha: Use blend function to update. BLENDFUNCTION blend = {AC_SRC_OVER, 0, (BYTE)(255.0 * level), AC_SRC_ALPHA}; QWindowsContext::user32dll.updateLayeredWindow(hwnd, NULL, NULL, NULL, NULL, NULL, 0, &blend, ULW_ALPHA); } else { @@ -661,7 +661,7 @@ void WindowCreationData::initialize(HWND hwnd, bool frameChange, qreal opacityLe EnableMenuItem(systemMenu, SC_CLOSE, MF_BYCOMMAND|MF_GRAYED); } - setWindowOpacity(hwnd, flags, hasAlpha, opacityLevel); + setWindowOpacity(hwnd, flags, hasAlpha, isGL, opacityLevel); } else { // child. SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, swpFlags); } @@ -1745,7 +1745,9 @@ void QWindowsWindow::setOpacity(qreal level) if (m_opacity != level) { m_opacity = level; if (m_data.hwnd) - setWindowOpacity(m_data.hwnd, m_data.flags, window()->format().hasAlpha(), level); + setWindowOpacity(m_data.hwnd, m_data.flags, + window()->format().hasAlpha(), testFlag(OpenGLSurface), + level); } } From fe41442575b64956aec5c67f909f1eab7da1015b Mon Sep 17 00:00:00 2001 From: Ian Dean Date: Tue, 15 Oct 2013 12:32:21 +0100 Subject: [PATCH 103/494] iOS: Add standard paths implementation for iOS A standard paths implementation for iOS. The APIs used on iOS require that the source file be "Objective-C++" (with a .MM extension), as there are no APIs available in C++ for this. The implementation complies with the latest documentation on standard paths. Change-Id: I349d3c5d4ddb6fb1297a45dc9ae26b56ac528abb Reviewed-by: Thiago Macieira Reviewed-by: David Faure --- src/corelib/io/io.pri | 2 + src/corelib/io/qstandardpaths_ios.mm | 135 +++++++++++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 src/corelib/io/qstandardpaths_ios.mm diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri index eab3981f7af..f06bf61b095 100644 --- a/src/corelib/io/io.pri +++ b/src/corelib/io/io.pri @@ -135,6 +135,8 @@ win32 { mac { macx { SOURCES += io/qstandardpaths_mac.cpp + } else:ios { + OBJECTIVE_SOURCES += io/qstandardpaths_ios.mm } else { SOURCES += io/qstandardpaths_unix.cpp } diff --git a/src/corelib/io/qstandardpaths_ios.mm b/src/corelib/io/qstandardpaths_ios.mm new file mode 100644 index 00000000000..332400eaf2e --- /dev/null +++ b/src/corelib/io/qstandardpaths_ios.mm @@ -0,0 +1,135 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#import + +#include "qstandardpaths.h" + +#ifndef QT_NO_STANDARDPATHS + +QT_BEGIN_NAMESPACE + +static QString pathForDirectory(NSSearchPathDirectory directory) +{ + return QString::fromNSString( + [NSSearchPathForDirectoriesInDomains(directory, NSUserDomainMask, YES) lastObject]); +} + +static QString bundlePath() +{ + return QString::fromNSString([[NSBundle mainBundle] bundlePath]); +} + +QString QStandardPaths::writableLocation(StandardLocation type) +{ + QString location; + + switch (type) { + case DesktopLocation: + location = pathForDirectory(NSDesktopDirectory); + break; + case DocumentsLocation: + location = pathForDirectory(NSDocumentDirectory); + break; + case FontsLocation: + location = bundlePath() + QLatin1String("/.fonts"); + break; + case ApplicationsLocation: + location = pathForDirectory(NSApplicationDirectory); + break; + case MusicLocation: + location = pathForDirectory(NSMusicDirectory); + break; + case MoviesLocation: + location = pathForDirectory(NSMoviesDirectory); + break; + case PicturesLocation: + location = pathForDirectory(NSPicturesDirectory); + break; + case TempLocation: + location = QString::fromNSString(NSTemporaryDirectory()); + break; + case HomeLocation: + location = bundlePath(); + break; + case DataLocation: + case GenericDataLocation: + location = pathForDirectory(NSDocumentDirectory); + break; + case CacheLocation: + case GenericCacheLocation: + location = pathForDirectory(NSCachesDirectory); + break; + case ConfigLocation: + location = pathForDirectory(NSDocumentDirectory); + break; + case DownloadLocation: + location = pathForDirectory(NSDownloadsDirectory); + break; + default: + break; + } + + switch (type) { + case RuntimeLocation: + break; + default: + // All other types must return something, so use the document directory + // as a reasonable fall-back (which will always exist). + if (location.isEmpty()) + location = pathForDirectory(NSDocumentDirectory); + break; + } + + return location; +} + +QStringList QStandardPaths::standardLocations(StandardLocation type) +{ + QStringList dirs; + const QString localDir = writableLocation(type); + dirs.prepend(localDir); + return dirs; +} + +QT_END_NAMESPACE + +#endif // QT_NO_STANDARDPATHS From 54c8c7a96a9303e7a56ca3cef8dcb1e91f23f2ac Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 25 Oct 2013 20:08:35 +0200 Subject: [PATCH 104/494] duplicate less work while handling -qconfig Change-Id: I8ba6b866f98c9fe7609af71c168023097e32828c Reviewed-by: Tasuku Suzuki Reviewed-by: Joerg Bornemann Reviewed-by: Thiago Macieira --- configure | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/configure b/configure index d74d811546f..f8dcebe9f67 100755 --- a/configure +++ b/configure @@ -2389,6 +2389,7 @@ while [ "$#" -gt 0 ]; do done # update QT_CONFIG to show our current predefined configuration +CFG_QCONFIG_PATH=$relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h case "$CFG_QCONFIG" in minimal|small|medium|large|full) # these are a sequence of increasing functionality @@ -2396,15 +2397,19 @@ minimal|small|medium|large|full) QT_CONFIG="$QT_CONFIG $c-config" [ "$CFG_QCONFIG" = $c ] && break done + [ "$CFG_QCONFIG" = full ] && CFG_QCONFIG_PATH= ;; *) # not known to be sufficient for anything - if [ '!' -f "$relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h" ] && [ '!' -f `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"` ]; then - echo >&2 "Error: configuration file not found:" - echo >&2 " $relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h" - echo >&2 " or" - echo >&2 " `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"`" - OPT_HELP=yes + if [ ! -f "$CFG_QCONFIG_PATH" ]; then + CFG_QCONFIG_PATH=`"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"` + if [ ! -f "$CFG_QCONFIG_PATH" ]; then + echo >&2 "Error: configuration file not found:" + echo >&2 " $relpath/src/corelib/global/qconfig-${CFG_QCONFIG}.h" + echo >&2 " or" + echo >&2 " $CFG_QCONFIG_PATH" + OPT_HELP=yes + fi fi esac @@ -6319,11 +6324,7 @@ full) *) tmpconfig="$outpath/src/corelib/global/qconfig.h.new" echo "#ifndef QT_BOOTSTRAPPED" >"$tmpconfig" - if [ -f "$relpath/src/corelib/global/qconfig-$CFG_QCONFIG.h" ]; then - cat "$relpath/src/corelib/global/qconfig-$CFG_QCONFIG.h" >>"$tmpconfig" - elif [ -f `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"` ]; then - cat `"$relpath/config.tests/unix/makeabs" "${CFG_QCONFIG}"` >>"$tmpconfig" - fi + cat "$CFG_QCONFIG_PATH" >>"$tmpconfig" echo "#endif" >>"$tmpconfig" ;; esac From bf0c9c3becbe1f4e42a836f8564b62c18529ef55 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 25 Oct 2013 20:31:44 +0200 Subject: [PATCH 105/494] turn makeabs into a proper cleanPath() normalize away all ".." and ".". fewer surprises that way. Change-Id: Iaa56c634aed5c8351966eaea7a73b85cb8235ead Reviewed-by: Joerg Bornemann Reviewed-by: Thiago Macieira --- config.tests/unix/makeabs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config.tests/unix/makeabs b/config.tests/unix/makeabs index 4df26f769f1..d2f65d19e9c 100755 --- a/config.tests/unix/makeabs +++ b/config.tests/unix/makeabs @@ -15,13 +15,13 @@ elif [ "$OSTYPE" = "msys" -a -z "${FILE##[a-zA-Z]:[/\\]*}" ]; then true else RES="$PWD/$FILE" - test -d "$RES" && RES="$RES/" - RES=`echo "$RES" | sed "s,/\(\./\)*,/,g"` - -# note: this will only strip 1 /path/../ from RES, i.e. given /a/b/c/../../../, it returns /a/b/../../ - RES=`echo "$RES" | sed "s,\(/[^/]*/\)\.\./,/,g"` - - RES=`echo "$RES" | sed "s,//,/,g" | sed "s,/$,,"` fi +RES=$RES/ +while true; do + nres=`echo "$RES" | sed "s,/[^/][^/]*/\.\./,/,g; s,/\./,/,g"` + test x"$nres" = x"$RES" && break + RES=$nres +done +RES=`echo "$RES" | sed "s,//,/,g; s,/$,,"` echo $RES #return From 6a508ee5b21dca0ae4e49ab5f5604345106ed0a9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 25 Oct 2013 17:51:28 +0200 Subject: [PATCH 106/494] bring the windows configure -qconfig handling in line with the unix one on the way, this significantly simplifies the code. Change-Id: I24f0a517e62cc4b913ffef5cab096e721653c013 Reviewed-by: Joerg Bornemann Reviewed-by: Thiago Macieira --- tools/configure/configureapp.cpp | 69 ++++++++------------------------ tools/configure/configureapp.h | 1 - 2 files changed, 16 insertions(+), 54 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 0fd35dd2fad..5d4ce84941a 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1432,20 +1432,7 @@ void Configure::parseCmdLine() void Configure::validateArgs() { // Validate the specified config - - // Get all possible configurations from the file system. - QDir dir; - QStringList filters; - filters << "qconfig-*.h"; - dir.setNameFilters(filters); - dir.setPath(sourcePath + "/src/corelib/global/"); - - QStringList stringList = dir.entryList(); - - QStringList::Iterator it; - for (it = stringList.begin(); it != stringList.end(); ++it) - allConfigs << it->remove("qconfig-").remove(".h"); - allConfigs << "full"; + QString cfgpath = sourcePath + "/src/corelib/global/qconfig-" + dictionary["QCONFIG"] + ".h"; // Try internal configurations first. QStringList possible_configs = QStringList() @@ -1457,23 +1444,22 @@ void Configure::validateArgs() int index = possible_configs.indexOf(dictionary["QCONFIG"]); if (index >= 0) { for (int c = 0; c <= index; c++) { - qmakeConfig += possible_configs[c] + "-config"; + qtConfig += possible_configs[c] + "-config"; } + if (dictionary["QCONFIG"] != "full") + dictionary["QCONFIG_PATH"] = cfgpath; return; } - // If the internal configurations failed, try others. - QStringList::Iterator config; - for (config = allConfigs.begin(); config != allConfigs.end(); ++config) { - if ((*config) == dictionary[ "QCONFIG" ]) - break; + if (!QFileInfo::exists(cfgpath)) { + cfgpath = QFileInfo(dictionary["QCONFIG"]).absoluteFilePath(); + if (!QFileInfo::exists(cfgpath)) { + dictionary[ "HELP" ] = "yes"; + cout << "No such configuration \"" << qPrintable(dictionary["QCONFIG"]) << "\"" << endl ; + return; + } } - if (config == allConfigs.end()) { - dictionary[ "HELP" ] = "yes"; - cout << "No such configuration \"" << qPrintable(dictionary[ "QCONFIG" ]) << "\"" << endl ; - } - else - qmakeConfig += (*config) + "-config"; + dictionary["QCONFIG_PATH"] = cfgpath; } // Output helper functions --------------------------------[ Start ]- @@ -1784,6 +1770,9 @@ bool Configure::displayHelp() desc( "-sysroot ", "Sets as the target compiler's and qmake's sysroot and also sets pkg-config paths."); desc( "-no-gcc-sysroot", "When using -sysroot, it disables the passing of --sysroot to the compiler.\n"); + desc( "-qconfig ", "Use src/corelib/global/qconfig-.h rather than the\n" + "default 'full'.\n"); + desc("NIS", "no", "-no-nis", "Do not compile NIS support."); desc("NIS", "yes", "-nis", "Compile NIS support.\n"); @@ -1935,13 +1924,6 @@ bool Configure::displayHelp() desc("MSVC_MP", "no", "-no-mp", "Do not use multiple processors for compiling with MSVC"); desc("MSVC_MP", "yes", "-mp", "Use multiple processors for compiling with MSVC (-MP).\n"); -/* We do not support -qconfig on Windows yet - - desc( "-qconfig ", "Use src/tools/qconfig-local.h rather than the default.\nPossible values for local:"); - for (int i=0; i", "Run configure with the parameters from file configure_.cache."); desc( "-saveconfig ", "Run configure and save the parameters in file configure_.cache."); desc( "-redo", "Run configure with the same parameters as last time.\n"); @@ -2740,23 +2722,6 @@ void Configure::generateOutputVars() if (dictionary[ "SYSTEM_PROXIES" ] == "yes") qtConfig += "system-proxies"; - // Add config levels -------------------------------------------- - QStringList possible_configs = QStringList() - << "minimal" - << "small" - << "medium" - << "large" - << "full"; - - QString set_config = dictionary["QCONFIG"]; - if (possible_configs.contains(set_config)) { - foreach (const QString &cfg, possible_configs) { - qtConfig += (cfg + "-config"); - if (cfg == set_config) - break; - } - } - if (dictionary.contains("XQMAKESPEC") && (dictionary["QMAKESPEC"] != dictionary["XQMAKESPEC"])) { qmakeConfig += "cross_compile"; dictionary["CROSS_COMPILE"] = "yes"; @@ -3280,10 +3245,8 @@ void Configure::generateConfigfiles() if (dictionary[ "QCONFIG" ] == "full") { tmpStream << "/* Everything */" << endl; } else { - QString configName("qconfig-" + dictionary[ "QCONFIG" ] + ".h"); - tmpStream << "/* Copied from " << configName << "*/" << endl; tmpStream << "#ifndef QT_BOOTSTRAPPED" << endl; - QFile inFile(sourcePath + "/src/corelib/global/" + configName); + QFile inFile(dictionary["QCONFIG_PATH"]); if (inFile.open(QFile::ReadOnly)) { tmpStream << QTextStream(&inFile).readAll(); inFile.close(); diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 8a22cea6ec8..bf0f61639f3 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -113,7 +113,6 @@ private: QStringList skipModules; QStringList licensedModules; QStringList allSqlDrivers; - QStringList allConfigs; QStringList disabledModules; QStringList enabledModules; QStringList modules; From fe220f3b5b6dcc5b98ce35684e9408c0fc669ddd Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Tue, 29 Oct 2013 22:04:19 +0100 Subject: [PATCH 107/494] Don't use NO_DEFAULT_PATH on mac when finding GL headers and libraries. The paths may be relative to a sysroot or osx SDK. The existing logic assumed that we always get fully resolved absolute paths from qmake. However, qmake populates and uses the -isysroot option separately. Task-number: QTBUG-32308 Change-Id: Ia23600cdc047d0844bfec32dd4feae3a2b5c95c0 Reviewed-by: James Turner Reviewed-by: Stephen Kelly --- src/gui/Qt5GuiConfigExtras.cmake.in | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in index f2f75d0ea07..b79845b07c0 100644 --- a/src/gui/Qt5GuiConfigExtras.cmake.in +++ b/src/gui/Qt5GuiConfigExtras.cmake.in @@ -57,7 +57,10 @@ set(Qt5Gui_OPENGL_LIBRARIES Qt5::Gui_GLESv2) set(_GL_INCDIRS $$CMAKE_GL_INCDIRS) find_path(_qt5gui_OPENGL_INCLUDE_DIR $$CMAKE_GL_HEADER_NAME PATHS ${_GL_INCDIRS} - NO_DEFAULT_PATH) +!!IF !mac + NO_DEFAULT_PATH +!!ENDIF +) if (NOT _qt5gui_OPENGL_INCLUDE_DIR) message(FATAL_ERROR \"Failed to find \\\"$$CMAKE_GL_HEADER_NAME\\\" in \\\"${_GL_INCDIRS}\\\".\") endif() @@ -80,7 +83,10 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) if (NOT TARGET Qt5::Gui_${_cmake_lib_name}) find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY ${_lib} !!IF !isEmpty(CROSS_COMPILE) - PATHS \"${LibDir}\" NO_DEFAULT_PATH + PATHS \"${LibDir}\" +!!IF !mac + NO_DEFAULT_PATH +!!ENDIF !!ENDIF ) !!IF mac @@ -106,7 +112,11 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs) unset(Qt5Gui_${_cmake_lib_name}_LIBRARY CACHE) find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG ${_lib}d - PATHS \"${LibDir}\" NO_DEFAULT_PATH) + PATHS \"${LibDir}\" +!!IF !mac + NO_DEFAULT_PATH +!!ENDIF + ) if (Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG) set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) _qt5_Gui_check_file_exists(\"${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}\") From e00a961732ad028a1ead1eae1d8aecf1492d3008 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 30 Oct 2013 15:18:25 +0100 Subject: [PATCH 108/494] Clean up QPlatformPrinterSupport via post routine. Change-Id: I5aff587f0186f15c9fa65d236e5ebe9a7901dd86 Reviewed-by: Lars Knoll --- .../kernel/qplatformprintplugin.cpp | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/printsupport/kernel/qplatformprintplugin.cpp b/src/printsupport/kernel/qplatformprintplugin.cpp index ce6d7a0f7ee..e38b481a0e2 100644 --- a/src/printsupport/kernel/qplatformprintplugin.cpp +++ b/src/printsupport/kernel/qplatformprintplugin.cpp @@ -40,7 +40,10 @@ ****************************************************************************/ #include "qplatformprintplugin.h" +#include "qplatformprintersupport.h" +#include "qprinterinfo.h" #include "private/qfactoryloader_p.h" +#include QT_BEGIN_NAMESPACE @@ -58,6 +61,14 @@ QPlatformPrinterSupportPlugin::~QPlatformPrinterSupportPlugin() { } +static QPlatformPrinterSupport *printerSupport = 0; + +static void cleanupPrinterSupport() +{ + delete printerSupport; + printerSupport = 0; +} + /*! \internal @@ -68,13 +79,14 @@ QPlatformPrinterSupportPlugin::~QPlatformPrinterSupportPlugin() */ QPlatformPrinterSupport *QPlatformPrinterSupportPlugin::get() { - static QPlatformPrinterSupport *singleton = 0; - if (!singleton) { + if (!printerSupport) { const QMultiMap keyMap = loader()->keyMap(); if (!keyMap.isEmpty()) - singleton = qLoadPlugin(loader(), keyMap.constBegin().value()); + printerSupport = qLoadPlugin(loader(), keyMap.constBegin().value()); + if (printerSupport) + qAddPostRoutine(cleanupPrinterSupport); } - return singleton; + return printerSupport; } QT_END_NAMESPACE From a316bdadc0200cf1a0e60562364f84c0f49d1488 Mon Sep 17 00:00:00 2001 From: Kari P Date: Thu, 24 Oct 2013 08:56:30 +0300 Subject: [PATCH 109/494] Mac: Modify Qt::SizeAllCursor to look like arrows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Mac, Qt::SizeAllCursor showed a spreadsheet cell selection cursor. It has been changed to look like it looks in the Qt Documentation. Task-number: QTBUG-27577 Change-Id: I2d50ab0d813137366b56cb30b8784ecf70392d4e Reviewed-by: Morten Johan Sørvig --- .../platforms/cocoa/images/sizeallcursor.png | Bin 0 -> 703 bytes src/plugins/platforms/cocoa/qcocoacursor.mm | 4 ++-- src/plugins/platforms/cocoa/qcocoaresources.qrc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 src/plugins/platforms/cocoa/images/sizeallcursor.png diff --git a/src/plugins/platforms/cocoa/images/sizeallcursor.png b/src/plugins/platforms/cocoa/images/sizeallcursor.png new file mode 100644 index 0000000000000000000000000000000000000000..bb5381ba32929107028ad25426227d12b95bd18d GIT binary patch literal 703 zcmV;w0zmzVP)4Tx04UFmlFv&UK@`Wo8}Y}XRiSZD7Um=#RF)_h&_gtbTB{IDDpp(QW_FE% zWL;-R+t5q?iJr8#q8`NdTOQ{}U%2H{d`_^;+Y;pf#~W;#9f3Nc9`k*}K&&^fu*hVCaBy+v?if zd*D+)VE(CVU9`uJPT-4G*J@@oAH)0+%=afE$#@`u#(!a0dki%10_P$O&pw3V`A6z~ z3Vd7Q%VOnnMuxEu+!gC{>KH~Wukfx}FBJvd3k?P!C?0zQQ zx6%31i+)8E3k#Bs(2I20Q;+xcu!LnLZ_n3vuWX{1-owt=^TfdS*J1Vgx(kCuk_32J z*#H0l00v@9M??Vs0RI60puMM)00009a7bBm000&x000&x0ZCFM@Bjb+eMv+?R5;6( zlR*-|AP55q|NnD(Xq`bPLCR6xfB`@%&_Rg$J`HXYeSKvMpB5+vI;j$)ZeW!T^hX}V!etnk@|Dq>Bnu*z%)Nx^Os lm8gWfUD!k%Y_t7Y=Lei~Pz?KLieLZ$002ovPDHLkV1g+`M(qFq literal 0 HcmV?d00001 diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm index e5b41e7a88b..d734c36d6f5 100644 --- a/src/plugins/platforms/cocoa/qcocoacursor.mm +++ b/src/plugins/platforms/cocoa/qcocoacursor.mm @@ -218,8 +218,8 @@ NSCursor *QCocoaCursor::createCursorData(QCursor *cursor) return createCursorFromPixmap(pixmap, hotspot); break; } case Qt::SizeAllCursor: { - QPixmap pixmap = QPixmap(QLatin1String(":/qt-project.org/mac/cursors/images/pluscursor.png")); - return createCursorFromPixmap(pixmap, hotspot); + QPixmap pixmap = QPixmap(QLatin1String(":/qt-project.org/mac/cursors/images/sizeallcursor.png")); + return createCursorFromPixmap(pixmap, QPoint(8, 8)); break; } case Qt::BusyCursor: { QPixmap pixmap = QPixmap(QLatin1String(":/qt-project.org/mac/cursors/images/waitcursor.png")); diff --git a/src/plugins/platforms/cocoa/qcocoaresources.qrc b/src/plugins/platforms/cocoa/qcocoaresources.qrc index 392300bb030..9e0640db7db 100644 --- a/src/plugins/platforms/cocoa/qcocoaresources.qrc +++ b/src/plugins/platforms/cocoa/qcocoaresources.qrc @@ -4,7 +4,7 @@ images/forbiddencursor.png images/spincursor.png images/waitcursor.png -images/pluscursor.png +images/sizeallcursor.png images/leopard-unified-toolbar-on.png From 9b8c4b3dea52a7d1c5386de8cc3ae46a45435c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 29 Oct 2013 14:14:03 +0100 Subject: [PATCH 110/494] iOS: Be more specific in where we look for object files to rename main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building under Xcode we can limit the object files search to the current SDK and debug/release configuration. Change-Id: Ic405f13f46a594e3ed20d82ca6b84e7e67edebfc Reviewed-by: Oswald Buddenhagen Reviewed-by: Morten Johan Sørvig --- mkspecs/macx-ios-clang/features/qt.prf | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mkspecs/macx-ios-clang/features/qt.prf b/mkspecs/macx-ios-clang/features/qt.prf index 2897c628195..9202a70a5a5 100644 --- a/mkspecs/macx-ios-clang/features/qt.prf +++ b/mkspecs/macx-ios-clang/features/qt.prf @@ -31,14 +31,19 @@ equals(TEMPLATE, app):contains(QT, gui(-private)?) { # able to add symbolic breakpoints for 'main', not caring that the symbol is actually # called 'qt_main' now. - isEmpty(OBJECTS_DIR): \ - OBJECTS_DIR = . + macx-xcode { + objects_dir = "${OBJECT_FILE_DIR}-${CURRENT_VARIANT}/${CURRENT_ARCH}" + } else { + objects_dir = $$OBJECTS_DIR + isEmpty(objects_dir): \ + objects_dir = . + } !isEmpty(QMAKE_PRE_LINK): \ QMAKE_PRE_LINK += ";" QMAKE_PRE_LINK += \ - "for f in $(find $${OBJECTS_DIR} -name '*.o'); do" \ + "for f in $(find $${objects_dir} -name '*.o'); do" \ "(nm $f | grep -q 'T _main' && cp $f $f.original" \ "&& ld -r -alias _main _qt_main -unexported_symbol _main $f.original -o $f)" \ "|| true" \ From 8c3f2f5f6903f6b16778d55ca49812bcfde174a1 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 31 Oct 2013 10:26:44 +0100 Subject: [PATCH 111/494] Mention androiddeployqt in changes-5.2.0 The new way deployment is done can be confusing to users of Qt 5.1 and Necessitas, so we need to mention that it has changed and point them to the documentation. Change-Id: I8e9890699f57d6000370c384c52fcb093a917bef Reviewed-by: Sergio Ahumada --- dist/changes-5.2.0 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dist/changes-5.2.0 b/dist/changes-5.2.0 index a3a7db81908..287cda4821f 100644 --- a/dist/changes-5.2.0 +++ b/dist/changes-5.2.0 @@ -103,3 +103,15 @@ QtNetwork - Support for preconnecting to servers before making HTTP and HTTPS connections. This allows for much reduced latency when the hosts to be connected to are known. + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +Qt for Android +-------------- + - Project structure and deployment has changed with the introduction of + androiddeployqt. Source and build files are no longer mixed, and the + build files for the APK package should not be touched. Customizing + the build files is possible. Read the documentation for androiddeployqt + for more information. From 22aea3f42b17a3675f95f39c6d9d33f4075f8f8e Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Thu, 31 Oct 2013 04:31:05 +0000 Subject: [PATCH 112/494] Include unistd.h in the unix implementation source of QLockFile This is necessary to avoid hidden dependencies for int gethostname(char *name, size_t namelen); This was revelead while backporting the class to Qt 4 for QtSerialPort. Change-Id: I1c477d295eeae90b3136fc6aae5d45982d5b1d73 Reviewed-by: Thiago Macieira --- src/corelib/io/qlockfile_unix.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp index d1dbb51e760..d1ef9c17704 100644 --- a/src/corelib/io/qlockfile_unix.cpp +++ b/src/corelib/io/qlockfile_unix.cpp @@ -54,6 +54,7 @@ #include // flock #include // kill #include // kill +#include // gethostname QT_BEGIN_NAMESPACE From f9a8cf99bc0b9afda44c0b3e7e8af141003bbd9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 30 Oct 2013 15:21:04 +0100 Subject: [PATCH 113/494] qmake: Pick up default bundle prefix from Xcode preferences MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit But still fall back to 'com.yourcompany', just like Xcode does for the initial launch. Change-Id: I89afadefafc254a0014aca197741d42a0199943e Reviewed-by: Morten Johan Sørvig Reviewed-by: Oswald Buddenhagen --- mkspecs/features/mac/default_pre.prf | 9 +++++++++ mkspecs/macx-clang-32/Info.plist.app | 2 +- mkspecs/macx-clang/Info.plist.app | 2 +- mkspecs/macx-g++-32/Info.plist.app | 2 +- mkspecs/macx-g++/Info.plist.app | 2 +- mkspecs/macx-g++40/Info.plist.app | 2 +- mkspecs/macx-g++42/Info.plist.app | 2 +- mkspecs/macx-icc/Info.plist.app | 2 +- mkspecs/macx-ios-clang/Info.plist.app | 2 +- mkspecs/macx-llvm/Info.plist.app | 2 +- qmake/generators/mac/pbuilder_pbx.cpp | 5 ++++- 11 files changed, 22 insertions(+), 10 deletions(-) diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf index 98caf54f8ab..c0314039305 100644 --- a/mkspecs/features/mac/default_pre.prf +++ b/mkspecs/features/mac/default_pre.prf @@ -24,6 +24,15 @@ isEmpty(QMAKE_XCODE_VERSION) { unset(xcode_version) } +isEmpty(QMAKE_TARGET_BUNDLE_PREFIX) { + QMAKE_XCODE_PREFERENCES_FILE = $$(HOME)/Library/Preferences/com.apple.dt.Xcode.plist + exists($$QMAKE_XCODE_PREFERENCES_FILE): \ + QMAKE_TARGET_BUNDLE_PREFIX = $$system("/usr/libexec/PlistBuddy -c 'print IDETemplateOptions:bundleIdentifierPrefix' $$QMAKE_XCODE_PREFERENCES_FILE 2>/dev/null") + + !isEmpty(_QMAKE_CACHE_):!isEmpty(QMAKE_TARGET_BUNDLE_PREFIX): \ + cache(QMAKE_TARGET_BUNDLE_PREFIX) +} + # This variable is used by the xcode_dynamic_library_suffix # feature, which allows Xcode to choose the Qt libraries to link to # at build time, depending on the current Xcode SDK and configuration. diff --git a/mkspecs/macx-clang-32/Info.plist.app b/mkspecs/macx-clang-32/Info.plist.app index 187a8e0aa42..8e44bd7f605 100644 --- a/mkspecs/macx-clang-32/Info.plist.app +++ b/mkspecs/macx-clang-32/Info.plist.app @@ -15,7 +15,7 @@ CFBundleExecutable @EXECUTABLE@ CFBundleIdentifier - com.yourcompany.@EXECUTABLE@ + @BUNDLEIDENTIFIER@ NOTE This file was generated by Qt/QMake. diff --git a/mkspecs/macx-clang/Info.plist.app b/mkspecs/macx-clang/Info.plist.app index 187a8e0aa42..8e44bd7f605 100644 --- a/mkspecs/macx-clang/Info.plist.app +++ b/mkspecs/macx-clang/Info.plist.app @@ -15,7 +15,7 @@ CFBundleExecutable @EXECUTABLE@ CFBundleIdentifier - com.yourcompany.@EXECUTABLE@ + @BUNDLEIDENTIFIER@ NOTE This file was generated by Qt/QMake. diff --git a/mkspecs/macx-g++-32/Info.plist.app b/mkspecs/macx-g++-32/Info.plist.app index 187a8e0aa42..8e44bd7f605 100644 --- a/mkspecs/macx-g++-32/Info.plist.app +++ b/mkspecs/macx-g++-32/Info.plist.app @@ -15,7 +15,7 @@ CFBundleExecutable @EXECUTABLE@ CFBundleIdentifier - com.yourcompany.@EXECUTABLE@ + @BUNDLEIDENTIFIER@ NOTE This file was generated by Qt/QMake. diff --git a/mkspecs/macx-g++/Info.plist.app b/mkspecs/macx-g++/Info.plist.app index 187a8e0aa42..8e44bd7f605 100644 --- a/mkspecs/macx-g++/Info.plist.app +++ b/mkspecs/macx-g++/Info.plist.app @@ -15,7 +15,7 @@ CFBundleExecutable @EXECUTABLE@ CFBundleIdentifier - com.yourcompany.@EXECUTABLE@ + @BUNDLEIDENTIFIER@ NOTE This file was generated by Qt/QMake. diff --git a/mkspecs/macx-g++40/Info.plist.app b/mkspecs/macx-g++40/Info.plist.app index 187a8e0aa42..8e44bd7f605 100644 --- a/mkspecs/macx-g++40/Info.plist.app +++ b/mkspecs/macx-g++40/Info.plist.app @@ -15,7 +15,7 @@ CFBundleExecutable @EXECUTABLE@ CFBundleIdentifier - com.yourcompany.@EXECUTABLE@ + @BUNDLEIDENTIFIER@ NOTE This file was generated by Qt/QMake. diff --git a/mkspecs/macx-g++42/Info.plist.app b/mkspecs/macx-g++42/Info.plist.app index 187a8e0aa42..8e44bd7f605 100644 --- a/mkspecs/macx-g++42/Info.plist.app +++ b/mkspecs/macx-g++42/Info.plist.app @@ -15,7 +15,7 @@ CFBundleExecutable @EXECUTABLE@ CFBundleIdentifier - com.yourcompany.@EXECUTABLE@ + @BUNDLEIDENTIFIER@ NOTE This file was generated by Qt/QMake. diff --git a/mkspecs/macx-icc/Info.plist.app b/mkspecs/macx-icc/Info.plist.app index 187a8e0aa42..8e44bd7f605 100644 --- a/mkspecs/macx-icc/Info.plist.app +++ b/mkspecs/macx-icc/Info.plist.app @@ -15,7 +15,7 @@ CFBundleExecutable @EXECUTABLE@ CFBundleIdentifier - com.yourcompany.@EXECUTABLE@ + @BUNDLEIDENTIFIER@ NOTE This file was generated by Qt/QMake. diff --git a/mkspecs/macx-ios-clang/Info.plist.app b/mkspecs/macx-ios-clang/Info.plist.app index 91f4b3d07e2..5a0a631d7f3 100755 --- a/mkspecs/macx-ios-clang/Info.plist.app +++ b/mkspecs/macx-ios-clang/Info.plist.app @@ -13,7 +13,7 @@ CFBundleExecutable @EXECUTABLE@ CFBundleIdentifier - com.yourcompany.@BUNDLEIDENTIFIER@ + @BUNDLEIDENTIFIER@ CFBundleDisplayName ${PRODUCT_NAME} CFBundleName diff --git a/mkspecs/macx-llvm/Info.plist.app b/mkspecs/macx-llvm/Info.plist.app index 187a8e0aa42..8e44bd7f605 100644 --- a/mkspecs/macx-llvm/Info.plist.app +++ b/mkspecs/macx-llvm/Info.plist.app @@ -15,7 +15,7 @@ CFBundleExecutable @EXECUTABLE@ CFBundleIdentifier - com.yourcompany.@EXECUTABLE@ + @BUNDLEIDENTIFIER@ NOTE This file was generated by Qt/QMake. diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 99373a0b8a5..307b3d27bab 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1404,7 +1404,10 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) } else { plist_in_text = plist_in_text.replace("@LIBRARY@", project->first("QMAKE_ORIG_TARGET").toQString()); } - plist_in_text = plist_in_text.replace("@BUNDLEIDENTIFIER@", QLatin1String("${PRODUCT_NAME:rfc1034identifier}")); + QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString(); + if (bundlePrefix.isEmpty()) + bundlePrefix = "com.yourcompany"; + plist_in_text = plist_in_text.replace("@BUNDLEIDENTIFIER@", bundlePrefix + "." + QLatin1String("${PRODUCT_NAME:rfc1034identifier}")); if (!project->values("VERSION").isEmpty()) { plist_in_text = plist_in_text.replace("@SHORT_VERSION@", project->first("VER_MAJ") + "." + project->first("VER_MIN")); From e8f2c4d2cd5432e0570f70a6f9379f2eaa43170c Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 23 Oct 2013 13:36:15 +0200 Subject: [PATCH 114/494] QFileDialog: document the consequences of being "widgetless" After 37ca2224eca671200a2710f57f970d2993e62aa5 it's an exposed behavior change that the widgets and related paraphernalia don't exist. Task-number: QTBUG-34100 Change-Id: Ie0ebcb8c5c5668b6c12c5447f25bfbfd893dec6c Reviewed-by: Jerome Pasion --- dist/changes-5.2.0 | 5 +++++ src/widgets/dialogs/qfiledialog.cpp | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/dist/changes-5.2.0 b/dist/changes-5.2.0 index 287cda4821f..e055e27a0eb 100644 --- a/dist/changes-5.2.0 +++ b/dist/changes-5.2.0 @@ -35,6 +35,11 @@ QtWidgets - QFileDialog::setDefaultSuffix() removes leading dot characters. +- [QTBUG-34132] QFileDialog does not instantiate widgets if a native dialog + will be used instead. Therefore some accessors which previously returned + unused objects will now return null. As before, you can set the + DontUseNativeDialog option to ensure that widgets will be created and used instead. + - QSizePolicy got a retainSizeWhenHidden attribute. - [QTBUG-31602] QSpinBox size calculation will now be fixed when stylesheets are diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 383e3ab3f4a..22d467661e4 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -184,6 +184,13 @@ Q_WIDGETS_EXPORT _qt_filedialog_save_file_url_hook qt_filedialog_save_file_url_h The \l{dialogs/standarddialogs}{Standard Dialogs} example shows how to use QFileDialog as well as other built-in Qt dialogs. + By default, a platform-native file dialog will be used if the platform has + one. In that case, the widgets which would otherwise be used to construct the + dialog will not be instantiated, so related accessors such as layout() and + itemDelegate() will return null. You can set the \l DontUseNativeDialog option to + ensure that the widget-based implementation will be used instead of the + native dialog. + \sa QDir, QFileInfo, QFile, QColorDialog, QFontDialog, {Standard Dialogs Example}, {Application Example} */ @@ -243,7 +250,8 @@ Q_WIDGETS_EXPORT _qt_filedialog_save_file_url_hook qt_filedialog_save_file_url_h \value DontUseNativeDialog Don't use the native file dialog. By default, the native file dialog is used unless you use a subclass - of QFileDialog that contains the Q_OBJECT macro. + of QFileDialog that contains the Q_OBJECT macro, or the platform + does not have a native dialog of the type that you require. \value ReadOnly Indicates that the model is readonly. From 65b12fbdb13d34c61bcadd5cc8fd6ee28a8dfafd Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Wed, 30 Oct 2013 17:53:40 +0100 Subject: [PATCH 115/494] Store the font's scalability in QFontEngine. This is an enabler to fallback to native font rendering when using a bitmap font in Qt Quick. Task-number: QTBUG-32737 Change-Id: I6d841dd5ef54d78a00f7fab9d80e9c95ff7f7b98 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontdatabase_qpa.cpp | 1 + src/gui/text/qfontengine.cpp | 3 ++- src/gui/text/qfontengine_p.h | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index 6c0be950dc9..fddbb11122a 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -184,6 +184,7 @@ QFontEngine *loadSingleEngine(int script, if (!engine) { engine = pfdb->fontEngine(def, QChar::Script(script), size->handle); if (engine) { + engine->smoothScalable = style->smoothScalable; QFontCache::Key key(def,script); QFontCache::instance()->instance()->insertEngine(key,engine); } diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 303c85ce75b..7d1afbbfb65 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -208,7 +208,8 @@ Q_AUTOTEST_EXPORT QList QFontEngine_stopCollectingEngines() QFontEngine::QFontEngine() : ref(0), font_(0), font_destroy_func(0), - face_(0), face_destroy_func(0) + face_(0), face_destroy_func(0), + smoothScalable(false) { cache_cost = 0; fsType = 0; diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index c181d61d738..07be498764e 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -302,6 +302,8 @@ public: inline QVariant userData() const { return m_userData; } + bool smoothScalable; + protected: QFixed lastRightBearing(const QGlyphLayout &glyphs, bool round = false); From 67c9b5ad9f32bc0ef89a34f01b1f0602a4869865 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 24 Oct 2013 20:36:25 +0200 Subject: [PATCH 116/494] fix filtering of system paths the path filtering functions assume that DEFAULT_{INC,LIB}DIRS are newline separated lists of unquoted strings, which 8fbf959be broke. Task-number: QTBUG-33714 Change-Id: Ie07909963ac5155a8ac79ca9254f34069925e001 Reviewed-by: Thiago Macieira --- configure | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/configure b/configure index f8dcebe9f67..3a8665d1c26 100755 --- a/configure +++ b/configure @@ -93,6 +93,13 @@ shellEscape() echo "$@" | sed 's/ /\ /g' } +shellQuoteLines() +{ + # The call of the outer echo makes the shell word-split the output of + # the nested pipe, thus effectively converting newlines to spaces. + echo `echo "$1" | sed 's,^[^ ]* .*$,"&",'` +} + # Adds a new qmake variable to the cache # Usage: QMakeVar mode varname contents # where mode is one of: set, add, del @@ -3028,35 +3035,26 @@ else CFG_FRAMEWORK=no fi -# auto-detect default include and library search paths -unset tty -[ "$OPT_VERBOSE" = "yes" ] && tty=/dev/stderr +# Auto-detect default include and library search paths. -eval `LC_ALL=C $TEST_COMPILER $SYSROOT_FLAG $TEST_COMPILER_CXXFLAGS -xc++ -E -v - < /dev/null 2>&1 > /dev/null | $AWK ' +# Use intermediate variable to get around backtick/quote nesting problems. +awkprog=' BEGIN { ORS = ""; FS = "="; incs = 0; libs = 0; } function normalize(dir) { do { odir = dir - gsub(/\\/[^\\/]+\\/\\.\\./, "", dir) + gsub(/\/[^\/]+\/\.\./, "", dir) } while (dir != odir); do { odir = dir - gsub(/\\/\\./, "", dir) + gsub(/\/\./, "", dir) } while (dir != odir); sub("/$", "", dir); return dir; } -function quote(s) -{ - # We only handle spaces - if (match(s, " ") != 0) - return "\\\\\"" s "\\\\\""; - return s; -} - # extract include paths from indented lines between # #include <...> search starts here: # and @@ -3064,7 +3062,7 @@ function quote(s) /^\#include &1 > /dev/null | $AWK "$awkprog" | tee $tty`" unset tty #setup the build parts @@ -6597,8 +6599,8 @@ host_build { QT_TARGET_ARCH = $CFG_ARCH } else { QT_ARCH = $CFG_ARCH - QMAKE_DEFAULT_LIBDIRS = $DEFAULT_LIBDIRS - QMAKE_DEFAULT_INCDIRS = $DEFAULT_INCDIRS + QMAKE_DEFAULT_LIBDIRS = `shellQuoteLines "$DEFAULT_LIBDIRS"` + QMAKE_DEFAULT_INCDIRS = `shellQuoteLines "$DEFAULT_INCDIRS"` } QT_EDITION = $Edition QT_CONFIG += $QT_CONFIG From 392054d311ecc036397cb022b442fa27134a2d4b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 29 Oct 2013 16:09:18 +0100 Subject: [PATCH 117/494] fix VS version selection On machines where multiple versions of VS are installed, the VS version for the vc(x)proj generator is selected by the entries in the PATH variable. The first VS installation that's found in PATH is used. The former logic printed a warning if multiple VS installations were in PATH and also fell back to the lowest version if a VS version was registered with multiple install paths. That's the case for VC 2012 express and prevented its usage. Task-number: QTBUG-34357 Change-Id: Ia5c66a1aea0c40e4b7460b3aa6c7daee6673da44 Reviewed-by: Oswald Buddenhagen Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msvc_vcproj.cpp | 47 +++++++++----------------- 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 8a5c5b70323..934902fd4a3 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -124,17 +124,17 @@ DotNET which_dotnet_version() // Fallback to .NET 2002 current_version = NET2002; - QStringList warnPath; + const DotNetCombo *lowestInstalledVersion = 0; 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() && installPaths.value(dotNetCombo[i].version) != path) { - installPaths.insert(dotNetCombo[i].version, path); + lowestInstalledVersion = &dotNetCombo[i]; + installPaths.insert(lowestInstalledVersion->version, path); ++installed; - current_version = dotNetCombo[i].version; - warnPath += QString("%1").arg(dotNetCombo[i].versionStr); + current_version = lowestInstalledVersion->version; } } @@ -143,35 +143,20 @@ DotNET which_dotnet_version() // More than one version installed, search directory path QString paths = qgetenv("PATH"); - QStringList pathlist = paths.toLower().split(";"); - - i = installed = 0; - for(; dotNetCombo[i].version; ++i) { - QString productPath = qt_readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey).toLower(); - if (productPath.isEmpty()) - continue; - QStringList::iterator it; - for(it = pathlist.begin(); it != pathlist.end(); ++it) { - if((*it).contains(productPath)) { - ++installed; - current_version = dotNetCombo[i].version; - warnPath += QString("%1 in path").arg(dotNetCombo[i].versionStr); - break; - } + const QStringList pathlist = paths.split(QLatin1Char(';')); + foreach (const QString &path, pathlist) { + for (i = 0; dotNetCombo[i].version; ++i) { + const QString productPath = installPaths.value(dotNetCombo[i].version); + if (productPath.isEmpty()) + continue; + if (path.startsWith(productPath, Qt::CaseInsensitive)) + return dotNetCombo[i].version; } } - switch(installed) { - case 1: - break; - case 0: - warn_msg(WarnLogic, "Generator: MSVC.NET: Found more than one version of Visual Studio, but" - " none in your path! Fallback to lowest version (%s)", warnPath.join(", ").toLatin1().data()); - break; - default: - warn_msg(WarnLogic, "Generator: MSVC.NET: Found more than one version of Visual Studio in" - " your path! Fallback to lowest version (%s)", warnPath.join(", ").toLatin1().data()); - break; - } + + warn_msg(WarnLogic, "Generator: MSVC.NET: Found more than one version of Visual Studio, but" + " none in your PATH. Falling back to lowest version (%s)", + qPrintable(lowestInstalledVersion->versionStr)); return current_version; #endif From c1e9c0bb0b1eb5438be07b21194ac03ee6c8636f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 30 Oct 2013 15:57:33 +0100 Subject: [PATCH 118/494] Assert in QImage conversion from rgba8888pm -> rgba8888 Fix typo in assert. Change-Id: I7dc056957b31a869eabe2e45feb99ae4fccb2d97 Reviewed-by: Gunnar Sletta --- src/gui/image/qimage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 234742e6b93..69ff27dc735 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2324,7 +2324,7 @@ static bool convert_RGB_to_RGB16_inplace(QImageData *data, Qt::ImageConversionFl static void convert_ARGB_PM_to_ARGB(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags) { Q_ASSERT(src->format == QImage::Format_ARGB32_Premultiplied || src->format == QImage::Format_RGBA8888_Premultiplied); - Q_ASSERT(dest->format == QImage::Format_ARGB32 || src->format == QImage::Format_RGBA8888); + Q_ASSERT(dest->format == QImage::Format_ARGB32 || dest->format == QImage::Format_RGBA8888); Q_ASSERT(src->width == dest->width); Q_ASSERT(src->height == dest->height); From a174eb95f1a39dcc10e50d889c2d3f4b17c004e8 Mon Sep 17 00:00:00 2001 From: Mark Brand Date: Thu, 24 Oct 2013 12:08:21 +0200 Subject: [PATCH 119/494] update changelog for QtSql 5.2.0 (and 5.1.0 in retrospect) Change-Id: I112e20d16f4da86487b95b4b01c4f3032ea2d3bd Reviewed-by: Mark Brand --- dist/changes-5.1.0 | 7 +++++++ dist/changes-5.2.0 | 29 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/dist/changes-5.1.0 b/dist/changes-5.1.0 index bc0db0b9c8f..8ba4547f932 100644 --- a/dist/changes-5.1.0 +++ b/dist/changes-5.1.0 @@ -99,6 +99,13 @@ QtNetwork - QHostInfo: * Allow QHostInfo::lookupHost() with no receiver to warm the DNS cache. + +QtSql +----- +This changelog as released was missing QtSql changes. +Please refer to changes-5.2.0 for QtSql 5.1.0 changes. + + QtWidgets --------- diff --git a/dist/changes-5.2.0 b/dist/changes-5.2.0 index e055e27a0eb..1eda87b553a 100644 --- a/dist/changes-5.2.0 +++ b/dist/changes-5.2.0 @@ -109,6 +109,35 @@ QtNetwork connections. This allows for much reduced latency when the hosts to be connected to are known. +QtSql +----- +Changes in Qt 5.1.0 (missing from released changelog dist/changes-5.1.0) +- [QTBUG-28088] Remove dependency of DB driver headers on qsqlcachedresult_p.h. +- Deprecate QSqlError setters. + The constructor is sufficient, since it has a parameter for each member variable. +- Rename the SQL driver header files to _p.h (make private) + The drivers were never public API. They were exposed by mistake in + public headers. What's more, they have #include'd a private header + (qsqlcachedresult_p.h) since at least Qt 4.5.1. That means no one used + those headers in Qt 4 (private headers weren't installed then) and + it's unlikely anyone did in 5.0. +- ODBC: Implemented lastInsertId() for some ODBC compatible databases. +- PSQL: Make lastInsertID work for tables without OIDs. +- [QTBUG-14904] SQLITE: Fix for Sql query aliases with dots +- [QTBUG-2192] ODBC: fix loss of milliseconds when binding QDateTime +- [QTBUG-30076] PSQL: escape backslashes only when server requires it + IMPORTANT: Applications that implemented their own workarounds must be + updated to avoid misbehavior and SQL injection vulnerabilities. +- [QTBUG-10569] ODBC: fixed QODBCResult::exec() return value for DELETE + operations when no rows are affected. +- ODBC: Fixed loss of column metadata on SQL_NO_DATA. +- QSqlTableModel: expose methods for getting primary values. +- ODBC: Fixed possible cause of spurious errors (commit af35ee291a1bbbc8) + +Changes in Qt 5.2.0 +- [QTBUG-29261] IBASE: Construct a valid QTime when creating timestamps for iBase SQL driver. +- [QTBUG-33389] PSQL: Format QDateTime following ISO8601. + **************************************************************************** * Platform Specific Changes * **************************************************************************** From f4d85c6548750fdd5e10602af50f085b53eaf24c Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Thu, 31 Oct 2013 12:23:48 +0100 Subject: [PATCH 120/494] Remove compiler warning when QT_NO_PRINTER is defined This broke the build on Android with warnings-are-errors. Change-Id: I9edb9539c4a6f7286ff46cbaa53bcfef4cf5280f Reviewed-by: Friedemann Kleint --- src/printsupport/kernel/qplatformprintplugin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/printsupport/kernel/qplatformprintplugin.cpp b/src/printsupport/kernel/qplatformprintplugin.cpp index e38b481a0e2..f3e88e7cf76 100644 --- a/src/printsupport/kernel/qplatformprintplugin.cpp +++ b/src/printsupport/kernel/qplatformprintplugin.cpp @@ -65,7 +65,9 @@ static QPlatformPrinterSupport *printerSupport = 0; static void cleanupPrinterSupport() { +#ifndef QT_NO_PRINTER delete printerSupport; +#endif printerSupport = 0; } From 33a88d6cd71691dd2fe616d65a3f303d2e683420 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 28 Oct 2013 16:57:00 +0100 Subject: [PATCH 121/494] Stabilize moveChild/showAndMoveChild-tests. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pass window flags on to ColorWidget constructor and use a window frame + stay on top-hint for the moveChild/showAndMoveChild tests to make the screen grabbing more reliable. Disable animations on Windows since they seem to affect screen grabbing as well (fading in of windows). Task-number: QTBUG-30566 Change-Id: I8eacfc203d26674dc1b283d6643f3d434f218f26 Reviewed-by: Jan Arve Sæther --- .../widgets/kernel/qwidget/tst_qwidget.cpp | 86 +++++++++++++------ 1 file changed, 59 insertions(+), 27 deletions(-) diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 227f61b0a35..fe85a1a42ff 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -170,6 +170,24 @@ static inline void centerOnScreen(QWidget *w) w->move(QGuiApplication::primaryScreen()->availableGeometry().center() - offset); } +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) +static inline void setWindowsAnimationsEnabled(bool enabled) +{ + ANIMATIONINFO animation = { sizeof(ANIMATIONINFO), enabled }; + SystemParametersInfo(SPI_SETANIMATION, 0, &animation, 0); +} + +static inline bool windowsAnimationsEnabled() +{ + ANIMATIONINFO animation = { sizeof(ANIMATIONINFO), 0 }; + SystemParametersInfo(SPI_GETANIMATION, 0, &animation, 0); + return animation.iMinAnimate; +} +#else // Q_OS_WIN && !Q_OS_WINCE +inline void setWindowsAnimationsEnabled(bool) {} +static inline bool windowsAnimationsEnabled() { return false; } +#endif // !Q_OS_WIN || Q_OS_WINCE + class tst_QWidget : public QObject { Q_OBJECT @@ -425,6 +443,7 @@ private: QWidget *testWidget; const QString m_platform; + const bool m_windowsAnimationsEnabled; }; bool tst_QWidget::ensureScreenSize(int width, int height) @@ -579,8 +598,12 @@ void tst_QWidget::getSetCheck() #endif } -tst_QWidget::tst_QWidget() : m_platform(qApp->platformName().toLower()) +tst_QWidget::tst_QWidget() + : m_platform(qApp->platformName().toLower()) + , m_windowsAnimationsEnabled(windowsAnimationsEnabled()) { + if (m_windowsAnimationsEnabled) // Disable animations which can interfere with screen grabbing in moveChild(), showAndMoveChild() + setWindowsAnimationsEnabled(false); QFont font; font.setBold(true); font.setPointSize(42); @@ -596,6 +619,8 @@ tst_QWidget::tst_QWidget() : m_platform(qApp->platformName().toLower()) tst_QWidget::~tst_QWidget() { + if (m_windowsAnimationsEnabled) + setWindowsAnimationsEnabled(m_windowsAnimationsEnabled); } class BezierViewer : public QWidget { @@ -4751,8 +4776,8 @@ void tst_QWidget::windowMoveResize() class ColorWidget : public QWidget { public: - ColorWidget(QWidget *parent = 0, const QColor &c = QColor(Qt::red)) - : QWidget(parent, Qt::FramelessWindowHint), color(c), enters(0), leaves(0) + ColorWidget(QWidget *parent = 0, Qt::WindowFlags f = 0, const QColor &c = QColor(Qt::red)) + : QWidget(parent, f), color(c), enters(0), leaves(0) { QPalette opaquePalette = palette(); opaquePalette.setColor(backgroundRole(), color); @@ -4783,6 +4808,12 @@ public: int leaves; }; +static inline QByteArray msgRgbMismatch(unsigned actual, unsigned expected) +{ + return QByteArrayLiteral("Color mismatch, 0x") + QByteArray::number(actual, 16) + + QByteArrayLiteral(" != 0x") + QByteArray::number(expected, 16); +} + #define VERIFY_COLOR(region, color) { \ const QRegion r = QRegion(region); \ QScreen *screen = qApp->primaryScreen(); \ @@ -4802,7 +4833,7 @@ public: uint firstPixel = image.pixel(0,0) | alphaCorrection; \ if ( firstPixel != QColor(color).rgb() && t < 4 ) \ { QTest::qWait(200); continue; } \ - QCOMPARE(firstPixel, QColor(color).rgb()); \ + QVERIFY2(firstPixel == QColor(color).rgb(), msgRgbMismatch(firstPixel, QColor(color).rgb())); \ QCOMPARE(pixmap, expectedPixmap); \ break; \ } \ @@ -4815,7 +4846,7 @@ void tst_QWidget::popupEnterLeave() parent.setWindowFlags(Qt::FramelessWindowHint); parent.setGeometry(10, 10, 200, 100); - ColorWidget alien(&parent, Qt::black); + ColorWidget alien(&parent, Qt::Widget, Qt::black); alien.setGeometry(0, 0, 10, 10); alien.show(); @@ -4866,23 +4897,23 @@ void tst_QWidget::moveChild_data() void tst_QWidget::moveChild() { -#if defined(UBUNTU_ONEIRIC) - QSKIP("QTBUG-30566 - Unstable auto-test"); -#endif QFETCH(QPoint, offset); - ColorWidget parent; + ColorWidget parent(0, Qt::Window | Qt::WindowStaysOnTopHint); // prevent custom styles parent.setStyle(QStyleFactory::create(QLatin1String("Windows"))); - ColorWidget child(&parent, Qt::blue); + ColorWidget child(&parent, Qt::Widget, Qt::blue); #ifndef Q_OS_WINCE - parent.setGeometry(QRect(QPoint(QApplication::desktop()->availableGeometry(&parent).topLeft()), - QSize(100, 100))); + parent.setGeometry(QRect(QPoint(QApplication::desktop()->availableGeometry(&parent).topLeft()) + QPoint(50, 50), + QSize(200, 200))); #else parent.setGeometry(60, 60, 150, 150); #endif child.setGeometry(25, 25, 50, 50); +#ifndef QT_NO_CURSOR // Try to make sure the cursor is not in a taskbar area to prevent tooltips or window highlighting + QCursor::setPos(parent.geometry().topRight() + QPoint(50 , 50)); +#endif parent.show(); QVERIFY(QTest::qWaitForWindowExposed(&parent)); QTest::qWait(30); @@ -4922,7 +4953,7 @@ void tst_QWidget::showAndMoveChild() #if defined(UBUNTU_ONEIRIC) QSKIP("QTBUG-30566 - Unstable auto-test"); #endif - QWidget parent(0, Qt::FramelessWindowHint); + QWidget parent(0, Qt::Window | Qt::WindowStaysOnTopHint); // prevent custom styles parent.setStyle(QStyleFactory::create(QLatin1String("Windows"))); @@ -4930,6 +4961,9 @@ void tst_QWidget::showAndMoveChild() QRect desktopDimensions = desktop.availableGeometry(&parent); desktopDimensions = desktopDimensions.adjusted(64, 64, -64, -64); +#ifndef QT_NO_CURSOR // Try to make sure the cursor is not in a taskbar area to prevent tooltips or window highlighting + QCursor::setPos(desktopDimensions.topRight() + QPoint(40, 40)); +#endif parent.setGeometry(desktopDimensions); parent.setPalette(Qt::red); parent.show(); @@ -4960,13 +4994,13 @@ void tst_QWidget::subtractOpaqueSiblings() QWidget w; w.setGeometry(50, 50, 300, 300); - ColorWidget *large = new ColorWidget(&w, Qt::red); + ColorWidget *large = new ColorWidget(&w, Qt::Widget, Qt::red); large->setGeometry(50, 50, 200, 200); - ColorWidget *medium = new ColorWidget(large, Qt::gray); + ColorWidget *medium = new ColorWidget(large, Qt::Widget, Qt::gray); medium->setGeometry(50, 50, 100, 100); - ColorWidget *tall = new ColorWidget(&w, Qt::blue); + ColorWidget *tall = new ColorWidget(&w, Qt::Widget, Qt::blue); tall->setGeometry(100, 30, 50, 100); w.show(); @@ -7049,7 +7083,7 @@ void tst_QWidget::repaintWhenChildDeleted() QTest::qWait(1000); } #endif - ColorWidget w(0, Qt::red); + ColorWidget w(0, Qt::FramelessWindowHint, Qt::red); #if !defined(Q_OS_WINCE) QPoint startPoint = QApplication::desktop()->availableGeometry(&w).topLeft(); startPoint.rx() += 50; @@ -7065,7 +7099,7 @@ void tst_QWidget::repaintWhenChildDeleted() w.r = QRegion(); { - ColorWidget child(&w, Qt::blue); + ColorWidget child(&w, Qt::Widget, Qt::blue); child.setGeometry(10, 10, 10, 10); child.show(); QTest::qWait(10); @@ -7080,7 +7114,7 @@ void tst_QWidget::repaintWhenChildDeleted() // task 175114 void tst_QWidget::hideOpaqueChildWhileHidden() { - ColorWidget w(0, Qt::red); + ColorWidget w(0, Qt::FramelessWindowHint, Qt::red); #if !defined(Q_OS_WINCE) QPoint startPoint = QApplication::desktop()->availableGeometry(&w).topLeft(); startPoint.rx() += 50; @@ -7090,10 +7124,10 @@ void tst_QWidget::hideOpaqueChildWhileHidden() w.setGeometry(60, 60, 110, 110); #endif - ColorWidget child(&w, Qt::blue); + ColorWidget child(&w, Qt::Widget, Qt::blue); child.setGeometry(10, 10, 80, 80); - ColorWidget child2(&child, Qt::white); + ColorWidget child2(&child, Qt::Widget, Qt::white); child2.setGeometry(10, 10, 60, 60); w.show(); @@ -9780,18 +9814,16 @@ void tst_QWidget::underMouse() // Move the mouse cursor to a safe location QCursor::setPos(0,0); - ColorWidget topLevelWidget(0, Qt::blue); - ColorWidget childWidget1(&topLevelWidget, Qt::yellow); - ColorWidget childWidget2(&topLevelWidget, Qt::black); - ColorWidget popupWidget(0, Qt::green); + ColorWidget topLevelWidget(0, Qt::FramelessWindowHint, Qt::blue); + ColorWidget childWidget1(&topLevelWidget, Qt::Widget, Qt::yellow); + ColorWidget childWidget2(&topLevelWidget, Qt::Widget, Qt::black); + ColorWidget popupWidget(0, Qt::Popup, Qt::green); topLevelWidget.setObjectName("topLevelWidget"); childWidget1.setObjectName("childWidget1"); childWidget2.setObjectName("childWidget2"); popupWidget.setObjectName("popupWidget"); - popupWidget.setWindowFlags(Qt::Popup); - topLevelWidget.setGeometry(100, 100, 300, 300); childWidget1.setGeometry(20, 20, 100, 100); childWidget2.setGeometry(20, 120, 100, 100); From 04de24c6449422d29a0d4760375aa94f59222fa3 Mon Sep 17 00:00:00 2001 From: Chengyong Xie Date: Fri, 13 Sep 2013 16:25:22 +0800 Subject: [PATCH 122/494] Fix setVisible() of QWidget has no effect in QTreeWidgetItem Check if the item is hidden before show the item(QWidget) Task-number: QTBUG-13522 Change-Id: I1c605d5cb8a80f340e9b7601612d3760f51cb4a7 Reviewed-by: Liang Qi Reviewed-by: Stephen Kelly Reviewed-by: David Faure --- src/widgets/itemviews/qabstractitemview.cpp | 3 +- .../itemviews/qtreewidget/tst_qtreewidget.cpp | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index fd704e479b2..ef7207229c4 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -2637,7 +2637,8 @@ void QAbstractItemView::updateEditorGeometries() if (index.isValid() && editor) { option.rect = visualRect(index); if (option.rect.isValid()) { - editor->show(); + if (!editor->isHidden()) + editor->show(); QAbstractItemDelegate *delegate = d->delegateForIndex(index); if (delegate) delegate->updateEditorGeometry(editor, option, index); diff --git a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp index 83ba1ddcda7..1de5749c69f 100644 --- a/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp +++ b/tests/auto/widgets/itemviews/qtreewidget/tst_qtreewidget.cpp @@ -165,6 +165,7 @@ private slots: void setChildIndicatorPolicy(); void task20345_sortChildren(); + void taskQTBUG13522_checkItemVisibilityBeforeItemShow(); public slots: void itemSelectionChanged(); @@ -3371,6 +3372,39 @@ void tst_QTreeWidget::task20345_sortChildren() QVERIFY(1); } +void tst_QTreeWidget::taskQTBUG13522_checkItemVisibilityBeforeItemShow() +{ + class TreeView : public QTreeWidget + { + public: + explicit TreeView(QWidget *parent = 0) : QTreeWidget(parent) + , item1_visibility(false), item2_visibility(false) {} + void showEvent(QShowEvent * /*event*/) Q_DECL_OVERRIDE + { + item1_visibility = !item1->isVisible(); + item2_visibility = item2->isVisible(); + } + QWidget *item1; + QWidget *item2; + bool item1_visibility; + bool item2_visibility; + + } tw; + tw.item1 = new QWidget(&tw); + tw.item2 = new QWidget(&tw); + QTreeWidgetItem *widget_item = new QTreeWidgetItem(); + widget_item->setText(0, "example text"); + tw.addTopLevelItem(widget_item); + tw.setItemWidget(widget_item, 0, tw.item1); + widget_item = new QTreeWidgetItem(); + tw.setItemWidget(widget_item, 0, tw.item2); + //set visible must after setItemWidget or setItemWidget will reset the visibility + tw.item1->setVisible(false); + tw.item2->setVisible(true); + tw.show(); + QTRY_VERIFY(tw.item1_visibility); + QTRY_VERIFY(tw.item2_visibility); +} QTEST_MAIN(tst_QTreeWidget) #include "tst_qtreewidget.moc" From 418e06f78f8b6cbc33b42f9b300c9c46c1ea2a32 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Tue, 8 Oct 2013 22:41:20 +0200 Subject: [PATCH 123/494] Don't cache QCoreApplication::appName. This isn't a hot codepath, there is no gain to doing this. It introduces unnecessary bloat (see e.g. https://www.webkit.org/blog/2826/unusual-speed-boost-size-matters/) and complicates boosting Qt application startup in cases where argv[0] is overwritten. Change-Id: I55b2b98b0de6b06fe7a049de262f3e19936b73db Reviewed-by: Thiago Macieira --- src/corelib/kernel/qcoreapplication.cpp | 14 +++++--------- src/corelib/kernel/qcoreapplication_p.h | 1 - 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 0460c52d1c9..1ae4da12e80 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -147,17 +147,13 @@ QString QCoreApplicationPrivate::macMenuBarName() #endif QString QCoreApplicationPrivate::appName() const { - static QBasicMutex applicationNameMutex; - QMutexLocker locker(&applicationNameMutex); - - if (applicationName.isNull()) { + QString applicationName; #ifdef Q_OS_MAC - applicationName = macMenuBarName(); + applicationName = macMenuBarName(); #endif - if (applicationName.isEmpty() && argv[0]) { - char *p = strrchr(argv[0], '/'); - applicationName = QString::fromLocal8Bit(p ? p + 1 : argv[0]); - } + if (applicationName.isEmpty() && argv[0]) { + char *p = strrchr(argv[0], '/'); + applicationName = QString::fromLocal8Bit(p ? p + 1 : argv[0]); } return applicationName; diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h index 4b57a7b67d0..ad0449f02c4 100644 --- a/src/corelib/kernel/qcoreapplication_p.h +++ b/src/corelib/kernel/qcoreapplication_p.h @@ -83,7 +83,6 @@ public: ~QCoreApplicationPrivate(); QString appName() const; - mutable QString applicationName; #ifdef Q_OS_MAC static QString macMenuBarName(); From 3b6b615334713cbfeb43409ff104244b55f4ce1f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 28 Oct 2013 21:59:17 +0100 Subject: [PATCH 124/494] export QT_NO_ equivalents to the build system MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this makes it possible to properly exclude entire subprojects based on the availability of features, rather than stuffing every single source file with #ifdefs. the defines are aggregated from the -qconfig , -no-feature- and some other configure flags. usage: load(qfeatures) !contains(QT_DISABLED_FEATURES, textarea): SUBDIRS += textstuff Task-number: QTBUG-28102 Change-Id: I83400632d64312fa4b907e1318dddfe27c432387 Reviewed-by: Tor Arne Vestbø Reviewed-by: Joerg Bornemann Reviewed-by: Peter Hartmann Reviewed-by: Tasuku Suzuki --- configure | 10 ++++++++++ mkspecs/features/qfeatures.prf | 4 ++++ qtbase.pro | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 mkspecs/features/qfeatures.prf diff --git a/configure b/configure index 3a8665d1c26..b5e375baedb 100755 --- a/configure +++ b/configure @@ -6682,6 +6682,16 @@ echo "QT_BUILD_PARTS += $CFG_BUILD_PARTS" >> "$QTMODULE.tmp" if [ -n "$CFG_SKIP_MODULES" ]; then echo "QT_SKIP_MODULES += $CFG_SKIP_MODULES" >> "$QTMODULE.tmp" fi +DISABLED_FEATURES= +for cfg in $QCONFIG_FLAGS; do + ncfg=${cfg#QT_NO_} + if [ x$ncfg != x$cfg ]; then + DISABLED_FEATURES="$DISABLED_FEATURES $ncfg" + fi +done +if [ -n "$DISABLED_FEATURES" ]; then + echo "QT_NO_DEFINES = $DISABLED_FEATURES" >> "$QTMODULE.tmp" +fi echo "QT_QCONFIG_PATH = ${CFG_QCONFIG_PATH#$relpath/src/corelib/global/}" >> "$QTMODULE.tmp" cat >>"$QTMODULE.tmp" </src/corelib/global/qfeatures.txt" \ " */" +FEATURES_PRI = for (ft, features) { !isEmpty(features.$${ft}.depends) { FEATURES_H += \ "$${LITERAL_HASH}if !defined(QT_NO_$$ft) && ($$join($$list($$split(features.$${ft}.depends)), ") || defined(QT_NO_", "defined(QT_NO_", ")"))" \ "$${LITERAL_HASH} define QT_NO_$$ft" \ "$${LITERAL_HASH}endif" + FEATURES_PRI += \ + "contains(QT_DISABLED_FEATURES, "^($$lower($$join($$list($$replace(features.$${ft}.depends, _, -)), "|")))$"): \\" \ + " QT_DISABLED_FEATURES += $$lower($$replace(ft, _, -))" } } write_file($$OUT_PWD/src/corelib/global/qfeatures.h, FEATURES_H)|error("Aborting.") @@ -145,6 +149,7 @@ FWD_FEATURES_H = \ '$${LITERAL_HASH}include "../../src/corelib/global/qfeatures.h"' write_file($$OUT_PWD/include/QtCore/qfeatures.h, FWD_FEATURES_H)|error("Aborting.") +no_features = lines = $$cat($$absolute_path($$QT_QCONFIG_PATH, $$PWD/src/corelib/global), lines) for (line, lines) { # We ignore all defines that don't follow the #ifndef + indent pattern. @@ -153,8 +158,22 @@ for (line, lines) { !isEqual(t, $$line) { isEmpty(features.$${t}.name): \ error("$$QT_QCONFIG_PATH disables unknown feature $$t") + no_features += $$t } } +for (def, QT_NO_DEFINES) { + !isEmpty(features.$${def}.name): \ + no_features += $$def +} +no_features = $$unique(no_features) + +# Can't simply add these to QT_CONFIG, as e.g., contains(QT_CONFIG, accessibility) matches no-accessibililty. +FEATURES_PRI = \ + "$${LITERAL_HASH} Features disabled by configure:" \ + "QT_DISABLED_FEATURES =$$lower($$join($$list($$replace(no_features, _, -)), " ", " "))" \ + "$$escape_expand(\\n)$${LITERAL_HASH} Dependencies derived from /src/corelib/global/qfeatures.txt:" \ + $$FEATURES_PRI +write_file($$OUT_PWD/mkspecs/qfeatures.pri, FEATURES_PRI)|error("Aborting.") #mkspecs mkspecs.path = $$[QT_HOST_DATA]/mkspecs From e469e667e39d638d3c4649b9793ee3eefe3c5784 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 31 Oct 2013 12:43:38 +0100 Subject: [PATCH 125/494] use the right scope "windows" only worked more or less by accident (it's the opposite of "console" and just happens to be the default on windows). Change-Id: Ib60c8ae5aea04f28207c05cc0005183dd6eb6244 Reviewed-by: Joerg Bornemann Reviewed-by: Thiago Macieira --- src/network/ssl/ssl.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri index 0fe231357bf..afb1df5aa46 100644 --- a/src/network/ssl/ssl.pri +++ b/src/network/ssl/ssl.pri @@ -45,5 +45,5 @@ android:!android-no-sdk: SOURCES += ssl/qsslsocket_openssl_android.cpp QMAKE_CXXFLAGS += $$OPENSSL_CFLAGS LIBS_PRIVATE += $$OPENSSL_LIBS - windows:LIBS += -lcrypt32 + win32: LIBS += -lcrypt32 } From 43684a20d044de6d4daac750809750777b68c9e5 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 31 Oct 2013 13:34:10 +0100 Subject: [PATCH 126/494] use private linkage where possible Change-Id: Ie8eaa71bee87654c21218a23efd7e9d65b71f022 Reviewed-by: Joerg Bornemann Reviewed-by: Thiago Macieira --- src/angle/src/common/common.pri | 4 ++-- src/angle/src/libEGL/libEGL.pro | 6 +++--- src/angle/src/libGLESv2/libGLESv2.pro | 8 ++++---- src/concurrent/concurrent.pro | 2 +- src/corelib/corelib.pro | 2 +- src/network/kernel/kernel.pri | 2 +- src/network/socket/socket.pri | 2 +- src/network/ssl/ssl.pri | 2 +- src/platformsupport/input/evdevtouch/evdevtouch.pri | 2 +- src/printsupport/dialogs/dialogs.pri | 2 +- src/printsupport/kernel/kernel.pri | 2 +- src/widgets/kernel/win.pri | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri index e5b01d50519..514c80dbd1a 100644 --- a/src/angle/src/common/common.pri +++ b/src/angle/src/common/common.pri @@ -4,7 +4,7 @@ INCLUDEPATH += \ $$ANGLE_DIR/src \ $$ANGLE_DIR/include -LIBS = $$QMAKE_LIBS_CORE $$QMAKE_LIBS_GUI +LIBS_PRIVATE = $$QMAKE_LIBS_CORE $$QMAKE_LIBS_GUI # DirectX is included in the Windows 8 Kit, but everything else requires the DX SDK. win32-msvc2012|win32-msvc2013 { @@ -36,7 +36,7 @@ win32-msvc2012|win32-msvc2013 { # Similarly we want the MinGW linker to use the import libraries shipped with the compiler # instead of those from the SDK which cause a crash on startup. - LIBS += -L\"$$DXLIB_DIR\" + LIBS_PRIVATE += -L\"$$DXLIB_DIR\" } } diff --git a/src/angle/src/libEGL/libEGL.pro b/src/angle/src/libEGL/libEGL.pro index 3781bd78688..b5854189f9a 100644 --- a/src/angle/src/libEGL/libEGL.pro +++ b/src/angle/src/libEGL/libEGL.pro @@ -4,11 +4,11 @@ TARGET = $$qtLibraryTarget(libEGL) include(../common/common.pri) angle_d3d11 { - LIBS += -ld3d11 + LIBS_PRIVATE += -ld3d11 } else { - LIBS += -ld3d9 + LIBS_PRIVATE += -ld3d9 } -LIBS += -ldxguid -L$$QT_BUILD_TREE/lib -l$$qtLibraryTarget(libGLESv2) +LIBS_PRIVATE += -ldxguid -L$$QT_BUILD_TREE/lib -l$$qtLibraryTarget(libGLESv2) HEADERS += \ $$ANGLE_DIR/src/libEGL/Config.h \ diff --git a/src/angle/src/libGLESv2/libGLESv2.pro b/src/angle/src/libGLESv2/libGLESv2.pro index ff2f888b1d9..5d54c0f86a5 100644 --- a/src/angle/src/libGLESv2/libGLESv2.pro +++ b/src/angle/src/libGLESv2/libGLESv2.pro @@ -8,18 +8,18 @@ INCLUDEPATH += $$OUT_PWD/.. $$ANGLE_DIR/src/libGLESv2 # Remember to adapt tools/configure/configureapp.cpp if the Direct X version changes. angle_d3d11 { - LIBS += -ldxgi -ld3d11 + LIBS_PRIVATE += -ldxgi -ld3d11 } else { - LIBS += -ld3d9 + LIBS_PRIVATE += -ld3d9 } -LIBS += -ldxguid +LIBS_PRIVATE += -ldxguid STATICLIBS = translator_common translator_hlsl preprocessor for(libname, STATICLIBS) { # Appends 'd' to the library for debug builds and builds up the fully # qualified path to pass to the linker. staticlib = $$QT_BUILD_TREE/lib/$${QMAKE_PREFIX_STATICLIB}$$qtLibraryTarget($$libname).$${QMAKE_EXTENSION_STATICLIB} - LIBS += $$staticlib + LIBS_PRIVATE += $$staticlib PRE_TARGETDEPS += $$staticlib } diff --git a/src/concurrent/concurrent.pro b/src/concurrent/concurrent.pro index 53b6bd0472d..2b8fef2d6aa 100644 --- a/src/concurrent/concurrent.pro +++ b/src/concurrent/concurrent.pro @@ -39,5 +39,5 @@ HEADERS += \ HEADERS += \ contains(QT_CONFIG, clock-gettime) { - linux-*|hpux-*|solaris-*:LIBS *= -lrt + linux-*|hpux-*|solaris-*: LIBS_PRIVATE *= -lrt } diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index bc618ed8435..2e4181efb17 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -48,7 +48,7 @@ mac|darwin { LIBS_PRIVATE += -framework CoreServices } LIBS_PRIVATE += -framework CoreFoundation - LIBS += -framework Foundation + LIBS_PRIVATE += -framework Foundation } win32:DEFINES-=QT_NO_CAST_TO_ASCII DEFINES += $$MODULE_DEFINES diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri index a4a19988b39..97f52fdb6e4 100644 --- a/src/network/kernel/kernel.pri +++ b/src/network/kernel/kernel.pri @@ -35,7 +35,7 @@ android { win32: { HEADERS += kernel/qnetworkinterface_win_p.h SOURCES += kernel/qdnslookup_win.cpp kernel/qhostinfo_win.cpp kernel/qnetworkinterface_win.cpp - LIBS += -ldnsapi + LIBS_PRIVATE += -ldnsapi } integrity:SOURCES += kernel/qdnslookup_unix.cpp kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_unix.cpp diff --git a/src/network/socket/socket.pri b/src/network/socket/socket.pri index 0204a92999b..c0c6d750d9d 100644 --- a/src/network/socket/socket.pri +++ b/src/network/socket/socket.pri @@ -40,7 +40,7 @@ win32:SOURCES += socket/qnativesocketengine_win.cpp \ socket/qlocalsocket_win.cpp \ socket/qlocalserver_win.cpp -win32:!wince*:LIBS += -ladvapi32 +win32:!wince*: LIBS_PRIVATE += -ladvapi32 wince*: { SOURCES -= socket/qlocalsocket_win.cpp \ diff --git a/src/network/ssl/ssl.pri b/src/network/ssl/ssl.pri index afb1df5aa46..eb8268515e4 100644 --- a/src/network/ssl/ssl.pri +++ b/src/network/ssl/ssl.pri @@ -45,5 +45,5 @@ android:!android-no-sdk: SOURCES += ssl/qsslsocket_openssl_android.cpp QMAKE_CXXFLAGS += $$OPENSSL_CFLAGS LIBS_PRIVATE += $$OPENSSL_LIBS - win32: LIBS += -lcrypt32 + win32: LIBS_PRIVATE += -lcrypt32 } diff --git a/src/platformsupport/input/evdevtouch/evdevtouch.pri b/src/platformsupport/input/evdevtouch/evdevtouch.pri index a6b90937f2e..16e1a981fa3 100644 --- a/src/platformsupport/input/evdevtouch/evdevtouch.pri +++ b/src/platformsupport/input/evdevtouch/evdevtouch.pri @@ -10,4 +10,4 @@ contains(QT_CONFIG, libudev) { # DEFINES += USE_MTDEV -contains(DEFINES, USE_MTDEV): LIBS += -lmtdev +contains(DEFINES, USE_MTDEV): LIBS_PRIVATE += -lmtdev diff --git a/src/printsupport/dialogs/dialogs.pri b/src/printsupport/dialogs/dialogs.pri index 9659046f605..bb07167f68e 100644 --- a/src/printsupport/dialogs/dialogs.pri +++ b/src/printsupport/dialogs/dialogs.pri @@ -11,7 +11,7 @@ HEADERS += \ mac:!ios { OBJECTIVE_SOURCES += dialogs/qpagesetupdialog_mac.mm \ dialogs/qprintdialog_mac.mm - LIBS += -framework Cocoa + LIBS_PRIVATE += -framework Cocoa } win32 { diff --git a/src/printsupport/kernel/kernel.pri b/src/printsupport/kernel/kernel.pri index 8bdccd0f5b2..67fcc8597c0 100644 --- a/src/printsupport/kernel/kernel.pri +++ b/src/printsupport/kernel/kernel.pri @@ -24,7 +24,7 @@ win32 { $$PWD/qprintengine_win_p.h SOURCES += \ $$PWD/qprintengine_win.cpp - LIBS += -lwinspool -lcomdlg32 -lgdi32 -luser32 + LIBS_PRIVATE += -lwinspool -lcomdlg32 -lgdi32 -luser32 } unix:!mac:contains(QT_CONFIG, cups): { diff --git a/src/widgets/kernel/win.pri b/src/widgets/kernel/win.pri index dd47664c286..d5cba740d14 100644 --- a/src/widgets/kernel/win.pri +++ b/src/widgets/kernel/win.pri @@ -3,5 +3,5 @@ INCLUDEPATH += ../3rdparty/wintab !wince* { - LIBS *= -lshell32 + LIBS_PRIVATE *= -lshell32 } From e7db02e79eec24015fcc4c2d2bc56c8c40c50e42 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Thu, 31 Oct 2013 15:41:26 +0200 Subject: [PATCH 127/494] Remove android specific qmake variables. Change-Id: Iba2b929ba70588ffcbcc9395501753521cfe5154 Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../features/android/android_deployment_settings.prf | 12 ------------ src/android/java/AndroidManifest.xml | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/mkspecs/features/android/android_deployment_settings.prf b/mkspecs/features/android/android_deployment_settings.prf index a903ed025da..5bc1fd14c93 100644 --- a/mkspecs/features/android/android_deployment_settings.prf +++ b/mkspecs/features/android/android_deployment_settings.prf @@ -47,18 +47,6 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-no-sdk { !isEmpty(ANDROID_PACKAGE_SOURCE_DIR): \ FILE_CONTENT += " \"android-package-source-directory\": $$emitString($$ANDROID_PACKAGE_SOURCE_DIR)," - !isEmpty(ANDROID_PACKAGE): \ - FILE_CONTENT += " \"android-package\": $$emitString($$ANDROID_PACKAGE)," - - !isEmpty(ANDROID_MINIMUM_VERSION): \ - FILE_CONTENT += " \"android-minimum-version\": $$ANDROID_MINIMUM_VERSION," - - !isEmpty(ANDROID_TARGET_VERSION): \ - FILE_CONTENT += " \"android-target-version\": $$ANDROID_TARGET_VERSION," - - !isEmpty(ANDROID_APP_NAME): \ - FILE_CONTENT += " \"android-app-name\": $$emitString($$ANDROID_APP_NAME)," - !isEmpty(ANDROID_EXTRA_LIBS): \ FILE_CONTENT += " \"android-extra-libs\": $$emitString($$join(ANDROID_EXTRA_LIBS, ","))," diff --git a/src/android/java/AndroidManifest.xml b/src/android/java/AndroidManifest.xml index 6463793e0b9..da34e4efac2 100644 --- a/src/android/java/AndroidManifest.xml +++ b/src/android/java/AndroidManifest.xml @@ -34,7 +34,7 @@ - + From 1da1259c281f2098ae11d928f1664cf00d379076 Mon Sep 17 00:00:00 2001 From: John Layt Date: Thu, 26 Sep 2013 16:51:48 +0200 Subject: [PATCH 128/494] QDateTime - Optimize date() and time() methods Optimize the performance of date() and time(), resulting in a one-third improvement, and subsequent improvements in all date/time based functions. Tested over 1000 iterations of the standard benchmarks, in msecs per iteration: Before After date()/time() 0.3 0.2 setDate()/setTime() 0.9 0.8 daysTo() 0.6 0.4 Note original performance before msecs storage was 0.06. Change-Id: Ie838e560ddf7129281531dc965af56ac19cce91d Reviewed-by: Mitch Curtis Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 5ce11a43aa1..935fd65ae1a 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -2682,10 +2682,10 @@ void QDateTimePrivate::getDateTime(QDate *date, QTime *time) const { msecsToTime(m_msecs, date, time); - if (isNullDate()) + if (date && isNullDate()) *date = QDate(); - if (isNullTime()) + if (time && isNullTime()) *time = QTime(); } @@ -3094,9 +3094,10 @@ bool QDateTime::isValid() const QDate QDateTime::date() const { + if (d->isNullDate()) + return QDate(); QDate dt; - QTime tm; - d->getDateTime(&dt, &tm); + msecsToTime(d->m_msecs, &dt, 0); return dt; } @@ -3108,9 +3109,10 @@ QDate QDateTime::date() const QTime QDateTime::time() const { - QDate dt; + if (d->isNullTime()) + return QTime(); QTime tm; - d->getDateTime(&dt, &tm); + msecsToTime(d->m_msecs, 0, &tm); return tm; } From 24733dea6c5c5500d3c01fcfa46c2b05d7557b47 Mon Sep 17 00:00:00 2001 From: John Layt Date: Sat, 28 Sep 2013 16:46:19 +0200 Subject: [PATCH 129/494] QDateTime - Optimize refreshDateTime() A small optimization to the private refreshDateTime() function, improves standard performance tests by 0.3 msecs per iteration for affected functions, e.g. isValid() and offsetFromUtc() improve from 5.4 to 5.1. Change-Id: Ie67812649ef244388b484af35848b09d92dee38a Reviewed-by: Mitch Curtis Reviewed-by: Thiago Macieira --- src/corelib/tools/qdatetime.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 935fd65ae1a..42721c018fb 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -2765,9 +2765,6 @@ void QDateTimePrivate::refreshDateTime() } // We have a valid date and time and a Qt::LocalTime or Qt::TimeZone that needs calculating - QDate date; - QTime time; - getDateTime(&date, &time); // LocalTime and TimeZone might fall into "missing" DaylightTime transition hour // Calling toEpochMSecs will adjust the returned date/time if it does QDate testDate; @@ -2781,7 +2778,7 @@ void QDateTimePrivate::refreshDateTime() epochMSecs = zoneMSecsToEpochMSecs(m_msecs, m_timeZone, &testDate, &testTime); #endif // QT_BOOTSTRAPPED } - if (testDate == date && testTime == time) { + if (timeToMSecs(testDate, testTime) == m_msecs) { setValidDateTime(); // Cache the offset to use in toMSecsSinceEpoch() m_offsetFromUtc = (m_msecs - epochMSecs) / 1000; From e696bef863ba4cc21a36cbfdc0d6e811060916f7 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 31 Oct 2013 08:19:52 +0100 Subject: [PATCH 130/494] Fix compilation with QT_COORD_TYPE=double on ARM Add a missing template specialization in the neon drawhelper. Task-number: QTBUG-33781 Change-Id: Iec02a93aee9403dc1275c32436db5527585b1088 Reviewed-by: Paul Olav Tvete Reviewed-by: Oswald Buddenhagen --- src/gui/painting/qdrawhelper_neon.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp index b12fd715638..541b3ef6199 100644 --- a/src/gui/painting/qdrawhelper_neon.cpp +++ b/src/gui/painting/qdrawhelper_neon.cpp @@ -964,6 +964,7 @@ public: union Vect_buffer_i { Int32x4 v; int i[4]; }; union Vect_buffer_f { Float32x4 v; float f[4]; }; + static inline Float32x4 v_dup(double x) { return vdupq_n_f32(float(x)); } static inline Float32x4 v_dup(float x) { return vdupq_n_f32(x); } static inline Int32x4 v_dup(int x) { return vdupq_n_s32(x); } static inline Int32x4 v_dup(uint x) { return vdupq_n_s32(x); } From d8bf317546bcfab0b6b50375218429fa9d470705 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 1 Oct 2013 12:34:20 +0200 Subject: [PATCH 131/494] make qreal double by default on all platforms On modern ARM CPUs there is no speed difference between float and double anymore, so let's rather use double for qreal to avoid rounding and precision issues. Like this we also get much better compatibility with our desktop OSes. This is not binary compatible on ARM, but the old behavior can be restored by passing -qreal float to configure. Change-Id: I2a4b61e19a3dfa6b0bd76734cecf2634c97207fc Reviewed-by: Thiago Macieira --- configure | 16 ++++++++++++++++ dist/changes-5.2.0 | 11 +++++++++++ src/corelib/global/qglobal.h | 3 --- tools/configure/configureapp.cpp | 12 ++++++++++++ 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/configure b/configure index b5e375baedb..4adaa774030 100755 --- a/configure +++ b/configure @@ -1006,6 +1006,7 @@ QPA_PLATFORM_GUARD=yes CFG_CXX11=auto CFG_DIRECTWRITE=no CFG_WERROR=auto +CFG_QREAL=double OPT_MAC_SDK= # initalize variables used for installation @@ -1168,6 +1169,7 @@ while [ "$#" -gt 0 ]; do -mysql_config| \ -qpa| \ -qconfig| \ + -qreal| \ -android-sdk| \ -android-ndk| \ -android-ndk-platform| \ @@ -1419,6 +1421,9 @@ while [ "$#" -gt 0 ]; do qconfig) CFG_QCONFIG="$VAL" ;; + qreal) + CFG_QREAL="$VAL" + ;; sysroot) CFG_SYSROOT="$VAL" ;; @@ -3699,6 +3704,9 @@ Additional options: -qconfig local ...... Use src/corelib/global/qconfig-local.h rather than the default ($CFG_QCONFIG). + -qreal [double|float] typedef qreal to the specified type. The default is double. + Note that changing this flag affects binary compatibility. + -no-opengl .......... Do not support OpenGL. -opengl ....... Enable OpenGL support With no parameter, this will attempt to auto-detect @@ -6356,6 +6364,10 @@ if [ "$CFG_LARGEFILE" = "yes" ] && [ "$XPLATFORM_MINGW" != "yes" ]; then echo "#define QT_LARGEFILE_SUPPORT 64" >>"$outpath/src/corelib/global/qconfig.h.new" fi +if [ "$CFG_QREAL" != double ]; then + echo "#define QT_COORD_TYPE $CFG_QREAL" >>"$outpath/src/corelib/global/qconfig.h.new" +fi + if [ "$CFG_FRAMEWORK" = "yes" ]; then echo "#define QT_MAC_FRAMEWORK_BUILD" >>"$outpath/src/corelib/global/qconfig.h.new" fi @@ -6960,6 +6972,10 @@ if [ "$ORIG_CFG_XKBCOMMON" != qt ] && [ "$CFG_XKBCOMMON" = qt ]; then echo "NOTE: libxkbcommon 0.2.0 (or higher) not found on the system, will use " echo "the bundled version from 3rd party directory." fi +if [ "$CFG_QREAL" = double ] && [ "$CFG_ARCH" = arm ]; then + echo "NOTE: Qt is using double for qreal on this system. This is binary incompatible against Qt 5.1." + echo "Configure with '-qreal float' to create a build that is binary compatible with 5.1." +fi exec 1>&3 3>&- # restore stdout cat $outpath/config.summary # display config feedback to user diff --git a/dist/changes-5.2.0 b/dist/changes-5.2.0 index 1eda87b553a..c0db0f28f91 100644 --- a/dist/changes-5.2.0 +++ b/dist/changes-5.2.0 @@ -15,10 +15,21 @@ corresponding to tasks in the Qt Bug Tracker: Each of these identifiers can be entered in the bug tracker to obtain more information about a particular change. +**************************************************************************** +* Architecture Specific Changes * +**************************************************************************** + +Qt is now compiled with qreal typedef'ed to double on all platforms. qreal +was a float on ARM chipsets before. This guarantees more consistent behavior +between all platforms Qt supports, but is binary incompatible to Qt 5.1 +on ARM. The old behavior can be restored by passing -qreal float to +configure. + **************************************************************************** * Library * **************************************************************************** + QtWidgets --------- diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 0fd9bab9790..5bb675728a8 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -213,11 +213,8 @@ typedef unsigned int uint; typedef unsigned long ulong; QT_END_INCLUDE_NAMESPACE -// This logic must match the one in qmetatype.h #if defined(QT_COORD_TYPE) typedef QT_COORD_TYPE qreal; -#elif defined(QT_NO_FPU) || defined(Q_PROCESSOR_ARM) || defined(Q_OS_WINCE) -typedef float qreal; #else typedef double qreal; #endif diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 5d4ce84941a..4c323a35405 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -196,6 +196,7 @@ Configure::Configure(int& argc, char** argv) dictionary[ "SLOG2" ] = "no"; dictionary[ "SYSTEM_PROXIES" ] = "no"; dictionary[ "WERROR" ] = "auto"; + dictionary[ "QREAL" ] = "double"; //Only used when cross compiling. dictionary[ "QT_INSTALL_SETTINGS" ] = "/etc/xdg"; @@ -418,6 +419,12 @@ void Configure::parseCmdLine() break; dictionary[ "QCONFIG" ] = configCmdLine.at(i); } + else if (configCmdLine.at(i) == "-qreal") { + ++i; + if (i == argCount) + break; + dictionary[ "QREAL" ] = configCmdLine.at(i); + } else if (configCmdLine.at(i) == "-release") { dictionary[ "BUILD" ] = "release"; @@ -1876,6 +1883,9 @@ bool Configure::displayHelp() desc("PROCESS", "full", "-fully-process", "Generate Makefiles/Project files for the entire Qt\ntree."); desc("PROCESS", "no", "-dont-process", "Do not generate Makefiles/Project files.\n"); + desc( "-qreal [double|float]", "typedef qreal to the specified type. The default is double.\n" + "Note that changing this flag affects binary compatibility.\n"); + desc("RTTI", "no", "-no-rtti", "Do not compile runtime type information."); desc("RTTI", "yes", "-rtti", "Compile runtime type information."); desc("STRIP", "no", "-no-strip", "Do not strip libraries and executables of debug info when installing."); @@ -3298,6 +3308,8 @@ void Configure::generateConfigfiles() if (dictionary[ "NEON" ] == "yes") tmpStream << "#define QT_COMPILER_SUPPORTS_NEON" << endl; + if (dictionary["QREAL"] != "double") + tmpStream << "#define QT_COORD_TYPE " << dictionary["QREAL"] << endl; tmpStream << endl << "// Compile time features" << endl; From a1bc2921a44409736a8b8576243a0c9129d7683b Mon Sep 17 00:00:00 2001 From: Sune Vuorela Date: Sun, 27 Oct 2013 14:10:06 +0100 Subject: [PATCH 132/494] Provide a fallback for QT_STAT_LNK on windows In most cases, _S_IFLNK isn't defined, but ensure that we still have a QT_STAT_LNK that works, for example for use around archive files (zip/tar) that can contain symlinks Change-Id: I9881e524b79845ce6b474b9a86e5fb25aaa31820 Reviewed-by: Friedemann Kleint Reviewed-by: David Faure --- mkspecs/win32-msvc2005/qplatformdefs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkspecs/win32-msvc2005/qplatformdefs.h b/mkspecs/win32-msvc2005/qplatformdefs.h index c6feb4895d6..c7370f1c63d 100644 --- a/mkspecs/win32-msvc2005/qplatformdefs.h +++ b/mkspecs/win32-msvc2005/qplatformdefs.h @@ -81,6 +81,8 @@ #define QT_STAT_MASK _S_IFMT #if defined(_S_IFLNK) # define QT_STAT_LNK _S_IFLNK +#else +# define QT_STAT_LNK 0120000 #endif #define QT_FILENO _fileno #define QT_OPEN ::_open From cfa85c76c7c7e1622cb02edcbbc3d948edca1e7f Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 29 Oct 2013 23:10:15 +0100 Subject: [PATCH 133/494] QWindowPrivate: add virtual function 'clearFocusObject' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On mobile platforms, a line edit should only have keyboard focus when the virtual keyboard is open. As it stands, the only way to clear focus when the user hides the keyboard, is to deactivate the whole window. This is a bit too much, since Qt still expects the window in front to be active/focused. What we need is a way to remove focus from the current focus object without disturbing the state of the window. QWindow has a virtual function 'focusObject' from before. We now add a virtual function 'clearFocusObject' to QWindowPrivate that can be overridden by QWidgetWindowPrivate and QQuickWindowPrivate. That way we can remove focus from current focus object when the virtual keyboard is closed from the platform plugins. Change-Id: Ica4ec76f8a69cd6107236a8000ff8bd742e988b5 Reviewed-by: Tor Arne Vestbø Reviewed-by: Friedemann Kleint Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: Gunnar Sletta --- src/gui/kernel/qwindow.cpp | 4 ++++ src/gui/kernel/qwindow_p.h | 2 ++ src/widgets/kernel/qwidgetwindow.cpp | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 13218fa178e..a3841d3cfb4 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -367,6 +367,10 @@ void QWindowPrivate::setScreen(QScreen *newScreen, bool recreate) } } +void QWindowPrivate::clearFocusObject() +{ +} + /*! Sets the \a surfaceType of the window. diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h index f43c1ea8ec7..8d8fca3ce62 100644 --- a/src/gui/kernel/qwindow_p.h +++ b/src/gui/kernel/qwindow_p.h @@ -129,6 +129,8 @@ public: void setScreen(QScreen *newScreen, bool recreate); + virtual void clearFocusObject(); + QWindow::SurfaceType surfaceType; Qt::WindowFlags windowFlags; QWindow *parentWindow; diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 51a0eb7d727..e977ab3d6fe 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -76,6 +76,13 @@ public: } return w; } + + void clearFocusObject() + { + if (QApplicationPrivate::focus_widget) + QApplicationPrivate::focus_widget->clearFocus(); + } + }; QWidgetWindow::QWidgetWindow(QWidget *widget) From eb64c765e3aa37da1373360c557e23aa29a2db48 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 30 Oct 2013 09:36:44 +0100 Subject: [PATCH 134/494] iOS: clear focus object when resigning first responder status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of deactivating the window when we resign first responder status, we now leave it focused, and tell it to clear its focus object instead. This will work better with the rest of Qt, which expects a window to have focus when its in front. Change-Id: I6fcc232467af306b791a834f4843bfd2786b206f Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qioswindow.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index dbeec5f5f29..74a56b0934d 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -48,6 +48,7 @@ #include "qiosviewcontroller.h" #include "qiosintegration.h" #include +#include #include #import @@ -256,7 +257,10 @@ - (BOOL)resignFirstResponder { - QWindowSystemInterface::handleWindowActivated(0); + // Resigning first responed status means that the virtual keyboard was closed, or + // some other view became first responder. In either case we clear the focus object to + // avoid blinking cursors in line edits etc: + static_cast(QObjectPrivate::get(m_qioswindow->window()))->clearFocusObject(); return [super resignFirstResponder]; } From fecc820c582f604babbbaabb86ecd0c1f51c3487 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 28 Oct 2013 12:50:59 +0100 Subject: [PATCH 135/494] iOS: bugfix touch events when not using alien MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems that 130ee40b broke touch handling for non-alien QWindows. For those cases, a QWindow that is a child of another QWindow will get its own UIView to back it up. The current code did not take this into account when calculating the global coordinates of touch events. Instead we need to search for the top level QWindow it might be inside before we find the view that acts as the "desktop" for it. Change-Id: Ie3c19bf86c92fa3f247a0764116830e91b8322d2 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qioswindow.mm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 74a56b0934d..5a2a1122ecb 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -151,9 +151,16 @@ - (void)updateTouchList:(NSSet *)touches withState:(Qt::TouchPointState)state { - // We deliver touch events with global coordinates. But global in this respect means - // the coordinate system where this QWindow lives. And that is our superview. - CGSize parentSize = self.superview.frame.size; + // We deliver touch events in global coordinates. But global in this respect + // means the same coordinate system that we use for describing the geometry + // of the top level QWindow we're inside. And that would be the coordinate + // system of the superview of the UIView that backs that window: + QPlatformWindow *topLevel = m_qioswindow; + while (QPlatformWindow *topLevelParent = topLevel->parent()) + topLevel = topLevelParent; + UIView *rootView = reinterpret_cast(topLevel->winId()).superview; + CGSize rootViewSize = rootView.frame.size; + foreach (UITouch *uiTouch, m_activeTouches.keys()) { QWindowSystemInterface::TouchPoint &touchPoint = m_activeTouches[uiTouch]; if (![touches containsObject:uiTouch]) { @@ -161,9 +168,9 @@ } else { touchPoint.state = state; touchPoint.pressure = (state == Qt::TouchPointReleased) ? 0.0 : 1.0; - QPoint touchPos = fromCGPoint([uiTouch locationInView:self.superview]); + QPoint touchPos = fromCGPoint([uiTouch locationInView:rootView]); touchPoint.area = QRectF(touchPos, QSize(0, 0)); - touchPoint.normalPosition = QPointF(touchPos.x() / parentSize.width, touchPos.y() / parentSize.height); + touchPoint.normalPosition = QPointF(touchPos.x() / rootViewSize.width, touchPos.y() / rootViewSize.height); } } } From d0f8ba748e4ee93b4b2a205421a0340b2d146ce5 Mon Sep 17 00:00:00 2001 From: Andreas Holzammer Date: Thu, 31 Oct 2013 13:31:11 +0100 Subject: [PATCH 136/494] Don't build ANGLE while xcompile for QNX Change-Id: Iacc0f4bb776943b21a94b52417a77112facad20f Reviewed-by: Wolfgang Bremer Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 4c323a35405..35231aecd25 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1647,6 +1647,7 @@ void Configure::applySpecSpecifics() dictionary["STACK_PROTECTOR_STRONG"] = "auto"; dictionary["SLOG2"] = "auto"; dictionary["QT_XKBCOMMON"] = "no"; + dictionary[ "ANGLE" ] = "no"; } else if (platform() == ANDROID) { dictionary[ "REDUCE_EXPORTS" ] = "yes"; dictionary[ "BUILD" ] = "release"; From d1114669e301e35cc4e9b2e4c8c4b9476180fb56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 9 Oct 2013 08:43:34 +0200 Subject: [PATCH 137/494] Cocoa: Improve cursor setting. Implement cursor setting in terms of [NSCursor set] and [NSView cursorUpdate] using the window tracking area. Refactor cursor conversion into QCocoaCursor:: convertCursor. Rename QCoocaWindow::m_underMouseWindow to m_enterLeaveTargetWindow since it's set according to spesific enter/leave logic. Add m_windowUnderMouse which tracks mouseEntered/mouseExited state. Task-number: QTBUG-33961 Change-Id: Id5e12594f5db365e09c9926a4c08d748a9afb935 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoacursor.h | 5 +- src/plugins/platforms/cocoa/qcocoacursor.mm | 125 +++++++++++--------- src/plugins/platforms/cocoa/qcocoawindow.h | 6 +- src/plugins/platforms/cocoa/qcocoawindow.mm | 19 +++ src/plugins/platforms/cocoa/qnsview.mm | 27 +++-- 5 files changed, 113 insertions(+), 69 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoacursor.h b/src/plugins/platforms/cocoa/qcocoacursor.h index dfa1fcff817..f3322407249 100644 --- a/src/plugins/platforms/cocoa/qcocoacursor.h +++ b/src/plugins/platforms/cocoa/qcocoacursor.h @@ -55,12 +55,13 @@ public: QCocoaCursor(); ~QCocoaCursor(); - virtual void changeCursor(QCursor * widgetCursor, QWindow * widget); + virtual void changeCursor(QCursor *cursor, QWindow *window); virtual QPoint pos() const; virtual void setPos(const QPoint &position); private: QHash m_cursors; - NSCursor *createCursorData(QCursor *); + NSCursor *convertCursor(QCursor *cursor); + NSCursor *createCursorData(QCursor * cursor); NSCursor *createCursorFromBitmap(const QBitmap *bitmap, const QBitmap *mask, const QPoint hotspot = QPoint()); NSCursor *createCursorFromPixmap(const QPixmap pixmap, const QPoint hotspot = QPoint()); }; diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm index d734c36d6f5..13f6423701f 100644 --- a/src/plugins/platforms/cocoa/qcocoacursor.mm +++ b/src/plugins/platforms/cocoa/qcocoacursor.mm @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qcocoacursor.h" +#include "qcocoawindow.h" #include "qcocoahelpers.h" #include "qcocoaautoreleasepool.h" @@ -63,65 +64,10 @@ QCocoaCursor::~QCocoaCursor() void QCocoaCursor::changeCursor(QCursor *cursor, QWindow *window) { - Q_UNUSED(window); + NSCursor * cocoaCursor = convertCursor(cursor); - const Qt::CursorShape newShape = cursor ? cursor->shape() : Qt::ArrowCursor; - // Check for a suitable built-in NSCursor first: - switch (newShape) { - case Qt::ArrowCursor: - [[NSCursor arrowCursor] set]; - break; - case Qt::CrossCursor: - [[NSCursor crosshairCursor] set]; - break; - case Qt::IBeamCursor: - [[NSCursor IBeamCursor] set]; - break; - case Qt::WhatsThisCursor: //for now just use the pointing hand - case Qt::PointingHandCursor: - [[NSCursor pointingHandCursor] set]; - break; - case Qt::SplitVCursor: - [[NSCursor resizeUpDownCursor] set]; - break; - case Qt::SplitHCursor: - [[NSCursor resizeLeftRightCursor] set]; - break; - case Qt::OpenHandCursor: - [[NSCursor openHandCursor] set]; - break; - case Qt::ClosedHandCursor: - [[NSCursor closedHandCursor] set]; - break; - case Qt::DragMoveCursor: - [[NSCursor crosshairCursor] set]; - break; - case Qt::DragCopyCursor: - [[NSCursor crosshairCursor] set]; - break; - case Qt::DragLinkCursor: - [[NSCursor dragLinkCursor] set]; - break; - default : { - // No suitable OS cursor exist, use cursors provided - // by Qt for the rest. Check for a cached cursor: - NSCursor *cocoaCursor = m_cursors.value(newShape); - if (cocoaCursor && cursor->shape() == Qt::BitmapCursor) { - [cocoaCursor release]; - cocoaCursor = 0; - } - if (cocoaCursor == 0) { - cocoaCursor = createCursorData(cursor); - if (cocoaCursor == 0) { - [[NSCursor arrowCursor] set]; - return; - } - m_cursors.insert(newShape, cocoaCursor); - } - - [cocoaCursor set]; - break; } - } + if (QPlatformWindow * platformWindow = window->handle()) + static_cast(platformWindow)->setWindowCursor(cocoaCursor); } QPoint QCocoaCursor::pos() const @@ -140,6 +86,69 @@ void QCocoaCursor::setPos(const QPoint &position) CFRelease(e); } +NSCursor *QCocoaCursor::convertCursor(QCursor * cursor) +{ + const Qt::CursorShape newShape = cursor ? cursor->shape() : Qt::ArrowCursor; + NSCursor *cocoaCursor; + + // Check for a suitable built-in NSCursor first: + switch (newShape) { + case Qt::ArrowCursor: + cocoaCursor= [NSCursor arrowCursor]; + break; + case Qt::CrossCursor: + cocoaCursor = [NSCursor crosshairCursor]; + break; + case Qt::IBeamCursor: + cocoaCursor = [NSCursor IBeamCursor]; + break; + case Qt::WhatsThisCursor: //for now just use the pointing hand + case Qt::PointingHandCursor: + cocoaCursor = [NSCursor pointingHandCursor]; + break; + case Qt::SplitVCursor: + cocoaCursor = [NSCursor resizeUpDownCursor]; + break; + case Qt::SplitHCursor: + cocoaCursor = [NSCursor resizeLeftRightCursor]; + break; + case Qt::OpenHandCursor: + cocoaCursor = [NSCursor openHandCursor]; + break; + case Qt::ClosedHandCursor: + cocoaCursor = [NSCursor closedHandCursor]; + break; + case Qt::DragMoveCursor: + cocoaCursor = [NSCursor crosshairCursor]; + break; + case Qt::DragCopyCursor: + cocoaCursor = [NSCursor crosshairCursor]; + break; + case Qt::DragLinkCursor: + cocoaCursor = [NSCursor dragLinkCursor]; + break; + default : { + // No suitable OS cursor exist, use cursors provided + // by Qt for the rest. Check for a cached cursor: + cocoaCursor = m_cursors.value(newShape); + if (cocoaCursor && cursor->shape() == Qt::BitmapCursor) { + [cocoaCursor release]; + cocoaCursor = 0; + } + if (cocoaCursor == 0) { + cocoaCursor = createCursorData(cursor); + if (cocoaCursor == 0) + return [NSCursor arrowCursor]; + + m_cursors.insert(newShape, cocoaCursor); + } + + break; } + } + return cocoaCursor; +} + + // Creates an NSCursor for the given QCursor. NSCursor *QCocoaCursor::createCursorData(QCursor *cursor) { diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h index 7f0f07e912c..4f5a208f439 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -154,6 +154,8 @@ public: void setMenubar(QCocoaMenuBar *mb); QCocoaMenuBar *menubar() const; + void setWindowCursor(NSCursor *cursor); + void registerTouch(bool enable); qreal devicePixelRatio() const; @@ -190,11 +192,13 @@ public: // for QNSView Qt::WindowState m_synchedWindowState; Qt::WindowModality m_windowModality; QPointer m_activePopupWindow; - QPointer m_underMouseWindow; + QPointer m_enterLeaveTargetWindow; + bool m_windowUnderMouse; bool m_inConstructor; QCocoaGLContext *m_glContext; QCocoaMenuBar *m_menubar; + NSCursor *m_windowCursor; bool m_hasModalSession; bool m_frameStrutEventsEnabled; diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 845cc1202f2..565594a98a5 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -206,9 +206,11 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw) , m_nsWindowDelegate(0) , m_synchedWindowState(Qt::WindowActive) , m_windowModality(Qt::NonModal) + , m_windowUnderMouse(false) , m_inConstructor(true) , m_glContext(0) , m_menubar(0) + , m_windowCursor(0) , m_hasModalSession(false) , m_frameStrutEventsEnabled(false) , m_isExposed(false) @@ -1030,6 +1032,23 @@ QCocoaMenuBar *QCocoaWindow::menubar() const return m_menubar; } +void QCocoaWindow::setWindowCursor(NSCursor *cursor) +{ + // This function is called (via QCocoaCursor) by Qt to set + // the cursor for this window. It can be called for a window + // that is not currenly under the mouse pointer (for example + // for a popup window.) Qt expects the set cursor to "stick": + // it should be accociated with the window until a different + // cursor is set. + + // Cocoa has different abstractions. We can set the cursor *now*: + if (m_windowUnderMouse) + [cursor set]; + // or we can set the cursor on mouse enter/leave using tracking + // areas. This is done in QNSView, save the cursor: + m_windowCursor = cursor; +} + void QCocoaWindow::registerTouch(bool enable) { m_registerTouchCount += enable ? 1 : -1; diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 8f839384dfa..71c4de3b69e 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -671,7 +671,7 @@ static QTouchDevice *touchDevice = 0; // mouse moves delivered to it (Apple recommends keeping it OFF because there // is a performance hit). So it goes. NSUInteger trackingOptions = NSTrackingMouseEnteredAndExited | NSTrackingActiveInActiveApp - | NSTrackingInVisibleRect | NSTrackingMouseMoved; + | NSTrackingInVisibleRect | NSTrackingMouseMoved | NSTrackingCursorUpdate; NSTrackingArea *ta = [[[NSTrackingArea alloc] initWithRect:[self frame] options:trackingOptions owner:self @@ -680,6 +680,13 @@ static QTouchDevice *touchDevice = 0; [self addTrackingArea:ta]; } +-(void)cursorUpdate:(NSEvent *)theEvent +{ + Q_UNUSED(theEvent) + if (m_platformWindow->m_windowCursor) + [m_platformWindow->m_windowCursor set]; +} + - (void)mouseMoved:(NSEvent *)theEvent { if (m_window->flags() & Qt::WindowTransparentForInput) @@ -696,9 +703,9 @@ static QTouchDevice *touchDevice = 0; // handling mouseEnter and mouseLeave envents, since they are sent // individually to different views. if (m_platformWindow->m_nsWindow && childWindow) { - if (childWindow != m_platformWindow->m_underMouseWindow) { - QWindowSystemInterface::handleEnterLeaveEvent(childWindow, m_platformWindow->m_underMouseWindow, windowPoint, screenPoint); - m_platformWindow->m_underMouseWindow = childWindow; + if (childWindow != m_platformWindow->m_enterLeaveTargetWindow) { + QWindowSystemInterface::handleEnterLeaveEvent(childWindow, m_platformWindow->m_enterLeaveTargetWindow, windowPoint, screenPoint); + m_platformWindow->m_enterLeaveTargetWindow = childWindow; } } @@ -712,6 +719,8 @@ static QTouchDevice *touchDevice = 0; - (void)mouseEntered:(NSEvent *)theEvent { + m_platformWindow->m_windowUnderMouse = true; + if (m_window->flags() & Qt::WindowTransparentForInput) return [super mouseEntered:theEvent]; @@ -722,12 +731,14 @@ static QTouchDevice *touchDevice = 0; QPointF windowPoint; QPointF screenPoint; [self convertFromScreen:[NSEvent mouseLocation] toWindowPoint:&windowPoint andScreenPoint:&screenPoint]; - m_platformWindow->m_underMouseWindow = m_platformWindow->childWindowAt(windowPoint.toPoint()); - QWindowSystemInterface::handleEnterEvent(m_platformWindow->m_underMouseWindow, windowPoint, screenPoint); + m_platformWindow->m_enterLeaveTargetWindow = m_platformWindow->childWindowAt(windowPoint.toPoint()); + QWindowSystemInterface::handleEnterEvent(m_platformWindow->m_enterLeaveTargetWindow, windowPoint, screenPoint); } - (void)mouseExited:(NSEvent *)theEvent { + m_platformWindow->m_windowUnderMouse = false; + if (m_window->flags() & Qt::WindowTransparentForInput) return [super mouseExited:theEvent]; Q_UNUSED(theEvent); @@ -736,8 +747,8 @@ static QTouchDevice *touchDevice = 0; if (!m_platformWindow->m_nsWindow) return; - QWindowSystemInterface::handleLeaveEvent(m_platformWindow->m_underMouseWindow); - m_platformWindow->m_underMouseWindow = 0; + QWindowSystemInterface::handleLeaveEvent(m_platformWindow->m_enterLeaveTargetWindow); + m_platformWindow->m_enterLeaveTargetWindow = 0; } - (void)rightMouseDown:(NSEvent *)theEvent From b7440536c788b04861591187edd071bf2c2ec137 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Thu, 31 Oct 2013 18:00:30 +0200 Subject: [PATCH 138/494] Android: Handle virtual keyboard visibility changes. emitInputPanelVisibleChanged when virtual keyboard visibility is changed. Task-number: QTBUG-34347 Change-Id: Iab7374db42ff8ce6f33dcc793b23f84d3c8692d5 Reviewed-by: Paul Olav Tvete --- .../qt5/android/QtActivityDelegate.java | 47 +++++------ .../org/qtproject/qt5/android/QtEditText.java | 13 ++- .../qt5/android/QtInputConnection.java | 80 ++++++++++++++----- .../org/qtproject/qt5/android/QtNative.java | 22 ++--- .../platforms/android/src/androidjniinput.cpp | 31 ++++++- .../android/src/qandroidinputcontext.cpp | 5 ++ .../android/src/qandroidinputcontext.h | 1 + 7 files changed, 133 insertions(+), 66 deletions(-) diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index 1f994404286..82533dc9cba 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -42,13 +42,6 @@ package org.qtproject.qt5.android; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Iterator; - import android.app.Activity; import android.content.Context; import android.content.pm.PackageManager; @@ -68,11 +61,18 @@ import android.view.KeyCharacterMap; import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; +import android.view.Surface; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.view.inputmethod.InputMethodManager; -import android.view.Surface; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Iterator; public class QtActivityDelegate { @@ -111,7 +111,7 @@ public class QtActivityDelegate private boolean m_quitApp = true; private Process m_debuggerProcess = null; // debugger process - public boolean m_keyboardIsVisible = false; + private boolean m_keyboardIsVisible = false; public boolean m_backKeyPressedSent = false; @@ -176,6 +176,13 @@ public class QtActivityDelegate private final int ApplicationInactive = 0x2; private final int ApplicationActive = 0x4; + public void setKeyboardVisibility(boolean visibility) + { + if (m_keyboardIsVisible == visibility) + return; + m_keyboardIsVisible = visibility; + QtNative.keyboardVisibilityChanged(m_keyboardIsVisible); + } public void resetSoftwareKeyboard() { if (m_imm == null) @@ -256,27 +263,21 @@ public class QtActivityDelegate m_editText.postDelayed(new Runnable() { @Override public void run() { - m_imm.showSoftInput(m_editText, 0, new ResultReceiver( new Handler()){ + m_imm.showSoftInput(m_editText, 0, new ResultReceiver(new Handler()) { @Override protected void onReceiveResult(int resultCode, Bundle resultData) { switch (resultCode) { case InputMethodManager.RESULT_SHOWN: case InputMethodManager.RESULT_UNCHANGED_SHOWN: - m_keyboardIsVisible = true; + setKeyboardVisibility(true); break; case InputMethodManager.RESULT_HIDDEN: case InputMethodManager.RESULT_UNCHANGED_HIDDEN: - m_keyboardIsVisible = false; + setKeyboardVisibility(false); break; } } - }) ; - m_editText.postDelayed(new Runnable() { - @Override - public void run() { - m_imm.restartInput(m_editText); - } - }, 25); + }); } }, 15); } @@ -291,11 +292,11 @@ public class QtActivityDelegate switch (resultCode) { case InputMethodManager.RESULT_SHOWN: case InputMethodManager.RESULT_UNCHANGED_SHOWN: - m_keyboardIsVisible = true; + setKeyboardVisibility(true); break; case InputMethodManager.RESULT_HIDDEN: case InputMethodManager.RESULT_UNCHANGED_HIDDEN: - m_keyboardIsVisible = false; + setKeyboardVisibility(false); break; } } @@ -612,7 +613,7 @@ public class QtActivityDelegate } m_layout = new QtLayout(m_activity); m_surface = new QtSurface(m_activity, 0); - m_editText = new QtEditText(m_activity); + m_editText = new QtEditText(m_activity, this); m_imm = (InputMethodManager)m_activity.getSystemService(Context.INPUT_METHOD_SERVICE); m_layout.addView(m_surface,0); m_activity.setContentView(m_layout, @@ -770,7 +771,7 @@ public class QtActivityDelegate if (keyCode == KeyEvent.KEYCODE_BACK && !m_backKeyPressedSent) { hideSoftwareKeyboard(); - m_keyboardIsVisible = false; + setKeyboardVisibility(false); return true; } diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtEditText.java b/src/android/jar/src/org/qtproject/qt5/android/QtEditText.java index b95e0c070cb..7e3ebb539ad 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtEditText.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtEditText.java @@ -50,10 +50,10 @@ import android.view.inputmethod.InputConnection; public class QtEditText extends View { - QtInputConnection m_inputConnection; int m_initialCapsMode = 0; int m_imeOptions = 0; int m_inputType = InputType.TYPE_CLASS_TEXT; + QtActivityDelegate m_activityDelegate; public void setImeOptions(int m_imeOptions) { @@ -71,12 +71,16 @@ public class QtEditText extends View this.m_inputType = m_inputType; } - public QtEditText(Context context) + public QtEditText(Context context, QtActivityDelegate activityDelegate) { super(context); setFocusable(true); setFocusableInTouchMode(true); - m_inputConnection = new QtInputConnection(this); + m_activityDelegate = activityDelegate; + } + public QtActivityDelegate getActivityDelegate() + { + return m_activityDelegate; } @Override @@ -86,8 +90,9 @@ public class QtEditText extends View outAttrs.imeOptions = m_imeOptions; outAttrs.initialCapsMode = m_initialCapsMode; outAttrs.imeOptions |= EditorInfo.IME_FLAG_NO_EXTRACT_UI; - return m_inputConnection; + return new QtInputConnection(this); } + // // DEBUG CODE // @Override // protected void onDraw(Canvas canvas) { diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java b/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java index f28ea3be83d..4b2d50ca1f2 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtInputConnection.java @@ -43,7 +43,6 @@ package org.qtproject.qt5.android; import android.content.Context; -import android.view.View; import android.view.inputmethod.BaseInputConnection; import android.view.inputmethod.CompletionInfo; import android.view.inputmethod.ExtractedText; @@ -81,6 +80,22 @@ class QtNativeInputConnection static native boolean paste(); } +class HideKeyboardRunnable implements Runnable { + private QtInputConnection m_connection; + HideKeyboardRunnable(QtInputConnection connection) + { + m_connection = connection; + } + + @Override + public void run() { + if (m_connection.getInputState() == QtInputConnection.InputStates.Hiding) { + QtNative.activityDelegate().setKeyboardVisibility(false); + m_connection.reset(); + } + } +} + public class QtInputConnection extends BaseInputConnection { private static final int ID_SELECT_ALL = android.R.id.selectAll; @@ -91,65 +106,83 @@ public class QtInputConnection extends BaseInputConnection private static final int ID_SWITCH_INPUT_METHOD = android.R.id.switchInputMethod; private static final int ID_ADD_TO_DICTIONARY = android.R.id.addToDictionary; - View m_view; - boolean m_closing; - public QtInputConnection(View targetView) + + enum InputStates { Visible, FinishComposing, Hiding }; + + private QtEditText m_view = null; + private InputStates m_inputState = InputStates.Visible; + + public void reset() + { + m_inputState = InputStates.Visible; + } + + public InputStates getInputState() + { + return m_inputState; + } + + private void setClosing(boolean closing) + { + if (closing && m_inputState == InputStates.Hiding) + return; + + if (closing && m_inputState == InputStates.FinishComposing && m_view.getActivityDelegate().isSoftwareKeyboardVisible()) { + m_view.postDelayed(new HideKeyboardRunnable(this), 100); + m_inputState = InputStates.Hiding; + } else { + if (m_inputState == InputStates.Hiding) + QtNative.activityDelegate().setKeyboardVisibility(true); + m_inputState = closing ? InputStates.FinishComposing : InputStates.Visible; + } + } + + public QtInputConnection(QtEditText targetView) { super(targetView, true); m_view = targetView; - m_closing = false; } @Override public boolean beginBatchEdit() { - m_closing = false; + setClosing(false); return true; } @Override public boolean endBatchEdit() { - m_closing = false; +// setClosing(false); return true; } @Override public boolean commitCompletion(CompletionInfo text) { - m_closing = false; + setClosing(false); return QtNativeInputConnection.commitCompletion(text.getText().toString(), text.getPosition()); } @Override public boolean commitText(CharSequence text, int newCursorPosition) { - m_closing = false; + setClosing(false); return QtNativeInputConnection.commitText(text.toString(), newCursorPosition); } @Override public boolean deleteSurroundingText(int leftLength, int rightLength) { - m_closing = false; + setClosing(false); return QtNativeInputConnection.deleteSurroundingText(leftLength, rightLength); } @Override public boolean finishComposingText() { - if (m_closing) { - m_view.postDelayed(new Runnable() { - @Override - public void run() { - QtNative.activityDelegate().m_keyboardIsVisible=false; - } - }, 100); // it seems finishComposingText comes much faster than onKeyUp event, - // so we must delay hide notification - m_closing = false; - } else { - m_closing = true; - } + // on some/all android devices hide event is not coming, but instead finishComposingText() is called twice + setClosing(true); return QtNativeInputConnection.finishComposingText(); } @@ -231,18 +264,21 @@ public class QtInputConnection extends BaseInputConnection @Override public boolean setComposingText(CharSequence text, int newCursorPosition) { + setClosing(false); return QtNativeInputConnection.setComposingText(text.toString(), newCursorPosition); } @Override public boolean setComposingRegion(int start, int end) { + setClosing(false); return QtNativeInputConnection.setComposingRegion(start, end); } @Override public boolean setSelection(int start, int end) { + setClosing(false); return QtNativeInputConnection.setSelection(start, end); } } diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java index b37f1e87fd2..67093a007e6 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -418,30 +418,21 @@ public class QtNative private static boolean isSoftwareKeyboardVisible() { - Semaphore semaphore = new Semaphore(1); - Boolean ret = false; - class RunnableRes implements Runnable { - @SuppressWarnings("unused") - Boolean returnValue = null; - Semaphore semaphore = null; - RunnableRes(Boolean ret, Semaphore sem) { - semaphore = sem; - returnValue = ret; - } + final Semaphore semaphore = new Semaphore(0); + final Boolean[] ret = {false}; + runAction(new Runnable() { @Override public void run() { - returnValue = m_activityDelegate.isSoftwareKeyboardVisible(); + ret[0] = m_activityDelegate.isSoftwareKeyboardVisible(); semaphore.release(); } - } - - runAction(new RunnableRes(ret, semaphore)); + }); try { semaphore.acquire(); } catch (Exception e) { e.printStackTrace(); } - return ret; + return ret[0]; } private static void setFullScreen(final boolean fullScreen) @@ -568,6 +559,7 @@ public class QtNative // keyboard methods public static native void keyDown(int key, int unicode, int modifier); public static native void keyUp(int key, int unicode, int modifier); + public static native void keyboardVisibilityChanged(boolean visibility); // keyboard methods // surface methods diff --git a/src/plugins/platforms/android/src/androidjniinput.cpp b/src/plugins/platforms/android/src/androidjniinput.cpp index 30d4e69afed..27d29129f8f 100644 --- a/src/plugins/platforms/android/src/androidjniinput.cpp +++ b/src/plugins/platforms/android/src/androidjniinput.cpp @@ -47,6 +47,10 @@ #include #include +#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL +# include +#endif + using namespace QtAndroid; namespace QtAndroidInput @@ -86,6 +90,9 @@ namespace QtAndroidInput width, height, inputHints); +#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL + qDebug() << "@@@ SHOWSOFTWAREKEYBOARD" << left << top << width << height << inputHints; +#endif } void resetSoftwareKeyboard() @@ -95,6 +102,9 @@ namespace QtAndroidInput return; env.jniEnv->CallStaticVoidMethod(applicationClass(), m_resetSoftwareKeyboardMethodID); +#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL + qDebug() << "@@@ RESETSOFTWAREKEYBOARD"; +#endif } void hideSoftwareKeyboard() @@ -104,6 +114,9 @@ namespace QtAndroidInput return; env.jniEnv->CallStaticVoidMethod(applicationClass(), m_hideSoftwareKeyboardMethodID); +#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL + qDebug() << "@@@ HIDESOFTWAREKEYBOARD"; +#endif } bool isSoftwareKeyboardVisible() @@ -112,7 +125,11 @@ namespace QtAndroidInput if (!env.jniEnv) return false; - return env.jniEnv->CallStaticBooleanMethod(applicationClass(), m_isSoftwareKeyboardVisibleMethodID); + bool visibility = env.jniEnv->CallStaticBooleanMethod(applicationClass(), m_isSoftwareKeyboardVisibleMethodID); +#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL + qDebug() << "@@@ ISSOFTWAREKEYBOARDVISIBLE" << visibility; +#endif + return visibility; } @@ -511,6 +528,15 @@ namespace QtAndroidInput false); } + static void keyboardVisibilityChanged(JNIEnv */*env*/, jobject /*thiz*/, jboolean /*visibility*/) + { + QAndroidInputContext *inputContext = QAndroidInputContext::androidInputContext(); + if (inputContext) + inputContext->emitInputPanelVisibleChanged(); +#ifdef QT_DEBUG_ANDROID_IM_PROTOCOL + qDebug() << "@@@ KEYBOARDVISIBILITYCHANGED" << inputContext; +#endif + } static JNINativeMethod methods[] = { {"touchBegin","(I)V",(void*)touchBegin}, @@ -521,7 +547,8 @@ namespace QtAndroidInput {"mouseMove", "(III)V", (void *)mouseMove}, {"longPress", "(III)V", (void *)longPress}, {"keyDown", "(III)V", (void *)keyDown}, - {"keyUp", "(III)V", (void *)keyUp} + {"keyUp", "(III)V", (void *)keyUp}, + {"keyboardVisibilityChanged", "(Z)V", (void *)keyboardVisibilityChanged} }; #define GET_AND_CHECK_STATIC_METHOD(VAR, CLASS, METHOD_NAME, METHOD_SIGNATURE) \ diff --git a/src/plugins/platforms/android/src/qandroidinputcontext.cpp b/src/plugins/platforms/android/src/qandroidinputcontext.cpp index 386c8e006a5..8556e8ebf13 100644 --- a/src/plugins/platforms/android/src/qandroidinputcontext.cpp +++ b/src/plugins/platforms/android/src/qandroidinputcontext.cpp @@ -381,6 +381,11 @@ QAndroidInputContext::~QAndroidInputContext() m_textFieldID = 0; } +QAndroidInputContext *QAndroidInputContext::androidInputContext() +{ + return m_androidInputContext; +} + void QAndroidInputContext::reset() { clear(); diff --git a/src/plugins/platforms/android/src/qandroidinputcontext.h b/src/plugins/platforms/android/src/qandroidinputcontext.h index d19dcc384b3..041bd0dc49d 100644 --- a/src/plugins/platforms/android/src/qandroidinputcontext.h +++ b/src/plugins/platforms/android/src/qandroidinputcontext.h @@ -80,6 +80,7 @@ public: public: QAndroidInputContext(); ~QAndroidInputContext(); + static QAndroidInputContext * androidInputContext(); bool isValid() const { return true; } void reset(); From 616b431a21595e9e8e968dca05e4df177f32e363 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Tue, 29 Oct 2013 13:23:59 +0100 Subject: [PATCH 139/494] Doc: Fixed footer style and information for offline builds. -footer is left aligned and smaller text. -footer contains fewer
which were not used. -CSS rules for footer changed to accommodate new specifications. -information not relevant in offline builds taken out. Task-number: QTBUG-33802 Change-Id: Icc57bad9ead8ce812d5df8e72a7bac8c22831b5f Reviewed-by: Sami Makkonen Reviewed-by: hjk --- doc/global/html-footer.qdocconf | 30 ++++++---------- doc/global/template/style/offline.css | 50 ++++++++++++--------------- 2 files changed, 33 insertions(+), 47 deletions(-) diff --git a/doc/global/html-footer.qdocconf b/doc/global/html-footer.qdocconf index 6c26dc7c29a..c53eb2f5999 100644 --- a/doc/global/html-footer.qdocconf +++ b/doc/global/html-footer.qdocconf @@ -7,24 +7,14 @@ HTML.footer = \ "
\n" \ "\n" \ "
\n" \ - "
\n" \ - "
\n" \ - "

\n" \ - " © 2013 Digia Plc and/or its\n" \ - " subsidiaries. Documentation contributions included herein are the copyrights of\n" \ - " their respective owners.

\n" \ - "

\n" \ - " The documentation provided herein is licensed under the terms of the\n" \ - " GNU Free Documentation\n" \ - " License version 1.3 as published by the Free Software Foundation.

\n" \ - "

\n" \ - " Documentation sources may be obtained from \n" \ - " www.qt-project.org.

\n" \ - "

\n" \ - " Digia, Qt and their respective logos are trademarks of Digia Plc \n" \ - " in Finland and/or other countries worldwide. All other trademarks are property\n" \ - " of their respective owners. Privacy Policy

\n" \ - "
\n" \ - "
\n" \ + "

\n" \ + " © 2013 Digia Plc and/or its\n" \ + " subsidiaries. Documentation contributions included herein are the copyrights of\n" \ + " their respective owners.
" \ + " The documentation provided herein is licensed under the terms of the" \ + " GNU Free Documentation" \ + " License version 1.3 as published by the Free Software Foundation.
" \ + " Digia, Qt and their respective logos are trademarks of Digia Plc " \ + " in Finland and/or other countries worldwide. All other trademarks are property\n" \ + " of their respective owners.

\n" \ "
\n" \ diff --git a/doc/global/template/style/offline.css b/doc/global/template/style/offline.css index 5dc4908aff6..81e11aac0bd 100644 --- a/doc/global/template/style/offline.css +++ b/doc/global/template/style/offline.css @@ -192,7 +192,29 @@ footer and license */ .footer { - text-align: center + text-align: left; + margin-top: 50px; + padding-left: 5px; + margin-bottom: 10px; + font-size: 10px; + border-top: 1px solid #999; + padding-top: 11px; +} + +.footer p { + line-height: 14px; + font-size: 11px; +} + +.footer a[href*="http://"], a[href*="ftp://"], a[href*="https://"] { + font-weight: bold; +} + +.footerNavi { + width: auto; + text-align: right; + margin-top: 50px; + z-index: 1; } .navigationbar { @@ -244,16 +266,6 @@ footer and license padding-right: 17px; } -/* ------------ -footer and license ------------ -*/ - -.footer { - text-align: center -} - #buildversion { font-style: italic; font-size: small; @@ -492,22 +504,6 @@ ol { padding: 20px 20px 20px 20px; } -.footer { - margin-top: 50px; - padding-left: 5px; - margin-bottom: 10px; - font-size: 10px; - border-top: 1px solid #999; - padding-top: 11px; -} - -.footerNavi { - width: auto; - text-align: right; - margin-top: 50px; - z-index: 1; -} - .memItemLeft { padding-right: 3px } From c95e1567e9f42239bb83a64c4e5f18c48f3ee022 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Fri, 1 Nov 2013 11:01:04 +0200 Subject: [PATCH 140/494] Remove unused field. Fix crash on Android 4.4 Change-Id: Ibee584c0154b0b116af58477302e7e8385f0290d Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/android/src/androidjnimain.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/plugins/platforms/android/src/androidjnimain.cpp b/src/plugins/platforms/android/src/androidjnimain.cpp index abfc2fa19c0..8b29a895b1d 100644 --- a/src/plugins/platforms/android/src/androidjnimain.cpp +++ b/src/plugins/platforms/android/src/androidjnimain.cpp @@ -111,8 +111,6 @@ static jobject m_surface = NULL; static EGLNativeWindowType m_nativeWindow = 0; static QSemaphore m_waitForWindowSemaphore; static bool m_waitForWindow = false; - -static jfieldID m_surfaceFieldID = 0; #endif @@ -763,11 +761,6 @@ static int registerNatives(JNIEnv *env) GET_AND_CHECK_STATIC_METHOD(m_redrawSurfaceMethodID, m_applicationClass, "redrawSurface", "(IIII)V"); -#ifdef ANDROID_PLUGIN_OPENGL - FIND_AND_CHECK_CLASS("android/view/Surface"); - GET_AND_CHECK_FIELD(m_surfaceFieldID, clazz, "mNativeSurface", "I"); -#endif - jmethodID methodID; GET_AND_CHECK_STATIC_METHOD(methodID, m_applicationClass, "activity", "()Landroid/app/Activity;"); jobject activityObject = env->CallStaticObjectMethod(m_applicationClass, methodID); From 48dcdbe51040c50ada8f709830e66644a31fb82b Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Fri, 1 Nov 2013 11:45:21 +0200 Subject: [PATCH 141/494] Android: implement a simple cache mechanism for assets dirs. AAssetManager_openDir is a pretty slow operation, so we are caching the most used dir contents. Task-number: QTBUG-34464 Change-Id: If198f7dae0d6961291c992e6eb46839ba5455819 Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../src/qandroidassetsfileenginehandler.cpp | 71 ++++++++++++------- .../src/qandroidassetsfileenginehandler.h | 8 ++- 2 files changed, 53 insertions(+), 26 deletions(-) diff --git a/src/plugins/platforms/android/src/qandroidassetsfileenginehandler.cpp b/src/plugins/platforms/android/src/qandroidassetsfileenginehandler.cpp index f3cb2586ccf..95844fc649c 100644 --- a/src/plugins/platforms/android/src/qandroidassetsfileenginehandler.cpp +++ b/src/plugins/platforms/android/src/qandroidassetsfileenginehandler.cpp @@ -43,20 +43,32 @@ #include "androidjnimain.h" #include +#include + +typedef QVector FilesList; + +struct AndroidAssetDir +{ + AndroidAssetDir(AAssetDir* ad) + { + const char *fileName; + while ((fileName = AAssetDir_getNextFileName(ad))) + m_items.push_back(QString::fromUtf8(fileName)); + AAssetDir_close(ad); + } + FilesList m_items; +}; class AndroidAbstractFileEngineIterator: public QAbstractFileEngineIterator { public: AndroidAbstractFileEngineIterator(QDir::Filters filters, const QStringList &nameFilters, - AAssetDir *asset, + QSharedPointer asset, const QString &path) : QAbstractFileEngineIterator(filters, nameFilters) { - AAssetDir_rewind(asset); - const char *fileName; - while ((fileName = AAssetDir_getNextFileName(asset))) - m_items << fileName; + m_items = asset->m_items; m_index = -1; m_path = path; } @@ -93,7 +105,7 @@ public: private: QString m_path; - QStringList m_items; + FilesList m_items; int m_index; }; @@ -102,12 +114,11 @@ class AndroidAbstractFileEngine: public QAbstractFileEngine public: explicit AndroidAbstractFileEngine(AAsset *asset, const QString &fileName) { - m_assetDir = 0; m_assetFile = asset; m_fileName = fileName; } - explicit AndroidAbstractFileEngine(AAssetDir *asset, const QString &fileName) + explicit AndroidAbstractFileEngine(QSharedPointer asset, const QString &fileName) { m_assetFile = 0; m_assetDir = asset; @@ -119,8 +130,6 @@ public: ~AndroidAbstractFileEngine() { close(); - if (m_assetDir) - AAssetDir_close(m_assetDir); } virtual bool open(QIODevice::OpenMode openMode) @@ -188,7 +197,7 @@ public: FileFlags flags(ReadOwnerPerm|ReadUserPerm|ReadGroupPerm|ReadOtherPerm|ExistsFlag); if (m_assetFile) flags |= FileType; - if (m_assetDir) + if (!m_assetDir.isNull()) flags |= DirectoryType; return type & flags; @@ -233,19 +242,19 @@ public: virtual Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) { - if (m_assetDir) + if (!m_assetDir.isNull()) return new AndroidAbstractFileEngineIterator(filters, filterNames, m_assetDir, m_fileName); return 0; } private: AAsset *m_assetFile; - AAssetDir *m_assetDir; + QSharedPointer m_assetDir; QString m_fileName; }; -AndroidAssetsFileEngineHandler::AndroidAssetsFileEngineHandler() +AndroidAssetsFileEngineHandler::AndroidAssetsFileEngineHandler():m_assetsCache(std::max(5, qgetenv("QT_ANDROID_MAX_ASSETS_CACHE_SIZE").toInt())) { m_assetManager = QtAndroid::assetManager(); } @@ -264,25 +273,37 @@ QAbstractFileEngine * AndroidAssetsFileEngineHandler::create(const QString &file int prefixSize=8; - m_path.clear(); + QByteArray path; if (!fileName.endsWith(QLatin1Char('/'))) { - m_path = fileName.toUtf8(); + path = fileName.toUtf8(); AAsset *asset = AAssetManager_open(m_assetManager, - m_path.constData() + prefixSize, + path.constData() + prefixSize, AASSET_MODE_BUFFER); if (asset) return new AndroidAbstractFileEngine(asset, fileName); } - if (!m_path.size()) - m_path = fileName.left(fileName.length() - 1).toUtf8(); + if (!path.size()) + path = fileName.left(fileName.length() - 1).toUtf8(); - AAssetDir *assetDir = AAssetManager_openDir(m_assetManager, m_path.constData() + prefixSize); - if (assetDir) { - if (AAssetDir_getNextFileName(assetDir)) - return new AndroidAbstractFileEngine(assetDir, fileName); - else - AAssetDir_close(assetDir); + m_assetsCacheMutext.lock(); + QSharedPointer *aad = m_assetsCache.object(path); + m_assetsCacheMutext.unlock(); + if (!aad) { + AAssetDir *assetDir = AAssetManager_openDir(m_assetManager, path.constData() + prefixSize); + if (assetDir) { + if (AAssetDir_getNextFileName(assetDir)) { + aad = new QSharedPointer(new AndroidAssetDir(assetDir)); + m_assetsCacheMutext.lock(); + m_assetsCache.insert(path, aad); + m_assetsCacheMutext.unlock(); + return new AndroidAbstractFileEngine(*aad, fileName); + } else { + AAssetDir_close(assetDir); + } + } + } else { + return new AndroidAbstractFileEngine(*aad, fileName); } return 0; } diff --git a/src/plugins/platforms/android/src/qandroidassetsfileenginehandler.h b/src/plugins/platforms/android/src/qandroidassetsfileenginehandler.h index 9bff6a012ee..7bd560886c6 100644 --- a/src/plugins/platforms/android/src/qandroidassetsfileenginehandler.h +++ b/src/plugins/platforms/android/src/qandroidassetsfileenginehandler.h @@ -43,8 +43,13 @@ #define QANDROIDASSETSFILEENGINEHANDLER_H #include +#include +#include +#include + #include +struct AndroidAssetDir; class AndroidAssetsFileEngineHandler: public QAbstractFileEngineHandler { public: @@ -54,7 +59,8 @@ public: private: AAssetManager *m_assetManager; - mutable QByteArray m_path; + mutable QCache> m_assetsCache; + mutable QMutex m_assetsCacheMutext; }; #endif // QANDROIDASSETSFILEENGINEHANDLER_H From 159f086a7f7bbe4deb6d95bde66ba875152e1cbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Thu, 24 Oct 2013 16:47:32 +0200 Subject: [PATCH 142/494] Android: Avoid re-creating Random objects. We where re-creating a Java Random object each time the seed was set, this causes unnecessary overhead as the old objects becomes subject for garbage collection. Change-Id: I7aa48f5380f86d6c0d57eaeadc71b9b2b146034d Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/corelib/global/qglobal.cpp | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 51cf91a77de..ca780346bc0 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2410,9 +2410,14 @@ void qsrand(uint seed) srand(seed); } #elif defined(Q_OS_ANDROID) - QJNIObjectPrivate random = QJNIObjectPrivate("java/util/Random", - "(J)V", - jlong(seed)); + if (randomTLS->hasLocalData()) { + randomTLS->localData().callMethod("setSeed", "(J)V", jlong(seed)); + return; + } + + QJNIObjectPrivate random("java/util/Random", + "(J)V", + jlong(seed)); if (!random.isValid()) { srand(seed); return; @@ -2465,19 +2470,20 @@ int qrand() if (!randomStorage) return rand(); - QJNIObjectPrivate random; - if (!randomStorage->hasLocalData()) { - random = QJNIObjectPrivate("java/util/Random", - "(J)V", - jlong(1)); - if (!random.isValid()) - return rand(); - - randomStorage->setLocalData(random); - } else { - random = randomStorage->localData(); + if (randomStorage->hasLocalData()) { + return randomStorage->localData().callMethod("nextInt", + "(I)I", + RAND_MAX); } + QJNIObjectPrivate random("java/util/Random", + "(J)V", + jlong(1)); + + if (!random.isValid()) + return rand(); + + randomStorage->setLocalData(random); return random.callMethod("nextInt", "(I)I", RAND_MAX); #else // On Windows srand() and rand() already use Thread-Local-Storage From efc61299bd51018df272b296b2c849071f685a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Mon, 21 Oct 2013 17:58:43 +0200 Subject: [PATCH 143/494] Android: Check for null pointer before calling ANativeWindow_release() Calling ANativeWindow_release() with a null pointer will cause a SIGSEGV. Task-number: QTBUG-33955 Change-Id: If7d1afa3baea04360507eec5042b4e18a0272527 Reviewed-by: Laszlo Agocs Reviewed-by: Paul Olav Tvete --- .../platforms/android/src/opengl/qeglfshooks_android.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/android/src/opengl/qeglfshooks_android.cpp b/src/plugins/platforms/android/src/opengl/qeglfshooks_android.cpp index e7e53e72a2a..278cd553f4c 100644 --- a/src/plugins/platforms/android/src/opengl/qeglfshooks_android.cpp +++ b/src/plugins/platforms/android/src/opengl/qeglfshooks_android.cpp @@ -120,7 +120,8 @@ EGLNativeWindowType QEglFSAndroidHooks::createNativeWindow(QPlatformWindow *plat void QEglFSAndroidHooks::destroyNativeWindow(EGLNativeWindowType window) { - ANativeWindow_release(window); + if (window != 0) + ANativeWindow_release(window); } bool QEglFSAndroidHooks::hasCapability(QPlatformIntegration::Capability capability) const From 7b33bd411061b021c6a6d68f64dfac205a4e65ac Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Thu, 31 Oct 2013 14:27:49 +0100 Subject: [PATCH 144/494] Fix stability issues in tst_qwidget with VERIFY_COLOR The grabbing always grabbed the desktop. This caused it to also grab tooltips, siderbars etc that could overlap the window which again caused the pixmap comparison to obviously fail. This will currently only fix it on windows. If needed, it should also be fixed for other platforms. Task-number: QTBUG-30566 Change-Id: I5cee8651e1d94dedded0acae8b19f351acd976c4 Reviewed-by: Friedemann Kleint --- .../widgets/kernel/qwidget/tst_qwidget.cpp | 84 ++++++++++++++----- 1 file changed, 61 insertions(+), 23 deletions(-) diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index fe85a1a42ff..03d6c1cdbd3 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -75,6 +75,7 @@ #include #include #include +#include #include "../../../qtest-config.h" @@ -4814,31 +4815,73 @@ static inline QByteArray msgRgbMismatch(unsigned actual, unsigned expected) QByteArrayLiteral(" != 0x") + QByteArray::number(expected, 16); } -#define VERIFY_COLOR(region, color) { \ +#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) +QT_BEGIN_NAMESPACE +extern Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0); +QT_END_NAMESPACE + +// grabs the window *without including any overlapping windows* +static QPixmap grabWindow(QWindow *window, int x, int y, int width, int height) +{ + const HWND hwnd = (HWND)window->winId(); + + // Create and setup bitmap + const HDC displayDc = ::GetDC(0); + const HDC bitmapDc = ::CreateCompatibleDC(displayDc); + const HBITMAP bitmap = ::CreateCompatibleBitmap(displayDc, width, height); + const HGDIOBJ oldBitmap = ::SelectObject(bitmapDc, bitmap); + + // copy data + const HDC windowDc = ::GetDC(hwnd); + ::BitBlt(bitmapDc, 0, 0, width, height, windowDc, x, y, SRCCOPY); + + // clean up all but bitmap + ::ReleaseDC(hwnd, windowDc); + ::SelectObject(bitmapDc, oldBitmap); + ::DeleteDC(bitmapDc); + + const QPixmap pixmap = qt_pixmapFromWinHBITMAP(bitmap); + + ::DeleteObject(bitmap); + ::ReleaseDC(0, displayDc); + + return pixmap; +} +#else +// fallback for other platforms. +static QPixmap grabWindow(QWindow *window, int x, int y, int width, int height) +{ + QScreen *screen = window->screen(); + return screen ? screen->grabWindow(window->winId(), x, y, width, height) : QPixmap(); +} +#endif //defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) + +#define VERIFY_COLOR(child, region, color) do { \ const QRegion r = QRegion(region); \ - QScreen *screen = qApp->primaryScreen(); \ - const WId desktopWinId = QDesktopWidget().winId(); \ + QWindow *window = child.window()->windowHandle(); \ + Q_ASSERT(window); \ + const QPoint offset = child.mapTo(child.window(), QPoint(0,0)); \ for (int i = 0; i < r.rects().size(); ++i) { \ - const QRect rect = r.rects().at(i); \ + const QRect rect = r.rects().at(i).translated(offset); \ for (int t = 0; t < 5; t++) { \ - const QPixmap pixmap = screen->grabWindow(desktopWinId, \ - rect.left(), rect.top(), \ - rect.width(), rect.height()); \ + const QPixmap pixmap = grabWindow(window, \ + rect.left(), rect.top(), \ + rect.width(), rect.height()); \ QCOMPARE(pixmap.size(), rect.size()); \ QPixmap expectedPixmap(pixmap); /* ensure equal formats */ \ - expectedPixmap.detach(); \ + expectedPixmap.detach(); \ expectedPixmap.fill(color); \ - QImage image = pixmap.toImage(); \ + QImage image = pixmap.toImage(); \ uint alphaCorrection = image.format() == QImage::Format_RGB32 ? 0xff000000 : 0; \ - uint firstPixel = image.pixel(0,0) | alphaCorrection; \ - if ( firstPixel != QColor(color).rgb() && t < 4 ) \ + uint firstPixel = image.pixel(0,0) | alphaCorrection; \ + if ( firstPixel != QColor(color).rgb() && t < 4 ) \ { QTest::qWait(200); continue; } \ QVERIFY2(firstPixel == QColor(color).rgb(), msgRgbMismatch(firstPixel, QColor(color).rgb())); \ QCOMPARE(pixmap, expectedPixmap); \ break; \ } \ } \ -} +} while (0) void tst_QWidget::popupEnterLeave() { @@ -4917,14 +4960,12 @@ void tst_QWidget::moveChild() parent.show(); QVERIFY(QTest::qWaitForWindowExposed(&parent)); QTest::qWait(30); - const QPoint tlwOffset = parent.geometry().topLeft(); QTRY_COMPARE(parent.r, QRegion(parent.rect()) - child.geometry()); QTRY_COMPARE(child.r, QRegion(child.rect())); - VERIFY_COLOR(child.geometry().translated(tlwOffset), + VERIFY_COLOR(child, child.rect(), child.color); - VERIFY_COLOR(QRegion(parent.geometry()) - child.geometry().translated(tlwOffset), - parent.color); + VERIFY_COLOR(parent, QRegion(parent.rect()) - child.geometry(), parent.color); parent.reset(); child.reset(); @@ -4942,10 +4983,8 @@ void tst_QWidget::moveChild() // should be scrolled in backingstore QCOMPARE(child.r, QRegion()); #endif - VERIFY_COLOR(child.geometry().translated(tlwOffset), - child.color); - VERIFY_COLOR(QRegion(parent.geometry()) - child.geometry().translated(tlwOffset), - parent.color); + VERIFY_COLOR(child, child.rect(), child.color); + VERIFY_COLOR(parent, QRegion(parent.rect()) - child.geometry(), parent.color); } void tst_QWidget::showAndMoveChild() @@ -4971,7 +5010,6 @@ void tst_QWidget::showAndMoveChild() QVERIFY(QTest::qWaitForWindowActive(&parent)); QTest::qWait(10); - const QPoint tlwOffset = parent.geometry().topLeft(); QWidget child(&parent); child.resize(desktopDimensions.width()/2, desktopDimensions.height()/2); child.setPalette(Qt::blue); @@ -4983,8 +5021,8 @@ void tst_QWidget::showAndMoveChild() child.move(desktopDimensions.width()/2, desktopDimensions.height()/2); qApp->processEvents(); - VERIFY_COLOR(child.geometry().translated(tlwOffset), Qt::blue); - VERIFY_COLOR(QRegion(parent.geometry()) - child.geometry().translated(tlwOffset), Qt::red); + VERIFY_COLOR(child, child.rect(), Qt::blue); + VERIFY_COLOR(parent, QRegion(parent.rect()) - child.geometry(), Qt::red); } // Cocoa only has rect granularity. From b6a4545b8f8714961025dd4475e966a5f505e9eb Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 4 Oct 2013 12:52:22 +0200 Subject: [PATCH 145/494] qdoc: Include internal types in the index files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Internal types can be inherited. Documentation is not created for internal types, but if an internal type is abstract, its properties must be listed on the documentation page of each subtype that inherits the internal type. This fix includes internal types in the index file. Task-number: QTBUG-33814 Change-Id: Ib6ef7cbd92804b3c605009802ddb15d35b32692c Reviewed-by: Topi Reiniö Reviewed-by: Nico Vertriest Reviewed-by: Jerome Pasion --- src/tools/qdoc/ditaxmlgenerator.cpp | 3 ++- src/tools/qdoc/htmlgenerator.cpp | 3 ++- src/tools/qdoc/qdocindexfiles.cpp | 14 ++++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp index 095e3c9d30b..e3b9bdd2641 100644 --- a/src/tools/qdoc/ditaxmlgenerator.cpp +++ b/src/tools/qdoc/ditaxmlgenerator.cpp @@ -682,7 +682,8 @@ void DitaXmlGenerator::generateTree() qdb_->generateIndex(outputDir() + QLatin1Char('/') + fileBase + ".index", projectUrl, projectDescription, - this); + this, + true); } if (!runPrepareOnly()) { diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index 2387502b8a0..a7dd6666db9 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -279,7 +279,8 @@ void HtmlGenerator::generateTree() qdb_->generateIndex(outputDir() + QLatin1Char('/') + fileBase + ".index", projectUrl, projectDescription, - this); + this, + true); } if (!runPrepareOnly()) { diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp index 7424971b13a..c84caa7eb5c 100644 --- a/src/tools/qdoc/qdocindexfiles.cpp +++ b/src/tools/qdoc/qdocindexfiles.cpp @@ -196,6 +196,10 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, location = Location(indexUrl + QLatin1Char('/') + name.toLower() + ".html"); else if (!indexUrl.isNull()) location = Location(name.toLower() + ".html"); + bool abstract = false; + if (element.attribute("abstract") == "true") + abstract = true; + node->setAbstract(abstract); } else if ((element.nodeName() == "qmlclass") || ((element.nodeName() == "page") && (element.attribute("subtype") == "qmlclass"))) { @@ -204,6 +208,10 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, QString qmlModuleName = element.attribute("qml-module-name"); if (!qmlModuleName.isEmpty()) qdb_->addToQmlModule(qmlModuleName, qcn); + bool abstract = false; + if (element.attribute("abstract") == "true") + abstract = true; + qcn->setAbstract(abstract); QString qmlFullBaseName = element.attribute("qml-base-type"); if (!qmlFullBaseName.isEmpty()) qcn->setQmlBaseName(qmlFullBaseName); @@ -729,7 +737,6 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, writer.writeStartElement(nodeName); QXmlStreamAttributes attributes; - writer.writeAttribute("access", access); if (node->type() != Node::Document) { QString threadSafety; @@ -776,7 +783,6 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, status = "main"; break; } - writer.writeAttribute("status", status); writer.writeAttribute("name", objName); if (node->isQmlModule()) { @@ -806,6 +812,10 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, href = node->name(); writer.writeAttribute("href", href); + writer.writeAttribute("access", access); + writer.writeAttribute("status", status); + if (node->isAbstract()) + writer.writeAttribute("abstract", "true"); writer.writeAttribute("location", node->location().fileName()); if (!node->location().filePath().isEmpty()) { writer.writeAttribute("filepath", node->location().filePath()); From 9205ae8fa49ad8ce330c522048f601bcab4e2174 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 10 Oct 2013 12:25:01 +0200 Subject: [PATCH 146/494] qdoc:headers and sources paths are canonicalized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This eliminates the possibility that the same file could appear in the file list twice causing qdoc to parse it twice. Task-number: QTBUG-34002 Change-Id: Iab63d778c9f955076515a8ae2f1bd9560099b13d Reviewed-by: Topi Reiniö Reviewed-by: Nico Vertriest Reviewed-by: Jerome Pasion --- src/tools/qdoc/config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/qdoc/config.cpp b/src/tools/qdoc/config.cpp index cb9b8c32690..2d8e98d64c7 100644 --- a/src/tools/qdoc/config.cpp +++ b/src/tools/qdoc/config.cpp @@ -703,7 +703,7 @@ QStringList Config::getAllFiles(const QString &filesVar, const QSet &excludedDirs, const QSet &excludedFiles) { - QStringList result = getStringList(filesVar); + QStringList result = getCanonicalPathList(filesVar); QStringList dirs = getCanonicalPathList(dirsVar); QString nameFilter = getString(filesVar + dot + CONFIG_FILEEXTENSIONS); From b21c82908c640068bed9bdcd80281d0e6f7adede Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 10 Oct 2013 12:33:28 +0200 Subject: [PATCH 147/494] qdoc: Snippets files no longer parsed by qdoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The files in the doc/snippets subdirectory of each example subdirectory are no longer parsed by qdoc as source files. They continue to be used as snippets files. This fix also ensures that there are no duplicates in the list of files to be parsed. Task-number: QTBUG-34003 Change-Id: Icec1a2a539237f24ee6bae89c6401f0dc81826d1 Reviewed-by: Topi Reiniö Reviewed-by: Nico Vertriest Reviewed-by: Jerome Pasion --- src/tools/qdoc/main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp index 246e4d2d82c..45737241377 100644 --- a/src/tools/qdoc/main.cpp +++ b/src/tools/qdoc/main.cpp @@ -393,6 +393,10 @@ static void processQdocconfFile(const QString &fileName) QMap headers; QMultiMap headerFileNames; for (int i=0; i sources; QMultiMap sourceFileNames; for (int i=0; i Date: Thu, 10 Oct 2013 14:50:36 +0200 Subject: [PATCH 148/494] qdoc: Internal QML Types no longer marked public MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a QML type marked with \internal is read from an index file, it is given private access instead of public access. Task-number: QTBUG-34010 Change-Id: If9270372cf4db835dca9731bce8c446a2fa4e140 Reviewed-by: Topi Reiniö Reviewed-by: Nico Vertriest Reviewed-by: Jerome Pasion --- src/tools/qdoc/qdocindexfiles.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp index c84caa7eb5c..02508e35897 100644 --- a/src/tools/qdoc/qdocindexfiles.cpp +++ b/src/tools/qdoc/qdocindexfiles.cpp @@ -120,6 +120,7 @@ void QDocIndexFiles::readIndexFile(const QString& path) { QFile file(path); if (file.open(QFile::ReadOnly)) { + //qDebug() << "READING:" << path; QDomDocument document; document.setContent(&file); file.close(); @@ -472,7 +473,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, node->setAccess(Node::Public); else if (access == "protected") node->setAccess(Node::Protected); - else if (access == "private") + else if ((access == "private") || (access == "internal")) node->setAccess(Node::Private); else node->setAccess(Node::Public); From 6893a0d656f8e08d93b44794e78c9b980a2937d5 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 16 Oct 2013 16:28:56 +0200 Subject: [PATCH 149/494] qdoc: Part 2 of fix for inheriting abstract QML types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fix not only gets the property lists correct but also creates correct links to the property docs. A side effect is that QML properties, methods, and signals whose names begin with "__" are automatically treated as if they are marked \internal. This had been agreed earlier but had not been implemented. It is also required to fix this bug so it is included here. Task-number: QTBUG-33814 Change-Id: I57de1e49774db47cb57c042f181ccc8edec62d13 Reviewed-by: Topi Reiniö Reviewed-by: Nico Vertriest Reviewed-by: Jerome Pasion --- src/tools/qdoc/cppcodemarker.cpp | 8 ++++++++ src/tools/qdoc/htmlgenerator.cpp | 5 +++-- src/tools/qdoc/node.cpp | 7 ++++++- src/tools/qdoc/node.h | 2 ++ src/tools/qdoc/qdocindexfiles.cpp | 34 ++++++++++++++++++++++++------- src/tools/qdoc/qmlvisitor.cpp | 1 - 6 files changed, 46 insertions(+), 11 deletions(-) diff --git a/src/tools/qdoc/cppcodemarker.cpp b/src/tools/qdoc/cppcodemarker.cpp index 24bd654238f..64b11109f76 100644 --- a/src/tools/qdoc/cppcodemarker.cpp +++ b/src/tools/qdoc/cppcodemarker.cpp @@ -1111,6 +1111,10 @@ QList
CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, Syno while (qcn != 0) { NodeList::ConstIterator c = qcn->childNodes().constBegin(); while (c != qcn->childNodes().constEnd()) { + if ((*c)->status() == Node::Internal) { + ++c; + continue; + } if ((*c)->type() == Node::QmlPropertyGroup) { insert(qmlproperties, *c, style, Okay); } @@ -1172,6 +1176,10 @@ QList
CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, Syno while (qcn != 0) { NodeList::ConstIterator c = qcn->childNodes().constBegin(); while (c != qcn->childNodes().constEnd()) { + if ((*c)->status() == Node::Internal) { + ++c; + continue; + } if ((*c)->type() == Node::QmlPropertyGroup) { insert(qmlproperties,*c,style,Okay); } diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp index a7dd6666db9..986b4ae261a 100644 --- a/src/tools/qdoc/htmlgenerator.cpp +++ b/src/tools/qdoc/htmlgenerator.cpp @@ -2311,7 +2311,7 @@ QString HtmlGenerator::generateAllQmlMembersFile(const QmlClassNode* qml_cn, } out() << "
    \n"; for (int j=0; jaccess() == Node::Private) { + if (nodes[j]->access() == Node::Private || nodes[j]->status() == Node::Internal) { continue; } out() << "
  • "; @@ -2320,7 +2320,8 @@ QString HtmlGenerator::generateAllQmlMembersFile(const QmlClassNode* qml_cn, prefix = keys.at(j).mid(1); prefix = prefix.left(keys.at(j).indexOf("::")+1); } - generateSynopsis(nodes[j], qcn, marker, CodeMarker::Summary, false, &prefix); + generateQmlItem(nodes[j], qcn, marker, true); + //generateSynopsis(nodes[j], qcn, marker, CodeMarker::Subpage, false, &prefix); out() << "
  • \n"; } out() << "
\n"; diff --git a/src/tools/qdoc/node.cpp b/src/tools/qdoc/node.cpp index 75896e2718c..c88ebfc7608 100644 --- a/src/tools/qdoc/node.cpp +++ b/src/tools/qdoc/node.cpp @@ -1867,7 +1867,10 @@ FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bo rf(0), ap(0) { - // nothing. + if (type == QmlMethod || type == QmlSignal) { + if (name.startsWith("__")) + setStatus(Internal); + } } /*! @@ -2326,6 +2329,8 @@ QmlPropertyNode::QmlPropertyNode(InnerNode* parent, setPageType(ApiPage); if (type_ == QString("alias")) isAlias_ = true; + if (name.startsWith("__")) + setStatus(Internal); } /*! diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h index 9e736aeba63..236b495bd09 100644 --- a/src/tools/qdoc/node.h +++ b/src/tools/qdoc/node.h @@ -195,6 +195,7 @@ public: virtual bool isInnerNode() const = 0; virtual bool isQmlModule() const { return false; } + virtual bool isQmlType() const { return false; } virtual bool isExample() const { return false; } virtual bool isExampleFile() const { return false; } virtual bool isLeaf() const { return false; } @@ -610,6 +611,7 @@ public: QmlClassNode(InnerNode* parent, const QString& name); virtual ~QmlClassNode(); virtual bool isQmlNode() const { return true; } + virtual bool isQmlType() const { return true; } virtual bool isQtQuickNode() const { return (qmlModuleName() == QLatin1String("QtQuick")); } virtual ClassNode* classNode() { return cnode_; } virtual void setClassNode(ClassNode* cn) { cnode_ = cn; } diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp index 02508e35897..47e302dad61 100644 --- a/src/tools/qdoc/qdocindexfiles.cpp +++ b/src/tools/qdoc/qdocindexfiles.cpp @@ -120,7 +120,6 @@ void QDocIndexFiles::readIndexFile(const QString& path) { QFile file(path); if (file.open(QFile::ReadOnly)) { - //qDebug() << "READING:" << path; QDomDocument document; document.setContent(&file); file.close(); @@ -515,10 +514,12 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element, QString moduleName = element.attribute("module"); if (!moduleName.isEmpty()) node->setModuleName(moduleName); - if (node->isExternalPage()) - node->setUrl(href); - else if (!indexUrl.isEmpty()) - node->setUrl(indexUrl + QLatin1Char('/') + href); + if (!href.isEmpty()) { + if (node->isExternalPage()) + node->setUrl(href); + else if (!indexUrl.isEmpty()) + node->setUrl(indexUrl + QLatin1Char('/') + href); + } QString since = element.attribute("since"); if (!since.isEmpty()) { @@ -717,6 +718,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, access = "protected"; break; case Node::Private: +#if 0 // Do not include private non-internal nodes in the index. // (Internal public and protected nodes are marked as private // by qdoc. We can check their internal status to determine @@ -725,6 +727,13 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, access = "internal"; else return false; +#endif + { + access = "private"; + bool b = generateInternalNodes; + if (b) + b = false; + } break; default: return false; @@ -811,13 +820,24 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, } else href = node->name(); - writer.writeAttribute("href", href); + if (node->isQmlNode()) { + InnerNode* p = node->parent(); + if (p) { + if (p->isQmlPropertyGroup()) + p = p->parent(); + if (p && p->isQmlType() && p->isAbstract()) + href.clear(); + } + } + if (!href.isEmpty()) + writer.writeAttribute("href", href); writer.writeAttribute("access", access); writer.writeAttribute("status", status); if (node->isAbstract()) writer.writeAttribute("abstract", "true"); - writer.writeAttribute("location", node->location().fileName()); + if (!node->location().fileName().isEmpty()) + writer.writeAttribute("location", node->location().fileName()); if (!node->location().filePath().isEmpty()) { writer.writeAttribute("filepath", node->location().filePath()); writer.writeAttribute("lineno", QString("%1").arg(node->location().lineNo())); diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp index 323c312eb5f..fb90dcd59a9 100644 --- a/src/tools/qdoc/qmlvisitor.cpp +++ b/src/tools/qdoc/qmlvisitor.cpp @@ -404,7 +404,6 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation, } } else if (command == COMMAND_INTERNAL) { - node->setAccess(Node::Private); node->setStatus(Node::Internal); } else if (command == COMMAND_OBSOLETE) { From e9fe369321939a6c1cb0ba822272875481dc038e Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 22 Oct 2013 12:02:36 +0200 Subject: [PATCH 150/494] qdoc: Corrected error in QDocDatabase::findQmlType() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was still using the QML module version number as part of the search key. e.g. it tried to find the type node for QtQuick.Controls::Button using QtQuick.Controls2.Button, but now it searches without the 2. Task-number: QTBUG-34173 Change-Id: Ibc8b6d9ef4ceebb20c1be00ec3bc9190c51bcdf3 Reviewed-by: Topi Reiniö Reviewed-by: Jerome Pasion Reviewed-by: Nico Vertriest --- src/tools/qdoc/qdocdatabase.cpp | 35 ++------------------------------- src/tools/qdoc/qmlvisitor.cpp | 34 +++++++++++--------------------- src/tools/qdoc/qmlvisitor.h | 4 ++-- 3 files changed, 15 insertions(+), 58 deletions(-) diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp index e371d448c66..f2ecb02a2fb 100644 --- a/src/tools/qdoc/qdocdatabase.cpp +++ b/src/tools/qdoc/qdocdatabase.cpp @@ -357,23 +357,10 @@ QmlClassNode* QDocDatabase::findQmlType(const ImportRec& import, const QString& else qmName = import.importUri_; for (int i=0; i 1) { - int dot = import.version_.lastIndexOf(QChar('.')); - if (dot > 0) { - qmid = import.name_ + import.version_.left(dot); - qualifiedName = qmid + "::" + dotSplit[i]; - qcn = qmlTypeMap_.value(qualifiedName); - if (qcn) { - return qcn; - } - } - } } } return 0; @@ -1000,24 +987,6 @@ void QDocDatabase::resolveQmlInheritance(InnerNode* root) } } -#if 0 -void QDocDatabase::resolveQmlInheritance(InnerNode* root) -{ - // Dop we need recursion? - foreach (Node* child, root->childNodes()) { - if (child->type() == Node::Document && child->subType() == Node::QmlClass) { - QmlClassNode* qcn = static_cast(child); - if ((qcn->qmlBaseNode() == 0) && !qcn->qmlBaseName().isEmpty()) { - QmlClassNode* bqcn = findQmlType(QString(), qcn->qmlBaseName()); - if (bqcn) { - qcn->setQmlBaseNode(bqcn); - } - } - } - } -} -#endif - /*! */ void QDocDatabase::resolveTargets(InnerNode* root) diff --git a/src/tools/qdoc/qmlvisitor.cpp b/src/tools/qdoc/qmlvisitor.cpp index fb90dcd59a9..ec1ef412564 100644 --- a/src/tools/qdoc/qmlvisitor.cpp +++ b/src/tools/qdoc/qmlvisitor.cpp @@ -464,6 +464,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiObjectDefinition *definition) QmlClassNode *component = new QmlClassNode(current, name); component->setTitle(name); component->setImportList(importList); + importList.clear(); if (applyDocumentation(definition->firstSourceLocation(), component)) { QmlClassNode::addInheritedBy(type, component); component->setQmlBaseName(type); @@ -488,34 +489,21 @@ void QmlDocVisitor::endVisit(QQmlJS::AST::UiObjectDefinition *definition) lastEndOffset = definition->lastSourceLocation().end(); } -/*! - Note that the imports list can be traversed by iteration to obtain - all the imports in the document at once, having found just one: - - *it = imports; it; it = it->next - - */ -bool QmlDocVisitor::visit(QQmlJS::AST::UiImportList *imports) +bool QmlDocVisitor::visit(QQmlJS::AST::UiImport *import) { - while (imports != 0) { - QQmlJS::AST::UiImport* imp = imports->import; + QString name = document.mid(import->fileNameToken.offset, import->fileNameToken.length); + if (name[0] == '\"') + name = name.mid(1, name.length()-2); + QString version = document.mid(import->versionToken.offset, import->versionToken.length); + QString importId = document.mid(import->importIdToken.offset, import->importIdToken.length); + QString importUri = getFullyQualifiedId(import->importUri); + QString reconstructed = importUri + QString(" ") + version; + importList.append(ImportRec(name, version, importId, importUri)); - QString name = document.mid(imp->fileNameToken.offset, imp->fileNameToken.length); - if (name[0] == '\"') - name = name.mid(1, name.length()-2); - QString version = document.mid(imp->versionToken.offset, imp->versionToken.length); - QString importId = document.mid(imp->importIdToken.offset, imp->importIdToken.length); - QString importUri = getFullyQualifiedId(imp->importUri); - importList.append(ImportRec(name, version, importId, importUri)); - imports = imports->next; - } return true; } -/*! - End the visit of the imports list. - */ -void QmlDocVisitor::endVisit(QQmlJS::AST::UiImportList *definition) +void QmlDocVisitor::endVisit(QQmlJS::AST::UiImport *definition) { lastEndOffset = definition->lastSourceLocation().end(); } diff --git a/src/tools/qdoc/qmlvisitor.h b/src/tools/qdoc/qmlvisitor.h index cdb7ae73918..feeeb13497a 100644 --- a/src/tools/qdoc/qmlvisitor.h +++ b/src/tools/qdoc/qmlvisitor.h @@ -75,8 +75,8 @@ public: const QSet &topics); virtual ~QmlDocVisitor(); - bool visit(QQmlJS::AST::UiImportList *imports); - void endVisit(QQmlJS::AST::UiImportList *definition); + bool visit(QQmlJS::AST::UiImport *import); + void endVisit(QQmlJS::AST::UiImport *definition); bool visit(QQmlJS::AST::UiObjectDefinition *definition); void endVisit(QQmlJS::AST::UiObjectDefinition *definition); From 0b152831ccee309f020435ab0737af6c73362dec Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 23 Oct 2013 13:55:53 +0200 Subject: [PATCH 151/494] qdoc: Update qdoc's QML parser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because qdoc is part of qtbase/src/tools, it is not allowed to depend on anything outside of qtbase. But qdoc uses the QML parser from qtdeclarative, so qdoc has its own copy of the QML parser sources. The QML parser has been updated to the current version for Qt 5.2. Task-number: QTBUG-34269 Change-Id: I5ac9c8ff08a3494d5c35a0014a437be88f2dc31d Reviewed-by: Simon Hausmann Reviewed-by: Topi Reiniö Reviewed-by: Jerome Pasion Reviewed-by: Nico Vertriest --- src/tools/qdoc/qmlparser/qqmljs.g | 84 +- src/tools/qdoc/qmlparser/qqmljsast.cpp | 24 +- src/tools/qdoc/qmlparser/qqmljsast_p.h | 168 +- src/tools/qdoc/qmlparser/qqmljsastfwd_p.h | 4 +- src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h | 8 +- src/tools/qdoc/qmlparser/qqmljsengine_p.h | 1 + src/tools/qdoc/qmlparser/qqmljsglobal_p.h | 4 +- src/tools/qdoc/qmlparser/qqmljsgrammar.cpp | 1678 +++++++++-------- src/tools/qdoc/qmlparser/qqmljsgrammar_p.h | 43 +- src/tools/qdoc/qmlparser/qqmljskeywords_p.h | 11 + src/tools/qdoc/qmlparser/qqmljslexer.cpp | 76 +- src/tools/qdoc/qmlparser/qqmljslexer_p.h | 4 +- src/tools/qdoc/qmlparser/qqmljsparser.cpp | 653 ++++--- src/tools/qdoc/qmlparser/qqmljsparser_p.h | 9 +- 14 files changed, 1516 insertions(+), 1251 deletions(-) diff --git a/src/tools/qdoc/qmlparser/qqmljs.g b/src/tools/qdoc/qmlparser/qqmljs.g index 7ba68595341..de4fec4d568 100644 --- a/src/tools/qdoc/qmlparser/qqmljs.g +++ b/src/tools/qdoc/qmlparser/qqmljs.g @@ -65,6 +65,7 @@ --- context keywords. %token T_PUBLIC "public" %token T_IMPORT "import" +%token T_PRAGMA "pragma" %token T_AS "as" %token T_ON "on" %token T_GET "get" @@ -253,7 +254,8 @@ public: AST::VariableDeclarationList *VariableDeclarationList; AST::UiProgram *UiProgram; - AST::UiImportList *UiImportList; + AST::UiHeaderItemList *UiHeaderItemList; + AST::UiPragma *UiPragma; AST::UiImport *UiImport; AST::UiParameterList *UiParameterList; AST::UiPublicMember *UiPublicMember; @@ -266,6 +268,7 @@ public: AST::UiObjectMemberList *UiObjectMemberList; AST::UiArrayMemberList *UiArrayMemberList; AST::UiQualifiedId *UiQualifiedId; + AST::UiQualifiedPragmaId *UiQualifiedPragmaId; }; public: @@ -347,6 +350,7 @@ protected: { return location_stack [tos + index - 1]; } AST::UiQualifiedId *reparseAsQualifiedId(AST::ExpressionNode *expr); + AST::UiQualifiedPragmaId *reparseAsQualifiedPragmaId(AST::ExpressionNode *expr); protected: Engine *driver; @@ -486,6 +490,19 @@ AST::UiQualifiedId *Parser::reparseAsQualifiedId(AST::ExpressionNode *expr) return 0; } +AST::UiQualifiedPragmaId *Parser::reparseAsQualifiedPragmaId(AST::ExpressionNode *expr) +{ + if (AST::IdentifierExpression *idExpr = AST::cast(expr)) { + AST::UiQualifiedPragmaId *q = new (pool) AST::UiQualifiedPragmaId(idExpr->name); + q->identifierToken = idExpr->identifierToken; + + return q->finish(); + } + + return 0; +} + + bool Parser::parse(int startToken) { Lexer *lexer = driver->lexer(); @@ -594,38 +611,62 @@ case $rule_number: { } break; ./ -UiProgram: UiImportListOpt UiRootMember ; +UiProgram: UiHeaderItemListOpt UiRootMember; /. case $rule_number: { - sym(1).UiProgram = new (pool) AST::UiProgram(sym(1).UiImportList, + sym(1).UiProgram = new (pool) AST::UiProgram(sym(1).UiHeaderItemList, sym(2).UiObjectMemberList->finish()); } break; ./ -UiImportListOpt: Empty ; -UiImportListOpt: UiImportList ; +UiHeaderItemListOpt: Empty ; +UiHeaderItemListOpt: UiHeaderItemList ; /. case $rule_number: { - sym(1).Node = sym(1).UiImportList->finish(); + sym(1).Node = sym(1).UiHeaderItemList->finish(); } break; ./ -UiImportList: UiImport ; +UiHeaderItemList: UiPragma ; /. case $rule_number: { - sym(1).Node = new (pool) AST::UiImportList(sym(1).UiImport); + sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiPragma); } break; ./ -UiImportList: UiImportList UiImport ; +UiHeaderItemList: UiImport ; /. case $rule_number: { - sym(1).Node = new (pool) AST::UiImportList(sym(1).UiImportList, sym(2).UiImport); + sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiImport); } break; ./ +UiHeaderItemList: UiHeaderItemList UiPragma ; +/. +case $rule_number: { + sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiHeaderItemList, sym(2).UiPragma); +} break; +./ + +UiHeaderItemList: UiHeaderItemList UiImport ; +/. +case $rule_number: { + sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiHeaderItemList, sym(2).UiImport); +} break; +./ + +PragmaId: MemberExpression ; + ImportId: MemberExpression ; +UiPragma: UiPragmaHead T_AUTOMATIC_SEMICOLON ; +UiPragma: UiPragmaHead T_SEMICOLON ; +/. +case $rule_number: { + sym(1).UiPragma->semicolonToken = loc(2); +} break; +./ + UiImport: UiImportHead T_AUTOMATIC_SEMICOLON ; UiImport: UiImportHead T_SEMICOLON ; /. @@ -666,6 +707,28 @@ case $rule_number: { } break; ./ +UiPragmaHead: T_PRAGMA PragmaId ; +/. +case $rule_number: { + AST::UiPragma *node = 0; + + if (AST::UiQualifiedPragmaId *qualifiedId = reparseAsQualifiedPragmaId(sym(2).Expression)) { + node = new (pool) AST::UiPragma(qualifiedId); + } + + sym(1).Node = node; + + if (node) { + node->pragmaToken = loc(1); + } else { + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1), + QLatin1String("Expected a qualified name id"))); + + return false; // ### remove me + } +} break; +./ + UiImportHead: T_IMPORT ImportId ; /. @@ -1261,6 +1324,7 @@ case $rule_number: { } break; ./ + UiQualifiedId: MemberExpression ; /. case $rule_number: { diff --git a/src/tools/qdoc/qmlparser/qqmljsast.cpp b/src/tools/qdoc/qmlparser/qqmljsast.cpp index ea0df4a5373..33b3868e663 100644 --- a/src/tools/qdoc/qmlparser/qqmljsast.cpp +++ b/src/tools/qdoc/qmlparser/qqmljsast.cpp @@ -821,7 +821,7 @@ void DebuggerStatement::accept0(Visitor *visitor) void UiProgram::accept0(Visitor *visitor) { if (visitor->visit(this)) { - accept(imports, visitor); + accept(headers, visitor); accept(members, visitor); } @@ -932,16 +932,34 @@ void UiImport::accept0(Visitor *visitor) visitor->endVisit(this); } -void UiImportList::accept0(Visitor *visitor) +void UiQualifiedPragmaId::accept0(Visitor *visitor) { if (visitor->visit(this)) { - accept(import, visitor); + } + + visitor->endVisit(this); +} + +void UiPragma::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + accept(pragmaType, visitor); + } + + visitor->endVisit(this); +} + +void UiHeaderItemList::accept0(Visitor *visitor) +{ + if (visitor->visit(this)) { + accept(headerItem, visitor); accept(next, visitor); } visitor->endVisit(this); } + void UiSourceElement::accept0(Visitor *visitor) { if (visitor->visit(this)) { diff --git a/src/tools/qdoc/qmlparser/qqmljsast_p.h b/src/tools/qdoc/qmlparser/qqmljsast_p.h index 01a872f1e86..6cc3b7649e2 100644 --- a/src/tools/qdoc/qmlparser/qqmljsast_p.h +++ b/src/tools/qdoc/qmlparser/qqmljsast_p.h @@ -207,18 +207,20 @@ public: Kind_UiArrayBinding, Kind_UiImport, - Kind_UiImportList, Kind_UiObjectBinding, Kind_UiObjectDefinition, Kind_UiObjectInitializer, Kind_UiObjectMemberList, Kind_UiArrayMemberList, + Kind_UiPragma, Kind_UiProgram, Kind_UiParameterList, Kind_UiPublicMember, Kind_UiQualifiedId, + Kind_UiQualifiedPragmaId, Kind_UiScriptBinding, - Kind_UiSourceElement + Kind_UiSourceElement, + Kind_UiHeaderItemList }; inline Node() @@ -2271,44 +2273,6 @@ public: SourceLocation semicolonToken; }; -class QML_PARSER_EXPORT UiImportList: public Node -{ -public: - QQMLJS_DECLARE_AST_NODE(UiImportList) - - UiImportList(UiImport *import) - : import(import), - next(this) - { kind = K; } - - UiImportList(UiImportList *previous, UiImport *import) - : import(import) - { - kind = K; - next = previous->next; - previous->next = this; - } - - UiImportList *finish() - { - UiImportList *head = next; - next = 0; - return head; - } - - virtual void accept0(Visitor *visitor); - - virtual SourceLocation firstSourceLocation() const - { return import->firstSourceLocation(); } - - virtual SourceLocation lastSourceLocation() const - { return next ? next->lastSourceLocation() : import->lastSourceLocation(); } - -// attributes - UiImport *import; - UiImportList *next; -}; - class QML_PARSER_EXPORT UiObjectMember: public Node { public: @@ -2355,21 +2319,131 @@ public: UiObjectMember *member; }; +class QML_PARSER_EXPORT UiQualifiedPragmaId: public Node +{ +public: + QQMLJS_DECLARE_AST_NODE(UiQualifiedPragmaId) + + UiQualifiedPragmaId(const QStringRef &name) + : next(this), name(name) + { kind = K; } + + UiQualifiedPragmaId(UiQualifiedPragmaId *previous, const QStringRef &name) + : name(name) + { + kind = K; + next = previous->next; + previous->next = this; + } + + UiQualifiedPragmaId *finish() + { + UiQualifiedPragmaId *head = next; + next = 0; + return head; + } + + virtual void accept0(Visitor *visitor); + + virtual SourceLocation firstSourceLocation() const + { return identifierToken; } + + virtual SourceLocation lastSourceLocation() const + { return next ? next->lastSourceLocation() : identifierToken; } + +// attributes + UiQualifiedPragmaId *next; + QStringRef name; + SourceLocation identifierToken; +}; + +class QML_PARSER_EXPORT UiPragma: public Node +{ +public: + QQMLJS_DECLARE_AST_NODE(UiPragma) + + UiPragma(UiQualifiedPragmaId *type) + : pragmaType(type) + { kind = K; } + + virtual void accept0(Visitor *visitor); + + virtual SourceLocation firstSourceLocation() const + { return pragmaToken; } + + virtual SourceLocation lastSourceLocation() const + { return semicolonToken; } + +// attributes + UiQualifiedPragmaId *pragmaType; + SourceLocation pragmaToken; + SourceLocation semicolonToken; +}; + +class QML_PARSER_EXPORT UiHeaderItemList: public Node +{ +public: + QQMLJS_DECLARE_AST_NODE(UiHeaderItemList) + + UiHeaderItemList(UiImport *import) + : headerItem(import), next(this) + { kind = K; } + + UiHeaderItemList(UiPragma *pragma) + : headerItem(pragma), next(this) + { kind = K; } + + UiHeaderItemList(UiHeaderItemList *previous, UiImport *import) + : headerItem(import) + { + kind = K; + next = previous->next; + previous->next = this; + } + + UiHeaderItemList(UiHeaderItemList *previous, UiPragma *pragma) + : headerItem(pragma) + { + kind = K; + next = previous->next; + previous->next = this; + } + + UiHeaderItemList *finish() + { + UiHeaderItemList *head = next; + next = 0; + return head; + } + + virtual void accept0(Visitor *visitor); + + virtual SourceLocation firstSourceLocation() const + { return headerItem->firstSourceLocation(); } + + virtual SourceLocation lastSourceLocation() const + { return next ? next->lastSourceLocation() : headerItem->lastSourceLocation(); } + +// attributes + Node *headerItem; + UiHeaderItemList *next; +}; + class QML_PARSER_EXPORT UiProgram: public Node { public: QQMLJS_DECLARE_AST_NODE(UiProgram) - UiProgram(UiImportList *imports, UiObjectMemberList *members) - : imports(imports), members(members) + UiProgram(UiHeaderItemList *headers, UiObjectMemberList *members) + : headers(headers), members(members) { kind = K; } virtual void accept0(Visitor *visitor); virtual SourceLocation firstSourceLocation() const { - if (imports) - return imports->firstSourceLocation(); + if (headers) + return headers->firstSourceLocation(); else if (members) return members->firstSourceLocation(); return SourceLocation(); @@ -2379,13 +2453,13 @@ public: { if (members) return members->lastSourceLocation(); - else if (imports) - return imports->lastSourceLocation(); + else if (headers) + return headers->lastSourceLocation(); return SourceLocation(); } // attributes - UiImportList *imports; + UiHeaderItemList *headers; UiObjectMemberList *members; }; diff --git a/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h b/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h index fe5572c4b26..f8cba4981cc 100644 --- a/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h +++ b/src/tools/qdoc/qmlparser/qqmljsastfwd_p.h @@ -167,7 +167,7 @@ class NestedExpression; // ui elements class UiProgram; -class UiImportList; +class UiPragma; class UiImport; class UiPublicMember; class UiParameterList; @@ -181,6 +181,8 @@ class UiObjectMember; class UiObjectMemberList; class UiArrayMemberList; class UiQualifiedId; +class UiQualifiedPragmaId; +class UiHeaderItemList; } } // namespace AST diff --git a/src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h b/src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h index ef022f617ce..1d67d4c75d1 100644 --- a/src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h +++ b/src/tools/qdoc/qmlparser/qqmljsastvisitor_p.h @@ -71,7 +71,8 @@ public: // Ui virtual bool visit(UiProgram *) { return true; } - virtual bool visit(UiImportList *) { return true; } + virtual bool visit(UiHeaderItemList *) { return true; } + virtual bool visit(UiPragma *) { return true; } virtual bool visit(UiImport *) { return true; } virtual bool visit(UiPublicMember *) { return true; } virtual bool visit(UiSourceElement *) { return true; } @@ -84,10 +85,12 @@ public: virtual bool visit(UiObjectMemberList *) { return true; } virtual bool visit(UiArrayMemberList *) { return true; } virtual bool visit(UiQualifiedId *) { return true; } + virtual bool visit(UiQualifiedPragmaId *) { return true; } virtual void endVisit(UiProgram *) {} - virtual void endVisit(UiImportList *) {} virtual void endVisit(UiImport *) {} + virtual void endVisit(UiHeaderItemList *) {} + virtual void endVisit(UiPragma *) {} virtual void endVisit(UiPublicMember *) {} virtual void endVisit(UiSourceElement *) {} virtual void endVisit(UiObjectDefinition *) {} @@ -99,6 +102,7 @@ public: virtual void endVisit(UiObjectMemberList *) {} virtual void endVisit(UiArrayMemberList *) {} virtual void endVisit(UiQualifiedId *) {} + virtual void endVisit(UiQualifiedPragmaId *) {} // QQmlJS virtual bool visit(ThisExpression *) { return true; } diff --git a/src/tools/qdoc/qmlparser/qqmljsengine_p.h b/src/tools/qdoc/qmlparser/qqmljsengine_p.h index 4f58e7f8ea9..195b98bfd7c 100644 --- a/src/tools/qdoc/qmlparser/qqmljsengine_p.h +++ b/src/tools/qdoc/qmlparser/qqmljsengine_p.h @@ -102,6 +102,7 @@ public: ~Engine(); void setCode(const QString &code); + const QString &code() const { return _code; } void addComment(int pos, int len, int line, int col); QList comments() const; diff --git a/src/tools/qdoc/qmlparser/qqmljsglobal_p.h b/src/tools/qdoc/qmlparser/qqmljsglobal_p.h index 3aecc863d56..c53e12ea56b 100644 --- a/src/tools/qdoc/qmlparser/qqmljsglobal_p.h +++ b/src/tools/qdoc/qmlparser/qqmljsglobal_p.h @@ -61,8 +61,10 @@ # if defined(QT_BUILD_QMLDEVTOOLS_LIB) || defined(QT_QMLDEVTOOLS_LIB) // QmlDevTools is a static library # define QML_PARSER_EXPORT -# else +# elif defined(QT_BUILD_QML_LIB) # define QML_PARSER_EXPORT Q_AUTOTEST_EXPORT +# else +# define QML_PARSER_EXPORT # endif #endif // QT_CREATOR diff --git a/src/tools/qdoc/qmlparser/qqmljsgrammar.cpp b/src/tools/qdoc/qmlparser/qqmljsgrammar.cpp index 4a5672a796b..1e5f7a8c6d4 100644 --- a/src/tools/qdoc/qmlparser/qqmljsgrammar.cpp +++ b/src/tools/qdoc/qmlparser/qqmljsgrammar.cpp @@ -54,421 +54,427 @@ const char *const QQmlJSGrammar::spell [] = { ")", ";", 0, "*", "*=", "string literal", "property", "signal", "readonly", "switch", "this", "throw", "~", "try", "typeof", "var", "void", "while", "with", "^", "^=", "null", "true", "false", "const", "debugger", "reserved word", "multiline string literal", "comment", 0, - "public", "import", "as", "on", "get", "set", 0, 0, 0, 0, - 0, 0, 0, 0, 0}; + "public", "import", "pragma", "as", "on", "get", "set", 0, 0, 0, + 0, 0, 0, 0, 0, 0}; const short QQmlJSGrammar::lhs [] = { - 105, 105, 105, 105, 105, 105, 106, 112, 112, 115, - 115, 117, 116, 116, 116, 116, 116, 116, 116, 116, - 119, 114, 113, 122, 122, 123, 123, 124, 124, 121, - 110, 110, 110, 110, 126, 126, 126, 126, 126, 126, - 126, 110, 134, 134, 134, 135, 135, 136, 136, 110, - 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, - 110, 110, 110, 110, 110, 110, 120, 120, 120, 120, - 120, 120, 120, 139, 139, 139, 139, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, - 139, 125, 141, 141, 141, 141, 140, 140, 145, 145, - 145, 143, 143, 146, 146, 146, 146, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, - 149, 149, 149, 149, 149, 149, 149, 149, 150, 150, - 118, 118, 118, 118, 118, 153, 153, 154, 154, 154, - 154, 152, 152, 155, 155, 156, 156, 157, 157, 157, - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, - 159, 159, 159, 159, 160, 160, 160, 161, 161, 161, - 161, 162, 162, 162, 162, 162, 162, 162, 163, 163, - 163, 163, 163, 163, 164, 164, 164, 164, 164, 165, - 165, 165, 165, 165, 166, 166, 167, 167, 168, 168, - 169, 169, 170, 170, 171, 171, 172, 172, 173, 173, - 174, 174, 175, 175, 176, 176, 177, 177, 144, 144, - 178, 178, 179, 179, 179, 179, 179, 179, 179, 179, - 179, 179, 179, 179, 108, 108, 180, 180, 181, 181, - 182, 182, 107, 107, 107, 107, 107, 107, 107, 107, - 107, 107, 107, 107, 107, 107, 107, 127, 191, 191, - 190, 190, 138, 138, 192, 192, 193, 193, 195, 195, - 194, 196, 199, 197, 197, 200, 198, 198, 128, 129, - 129, 130, 130, 183, 183, 183, 183, 183, 183, 183, - 183, 184, 184, 184, 184, 185, 185, 185, 185, 186, - 186, 131, 132, 201, 201, 204, 204, 202, 202, 205, - 203, 187, 188, 188, 133, 133, 133, 206, 207, 189, - 189, 208, 137, 151, 151, 209, 209, 148, 148, 147, - 147, 210, 111, 111, 211, 211, 109, 109, 142, 142, - 212}; + 106, 106, 106, 106, 106, 106, 107, 113, 113, 116, + 116, 116, 116, 119, 121, 117, 117, 118, 118, 118, + 118, 118, 118, 118, 118, 122, 123, 115, 114, 126, + 126, 127, 127, 128, 128, 125, 111, 111, 111, 111, + 130, 130, 130, 130, 130, 130, 130, 111, 138, 138, + 138, 139, 139, 140, 140, 111, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 124, 124, 124, 124, 124, 124, 124, 143, + 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, + 143, 143, 143, 143, 143, 143, 143, 129, 145, 145, + 145, 145, 144, 144, 149, 149, 149, 147, 147, 150, + 150, 150, 150, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, + 153, 153, 153, 153, 154, 154, 120, 120, 120, 120, + 120, 157, 157, 158, 158, 158, 158, 156, 156, 159, + 159, 160, 160, 161, 161, 161, 162, 162, 162, 162, + 162, 162, 162, 162, 162, 162, 163, 163, 163, 163, + 164, 164, 164, 165, 165, 165, 165, 166, 166, 166, + 166, 166, 166, 166, 167, 167, 167, 167, 167, 167, + 168, 168, 168, 168, 168, 169, 169, 169, 169, 169, + 170, 170, 171, 171, 172, 172, 173, 173, 174, 174, + 175, 175, 176, 176, 177, 177, 178, 178, 179, 179, + 180, 180, 181, 181, 148, 148, 182, 182, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, + 109, 109, 184, 184, 185, 185, 186, 186, 108, 108, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, + 108, 108, 108, 131, 195, 195, 194, 194, 142, 142, + 196, 196, 197, 197, 199, 199, 198, 200, 203, 201, + 201, 204, 202, 202, 132, 133, 133, 134, 134, 187, + 187, 187, 187, 187, 187, 187, 187, 188, 188, 188, + 188, 189, 189, 189, 189, 190, 190, 135, 136, 205, + 205, 208, 208, 206, 206, 209, 207, 191, 192, 192, + 137, 137, 137, 210, 211, 193, 193, 212, 141, 155, + 155, 213, 213, 152, 152, 151, 151, 214, 112, 112, + 215, 215, 110, 110, 146, 146, 216}; const short QQmlJSGrammar::rhs [] = { 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, - 2, 1, 2, 2, 3, 3, 5, 5, 4, 4, - 2, 0, 1, 1, 2, 1, 3, 2, 3, 2, - 1, 5, 4, 4, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 1, 1, 0, 1, 2, 4, 6, - 6, 3, 3, 7, 7, 4, 4, 5, 5, 5, - 6, 6, 10, 6, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 1, 1, 2, 2, 2, 2, 3, + 3, 5, 5, 4, 4, 2, 2, 0, 1, 1, + 2, 1, 3, 2, 3, 2, 1, 5, 4, 4, + 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, + 1, 0, 1, 2, 4, 6, 6, 3, 3, 7, + 7, 4, 4, 5, 5, 5, 6, 6, 10, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 3, 3, 4, 5, 3, 4, - 3, 1, 1, 2, 3, 4, 1, 2, 3, 7, - 8, 1, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 3, 3, 4, 5, 3, 4, 3, 1, 1, 2, + 3, 4, 1, 2, 3, 7, 8, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 4, 3, 5, 1, 2, 4, 4, 4, - 3, 0, 1, 1, 3, 1, 1, 1, 2, 2, - 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 3, 3, 3, 1, 3, 3, 1, 3, 3, - 3, 1, 3, 3, 3, 3, 3, 3, 1, 3, - 3, 3, 3, 3, 1, 3, 3, 3, 3, 1, - 3, 3, 3, 3, 1, 3, 1, 3, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 4, 3, + 5, 1, 2, 4, 4, 4, 3, 0, 1, 1, + 3, 1, 1, 1, 2, 2, 1, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 3, 3, 3, + 1, 3, 3, 1, 3, 3, 3, 1, 3, 3, + 3, 3, 3, 3, 1, 3, 3, 3, 3, 3, + 1, 3, 3, 3, 3, 1, 3, 3, 3, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, - 1, 3, 1, 3, 1, 5, 1, 5, 1, 3, - 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 0, 1, 1, 3, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 1, 2, - 0, 1, 3, 3, 1, 1, 1, 3, 1, 3, - 2, 2, 2, 0, 1, 2, 0, 1, 1, 2, - 2, 7, 5, 7, 7, 7, 5, 9, 10, 7, - 8, 2, 2, 3, 3, 2, 2, 3, 3, 3, - 3, 5, 5, 3, 5, 1, 2, 0, 1, 4, - 3, 3, 3, 3, 3, 3, 4, 5, 2, 2, - 2, 1, 8, 8, 7, 1, 3, 0, 1, 0, - 1, 1, 1, 1, 1, 2, 1, 1, 0, 1, - 2}; + 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, + 1, 5, 1, 5, 1, 3, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 0, 1, 1, 3, 0, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 1, 2, 0, 1, 3, 3, + 1, 1, 1, 3, 1, 3, 2, 2, 2, 0, + 1, 2, 0, 1, 1, 2, 2, 7, 5, 7, + 7, 7, 5, 9, 10, 7, 8, 2, 2, 3, + 3, 2, 2, 3, 3, 3, 3, 5, 5, 3, + 5, 1, 2, 0, 1, 4, 3, 3, 3, 3, + 3, 3, 4, 5, 2, 2, 2, 1, 8, 8, + 7, 1, 3, 0, 1, 0, 1, 1, 1, 1, + 1, 2, 1, 1, 0, 1, 2}; const short QQmlJSGrammar::action_default [] = { - 0, 0, 22, 0, 0, 0, 22, 0, 178, 245, - 209, 217, 213, 157, 229, 205, 3, 142, 75, 158, - 221, 225, 146, 175, 156, 161, 141, 195, 182, 0, - 82, 83, 78, 0, 72, 67, 349, 0, 0, 0, - 0, 80, 0, 0, 76, 79, 71, 0, 0, 68, - 70, 73, 69, 81, 74, 0, 77, 0, 0, 171, - 0, 0, 158, 177, 160, 159, 0, 0, 0, 173, - 174, 172, 176, 0, 206, 0, 0, 0, 0, 196, - 0, 0, 0, 0, 0, 0, 186, 0, 0, 0, - 180, 181, 179, 184, 188, 187, 185, 183, 198, 197, - 199, 0, 214, 0, 210, 0, 0, 152, 139, 151, - 140, 108, 109, 110, 135, 111, 136, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 137, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 138, 0, 0, 150, 246, 153, 0, 154, 0, - 155, 149, 0, 242, 235, 233, 240, 241, 239, 238, - 244, 237, 236, 234, 243, 230, 0, 218, 0, 0, - 222, 0, 0, 226, 0, 0, 152, 144, 0, 143, - 0, 148, 162, 0, 338, 338, 339, 0, 336, 0, - 337, 0, 340, 253, 260, 259, 267, 255, 0, 256, - 0, 341, 0, 348, 257, 258, 75, 263, 261, 345, - 342, 347, 264, 0, 275, 0, 0, 0, 0, 332, - 0, 349, 247, 289, 0, 0, 0, 276, 0, 0, - 265, 266, 0, 254, 262, 290, 291, 0, 338, 0, - 0, 340, 0, 333, 334, 0, 322, 346, 0, 306, - 307, 308, 309, 0, 302, 303, 304, 305, 330, 331, - 0, 0, 0, 0, 0, 294, 295, 296, 251, 249, - 211, 219, 215, 231, 207, 252, 0, 158, 223, 227, - 200, 189, 0, 0, 208, 0, 0, 0, 0, 201, - 0, 0, 0, 0, 0, 193, 191, 194, 192, 190, - 203, 202, 204, 0, 216, 0, 212, 0, 250, 158, - 0, 232, 247, 248, 0, 247, 0, 0, 298, 0, - 0, 0, 300, 0, 220, 0, 0, 224, 0, 0, - 228, 287, 0, 279, 288, 282, 0, 286, 0, 247, - 280, 0, 247, 0, 0, 299, 0, 0, 0, 301, - 0, 0, 0, 293, 0, 292, 75, 102, 350, 0, - 0, 107, 269, 272, 0, 108, 275, 111, 136, 113, - 114, 78, 118, 119, 72, 120, 123, 76, 79, 247, - 73, 81, 126, 74, 128, 77, 130, 131, 276, 133, - 134, 138, 0, 104, 103, 106, 90, 105, 89, 0, - 99, 270, 268, 0, 0, 0, 340, 0, 100, 146, - 147, 152, 0, 145, 0, 310, 311, 0, 338, 0, - 0, 340, 0, 101, 0, 0, 0, 313, 318, 316, - 319, 0, 0, 317, 318, 0, 314, 0, 315, 271, - 321, 0, 271, 320, 0, 323, 324, 0, 271, 325, - 326, 0, 0, 327, 0, 0, 0, 328, 329, 164, - 163, 0, 0, 0, 297, 0, 0, 0, 312, 284, - 277, 0, 285, 281, 0, 283, 273, 0, 274, 278, - 0, 0, 340, 0, 335, 93, 0, 0, 97, 84, - 0, 86, 95, 0, 87, 96, 98, 88, 94, 85, - 0, 91, 168, 166, 170, 167, 165, 169, 343, 6, - 344, 4, 2, 65, 92, 0, 0, 68, 70, 69, - 31, 5, 0, 66, 0, 45, 44, 43, 0, 0, - 58, 0, 59, 35, 36, 37, 38, 40, 41, 62, - 39, 0, 45, 0, 0, 0, 0, 0, 54, 0, - 55, 0, 0, 26, 0, 0, 63, 27, 0, 30, - 28, 24, 0, 29, 25, 0, 56, 0, 57, 146, - 0, 60, 64, 0, 0, 0, 0, 61, 0, 52, - 46, 53, 47, 0, 0, 0, 0, 49, 0, 50, - 51, 48, 0, 0, 146, 271, 0, 0, 42, 75, - 108, 275, 111, 136, 113, 114, 78, 118, 119, 120, - 123, 76, 79, 247, 81, 126, 74, 128, 77, 130, - 131, 276, 133, 134, 138, 0, 32, 33, 0, 34, - 8, 0, 10, 0, 9, 0, 1, 21, 12, 0, - 13, 0, 14, 0, 19, 20, 0, 15, 16, 0, - 17, 18, 11, 23, 7, 351}; + 0, 0, 28, 0, 0, 0, 28, 0, 184, 251, + 215, 223, 219, 163, 235, 211, 3, 148, 81, 164, + 227, 231, 152, 181, 162, 167, 147, 201, 188, 0, + 88, 89, 84, 0, 78, 73, 355, 0, 0, 0, + 0, 86, 0, 0, 82, 85, 77, 0, 0, 74, + 76, 79, 75, 87, 80, 0, 83, 0, 0, 177, + 0, 0, 164, 183, 166, 165, 0, 0, 0, 179, + 180, 178, 182, 0, 212, 0, 0, 0, 0, 202, + 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, + 186, 187, 185, 190, 194, 193, 191, 189, 204, 203, + 205, 0, 220, 0, 216, 0, 0, 158, 145, 157, + 146, 114, 115, 116, 141, 117, 142, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 143, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 144, 0, 0, 156, 252, 159, 0, 160, 0, + 161, 155, 0, 248, 241, 239, 246, 247, 245, 244, + 250, 243, 242, 240, 249, 236, 0, 224, 0, 0, + 228, 0, 0, 232, 0, 0, 158, 150, 0, 149, + 0, 154, 168, 0, 344, 344, 345, 0, 342, 0, + 343, 0, 346, 259, 266, 265, 273, 261, 0, 262, + 0, 347, 0, 354, 263, 264, 81, 269, 267, 351, + 348, 353, 270, 0, 281, 0, 0, 0, 0, 338, + 0, 355, 253, 295, 0, 0, 0, 282, 0, 0, + 271, 272, 0, 260, 268, 296, 297, 0, 344, 0, + 0, 346, 0, 339, 340, 0, 328, 352, 0, 312, + 313, 314, 315, 0, 308, 309, 310, 311, 336, 337, + 0, 0, 0, 0, 0, 300, 301, 302, 257, 255, + 217, 225, 221, 237, 213, 258, 0, 164, 229, 233, + 206, 195, 0, 0, 214, 0, 0, 0, 0, 207, + 0, 0, 0, 0, 0, 199, 197, 200, 198, 196, + 209, 208, 210, 0, 222, 0, 218, 0, 256, 164, + 0, 238, 253, 254, 0, 253, 0, 0, 304, 0, + 0, 0, 306, 0, 226, 0, 0, 230, 0, 0, + 234, 293, 0, 285, 294, 288, 0, 292, 0, 253, + 286, 0, 253, 0, 0, 305, 0, 0, 0, 307, + 0, 0, 0, 299, 0, 298, 81, 108, 356, 0, + 0, 113, 275, 278, 0, 114, 281, 117, 142, 119, + 120, 84, 124, 125, 78, 126, 129, 82, 85, 253, + 79, 87, 132, 80, 134, 83, 136, 137, 282, 139, + 140, 144, 0, 110, 109, 112, 96, 111, 95, 0, + 105, 276, 274, 0, 0, 0, 346, 0, 106, 152, + 153, 158, 0, 151, 0, 316, 317, 0, 344, 0, + 0, 346, 0, 107, 0, 0, 0, 319, 324, 322, + 325, 0, 0, 323, 324, 0, 320, 0, 321, 277, + 327, 0, 277, 326, 0, 329, 330, 0, 277, 331, + 332, 0, 0, 333, 0, 0, 0, 334, 335, 170, + 169, 0, 0, 0, 303, 0, 0, 0, 318, 290, + 283, 0, 291, 287, 0, 289, 279, 0, 280, 284, + 0, 0, 346, 0, 341, 99, 0, 0, 103, 90, + 0, 92, 101, 0, 93, 102, 104, 94, 100, 91, + 0, 97, 174, 172, 176, 173, 171, 175, 349, 6, + 350, 4, 2, 71, 98, 0, 0, 74, 76, 75, + 37, 5, 0, 72, 0, 51, 50, 49, 0, 0, + 64, 0, 65, 41, 42, 43, 44, 46, 47, 68, + 45, 0, 51, 0, 0, 0, 0, 0, 60, 0, + 61, 0, 0, 32, 0, 0, 69, 33, 0, 36, + 34, 30, 0, 35, 31, 0, 62, 0, 63, 152, + 0, 66, 70, 0, 0, 0, 0, 67, 0, 58, + 52, 59, 53, 0, 0, 0, 0, 55, 0, 56, + 57, 54, 0, 0, 152, 277, 0, 0, 48, 81, + 114, 281, 117, 142, 119, 120, 84, 124, 125, 126, + 129, 82, 85, 253, 87, 132, 80, 134, 83, 136, + 137, 282, 139, 140, 144, 0, 38, 39, 0, 40, + 8, 0, 0, 9, 0, 11, 0, 10, 0, 1, + 27, 15, 14, 26, 13, 12, 29, 7, 0, 18, + 0, 19, 0, 24, 25, 0, 20, 21, 0, 22, + 23, 16, 17, 357}; const short QQmlJSGrammar::goto_default [] = { - 7, 636, 211, 198, 209, 521, 509, 635, 654, 508, - 634, 632, 637, 22, 633, 18, 520, 562, 552, 559, - 554, 539, 193, 197, 199, 204, 234, 212, 231, 543, - 583, 582, 203, 233, 26, 487, 486, 359, 358, 9, - 357, 360, 202, 480, 361, 109, 17, 147, 24, 13, - 146, 19, 25, 59, 23, 8, 28, 27, 280, 15, - 274, 10, 270, 12, 272, 11, 271, 20, 278, 21, - 279, 14, 273, 269, 310, 414, 275, 276, 205, 195, - 194, 208, 207, 230, 196, 364, 363, 232, 471, 470, - 332, 333, 473, 335, 472, 334, 427, 431, 434, 430, - 429, 449, 450, 200, 186, 201, 210, 0}; + 7, 639, 211, 198, 209, 521, 509, 634, 647, 508, + 633, 637, 635, 643, 22, 640, 638, 636, 18, 520, + 562, 552, 559, 554, 539, 193, 197, 199, 204, 234, + 212, 231, 543, 583, 582, 203, 233, 26, 487, 486, + 359, 358, 9, 357, 360, 202, 480, 361, 109, 17, + 147, 24, 13, 146, 19, 25, 59, 23, 8, 28, + 27, 280, 15, 274, 10, 270, 12, 272, 11, 271, + 20, 278, 21, 279, 14, 273, 269, 310, 414, 275, + 276, 205, 195, 194, 208, 207, 230, 196, 364, 363, + 232, 471, 470, 332, 333, 473, 335, 472, 334, 427, + 431, 434, 430, 429, 449, 450, 200, 186, 201, 210, + 0}; const short QQmlJSGrammar::action_index [] = { - 235, 1289, 2663, 2663, 2562, 1005, 64, 90, 103, -105, - 88, 94, 79, 173, -105, 302, 69, -105, -105, 724, - 65, 135, 195, 239, -105, -105, -105, 367, 278, 1289, - -105, -105, -105, 485, -105, -105, 2360, 1772, 1289, 1289, - 1289, -105, 817, 1289, -105, -105, -105, 1289, 1289, -105, - -105, -105, -105, -105, -105, 1289, -105, 1289, 1289, -105, - 1289, 1289, 95, 207, -105, -105, 1289, 1289, 1289, -105, - -105, -105, 202, 1289, 300, 1289, 1289, 1289, 1289, 377, - 1289, 1289, 1289, 1289, 1289, 1289, 253, 1289, 1289, 1289, - 151, 147, 129, 196, 170, 199, 279, 270, 470, 470, - 387, 1289, 53, 1289, 80, 2158, 1289, 1289, -105, -105, - -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, - -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, - -105, -105, -105, -105, -105, -105, -105, -105, -105, -105, - -105, -105, 128, 1289, -105, -105, 74, 52, -105, 1289, - -105, -105, 1289, -105, -105, -105, -105, -105, -105, -105, - -105, -105, -105, -105, -105, -105, 1289, 51, 1289, 1289, - 77, 66, 1289, -105, 2158, 1289, 1289, -105, 125, -105, - 48, -105, -105, 47, 451, 374, 83, 87, -105, 397, - -105, 62, 2663, -105, -105, -105, -105, -105, 205, -105, - 415, -105, 68, -105, -105, -105, 86, -105, -105, -105, - 2663, -105, -105, 622, -105, 576, 102, 2562, 75, 89, - 81, 2865, 1289, -105, 70, 1289, 63, -105, 92, 93, - -105, -105, 546, -105, -105, -105, -105, 91, 546, 40, - 45, 2663, 49, -105, -105, 2562, -105, -105, 106, -105, - -105, -105, -105, 121, -105, -105, -105, -105, -105, -105, - 42, 44, 1289, 114, 222, -105, -105, -105, 1481, -105, - 84, 57, 56, -105, 388, 78, 54, 682, 82, 99, - 357, 247, 546, 1289, 295, 1289, 1289, 1289, 1289, 334, - 1289, 1289, 1289, 1289, 1289, 203, 217, 244, 263, 211, - 341, 319, 351, 1289, 56, 1289, 73, 1289, -105, 724, - 1289, -105, 1289, 67, 46, 1289, 61, 2562, -105, 1289, - 136, 2562, -105, 1289, 76, 1289, 1289, 85, 59, 1289, - -105, 71, 133, 72, -105, -105, 1289, -105, 546, 1289, - -105, -53, 1289, -60, 2562, -105, 1289, 143, 2562, -105, - 1289, 132, 2562, 8, 2562, -105, 7, -105, 12, -37, - 107, -105, -105, 2562, -33, 622, 22, 555, 115, 1289, - 2562, 23, -13, 502, 2259, -10, 817, 18, 6, 1387, - 2259, 0, 9, -6, 1289, -4, -23, 1289, 5, 1289, - -25, -27, 2461, -105, -105, -105, -105, -105, -105, 1289, - -105, -105, -105, -3, -1, 21, 2663, 1, -105, 218, - -105, 1289, 4, -105, 111, -105, -105, 26, 466, 16, - 38, 2663, 39, -105, 1289, 110, 37, -105, 55, -105, - 60, 116, 1289, -105, 58, 43, -105, -15, -105, 2562, - -105, 123, 2562, -105, 154, -105, -105, 96, 2562, 32, - -105, 3, 14, -105, 546, -11, 13, -105, -105, -105, - -105, 1289, 126, 2562, -105, 1289, 130, 2562, -105, 15, - -105, 301, -105, -105, 1289, -105, -105, 546, -105, -105, - -45, -12, 2663, -24, -105, -105, 204, 1578, -105, -105, - 1869, -105, -105, 1675, -105, -105, -105, -105, -105, -105, - 101, -105, -105, -105, -105, -105, -105, -105, -105, -105, - 2663, -105, -105, -105, 105, 2, 910, 206, -47, -2, - -105, -105, 246, -105, 214, -105, -105, -105, 364, 232, - -105, 1963, -105, -105, -105, -105, -105, -105, -105, -105, - -105, 191, 24, 394, 172, -18, 384, 215, -105, -30, - -105, 910, 149, -105, -16, 910, -105, -105, 1100, -105, - -105, -105, 1195, -105, -105, 225, -105, 1963, -105, 316, - -17, -105, -105, 269, 418, -5, 1963, -105, 184, -105, - 175, -105, 20, -9, 546, 182, 469, -105, 104, -105, - -105, -105, 2057, 910, 292, 2764, 1772, 10, -105, 35, - 622, 34, 525, 98, 1289, 2562, 50, 17, 536, 19, - 817, 31, 27, 1387, 28, 9, 29, 1289, 30, 11, - 1289, 41, 1289, 33, 36, 137, -105, -105, 25, -105, - -105, 910, -105, 268, -86, 910, -105, -105, 141, 546, - -105, 156, -105, 117, -105, -105, 546, -105, -105, 138, - -105, -105, -105, -105, -105, -105, + 239, 1406, 2692, 2692, 2794, 1119, 115, 29, 168, -106, + 26, -23, -60, 225, -106, 306, 33, -106, -106, 732, + -2, 145, 243, 223, -106, -106, -106, 379, 227, 1406, + -106, -106, -106, 539, -106, -106, 2488, 1698, 1406, 1406, + 1406, -106, 1023, 1406, -106, -106, -106, 1406, 1406, -106, + -106, -106, -106, -106, -106, 1406, -106, 1406, 1406, -106, + 1406, 1406, 114, 206, -106, -106, 1406, 1406, 1406, -106, + -106, -106, 211, 1406, 302, 1406, 1406, 1406, 1406, 369, + 1406, 1406, 1406, 1406, 1406, 1406, 226, 1406, 1406, 1406, + 135, 151, 110, 257, 279, 276, 256, 222, 475, 475, + 475, 1406, 7, 1406, 57, 2284, 1406, 1406, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, + -106, -106, 136, 1406, -106, -106, 30, -24, -106, 1406, + -106, -106, 1406, -106, -106, -106, -106, -106, -106, -106, + -106, -106, -106, -106, -106, -106, 1406, 2, 1406, 1406, + 10, 97, 1406, -106, 2284, 1406, 1406, -106, 141, -106, + -45, -106, -106, 4, 457, 386, 89, 79, -106, 448, + -106, 74, 2692, -106, -106, -106, -106, -106, 164, -106, + 460, -106, 85, -106, -106, -106, 96, -106, -106, -106, + 2692, -106, -106, 547, -106, 629, 143, 2794, 62, 54, + 43, 2998, 1406, -106, 51, 1406, 52, -106, 47, 45, + -106, -106, 454, -106, -106, -106, -106, 64, 352, 31, + 61, 2692, 27, -106, -106, 2794, -106, -106, 139, -106, + -106, -106, -106, 126, -106, -106, -106, -106, -106, -106, + -6, 25, 1406, 130, 159, -106, -106, -106, 1600, -106, + 68, 65, 5, -106, 308, 60, 3, 835, 99, 105, + 337, 207, 408, 1406, 317, 1406, 1406, 1406, 1406, 353, + 1406, 1406, 1406, 1406, 1406, 186, 203, 204, 212, 219, + 333, 343, 359, 1406, 20, 1406, 202, 1406, -106, 732, + 1406, -106, 1406, 81, 72, 1406, 77, 2794, -106, 1406, + 149, 2794, -106, 1406, 80, 1406, 1406, 94, 88, 1406, + -106, -8, 128, -25, -106, -106, 1406, -106, 471, 1406, + -106, -53, 1406, -56, 2794, -106, 1406, 134, 2794, -106, + 1406, 138, 2794, -5, 2794, -106, -4, -106, 9, -9, + 37, -106, -106, 2794, -12, 555, 32, 629, 123, 1406, + 2794, 41, 18, 504, 2386, 21, 1023, 49, 46, 1505, + 2386, 42, 16, 44, 1406, 24, -10, 1406, 17, 1406, + -15, -18, 2590, -106, -106, -106, -106, -106, -106, 1406, + -106, -106, -106, -1, -26, -3, 2692, -27, -106, 277, + -106, 1406, -28, -106, 90, -106, -106, 1, 552, -40, + -11, 2692, -29, -106, 1406, 117, 14, -106, 50, -106, + 40, 119, 1406, -106, 11, 35, -106, -54, -106, 2794, + -106, 116, 2794, -106, 267, -106, -106, 121, 2794, -7, + -106, -31, -19, -106, 376, 6, 78, -106, -106, -106, + -106, 1406, 98, 2794, -106, 1406, 106, 2794, -106, 76, + -106, 254, -106, -106, 1406, -106, -106, 552, -106, -106, + 71, 75, 2692, 67, -106, -106, 122, 1992, -106, -106, + 1796, -106, -106, 1894, -106, -106, -106, -106, -106, -106, + 113, -106, -106, -106, -106, -106, -106, -106, -106, -106, + 2692, -106, -106, -106, 111, 22, 929, 152, 39, 48, + -106, -106, 301, -106, 147, -106, -106, -106, 468, 155, + -106, 2182, -106, -106, -106, -106, -106, -106, -106, -106, + -106, 178, -30, 463, 181, -14, 400, 229, -106, -32, + -106, 929, 104, -106, 0, 929, -106, -106, 1311, -106, + -106, -106, 1215, -106, -106, 248, -106, 2182, -106, 392, + 59, -106, -106, 244, 552, 73, 2182, -106, 236, -106, + 237, -106, 70, 15, 368, 214, 355, -106, 103, -106, + -106, -106, 2087, 721, 392, 2896, 1698, 34, -106, 56, + 598, 55, 629, 107, 1406, 2794, 53, 23, 544, 36, + 1023, 58, 66, 1505, 69, 38, 63, 1406, 95, 84, + 1406, 102, 1406, 83, 82, 124, -106, -106, 87, -106, + -106, 929, 813, 91, 929, -106, 271, -106, 86, -106, + -106, 100, 101, -106, -106, -106, -106, -106, 552, -106, + 209, -106, 109, -106, -106, 552, -106, -106, 92, -106, + -106, -106, -106, -106, - -108, 0, 79, 128, 132, 301, 2, -108, -108, -108, - -108, -108, -108, -108, -108, -108, -108, -108, -108, -47, - -108, -108, -108, -108, -108, -108, -108, -108, -108, 51, - -108, -108, -108, -3, -108, -108, 8, -23, 12, 78, - 106, -108, 69, 74, -108, -108, -108, 195, 204, -108, - -108, -108, -108, -108, -108, 188, -108, 201, 200, -108, - 127, 129, -108, -108, -108, -108, 140, 137, 133, -108, - -108, -108, -108, 146, -108, 177, 168, 170, 167, -108, - 144, 152, 166, 158, 160, 131, -108, 194, 187, 207, - -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, - -108, 88, -108, 112, -108, 121, 90, -38, -108, -108, - -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, - -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, - -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, - -108, -108, -108, 32, -108, -108, -108, -108, -108, 26, - -108, -108, 27, -108, -108, -108, -108, -108, -108, -108, - -108, -108, -108, -108, -108, -108, 102, -108, 103, 41, - -108, -108, 37, -108, 250, 38, 83, -108, -108, -108, - -108, -108, -108, -108, 42, 126, -108, -108, -108, 40, - -108, -108, 43, -108, -108, -108, -108, -108, -108, -108, - 39, -108, -108, -108, -108, -108, -108, -108, -108, -108, - 225, -108, -108, 30, -108, 24, -108, 211, -108, 55, - -108, 77, 60, -108, -108, 66, 34, -108, -108, -108, - -108, -108, -8, -108, -108, -108, -108, -108, 153, -108, - -108, 164, -108, -108, -108, 241, -108, -108, -108, -108, - -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, - -108, -108, 11, -108, -108, -108, -108, -108, 179, -108, - -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, - -108, -108, 19, 259, -108, 255, 228, 240, 246, -108, - 52, 63, 67, 65, 50, -108, -108, -108, -108, -108, - -108, -108, -108, 210, -108, 256, -108, 226, -108, -108, - 252, -108, 161, -108, -108, 268, -108, 197, -108, 5, - -108, 218, -108, 222, -108, 213, 249, -108, -108, 236, - -108, -108, -108, -108, -108, -108, 212, -108, 80, 87, - -108, -108, 86, -108, 98, -108, 61, -108, 245, -108, - 59, -108, 208, -108, 192, -108, -108, -108, -108, -108, - -108, -108, -108, 257, -108, 33, -108, 28, -108, 73, - 71, -108, -108, 36, 57, -108, 62, -108, -108, 46, - 70, -108, -108, -108, 49, -108, 45, 99, -108, 84, - -108, -108, 100, -108, -108, -108, -108, -108, -108, 21, - -108, -108, -108, -108, -108, -108, 118, -108, -108, -108, - -108, 81, -108, -108, -108, -108, -108, -108, 123, -108, - -108, 134, -108, -108, 56, -108, -108, -108, -108, -108, - -58, -108, 47, -108, -57, -108, -108, -108, -108, 265, - -108, -108, 374, -108, -108, -108, -108, -108, 94, -66, - -108, -108, 25, -108, 22, -108, 31, -108, -108, -108, - -108, 58, -108, 229, -108, 35, -108, 235, -108, -108, - -108, -108, -108, -108, 29, -108, -108, 186, -108, -108, - -108, -108, 162, -108, -108, -108, -108, 48, -108, -108, - 163, -108, -108, 44, -108, -108, -108, -108, -108, -108, - -108, -108, -108, -108, -108, -108, -108, -108, -108, -108, - 141, -108, -108, -108, -108, -108, -7, -108, -108, -108, - -108, -108, -108, -108, -19, -108, -108, -108, -6, -108, - -108, 334, -108, -108, -108, -108, -108, -108, -108, -108, - -108, -108, -108, -15, -27, -108, -10, -108, -108, -108, - -108, 159, -108, -108, -108, 176, -108, -108, 319, -108, - -108, -108, 322, -108, -108, -108, -108, 469, -108, -108, - 10, -108, -108, 6, 16, -108, 342, -108, -108, -108, - 17, -108, -108, -108, 15, 3, 9, -108, -108, -108, - -108, -108, 358, 68, -108, 82, 310, 1, -108, -108, - -2, -108, 7, -108, 54, 76, -108, -108, 4, -108, - 64, -108, -108, 23, -108, -108, -108, 18, -108, -5, - 95, -108, 91, -108, -108, -108, -108, -108, -1, -108, - -108, 20, -108, -108, 14, 142, -108, -108, -108, 13, - -108, -108, -108, -108, -108, -108, -11, -108, -108, -108, - -108, -108, -108, -108, -108, -108}; + -111, 43, 59, 70, 71, 369, 40, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, 21, + -111, -111, -111, -111, -111, -111, -111, -111, -111, 79, + -111, -111, -111, -16, -111, -111, 5, -26, 23, 73, + 91, -111, 83, 61, -111, -111, -111, 88, 87, -111, + -111, -111, -111, -111, -111, 29, -111, 66, 39, -111, + 97, 193, -111, -111, -111, -111, 160, 180, 183, -111, + -111, -111, -111, 176, -111, 167, 151, 155, 152, -111, + 148, 187, 195, 197, 199, 201, -111, 186, 92, 194, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, 103, -111, 108, -111, 181, -2, -42, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, 34, -111, -111, -111, -111, -111, 3, + -111, -111, 10, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, 127, -111, 109, 15, + -111, -111, 16, -111, 225, 44, 128, -111, -111, -111, + -111, -111, -111, -111, 25, 157, -111, -111, -111, 26, + -111, -111, 24, -111, -111, -111, -111, -111, -111, -111, + 22, -111, -111, -111, -111, -111, -111, -111, -111, -111, + 179, -111, -111, 45, -111, 46, -111, 107, -111, 48, + -111, 106, 62, -111, -111, 163, -3, -111, -111, -111, + -111, -111, -14, -111, -111, -111, -111, -111, 57, -111, + -111, 224, -111, -111, -111, 227, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, 35, -111, -111, -111, -111, -111, 72, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, 12, 264, -111, 258, 246, 254, 209, -111, + 60, 51, 52, 27, 53, -111, -111, -111, -111, -111, + -111, -111, -111, 244, -111, 255, -111, 203, -111, -111, + 207, -111, 217, -111, -111, 198, -111, 208, -111, 8, + -111, 215, -111, 232, -111, 233, 234, -111, -111, 223, + -111, -111, -111, -111, -111, -111, 230, -111, 95, 113, + -111, -111, 153, -111, 156, -111, 2, -111, 147, -111, + 58, -111, 137, -111, 100, -111, -111, -111, -111, -111, + -111, -111, -111, 135, -111, 41, -111, 54, -111, 117, + 162, -111, -111, 50, 169, -111, 174, -111, -111, 32, + 178, -111, -111, -111, 31, -111, 7, 144, -111, 130, + -111, -111, 142, -111, -111, -111, -111, -111, -111, 11, + -111, -111, -111, -111, -111, -111, 214, -111, -111, -111, + -111, 140, -111, -111, -111, -111, -111, -111, 158, -111, + -111, 149, -111, -111, 47, -111, -111, -111, -111, -111, + -55, -111, 38, -111, -67, -111, -111, -111, -111, 263, + -111, -111, 262, -111, -111, -111, -111, -111, 190, -76, + -111, -111, 30, -111, 19, -111, 14, -111, -111, -111, + -111, 33, -111, 272, -111, 64, -111, 175, -111, -111, + -111, -111, -111, -111, 18, -111, -111, 69, -111, -111, + -111, -111, 114, -111, -111, -111, -111, 20, -111, -111, + 110, -111, -111, 28, -111, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, -111, -111, + 86, -111, -111, -111, -111, -111, 55, -111, -111, -111, + -111, -111, -111, -111, -7, -111, -111, -111, 1, -111, + -111, 329, -111, -111, -111, -111, -111, -111, -111, -111, + -111, -111, -111, 0, -11, -111, -10, -111, -111, -111, + -111, 204, -111, -111, -111, 205, -111, -111, 317, -111, + -111, -111, 311, -111, -111, -111, -111, 370, -111, -111, + -9, -111, -111, -4, -12, -111, 337, -111, -111, -111, + -18, -111, -111, -111, -1, -17, -6, -111, -111, -111, + -111, -111, 466, 78, -111, 82, 307, -13, -111, -111, + -8, -111, 6, -111, 74, 76, -111, -111, 9, -111, + 85, -111, -111, 17, -111, -111, -111, 4, -111, -22, + 84, -111, 67, -111, -111, -111, -111, -111, 49, -111, + -111, 37, 42, 68, 77, -111, -111, -111, -111, -111, + -111, -111, -111, -111, -111, -111, -111, -111, 13, -111, + -111, -111, -111, -111, -111, 36, -111, -111, -111, -111, + -111, -111, -111, -111}; const short QQmlJSGrammar::action_info [] = { - 344, -127, 576, -129, 551, 631, 546, -105, 342, 465, - 448, 461, -132, -106, 245, 481, 558, 558, 398, 573, - 392, 482, 402, 268, 354, -124, 350, 578, 585, -135, - -116, 484, 474, 404, -106, -105, -127, -129, -124, 454, - 438, -135, 245, 558, 448, 424, 448, 448, -132, 456, - 439, 588, 452, 268, 406, 350, 408, -116, 558, 405, - 432, 544, 418, 432, 413, 432, 329, 166, 524, 461, - 428, 421, 465, 172, 283, 143, 420, 143, 241, 166, - 262, 73, 149, 185, 323, 283, 307, 323, 336, 73, - 655, 189, 0, 245, 423, 192, 448, 0, 0, 101, - 240, 0, 451, 346, 243, 303, 424, 315, 181, 143, - 0, 268, 151, 0, 399, 312, 452, 350, 143, 261, - 174, 317, 143, 244, 303, 184, 435, 238, 461, 465, - 442, 143, 103, 143, 143, 305, 143, 64, 143, 175, - 143, 338, 101, 60, 143, 555, 0, 191, 65, 325, - 0, 143, 0, 326, 61, 631, 174, 555, 103, 259, - 258, 501, 143, 259, 258, 590, 589, 252, 251, 60, - 426, 436, 416, 415, 264, 175, 259, 258, 645, 644, - 61, 179, 257, 256, 144, 168, 463, 60, 105, 169, - 467, 60, 352, 626, 339, 87, 321, 88, 61, 651, - 650, 525, 61, 348, 525, 556, 174, 106, 89, 107, - 174, 525, 490, 143, 66, 446, 445, 648, 647, 66, - 580, 87, 549, 88, 87, 175, 88, 411, 87, 175, - 88, 176, 567, 174, 89, 542, 87, 89, 88, 531, - 0, 89, 87, 525, 88, 581, 579, 527, 646, 89, - 527, 66, 175, 592, 411, 89, 0, 527, 526, 67, - 491, 526, 0, 0, 67, 68, 236, 235, 526, 87, - 68, 88, 87, 0, 88, 0, 550, 548, 87, 558, - 88, 527, 89, 267, 265, 89, 568, 566, 87, 527, - 88, 89, 526, 532, 530, 87, 67, 88, 525, 0, - 526, 89, 68, 87, 87, 88, 88, 174, 89, 477, - 0, 266, 0, 285, 286, 641, 89, 89, 75, 76, - 75, 76, 0, 0, 0, -92, 175, 0, 176, 642, - 640, 174, 6, 5, 4, 1, 3, 2, 0, 593, - 287, 288, 290, 291, 527, 77, 78, 77, 78, -92, - 175, 292, 176, 0, 293, 526, 294, 290, 291, 0, - 639, 0, 478, 476, 290, 291, 292, 0, 0, 293, - 0, 294, 0, 292, 290, 291, 293, 0, 294, 0, - 290, 291, 0, 292, 0, 0, 293, 0, 294, 292, - 80, 81, 293, 35, 294, 0, 0, 0, 82, 83, - 80, 81, 84, 35, 85, 0, 285, 286, 82, 83, - 80, 81, 84, 35, 85, 0, 0, 0, 82, 83, - 0, 0, 84, 35, 85, 0, 35, 0, 0, 0, - 49, 52, 50, 287, 288, 0, 0, 0, 0, 0, - 49, 52, 50, 0, 35, 0, 0, 35, 0, 0, - 49, 52, 50, 0, 0, 0, 0, 46, 34, 51, - 49, 52, 50, 49, 52, 50, 0, 46, 34, 51, - 0, 0, 0, 0, 0, 0, 0, 46, 34, 51, - 35, 49, 52, 50, 49, 52, 50, 46, 34, 51, - 46, 34, 51, 80, 81, 35, 0, 0, 35, 0, - 0, 82, 83, 0, 0, 84, 0, 85, 46, 34, - 51, 46, 34, 51, 35, 0, 0, 49, 52, 50, - 0, 184, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 35, 49, 52, 50, 49, 52, 50, 184, 0, - 0, 0, 0, 0, 46, 34, 51, 0, 0, 0, - 0, 49, 52, 50, 35, 0, 0, 0, 0, 46, - 34, 51, 46, 34, 51, 35, 0, 0, 49, 52, - 50, 0, 184, 0, 0, 35, 0, 0, 46, 34, - 51, 0, 0, 0, 35, 0, 255, 254, 0, 0, - 0, 49, 52, 50, 0, 46, 34, 51, 0, 0, - 0, 0, 49, 52, 50, 35, 0, 0, 0, 0, - 0, 0, 49, 52, 50, 0, 255, 254, 46, 34, - 51, 49, 52, 50, 0, 0, 0, 0, 0, 46, - 34, 51, 0, 0, 0, 0, 0, 255, 254, 46, - 34, 51, 49, 52, 50, 0, 0, 0, 46, 34, - 51, 35, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 46, - 34, 51, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 250, 249, 153, 0, 0, 49, 52, - 50, 0, 0, 0, 0, 154, 0, 0, 0, 155, - 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, - 157, 0, 0, 319, 0, 46, 34, 51, 0, 0, - 0, 158, 0, 159, 64, 0, 0, 153, 0, 0, - 0, 160, 0, 0, 161, 65, 0, 154, 0, 0, - 162, 155, 0, 0, 0, 0, 163, 0, 0, 0, - 156, 0, 157, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 164, 158, 0, 159, 64, 0, 0, 0, - 0, 0, 0, 160, 0, 0, 161, 65, 0, 0, - 0, 0, 162, 0, 0, 0, 0, 0, 163, 0, + 166, 438, 551, 245, 344, 454, 346, 544, 342, 336, + 546, 354, 166, 452, 448, 181, 432, 392, 465, 103, + 420, 461, 421, 448, -138, 101, 423, 73, 408, 663, + 406, -135, 413, 558, 405, 404, 151, 418, 149, -141, + 185, 143, 439, 402, 399, 432, 398, 428, -122, -111, + 101, -133, 424, -112, 268, 432, -130, 350, 73, 268, + -122, 262, -141, 245, 312, -130, 456, 558, 307, 283, + -133, 261, 350, -112, 424, 588, -111, 578, 585, 350, + 576, 465, 243, 461, 305, 448, 103, 424, 524, 143, + 184, 240, 558, 474, 241, 329, 323, 189, 268, 305, + 238, 323, -135, 245, 172, 573, 143, 192, 482, -138, + 0, 448, 555, 303, 143, 174, 174, 448, 465, 461, + 558, 143, 484, 442, 143, 143, 174, 451, 303, 435, + 490, 481, 555, 315, 175, 175, 338, 317, 143, 191, + 244, 452, 143, 0, 143, 175, 143, 662, 661, 143, + 60, 416, 415, 660, 659, 325, 64, 143, 463, 326, + 556, 61, 531, 0, 590, 589, 467, 65, 259, 258, + 654, 653, 143, 501, 436, 60, 525, 426, 491, 0, + 626, 542, 631, 632, 259, 258, 61, 257, 256, 339, + 264, 60, 144, 174, 348, 168, 0, 179, 352, 169, + 252, 251, 61, 283, 259, 258, 631, 632, 60, 321, + 525, 87, 175, 88, 411, 0, 532, 530, 66, 61, + 267, 265, 527, 66, 89, 236, 235, 527, 87, 87, + 88, 88, 87, 526, 88, 66, 549, 87, 526, 88, + 105, 89, 89, 525, 87, 89, 88, 87, 266, 88, + 89, 87, 87, 88, 88, 567, 527, 89, 174, 106, + 89, 107, 477, 67, 89, 89, 525, 526, 67, 68, + 657, 656, 580, 525, 68, 143, 0, 175, 0, 176, + 67, 87, 87, 88, 88, 0, 68, 0, 0, 527, + 550, 548, 174, 0, 89, 89, 0, 581, 579, 0, + 526, 87, 655, 88, 87, 0, 88, 0, 592, 568, + 566, 175, 527, 411, 89, 478, 476, 89, 650, 527, + 75, 76, 0, 526, 75, 76, 285, 286, 446, 445, + 526, 0, 651, 649, 558, 285, 286, 6, 5, 4, + 1, 3, 2, 0, 0, 0, 0, 77, 78, 0, + 0, 77, 78, 287, 288, 0, 290, 291, 0, 0, + 290, 291, 287, 288, 648, 292, 290, 291, 293, 292, + 294, 0, 293, 0, 294, 292, 290, 291, 293, 0, + 294, 35, 290, 291, 35, 292, 0, 0, 293, 0, + 294, 292, 80, 81, 293, 593, 294, 35, 0, 0, + 82, 83, 80, 81, 84, 35, 85, 174, 0, 0, + 82, 83, 0, 0, 84, 35, 85, 0, 49, 52, + 50, 49, 52, 50, 0, -98, 175, 0, 176, 35, + 0, 0, 0, 0, 49, 52, 50, 35, 0, 0, + 0, 0, 49, 52, 50, 0, 46, 34, 51, 46, + 34, 51, 49, 52, 50, 0, 0, 0, 0, 0, + 0, 0, 46, 34, 51, 0, 49, 52, 50, 0, + 46, 34, 51, 0, 49, 52, 50, 35, 0, 0, + 46, 34, 51, 35, 0, 0, 35, 0, 0, 35, + 0, 0, 35, 0, 46, 34, 51, 35, 80, 81, + 35, 0, 46, 34, 51, 0, 82, 83, 0, 0, + 84, 0, 85, 0, 49, 52, 50, 0, 0, 0, + 49, 52, 50, 49, 52, 50, 49, 52, 50, 49, + 52, 50, 0, 35, 49, 52, 50, 49, 52, 50, + 184, 0, 46, 34, 51, 0, 0, 0, 46, 34, + 51, 46, 34, 51, 46, 34, 51, 46, 34, 51, + 0, 0, 46, 34, 51, 46, 34, 51, 35, 0, + 49, 52, 50, 35, 0, 184, 35, 0, 0, 0, + 184, 35, 0, 0, 35, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 46, 34, + 51, 0, 0, 0, 0, 49, 52, 50, 250, 249, + 49, 52, 50, 49, 52, 50, 250, 249, 49, 52, + 50, 49, 52, 50, 0, 0, 0, 35, 0, 0, + 0, 0, 0, 46, 34, 51, 0, 0, 46, 34, + 51, 46, 34, 51, 0, 0, 46, 34, 51, 46, + 34, 51, 0, 0, 0, 0, 0, 0, 35, 250, + 249, 0, 0, 0, 49, 52, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, - 31, 0, 0, 0, 0, 0, 0, 0, 0, 33, - 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, - 36, 37, 0, 38, 0, 0, 0, 0, 0, 0, - 42, 0, 0, 0, 45, 0, 0, 0, 0, 0, + 255, 254, 46, 34, 51, 49, 52, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 53, 49, 52, 50, 0, 54, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 44, 56, - 32, 0, 0, 0, 41, 0, 0, 0, 0, 0, - 46, 34, 51, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 30, 31, 0, 0, 0, 0, 0, 0, - 0, 0, 33, 0, 0, 0, 0, 0, 0, 35, - 0, 0, 0, 36, 37, 0, 38, 0, 0, 0, - 0, 0, 0, 516, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 53, 49, 52, 50, 0, - 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 44, 56, 32, 0, 0, 0, 41, 0, 0, 0, 0, 0, 46, 34, 51, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 515, 0, 30, 31, 0, - 0, 0, 0, 0, 0, 0, 0, 219, 0, 0, - 0, 0, 0, 0, 35, 0, 0, 0, 36, 37, - 0, 38, 0, 0, 0, 0, 0, 0, 516, 0, - 0, 0, 45, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 30, 31, 153, 0, 0, 0, 0, + 0, 0, 0, 33, 0, 154, 0, 0, 0, 155, + 35, 0, 0, 0, 36, 37, 0, 38, 156, 0, + 157, 0, 0, 0, 516, 0, 0, 0, 45, 0, + 0, 158, 0, 159, 64, 0, 0, 0, 0, 0, + 0, 160, 0, 0, 161, 65, 53, 49, 52, 50, + 162, 54, 0, 0, 0, 0, 163, 0, 0, 0, + 0, 0, 44, 56, 32, 0, 0, 0, 41, 0, + 0, 0, 164, 0, 0, 46, 34, 51, 0, 0, + 0, 0, 0, 0, 0, 30, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 33, 0, 0, 153, 0, + 0, 0, 35, 0, 0, 0, 36, 37, 154, 38, + 0, 0, 155, 0, 0, 0, 516, 0, 0, 0, + 45, 156, 0, 157, 0, 0, 319, 0, 0, 0, + 0, 0, 0, 0, 158, 0, 159, 64, 53, 49, + 52, 50, 0, 54, 160, 0, 0, 161, 65, 0, + 0, 0, 0, 162, 44, 56, 32, 0, 0, 163, + 41, 0, 0, 0, 0, 0, 0, 46, 34, 51, + 0, 0, 0, 0, 0, 164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 53, 517, 519, 518, 0, 54, 0, 0, 0, 0, - 227, 0, 0, 0, 0, 0, 44, 56, 32, 214, - 0, 0, 41, 0, 0, 0, 0, 0, 46, 34, - 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 515, 0, 30, 31, 0, 0, 0, 0, 0, 0, - 0, 0, 219, 0, 0, 0, 0, 0, 0, 35, - 0, 0, 0, 36, 37, 0, 38, 0, 0, 0, - 0, 0, 0, 516, 0, 0, 0, 45, 0, 0, - 0, 0, 0, 0, 0, 560, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 53, 517, 519, 518, 0, - 54, 0, 0, 0, 0, 227, 0, 0, 0, 0, - 0, 44, 56, 32, 214, 0, 0, 41, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 30, 31, 0, 0, 0, 0, 0, 0, 0, + 0, 33, 0, 0, 0, 0, 0, 0, 35, 0, + 0, 0, 36, 37, 0, 38, 0, 0, 0, 0, + 0, 0, 516, 0, 0, 0, 45, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 53, 49, 52, 50, 0, 54, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 44, 56, 32, 0, 0, 0, 41, 0, 0, 0, + 0, 0, 0, 46, 34, 51, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 30, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, + 0, 0, 35, 0, 0, 0, 36, 37, 0, 38, + 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, + 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 53, 49, + 52, 50, 0, 54, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 44, 56, 32, 0, 0, 0, + 41, 0, 0, 0, 0, 0, 0, 46, 34, 51, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 515, + 0, 30, 31, 0, 0, 0, 0, 0, 0, 0, + 0, 219, 0, 0, 0, 0, 0, 0, 35, 0, + 0, 0, 36, 37, 0, 38, 0, 0, 0, 0, + 0, 0, 516, 0, 0, 0, 45, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 53, 517, 519, 518, 0, 54, + 0, 0, 0, 0, 227, 0, 0, 0, 0, 0, + 44, 56, 32, 214, 0, 0, 41, 0, 0, 0, 0, 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 515, 0, 30, 31, 0, 0, 0, 0, 0, 0, 0, 0, 219, 0, 0, @@ -478,84 +484,85 @@ const short QQmlJSGrammar::action_info [] = { 563, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 517, 519, 518, 0, 54, 0, 0, 0, 0, 227, 0, 0, 0, 0, 0, 44, 56, 32, 214, - 0, 0, 41, 0, 0, 0, 0, 0, 46, 34, - 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 29, 30, 31, 0, 0, 0, 0, 0, 0, 0, - 0, 33, 0, 0, 0, 0, 0, 0, 35, 0, - 0, 0, 36, 37, 0, 38, 0, 0, 0, 39, - 0, 40, 42, 43, 0, 0, 45, 0, 0, 0, - 47, 0, 48, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 53, 49, 52, 50, 0, 54, - 0, 55, 0, 57, 0, 58, 0, 0, 0, 0, - 44, 56, 32, 0, 0, 0, 41, 0, 0, 0, - 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -125, 0, 0, 0, 29, 30, - 31, 0, 0, 0, 0, 0, 0, 0, 0, 33, - 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, - 36, 37, 0, 38, 0, 0, 0, 39, 0, 40, - 42, 43, 0, 0, 45, 0, 0, 0, 47, 0, - 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 53, 49, 52, 50, 0, 54, 0, 55, - 0, 57, 0, 58, 0, 0, 0, 0, 44, 56, - 32, 0, 0, 0, 41, 0, 0, 0, 0, 0, - 46, 34, 51, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 29, 30, 31, 0, 0, 0, 0, 0, - 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, + 0, 0, 41, 0, 0, 0, 0, 0, 0, 46, + 34, 51, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 515, 0, 30, 31, 0, 0, 0, 0, 0, + 0, 0, 0, 219, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, 37, 0, 38, 0, 0, - 0, 39, 0, 40, 42, 43, 0, 0, 45, 0, - 0, 0, 47, 0, 48, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 53, 49, 52, 50, - 0, 54, 0, 55, 0, 57, 282, 58, 0, 0, - 0, 0, 44, 56, 32, 0, 0, 0, 41, 0, - 0, 0, 0, 0, 46, 34, 51, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 496, 0, 0, 29, - 30, 31, 0, 0, 0, 0, 0, 0, 0, 0, - 33, 0, 0, 0, 0, 0, 0, 35, 0, 0, - 0, 36, 37, 0, 38, 0, 0, 0, 39, 0, - 40, 42, 43, 0, 0, 45, 0, 0, 0, 47, - 0, 48, 0, 0, 499, 0, 0, 0, 0, 0, - 0, 0, 0, 53, 49, 52, 50, 0, 54, 0, - 55, 0, 57, 0, 58, 0, 0, 0, 0, 44, - 56, 32, 0, 0, 0, 41, 0, 0, 0, 0, - 0, 46, 34, 51, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 496, 0, 0, 29, 30, 31, 0, + 0, 0, 0, 0, 516, 0, 0, 0, 45, 0, + 0, 0, 0, 0, 0, 0, 560, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 53, 517, 519, 518, + 0, 54, 0, 0, 0, 0, 227, 0, 0, 0, + 0, 0, 44, 56, 32, 214, 0, 0, 41, 0, + 0, 0, 0, 0, 0, 46, 34, 51, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 29, 30, 31, + 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, + 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, + 37, 0, 38, 0, 0, 0, 39, 0, 40, 42, + 43, 0, 0, 45, 0, 0, 0, 47, 0, 48, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 53, 49, 52, 50, 0, 54, 0, 55, 0, + 57, 0, 58, 0, 0, 0, 0, 44, 56, 32, + 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, + 46, 34, 51, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -131, 0, 0, 0, 29, 30, 31, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, 37, 0, 38, 0, 0, 0, 39, 0, 40, 42, 43, 0, 0, 45, 0, 0, 0, 47, 0, 48, 0, - 0, 497, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 49, 52, 50, 0, 54, 0, 55, 0, 57, 0, 58, 0, 0, 0, 0, 44, 56, 32, 0, - 0, 0, 41, 0, 0, 0, 0, 0, 46, 34, + 0, 0, 41, 0, 0, 0, 0, 0, 0, 46, + 34, 51, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 29, 30, 31, 0, 0, 0, 0, 0, 0, + 0, 0, 33, 0, 0, 0, 0, 0, 0, 35, + 0, 0, 0, 36, 37, 0, 38, 0, 0, 0, + 39, 0, 40, 42, 43, 0, 0, 45, 0, 0, + 0, 47, 0, 48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 53, 49, 52, 50, 0, + 54, 0, 55, 0, 57, 282, 58, 0, 0, 0, + 0, 44, 56, 32, 0, 0, 0, 41, 0, 0, + 0, 0, 0, 0, 46, 34, 51, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 488, 0, 0, 29, + 30, 31, 0, 0, 0, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 0, 0, 0, 35, 0, 0, + 0, 36, 37, 0, 38, 0, 0, 0, 39, 0, + 40, 42, 43, 0, 0, 45, 0, 0, 0, 47, + 0, 48, 0, 0, 489, 0, 0, 0, 0, 0, + 0, 0, 0, 53, 49, 52, 50, 0, 54, 0, + 55, 0, 57, 0, 58, 0, 0, 0, 0, 44, + 56, 32, 0, 0, 0, 41, 0, 0, 0, 0, + 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 488, 0, 0, 29, 30, 31, + 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, + 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, + 37, 0, 38, 0, 0, 0, 39, 0, 40, 42, + 43, 0, 0, 45, 0, 0, 0, 47, 0, 48, + 0, 0, 494, 0, 0, 0, 0, 0, 0, 0, + 0, 53, 49, 52, 50, 0, 54, 0, 55, 0, + 57, 0, 58, 0, 0, 0, 0, 44, 56, 32, + 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, + 46, 34, 51, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 496, 0, 0, 29, 30, 31, 0, 0, + 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, + 0, 0, 0, 35, 0, 0, 0, 36, 37, 0, + 38, 0, 0, 0, 39, 0, 40, 42, 43, 0, + 0, 45, 0, 0, 0, 47, 0, 48, 0, 0, + 497, 0, 0, 0, 0, 0, 0, 0, 0, 53, + 49, 52, 50, 0, 54, 0, 55, 0, 57, 0, + 58, 0, 0, 0, 0, 44, 56, 32, 0, 0, + 0, 41, 0, 0, 0, 0, 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 488, 0, 0, 29, 30, 31, 0, 0, 0, 0, + 496, 0, 0, 29, 30, 31, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 36, 37, 0, 38, 0, 0, 0, 39, 0, 40, 42, 43, 0, 0, 45, - 0, 0, 0, 47, 0, 48, 0, 0, 489, 0, + 0, 0, 0, 47, 0, 48, 0, 0, 499, 0, 0, 0, 0, 0, 0, 0, 0, 53, 49, 52, 50, 0, 54, 0, 55, 0, 57, 0, 58, 0, 0, 0, 0, 44, 56, 32, 0, 0, 0, 41, - 0, 0, 0, 0, 0, 46, 34, 51, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 488, 0, 0, - 29, 30, 31, 0, 0, 0, 0, 0, 0, 0, - 0, 33, 0, 0, 0, 0, 0, 0, 35, 0, - 0, 0, 36, 37, 0, 38, 0, 0, 0, 39, - 0, 40, 42, 43, 0, 0, 45, 0, 0, 0, - 47, 0, 48, 0, 0, 494, 0, 0, 0, 0, - 0, 0, 0, 0, 53, 49, 52, 50, 0, 54, - 0, 55, 0, 57, 0, 58, 0, 0, 0, 0, - 44, 56, 32, 0, 0, 0, 41, 0, 0, 0, - 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 29, 30, 31, 0, 0, 0, - 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, - 0, 0, 35, 220, 0, 0, 221, 37, 0, 38, - 0, 0, 0, 39, 0, 40, 42, 43, 0, 0, - 45, 0, 0, 0, 47, 0, 48, 0, 0, 0, - 0, 0, 0, 0, 223, 0, 0, 0, 53, 49, - 52, 50, 224, 54, 0, 55, 226, 57, 0, 58, - 0, 229, 0, 0, 44, 56, 32, 0, 0, 0, - 41, 0, 0, 0, 0, 0, 46, 34, 51, 0, + 0, 0, 0, 0, 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 30, 31, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 35, 220, 0, 0, @@ -565,139 +572,150 @@ const short QQmlJSGrammar::action_info [] = { 0, 0, 53, 49, 52, 50, 224, 54, 0, 55, 226, 57, 0, 58, 0, 229, 0, 0, 44, 56, 32, 0, 0, 0, 41, 0, 0, 0, 0, 0, + 0, 46, 34, 51, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 29, 30, 31, 0, 0, 0, 0, + 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, + 0, 35, 220, 0, 0, 221, 37, 0, 38, 0, + 0, 0, 39, 0, 40, 42, 43, 0, 0, 45, + 0, 0, 0, 47, 0, 48, 0, 0, 0, 0, + 0, 0, 0, 223, 0, 0, 0, 53, 49, 52, + 50, 224, 54, 0, 55, 226, 57, 0, 58, 0, + 229, 0, 0, 44, 56, 32, 0, 0, 0, 41, + 0, 0, 0, 0, 0, 0, 46, 34, 51, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 111, 112, + 113, 0, 0, 115, 117, 118, 0, 0, 119, 0, + 120, 0, 0, 0, 122, 123, 124, 0, 0, 0, + 0, 0, 0, 35, 125, 126, 127, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 131, 0, 0, 0, 0, 0, 0, + 49, 52, 50, 132, 133, 134, 0, 136, 137, 138, + 139, 140, 141, 0, 0, 129, 135, 121, 114, 116, + 130, 0, 0, 0, 0, 0, 0, 0, 46, 34, + 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 111, 112, 113, 0, 0, 115, 117, 118, 0, 0, + 119, 0, 120, 0, 0, 0, 122, 123, 124, 0, + 0, 0, 0, 0, 0, 35, 125, 126, 127, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, + 0, 0, 0, 395, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 131, 0, 0, 0, 0, + 0, 397, 49, 52, 50, 132, 133, 134, 0, 136, + 137, 138, 139, 140, 141, 0, 0, 129, 135, 121, + 114, 116, 130, 0, 0, 0, 0, 0, 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 112, 113, 0, 0, 115, 117, 118, 0, 0, 119, 0, 120, 0, 0, 0, 122, 123, 124, 0, 0, 0, 0, 0, 0, 35, 125, 126, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 128, 0, 0, 0, 395, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, 0, 0, - 0, 0, 0, 0, 49, 52, 50, 132, 133, 134, + 0, 0, 0, 397, 49, 52, 50, 132, 133, 134, 0, 136, 137, 138, 139, 140, 141, 0, 0, 129, 135, 121, 114, 116, 130, 0, 0, 0, 0, 0, - 0, 46, 34, 51, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 111, 112, 113, 0, 0, 115, 117, - 118, 0, 0, 119, 0, 120, 0, 0, 0, 122, - 123, 124, 0, 0, 0, 0, 0, 0, 35, 125, - 126, 127, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 128, 0, 0, 0, 395, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 131, 0, - 0, 0, 0, 0, 397, 49, 52, 50, 132, 133, - 134, 0, 136, 137, 138, 139, 140, 141, 0, 0, - 129, 135, 121, 114, 116, 130, 0, 0, 0, 0, - 0, 0, 46, 34, 51, 0, 0, 0, 0, 0, + 0, 0, 46, 374, 380, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 112, 113, 0, 0, 115, 117, 118, 0, 0, 119, 0, 120, 0, 0, 0, 122, 123, 124, 0, 0, 0, 0, 0, 0, 35, 125, 126, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 395, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 131, + 0, 0, 0, 0, 0, 396, 0, 0, 0, 131, 0, 0, 0, 0, 0, 397, 49, 52, 50, 132, 133, 134, 0, 136, 137, 138, 139, 140, 141, 0, 0, 129, 135, 121, 114, 116, 130, 0, 0, 0, - 0, 0, 0, 46, 374, 380, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 111, 112, 113, 0, 0, - 115, 117, 118, 0, 0, 119, 0, 120, 0, 0, - 0, 122, 123, 124, 0, 0, 0, 0, 0, 0, - 35, 125, 126, 127, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 128, 0, 0, 0, 395, 0, - 0, 0, 0, 0, 0, 0, 396, 0, 0, 0, - 131, 0, 0, 0, 0, 0, 397, 49, 52, 50, - 132, 133, 134, 0, 136, 137, 138, 139, 140, 141, - 0, 0, 129, 135, 121, 114, 116, 130, 0, 0, 0, 0, 0, 0, 46, 374, 380, 0, 0, 0, 0, 0, 0, 0, 0, 0, 213, 0, 0, 0, 0, 215, 0, 29, 30, 31, 217, 0, 0, 0, - 0, 0, 0, 218, 33, 0, 0, 0, 0, 0, + 0, 0, 0, 218, 219, 0, 0, 0, 0, 0, 0, 35, 220, 0, 0, 221, 37, 0, 38, 0, 0, 0, 39, 0, 40, 42, 43, 0, 0, 45, 0, 0, 0, 47, 0, 48, 0, 0, 0, 0, 0, 222, 0, 223, 0, 0, 0, 53, 49, 52, 50, 224, 54, 225, 55, 226, 57, 227, 58, 228, 229, 0, 0, 44, 56, 32, 214, 216, 0, 41, - 0, 0, 0, 0, 0, 46, 34, 51, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 213, 0, 0, - 0, 0, 215, 0, 29, 30, 31, 217, 0, 0, - 0, 0, 0, 0, 218, 219, 0, 0, 0, 0, - 0, 0, 35, 220, 0, 0, 221, 37, 0, 38, - 0, 0, 0, 39, 0, 40, 42, 43, 0, 0, - 45, 0, 0, 0, 47, 0, 48, 0, 0, 0, - 0, 0, 222, 0, 223, 0, 0, 0, 53, 49, - 52, 50, 224, 54, 225, 55, 226, 57, 227, 58, - 228, 229, 0, 0, 44, 56, 32, 214, 216, 0, - 41, 0, 0, 0, 0, 0, 46, 34, 51, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 600, 112, - 113, 0, 0, 602, 117, 604, 30, 31, 605, 0, - 120, 0, 0, 0, 122, 607, 608, 0, 0, 0, - 0, 0, 0, 35, 609, 126, 127, 221, 37, 0, - 38, 0, 0, 0, 39, 0, 40, 610, 43, 0, - 0, 612, 0, 0, 0, 47, 0, 48, 0, 0, - 0, 0, 0, 613, 0, 223, 0, 0, 0, 614, - 49, 52, 50, 615, 616, 617, 55, 619, 620, 621, - 622, 623, 624, 0, 0, 611, 618, 606, 601, 603, - 130, 41, 0, 0, 0, 0, 0, 46, 374, 380, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 365, - 112, 113, 0, 0, 367, 117, 369, 30, 31, 370, - 0, 120, 0, 0, 0, 122, 372, 373, 0, 0, - 0, 0, 0, 0, 35, 375, 126, 127, 221, 37, - 0, 38, 0, 0, 0, 39, 0, 40, 376, 43, - 0, 0, 378, 0, 0, 0, 47, 0, 48, 0, - -271, 0, 0, 0, 379, 0, 223, 0, 0, 0, - 381, 49, 52, 50, 382, 383, 384, 55, 386, 387, - 388, 389, 390, 391, 0, 0, 377, 385, 371, 366, - 368, 130, 41, 0, 0, 0, 0, 0, 46, 374, - 380, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 46, 34, 51, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 213, 0, + 0, 0, 0, 215, 0, 29, 30, 31, 217, 0, + 0, 0, 0, 0, 0, 218, 33, 0, 0, 0, + 0, 0, 0, 35, 220, 0, 0, 221, 37, 0, + 38, 0, 0, 0, 39, 0, 40, 42, 43, 0, + 0, 45, 0, 0, 0, 47, 0, 48, 0, 0, + 0, 0, 0, 222, 0, 223, 0, 0, 0, 53, + 49, 52, 50, 224, 54, 225, 55, 226, 57, 227, + 58, 228, 229, 0, 0, 44, 56, 32, 214, 216, + 0, 41, 0, 0, 0, 0, 0, 0, 46, 34, + 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 600, 112, 113, 0, 0, 602, 117, 604, 30, 31, + 605, 0, 120, 0, 0, 0, 122, 607, 608, 0, + 0, 0, 0, 0, 0, 35, 609, 126, 127, 221, + 37, 0, 38, 0, 0, 0, 39, 0, 40, 610, + 43, 0, 0, 612, 0, 0, 0, 47, 0, 48, + 0, 0, 0, 0, 0, 613, 0, 223, 0, 0, + 0, 614, 49, 52, 50, 615, 616, 617, 55, 619, + 620, 621, 622, 623, 624, 0, 0, 611, 618, 606, + 601, 603, 130, 41, 0, 0, 0, 0, 0, 0, + 46, 374, 380, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 365, 112, 113, 0, 0, 367, 117, 369, + 30, 31, 370, 0, 120, 0, 0, 0, 122, 372, + 373, 0, 0, 0, 0, 0, 0, 35, 375, 126, + 127, 221, 37, 0, 38, 0, 0, 0, 39, 0, + 40, 376, 43, 0, 0, 378, 0, 0, 0, 47, + 0, 48, 0, -277, 0, 0, 0, 379, 0, 223, + 0, 0, 0, 381, 49, 52, 50, 382, 383, 384, + 55, 386, 387, 388, 389, 390, 391, 0, 0, 377, + 385, 371, 366, 368, 130, 41, 0, 0, 0, 0, + 0, 0, 46, 374, 380, 0, 0, 0, 0, 0, + 0, 0, 0, 0, - 565, 148, 545, 16, 649, 547, 541, 469, 320, 529, - 528, 630, 183, 248, 263, 500, 485, 447, 629, 183, - 627, 444, 253, 393, 587, 652, 313, 152, 643, 572, - 591, 575, 586, 638, 331, 574, 453, 455, 466, 253, - 437, 178, 433, 253, 0, 248, 584, 458, 248, 313, - 441, 183, 444, 457, 237, 190, 447, 188, 206, 425, - 400, 462, 351, 313, 347, 150, 165, 447, 475, 444, - 183, 145, 393, 260, 0, 409, 173, 409, 260, 362, - 171, 514, 409, 495, 362, 393, 206, 498, 628, 313, - 313, 206, 356, 142, 206, 331, 362, 599, 403, 0, - 345, 62, 62, 62, 182, 62, 299, 182, 295, 206, - 410, 417, 410, 206, 62, 393, 62, 410, 62, 296, - 148, 298, 148, 297, 62, 62, 182, 504, 412, 62, - 180, 502, 511, 206, 512, 62, 108, 460, 188, 62, - 394, 188, 62, 206, 460, 247, 62, 206, 459, 206, - 62, 102, 459, 62, 62, 514, 206, 62, 653, 503, - 407, 343, 341, 62, 313, 110, 419, 167, 188, 187, - 170, 340, 514, 104, 0, 553, 422, 206, 62, 206, - 62, 63, 62, 72, 62, 510, 71, 97, 62, 514, - 70, 62, 557, 69, 355, 62, 239, 62, 493, 318, - 86, 469, 492, 62, 483, 74, 242, 206, 93, 62, - 353, 62, 206, 260, 95, 0, 96, 62, 62, 62, - 322, 62, 94, 206, 100, 98, 206, 99, 62, 247, - 277, 464, 0, 206, 79, 281, 314, 468, 62, 62, - 206, 507, 91, 246, 206, 62, 62, 349, 505, 90, - 206, 62, 62, 460, 459, 62, 206, 506, 62, 401, - 206, 62, 92, 309, 62, 108, 281, 362, 281, 281, - 0, 313, 206, 62, 304, 479, 0, 309, 281, 62, - 206, 327, 281, 0, 281, 337, 300, 309, 324, 0, - 0, 62, 281, 0, 110, 177, 281, 62, 301, 308, - 309, 0, 281, 309, 302, 281, 62, 62, 281, 330, - 62, 281, 281, 289, 514, 281, 0, 0, 306, 284, - 0, 522, 328, 569, 561, 311, 553, 564, 625, 0, - 0, 0, 514, 513, 523, 514, 0, 0, 0, 522, - 0, 0, 522, 316, 0, 0, 0, 0, 0, 485, - 440, 513, 523, 0, 513, 523, 533, 534, 535, 536, - 540, 537, 538, 577, 533, 534, 535, 536, 540, 537, - 538, 594, 0, 0, 0, 0, 362, 0, 597, 598, - 533, 534, 535, 536, 540, 537, 538, 0, 0, 206, + 148, 142, 183, 447, 469, 347, 575, 444, 547, 627, + 248, 320, 587, 572, 584, 586, 485, 591, 565, 529, + 313, 545, 447, 393, 253, 528, 500, 183, 574, 453, + 331, 652, 447, 437, 444, 313, 462, 455, 263, 457, + 237, 441, 206, 188, 190, 150, 16, 178, 433, 630, + 425, 641, 165, 400, 658, 458, 642, 171, 173, 248, + 475, 351, 498, 248, 253, 313, 183, 466, 183, 541, + 495, 629, 253, 512, 511, 188, 145, 206, 260, 645, + 644, 62, 0, 62, 362, 507, 298, 469, 206, 206, + 247, 514, 514, 62, 206, 460, 646, 409, 152, 409, + 599, 628, 355, 239, 206, 62, 62, 62, 362, 260, + 296, 297, 299, 331, 62, 62, 313, 504, 206, 295, + 62, 62, 459, 460, 356, 206, 277, 62, 62, 502, + 182, 281, 206, 62, 410, 182, 410, 401, 62, 353, + 459, 62, 62, 506, 505, 62, 62, 503, 493, 349, + 91, 62, 492, 206, 63, 206, 313, 62, 345, 483, + 393, 479, 62, 62, 260, 206, 444, 206, 510, 102, + 148, 62, 104, 182, 206, 188, 188, 468, 180, 170, + 206, 62, 148, 247, 62, 394, 460, 393, 409, 340, + 412, 341, 362, 206, 422, 167, 393, 206, 62, 108, + 459, 313, 62, 187, 419, 62, 62, 86, 206, 62, + 318, 98, 100, 403, 62, 99, 69, 322, 514, 514, + 313, 62, 417, 553, 557, 410, 206, 79, 110, 246, + 62, 343, 206, 206, 62, 0, 70, 62, 74, 71, + 62, 62, 206, 108, 90, 206, 93, 62, 62, 62, + 72, 62, 92, 62, 94, 62, 95, 309, 96, 407, + 97, 309, 281, 62, 362, 362, 281, 0, 281, 242, + 302, 0, 110, 177, 464, 0, 316, 309, 0, 308, + 206, 206, 281, 311, 309, 0, 62, 62, 309, 281, + 206, 281, 281, 281, 0, 314, 0, 0, 62, 330, + 62, 324, 0, 281, 327, 281, 337, 300, 62, 62, + 328, 304, 62, 281, 281, 301, 564, 281, 62, 289, + 306, 569, 561, 281, 0, 514, 553, 284, 625, 0, + 0, 514, 0, 0, 522, 0, 0, 0, 0, 0, + 522, 0, 0, 0, 0, 0, 513, 523, 0, 485, + 443, 440, 513, 523, 533, 534, 535, 536, 540, 537, + 538, 577, 533, 534, 535, 536, 540, 537, 538, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 514, 569, 0, 0, 0, 0, 0, + 0, 0, 522, 570, 571, 533, 534, 535, 536, 540, + 537, 538, 0, 0, 513, 523, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 443, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 569, 0, 0, 0, 0, 0, 0, 570, - 571, 533, 534, 535, 536, 540, 537, 538, 0, 0, + 594, 0, 0, 0, 0, 0, 0, 0, 0, 597, + 598, 533, 534, 535, 536, 540, 537, 538, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -708,126 +726,128 @@ const short QQmlJSGrammar::action_info [] = { 0, 0, 0, 0, 0, 0, 0}; const short QQmlJSGrammar::action_check [] = { - 60, 7, 7, 7, 34, 91, 24, 7, 61, 36, - 33, 36, 7, 7, 7, 60, 33, 33, 55, 66, - 8, 33, 55, 36, 16, 7, 36, 29, 8, 7, - 7, 55, 17, 36, 7, 7, 7, 7, 7, 36, - 55, 7, 7, 33, 33, 36, 33, 33, 7, 60, - 7, 60, 20, 36, 33, 36, 55, 7, 33, 60, - 5, 37, 36, 5, 60, 5, 7, 2, 66, 36, - 33, 33, 36, 7, 1, 8, 60, 8, 33, 2, - 36, 1, 8, 36, 2, 1, 8, 2, 17, 1, - 0, 8, -1, 7, 55, 33, 33, -1, -1, 48, - 60, -1, 6, 31, 55, 48, 36, 61, 60, 8, - -1, 36, 60, -1, 7, 61, 20, 36, 8, 77, - 15, 60, 8, 55, 48, 36, 10, 36, 36, 36, - 7, 8, 79, 8, 8, 79, 8, 42, 8, 34, - 8, 8, 48, 40, 8, 8, -1, 60, 53, 50, - -1, 8, -1, 54, 51, 91, 15, 8, 79, 61, - 62, 60, 8, 61, 62, 61, 62, 61, 62, 40, - 60, 55, 61, 62, 60, 34, 61, 62, 61, 62, - 51, 56, 61, 62, 56, 50, 60, 40, 15, 54, - 60, 40, 60, 56, 61, 25, 60, 27, 51, 61, - 62, 29, 51, 60, 29, 56, 15, 34, 38, 36, - 15, 29, 8, 8, 12, 61, 62, 61, 62, 12, - 36, 25, 7, 27, 25, 34, 27, 36, 25, 34, - 27, 36, 7, 15, 38, 29, 25, 38, 27, 7, - -1, 38, 25, 29, 27, 61, 62, 75, 92, 38, - 75, 12, 34, 7, 36, 38, -1, 75, 86, 57, - 56, 86, -1, -1, 57, 63, 61, 62, 86, 25, - 63, 27, 25, -1, 27, -1, 61, 62, 25, 33, - 27, 75, 38, 61, 62, 38, 61, 62, 25, 75, - 27, 38, 86, 61, 62, 25, 57, 27, 29, -1, - 86, 38, 63, 25, 25, 27, 27, 15, 38, 8, - -1, 89, -1, 18, 19, 47, 38, 38, 18, 19, - 18, 19, -1, -1, -1, 33, 34, -1, 36, 61, - 62, 15, 97, 98, 99, 100, 101, 102, -1, 93, - 45, 46, 23, 24, 75, 45, 46, 45, 46, 33, - 34, 32, 36, -1, 35, 86, 37, 23, 24, -1, - 92, -1, 61, 62, 23, 24, 32, -1, -1, 35, - -1, 37, -1, 32, 23, 24, 35, -1, 37, -1, - 23, 24, -1, 32, -1, -1, 35, -1, 37, 32, - 23, 24, 35, 29, 37, -1, -1, -1, 31, 32, - 23, 24, 35, 29, 37, -1, 18, 19, 31, 32, - 23, 24, 35, 29, 37, -1, -1, -1, 31, 32, - -1, -1, 35, 29, 37, -1, 29, -1, -1, -1, - 66, 67, 68, 45, 46, -1, -1, -1, -1, -1, - 66, 67, 68, -1, 29, -1, -1, 29, -1, -1, - 66, 67, 68, -1, -1, -1, -1, 93, 94, 95, - 66, 67, 68, 66, 67, 68, -1, 93, 94, 95, - -1, -1, -1, -1, -1, -1, -1, 93, 94, 95, - 29, 66, 67, 68, 66, 67, 68, 93, 94, 95, - 93, 94, 95, 23, 24, 29, -1, -1, 29, -1, - -1, 31, 32, -1, -1, 35, -1, 37, 93, 94, - 95, 93, 94, 95, 29, -1, -1, 66, 67, 68, - -1, 36, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 29, 66, 67, 68, 66, 67, 68, 36, -1, - -1, -1, -1, -1, 93, 94, 95, -1, -1, -1, - -1, 66, 67, 68, 29, -1, -1, -1, -1, 93, - 94, 95, 93, 94, 95, 29, -1, -1, 66, 67, - 68, -1, 36, -1, -1, 29, -1, -1, 93, 94, - 95, -1, -1, -1, 29, -1, 61, 62, -1, -1, - -1, 66, 67, 68, -1, 93, 94, 95, -1, -1, - -1, -1, 66, 67, 68, 29, -1, -1, -1, -1, - -1, -1, 66, 67, 68, -1, 61, 62, 93, 94, - 95, 66, 67, 68, -1, -1, -1, -1, -1, 93, - 94, 95, -1, -1, -1, -1, -1, 61, 62, 93, - 94, 95, 66, 67, 68, -1, -1, -1, 93, 94, - 95, 29, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 93, - 94, 95, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 61, 62, 3, -1, -1, 66, 67, - 68, -1, -1, -1, -1, 13, -1, -1, -1, 17, - -1, -1, -1, -1, -1, -1, -1, -1, 26, -1, - 28, -1, -1, 31, -1, 93, 94, 95, -1, -1, - -1, 39, -1, 41, 42, -1, -1, 3, -1, -1, - -1, 49, -1, -1, 52, 53, -1, 13, -1, -1, - 58, 17, -1, -1, -1, -1, 64, -1, -1, -1, - 26, -1, 28, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 80, 39, -1, 41, 42, -1, -1, -1, - -1, -1, -1, 49, -1, -1, 52, 53, -1, -1, - -1, -1, 58, -1, -1, -1, -1, -1, 64, -1, + 2, 55, 34, 7, 60, 36, 31, 37, 61, 17, + 24, 16, 2, 20, 33, 60, 5, 8, 36, 79, + 60, 36, 33, 33, 7, 48, 55, 1, 55, 0, + 33, 7, 60, 33, 60, 36, 60, 36, 8, 7, + 36, 8, 7, 55, 7, 5, 55, 33, 7, 7, + 48, 7, 36, 7, 36, 5, 7, 36, 1, 36, + 7, 36, 7, 7, 61, 7, 60, 33, 8, 1, + 7, 77, 36, 7, 36, 60, 7, 29, 8, 36, + 7, 36, 55, 36, 79, 33, 79, 36, 66, 8, + 36, 60, 33, 17, 33, 7, 2, 8, 36, 79, + 36, 2, 7, 7, 7, 66, 8, 33, 33, 7, + -1, 33, 8, 48, 8, 15, 15, 33, 36, 36, + 33, 8, 55, 7, 8, 8, 15, 6, 48, 10, + 8, 60, 8, 61, 34, 34, 8, 60, 8, 60, + 55, 20, 8, -1, 8, 34, 8, 61, 62, 8, + 40, 61, 62, 61, 62, 50, 42, 8, 60, 54, + 56, 51, 7, -1, 61, 62, 60, 53, 61, 62, + 61, 62, 8, 60, 55, 40, 29, 60, 56, -1, + 56, 29, 91, 92, 61, 62, 51, 61, 62, 61, + 60, 40, 56, 15, 60, 50, -1, 56, 60, 54, + 61, 62, 51, 1, 61, 62, 91, 92, 40, 60, + 29, 25, 34, 27, 36, -1, 61, 62, 12, 51, + 61, 62, 75, 12, 38, 61, 62, 75, 25, 25, + 27, 27, 25, 86, 27, 12, 7, 25, 86, 27, + 15, 38, 38, 29, 25, 38, 27, 25, 89, 27, + 38, 25, 25, 27, 27, 7, 75, 38, 15, 34, + 38, 36, 8, 57, 38, 38, 29, 86, 57, 63, + 61, 62, 36, 29, 63, 8, -1, 34, -1, 36, + 57, 25, 25, 27, 27, -1, 63, -1, -1, 75, + 61, 62, 15, -1, 38, 38, -1, 61, 62, -1, + 86, 25, 93, 27, 25, -1, 27, -1, 7, 61, + 62, 34, 75, 36, 38, 61, 62, 38, 47, 75, + 18, 19, -1, 86, 18, 19, 18, 19, 61, 62, + 86, -1, 61, 62, 33, 18, 19, 98, 99, 100, + 101, 102, 103, -1, -1, -1, -1, 45, 46, -1, + -1, 45, 46, 45, 46, -1, 23, 24, -1, -1, + 23, 24, 45, 46, 93, 32, 23, 24, 35, 32, + 37, -1, 35, -1, 37, 32, 23, 24, 35, -1, + 37, 29, 23, 24, 29, 32, -1, -1, 35, -1, + 37, 32, 23, 24, 35, 94, 37, 29, -1, -1, + 31, 32, 23, 24, 35, 29, 37, 15, -1, -1, + 31, 32, -1, -1, 35, 29, 37, -1, 66, 67, + 68, 66, 67, 68, -1, 33, 34, -1, 36, 29, + -1, -1, -1, -1, 66, 67, 68, 29, -1, -1, + -1, -1, 66, 67, 68, -1, 94, 95, 96, 94, + 95, 96, 66, 67, 68, -1, -1, -1, -1, -1, + -1, -1, 94, 95, 96, -1, 66, 67, 68, -1, + 94, 95, 96, -1, 66, 67, 68, 29, -1, -1, + 94, 95, 96, 29, -1, -1, 29, -1, -1, 29, + -1, -1, 29, -1, 94, 95, 96, 29, 23, 24, + 29, -1, 94, 95, 96, -1, 31, 32, -1, -1, + 35, -1, 37, -1, 66, 67, 68, -1, -1, -1, + 66, 67, 68, 66, 67, 68, 66, 67, 68, 66, + 67, 68, -1, 29, 66, 67, 68, 66, 67, 68, + 36, -1, 94, 95, 96, -1, -1, -1, 94, 95, + 96, 94, 95, 96, 94, 95, 96, 94, 95, 96, + -1, -1, 94, 95, 96, 94, 95, 96, 29, -1, + 66, 67, 68, 29, -1, 36, 29, -1, -1, -1, + 36, 29, -1, -1, 29, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 94, 95, + 96, -1, -1, -1, -1, 66, 67, 68, 61, 62, + 66, 67, 68, 66, 67, 68, 61, 62, 66, 67, + 68, 66, 67, 68, -1, -1, -1, 29, -1, -1, + -1, -1, -1, 94, 95, 96, -1, -1, 94, 95, + 96, 94, 95, 96, -1, -1, 94, 95, 96, 94, + 95, 96, -1, -1, -1, -1, -1, -1, 29, 61, + 62, -1, -1, -1, 66, 67, 68, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 80, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 12, - 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, - -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, - 33, 34, -1, 36, -1, -1, -1, -1, -1, -1, - 43, -1, -1, -1, 47, -1, -1, -1, -1, -1, + 61, 62, 94, 95, 96, 66, 67, 68, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 65, 66, 67, 68, -1, 70, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 81, 82, - 83, -1, -1, -1, 87, -1, -1, -1, -1, -1, - 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 12, 13, -1, -1, -1, -1, -1, -1, - -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, - -1, -1, -1, 33, 34, -1, 36, -1, -1, -1, - -1, -1, -1, 43, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 65, 66, 67, 68, -1, - 70, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 81, 82, 83, -1, -1, -1, 87, -1, -1, - -1, -1, -1, 93, 94, 95, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 10, -1, 12, 13, -1, - -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, - -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, - -1, 36, -1, -1, -1, -1, -1, -1, 43, -1, - -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 94, 95, 96, -1, -1, -1, -1, + -1, -1, -1, 12, 13, 3, -1, -1, -1, -1, + -1, -1, -1, 22, -1, 13, -1, -1, -1, 17, + 29, -1, -1, -1, 33, 34, -1, 36, 26, -1, + 28, -1, -1, -1, 43, -1, -1, -1, 47, -1, + -1, 39, -1, 41, 42, -1, -1, -1, -1, -1, + -1, 49, -1, -1, 52, 53, 65, 66, 67, 68, + 58, 70, -1, -1, -1, -1, 64, -1, -1, -1, + -1, -1, 81, 82, 83, -1, -1, -1, 87, -1, + -1, -1, 80, -1, -1, 94, 95, 96, -1, -1, + -1, -1, -1, -1, -1, 12, 13, -1, -1, -1, + -1, -1, -1, -1, -1, 22, -1, -1, 3, -1, + -1, -1, 29, -1, -1, -1, 33, 34, 13, 36, + -1, -1, 17, -1, -1, -1, 43, -1, -1, -1, + 47, 26, -1, 28, -1, -1, 31, -1, -1, -1, + -1, -1, -1, -1, 39, -1, 41, 42, 65, 66, + 67, 68, -1, 70, 49, -1, -1, 52, 53, -1, + -1, -1, -1, 58, 81, 82, 83, -1, -1, 64, + 87, -1, -1, -1, -1, -1, -1, 94, 95, 96, + -1, -1, -1, -1, -1, 80, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, 67, 68, -1, 70, -1, -1, -1, -1, - 75, -1, -1, -1, -1, -1, 81, 82, 83, 84, - -1, -1, 87, -1, -1, -1, -1, -1, 93, 94, - 95, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 10, -1, 12, 13, -1, -1, -1, -1, -1, -1, - -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, - -1, -1, -1, 33, 34, -1, 36, -1, -1, -1, - -1, -1, -1, 43, -1, -1, -1, 47, -1, -1, - -1, -1, -1, -1, -1, 55, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 65, 66, 67, 68, -1, - 70, -1, -1, -1, -1, 75, -1, -1, -1, -1, - -1, 81, 82, 83, 84, -1, -1, 87, -1, -1, - -1, -1, -1, 93, 94, 95, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, + -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, + -1, -1, 33, 34, -1, 36, -1, -1, -1, -1, + -1, -1, 43, -1, -1, -1, 47, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 65, 66, 67, 68, -1, 70, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 81, 82, 83, -1, -1, -1, 87, -1, -1, -1, + -1, -1, -1, 94, 95, 96, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 12, 13, -1, -1, -1, + -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, + -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, + -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, + 67, 68, -1, 70, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 81, 82, 83, -1, -1, -1, + 87, -1, -1, -1, -1, -1, -1, 94, 95, 96, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, + -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, + -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, + -1, -1, 33, 34, -1, 36, -1, -1, -1, -1, + -1, -1, 43, -1, -1, -1, 47, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 65, 66, 67, 68, -1, 70, + -1, -1, -1, -1, 75, -1, -1, -1, -1, -1, + 81, 82, 83, 84, -1, -1, 87, -1, -1, -1, + -1, -1, -1, 94, 95, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, @@ -836,36 +856,46 @@ const short QQmlJSGrammar::action_check [] = { 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, 67, 68, -1, 70, -1, -1, -1, -1, 75, -1, -1, -1, -1, -1, 81, 82, 83, 84, - -1, -1, 87, -1, -1, -1, -1, -1, 93, 94, - 95, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, - -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, - -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, - -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, - 51, -1, 53, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 65, 66, 67, 68, -1, 70, - -1, 72, -1, 74, -1, 76, -1, -1, -1, -1, - 81, 82, 83, -1, -1, -1, 87, -1, -1, -1, - -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 7, -1, -1, -1, 11, 12, - 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, - -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, - 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, - 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, - 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 65, 66, 67, 68, -1, 70, -1, 72, - -1, 74, -1, 76, -1, -1, -1, -1, 81, 82, - 83, -1, -1, -1, 87, -1, -1, -1, -1, -1, - 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, + -1, -1, 87, -1, -1, -1, -1, -1, -1, 94, + 95, 96, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 10, -1, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, - -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, - -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 43, -1, -1, -1, 47, -1, + -1, -1, -1, -1, -1, -1, 55, -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, 66, 67, 68, - -1, 70, -1, 72, -1, 74, 75, 76, -1, -1, - -1, -1, 81, 82, 83, -1, -1, -1, 87, -1, - -1, -1, -1, -1, 93, 94, 95, -1, -1, -1, + -1, 70, -1, -1, -1, -1, 75, -1, -1, -1, + -1, -1, 81, 82, 83, 84, -1, -1, 87, -1, + -1, -1, -1, -1, -1, 94, 95, 96, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 11, 12, 13, + -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, + -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, + 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, + 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 65, 66, 67, 68, -1, 70, -1, 72, -1, + 74, -1, 76, -1, -1, -1, -1, 81, 82, 83, + -1, -1, -1, 87, -1, -1, -1, -1, -1, -1, + 94, 95, 96, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 7, -1, -1, -1, 11, 12, 13, -1, + -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, + -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, + -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 65, 66, 67, 68, -1, 70, -1, 72, -1, 74, + -1, 76, -1, -1, -1, -1, 81, 82, 83, -1, + -1, -1, 87, -1, -1, -1, -1, -1, -1, 94, + 95, 96, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, + -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, + -1, -1, -1, 33, 34, -1, 36, -1, -1, -1, + 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, + -1, 51, -1, 53, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 65, 66, 67, 68, -1, + 70, -1, 72, -1, 74, 75, 76, -1, -1, -1, + -1, 81, 82, 83, -1, -1, -1, 87, -1, -1, + -1, -1, -1, -1, 94, 95, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, @@ -875,17 +905,27 @@ const short QQmlJSGrammar::action_check [] = { -1, -1, -1, 65, 66, 67, 68, -1, 70, -1, 72, -1, 74, -1, 76, -1, -1, -1, -1, 81, 82, 83, -1, -1, -1, 87, -1, -1, -1, -1, - -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 8, -1, -1, 11, 12, 13, -1, - -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, - -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, - -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, - -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, - -1, 56, -1, -1, -1, -1, -1, -1, -1, -1, - 65, 66, 67, 68, -1, 70, -1, 72, -1, 74, - -1, 76, -1, -1, -1, -1, 81, 82, 83, -1, - -1, -1, 87, -1, -1, -1, -1, -1, 93, 94, - 95, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 94, 95, 96, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 8, -1, -1, 11, 12, 13, + -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, + -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, + 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, + 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, + -1, -1, 56, -1, -1, -1, -1, -1, -1, -1, + -1, 65, 66, 67, 68, -1, 70, -1, 72, -1, + 74, -1, 76, -1, -1, -1, -1, 81, 82, 83, + -1, -1, -1, 87, -1, -1, -1, -1, -1, -1, + 94, 95, 96, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 8, -1, -1, 11, 12, 13, -1, -1, + -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, + -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, + 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, + -1, 47, -1, -1, -1, 51, -1, 53, -1, -1, + 56, -1, -1, -1, -1, -1, -1, -1, -1, 65, + 66, 67, 68, -1, 70, -1, 72, -1, 74, -1, + 76, -1, -1, -1, -1, 81, 82, 83, -1, -1, + -1, 87, -1, -1, -1, -1, -1, -1, 94, 95, + 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, @@ -894,26 +934,7 @@ const short QQmlJSGrammar::action_check [] = { -1, -1, -1, -1, -1, -1, -1, 65, 66, 67, 68, -1, 70, -1, 72, -1, 74, -1, 76, -1, -1, -1, -1, 81, 82, 83, -1, -1, -1, 87, - -1, -1, -1, -1, -1, 93, 94, 95, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 8, -1, -1, - 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, - -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, - -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, - -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, - 51, -1, 53, -1, -1, 56, -1, -1, -1, -1, - -1, -1, -1, -1, 65, 66, 67, 68, -1, 70, - -1, 72, -1, 74, -1, 76, -1, -1, -1, -1, - 81, 82, 83, -1, -1, -1, 87, -1, -1, -1, - -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 11, 12, 13, -1, -1, -1, - -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, - -1, -1, 29, 30, -1, -1, 33, 34, -1, 36, - -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, - 47, -1, -1, -1, 51, -1, 53, -1, -1, -1, - -1, -1, -1, -1, 61, -1, -1, -1, 65, 66, - 67, 68, 69, 70, -1, 72, 73, 74, -1, 76, - -1, 78, -1, -1, 81, 82, 83, -1, -1, -1, - 87, -1, -1, -1, -1, -1, 93, 94, 95, -1, + -1, -1, -1, -1, -1, -1, 94, 95, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, 30, -1, -1, @@ -923,47 +944,57 @@ const short QQmlJSGrammar::action_check [] = { -1, -1, 65, 66, 67, 68, 69, 70, -1, 72, 73, 74, -1, 76, -1, 78, -1, -1, 81, 82, 83, -1, -1, -1, 87, -1, -1, -1, -1, -1, - 93, 94, 95, -1, -1, -1, -1, -1, -1, -1, + -1, 94, 95, 96, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, + -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, + -1, 29, 30, -1, -1, 33, 34, -1, 36, -1, + -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, + -1, -1, -1, 51, -1, 53, -1, -1, -1, -1, + -1, -1, -1, 61, -1, -1, -1, 65, 66, 67, + 68, 69, 70, -1, 72, 73, 74, -1, 76, -1, + 78, -1, -1, 81, 82, 83, -1, -1, -1, 87, + -1, -1, -1, -1, -1, -1, 94, 95, 96, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 4, 5, + 6, -1, -1, 9, 10, 11, -1, -1, 14, -1, + 16, -1, -1, -1, 20, 21, 22, -1, -1, -1, + -1, -1, -1, 29, 30, 31, 32, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 43, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 59, -1, -1, -1, -1, -1, -1, + 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, + 76, 77, 78, -1, -1, 81, 82, 83, 84, 85, + 86, -1, -1, -1, -1, -1, -1, -1, 94, 95, + 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 4, 5, 6, -1, -1, 9, 10, 11, -1, -1, + 14, -1, 16, -1, -1, -1, 20, 21, 22, -1, + -1, -1, -1, -1, -1, 29, 30, 31, 32, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, + -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 59, -1, -1, -1, -1, + -1, 65, 66, 67, 68, 69, 70, 71, -1, 73, + 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, + 84, 85, 86, -1, -1, -1, -1, -1, -1, -1, + 94, 95, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, 11, -1, -1, 14, -1, 16, -1, -1, -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 43, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 43, -1, -1, -1, 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, -1, -1, - -1, -1, -1, -1, 66, 67, 68, 69, 70, 71, + -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, 85, 86, -1, -1, -1, -1, -1, - -1, 93, 94, 95, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, - 11, -1, -1, 14, -1, 16, -1, -1, -1, 20, - 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, - 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 43, -1, -1, -1, 47, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 59, -1, - -1, -1, -1, -1, 65, 66, 67, 68, 69, 70, - 71, -1, 73, 74, 75, 76, 77, 78, -1, -1, - 81, 82, 83, 84, 85, 86, -1, -1, -1, -1, - -1, -1, 93, 94, 95, -1, -1, -1, -1, -1, + -1, -1, 94, 95, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, 11, -1, -1, 14, -1, 16, -1, -1, -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, 47, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, + -1, -1, -1, -1, -1, 55, -1, -1, -1, 59, -1, -1, -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, -1, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, 85, 86, -1, -1, -1, - -1, -1, -1, 93, 94, 95, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 4, 5, 6, -1, -1, - 9, 10, 11, -1, -1, 14, -1, 16, -1, -1, - -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, - 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, -1, -1, -1, 47, -1, - -1, -1, -1, -1, -1, -1, 55, -1, -1, -1, - 59, -1, -1, -1, -1, -1, 65, 66, 67, 68, - 69, 70, 71, -1, 73, 74, 75, 76, 77, 78, - -1, -1, 81, 82, 83, 84, 85, 86, -1, -1, - -1, -1, -1, -1, 93, 94, 95, -1, -1, -1, + -1, -1, -1, -1, 94, 95, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, 9, -1, 11, 12, 13, 14, -1, -1, -1, -1, -1, -1, 21, 22, -1, -1, -1, -1, -1, @@ -973,89 +1004,90 @@ const short QQmlJSGrammar::action_check [] = { -1, 59, -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, 85, -1, 87, - -1, -1, -1, -1, -1, 93, 94, 95, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 4, -1, -1, - -1, -1, 9, -1, 11, 12, 13, 14, -1, -1, - -1, -1, -1, -1, 21, 22, -1, -1, -1, -1, - -1, -1, 29, 30, -1, -1, 33, 34, -1, 36, - -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, - 47, -1, -1, -1, 51, -1, 53, -1, -1, -1, - -1, -1, 59, -1, 61, -1, -1, -1, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, -1, -1, 81, 82, 83, 84, 85, -1, - 87, -1, -1, -1, -1, -1, 93, 94, 95, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 4, 5, - 6, -1, -1, 9, 10, 11, 12, 13, 14, -1, - 16, -1, -1, -1, 20, 21, 22, -1, -1, -1, - -1, -1, -1, 29, 30, 31, 32, 33, 34, -1, + -1, -1, -1, -1, -1, -1, 94, 95, 96, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 4, -1, + -1, -1, -1, 9, -1, 11, 12, 13, 14, -1, + -1, -1, -1, -1, -1, 21, 22, -1, -1, -1, + -1, -1, -1, 29, 30, -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, 59, -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, 85, - 86, 87, -1, -1, -1, -1, -1, 93, 94, 95, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, - 5, 6, -1, -1, 9, 10, 11, 12, 13, 14, - -1, 16, -1, -1, -1, 20, 21, 22, -1, -1, - -1, -1, -1, -1, 29, 30, 31, 32, 33, 34, - -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, - -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, - 55, -1, -1, -1, 59, -1, 61, -1, -1, -1, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, -1, -1, 81, 82, 83, 84, - 85, 86, 87, -1, -1, -1, -1, -1, 93, 94, - 95, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 87, -1, -1, -1, -1, -1, -1, 94, 95, + 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 4, 5, 6, -1, -1, 9, 10, 11, 12, 13, + 14, -1, 16, -1, -1, -1, 20, 21, 22, -1, + -1, -1, -1, -1, -1, 29, 30, 31, 32, 33, + 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, + 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, + -1, -1, -1, -1, -1, 59, -1, 61, -1, -1, + -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, -1, -1, 81, 82, 83, + 84, 85, 86, 87, -1, -1, -1, -1, -1, -1, + 94, 95, 96, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 4, 5, 6, -1, -1, 9, 10, 11, + 12, 13, 14, -1, 16, -1, -1, -1, 20, 21, + 22, -1, -1, -1, -1, -1, -1, 29, 30, 31, + 32, 33, 34, -1, 36, -1, -1, -1, 40, -1, + 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, + -1, 53, -1, 55, -1, -1, -1, 59, -1, 61, + -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, -1, -1, 81, + 82, 83, 84, 85, 86, 87, -1, -1, -1, -1, + -1, -1, 94, 95, 96, -1, -1, -1, -1, -1, + -1, -1, -1, -1, - 15, 39, 29, 3, 15, 15, 13, 15, 3, 15, - 29, 9, 15, 15, 3, 3, 39, 22, 19, 15, - 19, 3, 15, 15, 15, 11, 3, 74, 15, 19, - 15, 15, 29, 13, 15, 29, 102, 15, 3, 15, - 97, 3, 100, 15, -1, 15, 29, 22, 15, 3, - 3, 15, 3, 22, 15, 15, 22, 15, 15, 3, - 39, 3, 3, 3, 3, 39, 39, 22, 39, 3, - 15, 39, 15, 2, -1, 13, 39, 13, 2, 2, - 39, 13, 13, 39, 2, 15, 15, 39, 20, 3, - 3, 15, 15, 3, 15, 15, 2, 15, 41, -1, - 2, 51, 51, 51, 53, 51, 56, 53, 56, 15, - 48, 41, 48, 15, 51, 15, 51, 48, 51, 56, - 39, 56, 39, 56, 51, 51, 53, 53, 47, 51, - 47, 53, 4, 15, 2, 51, 15, 53, 15, 51, - 40, 15, 51, 15, 53, 4, 51, 15, 53, 15, - 51, 63, 53, 51, 51, 13, 15, 51, 16, 53, - 42, 75, 75, 51, 3, 44, 43, 65, 15, 43, - 67, 91, 13, 61, -1, 16, 42, 15, 51, 15, - 51, 54, 51, 54, 51, 106, 53, 56, 51, 13, - 53, 51, 16, 53, 2, 51, 43, 51, 35, 2, - 56, 15, 39, 51, 42, 59, 42, 15, 56, 51, - 2, 51, 15, 2, 56, -1, 56, 51, 51, 51, - 2, 51, 56, 15, 57, 57, 15, 57, 51, 4, - 51, 2, -1, 15, 57, 56, 75, 2, 51, 51, - 15, 53, 55, 2, 15, 51, 51, 2, 53, 55, - 15, 51, 51, 53, 53, 51, 15, 53, 51, 2, - 15, 51, 55, 51, 51, 15, 56, 2, 56, 56, - -1, 3, 15, 51, 64, 89, -1, 51, 56, 51, - 15, 68, 56, -1, 56, 73, 58, 51, 66, -1, - -1, 51, 56, -1, 44, 45, 56, 51, 58, 73, - 51, -1, 56, 51, 58, 56, 51, 51, 56, 73, - 51, 56, 56, 58, 13, 56, -1, -1, 62, 60, - -1, 20, 73, 13, 5, 73, 16, 5, 18, -1, - -1, -1, 13, 32, 33, 13, -1, -1, -1, 20, - -1, -1, 20, 75, -1, -1, -1, -1, -1, 39, - 85, 32, 33, -1, 32, 33, 22, 23, 24, 25, - 26, 27, 28, 21, 22, 23, 24, 25, 26, 27, - 28, 13, -1, -1, -1, -1, 2, -1, 20, 21, - 22, 23, 24, 25, 26, 27, 28, -1, -1, 15, + 42, 3, 18, 25, 18, 3, 18, 3, 18, 22, + 18, 3, 18, 22, 32, 32, 42, 18, 18, 18, + 3, 32, 25, 18, 18, 32, 3, 18, 32, 105, + 18, 18, 25, 100, 3, 3, 3, 18, 3, 25, + 18, 3, 18, 18, 18, 42, 3, 3, 103, 9, + 3, 14, 42, 42, 18, 25, 14, 42, 42, 18, + 42, 3, 42, 18, 18, 3, 18, 3, 18, 14, + 42, 22, 18, 2, 4, 18, 42, 18, 2, 11, + 12, 54, -1, 54, 2, 56, 59, 18, 18, 18, + 4, 14, 14, 54, 18, 56, 19, 14, 77, 14, + 18, 23, 2, 46, 18, 54, 54, 54, 2, 2, + 59, 59, 59, 18, 54, 54, 3, 56, 18, 59, + 54, 54, 56, 56, 18, 18, 54, 54, 54, 56, + 56, 59, 18, 54, 51, 56, 51, 2, 54, 2, + 56, 54, 54, 56, 56, 54, 54, 56, 38, 2, + 58, 54, 42, 18, 57, 18, 3, 54, 2, 45, + 18, 92, 54, 54, 2, 18, 3, 18, 109, 66, + 42, 54, 64, 56, 18, 18, 18, 2, 50, 70, + 18, 54, 42, 4, 54, 43, 56, 18, 14, 94, + 50, 78, 2, 18, 45, 68, 18, 18, 54, 18, + 56, 3, 54, 46, 46, 54, 54, 59, 18, 54, + 2, 60, 60, 44, 54, 60, 56, 2, 14, 14, + 3, 54, 44, 19, 19, 51, 18, 60, 47, 2, + 54, 78, 18, 18, 54, -1, 56, 54, 62, 56, + 54, 54, 18, 18, 58, 18, 59, 54, 54, 54, + 57, 54, 58, 54, 59, 54, 59, 54, 59, 45, + 59, 54, 59, 54, 2, 2, 59, -1, 59, 45, + 61, -1, 47, 48, 2, -1, 78, 54, -1, 76, + 18, 18, 59, 76, 54, -1, 54, 54, 54, 59, + 18, 59, 59, 59, -1, 78, -1, -1, 54, 76, + 54, 69, -1, 59, 71, 59, 76, 61, 54, 54, + 76, 67, 54, 59, 59, 61, 5, 59, 54, 61, + 65, 14, 5, 59, -1, 14, 19, 63, 21, -1, + -1, 14, -1, -1, 23, -1, -1, -1, -1, -1, + 23, -1, -1, -1, -1, -1, 35, 36, -1, 42, + 88, 88, 35, 36, 25, 26, 27, 28, 29, 30, + 31, 24, 25, 26, 27, 28, 29, 30, 31, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 14, 14, -1, -1, -1, -1, -1, + -1, -1, 23, 23, 24, 25, 26, 27, 28, 29, + 30, 31, -1, -1, 35, 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 85, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 13, -1, -1, -1, -1, -1, -1, 20, - 21, 22, 23, 24, 25, 26, 27, 28, -1, -1, + 14, -1, -1, -1, -1, -1, -1, -1, -1, 23, + 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, diff --git a/src/tools/qdoc/qmlparser/qqmljsgrammar_p.h b/src/tools/qdoc/qmlparser/qqmljsgrammar_p.h index 9ef4695d69e..054b7cc2e0f 100644 --- a/src/tools/qdoc/qmlparser/qqmljsgrammar_p.h +++ b/src/tools/qdoc/qmlparser/qqmljsgrammar_p.h @@ -63,12 +63,12 @@ class QQmlJSGrammar public: enum VariousConstants { EOF_SYMBOL = 0, - REDUCE_HERE = 104, - SHIFT_THERE = 103, + REDUCE_HERE = 105, + SHIFT_THERE = 104, T_AND = 1, T_AND_AND = 2, T_AND_EQ = 3, - T_AS = 92, + T_AS = 93, T_AUTOMATIC_SEMICOLON = 62, T_BREAK = 4, T_CASE = 5, @@ -90,19 +90,19 @@ public: T_EQ = 17, T_EQ_EQ = 18, T_EQ_EQ_EQ = 19, - T_ERROR = 96, + T_ERROR = 97, T_FALSE = 83, - T_FEED_JS_EXPRESSION = 100, - T_FEED_JS_PROGRAM = 102, - T_FEED_JS_SOURCE_ELEMENT = 101, - T_FEED_JS_STATEMENT = 99, - T_FEED_UI_OBJECT_MEMBER = 98, - T_FEED_UI_PROGRAM = 97, + T_FEED_JS_EXPRESSION = 101, + T_FEED_JS_PROGRAM = 103, + T_FEED_JS_SOURCE_ELEMENT = 102, + T_FEED_JS_STATEMENT = 100, + T_FEED_UI_OBJECT_MEMBER = 99, + T_FEED_UI_PROGRAM = 98, T_FINALLY = 20, T_FOR = 21, T_FUNCTION = 22, T_GE = 23, - T_GET = 94, + T_GET = 95, T_GT = 24, T_GT_GT = 25, T_GT_GT_EQ = 26, @@ -130,13 +130,14 @@ public: T_NOT_EQ_EQ = 46, T_NULL = 81, T_NUMERIC_LITERAL = 47, - T_ON = 93, + T_ON = 94, T_OR = 48, T_OR_EQ = 49, T_OR_OR = 50, T_PLUS = 51, T_PLUS_EQ = 52, T_PLUS_PLUS = 53, + T_PRAGMA = 92, T_PROPERTY = 66, T_PUBLIC = 90, T_QUESTION = 54, @@ -149,7 +150,7 @@ public: T_RETURN = 59, T_RPAREN = 60, T_SEMICOLON = 61, - T_SET = 95, + T_SET = 96, T_SIGNAL = 67, T_STAR = 63, T_STAR_EQ = 64, @@ -168,15 +169,15 @@ public: T_XOR = 79, T_XOR_EQ = 80, - ACCEPT_STATE = 655, - RULE_COUNT = 351, - STATE_COUNT = 656, - TERMINAL_COUNT = 105, - NON_TERMINAL_COUNT = 108, + ACCEPT_STATE = 663, + RULE_COUNT = 357, + STATE_COUNT = 664, + TERMINAL_COUNT = 106, + NON_TERMINAL_COUNT = 111, - GOTO_INDEX_OFFSET = 656, - GOTO_INFO_OFFSET = 2970, - GOTO_CHECK_OFFSET = 2970 + GOTO_INDEX_OFFSET = 664, + GOTO_INFO_OFFSET = 3104, + GOTO_CHECK_OFFSET = 3104 }; static const char *const spell []; diff --git a/src/tools/qdoc/qmlparser/qqmljskeywords_p.h b/src/tools/qdoc/qmlparser/qqmljskeywords_p.h index 7fcf001303d..c6277e0fccf 100644 --- a/src/tools/qdoc/qmlparser/qqmljskeywords_p.h +++ b/src/tools/qdoc/qmlparser/qqmljskeywords_p.h @@ -436,6 +436,17 @@ static inline int classify6(const QChar *s, bool qmlMode) { } } } + else if (s[1].unicode() == 'r') { + if (s[2].unicode() == 'a') { + if (s[3].unicode() == 'g') { + if (s[4].unicode() == 'm') { + if (s[5].unicode() == 'a') { + return qmlMode ? Lexer::T_PRAGMA : Lexer::T_IDENTIFIER; + } + } + } + } + } } else if (s[0].unicode() == 'r') { if (s[1].unicode() == 'e') { diff --git a/src/tools/qdoc/qmlparser/qqmljslexer.cpp b/src/tools/qdoc/qmlparser/qqmljslexer.cpp index edd85ec8785..8e8ed954ad9 100644 --- a/src/tools/qdoc/qmlparser/qqmljslexer.cpp +++ b/src/tools/qdoc/qmlparser/qqmljslexer.cpp @@ -54,7 +54,7 @@ QT_END_NAMESPACE using namespace QQmlJS; -static int regExpFlagFromChar(const QChar &ch) +static inline int regExpFlagFromChar(const QChar &ch) { switch (ch.unicode()) { case 'g': return Lexer::RegExp_Global; @@ -64,7 +64,7 @@ static int regExpFlagFromChar(const QChar &ch) return 0; } -static unsigned char convertHex(ushort c) +static inline unsigned char convertHex(ushort c) { if (c >= '0' && c <= '9') return (c - '0'); @@ -74,12 +74,12 @@ static unsigned char convertHex(ushort c) return (c - 'A' + 10); } -static QChar convertHex(QChar c1, QChar c2) +static inline QChar convertHex(QChar c1, QChar c2) { return QChar((convertHex(c1.unicode()) << 4) + convertHex(c2.unicode())); } -static QChar convertUnicode(QChar c1, QChar c2, QChar c3, QChar c4) +static inline QChar convertUnicode(QChar c1, QChar c2, QChar c3, QChar c4) { return QChar((convertHex(c3.unicode()) << 4) + convertHex(c4.unicode()), (convertHex(c1.unicode()) << 4) + convertHex(c2.unicode())); @@ -259,6 +259,7 @@ int Lexer::lex() _parenthesesCount = 0; break; + case T_ELSE: case T_DO: _parenthesesState = BalancedParentheses; break; @@ -287,7 +288,8 @@ int Lexer::lex() break; case BalancedParentheses: - _parenthesesState = IgnoreParentheses; + if (_tokenKind != T_DO && _tokenKind != T_ELSE) + _parenthesesState = IgnoreParentheses; break; } // switch @@ -329,6 +331,27 @@ QChar Lexer::decodeUnicodeEscapeCharacter(bool *ok) return QChar(); } +QChar Lexer::decodeHexEscapeCharacter(bool *ok) +{ + if (isHexDigit(_codePtr[0]) && isHexDigit(_codePtr[1])) { + scanChar(); + + const QChar c1 = _char; + scanChar(); + + const QChar c2 = _char; + scanChar(); + + if (ok) + *ok = true; + + return convertHex(c1, c2); + } + + *ok = false; + return QChar(); +} + static inline bool isIdentifierStart(QChar ch) { // fast path for ascii @@ -705,35 +728,29 @@ again: scanChar(); QChar u; - bool ok = false; switch (_char.unicode()) { // unicode escape sequence - case 'u': + case 'u': { + bool ok = false; u = decodeUnicodeEscapeCharacter(&ok); if (! ok) { _errorCode = IllegalUnicodeEscapeSequence; _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal unicode escape sequence"); return T_ERROR; } - break; + } break; // hex escape sequence - case 'x': - if (isHexDigit(_codePtr[0]) && isHexDigit(_codePtr[1])) { - scanChar(); - - const QChar c1 = _char; - scanChar(); - - const QChar c2 = _char; - scanChar(); - - u = convertHex(c1, c2); - } else { - u = _char; + case 'x': { + bool ok = false; + u = decodeHexEscapeCharacter(&ok); + if (!ok) { + _errorCode = IllegalHexadecimalEscapeSequence; + _errorMessage = QCoreApplication::translate("QQmlParser", "Illegal hexadecimal escape sequence"); + return T_ERROR; } - break; + } break; // single character escape sequence case '\\': u = QLatin1Char('\\'); scanChar(); break; @@ -767,22 +784,11 @@ again: return T_ERROR; case '\r': - if (isLineTerminatorSequence() == 2) { - _tokenText += QLatin1Char('\r'); - u = QLatin1Char('\n'); - } else { - u = QLatin1Char('\r'); - } - scanChar(); - break; - case '\n': case 0x2028u: case 0x2029u: - u = _char; scanChar(); - break; - + continue; default: // non escape character @@ -1033,7 +1039,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix) _patternFlags = 0; while (isIdentLetter(_char)) { int flag = regExpFlagFromChar(_char); - if (flag == 0) { + if (flag == 0 || _patternFlags & flag) { _errorMessage = QCoreApplication::translate("QQmlParser", "Invalid regular expression flag '%0'") .arg(QChar(_char)); return false; diff --git a/src/tools/qdoc/qmlparser/qqmljslexer_p.h b/src/tools/qdoc/qmlparser/qqmljslexer_p.h index e1b51da92ba..23af61d650c 100644 --- a/src/tools/qdoc/qmlparser/qqmljslexer_p.h +++ b/src/tools/qdoc/qmlparser/qqmljslexer_p.h @@ -128,7 +128,8 @@ public: IllegalUnicodeEscapeSequence, UnclosedComment, IllegalExponentIndicator, - IllegalIdentifier + IllegalIdentifier, + IllegalHexadecimalEscapeSequence }; enum RegExpBodyPrefix { @@ -203,6 +204,7 @@ private: void syncProhibitAutomaticSemicolon(); QChar decodeUnicodeEscapeCharacter(bool *ok); + QChar decodeHexEscapeCharacter(bool *ok); private: Engine *_engine; diff --git a/src/tools/qdoc/qmlparser/qqmljsparser.cpp b/src/tools/qdoc/qmlparser/qqmljsparser.cpp index a0fa7a47110..b86b4a987fe 100644 --- a/src/tools/qdoc/qmlparser/qqmljsparser.cpp +++ b/src/tools/qdoc/qmlparser/qqmljsparser.cpp @@ -50,6 +50,7 @@ #include + #include "qqmljsparser_p.h" #include @@ -146,6 +147,19 @@ AST::UiQualifiedId *Parser::reparseAsQualifiedId(AST::ExpressionNode *expr) return 0; } +AST::UiQualifiedPragmaId *Parser::reparseAsQualifiedPragmaId(AST::ExpressionNode *expr) +{ + if (AST::IdentifierExpression *idExpr = AST::cast(expr)) { + AST::UiQualifiedPragmaId *q = new (pool) AST::UiQualifiedPragmaId(idExpr->name); + q->identifierToken = idExpr->identifierToken; + + return q->finish(); + } + + return 0; +} + + bool Parser::parse(int startToken) { Lexer *lexer = driver->lexer(); @@ -232,32 +246,44 @@ case 5: { } break; case 6: { - sym(1).UiProgram = new (pool) AST::UiProgram(sym(1).UiImportList, + sym(1).UiProgram = new (pool) AST::UiProgram(sym(1).UiHeaderItemList, sym(2).UiObjectMemberList->finish()); } break; case 8: { - sym(1).Node = sym(1).UiImportList->finish(); + sym(1).Node = sym(1).UiHeaderItemList->finish(); } break; case 9: { - sym(1).Node = new (pool) AST::UiImportList(sym(1).UiImport); + sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiPragma); } break; case 10: { - sym(1).Node = new (pool) AST::UiImportList(sym(1).UiImportList, sym(2).UiImport); + sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiImport); } break; -case 13: { +case 11: { + sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiHeaderItemList, sym(2).UiPragma); +} break; + +case 12: { + sym(1).Node = new (pool) AST::UiHeaderItemList(sym(1).UiHeaderItemList, sym(2).UiImport); +} break; + +case 16: { + sym(1).UiPragma->semicolonToken = loc(2); +} break; + +case 18: { sym(1).UiImport->semicolonToken = loc(2); } break; -case 15: { +case 20: { sym(1).UiImport->versionToken = loc(2); sym(1).UiImport->semicolonToken = loc(3); } break; -case 17: { +case 22: { sym(1).UiImport->versionToken = loc(2); sym(1).UiImport->asToken = loc(3); sym(1).UiImport->importIdToken = loc(4); @@ -265,14 +291,33 @@ case 17: { sym(1).UiImport->semicolonToken = loc(5); } break; -case 19: { +case 24: { sym(1).UiImport->asToken = loc(2); sym(1).UiImport->importIdToken = loc(3); sym(1).UiImport->importId = stringRef(3); sym(1).UiImport->semicolonToken = loc(4); } break; -case 20: { +case 25: { + AST::UiPragma *node = 0; + + if (AST::UiQualifiedPragmaId *qualifiedId = reparseAsQualifiedPragmaId(sym(2).Expression)) { + node = new (pool) AST::UiPragma(qualifiedId); + } + + sym(1).Node = node; + + if (node) { + node->pragmaToken = loc(1); + } else { + diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1), + QLatin1String("Expected a qualified name id"))); + + return false; // ### remove me + } +} break; + +case 26: { AST::UiImport *node = 0; if (AST::StringLiteral *importIdLiteral = AST::cast(sym(2).Expression)) { @@ -295,56 +340,56 @@ case 20: { } } break; -case 21: { +case 27: { sym(1).Node = 0; } break; -case 22: { +case 28: { sym(1).Node = new (pool) AST::UiObjectMemberList(sym(1).UiObjectMember); } break; -case 23: { +case 29: { sym(1).Node = new (pool) AST::UiObjectMemberList(sym(1).UiObjectMember); } break; -case 24: { +case 30: { AST::UiObjectMemberList *node = new (pool) AST:: UiObjectMemberList( sym(1).UiObjectMemberList, sym(2).UiObjectMember); sym(1).Node = node; } break; -case 25: { +case 31: { sym(1).Node = new (pool) AST::UiArrayMemberList(sym(1).UiObjectMember); } break; -case 26: { +case 32: { AST::UiArrayMemberList *node = new (pool) AST::UiArrayMemberList( sym(1).UiArrayMemberList, sym(3).UiObjectMember); node->commaToken = loc(2); sym(1).Node = node; } break; -case 27: { +case 33: { AST::UiObjectInitializer *node = new (pool) AST::UiObjectInitializer((AST::UiObjectMemberList*)0); node->lbraceToken = loc(1); node->rbraceToken = loc(2); sym(1).Node = node; } break; -case 28: { +case 34: { AST::UiObjectInitializer *node = new (pool) AST::UiObjectInitializer(sym(2).UiObjectMemberList->finish()); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 29: { +case 35: { AST::UiObjectDefinition *node = new (pool) AST::UiObjectDefinition(sym(1).UiQualifiedId, sym(2).UiObjectInitializer); sym(1).Node = node; } break; -case 31: { +case 37: { AST::UiArrayBinding *node = new (pool) AST::UiArrayBinding( sym(1).UiQualifiedId, sym(4).UiArrayMemberList->finish()); node->colonToken = loc(2); @@ -353,14 +398,14 @@ case 31: { sym(1).Node = node; } break; -case 32: { +case 38: { AST::UiObjectBinding *node = new (pool) AST::UiObjectBinding( sym(1).UiQualifiedId, sym(3).UiQualifiedId, sym(4).UiObjectInitializer); node->colonToken = loc(2); sym(1).Node = node; } break; -case 33: { +case 39: { AST::UiObjectBinding *node = new (pool) AST::UiObjectBinding( sym(3).UiQualifiedId, sym(1).UiQualifiedId, sym(4).UiObjectInitializer); node->colonToken = loc(2); @@ -368,7 +413,7 @@ case 33: { sym(1).Node = node; } break; -case 41: +case 47: { AST::UiScriptBinding *node = new (pool) AST::UiScriptBinding( sym(1).UiQualifiedId, sym(3).Statement); @@ -376,22 +421,22 @@ case 41: sym(1).Node = node; } break; -case 45: { +case 51: { sym(1).Node = 0; } break; -case 46: { +case 52: { sym(1).Node = sym(1).UiParameterList->finish (); } break; -case 47: { +case 53: { AST::UiParameterList *node = new (pool) AST::UiParameterList(stringRef(1), stringRef(2)); node->propertyTypeToken = loc(1); node->identifierToken = loc(2); sym(1).Node = node; } break; -case 48: { +case 54: { AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(1).UiParameterList, stringRef(3), stringRef(4)); node->propertyTypeToken = loc(3); node->commaToken = loc(2); @@ -399,7 +444,7 @@ case 48: { sym(1).Node = node; } break; -case 50: { +case 56: { AST::UiPublicMember *node = new (pool) AST::UiPublicMember(QStringRef(), stringRef(2)); node->type = AST::UiPublicMember::Signal; node->propertyToken = loc(1); @@ -410,7 +455,7 @@ case 50: { sym(1).Node = node; } break; -case 52: { +case 58: { AST::UiPublicMember *node = new (pool) AST::UiPublicMember(QStringRef(), stringRef(2)); node->type = AST::UiPublicMember::Signal; node->propertyToken = loc(1); @@ -420,7 +465,7 @@ case 52: { sym(1).Node = node; } break; -case 54: { +case 60: { AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(4), stringRef(6)); node->typeModifier = stringRef(2); node->propertyToken = loc(1); @@ -431,7 +476,7 @@ case 54: { sym(1).Node = node; } break; -case 56: { +case 62: { AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3)); node->propertyToken = loc(1); node->typeToken = loc(2); @@ -440,7 +485,7 @@ case 56: { sym(1).Node = node; } break; -case 58: { +case 64: { AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4)); node->isDefaultMember = true; node->defaultToken = loc(1); @@ -451,7 +496,7 @@ case 58: { sym(1).Node = node; } break; -case 59: { +case 65: { AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3), sym(5).Statement); node->propertyToken = loc(1); @@ -461,7 +506,7 @@ case 59: { sym(1).Node = node; } break; -case 60: { +case 66: { AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4), sym(6).Statement); node->isReadonlyMember = true; @@ -473,7 +518,7 @@ case 60: { sym(1).Node = node; } break; -case 61: { +case 67: { AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4), sym(6).Statement); node->isDefaultMember = true; @@ -485,7 +530,7 @@ case 61: { sym(1).Node = node; } break; -case 62: { +case 68: { AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(4), stringRef(6)); node->typeModifier = stringRef(2); node->propertyToken = loc(1); @@ -509,7 +554,7 @@ case 62: { sym(1).Node = node; } break; -case 63: { +case 69: { AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3)); node->propertyToken = loc(1); node->typeToken = loc(2); @@ -529,57 +574,57 @@ case 63: { sym(1).Node = node; } break; -case 64: { +case 70: { sym(1).Node = new (pool) AST::UiSourceElement(sym(1).Node); } break; -case 65: { +case 71: { sym(1).Node = new (pool) AST::UiSourceElement(sym(1).Node); } break; -case 73: { +case 79: { AST::ThisExpression *node = new (pool) AST::ThisExpression(); node->thisToken = loc(1); sym(1).Node = node; } break; -case 74: { +case 80: { AST::IdentifierExpression *node = new (pool) AST::IdentifierExpression(stringRef(1)); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 75: { +case 81: { AST::NullExpression *node = new (pool) AST::NullExpression(); node->nullToken = loc(1); sym(1).Node = node; } break; -case 76: { +case 82: { AST::TrueLiteral *node = new (pool) AST::TrueLiteral(); node->trueToken = loc(1); sym(1).Node = node; } break; -case 77: { +case 83: { AST::FalseLiteral *node = new (pool) AST::FalseLiteral(); node->falseToken = loc(1); sym(1).Node = node; } break; -case 78: { +case 84: { AST::NumericLiteral *node = new (pool) AST::NumericLiteral(sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 79: -case 80: { +case 85: +case 86: { AST::StringLiteral *node = new (pool) AST::StringLiteral(stringRef(1)); node->literalToken = loc(1); sym(1).Node = node; } break; -case 81: { +case 87: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); @@ -595,7 +640,7 @@ case 81: { sym(1).Node = node; } break; -case 82: { +case 88: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage())); @@ -611,28 +656,28 @@ case 82: { sym(1).Node = node; } break; -case 83: { +case 89: { AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral((AST::Elision *) 0); node->lbracketToken = loc(1); node->rbracketToken = loc(2); sym(1).Node = node; } break; -case 84: { +case 90: { AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).Elision->finish()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 85: { +case 91: { AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish ()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 86: { +case 92: { AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish (), (AST::Elision *) 0); node->lbracketToken = loc(1); @@ -641,7 +686,7 @@ case 86: { sym(1).Node = node; } break; -case 87: { +case 93: { AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish (), sym(4).Elision->finish()); node->lbracketToken = loc(1); @@ -650,7 +695,7 @@ case 87: { sym(1).Node = node; } break; -case 88: { +case 94: { AST::ObjectLiteral *node = 0; if (sym(2).Node) node = new (pool) AST::ObjectLiteral( @@ -662,7 +707,7 @@ case 88: { sym(1).Node = node; } break; -case 89: { +case 95: { AST::ObjectLiteral *node = new (pool) AST::ObjectLiteral( sym(2).PropertyAssignmentList->finish ()); node->lbraceToken = loc(1); @@ -670,14 +715,14 @@ case 89: { sym(1).Node = node; } break; -case 90: { +case 96: { AST::NestedExpression *node = new (pool) AST::NestedExpression(sym(2).Expression); node->lparenToken = loc(1); node->rparenToken = loc(3); sym(1).Node = node; } break; -case 91: { +case 97: { if (AST::ArrayMemberExpression *mem = AST::cast(sym(1).Expression)) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, mem->lbracketToken, QLatin1String("Ignored annotation"))); @@ -697,48 +742,48 @@ case 91: { } } break; -case 92: { +case 98: { sym(1).Node = new (pool) AST::ElementList((AST::Elision *) 0, sym(1).Expression); } break; -case 93: { +case 99: { sym(1).Node = new (pool) AST::ElementList(sym(1).Elision->finish(), sym(2).Expression); } break; -case 94: { +case 100: { AST::ElementList *node = new (pool) AST::ElementList(sym(1).ElementList, (AST::Elision *) 0, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 95: { +case 101: { AST::ElementList *node = new (pool) AST::ElementList(sym(1).ElementList, sym(3).Elision->finish(), sym(4).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 96: { +case 102: { AST::Elision *node = new (pool) AST::Elision(); node->commaToken = loc(1); sym(1).Node = node; } break; -case 97: { +case 103: { AST::Elision *node = new (pool) AST::Elision(sym(1).Elision); node->commaToken = loc(2); sym(1).Node = node; } break; -case 98: { +case 104: { AST::PropertyNameAndValue *node = new (pool) AST::PropertyNameAndValue( sym(1).PropertyName, sym(3).Expression); node->colonToken = loc(2); sym(1).Node = node; } break; -case 99: { +case 105: { AST::PropertyGetterSetter *node = new (pool) AST::PropertyGetterSetter( sym(2).PropertyName, sym(6).FunctionBody); node->getSetToken = loc(1); @@ -749,7 +794,7 @@ case 99: { sym(1).Node = node; } break; -case 100: { +case 106: { AST::PropertyGetterSetter *node = new (pool) AST::PropertyGetterSetter( sym(2).PropertyName, sym(4).FormalParameterList, sym(7).FunctionBody); node->getSetToken = loc(1); @@ -760,56 +805,56 @@ case 100: { sym(1).Node = node; } break; -case 101: { +case 107: { sym(1).Node = new (pool) AST::PropertyAssignmentList(sym(1).PropertyAssignment); } break; -case 102: { +case 108: { AST::PropertyAssignmentList *node = new (pool) AST::PropertyAssignmentList( sym(1).PropertyAssignmentList, sym(3).PropertyAssignment); node->commaToken = loc(2); sym(1).Node = node; } break; -case 103: { +case 109: { AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1)); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 104: { +case 110: { AST::StringLiteralPropertyName *node = new (pool) AST::StringLiteralPropertyName(stringRef(1)); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 105: { +case 111: { AST::NumericLiteralPropertyName *node = new (pool) AST::NumericLiteralPropertyName(sym(1).dval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 106: { +case 112: { AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1)); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 142: { +case 148: { AST::ArrayMemberExpression *node = new (pool) AST::ArrayMemberExpression(sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 143: { +case 149: { AST::FieldMemberExpression *node = new (pool) AST::FieldMemberExpression(sym(1).Expression, stringRef(3)); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 144: { +case 150: { AST::NewMemberExpression *node = new (pool) AST::NewMemberExpression(sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -817,505 +862,505 @@ case 144: { sym(1).Node = node; } break; -case 146: { +case 152: { AST::NewExpression *node = new (pool) AST::NewExpression(sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 147: { +case 153: { AST::CallExpression *node = new (pool) AST::CallExpression(sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 148: { +case 154: { AST::CallExpression *node = new (pool) AST::CallExpression(sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 149: { +case 155: { AST::ArrayMemberExpression *node = new (pool) AST::ArrayMemberExpression(sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 150: { +case 156: { AST::FieldMemberExpression *node = new (pool) AST::FieldMemberExpression(sym(1).Expression, stringRef(3)); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 151: { +case 157: { sym(1).Node = 0; } break; -case 152: { +case 158: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 153: { +case 159: { sym(1).Node = new (pool) AST::ArgumentList(sym(1).Expression); } break; -case 154: { +case 160: { AST::ArgumentList *node = new (pool) AST::ArgumentList(sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 158: { +case 164: { AST::PostIncrementExpression *node = new (pool) AST::PostIncrementExpression(sym(1).Expression); node->incrementToken = loc(2); sym(1).Node = node; } break; -case 159: { +case 165: { AST::PostDecrementExpression *node = new (pool) AST::PostDecrementExpression(sym(1).Expression); node->decrementToken = loc(2); sym(1).Node = node; } break; -case 161: { +case 167: { AST::DeleteExpression *node = new (pool) AST::DeleteExpression(sym(2).Expression); node->deleteToken = loc(1); sym(1).Node = node; } break; -case 162: { +case 168: { AST::VoidExpression *node = new (pool) AST::VoidExpression(sym(2).Expression); node->voidToken = loc(1); sym(1).Node = node; } break; -case 163: { +case 169: { AST::TypeOfExpression *node = new (pool) AST::TypeOfExpression(sym(2).Expression); node->typeofToken = loc(1); sym(1).Node = node; } break; -case 164: { +case 170: { AST::PreIncrementExpression *node = new (pool) AST::PreIncrementExpression(sym(2).Expression); node->incrementToken = loc(1); sym(1).Node = node; } break; -case 165: { +case 171: { AST::PreDecrementExpression *node = new (pool) AST::PreDecrementExpression(sym(2).Expression); node->decrementToken = loc(1); sym(1).Node = node; } break; -case 166: { +case 172: { AST::UnaryPlusExpression *node = new (pool) AST::UnaryPlusExpression(sym(2).Expression); node->plusToken = loc(1); sym(1).Node = node; } break; -case 167: { +case 173: { AST::UnaryMinusExpression *node = new (pool) AST::UnaryMinusExpression(sym(2).Expression); node->minusToken = loc(1); sym(1).Node = node; } break; -case 168: { +case 174: { AST::TildeExpression *node = new (pool) AST::TildeExpression(sym(2).Expression); node->tildeToken = loc(1); sym(1).Node = node; } break; -case 169: { +case 175: { AST::NotExpression *node = new (pool) AST::NotExpression(sym(2).Expression); node->notToken = loc(1); sym(1).Node = node; } break; -case 171: { +case 177: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Mul, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 172: { +case 178: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Div, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 173: { +case 179: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Mod, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 175: { +case 181: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Add, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 176: { +case 182: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Sub, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 178: { +case 184: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::LShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 179: { +case 185: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::RShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 180: { +case 186: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::URShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 182: { +case 188: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 183: { - AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::Gt, sym(3).Expression); - node->operatorToken = loc(2); - sym(1).Node = node; -} break; - -case 184: { - AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::Le, sym(3).Expression); - node->operatorToken = loc(2); - sym(1).Node = node; -} break; - -case 185: { - AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::Ge, sym(3).Expression); - node->operatorToken = loc(2); - sym(1).Node = node; -} break; - -case 186: { - AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::InstanceOf, sym(3).Expression); - node->operatorToken = loc(2); - sym(1).Node = node; -} break; - -case 187: { - AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::In, sym(3).Expression); - node->operatorToken = loc(2); - sym(1).Node = node; -} break; - case 189: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::Lt, sym(3).Expression); + QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 190: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::Gt, sym(3).Expression); + QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 191: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::Le, sym(3).Expression); + QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 192: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::Ge, sym(3).Expression); + QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 193: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::InstanceOf, sym(3).Expression); + QSOperator::In, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 195: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::Equal, sym(3).Expression); + QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 196: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::NotEqual, sym(3).Expression); + QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 197: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::StrictEqual, sym(3).Expression); + QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 198: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::StrictNotEqual, sym(3).Expression); + QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 200: { +case 199: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::Equal, sym(3).Expression); + QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 201: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::NotEqual, sym(3).Expression); + QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 202: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::StrictEqual, sym(3).Expression); + QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 203: { + AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, + QSOperator::StrictEqual, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; +} break; + +case 204: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 205: { +case 206: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::BitAnd, sym(3).Expression); + QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 207: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::BitAnd, sym(3).Expression); + QSOperator::NotEqual, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; +} break; + +case 208: { + AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, + QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 209: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::BitXor, sym(3).Expression); + QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 211: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::BitXor, sym(3).Expression); + QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 213: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::BitOr, sym(3).Expression); + QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 215: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::BitOr, sym(3).Expression); + QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 217: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::And, sym(3).Expression); + QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 219: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::And, sym(3).Expression); + QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 221: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::Or, sym(3).Expression); + QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 223: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - QSOperator::Or, sym(3).Expression); + QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 225: { - AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression, - sym(3).Expression, sym(5).Expression); - node->questionToken = loc(2); - node->colonToken = loc(4); + AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, + QSOperator::And, sym(3).Expression); + node->operatorToken = loc(2); sym(1).Node = node; } break; case 227: { - AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression, - sym(3).Expression, sym(5).Expression); - node->questionToken = loc(2); - node->colonToken = loc(4); + AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, + QSOperator::Or, sym(3).Expression); + node->operatorToken = loc(2); sym(1).Node = node; } break; case 229: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, - sym(2).ival, sym(3).Expression); + QSOperator::Or, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; case 231: { + AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression, + sym(3).Expression, sym(5).Expression); + node->questionToken = loc(2); + node->colonToken = loc(4); + sym(1).Node = node; +} break; + +case 233: { + AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression, + sym(3).Expression, sym(5).Expression); + node->questionToken = loc(2); + node->colonToken = loc(4); + sym(1).Node = node; +} break; + +case 235: { AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 232: { - sym(1).ival = QSOperator::Assign; -} break; - -case 233: { - sym(1).ival = QSOperator::InplaceMul; -} break; - -case 234: { - sym(1).ival = QSOperator::InplaceDiv; -} break; - -case 235: { - sym(1).ival = QSOperator::InplaceMod; -} break; - -case 236: { - sym(1).ival = QSOperator::InplaceAdd; -} break; - case 237: { - sym(1).ival = QSOperator::InplaceSub; + AST::BinaryExpression *node = new (pool) AST::BinaryExpression(sym(1).Expression, + sym(2).ival, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; } break; case 238: { - sym(1).ival = QSOperator::InplaceLeftShift; + sym(1).ival = QSOperator::Assign; } break; case 239: { - sym(1).ival = QSOperator::InplaceRightShift; + sym(1).ival = QSOperator::InplaceMul; } break; case 240: { - sym(1).ival = QSOperator::InplaceURightShift; + sym(1).ival = QSOperator::InplaceDiv; } break; case 241: { - sym(1).ival = QSOperator::InplaceAnd; + sym(1).ival = QSOperator::InplaceMod; } break; case 242: { - sym(1).ival = QSOperator::InplaceXor; + sym(1).ival = QSOperator::InplaceAdd; } break; case 243: { - sym(1).ival = QSOperator::InplaceOr; + sym(1).ival = QSOperator::InplaceSub; +} break; + +case 244: { + sym(1).ival = QSOperator::InplaceLeftShift; } break; case 245: { - AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression); - node->commaToken = loc(2); - sym(1).Node = node; + sym(1).ival = QSOperator::InplaceRightShift; } break; case 246: { - sym(1).Node = 0; + sym(1).ival = QSOperator::InplaceURightShift; +} break; + +case 247: { + sym(1).ival = QSOperator::InplaceAnd; +} break; + +case 248: { + sym(1).ival = QSOperator::InplaceXor; } break; case 249: { + sym(1).ival = QSOperator::InplaceOr; +} break; + +case 251: { AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 250: { +case 252: { sym(1).Node = 0; } break; -case 267: { +case 255: { + AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression); + node->commaToken = loc(2); + sym(1).Node = node; +} break; + +case 256: { + sym(1).Node = 0; +} break; + +case 273: { AST::Block *node = new (pool) AST::Block(sym(2).StatementList); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 268: { +case 274: { sym(1).Node = new (pool) AST::StatementList(sym(1).Statement); } break; -case 269: { +case 275: { sym(1).Node = new (pool) AST::StatementList(sym(1).StatementList, sym(2).Statement); } break; -case 270: { +case 276: { sym(1).Node = 0; } break; -case 271: { +case 277: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 273: { +case 279: { AST::VariableStatement *node = new (pool) AST::VariableStatement( sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); @@ -1323,76 +1368,76 @@ case 273: { sym(1).Node = node; } break; -case 274: { +case 280: { sym(1).ival = T_CONST; } break; -case 275: { +case 281: { sym(1).ival = T_VAR; } break; -case 276: { +case 282: { sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclaration); } break; -case 277: { +case 283: { AST::VariableDeclarationList *node = new (pool) AST::VariableDeclarationList( sym(1).VariableDeclarationList, sym(3).VariableDeclaration); node->commaToken = loc(2); sym(1).Node = node; } break; -case 278: { +case 284: { sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclaration); } break; -case 279: { +case 285: { sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 280: { - AST::VariableDeclaration *node = new (pool) AST::VariableDeclaration(stringRef(1), sym(2).Expression); - node->identifierToken = loc(1); - sym(1).Node = node; -} break; - -case 281: { - AST::VariableDeclaration *node = new (pool) AST::VariableDeclaration(stringRef(1), sym(2).Expression); - node->identifierToken = loc(1); - sym(1).Node = node; -} break; - -case 282: { - // ### TODO: AST for initializer - sym(1) = sym(2); -} break; - -case 283: { - sym(1).Node = 0; -} break; - -case 285: { - // ### TODO: AST for initializer - sym(1) = sym(2); -} break; - case 286: { - sym(1).Node = 0; + AST::VariableDeclaration *node = new (pool) AST::VariableDeclaration(stringRef(1), sym(2).Expression); + node->identifierToken = loc(1); + sym(1).Node = node; +} break; + +case 287: { + AST::VariableDeclaration *node = new (pool) AST::VariableDeclaration(stringRef(1), sym(2).Expression); + node->identifierToken = loc(1); + sym(1).Node = node; } break; case 288: { + // ### TODO: AST for initializer + sym(1) = sym(2); +} break; + +case 289: { + sym(1).Node = 0; +} break; + +case 291: { + // ### TODO: AST for initializer + sym(1) = sym(2); +} break; + +case 292: { + sym(1).Node = 0; +} break; + +case 294: { AST::EmptyStatement *node = new (pool) AST::EmptyStatement(); node->semicolonToken = loc(1); sym(1).Node = node; } break; -case 290: { +case 296: { AST::ExpressionStatement *node = new (pool) AST::ExpressionStatement(sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 291: { +case 297: { AST::IfStatement *node = new (pool) AST::IfStatement(sym(3).Expression, sym(5).Statement, sym(7).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1401,7 +1446,7 @@ case 291: { sym(1).Node = node; } break; -case 292: { +case 298: { AST::IfStatement *node = new (pool) AST::IfStatement(sym(3).Expression, sym(5).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1409,7 +1454,7 @@ case 292: { sym(1).Node = node; } break; -case 295: { +case 301: { AST::DoWhileStatement *node = new (pool) AST::DoWhileStatement(sym(2).Statement, sym(5).Expression); node->doToken = loc(1); node->whileToken = loc(3); @@ -1419,7 +1464,7 @@ case 295: { sym(1).Node = node; } break; -case 296: { +case 302: { AST::WhileStatement *node = new (pool) AST::WhileStatement(sym(3).Expression, sym(5).Statement); node->whileToken = loc(1); node->lparenToken = loc(2); @@ -1427,7 +1472,7 @@ case 296: { sym(1).Node = node; } break; -case 297: { +case 303: { AST::ForStatement *node = new (pool) AST::ForStatement(sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); node->forToken = loc(1); @@ -1438,7 +1483,7 @@ case 297: { sym(1).Node = node; } break; -case 298: { +case 304: { AST::LocalForStatement *node = new (pool) AST::LocalForStatement( sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); @@ -1451,7 +1496,7 @@ case 298: { sym(1).Node = node; } break; -case 299: { +case 305: { AST:: ForEachStatement *node = new (pool) AST::ForEachStatement(sym(3).Expression, sym(5).Expression, sym(7).Statement); node->forToken = loc(1); @@ -1461,7 +1506,7 @@ case 299: { sym(1).Node = node; } break; -case 300: { +case 306: { AST::LocalForEachStatement *node = new (pool) AST::LocalForEachStatement( sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); node->forToken = loc(1); @@ -1472,14 +1517,14 @@ case 300: { sym(1).Node = node; } break; -case 302: { +case 308: { AST::ContinueStatement *node = new (pool) AST::ContinueStatement(); node->continueToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 304: { +case 310: { AST::ContinueStatement *node = new (pool) AST::ContinueStatement(stringRef(2)); node->continueToken = loc(1); node->identifierToken = loc(2); @@ -1487,14 +1532,14 @@ case 304: { sym(1).Node = node; } break; -case 306: { +case 312: { AST::BreakStatement *node = new (pool) AST::BreakStatement(QStringRef()); node->breakToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 308: { +case 314: { AST::BreakStatement *node = new (pool) AST::BreakStatement(stringRef(2)); node->breakToken = loc(1); node->identifierToken = loc(2); @@ -1502,14 +1547,14 @@ case 308: { sym(1).Node = node; } break; -case 310: { +case 316: { AST::ReturnStatement *node = new (pool) AST::ReturnStatement(sym(2).Expression); node->returnToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 311: { +case 317: { AST::WithStatement *node = new (pool) AST::WithStatement(sym(3).Expression, sym(5).Statement); node->withToken = loc(1); node->lparenToken = loc(2); @@ -1517,7 +1562,7 @@ case 311: { sym(1).Node = node; } break; -case 312: { +case 318: { AST::SwitchStatement *node = new (pool) AST::SwitchStatement(sym(3).Expression, sym(5).CaseBlock); node->switchToken = loc(1); node->lparenToken = loc(2); @@ -1525,83 +1570,83 @@ case 312: { sym(1).Node = node; } break; -case 313: { +case 319: { AST::CaseBlock *node = new (pool) AST::CaseBlock(sym(2).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 314: { +case 320: { AST::CaseBlock *node = new (pool) AST::CaseBlock(sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(5); sym(1).Node = node; } break; -case 315: { +case 321: { sym(1).Node = new (pool) AST::CaseClauses(sym(1).CaseClause); } break; -case 316: { +case 322: { sym(1).Node = new (pool) AST::CaseClauses(sym(1).CaseClauses, sym(2).CaseClause); } break; -case 317: { +case 323: { sym(1).Node = 0; } break; -case 318: { +case 324: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 319: { +case 325: { AST::CaseClause *node = new (pool) AST::CaseClause(sym(2).Expression, sym(4).StatementList); node->caseToken = loc(1); node->colonToken = loc(3); sym(1).Node = node; } break; -case 320: { +case 326: { AST::DefaultClause *node = new (pool) AST::DefaultClause(sym(3).StatementList); node->defaultToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 321: { +case 327: { AST::LabelledStatement *node = new (pool) AST::LabelledStatement(stringRef(1), sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 323: { +case 329: { AST::ThrowStatement *node = new (pool) AST::ThrowStatement(sym(2).Expression); node->throwToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 324: { +case 330: { AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Catch); node->tryToken = loc(1); sym(1).Node = node; } break; -case 325: { +case 331: { AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 326: { +case 332: { AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Catch, sym(4).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 327: { +case 333: { AST::Catch *node = new (pool) AST::Catch(stringRef(3), sym(5).Block); node->catchToken = loc(1); node->lparenToken = loc(2); @@ -1610,20 +1655,20 @@ case 327: { sym(1).Node = node; } break; -case 328: { +case 334: { AST::Finally *node = new (pool) AST::Finally(sym(2).Block); node->finallyToken = loc(1); sym(1).Node = node; } break; -case 330: { +case 336: { AST::DebuggerStatement *node = new (pool) AST::DebuggerStatement(); node->debuggerToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 332: { +case 338: { AST::FunctionDeclaration *node = new (pool) AST::FunctionDeclaration(stringRef(2), sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1634,7 +1679,7 @@ case 332: { sym(1).Node = node; } break; -case 333: { +case 339: { AST::FunctionExpression *node = new (pool) AST::FunctionExpression(stringRef(2), sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (! stringRef(2).isNull()) @@ -1646,7 +1691,7 @@ case 333: { sym(1).Node = node; } break; -case 334: { +case 340: { AST::FunctionExpression *node = new (pool) AST::FunctionExpression(QStringRef(), sym(3).FormalParameterList, sym(6).FunctionBody); node->functionToken = loc(1); node->lparenToken = loc(2); @@ -1656,56 +1701,56 @@ case 334: { sym(1).Node = node; } break; -case 335: { +case 341: { AST::FormalParameterList *node = new (pool) AST::FormalParameterList(stringRef(1)); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 336: { +case 342: { AST::FormalParameterList *node = new (pool) AST::FormalParameterList(sym(1).FormalParameterList, stringRef(3)); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 337: { - sym(1).Node = 0; -} break; - -case 338: { - sym(1).Node = sym(1).FormalParameterList->finish (); -} break; - -case 339: { - sym(1).Node = 0; -} break; - -case 341: { - sym(1).Node = new (pool) AST::FunctionBody(sym(1).SourceElements->finish ()); -} break; - case 343: { - sym(1).Node = new (pool) AST::Program(sym(1).SourceElements->finish ()); + sym(1).Node = 0; } break; case 344: { - sym(1).Node = new (pool) AST::SourceElements(sym(1).SourceElement); + sym(1).Node = sym(1).FormalParameterList->finish (); } break; case 345: { - sym(1).Node = new (pool) AST::SourceElements(sym(1).SourceElements, sym(2).SourceElement); -} break; - -case 346: { - sym(1).Node = new (pool) AST::StatementSourceElement(sym(1).Statement); + sym(1).Node = 0; } break; case 347: { + sym(1).Node = new (pool) AST::FunctionBody(sym(1).SourceElements->finish ()); +} break; + +case 349: { + sym(1).Node = new (pool) AST::Program(sym(1).SourceElements->finish ()); +} break; + +case 350: { + sym(1).Node = new (pool) AST::SourceElements(sym(1).SourceElement); +} break; + +case 351: { + sym(1).Node = new (pool) AST::SourceElements(sym(1).SourceElements, sym(2).SourceElement); +} break; + +case 352: { + sym(1).Node = new (pool) AST::StatementSourceElement(sym(1).Statement); +} break; + +case 353: { sym(1).Node = new (pool) AST::FunctionSourceElement(sym(1).FunctionDeclaration); } break; -case 348: { +case 354: { sym(1).Node = 0; } break; diff --git a/src/tools/qdoc/qmlparser/qqmljsparser_p.h b/src/tools/qdoc/qmlparser/qqmljsparser_p.h index 6edfd844d0b..bf963718fbf 100644 --- a/src/tools/qdoc/qmlparser/qqmljsparser_p.h +++ b/src/tools/qdoc/qmlparser/qqmljsparser_p.h @@ -112,7 +112,8 @@ public: AST::VariableDeclarationList *VariableDeclarationList; AST::UiProgram *UiProgram; - AST::UiImportList *UiImportList; + AST::UiHeaderItemList *UiHeaderItemList; + AST::UiPragma *UiPragma; AST::UiImport *UiImport; AST::UiParameterList *UiParameterList; AST::UiPublicMember *UiPublicMember; @@ -125,6 +126,7 @@ public: AST::UiObjectMemberList *UiObjectMemberList; AST::UiArrayMemberList *UiArrayMemberList; AST::UiQualifiedId *UiQualifiedId; + AST::UiQualifiedPragmaId *UiQualifiedPragmaId; }; public: @@ -206,6 +208,7 @@ protected: { return location_stack [tos + index - 1]; } AST::UiQualifiedId *reparseAsQualifiedId(AST::ExpressionNode *expr); + AST::UiQualifiedPragmaId *reparseAsQualifiedPragmaId(AST::ExpressionNode *expr); protected: Engine *driver; @@ -245,9 +248,9 @@ protected: -#define J_SCRIPT_REGEXPLITERAL_RULE1 81 +#define J_SCRIPT_REGEXPLITERAL_RULE1 87 -#define J_SCRIPT_REGEXPLITERAL_RULE2 82 +#define J_SCRIPT_REGEXPLITERAL_RULE2 88 QT_QML_END_NAMESPACE From 45b10ee02af53b712feacdce1d5c86af5a4079ad Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Wed, 30 Oct 2013 11:55:53 +0100 Subject: [PATCH 152/494] qdoc: Don't output docs for internal things MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This update to the Generator base class prevents qdoc from writing an html file for anything that is marked \internal if the user has not set the showinternal flag. Task-number: QTBUG-34269 Change-Id: Ia60109d4568447501370bb9d4c1344a48f9b6113 Reviewed-by: Topi Reiniö Reviewed-by: Jerome Pasion Reviewed-by: Nico Vertriest --- src/tools/qdoc/generator.cpp | 4 ++++ src/tools/qdoc/generator.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index e6c5ae90625..357e0133608 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -136,6 +136,7 @@ Generator::Generator() inSectionHeading_(false), inTableHeader_(false), threeColumnEnumValueTable_(true), + showInternal_(false), numTableRows_(0) { qdb_ = QDocDatabase::qdocDB(); @@ -964,6 +965,8 @@ void Generator::generateInnerNode(InnerNode* node) return; if (node->isIndexNode()) return; + if (node->isInternal() && !showInternal_) + return; if (node->type() == Node::Document) { DocNode* docNode = static_cast(node); @@ -1666,6 +1669,7 @@ void Generator::augmentImageDirs(QSet& moreImageDirs) void Generator::initializeGenerator(const Config& config) { config_ = &config; + showInternal_ = config.getBool(CONFIG_SHOWINTERNAL); } bool Generator::matchAhead(const Atom *atom, Atom::Type expectedAtomType) diff --git a/src/tools/qdoc/generator.h b/src/tools/qdoc/generator.h index 52d73e8dea8..b464014308c 100644 --- a/src/tools/qdoc/generator.h +++ b/src/tools/qdoc/generator.h @@ -239,6 +239,7 @@ private: bool inSectionHeading_; bool inTableHeader_; bool threeColumnEnumValueTable_; + bool showInternal_; int numTableRows_; QString link_; QString sectionNumber_; From 59569fd0202c52a16860fba5634e743286a19fd2 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 31 Oct 2013 16:14:54 +0100 Subject: [PATCH 153/494] Android: Differ between ShowMaximized and ShowFullScreen The default is now ShowMaximized which behaves as it did before, i.e. each window will fill the screen but the status bar will be visible. Calling showFullScreen() explicitly will now hide the status bar to maximize the amount of screen real estate occupied by the application. Task-number: QTBUG-33135 Change-Id: If0d0a2ab72f8026e76818290e2b953dbc0dec156 Reviewed-by: BogDan Vatra --- src/gui/kernel/qplatformintegration.cpp | 2 + src/gui/kernel/qplatformintegration.h | 3 +- src/gui/kernel/qwindow.cpp | 2 + .../platforms/android/opengl/opengl.pro | 6 +- .../platforms/android/src/androidjnimain.cpp | 34 +++++++++++ .../platforms/android/src/androidjnimain.h | 5 +- .../opengl/qandroidopenglplatformscreen.cpp | 59 ++++++++++++++++++ .../src/opengl/qandroidopenglplatformscreen.h | 60 +++++++++++++++++++ .../opengl/qandroidopenglplatformwindow.cpp | 27 +++++++++ .../src/opengl/qandroidopenglplatformwindow.h | 3 + .../src/qandroidplatformintegration.cpp | 14 ++++- .../android/src/qandroidplatformintegration.h | 4 ++ .../src/raster/qandroidplatformscreen.cpp | 7 +++ .../src/raster/qandroidplatformwindow.cpp | 37 +++++++++++- .../src/raster/qandroidplatformwindow.h | 5 ++ .../platforms/eglfs/qeglfsintegration.cpp | 7 ++- .../platforms/eglfs/qeglfsintegration.h | 3 + src/plugins/platforms/eglfs/qeglfsscreen.cpp | 17 +++++- src/plugins/platforms/eglfs/qeglfsscreen.h | 1 + src/widgets/kernel/qwidget.cpp | 2 + 20 files changed, 287 insertions(+), 11 deletions(-) create mode 100644 src/plugins/platforms/android/src/opengl/qandroidopenglplatformscreen.cpp create mode 100644 src/plugins/platforms/android/src/opengl/qandroidopenglplatformscreen.h diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index e583606e416..08a3b63ee42 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -343,6 +343,8 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const return QPlatformTheme::defaultThemeHint(QPlatformTheme::StartDragTime); case ShowIsFullScreen: return false; + case ShowIsMaximized: + return false; case PasswordMaskDelay: return QPlatformTheme::defaultThemeHint(QPlatformTheme::PasswordMaskDelay); case PasswordMaskCharacter: diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h index 4be675a37a9..d397270c101 100644 --- a/src/gui/kernel/qplatformintegration.h +++ b/src/gui/kernel/qplatformintegration.h @@ -147,7 +147,8 @@ public: UseRtlExtensions, SynthesizeMouseFromTouchEvents, PasswordMaskCharacter, - SetFocusOnTouchRelease + SetFocusOnTouchRelease, + ShowIsMaximized }; virtual QVariant styleHint(StyleHint hint) const; diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index a3841d3cfb4..e0e1638d750 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1657,6 +1657,8 @@ void QWindow::show() bool isPopup = d_func()->windowFlags & Qt::Popup & ~Qt::Window; if (!isPopup && qApp->styleHints()->showIsFullScreen()) showFullScreen(); + else if (!isPopup && QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::ShowIsMaximized).toBool()) + showMaximized(); else showNormal(); } diff --git a/src/plugins/platforms/android/opengl/opengl.pro b/src/plugins/platforms/android/opengl/opengl.pro index 301c8e6e4c1..ea050ca3a0c 100644 --- a/src/plugins/platforms/android/opengl/opengl.pro +++ b/src/plugins/platforms/android/opengl/opengl.pro @@ -20,11 +20,13 @@ INCLUDEPATH += $$PWD/../src/opengl/ HEADERS += \ $$PWD/../src/opengl/qandroidopenglcontext.h \ - $$PWD/../src/opengl/qandroidopenglplatformwindow.h + $$PWD/../src/opengl/qandroidopenglplatformwindow.h \ + $$PWD/../src/opengl/qandroidopenglplatformscreen.h SOURCES += \ $$PWD/../src/opengl/qandroidopenglcontext.cpp \ - $$PWD/../src/opengl/qandroidopenglplatformwindow.cpp + $$PWD/../src/opengl/qandroidopenglplatformwindow.cpp \ + $$PWD/../src/opengl/qandroidopenglplatformscreen.cpp include($$PWD/../../eglfs/eglfs.pri) include($$PWD/../src/src.pri) diff --git a/src/plugins/platforms/android/src/androidjnimain.cpp b/src/plugins/platforms/android/src/androidjnimain.cpp index 8b29a895b1d..9ce79f445ac 100644 --- a/src/plugins/platforms/android/src/androidjnimain.cpp +++ b/src/plugins/platforms/android/src/androidjnimain.cpp @@ -97,6 +97,9 @@ static jmethodID m_createBitmapMethodID = 0; static jobject m_ARGB_8888_BitmapConfigValue = 0; static jobject m_RGB_565_BitmapConfigValue = 0; +jmethodID m_setFullScreenMethodID = 0; +static bool m_statusBarShowing = true; + static jclass m_bitmapDrawableClass = 0; static jmethodID m_bitmapDrawableConstructorMethodID = 0; @@ -310,6 +313,36 @@ namespace QtAndroid return m_activityObject; } + void showStatusBar() + { + if (m_statusBarShowing) + return; + + QtAndroid::AttachedJNIEnv env; + if (env.jniEnv == 0) { + qWarning("Failed to get JNI Environment."); + return; + } + + env.jniEnv->CallStaticVoidMethod(m_applicationClass, m_setFullScreenMethodID, false); + m_statusBarShowing = true; + } + + void hideStatusBar() + { + if (!m_statusBarShowing) + return; + + QtAndroid::AttachedJNIEnv env; + if (env.jniEnv == 0) { + qWarning("Failed to get JNI Environment."); + return; + } + + env.jniEnv->CallStaticVoidMethod(m_applicationClass, m_setFullScreenMethodID, true); + m_statusBarShowing = false; + } + void setApplicationActive() { if (m_activityActive) @@ -753,6 +786,7 @@ static int registerNatives(JNIEnv *env) jclass clazz; FIND_AND_CHECK_CLASS("org/qtproject/qt5/android/QtNative"); m_applicationClass = static_cast(env->NewGlobalRef(clazz)); + GET_AND_CHECK_STATIC_METHOD(m_setFullScreenMethodID, m_applicationClass, "setFullScreen", "(Z)V"); if (env->RegisterNatives(m_applicationClass, methods, sizeof(methods) / sizeof(methods[0])) < 0) { __android_log_print(ANDROID_LOG_FATAL,"Qt", "RegisterNatives failed"); diff --git a/src/plugins/platforms/android/src/androidjnimain.h b/src/plugins/platforms/android/src/androidjnimain.h index b530aac8849..11d35734043 100644 --- a/src/plugins/platforms/android/src/androidjnimain.h +++ b/src/plugins/platforms/android/src/androidjnimain.h @@ -69,8 +69,6 @@ namespace QtAndroid void setAndroidPlatformIntegration(QAndroidPlatformIntegration *androidPlatformIntegration); void setQtThread(QThread *thread); - void setFullScreen(QWidget *widget); - #ifndef ANDROID_PLUGIN_OPENGL void flushImage(const QPoint &pos, const QImage &image, const QRect &rect); #else @@ -89,6 +87,9 @@ namespace QtAndroid void setApplicationActive(); + void showStatusBar(); + void hideStatusBar(); + jobject createBitmap(QImage img, JNIEnv *env = 0); jobject createBitmapDrawable(jobject bitmap, JNIEnv *env = 0); diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformscreen.cpp b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformscreen.cpp new file mode 100644 index 00000000000..821fd954df7 --- /dev/null +++ b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformscreen.cpp @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qandroidopenglplatformscreen.h" +#include "qandroidopenglplatformwindow.h" + +QT_BEGIN_NAMESPACE + +QAndroidOpenGLPlatformScreen::QAndroidOpenGLPlatformScreen(EGLDisplay display) + : QEglFSScreen(display) +{ +} + +void QAndroidOpenGLPlatformScreen::topWindowChanged(QPlatformWindow *window) +{ + QAndroidOpenGLPlatformWindow *platformWindow = static_cast(window); + if (platformWindow != 0) + platformWindow->updateStatusBarVisibility(); +} + +QT_END_NAMESPACE diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformscreen.h b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformscreen.h new file mode 100644 index 00000000000..e9251592aa4 --- /dev/null +++ b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformscreen.h @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QANDROIDOPENGLPLATFORMSCREEN_H +#define QANDROIDOPENGLPLATFORMSCREEN_H + +#include "qeglfsscreen.h" + +QT_BEGIN_NAMESPACE + +class QAndroidOpenGLPlatformScreen : public QEglFSScreen +{ +public: + QAndroidOpenGLPlatformScreen(EGLDisplay display); + +protected: + void topWindowChanged(QPlatformWindow *window); +}; + +QT_END_NAMESPACE + +#endif // QANDROIDOPENGLPLATFORMSCREEN_H diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp index 258a0968e87..6ed805174b7 100644 --- a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp +++ b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp @@ -53,6 +53,7 @@ QBasicAtomicInt QAndroidOpenGLPlatformWindow::m_referenceCount = Q_BASIC_ATOMIC_ QAndroidOpenGLPlatformWindow::QAndroidOpenGLPlatformWindow(QWindow *window) : QEglFSWindow(window) + , m_state(Qt::WindowNoState) { } @@ -131,12 +132,38 @@ void QAndroidOpenGLPlatformWindow::destroy() } } +void QAndroidOpenGLPlatformWindow::updateStatusBarVisibility() +{ + Qt::WindowFlags flags = window()->flags(); + bool isNonRegularWindow = flags & (Qt::Popup | Qt::Dialog | Qt::Sheet) & ~Qt::Window; + if (!isNonRegularWindow) { + if (m_state & Qt::WindowFullScreen) + QtAndroid::hideStatusBar(); + else if (m_state & Qt::WindowMaximized) + QtAndroid::showStatusBar(); + } +} + void QAndroidOpenGLPlatformWindow::raise() { + updateStatusBarVisibility(); +} + +void QAndroidOpenGLPlatformWindow::setWindowState(Qt::WindowState state) +{ + if (m_state == state) + return; + + m_state = state; + if (window()->isVisible()) + updateStatusBarVisibility(); } void QAndroidOpenGLPlatformWindow::setVisible(bool visible) { + if (visible) + updateStatusBarVisibility(); + QEglFSWindow::setVisible(visible); // The Android Activity is activated before Qt is initialized, causing the application state to diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h index 9a25957ccd0..e4ff0444d40 100644 --- a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h +++ b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h @@ -66,16 +66,19 @@ public: void invalidateSurface(); void resetSurface(); + void setWindowState(Qt::WindowState state); void setVisible(bool visible); void destroy(); static void updateStaticNativeWindow(); + void updateStatusBarVisibility(); private: QSize m_scheduledResize; QMutex m_lock; + Qt::WindowState m_state; static QReadWriteLock m_staticSurfaceLock; static EGLSurface m_staticSurface; diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp index e48a3c9ebe1..6d0ec306ab6 100644 --- a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp @@ -61,6 +61,7 @@ # include "androidjnimenu.h" # include "qandroidopenglcontext.h" # include "qandroidopenglplatformwindow.h" +# include "qandroidopenglplatformscreen.h" # include "qeglfshooks.h" # include #endif @@ -141,7 +142,10 @@ QPlatformBackingStore *QAndroidPlatformIntegration::createPlatformBackingStore(Q QPlatformWindow *QAndroidPlatformIntegration::createPlatformWindow(QWindow *window) const { - return new QAndroidPlatformWindow(window); + QAndroidPlatformWindow *platformWindow = new QAndroidPlatformWindow(window); + platformWindow->setWindowState(window->windowState()); + + return platformWindow; } QAbstractEventDispatcher *QAndroidPlatformIntegration::createEventDispatcher() const @@ -154,6 +158,7 @@ QPlatformWindow *QAndroidPlatformIntegration::createPlatformWindow(QWindow *wind QAndroidOpenGLPlatformWindow *platformWindow = new QAndroidOpenGLPlatformWindow(window); platformWindow->create(); platformWindow->requestActivateWindow(); + platformWindow->setWindowState(window->windowState()); QtAndroidMenu::setActiveTopLevelWindow(window); return platformWindow; @@ -230,7 +235,7 @@ QPlatformServices *QAndroidPlatformIntegration::services() const QVariant QAndroidPlatformIntegration::styleHint(StyleHint hint) const { switch (hint) { - case ShowIsFullScreen: + case ShowIsMaximized: return true; default: return QPlatformIntegration::styleHint(hint); @@ -307,6 +312,11 @@ void QAndroidPlatformIntegration::setDisplayMetrics(int width, int height) m_defaultPhysicalSizeHeight = height; } +QEglFSScreen *QAndroidPlatformIntegration::createScreen() const +{ + return new QAndroidOpenGLPlatformScreen(display()); +} + #endif void QAndroidPlatformIntegration::pauseApp() diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.h b/src/plugins/platforms/android/src/qandroidplatformintegration.h index 5ebdf9e65c3..3b34cdf7dfb 100644 --- a/src/plugins/platforms/android/src/qandroidplatformintegration.h +++ b/src/plugins/platforms/android/src/qandroidplatformintegration.h @@ -140,6 +140,10 @@ public: QTouchDevice *touchDevice() const { return m_touchDevice; } void setTouchDevice(QTouchDevice *touchDevice) { m_touchDevice = touchDevice; } +#ifdef ANDROID_PLUGIN_OPENGL + QEglFSScreen *createScreen() const; +#endif + private: friend class QEglFSAndroidHooks; diff --git a/src/plugins/platforms/android/src/raster/qandroidplatformscreen.cpp b/src/plugins/platforms/android/src/raster/qandroidplatformscreen.cpp index 0250a6122c9..2e59c307c3f 100644 --- a/src/plugins/platforms/android/src/raster/qandroidplatformscreen.cpp +++ b/src/plugins/platforms/android/src/raster/qandroidplatformscreen.cpp @@ -43,6 +43,7 @@ #include "qandroidplatformintegration.h" #include "androidjnimain.h" #include "androidjnimenu.h" +#include "qandroidplatformwindow.h" QAndroidPlatformScreen::QAndroidPlatformScreen():QFbScreen() { @@ -57,6 +58,12 @@ QAndroidPlatformScreen::QAndroidPlatformScreen():QFbScreen() void QAndroidPlatformScreen::topWindowChanged(QWindow *w) { QtAndroidMenu::setActiveTopLevelWindow(w); + + if (w != 0) { + QAndroidPlatformWindow *platformWindow = static_cast(w->handle()); + if (platformWindow != 0) + platformWindow->updateStatusBarVisibility(); + } } QRegion QAndroidPlatformScreen::doRedraw() diff --git a/src/plugins/platforms/android/src/raster/qandroidplatformwindow.cpp b/src/plugins/platforms/android/src/raster/qandroidplatformwindow.cpp index f5fce0ae34f..2dedc770277 100644 --- a/src/plugins/platforms/android/src/raster/qandroidplatformwindow.cpp +++ b/src/plugins/platforms/android/src/raster/qandroidplatformwindow.cpp @@ -44,7 +44,9 @@ #include "androidjnimain.h" #include -QAndroidPlatformWindow::QAndroidPlatformWindow(QWindow *window) : QFbWindow(window) +QAndroidPlatformWindow::QAndroidPlatformWindow(QWindow *window) + : QFbWindow(window) + , m_state(Qt::WindowNoState) { } @@ -58,8 +60,41 @@ void QAndroidPlatformWindow::propagateSizeHints() //shut up warning from default implementation } +void QAndroidPlatformWindow::updateStatusBarVisibility() +{ + Qt::WindowFlags flags = window()->flags(); + bool isNonRegularWindow = flags & (Qt::Popup | Qt::Dialog | Qt::Sheet) & ~Qt::Window; + if (!isNonRegularWindow) { + if (m_state & Qt::WindowFullScreen) + QtAndroid::hideStatusBar(); + else if (m_state & Qt::WindowMaximized) + QtAndroid::showStatusBar(); + } +} + +void QAndroidPlatformWindow::raise() +{ + updateStatusBarVisibility(); + QFbWindow::raise(); +} + +void QAndroidPlatformWindow::setWindowState(Qt::WindowState state) +{ + if (m_state == state) + return; + + m_state = state; + if (window()->isVisible()) + updateStatusBarVisibility(); + + QFbWindow::setWindowState(state); +} + void QAndroidPlatformWindow::setVisible(bool visible) { + if (visible) + updateStatusBarVisibility(); + QFbWindow::setVisible(visible); // The Android Activity is activated before Qt is initialized, causing the application state to diff --git a/src/plugins/platforms/android/src/raster/qandroidplatformwindow.h b/src/plugins/platforms/android/src/raster/qandroidplatformwindow.h index 58e6451ea19..87626b982a7 100644 --- a/src/plugins/platforms/android/src/raster/qandroidplatformwindow.h +++ b/src/plugins/platforms/android/src/raster/qandroidplatformwindow.h @@ -52,11 +52,16 @@ public: void propagateSizeHints(); + void raise(); + void setWindowState(Qt::WindowState state); void setVisible(bool visible); + void updateStatusBarVisibility(); public slots: void setGeometry(const QRect &rect); +private: + Qt::WindowState m_state; }; #endif // ANDROIDPLATFORMWINDOW_H diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp index 8a526dbff5f..9f8c0747df9 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp @@ -165,7 +165,7 @@ void QEglFSIntegration::initialize() qFatal("EGL error"); } - mScreen = new QEglFSScreen(mDisplay); + mScreen = createScreen(); screenAdded(mScreen); mInputContext = QPlatformInputContextFactory::create(); @@ -173,6 +173,11 @@ void QEglFSIntegration::initialize() createInputHandlers(); } +QEglFSScreen *QEglFSIntegration::createScreen() const +{ + return new QEglFSScreen(mDisplay); +} + QVariant QEglFSIntegration::styleHint(QPlatformIntegration::StyleHint hint) const { switch (hint) diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.h b/src/plugins/platforms/eglfs/qeglfsintegration.h index a6fcfc84271..f685eec2d47 100644 --- a/src/plugins/platforms/eglfs/qeglfsintegration.h +++ b/src/plugins/platforms/eglfs/qeglfsintegration.h @@ -86,6 +86,9 @@ public: QPlatformInputContext *inputContext() const { return mInputContext; } +protected: + virtual QEglFSScreen *createScreen() const; + private: void createInputHandlers(); diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp index 3f92d60aa29..758b461b3f0 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp @@ -126,26 +126,34 @@ void QEglFSScreen::setPrimarySurface(EGLSurface surface) void QEglFSScreen::addWindow(QEglFSWindow *window) { - if (!m_windows.contains(window)) + if (!m_windows.contains(window)) { m_windows.append(window); + topWindowChanged(window); + } } void QEglFSScreen::removeWindow(QEglFSWindow *window) { m_windows.removeOne(window); + if (!m_windows.isEmpty()) + topWindowChanged(m_windows.last()); } void QEglFSScreen::moveToTop(QEglFSWindow *window) { m_windows.removeOne(window); m_windows.append(window); + topWindowChanged(window); } void QEglFSScreen::changeWindowIndex(QEglFSWindow *window, int newIdx) { int idx = m_windows.indexOf(window); - if (idx != -1 && idx != newIdx) + if (idx != -1 && idx != newIdx) { m_windows.move(idx, newIdx); + if (newIdx == m_windows.size() - 1) + topWindowChanged(m_windows.last()); + } } QEglFSWindow *QEglFSScreen::rootWindow() @@ -157,4 +165,9 @@ QEglFSWindow *QEglFSScreen::rootWindow() return 0; } +void QEglFSScreen::topWindowChanged(QPlatformWindow *window) +{ + Q_UNUSED(window); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.h b/src/plugins/platforms/eglfs/qeglfsscreen.h index 578a6cf20d7..11d66b7e0f1 100644 --- a/src/plugins/platforms/eglfs/qeglfsscreen.h +++ b/src/plugins/platforms/eglfs/qeglfsscreen.h @@ -85,6 +85,7 @@ public: protected: void setPrimarySurface(EGLSurface surface); + virtual void topWindowChanged(QPlatformWindow *window); private: friend class QEglFSWindow; diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index abba2b455a0..039a8342141 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -7012,6 +7012,8 @@ void QWidget::show() bool isPopup = data->window_flags & Qt::Popup & ~Qt::Window; if (isWindow() && !isPopup && qApp->styleHints()->showIsFullScreen()) showFullScreen(); + else if (isWindow() && !isPopup && QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::ShowIsMaximized).toBool()) + showMaximized(); else setVisible(true); } From dd5f1ab4541a50e963555a082534fc4275680a33 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 1 Nov 2013 16:05:39 +0100 Subject: [PATCH 154/494] Fix compilation of the manual dialogs test with Qt 4. This is useful for comparisons and bug fixes. Change-Id: Ib5c5bcb7df4b15779be0b613782206f052c94430 Reviewed-by: J-P Nurmi --- tests/manual/dialogs/filedialogpanel.cpp | 10 ++++++++++ tests/manual/dialogs/fontdialogpanel.cpp | 2 ++ tests/manual/dialogs/messageboxpanel.cpp | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/tests/manual/dialogs/filedialogpanel.cpp b/tests/manual/dialogs/filedialogpanel.cpp index e234835cdb7..682e944556c 100644 --- a/tests/manual/dialogs/filedialogpanel.cpp +++ b/tests/manual/dialogs/filedialogpanel.cpp @@ -355,6 +355,7 @@ void FileDialogPanel::getOpenFileNames() void FileDialogPanel::getOpenFileUrls() { +#if QT_VERSION >= 0x050000 QString selectedFilter = m_selectedNameFilter->text().trimmed(); const QList files = QFileDialog::getOpenFileUrls(this, tr("getOpenFileNames Qt %1").arg(QLatin1String(QT_VERSION_STR)), @@ -367,6 +368,7 @@ void FileDialogPanel::getOpenFileUrls() << "\nName filter: " << selectedFilter; QMessageBox::information(this, tr("getOpenFileNames"), result, QMessageBox::Ok); } +#endif // Qt 5 } void FileDialogPanel::getOpenFileName() @@ -386,6 +388,7 @@ void FileDialogPanel::getOpenFileName() void FileDialogPanel::getOpenFileUrl() { +#if QT_VERSION >= 0x050000 QString selectedFilter = m_selectedNameFilter->text().trimmed(); const QUrl file = QFileDialog::getOpenFileUrl(this, tr("getOpenFileUrl Qt %1").arg(QLatin1String(QT_VERSION_STR)), @@ -398,6 +401,7 @@ void FileDialogPanel::getOpenFileUrl() << "\nName filter: " << selectedFilter; QMessageBox::information(this, tr("getOpenFileName"), result, QMessageBox::Ok); } +#endif // Qt 5 } void FileDialogPanel::getSaveFileName() @@ -417,6 +421,7 @@ void FileDialogPanel::getSaveFileName() void FileDialogPanel::getSaveFileUrl() { +#if QT_VERSION >= 0x050000 QString selectedFilter = m_selectedNameFilter->text().trimmed(); const QUrl file = QFileDialog::getSaveFileUrl(this, tr("getSaveFileName Qt %1").arg(QLatin1String(QT_VERSION_STR)), @@ -429,6 +434,7 @@ void FileDialogPanel::getSaveFileUrl() << "\nName filter: " << selectedFilter; QMessageBox::information(this, tr("getSaveFileNames"), result, QMessageBox::Ok); } +#endif // Qt 5 } void FileDialogPanel::getExistingDirectory() @@ -442,12 +448,14 @@ void FileDialogPanel::getExistingDirectory() void FileDialogPanel::getExistingDirectoryUrl() { +#if QT_VERSION >= 0x050000 const QUrl dir = QFileDialog::getExistingDirectoryUrl(this, tr("getExistingDirectory Qt %1").arg(QLatin1String(QT_VERSION_STR)), QUrl(m_directory->text()), options() | QFileDialog::ShowDirsOnly, allowedSchemes()); if (!dir.isEmpty()) QMessageBox::information(this, tr("getExistingDirectory"), QLatin1String("Directory: ") + dir.toString(), QMessageBox::Ok); +#endif // Qt 5 } void FileDialogPanel::restoreDefaults() @@ -493,9 +501,11 @@ void FileDialogPanel::applySettings(QFileDialog *d) const if (!filter.isEmpty()) d->selectNameFilter(filter); } else { +#if QT_VERSION >= 0x050000 d->setMimeTypeFilters(filters); if (!filter.isEmpty()) d->selectMimeTypeFilter(filter); +#endif // Qt 5 } foreach (LabelLineEdit *l, m_labelLineEdits) l->apply(d); diff --git a/tests/manual/dialogs/fontdialogpanel.cpp b/tests/manual/dialogs/fontdialogpanel.cpp index c72bf77351b..ff45402197d 100644 --- a/tests/manual/dialogs/fontdialogpanel.cpp +++ b/tests/manual/dialogs/fontdialogpanel.cpp @@ -209,10 +209,12 @@ void FontDialogPanel::applySettings(QFontDialog *d) const { d->setOption(QFontDialog::NoButtons, m_noButtons->isChecked()); d->setOption(QFontDialog::DontUseNativeDialog, m_dontUseNativeDialog->isChecked()); +#if QT_VERSION >= 0x050000 d->setOption(QFontDialog::ScalableFonts, m_scalableFilter->isChecked()); d->setOption(QFontDialog::NonScalableFonts, m_nonScalableFilter->isChecked()); d->setOption(QFontDialog::MonospacedFonts, m_monospacedFilter->isChecked()); d->setOption(QFontDialog::ProportionalFonts, m_proportionalFilter->isChecked()); +#endif // Qt 5 QFont font = m_fontFamilyBox->currentFont(); font.setPointSizeF(m_fontSizeBox->value()); diff --git a/tests/manual/dialogs/messageboxpanel.cpp b/tests/manual/dialogs/messageboxpanel.cpp index 529a8251e11..ced582981e8 100644 --- a/tests/manual/dialogs/messageboxpanel.cpp +++ b/tests/manual/dialogs/messageboxpanel.cpp @@ -149,9 +149,11 @@ void MessageBoxPanel::setupMessageBox(QMessageBox &box) if (box.standardButtons() == (QMessageBox::StandardButtons) 0) box.setStandardButtons(QMessageBox::Ok); // just to have something. +#if QT_VERSION >= 0x050000 box.setCheckBox(0); if (m_checkboxText->text().length() > 0) box.setCheckBox(new QCheckBox(m_checkboxText->text())); +#endif // Qt 5 box.setIcon((QMessageBox::Icon) m_iconComboBox->currentIndex()); } @@ -176,12 +178,14 @@ void MessageBoxPanel::doExec() QString sres; sres.setNum(res, 16); m_resultLabel->setText(QString::fromLatin1("Return value (hex): %1").arg(sres)); +#if QT_VERSION >= 0x050000 if (m_msgbox->checkBox()) { if (m_msgbox->checkBox()->isChecked()) m_checkBoxResult->setText(QString::fromLatin1("Checkbox was checked")); else m_checkBoxResult->setText(QString::fromLatin1("Checkbox was not checked")); } +#endif // Qt 5 } void MessageBoxPanel::doShowApply() From 7be6438badf00f24b414c2d27d564e636e2b5eb5 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 21 Oct 2013 11:14:31 +0200 Subject: [PATCH 155/494] xcode generator: warn if QMAKE_INFO_PLIST is not valid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Warn the user if QMAKE_INFO_PLIST is set, but file not found. An iOS application will not run or deploy without an Info.plist present, and the error message given by xcodebuild is not very informative. Change-Id: I54f0e06de320a43c9f3261fe88761c41e3ccd022 Reviewed-by: Oswald Buddenhagen Reviewed-by: Tor Arne Vestbø --- qmake/generators/mac/pbuilder_pbx.cpp | 2 ++ qmake/generators/unix/unixmake2.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 307b3d27bab..68338a66842 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1422,6 +1422,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) t << "\t\t\t\t" << writeSettings("INFOPLIST_FILE", "Info.plist") << ";\n"; } } + } else { + warn_msg(WarnLogic, "Could not resolve Info.plist: '%s'. Check if QMAKE_INFO_PLIST points to a valid file.", plist.toLatin1().constData()); } } diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 2373059f796..3f879202aea 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1266,6 +1266,8 @@ void UnixMakefileGenerator::init2() alldeps += path + Option::dir_sep + fileInfo(files[file].toQString()).fileName(); } } + } else { + warn_msg(WarnLogic, "Could not resolve Info.plist: '%s'. Check if QMAKE_INFO_PLIST points to a valid file.", plist.toLatin1().constData()); } } } From 3b48a65e99839c9427923c03b4e2a87a8465d165 Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 14 Oct 2013 16:57:32 +0200 Subject: [PATCH 156/494] QBasicAtomicInt: fix wrong comment about non-atomic API The public documentation for load() and store() says it's atomic, and it is: * using _q_value.store(newValue, std::memory_order_relaxed) in the C++11 implementation * using a simple assignment otherwise, which is atomic (and relaxed, no memory barriers) on all the existing C++ ABIs. Change-Id: I40faa47120163225bd11c3a32514ac97ef8bbbd4 Reviewed-by: Thiago Macieira --- src/corelib/thread/qbasicatomic.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index ddcc25f7b71..782ae90698f 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -137,12 +137,11 @@ public: typename Ops::Type _q_value; - // Non-atomic API + // Everything below is either implemented in ../arch/qatomic_XXX.h or (as fallback) in qgenericatomic.h + T load() const Q_DECL_NOTHROW { return Ops::load(_q_value); } void store(T newValue) Q_DECL_NOTHROW { Ops::store(_q_value, newValue); } - // Atomic API, implemented in qatomic_XXX.h - T loadAcquire() const Q_DECL_NOTHROW { return Ops::loadAcquire(_q_value); } void storeRelease(T newValue) Q_DECL_NOTHROW { Ops::storeRelease(_q_value, newValue); } From 1f6dfa774959830a915f3e2a7b0561ca29b8c485 Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Mon, 28 Oct 2013 09:25:11 +0100 Subject: [PATCH 157/494] Add QSQLITE_OPEN_URI database connection flag This flag enables the URI mode for database names in the SQLite backend. Without this flag, it's not possible to use URIs like 'file:somedb?mode=memory&cache=shared' to create shared, in-memory databases. Change-Id: I2938184dad1f27c7af454385ca305bd4f6ed1a5e Reviewed-by: Mark Brand --- dist/changes-5.2.0 | 1 + src/sql/drivers/sqlite/qsql_sqlite.cpp | 2 ++ src/sql/kernel/qsqldatabase.cpp | 1 + 3 files changed, 4 insertions(+) diff --git a/dist/changes-5.2.0 b/dist/changes-5.2.0 index c0db0f28f91..2536076f12f 100644 --- a/dist/changes-5.2.0 +++ b/dist/changes-5.2.0 @@ -148,6 +148,7 @@ Changes in Qt 5.1.0 (missing from released changelog dist/changes-5.1.0) Changes in Qt 5.2.0 - [QTBUG-29261] IBASE: Construct a valid QTime when creating timestamps for iBase SQL driver. - [QTBUG-33389] PSQL: Format QDateTime following ISO8601. +- Add QSQLITE_OPEN_URI option to QSQLITE driver **************************************************************************** * Platform Specific Changes * diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp index ffeb7921b36..0a8b71aa8a8 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.cpp +++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp @@ -596,6 +596,8 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c } if (option == QLatin1String("QSQLITE_OPEN_READONLY")) openMode = SQLITE_OPEN_READONLY; + if (option == QLatin1String("QSQLITE_OPEN_URI")) + openMode |= SQLITE_OPEN_URI; if (option == QLatin1String("QSQLITE_ENABLE_SHARED_CACHE")) sharedCache = true; } diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp index b87a1fe1c50..f8ecabee8fb 100644 --- a/src/sql/kernel/qsqldatabase.cpp +++ b/src/sql/kernel/qsqldatabase.cpp @@ -1264,6 +1264,7 @@ QSqlRecord QSqlDatabase::record(const QString& tablename) const \list \li QSQLITE_BUSY_TIMEOUT \li QSQLITE_OPEN_READONLY + \li QSQLITE_OPEN_URI \li QSQLITE_ENABLE_SHARED_CACHE \endlist From 9927c1a2bbb372d0e557c58062e4ecda7a644aa1 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 3 Nov 2013 21:20:35 +0100 Subject: [PATCH 158/494] QPrintDialog - Fix Windows Current Page option selection In the Windows print dialog default the print range radio button selection to the QPrinter set value, but only if the option is enabled in the dialog. Task-number: QTBUG-32965 Change-Id: Ic64d86d263a2f8e31c8b32608b569499d0f24d63 Reviewed-by: Friedemann Kleint --- src/printsupport/dialogs/qprintdialog_win.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/printsupport/dialogs/qprintdialog_win.cpp b/src/printsupport/dialogs/qprintdialog_win.cpp index e886abbcf32..96a201ae458 100644 --- a/src/printsupport/dialogs/qprintdialog_win.cpp +++ b/src/printsupport/dialogs/qprintdialog_win.cpp @@ -109,10 +109,12 @@ static void qt_win_setup_PRINTDLGEX(PRINTDLGEX *pd, QWidget *parent, if(!pdlg->isOptionEnabled(QPrintDialog::PrintToFile)) pd->Flags |= PD_DISABLEPRINTTOFILE; - if (pdlg->printRange() == QPrintDialog::Selection) + if (pdlg->isOptionEnabled(QPrintDialog::PrintSelection) && pdlg->printRange() == QPrintDialog::Selection) pd->Flags |= PD_SELECTION; - else if (pdlg->printRange() == QPrintDialog::PageRange) + else if (pdlg->isOptionEnabled(QPrintDialog::PrintPageRange) && pdlg->printRange() == QPrintDialog::PageRange) pd->Flags |= PD_PAGENUMS; + else if (pdlg->isOptionEnabled(QPrintDialog::PrintCurrentPage) && pdlg->printRange() == QPrintDialog::CurrentPage) + pd->Flags |= PD_CURRENTPAGE; else pd->Flags |= PD_ALLPAGES; From 7b2ae0db664a5f3fe9982a409e7e493245dde8ba Mon Sep 17 00:00:00 2001 From: Andreas Holzammer Date: Wed, 30 Oct 2013 12:52:40 +0100 Subject: [PATCH 159/494] Better check for host builds for fails on QT_POINTER_SIZE Change-Id: I9949565617cb62e34dd4db93acc4162b24c99ff9 Reviewed-by: Simon Hausmann Reviewed-by: Oswald Buddenhagen --- src/corelib/global/qglobal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 5bb675728a8..ea6639be1b0 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -197,7 +197,7 @@ typedef quint64 qulonglong; # define QT_POINTER_SIZE 4 # elif defined(Q_OS_ANDROID) # define QT_POINTER_SIZE 4 // ### Add auto-detection to Windows configure -# elif !defined(QT_BUILD_MOC) && !defined(QT_BUILD_QMAKE) && !defined(QT_BUILD_CONFIGURE) +# elif !defined(QT_BOOTSTRAPPED) # error could not determine QT_POINTER_SIZE # endif #endif From a24ec6b273892c41f1c163fd43b568e3e5ff8279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 31 Oct 2013 14:50:19 +0100 Subject: [PATCH 160/494] Ensure QLocale's shared C-locale QLocalePrivate is never deleted Other static data such as QTextStream might be initialized before the static C-locale, in which case QLocale would adopt c_private and bump the ref-count to 2, only to see it reset back to 1 when the c_locale's static initialization happened. The result was that at application shutdown the ref-count would fall down to 0, and we tried deleting the static data. This issue was observed with clang in a debug build, where the c_private is initialized at runtime. Change-Id: If05221a5e87886e1805ad3c1b1520483f425c0fb Reviewed-by: Simon Hausmann Reviewed-by: Olivier Goffart --- src/corelib/tools/qlocale.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index fb233c0640a..0eb202c5e29 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -531,7 +531,11 @@ static const QLocaleData *default_data = 0; static uint default_number_options = 0; static const QLocaleData *const c_data = locale_data; -static QLocalePrivate c_private = { c_data, Q_BASIC_ATOMIC_INITIALIZER(1), 0 }; +static QLocalePrivate *c_private() +{ + static QLocalePrivate c_locale = { c_data, Q_BASIC_ATOMIC_INITIALIZER(1), 0 }; + return &c_locale; +} #ifndef QT_NO_SYSTEMLOCALE @@ -700,7 +704,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QSharedDataPointer, defaultLocalePriva static QLocalePrivate *localePrivateByName(const QString &name) { if (name == QLatin1String("C")) - return &c_private; + return c_private(); return QLocalePrivate::create(findLocaleData(name)); } @@ -708,7 +712,7 @@ static QLocalePrivate *findLocalePrivate(QLocale::Language language, QLocale::Sc QLocale::Country country) { if (language == QLocale::C) - return &c_private; + return c_private(); const QLocaleData *data = QLocaleData::findLocaleData(language, script, country); From 2ae4e180ac865e5008e8c60facff74602f1b69de Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Fri, 1 Nov 2013 15:21:45 +0100 Subject: [PATCH 161/494] qt.prf: add correct library version when using qmlimportscanner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We need to add the correct suffix to the libs we add when running qmlimportscanner. Otherwise we will always add release versions of the libs instead of debug versions when generating debug builds. This in turn will confuse the xcode generator that will try to convert the libs in LIBS to native Xcode build variables. Change-Id: I4d9fab49ad9e644e9bfd06caf79fc084bde2a3b7 Reviewed-by: Tor Arne Vestbø --- mkspecs/features/qt.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index 279540c384c..31d8b0e3ec8 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -96,7 +96,7 @@ if(contains(QT, qml)|contains(QT_PRIVATE, qml)): \ for (key, IMPORTS._KEYS_): { PATH = $$eval(IMPORTS.$${key}.path) PLUGIN = $$eval(IMPORTS.$${key}.plugin) - !isEmpty(PATH):!isEmpty(PLUGIN): LIBS *= -L$$PATH -l$$PLUGIN + !isEmpty(PATH):!isEmpty(PLUGIN): LIBS *= -L$$PATH -l$${PLUGIN}$$qtPlatformTargetSuffix() } # create qml_plugin_import.cpp From 00b5dec9e65b3c6fce5559f7181592ff9753ba38 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 1 Nov 2013 14:15:50 +0100 Subject: [PATCH 162/494] qdoc: warn if index file for dependency is not found Output a warning for each doc dependency that qdoc cannot locate an index file for. The index files are loaded for both prepare and generate phases. To avoid duplication, output warnings only when in generate phase. Change-Id: I74f9ba78e4b57cb1a62e0d1c2efda01ecc85c06d Reviewed-by: Martin Smith Reviewed-by: Jerome Pasion --- src/tools/qdoc/main.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/tools/qdoc/main.cpp b/src/tools/qdoc/main.cpp index 45737241377..ffaef904b7b 100644 --- a/src/tools/qdoc/main.cpp +++ b/src/tools/qdoc/main.cpp @@ -218,8 +218,15 @@ static void loadIndexFiles(Config& config) else if (foundIndices.size() == 1) { indexToAdd = foundIndices[0].absoluteFilePath(); } - if (!indexToAdd.isEmpty() && !indexFiles.contains(indexToAdd)) - indexFiles << indexToAdd; + if (!indexToAdd.isEmpty()) { + if (!indexFiles.contains(indexToAdd)) + indexFiles << indexToAdd; + } + else if (Generator::runGenerateOnly()) { + qDebug() << "warning:" << config.getString(CONFIG_PROJECT) + << "Cannot locate index file for dependency" + << dependModules[i]; + } } } else { From c2b8ebe9dbb2b3fa8f5e157b4d98e0a8d8208332 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 4 Nov 2013 15:06:17 +0100 Subject: [PATCH 163/494] tests: make qt_on_cocoa build again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QPA was public since 36547f4eff44361f7a6acd0cff107c0e47561f93. Change-Id: I838cc0736dc75e5301dd41f3ea89848f300443d4 Reviewed-by: Morten Johan Sørvig --- tests/manual/cocoa/qt_on_cocoa/main.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/manual/cocoa/qt_on_cocoa/main.mm b/tests/manual/cocoa/qt_on_cocoa/main.mm index c9338f25f4d..9a39788b028 100644 --- a/tests/manual/cocoa/qt_on_cocoa/main.mm +++ b/tests/manual/cocoa/qt_on_cocoa/main.mm @@ -44,7 +44,7 @@ #include #include -#include +#include #include From c8df30682cecc36153b536f52cdfe4d7d789959c Mon Sep 17 00:00:00 2001 From: Jan Arne Petersen Date: Wed, 30 Oct 2013 11:03:08 +0100 Subject: [PATCH 164/494] Handle keyboard focus change Call QWindowSystemInterface::handleWindowActivated when a SCREEN_EVENT_PROPERTY event for he SCREEN_PROPERTY_KEYBOARD_FOCUS property is received. Change-Id: Ic2b10c5b793dd4451adac68691296f8265a71160 Reviewed-by: Andreas Holzammer Reviewed-by: Frank Osterfeld Reviewed-by: Kevin Krammer Reviewed-by: Thomas McGuire --- .../platforms/qnx/qqnxscreeneventhandler.cpp | 46 +++++++++++++++++++ .../platforms/qnx/qqnxscreeneventhandler.h | 2 + 2 files changed, 48 insertions(+) diff --git a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp index c869d29c99f..129f149ca13 100644 --- a/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp +++ b/src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp @@ -125,6 +125,10 @@ bool QQnxScreenEventHandler::handleEvent(screen_event_t event, int qnxType) handleDisplayEvent(event); break; + case SCREEN_EVENT_PROPERTY: + handlePropertyEvent(event); + break; + default: // event ignored qScreenEventDebug() << Q_FUNC_INFO << "unknown event" << qnxType; @@ -496,6 +500,48 @@ void QQnxScreenEventHandler::handleDisplayEvent(screen_event_t event) } } +void QQnxScreenEventHandler::handlePropertyEvent(screen_event_t event) +{ + errno = 0; + int objectType; + if (screen_get_event_property_iv(event, SCREEN_PROPERTY_OBJECT_TYPE, &objectType) != 0) + qFatal("QQNX: failed to query object type property, errno=%d", errno); + + if (objectType != SCREEN_OBJECT_TYPE_WINDOW) + return; + + errno = 0; + screen_window_t window = 0; + if (screen_get_event_property_pv(event, SCREEN_PROPERTY_WINDOW, (void**)&window) != 0) + qFatal("QQnx: failed to query window property, errno=%d", errno); + + errno = 0; + int property; + if (screen_get_event_property_iv(event, SCREEN_PROPERTY_NAME, &property) != 0) + qFatal("QQnx: failed to query window property, errno=%d", errno); + + switch (property) { + case SCREEN_PROPERTY_KEYBOARD_FOCUS: + handleKeyboardFocusPropertyEvent(window); + break; + default: + // event ignored + qScreenEventDebug() << Q_FUNC_INFO << "Ignore property event for property: " << property; + } +} + +void QQnxScreenEventHandler::handleKeyboardFocusPropertyEvent(screen_window_t window) +{ + errno = 0; + int focus = 0; + if (window && screen_get_window_property_iv(window, SCREEN_PROPERTY_KEYBOARD_FOCUS, &focus) != 0) + qFatal("QQnx: failed to query keyboard focus property, errno=%d", errno); + + QWindow *w = focus ? QQnxIntegration::window(window) : 0; + + QWindowSystemInterface::handleWindowActivated(w); +} + #include "moc_qqnxscreeneventhandler.cpp" QT_END_NAMESPACE diff --git a/src/plugins/platforms/qnx/qqnxscreeneventhandler.h b/src/plugins/platforms/qnx/qqnxscreeneventhandler.h index 7a1af6f343b..7ceb32fcec5 100644 --- a/src/plugins/platforms/qnx/qqnxscreeneventhandler.h +++ b/src/plugins/platforms/qnx/qqnxscreeneventhandler.h @@ -72,6 +72,8 @@ private: void handleCloseEvent(screen_event_t event); void handleCreateEvent(screen_event_t event); void handleDisplayEvent(screen_event_t event); + void handlePropertyEvent(screen_event_t event); + void handleKeyboardFocusPropertyEvent(screen_window_t window); private: enum { From 84a318c74f11ffb198c394cb07f67d137b44a5df Mon Sep 17 00:00:00 2001 From: Frank Osterfeld Date: Mon, 28 Oct 2013 13:56:35 +0100 Subject: [PATCH 165/494] enable PPS keyboard implementation also for plain QNX Integrating with /pps/services/input is also the way to go for QNX. Change-Id: If2498f2c42ed4e6e0d1cadc787cc62e80940043a Reviewed-by: Rafael Roquetto Reviewed-by: Kevin Krammer Reviewed-by: Thomas McGuire --- src/plugins/platforms/qnx/qnx.pro | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro index f5a4e0735f6..becf5e287e6 100644 --- a/src/plugins/platforms/qnx/qnx.pro +++ b/src/plugins/platforms/qnx/qnx.pro @@ -2,21 +2,13 @@ TARGET = qqnx QT += platformsupport-private core-private gui-private +# The PPS based platform integration is currently used for both BB10 and plain QNX +CONFIG += qqnx_pps + # Uncomment this to build with support for IMF once it becomes available in the BBNDK #CONFIG += qqnx_imf -# Uncomment this to build with support for PPS based platform integration -#CONFIG += qqnx_pps - -CONFIG(blackberry) { - CONFIG += qqnx_pps - - # Uncomment following line to enable screen event - # handling through a dedicated thread. - # CONFIG += qqnx_screeneventthread -} else { - CONFIG += qqnx_screeneventthread -} +!blackberry:CONFIG += qqnx_screeneventthread # Uncomment these to enable debugging output for various aspects of the plugin #DEFINES += QQNXBPSEVENTFILTER_DEBUG From c982fa3666385e87d968a9f2cad70cd906a3749d Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Thu, 31 Oct 2013 13:34:57 +0100 Subject: [PATCH 166/494] iOS: Prevent calling QWindow methods on native NSViews MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UIViews can return nil when calling qwindow, so we must check before trying to use the QWindow handle. Change-Id: I72e9ddc58ebe10a3e7ea511f2356650402ba23f4 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qioswindow.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/ios/qioswindow.mm b/src/plugins/platforms/ios/qioswindow.mm index 5a2a1122ecb..0bfda495360 100644 --- a/src/plugins/platforms/ios/qioswindow.mm +++ b/src/plugins/platforms/ios/qioswindow.mm @@ -455,7 +455,7 @@ void QIOSWindow::raiseOrLower(bool raise) for (int i = int(subviews.count) - 1; i >= 0; --i) { UIView *view = static_cast([subviews objectAtIndex:i]); - if (view.hidden || view == m_view) + if (view.hidden || view == m_view || !view.qwindow) continue; int level = static_cast(view.qwindow->handle())->m_windowLevel; if (m_windowLevel > level || (raise && m_windowLevel == level)) { From d35c8fe52149f0adb7c81da804a5b98cc54a0abe Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 1 Nov 2013 09:40:27 +0100 Subject: [PATCH 167/494] CMake: Add the qreal typedef type to the Qt5::Core target. This way, a Qt compiled with qreal=float and one linked with qreal=double can not be linked by a single downstream. That is diagnosed at cmake-time. Change-Id: I9183dbcfef181fadea5321d3154948e8258e4a2a Reviewed-by: Oswald Buddenhagen Reviewed-by: Stephen Kelly --- configure | 1 + src/corelib/Qt5CoreConfigExtras.cmake.in | 3 ++- tools/configure/configureapp.cpp | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 4adaa774030..81e2a93c28a 100755 --- a/configure +++ b/configure @@ -6713,6 +6713,7 @@ host_build { QT_CPU_FEATURES.$CFG_ARCH = $CFG_CPUFEATURES } EOF +echo "QT_COORD_TYPE = $CFG_QREAL" >> "$QTMODULE.tmp" if [ -n "$QT_CFLAGS_PSQL" ]; then echo "QT_CFLAGS_PSQL = $QT_CFLAGS_PSQL" >> "$QTMODULE.tmp" diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in index 2d87783107f..1e00c74aa67 100644 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -51,8 +51,9 @@ set(Qt5Core_MOC_EXECUTABLE Qt5::moc) set(Qt5Core_RCC_EXECUTABLE Qt5::rcc) set_property(TARGET Qt5::Core PROPERTY INTERFACE_QT_MAJOR_VERSION 5) +set_property(TARGET Qt5::Core PROPERTY INTERFACE_QT_COORD_TYPE $$QT_COORD_TYPE) set_property(TARGET Qt5::Core APPEND PROPERTY - COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION + COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION QT_COORD_TYPE ) include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5CoreConfigExtrasMkspecDir.cmake\") diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 35231aecd25..c67b2452287 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2850,6 +2850,7 @@ void Configure::generateCachefile() moduleStream << " QT_CPU_FEATURES." << dictionary["QT_ARCH"] << " = " << dictionary["QT_CPU_FEATURES"] << endl; moduleStream << "}" << endl; + moduleStream << "QT_COORD_TYPE += " << dictionary["QREAL"] << endl; if (dictionary["QT_EDITION"] != "QT_EDITION_OPENSOURCE") moduleStream << "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" << endl; From 8a1bebb297dc672f8b12039b4b998c3587bc4eb1 Mon Sep 17 00:00:00 2001 From: John Layt Date: Sun, 3 Nov 2013 18:15:31 +0100 Subject: [PATCH 168/494] QPdfEngine - Remove Producer copyright notice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the copyright notice from the PDF Producer field which could be misunderstood. Comparison to other PDF Producers shows no other company does this. Task-number: QTBUG-33853 Change-Id: Ie657a356dc7c4b15f04d961978e0c8514c092a31 Reviewed-by: Olivier Goffart Reviewed-by: Jake Petroules Reviewed-by: Thorbjørn Lund Martsum Reviewed-by: Lars Knoll Reviewed-by: Gunnar Sletta --- src/gui/painting/qpdf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index 9105e8b3969..c05f47c59d6 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -1651,7 +1651,7 @@ void QPdfEnginePrivate::writeInfo() xprintf("\n/Creator "); printString(creator); xprintf("\n/Producer "); - printString(QString::fromLatin1("Qt " QT_VERSION_STR " (C) 2012 Digia Plc and/or its subsidiary(-ies)")); + printString(QString::fromLatin1("Qt " QT_VERSION_STR)); QDateTime now = QDateTime::currentDateTime().toUTC(); QTime t = now.time(); QDate d = now.date(); From 2e8ad02b7d10c100dcd9d559b019c474fa4b8a29 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 1 Nov 2013 12:46:42 +0100 Subject: [PATCH 169/494] Add print dialog manual test. Allowing for creating a printer in various modes and toying with the paper settings. Task-number: QTBUG-34276 Change-Id: Ieb35dc55c509f84d7d81817c7903e02a41ba8b44 Reviewed-by: John Layt --- tests/manual/dialogs/dialogs.pro | 6 +- tests/manual/dialogs/filedialogpanel.cpp | 39 +- tests/manual/dialogs/main.cpp | 4 + tests/manual/dialogs/printdialogpanel.cpp | 417 ++++++++++++++++++++++ tests/manual/dialogs/printdialogpanel.h | 95 +++++ tests/manual/dialogs/utils.cpp | 85 +++++ tests/manual/dialogs/utils.h | 88 +++++ 7 files changed, 699 insertions(+), 35 deletions(-) create mode 100644 tests/manual/dialogs/printdialogpanel.cpp create mode 100644 tests/manual/dialogs/printdialogpanel.h create mode 100644 tests/manual/dialogs/utils.cpp create mode 100644 tests/manual/dialogs/utils.h diff --git a/tests/manual/dialogs/dialogs.pro b/tests/manual/dialogs/dialogs.pro index d19c3026d0d..71c41119fea 100644 --- a/tests/manual/dialogs/dialogs.pro +++ b/tests/manual/dialogs/dialogs.pro @@ -1,10 +1,10 @@ QT += core gui -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport TARGET = dialogs TEMPLATE = app SOURCES += main.cpp filedialogpanel.cpp colordialogpanel.cpp fontdialogpanel.cpp \ - wizardpanel.cpp messageboxpanel.cpp + wizardpanel.cpp messageboxpanel.cpp printdialogpanel.cpp utils.cpp HEADERS += filedialogpanel.h colordialogpanel.h fontdialogpanel.h \ - wizardpanel.h messageboxpanel.h + wizardpanel.h messageboxpanel.h printdialogpanel.h utils.h diff --git a/tests/manual/dialogs/filedialogpanel.cpp b/tests/manual/dialogs/filedialogpanel.cpp index 682e944556c..2ae62418495 100644 --- a/tests/manual/dialogs/filedialogpanel.cpp +++ b/tests/manual/dialogs/filedialogpanel.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "filedialogpanel.h" +#include "utils.h" #include #include @@ -48,7 +49,6 @@ #include #include #include -#include #include #include #include @@ -60,25 +60,19 @@ #include #include -struct ComboData -{ - const char *description; - int value; -}; - -const ComboData acceptModeComboData[] = +const FlagData acceptModeComboData[] = { {"AcceptOpen", QFileDialog::AcceptOpen }, {"AcceptSave", QFileDialog::AcceptSave } }; -const ComboData viewModeComboData[] = +const FlagData viewModeComboData[] = { {"Detail", QFileDialog::Detail}, {"List", QFileDialog::List} }; -const ComboData fileModeComboData[] = +const FlagData fileModeComboData[] = { {"AnyFile", QFileDialog::AnyFile}, {"ExistingFile", QFileDialog::ExistingFile}, @@ -87,25 +81,6 @@ const ComboData fileModeComboData[] = {"DirectoryOnly", QFileDialog::DirectoryOnly} }; -static QComboBox *createCombo(QWidget *parent, const ComboData *d, size_t size) -{ - QComboBox *c = new QComboBox(parent); - for (size_t i = 0; i < size; ++i) - c->addItem(QLatin1String(d[i].description), QVariant(d[i].value)); - return c; -} - -template -Enum comboBoxValue(const QComboBox *c) -{ - return static_cast(c->itemData(c->currentIndex()).toInt()); -} - -inline void setComboBoxValue(QComboBox *c, int v) -{ - c->setCurrentIndex(c->findData(QVariant(v))); -} - static inline QPushButton *addButton(const QString &description, QGridLayout *layout, int &row, int column, QObject *receiver, const char *slotFunc) { @@ -155,9 +130,9 @@ FileDialogPanel::FileDialogPanel(QWidget *parent) , m_resolveSymLinks(new QCheckBox(tr("Resolve symlinks"))) , m_native(new QCheckBox(tr("Use native dialog"))) , m_customDirIcons(new QCheckBox(tr("Don't use custom directory icons"))) - , m_acceptMode(createCombo(this, acceptModeComboData, sizeof(acceptModeComboData)/sizeof(ComboData))) - , m_fileMode(createCombo(this, fileModeComboData, sizeof(fileModeComboData)/sizeof(ComboData))) - , m_viewMode(createCombo(this, viewModeComboData, sizeof(viewModeComboData)/sizeof(ComboData))) + , m_acceptMode(createCombo(this, acceptModeComboData, sizeof(acceptModeComboData)/sizeof(FlagData))) + , m_fileMode(createCombo(this, fileModeComboData, sizeof(fileModeComboData)/sizeof(FlagData))) + , m_viewMode(createCombo(this, viewModeComboData, sizeof(viewModeComboData)/sizeof(FlagData))) , m_allowedSchemes(new QLineEdit(this)) , m_defaultSuffix(new QLineEdit(this)) , m_directory(new QLineEdit(this)) diff --git a/tests/manual/dialogs/main.cpp b/tests/manual/dialogs/main.cpp index c5f14cabef7..6082727c3b6 100644 --- a/tests/manual/dialogs/main.cpp +++ b/tests/manual/dialogs/main.cpp @@ -42,6 +42,7 @@ #include "filedialogpanel.h" #include "colordialogpanel.h" #include "fontdialogpanel.h" +#include "printdialogpanel.h" #include "wizardpanel.h" #include "messageboxpanel.h" @@ -75,6 +76,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) tabWidget->addTab(new FontDialogPanel, tr("QFontDialog")); tabWidget->addTab(new WizardPanel, tr("QWizard")); tabWidget->addTab(new MessageBoxPanel, tr("QMessageBox")); +#ifndef QT_NO_PRINTER + tabWidget->addTab(new PrintDialogPanel, tr("QPrintDialog")); +#endif setCentralWidget(tabWidget); } diff --git a/tests/manual/dialogs/printdialogpanel.cpp b/tests/manual/dialogs/printdialogpanel.cpp new file mode 100644 index 00000000000..02beaa4baee --- /dev/null +++ b/tests/manual/dialogs/printdialogpanel.cpp @@ -0,0 +1,417 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT_NO_PRINTER + +#include "printdialogpanel.h" +#include "utils.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +const FlagData modeComboData[] = +{ + {"ScreenResolution", QPrinter::ScreenResolution}, + {"PrinterResolution", QPrinter::PrinterResolution}, + {"HighResolution", QPrinter::HighResolution} +}; + +const FlagData orientationComboData[] = +{ + {"Portrait", QPrinter::Portrait}, + {"Landscape", QPrinter::Landscape}, +}; + +const FlagData pageSizeComboData[] = +{ + {"A4", QPrinter::A4}, + {"B5", QPrinter::B5}, + {"Letter", QPrinter::Letter}, + {"Legal", QPrinter::Legal}, + {"Executive", QPrinter::Executive}, + {"A0", QPrinter::A0}, + {"A1", QPrinter::A1}, + {"A2", QPrinter::A2}, + {"A3", QPrinter::A3}, + {"A5", QPrinter::A5}, + {"A6", QPrinter::A6}, + {"A7", QPrinter::A7}, + {"A8", QPrinter::A8}, + {"A9", QPrinter::A9}, + {"B0", QPrinter::B0}, + {"B1", QPrinter::B1}, + {"B10", QPrinter::B10}, + {"B2", QPrinter::B2}, + {"B3", QPrinter::B3}, + {"B4", QPrinter::B4}, + {"B6", QPrinter::B6}, + {"B7", QPrinter::B7}, + {"B8", QPrinter::B8}, + {"B9", QPrinter::B9}, + {"C5E", QPrinter::C5E}, + {"Comm10E", QPrinter::Comm10E}, + {"DLE", QPrinter::DLE}, + {"Folio", QPrinter::Folio}, + {"Ledger", QPrinter::Ledger}, + {"Tabloid", QPrinter::Tabloid}, + {"Custom", QPrinter::Custom} +}; + +const FlagData printDialogOptions[] = +{ + {"PrintToFile", QPrintDialog::PrintToFile}, + {"PrintSelection", QPrintDialog::PrintSelection}, + {"PrintPageRange", QPrintDialog::PrintPageRange}, + {"PrintShowPageSize", QPrintDialog::PrintShowPageSize}, + {"PrintCollateCopies", QPrintDialog::PrintCollateCopies}, + {"PrintCurrentPage", QPrintDialog::PrintCurrentPage} +}; + +const FlagData printRangeOptions[] = +{ + {"AllPages", QPrintDialog::AllPages}, + {"Selection", QPrintDialog::Selection}, + {"PageRange", QPrintDialog::PageRange}, + {"CurrentPage", QPrintDialog::CurrentPage} +}; + +QTextStream &operator<<(QTextStream &s, const QSizeF &size) +{ + s << size.width() << 'x' << size.height(); + return s; +} + +QTextStream &operator<<(QTextStream &s, const QRectF &rect) +{ + s << rect.width() << 'x' << rect.height() << forcesign << rect.x() << rect.y() << noforcesign; + return s; +} + +QTextStream &operator<<(QTextStream &s, const QPrinter &printer) +{ + s << '"' << printer.printerName() << "\"\nPaper #" <= 0x050000 + << " \"" << printer.paperName() << '"' +#endif + << (printer.orientation() == QPrinter::Portrait ? ", Portrait" : ", Landscape"); + if (printer.fullPage()) + s << ", full page"; + s << "\nPaper size: " + << printer.paperSize(QPrinter::Point) << "pt " + << printer.paperSize(QPrinter::Millimeter) << "mm " + << "\n " << printer.paperSize(QPrinter::DevicePixel) << "device pt " + << printer.paperSize(QPrinter::Inch) << "inch " +#if QT_VERSION >= 0x050000 + << "\nPagedPaintDevSize: " << printer.pageSizeMM() << "mm" +#endif + << "\nLogical resolution : " << printer.logicalDpiX() << ',' << printer.logicalDpiY() << "DPI" + << "\nPhysical resolution: " << printer.physicalDpiX() << ',' << printer.physicalDpiY() << "DPI" + << "\nPaperRect: " << printer.paperRect(QPrinter::Point) << "pt " + << printer.paperRect(QPrinter::Millimeter) << "mm " + << "\n " << printer.paperRect(QPrinter::DevicePixel) << "device pt" + << "\nPageRect: " << printer.pageRect(QPrinter::Point) << "pt " + << printer.pageRect(QPrinter::Millimeter) << "mm " + << "\n " << printer.pageRect(QPrinter::DevicePixel) << "device pt"; + return s; +} + +// Print a page with a rectangular frame, vertical / horizontal rulers in cm and printer info. + +static void drawHorizCmRuler(QPainter &painter, int x1, int x2, int y) +{ + painter.drawLine(x1, y, x2, y); + const int dpI = painter.device()->logicalDpiX(); + const int dpCm = qRound(double(dpI) / 2.54); + const int h = dpCm / 2; + const QFontMetrics fm(painter.font()); + for (int cm = 0, x = x1; x < x2; x += dpCm, ++cm) { + painter.drawLine(x, y, x, y - h); + if (cm) { + const QString n = QString::number(cm); + const QRect br = fm.boundingRect(n); + painter.drawText(x - br.width() / 2, y - h - 10, n); + } + } +} + +static void drawVertCmRuler(QPainter &painter, int x, int y1, int y2) +{ + painter.drawLine(x, y1, x, y2); + const int dpI = painter.device()->logicalDpiY(); + const int dpCm = qRound(double(dpI) / 2.54); + const int h = dpCm / 2; + const QFontMetrics fm(painter.font()); + for (int cm = 0, y = y1; y < y2; y += dpCm, ++cm) { + painter.drawLine(x, y, x + h, y); + if (cm) { + const QString n = QString::number(cm); + const QRect br = fm.boundingRect(n); + painter.drawText(x + h + 10, y + br.height() / 2, n); + } + } +} + +static void print(QPrinter *printer) +{ + QPainter painter(printer); + const QRectF pageF = printer->pageRect(); + + painter.drawRect(pageF); + + drawHorizCmRuler(painter, pageF.x(), pageF.right(), pageF.height() /2); + drawVertCmRuler(painter, pageF.x() + pageF.width() / 2, pageF.top(), pageF.bottom()); + + QFont font = painter.font(); + font.setFamily("Courier"); + font.setPointSize(10); + painter.setFont(font); + + // Format message. + const int charHeight = QFontMetrics(font).boundingRect('X').height(); + QString msg; + QTextStream str(&msg); + str << "Qt "<< QT_VERSION_STR; +#if QT_VERSION >= 0x050000 + str << ' ' << QGuiApplication::platformName(); +#endif + str << ' ' << QDateTime::currentDateTime().toString() + << "\nFont: " << font.family() << ' ' << font.pointSize() << '\n' + << *printer; + + QPointF textPoint = pageF.topLeft() + QPoint(10, charHeight + 10); + foreach (const QString &line, msg.split('\n')) { + painter.drawText(textPoint, line); + textPoint.ry() += (15 * charHeight) / 10; + } + + painter.end(); +} + +class PrintPreviewDialog : public QPrintPreviewDialog { + Q_OBJECT +public: + explicit PrintPreviewDialog(QPrinter *printer, QWidget *parent = 0) : QPrintPreviewDialog(printer, parent) + { + connect(this, SIGNAL(paintRequested(QPrinter*)), this, SLOT(slotPaintRequested(QPrinter*))); + } + +public slots: + void slotPaintRequested(QPrinter *p) { print(p); } +}; + +class PageSizeControl : public QWidget { +public: + explicit PageSizeControl(QWidget *parent = 0); + QSizeF pageSize() const { return QSizeF(m_width->value(), m_height->value()); } + void setPageSize(const QSizeF &s) { m_width->setValue(s.width()); m_height->setValue(s.height()); } + +private: + QDoubleSpinBox *m_width; + QDoubleSpinBox *m_height; +}; + +PageSizeControl::PageSizeControl(QWidget *parent) + : QWidget(parent) + , m_width(new QDoubleSpinBox(this)) + , m_height(new QDoubleSpinBox(this)) +{ + m_width->setRange(1, 1000); + m_width->setSingleStep(10); + m_height->setRange(1, 1000); + m_height->setSingleStep(10); + QHBoxLayout *hBoxLayout = new QHBoxLayout(this); + hBoxLayout->addWidget(m_width); + hBoxLayout->addWidget(new QLabel("x", this)); + hBoxLayout->addWidget(m_height); + hBoxLayout->addWidget(new QLabel("mm", this)); +} + +PrintDialogPanel::PrintDialogPanel(QWidget *parent) + : QWidget(parent) + , m_creationGroupBox(new QGroupBox(tr("Create"), this)) + , m_settingsGroupBox(new QGroupBox(tr("Settings"), this)) + , m_dialogsGroupBox(new QGroupBox(tr("Dialogs"), this)) + , m_pageSizeCombo(new QComboBox) +{ + // Create with resolution + QHBoxLayout *hBoxLayout = new QHBoxLayout(m_creationGroupBox); + m_modeCombo = createCombo(m_creationGroupBox, modeComboData, sizeof(modeComboData)/sizeof(FlagData)); + hBoxLayout->addWidget(m_modeCombo); + m_createButton = new QPushButton(tr("Create"), m_creationGroupBox); + connect(m_createButton, SIGNAL(clicked()), this, SLOT(createPrinter())); + hBoxLayout->addWidget(m_createButton); + m_deleteButton = new QPushButton(tr("Delete"), m_creationGroupBox); + connect(m_deleteButton, SIGNAL(clicked()), this, SLOT(deletePrinter())); + hBoxLayout->addWidget(m_deleteButton); + hBoxLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::Ignored)); + + QFormLayout *formLayout = new QFormLayout(m_settingsGroupBox); + m_pageSizeCombo = createCombo(m_settingsGroupBox, pageSizeComboData, sizeof(pageSizeComboData)/sizeof(FlagData)); + connect(m_pageSizeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(enableCustomSizeControl())); + formLayout->addRow(tr("Paper #:"), m_pageSizeCombo); + m_customPageSizeControl = new PageSizeControl; + formLayout->addRow(tr("Custom size:"), m_customPageSizeControl); + m_orientationCombo = createCombo(m_settingsGroupBox, orientationComboData, sizeof(orientationComboData)/sizeof(FlagData)); + formLayout->addRow("Orientation:", m_orientationCombo); + m_fullPageCheckBox = new QCheckBox(tr("Full page"), m_settingsGroupBox); + formLayout->addRow(m_fullPageCheckBox); + + QVBoxLayout *vBoxLayout = new QVBoxLayout(m_dialogsGroupBox); + + m_printDialogOptionsControl = new OptionsControl(tr("Options"), printDialogOptions, sizeof(printDialogOptions) / sizeof(FlagData), m_dialogsGroupBox); + vBoxLayout->addWidget(m_printDialogOptionsControl); + m_printDialogRangeCombo = createCombo(m_dialogsGroupBox, printRangeOptions, sizeof(printRangeOptions) / sizeof(FlagData)); + vBoxLayout->addWidget(m_printDialogRangeCombo); + + { + QPrintDialog dialog; + m_printDialogOptionsControl->setValue(dialog.options()); + m_printDialogRangeCombo->setCurrentIndex(dialog.printRange()); + } + + QPushButton *button = new QPushButton(tr("Print..."), m_dialogsGroupBox); + connect(button, SIGNAL(clicked()), this, SLOT(showPrintDialog())); + vBoxLayout->addWidget(button); + button = new QPushButton(tr("Preview..."), m_dialogsGroupBox); + connect(button, SIGNAL(clicked()), this, SLOT(showPreviewDialog())); + vBoxLayout->addWidget(button); + + QGridLayout *gridLayout = new QGridLayout(this); + gridLayout->addWidget(m_creationGroupBox, 0, 0); + gridLayout->addWidget(m_settingsGroupBox, 1, 0); + gridLayout->addWidget(m_dialogsGroupBox, 0, 1, 2, 1); + gridLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::MinimumExpanding), 2, 0, 1, 2); + + enablePanels(); +} + +PrintDialogPanel::~PrintDialogPanel() +{ +} + +void PrintDialogPanel::enablePanels() +{ + const bool exists = !m_printer.isNull(); + m_createButton->setEnabled(!exists); + m_modeCombo->setEnabled(!exists); + m_deleteButton->setEnabled(exists); + m_settingsGroupBox->setEnabled(exists); + m_dialogsGroupBox->setEnabled(exists); +} + +void PrintDialogPanel::createPrinter() +{ + const QPrinter::PrinterMode mode = comboBoxValue(m_modeCombo); + m_printer.reset(new QPrinter(mode)); // Can set only once. + retrieveSettings(m_printer.data()); + enablePanels(); + enableCustomSizeControl(); +} + +void PrintDialogPanel::deletePrinter() +{ + m_printer.reset(); + enablePanels(); +} + +void PrintDialogPanel::applySettings(QPrinter *printer) const +{ + const QPrinter::PageSize pageSize = comboBoxValue(m_pageSizeCombo); + if (pageSize == QPrinter::Custom) + printer->setPaperSize(m_customPageSizeControl->pageSize(), QPrinter::Millimeter); + else + printer->setPageSize(pageSize); + printer->setOrientation(comboBoxValue(m_orientationCombo)); + printer->setFullPage(m_fullPageCheckBox->isChecked()); +} + +void PrintDialogPanel::retrieveSettings(const QPrinter *printer) +{ + setComboBoxValue(m_pageSizeCombo, printer->pageSize()); + setComboBoxValue(m_orientationCombo, printer->orientation()); + m_fullPageCheckBox->setChecked(printer->fullPage()); + m_customPageSizeControl->setPageSize(m_printer->paperSize(QPrinter::Millimeter)); +} + +void PrintDialogPanel::enableCustomSizeControl() +{ + m_customPageSizeControl->setEnabled(m_pageSizeCombo->currentIndex() == QPrinter::Custom); +} + +void PrintDialogPanel::showPrintDialog() +{ + applySettings(m_printer.data()); + QPrintDialog dialog(m_printer.data(), this); + dialog.setOptions(m_printDialogOptionsControl->value()); + dialog.setPrintRange(comboBoxValue(m_printDialogRangeCombo)); + if (dialog.exec() == QDialog::Accepted) + retrieveSettings(m_printer.data()); +} + +void PrintDialogPanel::showPreviewDialog() +{ + applySettings(m_printer.data()); + PrintPreviewDialog dialog(m_printer.data(), this); + dialog.resize(QApplication::desktop()->availableGeometry().size() * 4/ 5); + if (dialog.exec() == QDialog::Accepted) + retrieveSettings(m_printer.data()); +} + +#include "printdialogpanel.moc" + +#endif // !QT_NO_PRINTER diff --git a/tests/manual/dialogs/printdialogpanel.h b/tests/manual/dialogs/printdialogpanel.h new file mode 100644 index 00000000000..4999504a3cb --- /dev/null +++ b/tests/manual/dialogs/printdialogpanel.h @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef PRINTDIALOGPANEL_H +#define PRINTDIALOGPANEL_H + +#ifndef QT_NO_PRINTER + +#include + +QT_BEGIN_NAMESPACE +class QPrinter; +class QComboBox; +class QGroupBox; +class QPushButton; +class QCheckBox; +QT_END_NAMESPACE + +class PageSizeControl; +class OptionsControl; + +class PrintDialogPanel : public QWidget +{ + Q_OBJECT +public: + explicit PrintDialogPanel(QWidget *parent = 0); + ~PrintDialogPanel(); + +private slots: + void createPrinter(); + void deletePrinter(); + void showPrintDialog(); + void showPreviewDialog(); + void enableCustomSizeControl(); + +private: + void applySettings(QPrinter *printer) const; + void retrieveSettings(const QPrinter *printer); + void enablePanels(); + + QGroupBox *m_creationGroupBox; + QPushButton *m_createButton; + QPushButton *m_deleteButton; + QGroupBox *m_settingsGroupBox; + QCheckBox *m_fullPageCheckBox; + QGroupBox *m_dialogsGroupBox; + OptionsControl *m_printDialogOptionsControl; + QComboBox *m_printDialogRangeCombo; + QComboBox *m_modeCombo; + QComboBox *m_orientationCombo; + QComboBox *m_pageSizeCombo; + PageSizeControl *m_customPageSizeControl; + QScopedPointer m_printer; +}; + +#endif // !QT_NO_PRINTER +#endif // PRINTDIALOGPANEL_H diff --git a/tests/manual/dialogs/utils.cpp b/tests/manual/dialogs/utils.cpp new file mode 100644 index 00000000000..7e0067c7f36 --- /dev/null +++ b/tests/manual/dialogs/utils.cpp @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "utils.h" + +#include +#include + +QComboBox *createCombo(QWidget *parent, const FlagData *d, size_t size) +{ + QComboBox *c = new QComboBox(parent); + for (size_t i = 0; i < size; ++i) + c->addItem(QLatin1String(d[i].description), QVariant(d[i].value)); + return c; +} + +void setComboBoxValue(QComboBox *c, int v) +{ + c->setCurrentIndex(c->findData(QVariant(v))); +} + +OptionsControl::OptionsControl(const QString &title, const FlagData *data, size_t count, QWidget *parent) + : QGroupBox(title, parent) +{ + QVBoxLayout *layout = new QVBoxLayout(this); + for (size_t i = 0; i < count; ++i) { + QCheckBox *box = new QCheckBox(QString::fromLatin1(data[i].description)); + m_checkBoxes.push_back(CheckBoxFlagPair(box, data[i].value)); + layout->addWidget(box); + } +} + +void OptionsControl::setValue(int flags) +{ + foreach (const CheckBoxFlagPair &cf, m_checkBoxes) + cf.first->setChecked(cf.second & flags); +} + +int OptionsControl::intValue() const +{ + int result = 0; + foreach (const CheckBoxFlagPair &cf, m_checkBoxes) { + if (cf.first->isChecked()) + result |= cf.second; + } + return result; +} diff --git a/tests/manual/dialogs/utils.h b/tests/manual/dialogs/utils.h new file mode 100644 index 00000000000..634795627f7 --- /dev/null +++ b/tests/manual/dialogs/utils.h @@ -0,0 +1,88 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef UTILS_H +#define UTILS_H + +#include +#include +#include +#include +#include + +QT_FORWARD_DECLARE_CLASS(QCheckBox) + +// Associate enum/flag value with a description. +struct FlagData +{ + const char *description; + int value; +}; + +// Helpers for creating combo boxes representing enumeration values from flag data. +QComboBox *createCombo(QWidget *parent, const FlagData *d, size_t size); + +template +Enum comboBoxValue(const QComboBox *c) +{ + return static_cast(c->itemData(c->currentIndex()).toInt()); +} + +void setComboBoxValue(QComboBox *c, int v); + +// A group box with check boxes for option flags. +class OptionsControl : public QGroupBox { +public: + explicit OptionsControl(const QString &title, const FlagData *data, size_t count, QWidget *parent); + + void setValue(int flags); + template + Enum value() const { return static_cast(intValue()); } + +private: + typedef QPair CheckBoxFlagPair; + + int intValue() const; + + QList m_checkBoxes; +}; + +#endif // UTILS_H From a922b94c2fa273dfc3915c840b4b8518163d06f1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 31 Oct 2013 16:41:19 +0100 Subject: [PATCH 170/494] Windows: Do not detect full-screen state for child windows. Introduced by a1db174ea98fab8669da498639895bac4c894baf (Fix window state handling). Task-number: QTBUG-34477 Change-Id: I4c92edddef346f9d7c4741f2f9784e9f686e9cda Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowswindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index d3d381ae285..44fd97e1aa3 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1548,7 +1548,7 @@ static const QScreen *effectiveScreen(const QWindow *w) bool QWindowsWindow::isFullScreen_sys() const { - return geometry_sys() == effectiveScreen(window())->geometry(); + return window()->isTopLevel() && geometry_sys() == effectiveScreen(window())->geometry(); } /*! From 098c24344f208fcd53c4b8a9af62476108fc4b93 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 1 Nov 2013 17:20:18 +0100 Subject: [PATCH 171/494] de-duplicate QT_DISABLED_FEATURES after resolving dependencies Change-Id: I1873c1e7c59af02b06566d0e47c020c609d49c9f Reviewed-by: Stephen Kelly Reviewed-by: Joerg Bornemann --- qtbase.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qtbase.pro b/qtbase.pro index 37a20738fda..8da34c50232 100644 --- a/qtbase.pro +++ b/qtbase.pro @@ -172,7 +172,8 @@ FEATURES_PRI = \ "$${LITERAL_HASH} Features disabled by configure:" \ "QT_DISABLED_FEATURES =$$lower($$join($$list($$replace(no_features, _, -)), " ", " "))" \ "$$escape_expand(\\n)$${LITERAL_HASH} Dependencies derived from /src/corelib/global/qfeatures.txt:" \ - $$FEATURES_PRI + $$FEATURES_PRI \ + "QT_DISABLED_FEATURES = \$\$unique(QT_DISABLED_FEATURES)" write_file($$OUT_PWD/mkspecs/qfeatures.pri, FEATURES_PRI)|error("Aborting.") #mkspecs From 14f261a28c07081fa9d3d2ed8aaa158e4ab1c38d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 31 Oct 2013 16:13:13 +0100 Subject: [PATCH 172/494] kill dead code Change-Id: I713c5504126fab40389ecb3a248b6c10048fc6c4 Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msbuild_objectmodel.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 3f16a7625e9..f5a6e15a7b1 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -1762,9 +1762,6 @@ void VCXProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, XmlOutpu else root = new XTreeNode; - QString name, extfilter; - triState parse; - for (int i = 0; i < project.SingleProjects.count(); ++i) { VCFilter filter; const VCProjectSingleConfig &singleCfg = project.SingleProjects.at(i); @@ -1794,14 +1791,6 @@ void VCXProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, XmlOutpu // Merge all files in this filter to root tree for (int x = 0; x < filter.Files.count(); ++x) root->addElement(filter.Files.at(x)); - - // Save filter setting from first filter. Next filters - // may differ but we cannot handle that. (ex. extfilter) - if (name.isEmpty()) { - name = filter.Name; - extfilter = filter.Filter; - parse = filter.ParseFiles; - } } if (!root->hasElements()) From 033bc07fb435a6c222f8908ddb451e3cdc0ac4b3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 31 Oct 2013 16:12:54 +0100 Subject: [PATCH 173/494] fix signedness warnings Change-Id: I86952c06176dd334a3f029c34b74260ea43434cb Reviewed-by: Joerg Bornemann --- qmake/property.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qmake/property.cpp b/qmake/property.cpp index 38d454cb5df..e50485ce19c 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -81,7 +81,7 @@ static const struct { QMakeProperty::QMakeProperty() : settings(0) { - for (int i = 0; i < sizeof(propList)/sizeof(propList[0]); i++) { + for (unsigned i = 0; i < sizeof(propList)/sizeof(propList[0]); i++) { QString name = QString::fromLatin1(propList[i].name); m_values[ProKey(name + "/src")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectiveSourcePaths); m_values[ProKey(name + "/get")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectivePaths); @@ -155,7 +155,7 @@ QMakeProperty::exec() fprintf(stdout, "%s:%s\n", qPrintable(key), qPrintable(val)); } QStringList specialProps; - for (int i = 0; i < sizeof(propList)/sizeof(propList[0]); i++) + for (unsigned i = 0; i < sizeof(propList)/sizeof(propList[0]); i++) specialProps.append(QString::fromLatin1(propList[i].name)); specialProps.append("QMAKE_VERSION"); #ifdef QT_VERSION_STR From c91f12f9e94a296a94bf9441019d11d49315d12b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 31 Oct 2013 16:13:33 +0100 Subject: [PATCH 174/494] fix initialization order warnings Change-Id: Ia12973f7c4cabff77133ef4b9a840b76e8881759 Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msvc_objectmodel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index fa0426a894a..b74ecc11f4d 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -1199,7 +1199,6 @@ VCLinkerTool::VCLinkerTool() TurnOffAssemblyGeneration(unset), TypeLibraryResourceID(0), GenerateManifest(unset), - GenerateWindowsMetadata(unset), EnableUAC(unset), UACUIAccess(unset), SectionAlignment(-1), @@ -1207,7 +1206,8 @@ VCLinkerTool::VCLinkerTool() AllowIsolation(unset), AssemblyDebug(unset), CLRUnmanagedCodeCheck(unset), - DelaySign(unset) + DelaySign(unset), + GenerateWindowsMetadata(unset) { } @@ -2121,9 +2121,9 @@ VCPreLinkEventTool::VCPreLinkEventTool() // VCConfiguration -------------------------------------------------- VCConfiguration::VCConfiguration() - : ATLMinimizesCRunTimeLibraryUsage(unset), - WinRT(false), + : WinRT(false), WinPhone(false), + ATLMinimizesCRunTimeLibraryUsage(unset), BuildBrowserInformation(unset), CharacterSet(charSetNotSet), ConfigurationType(typeApplication), From 2129a3e2d2dabb289230aa9af1e6fbf4af9f24ca Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 31 Oct 2013 16:14:21 +0100 Subject: [PATCH 175/494] make-gcc-happy variable-may-be-uninitialized (but-is-not) commit Change-Id: If214d3bce7fd23e2c30b6b9bc1bfec2e9fff3958 Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msvc_objectmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index b74ecc11f4d..019bb2504d6 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2861,7 +2861,7 @@ void VCProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, const QSt root = new TreeNode; QString name, extfilter, guid; - triState parse; + triState parse = unset; for (int i = 0; i < project.SingleProjects.count(); ++i) { VCFilter filter; From 9dd2b32e9aede824eed1fa37ef143a6421db04fe Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 31 Oct 2013 16:15:28 +0100 Subject: [PATCH 176/494] shrink #ifdef'd section for better compile-time coverage Change-Id: I594303cca6f22b68f99c0f35e0767032b90c9eae Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msvc_nmake.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 3185e68eccb..37ba3a66ef4 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -113,9 +113,7 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) qPrintable(variables["QMAKESPEC"].first().toQString())); return false; } - } -#ifdef Q_OS_WIN - else if (project->isActiveConfig(QStringLiteral("winrt"))) { + } else if (project->isActiveConfig(QStringLiteral("winrt"))) { QString arch = project->first("VCPROJ_ARCH").toQString().toLower(); QString compiler; QString compilerArch; @@ -126,6 +124,7 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) compiler = QStringLiteral("x86_amd64"); compilerArch = QStringLiteral("amd64"); } +#ifdef Q_OS_WIN #ifdef Q_OS_WIN64 const QString regKey = QStringLiteral("Software\\Wow6432Node\\Microsoft\\VisualStudio\\11.0\\Setup\\VC\\ProductDir"); #else @@ -137,6 +136,9 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) "Is it installed?.\n"); return false; } +#else + const QString vcInstallDir = "/fake/vc_install_dir"; +#endif // Q_OS_WIN QStringList incDirs; QStringList libDirs; @@ -192,7 +194,6 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) t << "\nLIB = " << nmakePathList(libDirs); t << "\nPATH = " << nmakePathList(binDirs) << '\n'; } -#endif // Q_OS_WIN } writeNmakeParts(t); return MakefileGenerator::writeMakefile(t); From 8a5657b9f721bb2301358080353e1d6f3fcf2174 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 31 Oct 2013 16:15:51 +0100 Subject: [PATCH 177/494] fix warnings about unused variables & parameters Change-Id: Ia5816671267ea21dae0d90560b239c4498f9156c Reviewed-by: Joerg Bornemann --- qmake/generators/integrity/gbuild.cpp | 1 + qmake/generators/mac/pbuilder_pbx.cpp | 1 + qmake/option.cpp | 9 ++++----- src/corelib/io/qsettings.cpp | 4 +++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp index 8a3a75b7d9d..e8e992b6947 100644 --- a/qmake/generators/integrity/gbuild.cpp +++ b/qmake/generators/integrity/gbuild.cpp @@ -417,6 +417,7 @@ QString GBuildMakefileGenerator::writeOne(QString filename, QString pathtoremove bool GBuildMakefileGenerator::openOutput(QFile &file, const QString &build) const { + Q_UNUSED(build) debug_msg(1, "file is %s", file.fileName().toLatin1().constData()); QFileInfo fi(file); if (fi.filePath().isEmpty()) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 68338a66842..5ea1ff14b9d 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1797,6 +1797,7 @@ ProjectBuilderMakefileGenerator::reftypeForFile(const QString &where) QString ProjectBuilderMakefileGenerator::sourceTreeForFile(const QString &where) { + Q_UNUSED(where) // We always use absolute paths, instead of maintaining the SRCROOT // build variable and making files relative to that. return QLatin1String(""); diff --git a/qmake/option.cpp b/qmake/option.cpp index 86d55835f87..7b93144d825 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -531,12 +531,11 @@ Option::fixString(QString string, uchar flags) string = QDir::cleanPath(string); } - bool localSep = (flags & Option::FixPathToLocalSeparators) != 0; - bool targetSep = (flags & Option::FixPathToTargetSeparators) != 0; - bool normalSep = (flags & Option::FixPathToNormalSeparators) != 0; - // either none or only one active flag - Q_ASSERT(localSep + targetSep + normalSep <= 1); + Q_ASSERT(((flags & Option::FixPathToLocalSeparators) != 0) + + ((flags & Option::FixPathToTargetSeparators) != 0) + + ((flags & Option::FixPathToNormalSeparators) != 0) <= 1); + //fix separators if (flags & Option::FixPathToNormalSeparators) { string = string.replace('\\', '/'); diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index c78b355ac10..35b3ed4e3d0 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -890,7 +890,9 @@ StNormal: ++j; } -#ifndef QT_NO_TEXTCODEC +#ifdef QT_NO_TEXTCODEC + Q_UNUSED(codec) +#else if (codec) { stringResult += codec->toUnicode(str.constData() + i, j - i); } else From f82f1a6a965610a7f1ed3fd2c8583c3f096a6377 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 31 Oct 2013 16:39:55 +0100 Subject: [PATCH 178/494] bring fake qmake project up to snuff Change-Id: Ib5b51ea2198db9fb202d957ab08b47cd32e99723 Reviewed-by: Joerg Bornemann --- qmake/qmake.pri | 15 ++++++++++----- qmake/qmake.pro | 38 ++++++++++++++++---------------------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/qmake/qmake.pri b/qmake/qmake.pri index 5012bd02069..661b787a552 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -1,6 +1,3 @@ -SKIP_DEPENDS += qconfig.h qmodules.h -DEFINES += QT_NO_TEXTCODEC QT_NO_LIBRARY QT_NO_COMPRESS QT_NO_UNICODETABLES \ - QT_NO_GEOM_VARIANT QT_NO_DATASTREAM #qmake code SOURCES += project.cpp property.cpp main.cpp \ @@ -37,7 +34,6 @@ contains(QT_EDITION, OpenSource) { } bootstrap { #Qt code - DEFINES+=QT_NO_THREAD SOURCES+= \ qbitarray.cpp \ qbuffer.cpp \ @@ -160,7 +156,16 @@ bootstrap { #Qt code CFLAGS += -fhonor-std LFLAGS += -lcpp } - DEFINES *= QT_NO_QOBJECT QT_CRYPTOGRAPHICHASH_ONLY_SHA1 + + DEFINES += \ + QT_BOOTSTRAPPED \ + QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_NO_COMPONENT QT_NO_COMPRESS \ + QT_NO_THREAD QT_NO_QOBJECT QT_NO_GEOM_VARIANT QT_NO_DATASTREAM \ + QT_CRYPTOGRAPHICHASH_ONLY_SHA1 QT_JSON_READONLY + + INCLUDEPATH += \ + $$QT.core.includes $$QT.core_private.includes \ + $$shadowed(../src/corelib/global) } else { CONFIG += qt QT = core diff --git a/qmake/qmake.pro b/qmake/qmake.pro index e680942716a..89d6ea5fc1b 100644 --- a/qmake/qmake.pro +++ b/qmake/qmake.pro @@ -4,24 +4,21 @@ option(host_build) CONFIG += console bootstrap -CONFIG -= qt shared app_bundle uic -DEFINES += QT_BUILD_QMAKE QT_BOOTSTRAPPED \ +CONFIG -= qt +DEFINES += \ + QT_BUILD_QMAKE \ PROEVALUATOR_FULL -DESTDIR = ../bin/ -OBJECTS_DIR = . -MOC_DIR = . - -#guts -VPATH += $$QT_SOURCE_TREE/src/corelib/global \ - $$QT_SOURCE_TREE/src/corelib/tools \ - $$QT_SOURCE_TREE/src/corelib/kernel \ - $$QT_SOURCE_TREE/src/corelib/codecs \ - $$QT_SOURCE_TREE/src/corelib/plugin \ - $$QT_SOURCE_TREE/src/corelib/xml \ - $$QT_SOURCE_TREE/src/corelib/io \ - $$QT_SOURCE_TREE/src/corelib/json \ - $$QT_SOURCE_TREE/tools/shared/windows +VPATH += \ + ../src/corelib/global \ + ../src/corelib/tools \ + ../src/corelib/kernel \ + ../src/corelib/codecs \ + ../src/corelib/plugin \ + ../src/corelib/xml \ + ../src/corelib/io \ + ../src/corelib/json \ + ../tools/shared/windows INCLUDEPATH += . \ library \ @@ -30,11 +27,8 @@ INCLUDEPATH += . \ generators/win32 \ generators/mac \ generators/integrity \ - $$QT_SOURCE_TREE/include \ - $$QT_SOURCE_TREE/include/QtCore \ - $$QT_SOURCE_TREE/include/QtCore/$$QT_VERSION \ - $$QT_SOURCE_TREE/include/QtCore/$$QT_VERSION/QtCore \ - $$QT_SOURCE_TREE/tools/shared \ - $$QT_SOURCE_TREE/qmake + ../tools/shared include(qmake.pri) + +load(qt_app) From 0f68222e9ebdf42778d4bb84260268764eb55b30 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 31 Oct 2013 18:01:29 +0100 Subject: [PATCH 179/494] move setting of _QMAKE_{SUPER,CONF,CACHE}_ to a more logical location there is no point in setting the variables already when peeking into the caches, as that is done in a separate evaluator anyway. it also makes no sense to have them set while loading the spec itself, as it's not permitted to do anything with the caches. so set them at the next convenient point, which is right before actually loading the caches. Change-Id: I3717ddf94353dc04e12c52e542f16ed27b578e14 Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- qmake/library/qmakeevaluator.cpp | 49 ++++++++++++++++---------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index 703c13a61a9..3415724c5ef 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -1188,23 +1188,18 @@ bool QMakeEvaluator::loadSpec() QMakeEvaluator evaluator(m_option, m_parser, m_vfs, m_handler); evaluator.m_sourceRoot = m_sourceRoot; evaluator.m_buildRoot = m_buildRoot; - if (!m_superfile.isEmpty()) { - valuesRef(ProKey("_QMAKE_SUPER_CACHE_")) << ProString(m_superfile); - if (evaluator.evaluateFile( - m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) - return false; + + if (!m_superfile.isEmpty() && evaluator.evaluateFile( + m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) { + return false; } - if (!m_conffile.isEmpty()) { - valuesRef(ProKey("_QMAKE_CONF_")) << ProString(m_conffile); - if (evaluator.evaluateFile( - m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) - return false; + if (!m_conffile.isEmpty() && evaluator.evaluateFile( + m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) { + return false; } - if (!m_cachefile.isEmpty()) { - valuesRef(ProKey("_QMAKE_CACHE_")) << ProString(m_cachefile); - if (evaluator.evaluateFile( - m_cachefile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) - return false; + if (!m_cachefile.isEmpty() && evaluator.evaluateFile( + m_cachefile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) { + return false; } if (qmakespec.isEmpty()) { if (!m_hostBuild) @@ -1238,19 +1233,25 @@ bool QMakeEvaluator::loadSpec() cool: m_qmakespec = QDir::cleanPath(qmakespec); - if (!m_superfile.isEmpty() - && evaluateFile(m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) { - return false; + if (!m_superfile.isEmpty()) { + valuesRef(ProKey("_QMAKE_SUPER_CACHE_")) << ProString(m_superfile); + if (evaluateFile( + m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) + return false; } if (!loadSpecInternal()) return false; - if (!m_conffile.isEmpty() - && evaluateFile(m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) { - return false; + if (!m_conffile.isEmpty()) { + valuesRef(ProKey("_QMAKE_CONF_")) << ProString(m_conffile); + if (evaluateFile( + m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) + return false; } - if (!m_cachefile.isEmpty() - && evaluateFile(m_cachefile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) { - return false; + if (!m_cachefile.isEmpty()) { + valuesRef(ProKey("_QMAKE_CACHE_")) << ProString(m_cachefile); + if (evaluateFile( + m_cachefile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) + return false; } return true; } From c87b27f308eecb2beadc227e107b2df161b3466b Mon Sep 17 00:00:00 2001 From: Marcel Krems Date: Thu, 10 Oct 2013 16:32:31 +0200 Subject: [PATCH 180/494] Silence compiler warning warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses] Change-Id: I15e283023918cd4ebc27e91812eadf95ba156d71 Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira Reviewed-by: David Faure --- src/corelib/io/qurl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index fe5faa2be79..77aa3c4821b 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -3586,7 +3586,7 @@ bool QUrl::matches(const QUrl &url, FormattingOptions options) const else if (d->fragment != url.d->fragment) return false; - if (!(d->sectionIsPresent & mask) == (url.d->sectionIsPresent & mask)) + if ((d->sectionIsPresent & mask) != (url.d->sectionIsPresent & mask)) return false; // Compare paths, after applying path-related options From 1d07c724317126c03ddadaed8cda2a0fcf783073 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 1 Nov 2013 14:29:51 +0100 Subject: [PATCH 181/494] Fix major performance regression in QGLWidget on texture bind Since Qt 5.1 we have not recognized the GL_EXT_bgra extension on desktop OpenGL, or the GL_EXT_texture_format_BGRA8888 extension on OpenGL ES. This patch matches the GL_EXT_bgra extension on both OpenGL and OpenGL ES and adds discovery of GL_EXT_texture_format_BGRA8888 under OpenGL ES. The old name for GL_EXT_texture_format_BGRA8888, GL_IMG_texture_format_BGRA8888 is also recognized. Change-Id: I2035bfe045aee14e86a1f407f5b8556454f8bb90 Reviewed-by: Gunnar Sletta --- src/gui/opengl/qopenglfunctions.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp index a4ed74637ca..0e5a1327b0f 100644 --- a/src/gui/opengl/qopenglfunctions.cpp +++ b/src/gui/opengl/qopenglfunctions.cpp @@ -347,6 +347,9 @@ static int qt_gl_resolve_extensions() { int extensions = 0; QOpenGLExtensionMatcher extensionMatcher; + if (extensionMatcher.match("GL_EXT_bgra")) + extensions |= QOpenGLExtensions::BGRATextureFormat; + #if defined(QT_OPENGL_ES) if (extensionMatcher.match("GL_OES_mapbuffer")) extensions |= QOpenGLExtensions::MapBuffer; @@ -356,10 +359,9 @@ static int qt_gl_resolve_extensions() extensions |= QOpenGLExtensions::ElementIndexUint; if (extensionMatcher.match("GL_OES_depth24")) extensions |= QOpenGLExtensions::Depth24; - - if (extensionMatcher.match("GL_EXT_bgra")) + // TODO: Consider matching GL_APPLE_texture_format_BGRA8888 as well, but it needs testing. + if (extensionMatcher.match("GL_IMG_texture_format_BGRA8888") || extensionMatcher.match("GL_EXT_texture_format_BGRA8888")) extensions |= QOpenGLExtensions::BGRATextureFormat; - #else QSurfaceFormat format = QOpenGLContext::currentContext()->format(); extensions |= QOpenGLExtensions::ElementIndexUint | QOpenGLExtensions::MapBuffer; From 0884802bb5a775e30555d21f071e12989fcba8c9 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 4 Nov 2013 16:20:23 +0100 Subject: [PATCH 182/494] Revert "QtConcurrent::Median: add some qMove()" This reverts commit 12bd604f241d41d52ab3fde9f4a8f4f5c2f3fa6d. This causes problems in QtCreator without anyone being able to say why. Task-number: QTBUG-34397 Change-Id: I7733c3db7d35bba2734e128476aabcb0152a91e4 Reviewed-by: Simon Hausmann --- src/concurrent/qtconcurrentmedian.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/concurrent/qtconcurrentmedian.h b/src/concurrent/qtconcurrentmedian.h index 29342e64028..b39b3ed32b6 100644 --- a/src/concurrent/qtconcurrentmedian.h +++ b/src/concurrent/qtconcurrentmedian.h @@ -90,7 +90,7 @@ public: dirty = true; } - values[currentIndex] = qMove(value); + values[currentIndex] = value; } bool isMedianValid() const @@ -105,7 +105,7 @@ public: QVector copy = values; typename QVector::iterator begin = copy.begin(), mid = copy.begin() + bufferSize/2, end = copy.end(); std::nth_element(begin, mid, end); - currentMedian = qMove(*mid); + currentMedian = *mid; } return currentMedian; } From 770ab026a80a038c77eb8957902208b2f6e76427 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 4 Nov 2013 16:22:10 +0100 Subject: [PATCH 183/494] Revert "QTest: use nth_element to calculate the median" This reverts commit 48586b2bac623605e9f300f8e5380e4f4b484dab. This causes problems in QtCreator without anyone being able to say why. Task-number: QTBUG-34397 Change-Id: I9ea5457724d5af8d87e0bc40e6615748daf9c04c Reviewed-by: Simon Hausmann --- src/testlib/qtestcase.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 260ace642e0..e170d2a0442 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1631,14 +1631,13 @@ QBenchmarkResult qMedian(const QList &container) if (count == 1) return container.front(); + QList containerCopy = container; + std::sort(containerCopy.begin(), containerCopy.end()); + const int middle = count / 2; - QList containerCopy = container; - const QList::iterator begin = containerCopy.begin(), mid = begin + middle, end = containerCopy.end(); - std::nth_element(begin, mid, end); - // ### handle even-sized containers here by doing an aritmetic mean of the two middle items. - return *mid; + return containerCopy.at(middle); } struct QTestDataSetter From 03aea653e2d1808fd6acf5bbe4672fa73e87b78e Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 4 Nov 2013 18:16:23 +0100 Subject: [PATCH 184/494] Remove now redundant argb to rgba function Change-Id: I293d71e12398aef91995b68a9ea22cac984917b0 Reviewed-by: Gunnar Sletta --- src/gui/opengl/qopenglgradientcache.cpp | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/gui/opengl/qopenglgradientcache.cpp b/src/gui/opengl/qopenglgradientcache.cpp index b48e96cd98b..9c4fbbe013c 100644 --- a/src/gui/opengl/qopenglgradientcache.cpp +++ b/src/gui/opengl/qopenglgradientcache.cpp @@ -152,22 +152,6 @@ GLuint QOpenGL2GradientCache::addCacheElement(quint64 hash_val, const QGradient } -// GL's expects pixels in RGBA (when using GL_RGBA), bin-endian (ABGR on x86). -// Qt always stores in ARGB reguardless of the byte-order the mancine uses. -static inline uint qtToGlColor(uint c) -{ - uint o; -#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN - o = (c & 0xff00ff00) // alpha & green already in the right place - | ((c >> 16) & 0x000000ff) // red - | ((c << 16) & 0x00ff0000); // blue -#else //Q_BIG_ENDIAN - o = (c << 8) - | ((c >> 24) & 0x000000ff); -#endif // Q_BYTE_ORDER - return o; -} - //TODO: Let GL generate the texture using an FBO void QOpenGL2GradientCache::generateGradientColorTable(const QGradient& gradient, uint *colorTable, int size, qreal opacity) const { @@ -184,7 +168,7 @@ void QOpenGL2GradientCache::generateGradientColorTable(const QGradient& gradient uint current_color = ARGB_COMBINE_ALPHA(colors[0], alpha); qreal incr = 1.0 / qreal(size); qreal fpos = 1.5 * incr; - colorTable[pos++] = qtToGlColor(PREMUL(current_color)); + colorTable[pos++] = ARGB2RGBA(PREMUL(current_color)); while (fpos <= s.first().first) { colorTable[pos] = colorTable[pos - 1]; @@ -205,9 +189,9 @@ void QOpenGL2GradientCache::generateGradientColorTable(const QGradient& gradient int dist = int(256 * ((fpos - s[i].first) * delta)); int idist = 256 - dist; if (colorInterpolation) - colorTable[pos] = qtToGlColor(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist)); + colorTable[pos] = ARGB2RGBA(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist)); else - colorTable[pos] = qtToGlColor(PREMUL(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist))); + colorTable[pos] = ARGB2RGBA(PREMUL(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist))); ++pos; fpos += incr; } @@ -216,7 +200,7 @@ void QOpenGL2GradientCache::generateGradientColorTable(const QGradient& gradient Q_ASSERT(s.size() > 0); - uint last_color = qtToGlColor(PREMUL(ARGB_COMBINE_ALPHA(colors[s.size() - 1], alpha))); + uint last_color = ARGB2RGBA(PREMUL(ARGB_COMBINE_ALPHA(colors[s.size() - 1], alpha))); for (;pos < size; ++pos) colorTable[pos] = last_color; From a8351096dbe1b8c02bcae858fb03133a5dacffdd Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 4 Nov 2013 18:19:34 +0100 Subject: [PATCH 185/494] Fix ARGB image glyphs on Open GL ES2 or big endian Change Ie891665ad66e31692b69db02d34be8d303a7d631 accidentially removed the condition that would ensure ARGB glyphs would get swizzled on OpenGL ES2. This patch readds a condition to check that, and also fixes the same on big endian hosts by reusing the OpenGL ES2 code path. Change-Id: I55615c498261a43c50e5a6902a7e2e24cddc4f4b Reviewed-by: Gunnar Sletta --- src/gui/opengl/qopengltextureglyphcache.cpp | 27 ++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/gui/opengl/qopengltextureglyphcache.cpp b/src/gui/opengl/qopengltextureglyphcache.cpp index 506aec0f431..061e8f41664 100644 --- a/src/gui/opengl/qopengltextureglyphcache.cpp +++ b/src/gui/opengl/qopengltextureglyphcache.cpp @@ -43,6 +43,8 @@ #include "qopenglpaintengine_p.h" #include "private/qopenglengineshadersource_p.h" #include "qopenglextensions_p.h" +#include +#include QT_BEGIN_NAMESPACE @@ -316,24 +318,27 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed if (mask.format() == QImage::Format_RGB32 // We need to make the alpha component equal to the average of the RGB values. // This is needed when drawing sub-pixel antialiased text on translucent targets. +#if defined(QT_OPENGL_ES_2) || Q_BYTE_ORDER == Q_BIG_ENDIAN + || mask.format() == QImage::Format_ARGB32_Premultiplied +#endif ) { for (int y = 0; y < maskHeight; ++y) { - quint32 *src = (quint32 *) mask.scanLine(y); + QRgb *src = (QRgb *) mask.scanLine(y); for (int x = 0; x < maskWidth; ++x) { - uchar r = src[x] >> 16; - uchar g = src[x] >> 8; - uchar b = src[x]; - quint32 avg; + int r = qRed(src[x]); + int g = qGreen(src[x]); + int b = qBlue(src[x]); + int avg; if (mask.format() == QImage::Format_RGB32) - avg = (quint32(r) + quint32(g) + quint32(b) + 1) / 3; // "+1" for rounding. + avg = (r + g + b + 1) / 3; // "+1" for rounding. else // Format_ARGB_Premultiplied - avg = src[x] >> 24; + avg = qAlpha(src[x]); -#if defined(QT_OPENGL_ES_2) + src[x] = qRgba(r, g, b, avg); +#if defined(QT_OPENGL_ES_2) || Q_BYTE_ORDER == Q_BIG_ENDIAN // swizzle the bits to accommodate for the GL_RGBA upload. - src[x] = (avg << 24) | (quint32(r) << 0) | (quint32(g) << 8) | (quint32(b) << 16); + src[x] = ARGB2RGBA(src[x]); #endif - src[x] = (src[x] & 0x00ffffff) | (avg << 24); } } } @@ -341,7 +346,7 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed glBindTexture(GL_TEXTURE_2D, m_textureResource->m_texture); if (mask.depth() == 32) { -#if defined(QT_OPENGL_ES_2) +#if defined(QT_OPENGL_ES_2) || Q_BYTE_ORDER == Q_BIG_ENDIAN glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_RGBA, GL_UNSIGNED_BYTE, mask.bits()); #else glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_BGRA, GL_UNSIGNED_BYTE, mask.bits()); From 6b8e866391cf933f077756c8ad154683885ea07f Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sat, 2 Nov 2013 10:13:45 +0800 Subject: [PATCH 186/494] Doc: Clean up threading examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Example 3 (Clock) is a collection of anti-patterns. - It implements a slot in a QThread subclass and then forces the new thread to use Qt::DirectConnection to invoke the slot in the "wrong" thread. - It talks about getting away with non-thread-safe usage - It uses a thread as a timer and then admits that it's an over- complicated approach. - Example 4 (Permanent Thread) is over-complicated yet incomplete. A better one exists in the QThread class ref. - Example 1 (Thread Pool) is covered by the QThreadPool class ref. - Example 2 (QtConcurrent::run()) is covered in the "Threading and Concurrent Programming Examples" page and the "QtConcurrentRun" page. - The undocumented "Hello Thread" example is covered in the QThread class ref. - These examples cannot be accessed from Qt Creator's Examples tool. - These examples are neither widget-related nor tutorials, contrary to their source paths. Task-number: QTBUG-33360 Change-Id: Ic79cb764ee925ddbcbeafee8e1d01db7fe0f6cfe Reviewed-by: Topi Reiniö Reviewed-by: Jerome Pasion --- .../widgets/tutorials/threads/clock/clock.pro | 10 -- .../tutorials/threads/clock/clockthread.cpp | 66 --------- .../tutorials/threads/clock/clockthread.h | 64 --------- .../widgets/tutorials/threads/clock/main.cpp | 67 --------- .../helloconcurrent/helloconcurrent.cpp | 63 --------- .../helloconcurrent/helloconcurrent.pro | 14 -- .../threads/hellothread/hellothread.cpp | 50 ------- .../threads/hellothread/hellothread.h | 53 -------- .../threads/hellothread/hellothread.pro | 14 -- .../tutorials/threads/hellothread/main.cpp | 52 ------- .../hellothreadpool/hellothreadpool.cpp | 65 --------- .../hellothreadpool/hellothreadpool.pro | 14 -- .../tutorials/threads/movedobject/main.cpp | 69 ---------- .../threads/movedobject/movedobject.pro | 15 --- .../tutorials/threads/movedobject/thread.cpp | 100 -------------- .../tutorials/threads/movedobject/thread.h | 67 --------- .../threads/movedobject/workerobject.cpp | 87 ------------ .../threads/movedobject/workerobject.h | 64 --------- .../widgets/tutorials/threads/threads.pro | 8 -- examples/widgets/tutorials/tutorials.pro | 2 +- src/corelib/doc/images/thread_clock.png | Bin 5964 -> 0 bytes src/corelib/doc/src/threads-basics.qdoc | 127 +----------------- 22 files changed, 4 insertions(+), 1067 deletions(-) delete mode 100644 examples/widgets/tutorials/threads/clock/clock.pro delete mode 100644 examples/widgets/tutorials/threads/clock/clockthread.cpp delete mode 100644 examples/widgets/tutorials/threads/clock/clockthread.h delete mode 100644 examples/widgets/tutorials/threads/clock/main.cpp delete mode 100644 examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.cpp delete mode 100644 examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.pro delete mode 100644 examples/widgets/tutorials/threads/hellothread/hellothread.cpp delete mode 100644 examples/widgets/tutorials/threads/hellothread/hellothread.h delete mode 100644 examples/widgets/tutorials/threads/hellothread/hellothread.pro delete mode 100644 examples/widgets/tutorials/threads/hellothread/main.cpp delete mode 100644 examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.cpp delete mode 100644 examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.pro delete mode 100644 examples/widgets/tutorials/threads/movedobject/main.cpp delete mode 100644 examples/widgets/tutorials/threads/movedobject/movedobject.pro delete mode 100644 examples/widgets/tutorials/threads/movedobject/thread.cpp delete mode 100644 examples/widgets/tutorials/threads/movedobject/thread.h delete mode 100644 examples/widgets/tutorials/threads/movedobject/workerobject.cpp delete mode 100644 examples/widgets/tutorials/threads/movedobject/workerobject.h delete mode 100644 examples/widgets/tutorials/threads/threads.pro delete mode 100644 src/corelib/doc/images/thread_clock.png diff --git a/examples/widgets/tutorials/threads/clock/clock.pro b/examples/widgets/tutorials/threads/clock/clock.pro deleted file mode 100644 index 041c02bea83..00000000000 --- a/examples/widgets/tutorials/threads/clock/clock.pro +++ /dev/null @@ -1,10 +0,0 @@ -QT += widgets -CONFIG += console -TEMPLATE = app -SOURCES += main.cpp \ - clockthread.cpp -HEADERS += clockthread.h - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/threads/clock -INSTALLS += target diff --git a/examples/widgets/tutorials/threads/clock/clockthread.cpp b/examples/widgets/tutorials/threads/clock/clockthread.cpp deleted file mode 100644 index 5068a9b14a2..00000000000 --- a/examples/widgets/tutorials/threads/clock/clockthread.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "clockthread.h" - - //This class starts another thread where it emits a signal for every new second. - -//! [1] -// clock/clockthread.cpp -void ClockThread::run() -{ - QTimer timer; - connect(&timer, SIGNAL(timeout()), this, SLOT(timerHit()), Qt::DirectConnection); - timer.setInterval(10); - timer.start(); // puts one event in the threads event queue - exec(); - timer.stop(); -} - -void ClockThread::timerHit() -{ - QString newTime= QDateTime::currentDateTime().toString("ddd MMMM d yy, hh:mm:ss"); - if(m_lastTime != newTime ){ - m_lastTime = newTime; - emit sendTime(newTime) ; - } -} -//! [1] diff --git a/examples/widgets/tutorials/threads/clock/clockthread.h b/examples/widgets/tutorials/threads/clock/clockthread.h deleted file mode 100644 index 9d3b06ddd8f..00000000000 --- a/examples/widgets/tutorials/threads/clock/clockthread.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef CLOCKTHREAD_H -#define CLOCKTHREAD_H - -#include -#include - - - -//! [1] -// clock/clockthread.h -class ClockThread : public QThread -{ - Q_OBJECT -signals: - void sendTime(QString time); -private: - void run(); - QString m_lastTime; -private slots: - void timerHit(); - -}; -//! [1] -#endif // CLOCKTHREAD_H \ No newline at end of file diff --git a/examples/widgets/tutorials/threads/clock/main.cpp b/examples/widgets/tutorials/threads/clock/main.cpp deleted file mode 100644 index f90318027c0..00000000000 --- a/examples/widgets/tutorials/threads/clock/main.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "clockthread.h" - -//A clock that does time formatting in another thread - -//! [1] -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - // build gui - QWidget widget; - QLabel *label = new QLabel; - QHBoxLayout *layout = new QHBoxLayout(&widget); - layout->addWidget(label); - widget.setWindowTitle("clock"); - - //instantiate thread object - ClockThread clockThread; - QObject::connect(&clockThread, SIGNAL(sendTime(QString)), label, SLOT(setText(QString)), Qt::QueuedConnection); - clockThread.start(); - widget.show(); - app.exec(); - clockThread.quit(); - clockThread.wait(); - return 0; -} -//! [1] diff --git a/examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.cpp b/examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.cpp deleted file mode 100644 index 773c685ba0f..00000000000 --- a/examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include - -/* - says hello from main thread and secondary thread using QtConcurrent -*/ - -//! [1] -// helloconcurrent/main.cpp -void hello() -{ - qDebug() << "Hello from thread " << QThread::currentThread(); -} - -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - QFuture future = QtConcurrent::run(hello); - qDebug() << "hello from GUI thread " << QThread::currentThread(); - future.waitForFinished(); - return 0; -} -//! [1] diff --git a/examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.pro b/examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.pro deleted file mode 100644 index 7e6da1133c8..00000000000 --- a/examples/widgets/tutorials/threads/helloconcurrent/helloconcurrent.pro +++ /dev/null @@ -1,14 +0,0 @@ -QT -= gui -QT += concurrent - -CONFIG += console -CONFIG -= app_bundle -TEMPLATE = app -SOURCES += helloconcurrent.cpp - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/threads/helloconcurrent -INSTALLS += target - - - diff --git a/examples/widgets/tutorials/threads/hellothread/hellothread.cpp b/examples/widgets/tutorials/threads/hellothread/hellothread.cpp deleted file mode 100644 index 1b5088e0db6..00000000000 --- a/examples/widgets/tutorials/threads/hellothread/hellothread.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "hellothread.h" -/* - * demonstrates use of QThread, says hello in another thread and terminates - */ - -void HelloThread::run() -{ - qDebug() << "hello from worker thread " << thread()->currentThreadId(); -} diff --git a/examples/widgets/tutorials/threads/hellothread/hellothread.h b/examples/widgets/tutorials/threads/hellothread/hellothread.h deleted file mode 100644 index 281f2c6cb57..00000000000 --- a/examples/widgets/tutorials/threads/hellothread/hellothread.h +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef HELLOTHREAD_H -#define HELLOTHREAD_H - -#include - -class HelloThread : public QThread -{ - Q_OBJECT -private: - void run(); -}; - -#endif // HELLOTHREAD_H diff --git a/examples/widgets/tutorials/threads/hellothread/hellothread.pro b/examples/widgets/tutorials/threads/hellothread/hellothread.pro deleted file mode 100644 index 40fd33b1460..00000000000 --- a/examples/widgets/tutorials/threads/hellothread/hellothread.pro +++ /dev/null @@ -1,14 +0,0 @@ -QT -= gui - -CONFIG += console -CONFIG -= app_bundle -TEMPLATE = app -SOURCES += main.cpp \ - hellothread.cpp -HEADERS += hellothread.h - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/threads/hellothread -INSTALLS += target - - diff --git a/examples/widgets/tutorials/threads/hellothread/main.cpp b/examples/widgets/tutorials/threads/hellothread/main.cpp deleted file mode 100644 index 8b4b00874f7..00000000000 --- a/examples/widgets/tutorials/threads/hellothread/main.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "hellothread.h" - -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - HelloThread thread; - thread.start(); - qDebug() << "hello from GUI thread " << app.thread()->currentThreadId(); - thread.wait(); // do not exit before the thread is completed! - return 0; -} diff --git a/examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.cpp b/examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.cpp deleted file mode 100644 index f904159fe44..00000000000 --- a/examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -// A hello world program to demonstrate the use of the global thread pool - -//! [1] -// hellothreadpool/main.cpp -class Work : public QRunnable -{ -public: - void run() - { - qDebug() << "Hello from thread " << QThread::currentThread(); - } -}; - -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - Work work; - work.setAutoDelete(false); - QThreadPool *threadPool = QThreadPool::globalInstance(); - threadPool->start(&work); - qDebug() << "hello from GUI thread " << QThread::currentThread(); - threadPool->waitForDone(); - return 0; -} -//! [1] diff --git a/examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.pro b/examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.pro deleted file mode 100644 index d5404a51343..00000000000 --- a/examples/widgets/tutorials/threads/hellothreadpool/hellothreadpool.pro +++ /dev/null @@ -1,14 +0,0 @@ -QT -= gui - -CONFIG += console -CONFIG -= app_bundle -TEMPLATE = app -SOURCES += hellothreadpool.cpp - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/threads/hellothreadpool -INSTALLS += target - - - - diff --git a/examples/widgets/tutorials/threads/movedobject/main.cpp b/examples/widgets/tutorials/threads/movedobject/main.cpp deleted file mode 100644 index 2894707fda3..00000000000 --- a/examples/widgets/tutorials/threads/movedobject/main.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "workerobject.h" -#include "thread.h" - -/* - * moves a class derived from QObject (WorkerObject) to another thread - * and calls methods over thread boundaries. - */ - -//![1] -// movedobject/main.cpp -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - Thread thread; - qDebug() << "main thread ID: " << app.thread()->currentThreadId(); - WorkerObject *worker = new WorkerObject; - thread.launchWorker(worker); - QMetaObject::invokeMethod(worker, "doWork", Qt::QueuedConnection); - QMetaObject::invokeMethod(worker, "startPolling", Qt::QueuedConnection, Q_ARG(int, 500)); - //let application produce output for 3 seconds and quit - QTimer::singleShot(3000, &app, SLOT(quit())); - app.exec(); - thread.stop(); - thread.wait(); - delete worker; - return 0; -} -//![1] diff --git a/examples/widgets/tutorials/threads/movedobject/movedobject.pro b/examples/widgets/tutorials/threads/movedobject/movedobject.pro deleted file mode 100644 index b2ea7e53667..00000000000 --- a/examples/widgets/tutorials/threads/movedobject/movedobject.pro +++ /dev/null @@ -1,15 +0,0 @@ -QT += widgets -CONFIG += console -CONFIG -= app_bundle -TEMPLATE = app -SOURCES += main.cpp \ - workerobject.cpp \ - thread.cpp - -HEADERS += \ - workerobject.h \ - thread.h - -# install -target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tutorials/threads/movedobject -INSTALLS += target diff --git a/examples/widgets/tutorials/threads/movedobject/thread.cpp b/examples/widgets/tutorials/threads/movedobject/thread.cpp deleted file mode 100644 index 2b6c2ffbd61..00000000000 --- a/examples/widgets/tutorials/threads/movedobject/thread.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "thread.h" - -/* - * QThread derived class with additional capability to move a QObject to the - * new thread, to stop the thread and move the QObject back to the thread where - *it came from. - */ - -Thread::Thread( QObject *parent) - : QThread (parent) -{ - //we need a class that receives signals from other threads and emits a signal in response - shutDownHelper=new QSignalMapper; - shutDownHelper->setMapping(this,0); - connect(this, SIGNAL(started()), this, SLOT(setReadyStatus() ), Qt::DirectConnection); - connect(this, SIGNAL(aboutToStop()), shutDownHelper, SLOT(map()) ); -} - -//------------------------------------------------------ -Thread::~Thread() -{ - delete shutDownHelper; -} - -//------------------------------------------------------ -// starts thread, moves worker to this thread and blocks -void Thread::launchWorker(QObject *worker) -{ - this->worker = worker; - start(); - worker->moveToThread(this); - shutDownHelper->moveToThread(this); - connect(shutDownHelper, SIGNAL(mapped(int) ), this, SLOT(stopExecutor()), Qt::DirectConnection ); - mutex.lock(); - waitCondition.wait(&mutex); -} - -//------------------------------------------------------ -// puts a command to stop processing in the event queue of worker thread -void Thread::stop() -{ - emit aboutToStop(); -} - -//------------------------------------------------------ - -// methods above this line should be called in gui thread context -// methods below this line are private and will be run in secondary thread context - -//------------------------------------------------------ -void Thread::stopExecutor() //secondary thread context -{ - exit(); -} - -//------------------------------------------------------ -void Thread::setReadyStatus() -{ - waitCondition.wakeAll(); -} diff --git a/examples/widgets/tutorials/threads/movedobject/thread.h b/examples/widgets/tutorials/threads/movedobject/thread.h deleted file mode 100644 index e95d480ca8a..00000000000 --- a/examples/widgets/tutorials/threads/movedobject/thread.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef THREAD_H -#define THREAD_H - -#include - -class Thread :public QThread -{ - Q_OBJECT -public: - Thread( QObject *parent=0); - ~Thread(); - void stop(); - void launchWorker(QObject *worker); -private: - QObject *worker; - QSignalMapper *shutDownHelper; - QWaitCondition waitCondition; - QMutex mutex; -private slots: - void stopExecutor(); - void setReadyStatus(); -signals: - void aboutToStop(); -}; - -#endif // THREAD_H diff --git a/examples/widgets/tutorials/threads/movedobject/workerobject.cpp b/examples/widgets/tutorials/threads/movedobject/workerobject.cpp deleted file mode 100644 index a630042f9a7..00000000000 --- a/examples/widgets/tutorials/threads/movedobject/workerobject.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include "workerobject.h" - -/* - * represents an object that lives in another thread where it polls a resource - * and communicates with the gui thread - */ - -WorkerObject::WorkerObject(QObject *parent) - : QObject(parent) -{ - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(poll())); -} - -//--------------------------------------------------------------- -void WorkerObject::doWork() -{ - - qDebug() << "doing work in thread " << thread()->currentThreadId() ; -} - -//--------------------------------------------------------------- -WorkerObject::~WorkerObject() -{ - qDebug() << "destruction WorkerObject in thread " << thread()->currentThreadId(); -} - -//--------------------------------------------------------------- -void WorkerObject::startPolling(int milliseconds) -{ - count=0; - timer->start(milliseconds); -} - -//--------------------------------------------------------------- -void WorkerObject::stopPolling() -{ - timer->stop(); -} - -//--------------------------------------------------------------- -void WorkerObject::poll() -{ - qDebug() << QString("timer hit %1").arg(count); - count++; -} - diff --git a/examples/widgets/tutorials/threads/movedobject/workerobject.h b/examples/widgets/tutorials/threads/movedobject/workerobject.h deleted file mode 100644 index 251a935282b..00000000000 --- a/examples/widgets/tutorials/threads/movedobject/workerobject.h +++ /dev/null @@ -1,64 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#ifndef WORKEROBJECT_H -#define WORKEROBJECT_H - -#include - -class WorkerObject : public QObject -{ - Q_OBJECT -public: - explicit WorkerObject(QObject *parent = 0); - ~WorkerObject(); -public slots: - void doWork(); - void startPolling(int milliseconds); - void stopPolling(); -private slots: - void poll(); -private: - QTimer *timer; - int count; -}; - -#endif // WORKEROBJECT_H diff --git a/examples/widgets/tutorials/threads/threads.pro b/examples/widgets/tutorials/threads/threads.pro deleted file mode 100644 index 19718d760c1..00000000000 --- a/examples/widgets/tutorials/threads/threads.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS = hellothread \ - hellothreadpool \ - clock \ - movedobject - -qtHaveModule(concurrent): SUBDIRS += helloconcurrent diff --git a/examples/widgets/tutorials/tutorials.pro b/examples/widgets/tutorials/tutorials.pro index cf948305516..2eb87cdbd58 100644 --- a/examples/widgets/tutorials/tutorials.pro +++ b/examples/widgets/tutorials/tutorials.pro @@ -1,2 +1,2 @@ TEMPLATE = subdirs -SUBDIRS += threads addressbook widgets modelview gettingStarted +SUBDIRS += addressbook widgets modelview gettingStarted diff --git a/src/corelib/doc/images/thread_clock.png b/src/corelib/doc/images/thread_clock.png deleted file mode 100644 index b8a8aa0a39eb92249671b7efb07768630a1516bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5964 zcmV-S7qjSzP)V=-S7~l!Z+9R= zY+-YAIv`_gZ)0l)@!p33000YgMObuHX>@F50Ap-#V{3$E_ul{j7OhD{K~#90?Oc0Y zRmJvS`|vnm0)}a!0x6=vBtbUdKdTN@_ZZ|St zm8h8hEUh%{CMJ~PBYY%cs3;O3aDc-(vwnZfW6z$w&*2;b^>$ls&t9`;?b);EyVjaD zv$p~w!k_e?M~E1xY1+zyKjCkfW;{Lp*e7pZ>|QhtO_@AN)3iWZct5B3;`Zj>f)3{G zx!7H3N@Cc9De|`rvZclbB)1KU3JV5+)0NI2&(^OmbXV1r3*5y^ioV>u#dqb$pPWAX zEk8oV<4;ca*S!4gkKDdB_IJl%%2kd%dHc_vv6t9v6%`d>En8mYa=w?;?ek)L<_XQO z{#{6#aDBV?e>l|~jG&{x{Nh)a{MGlD8r?p_9#Qw^aaR<#K3kM?8V3y;WVhSD{PN5A z`1rPM+lGXMeD(ELaiR9~*6lw$cU2Sgx*2H6uA-9NU$p6Sdy_NrUFI)biS-+EJq z#9w`Xsd4RdzX#^`cSKfRR(dq7U58t*zux6?)zs8PMMc%u*Sp=d>(6 zdPii7O}~Yi@3D163;^7`>VzUxBxcG?Yj=0nDepQyD!1u#8-1K6XJk58QsQH88>jCt zHKKh(%x@WNOKlH(%WXZAl4@&f0|EjxO^c6@M?^x1+wHEbtZdyn@^I<7)DEztQmb-W z%>9U{Y1+*z3u$rd$XL<77rHzoph2C+DK`^2olbxC+jr<-S#`3gsHytXzC#DOHKnMK zjh+w@5pQp&6&4lUaQzKVr}NyobET!F0RaIvn=K$9AUHU z0%HG8k#%)-K|w);kf^9Ahr^MRlVi8r?RNX-&6@)Q1FyU8I!)6;LqjVoEBkkf6ab3@ z0BC0W&YN!_;yZ7?A-69dk#^f#H@Dp~Jm!NtqL>pS0%GeB+q(m=+%i07&cG{MhuFL; zk4g-GuzM@H*~Q-YYw{bnMhg971RwXdyhDpDzxj>i1B+(>@bglG;T@xm>Qmz`&}is-lx8JC>fB zy>yMQT{Df{v_7p5mDbJJb|x&?ro#y^wRhycv$fN|DIRlOtEs&sXKp|1N%`JuBEs#q z1-ZW|Enm@dAk}GdMy5tPw^^sD{2l=I=jC13y}JUK1(v)OC_ z(DCX{ZExrsT~-zo6XU3^uC1-Ds;a81tFr-Y$XYk^nWropo&DCEPfULb0O&6m*AbNZ zM1{P*^GuzK)VbWUPVcDDH+G(_bCFdC%RU_%OND0Tk%{50LTvMM&iOe+O-9aoE9|X= zN|jm1%T>+SA5da`L0NV2>EhDTQisD)TU$$!zT=i#qT}Mq%ggJWPC|&yW^=pUH8nK_ zWsaMc9#Ib3m<&9F-xTvTO>?^?3D?m8Q0NGuNjWUocC5^4Zg$dN7R505RvZV|YTV zAR7!zXtn#4!%`Ul7U!O;sC7+9iqwqFF4}&ibnmw2V3dIqQ~Qo@w~51-`M&Rs{luYE z{T`}!Iz@xDGvaoh+Bf9+-&M5e9N)RTyu7ru)ai60A|V6`!P?s3Hf>zz&r{%k`|Y>5 zxK7_yw6M&;0boGJAt4!%aR{u^@^`Y&CS4i&#eH#eZ|i`FtA8$Aa%Z$XK%0|&HtDL+ zO(WxaTp2oN*I7$t+Ti!UR_#9Jn3#Np(sE?C0nNcE19u7L`Co6@3;^mtI%gI&k2&Z@-O>j*gCwZqcHJP177THNT!e ze{%cwn{U1Km@_o9!14RL+Z;6czph!hEx$P!nf!V~(+GWksd4RF?B~zQsk-l)miLVq zk)NM`B_p?(~hj8)ehHx=!YIfUuJB0_Ws1~NzHl} zf8XKy+aKEg{Dq4aELzO`zU<)60o6H*-u|7i-zbUm>pp)h>K57X>#~0fnlgD3WdddC z!w*dqyryXiBg;SojWYlW&lydVimW96Dt`bBmAbN0qjXFvi|cqVb-5>rPIUR;MIv&2 zA?GU&xgPmmg>*tdkn5B`#!KZ(Oc%*FHgrNQm^(&k!Qv%?H(*aBC3$!_k9^o91_jpY zg&KlfrCI&bu4)?nMFb6Ki?mj60fE)CUjWbm0W`Yv0{~P`2Y^a+sJMN|;CUf5>FC49 zIqS0mlmSK~lopp+VJ|_hVsDAL$tnz;Hu5@>F-qts*+NXF+5Xen|jR{XiWC!wsKPn}ZEWm1Ly#X&2t%JYEf_{<5b`1jk zW@=4CQO<}xvCUTL@i9f2$|(9(1_&DI)4MOG5~{$U)Wn|%SoRxyO%^#-X+Zi zdd4Rzc##DHmh|b~EhmWTe9!NpGll|!KwXRjn>$Q+D_NhXVKU0CEx;l!n-Elir>yLt z7RiG}kT<(FXQZaQK9Nj5<$9)|s{tW_ z#L^H!&h-Fzkv)+bvOErrJjUWFcm*%27+86{0=@#gR94~F`)B;?G0$%l@ZdeyGgbkI zSh$QHmqAk{T*i?Xfr3u<3~K$CU!o^^EGq=Yh?#(+u7-P%b3GpY^~BV2Hq*2QhDk@4 z7ESONbc~=Ik+9n3v5NfiUA#EG=VMo}#2=UY3!chjl#^h_Y#kue&=Kq!dg9 zP;d`l%!zb$qu|M@r`&J+m-L`DXEm6v{|sX zn)t0VaG^u-0*0S(Tsi6+;WtPD)M$?Yz!XLN2e!1=O+xULcn8f-q{%*Q^}y_GIY14; zpw8gF059L6QF!|fJouF7%L;}yHWylid|iTis;}!HNP$94_<=`#ZVh^>4=hfDfdOh^ zY|fW?-fIsFe5aVeEd>}&jnKMX` za0xL=P|}er5DC>DJ$5W1gcXqxdPe=1{oyRt88%|1uFU@;`%4J>(u~j|t01gGCR7FN z6E)Un)VoAPQ~IMwcaa&rv!-V;KB?hC;scsE?pd^Udfdr8pFFc+yBuxO2m$&zx;luAAJ^JX;Ba)4<>kA7D zQ-=&eE-or68l9d#I(^*9lPA#xH9aAc8CYqfd8-=~bu!%k^oXmw9=i z$0Ur~wQJYg@62{oI|yM9``-Ko)1P?a{Q2`s-v7sIvtHqv007y$et3KKY=^@^&`l*D zE&KSMp?48NmM&X1{mH*8X&PmI*tL7kyty?F2Zam(KVP>75%%oevwp)yLfl*#0I*d= zs|EAkEj&>;d+xmc{rXYK{CDRR{(550-1q+4ub(`b=jQ%6fANwUhXd*KjQGjw)hUAp z6Lf!?x%!dGlN*FjCcpij4rp*-U{X?#@eibDX0D+odGCn(L^#)tl^{V}yLSDA2Oj9! zrHd`Vme8f^#PQ=Z*Q}*s0RX7dr=MkhynH#uBW1|Ylp#Z@UzV1hd+M1PX+!UR`k5J} zC8g9C0pQ_B9=$Vl$n>Y5K3h^kUBBSiv2hPRc=xd3J9hkwI_YE6rrnvEHadNraC<_? zXPKEJMhs`xLkJR5aQt}p?%n$Kz2WEld|eX>L9%*H=E&j006>JGef#$H?c4V+H}>7P zZ=Z-PJUr2vfvj1#ZrHu|0Dv5k5XsuLSwm7%Xf))L2;TnRe+v%}i;0Or9yD(I+pXc@ zVKLFsh{Q0Mh*=vq4jqyT03ymC{5ii*ubwyb>V5EFzQ2Co80>BILA#TD}Y;J;lPfnnYns#+e z?1B9UdiG4BGw*@@2Rg>aB4JlmRaV7xh!&uV_UV=mi!g2i)Y9DyRLY>stqC6S4+kV)+n{c7B{$qF}T;8fxSy>q%Tz+{gbQAMB z3uI?-qiAUV{sX;}dx>_$!@BD0H~ilh)22MaS_5#^yEbn6;;|`HXb;VcJN>x;BErKf zD$WC9tB436;S;39eA3_n0ED>foOOHl?)~tirD-X5A`&ESb~$k)5=1u=H=ELkJ0)e% z2Onh|K76R&={$7g&<7bGrlqA2e${;=hqr8b+47aE2yr8lu$C=PoH$W&zJj*Xt$Vku z^`F<*JJ+pW-=jx&+A;vt)HocD>W^2fNKWoa(2c~M(6#Hjto2T3T}ep^5<*idLfqnz zBfnf#TT`<$J3Hf}kB1Jqi(aT4vT|Z#V)m|G-)HYkOh_QajZ97-oZkr9EfC#&Wk`+{ z9FL8S<_i|4gT(#e(xqv44sO$?wUA_dyfk(2;5MxzdB)^s?Xa;WGE!Z;cFoDn-JP4; zwQCn2;SN9*M1)KQZ-DLI{8s8xu3;f$;#)vqz7~lOH04XaEx)96x8?ymjld zI<)UF=WX_H6$mmv1H%_30Nj;bF4w5^adDkG{e9ZhP93i%grG6#vom4wdHB6|zx2v1 z0GRpQGlZbq?YeKw*j3Ax32k{Z5Q)A^S5i_Ed3mJp`{!PK>E#z^0>HNIJ2rpyHC0-< zGy?#>-LYfK*WXad@{E6qA(aPNjQP;ClsDd)4FFF)@wmS+pAE->y+6%gxagj=6u&OE zZqfXKulW2%-|rK9ecrzGRa8ZXH7`Z|QuEm=^qa`IYo~MaU*H%Q94}b5e8uz6&QSM% zJ-z%hnTOn*Wq5D&bZ$wjvp%0Pd6NEpJ|Z^Z{~CzW9zU=*=JK*szNKq@ylOK{5p2EC7TNh;1E%5m1Say2YzI0RZS)hHiT3yoJn40Rdpj zq=x`4AP0lz%i%(9z$5C=)b4Ic&4N88>i_^gS^yZr0Dx));K>fSOziXN{b}4&=qwmn zb#9O$2P2Zu7}TLTfrnjF=a=2trr*uKFr)0JOFy;Y3 zU%~1zUNHiY;y*}10Yoe|;>;%ugTUM^Zz8qQ(&@nrxx!k^>*nGGql>;PU)gyPs!l-mSF&BBtXe|t?U5A z_MSdDo4w!nepzr*r&U$U>EKd@T+l_vUXW!N08=CY@kNf&4gd_Mz#0LN_In#O++H?% zOd+5_$SoxokuDYNDJfwc^jS;mLsgALIX#`jdR5001aCQ@lGz u{SVguq(3TAtas<+Ug~qwpVUl*i2n~0e~Sd?@P3&90000