Merge remote-tracking branch 'origin/stable' into dev

Conflicts:
	src/sql/drivers/sqlite/qsql_sqlite.cpp

Change-Id: Ia7cffd2c99ae3d5eea6b5740683c06e921336dcd
This commit is contained in:
Frederik Gladhorn 2013-12-05 18:52:38 +01:00
commit f6dbdd9c16
99 changed files with 938 additions and 354 deletions

View File

@ -0,0 +1,47 @@
/****************************************************************************
**
** 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 <fcntl.h>
int main(int, char **)
{
return ::posix_fallocate(0, 0, 0);
}

View File

@ -0,0 +1,2 @@
SOURCES = posix_fallocate.cpp
CONFIG -= qt dylib

17
configure vendored
View File

@ -687,6 +687,7 @@ CFG_MIPS_DSP=auto
CFG_MIPS_DSPR2=auto
CFG_CLOCK_GETTIME=auto
CFG_CLOCK_MONOTONIC=auto
CFG_POSIX_FALLOCATE=auto
CFG_MREMAP=auto
CFG_GETADDRINFO=auto
CFG_IPV6IFNAME=auto
@ -5143,6 +5144,9 @@ if [ "$CFG_XCB" != "no" ]; then
if [ "$CFG_XCB_XLIB" != "no" ]; then
if compileTest qpa/xcb-xlib "xcb-xlib" $QMAKE_CFLAGS_XCB $QMAKE_LIBS_XCB; then
QT_CONFIG="$QT_CONFIG xcb-xlib"
CFG_XCB_XLIB=yes
else
CFG_XCB_XLIB=no
fi
fi
@ -5457,6 +5461,15 @@ elif [ "$CFG_CLOCK_GETTIME" = "no" ]; then
CFG_CLOCK_MONOTONIC=no
fi
# detect posix_fallocate
if [ "$CFG_POSIX_FALLOCATE" = "auto" ]; then
if compileTest unix/posix_fallocate "posix_fallocate"; then
CFG_POSIX_FALLOCATE=yes
else
CFG_POSIX_FALLOCATE=no
fi
fi
# detect mremap
if [ "$CFG_MREMAP" = "auto" ]; then
if compileTest unix/mremap "mremap"; then
@ -5781,6 +5794,9 @@ fi
if [ "$CFG_CLOCK_MONOTONIC" = "yes" ]; then
QT_CONFIG="$QT_CONFIG clock-monotonic"
fi
if [ "$CFG_POSIX_FALLOCATE" = "yes" ]; then
QT_CONFIG="$QT_CONFIG posix_fallocate"
fi
if [ "$CFG_MREMAP" = "yes" ]; then
QT_CONFIG="$QT_CONFIG mremap"
fi
@ -6260,6 +6276,7 @@ QMakeVar set sql-plugins "$SQL_PLUGINS"
[ "$CFG_GLIB" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GLIB"
[ "$CFG_QGTKSTYLE" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_STYLE_GTK"
[ "$CFG_CLOCK_MONOTONIC" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_CLOCK_MONOTONIC"
[ "$CFG_POSIX_FALLOCATE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_POSIX_FALLOCATE"
[ "$CFG_MREMAP" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_MREMAP"
[ "$CFG_GETADDRINFO" = "no" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETADDRINFO"
[ "$CFG_IPV6IFNAME" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6IFNAME"

144
dist/changes-5.2.0 vendored
View File

@ -48,6 +48,10 @@ information about a particular change.
* QUrl now normalizes the path given in setPath, removing ./ and ../ and
duplicate slashes.
- QWheelEvent has gained a "phase" attribute and may now be sent with
zero delta() in order to indicate beginning and end of transient
scrolling.
****************************************************************************
* Library *
****************************************************************************
@ -290,6 +294,9 @@ QtGui
- [QTBUG-27349] Reintroduced command line argument for positioning
windows (-geometry on X11, -qwindowgeometry on other platforms)
- [QTBUG-28832] Fixed regression from Qt 4 when using
QTextOption::ShowLineAndParagraphSeparators.
QtNetwork
---------
@ -353,12 +360,24 @@ Changes in Qt 5.2.0
QtWidgets
---------
- Added class QKeySequenceEdit.
- Added QMaxCocoaViewContainer and QMacNativeWidget classes.
- [QTBUG-1016] Added API to control tool tip timing via:
* new QToolTip::showTip() overload
* QWidget::toolTipDuration() property.
* QStyle::SH_ToolTip_WakeUpDelay and SH_ToolTip_FallAsleepDelay
style hints.
- [QTBUG-30255] Fixed a bug where spans across empty cells in a grid
layout got broken.
- [QTBUG-31569] WA_QuitOnClose now works even if there are other
windows that don't have it set.
- [QTBUG-32788] Properly handles Qt::WidgetWithChildrenShortcut
shortcuts in MDI subwindows now.
- [QTBUG-33078] QWidget::setWindowOpacity() now works when called
before QWidget::show().
- [QTBUG-33104] Fixed a bug where layout items with a Preferred size
policy would be treated as fixed size, if mixed with Expanding
items having maximumSize set.
- [QTBUG-33247] Changed accessible trees and tables to always expose
hidden headers, instead of only exposing the visible headers.
- [QTBUG-34007] Fixed a crash in tablet support.
@ -384,18 +403,26 @@ QtWidgets
overriding viewportSizeHint() needs to be recompiled against 5.2 for
this feature to work correctly.
- QButtonGroup:
* [QTBUG-14857] Added buttonToggled() signals.
- QColorDialog:
* Added a web color QLineEdit.
* [QTBUG-14332] Added a screen color picker button.
* [QTBUG-31998] Does no longer create widgets when using the
platform dialog.
* [QTBUG-32054] Fixed a bug with keyboard navigation.
- QComboBox:
* [QTBUG-31146] Fixed selection of items with identical text in
popup completion.
* Added currentData() convenience function which allows to retrieve
the user data set for the current item.
- QCompleter:
* [QTBUG-3414] Added filterMode property.
* The activated() signal now passes invalid indexes instead of
random bogus ones when falling back to the completion prefix.
- QDesktopWidget:
* [QTBUG-32567] Fixed emission of workAreaResized() signal.
@ -434,10 +461,16 @@ QtWidgets
* [QTBUG-33039] Does no longer create widgets when using the
platform dialog.
- QFontComboBox:
* [QTBUG-1573] Made QFontComboBox locale-sensitive.
- QFontDialog:
* Now has finer-grained control over the types of fonts listed,
similar to what QFontComboBox already had.
- QGestureManager
* Now supports Mac OS X native gestures.
- QGraphicsView etc
* Fixed a crash in QGraphicsProxyWidget.
* [QTBUG-8061] Allow handling of mouseDoubleClickEvent in
@ -446,16 +479,30 @@ QtWidgets
Qt::{Contains,Intersets}ItemBoundingRect with items that contain
the point in the bounding rectangle, but not their (custom)
shape.
* [QTBUG-29945] Fixed drop-shadow and blur effects when using a
QGLWidget viewport.
- QGroupBox:
* [QTBUG-33610] The check indicator of a checkable group box is no
longer clipped when using a small title font.
- QHeaderView:
* Reduced memory usage by 33%.
* [QTBUG-4346] A maximumSize for sections has been introduced. The
maximum section size is by default the largest possible section
size which in Qt 5.2 has been limited to 1048575 pixels.
* [QTBUG-32203] Fixed a painting bug involving hidden and reordered
sections.
- QInputDialog:
* Added getMultiLineText static method.
- QLayout:
* Added replaceWidget() function.
- QLineEdit:
* [QTBUG-32061] The cursor is now positioned correctly in an empty
line edit with placeholder text.
* Keep placeholderText visible when focused, until text is added.
* Context-menu actions now have icons.
* Made it possible to add side widgets.
@ -467,28 +514,59 @@ QtWidgets
no longer loses the icon. Also fixed a bug where under certain
conditions code overriding QAbstractItemView::viewOptions() would
not be called.
* [QTBUG-21433] Fixed content size calculation when either
horizontal or vertical scroll bar policy is always off.
- QMacStyle:
* [QTBUG-31668] Fixed a case where multiple auto-default button
animations were running in parallel on OS X
- QMainWindow:
* Added takeCentalWidget() function.
- QMenu:
* Added QMenu::toNSMenu() conversion function (Mac only)
* Added QMenu::setAsDockMenu() and qt_mac_set_doc_menu(QMenu *menu)
functions (Mac only).
* [QTBUG-31664] Moving the mouse over a menu separator now closes
any open sub menus.
- QMenuBar:
* [QTBUG-32807] Menus now close again on second click.
* Added QMenuBar::toNSMenu() conversion function (Mac only)
- QMessageBox:
* May use native message boxes on some platforms now.
* setDetailedText() now works after show().
* [QTBUG-2450] Added setCheckBox() function.
* [QTBUG-6731] It is now possible to select some or all text from a
QMessageBox and copy it to the clipboard.
- QScrollBar:
* Transient scrollbars are now properly shown when starting
two-finger scrolling on OS X.
- QSizePolicy:
* Added a retainSizeWhenHidden attribute.
- QSpinBox:
* Values can now be displayed in different bases
(cf. displayIntegerBase property)
* [QTBUG-31602] Size calculation will now be fixed when stylesheets
are used.
* [QTBUG-31602][QTBUG-34305] Fixed size calculation when
stylesheets are used.
- QSplashScreen:
* Added message(), a getter for the currently displayed message.
- QSplitter:
* Now gets the default value of opaqueResize property from (new)
QStyle::SH_Splitter_OpaqueResize styleHint.
- QStyle:
* Added SH_ToolTip_WakeUpDelay and SH_ToolTip_FallAsleepDelay.
* Fixed SH_ItemView_ActivateItemOnSingleClick not being retrieved
correctly from the platform theme.
- QSystemTrayIcon:
* [QTBUG-31762] Fixed position of system tray icon on Linux/X11
(except Unity).
@ -505,14 +583,26 @@ QtWidgets
* Added placeholderText akin to QLineEdit.
* Context-menu actions now have icons.
- QToolTip:
* Added new showText() overload taking a duration.
- QTreeView:
* QTreeView now has setTreePosition to allow the treestructure to
show data from other columns than logicalindex zero.
* Added setTreePosition() function.
- QWidget:
* Added window{Title,Icon,IconText}Changed() signals.
* Added toolTipDuration property.
- QWindowContainer:
* [QTBUG-32177] Sets active window correctly now.
* [QTBUG-34138] Will not create native child widgets any more.
- QWindowsVistaStyle:
* [QTBUG-26503] Does no longer draw inapplicable scroll bar
grippers on Windows 8.
- QWizard:
* [QTBUG-26722] The default background pixmap works again on OS X.
* [QTBUG-29924] Gave all buttons an objectName().
****************************************************************************
@ -533,10 +623,45 @@ Android
show the status bar (QWindow::showMaximized()). Use
QWindow::showFullScreen() to hide it.
- Implemented support for accessibility on Android.
- Implemented support for native action bar backend for menu bars in
Qt Quick Controls and Qt Widgets.
- Implemented support for native popup menus and comboboxes in Qt Quick
Controls.
- Implemented support for native message boxes in Qt Widgets.
- Several improvements to handling dialogs and multiple top-level
windows in Qt Widgets.
- Implemented automatic inclusion of necessary permissions in manifest
when linking against Qt Multimedia.
- Fixed crash on startup when running on Android 4.4.
- Add requirement for Android SDK version 13 or higher for building
Qt application. Note that this is for building only. The application
can still be targeted for devices with SDK versions 9 and up.
- Default to target SDK version 14 to disable overflow button in
system navigation.
- New module: Qt Android Extras. Contains convenience APIs for using
JNI, and will in the future include support for Android-specific
features which do not fit in a cross-platform API.
- Implemented support for thread-affinity in qrand() functions.
- Fixed several problems with predictive text in soft keyboard.
- Made several improvements to stability.
- Implemented support for camera and low-latency audio in Qt Multimedia.
- Fixed driver-specific bugs in text rendering in Qt Quick 2.
- Added preference in default manifest for installing applications to
external storage if possible.
- Fixed delivery of key press event for the Back key.
- Fixed race condition when showing a window in full screen which would
cause it to not be maximized.
- Fixed input method hints.
- Made font point sizes compatible with the interpretation of point
sizes on iOS to ease sharing code between the two platforms.
- Added support for QAmbientTemperatureSensor, QPressureSensor
and QProximitySensor to Qt Sensors.
- Removed dependency on Qt Widgets in default build of Qt Quick Controls.
OS X
----
- Added QMaxCocoaViewContainer and QMacNativeWidget classes.
- Qt for OS X is now identified by the macro Q_OS_OSX. This complements the
existing Q_OS_DARWIN macro (which identifies the open source kernel and
could identify non-Apple products) and Q_OS_MAC, which is defined for
@ -547,6 +672,17 @@ OS X
supported until official announcement by the Qt Project.
- Added a number of functions to QtCore to convert to and from
CFString/NSString and QString, CFURL/NSURL and QUrl.
- QGestureManager now supports Mac OS X native gestures.
- Added QMenu::setAsDockMenu(), QMenu(Bar)::toNSMenu(),
qt_mac_set_doc_menu() functions.
- [QTBUG-26722] The QWizard default background pixmap works again.
BlackBerry
----------
- Cover windows (aka active frames) are now supported. Cover windows must
have the Qt::CoverWindow flag set. They are shown when the application
is minimized.
Windows
-------

View File

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -28,6 +28,8 @@
/*!
\example books
\title Books
\ingroup sql_examples
\brief Shows how to use Qt SQL classes with a model/view framework.
The Books example shows how Qt's SQL classes can be used with the model/view
framework to create rich user interfaces for information stored in a database.

View File

@ -64,7 +64,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<<
QMAKE_LINK = link
QMAKE_LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT /NODEFAULTLIB:ole32.lib
QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF /INCREMENTAL:NO
QMAKE_LFLAGS_DEBUG = /DEBUG
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS
QMAKE_LFLAGS_EXE = /MANIFEST:NO

View File

@ -29,6 +29,9 @@ QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH)
CONFIG -= no_debug_info separate_debug_info
}
force_debug_info|debug: \
CONFIG += debug_info
force_debug_info {
QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO
@ -69,11 +72,6 @@ silent {
CONFIG = silent $$CONFIG
}
force_debug_info:win32 {
load(resolve_target)
QMAKE_CLEAN += $$replace(QMAKE_RESOLVED_TARGET, ...$, pdb) # for the debug case it is hardcoded in qmake
}
breakpad {
load(resolve_target)
DEBUGFILENAME = $$shell_quote($$shell_path($$QMAKE_RESOLVED_TARGET))

View File

@ -55,6 +55,7 @@ CONFIG += \
create_prl link_prl \
prepare_docs qt_docs_targets \
no_private_qt_headers_warning QTDIR_build \
no_dll \
# Qt modules get compiled without exceptions enabled by default.
# However, testcases should be still built with exceptions.
exceptions_off testcase_exceptions

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -173,6 +173,25 @@ macx-xcode {
ios_device_family.name = TARGETED_DEVICE_FAMILY
ios_device_family.value = $$QMAKE_IOS_TARGETED_DEVICE_FAMILY
QMAKE_MAC_XCODE_SETTINGS += ios_device_family
# Set up default 4-inch iPhone/iPod launch image so that our apps
# support the full screen resolution of those devices.
launch_image = Default-568h@2x.png
copy_image.input = $$QMAKESPEC/$$launch_image
copy_image.output = $$OUT_PWD/$${TARGET}.xcodeproj/$$launch_image
copy_image.CONFIG = verbatim
QMAKE_SUBSTITUTES += copy_image
launch_images.files = $$copy_image.output
QMAKE_BUNDLE_DATA += launch_images
!c++11 {
# Explicitly use libstdc++ if C++11 support is not enabled,
# as otherwise Xcode will choose the compiler default based
# on the deployment target, which for iOS 7 is libc++. This
# breaks compilation since Qt was built against libstdc++.
QMAKE_CXXFLAGS += -stdlib=libstdc++
QMAKE_LFLAGS += -stdlib=libstdc++
}
}
macx-xcode {

View File

@ -52,7 +52,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<<
QMAKE_LINK = link
QMAKE_LFLAGS = /NOLOGO
QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF /INCREMENTAL:NO
QMAKE_LFLAGS_DEBUG = /DEBUG
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS

View File

@ -63,7 +63,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<<
QMAKE_LINK = link
QMAKE_LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT
QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF /INCREMENTAL:NO
QMAKE_LFLAGS_DEBUG = /DEBUG
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS

View File

@ -65,7 +65,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<<
QMAKE_LINK = link
QMAKE_LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT
QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF /INCREMENTAL:NO
QMAKE_LFLAGS_DEBUG = /DEBUG
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS

View File

@ -67,7 +67,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<<
QMAKE_LINK = link
QMAKE_LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT
QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF /INCREMENTAL:NO
QMAKE_LFLAGS_DEBUG = /DEBUG
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS

View File

@ -67,7 +67,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<<
QMAKE_LINK = link
QMAKE_LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT
QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF /INCREMENTAL:NO
QMAKE_LFLAGS_DEBUG = /DEBUG
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS

View File

@ -67,7 +67,7 @@ QMAKE_RUN_CXX_IMP_BATCH = $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fo$@ @<<
QMAKE_LINK = link
QMAKE_LFLAGS = /NOLOGO /DYNAMICBASE /NXCOMPAT
QMAKE_LFLAGS_RELEASE = /INCREMENTAL:NO
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF
QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO = /DEBUG /OPT:REF /INCREMENTAL:NO
QMAKE_LFLAGS_DEBUG = /DEBUG
QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:CONSOLE
QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWS

View File

@ -30,7 +30,7 @@ CFLAGS_EXTRA = /Zc:wchar_t-
CFLAGS_EXTRA = /MP
!endif
CFLAGS_BARE = -c -Fo./ \
CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \
-W3 -nologo -O1 \
$(CFLAGS_EXTRA) \
-I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac -I$(QMKSRC)\generators\integrity \
@ -50,7 +50,7 @@ CXXFLAGS = $(CFLAGS)
LFLAGS =
LIBS = ole32.lib advapi32.lib
LINKQMAKE = $(LINKER) $(LFLAGS) -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS)
ADDCLEAN = vc60.pdb vc70.pdb qmake.pdb qmake.ilk
ADDCLEAN = qmake.pdb qmake.ilk
!ELSE
!ERROR Unsupported compiler for this Makefile
@ -140,8 +140,6 @@ clean::
-del qmake_pch.obj
-del qmake_pch.pch
-del qsystemlibrary.obj
-del vc60.pdb
-del vc70.pdb
-del qmake.pdb
-del qmake.ilk
-del qmake.tds

View File

@ -4161,6 +4161,7 @@
*/
/*!
\target qmake-getting-started
\page qmake-tutorial.html
\title Getting Started
\contentspage {qmake Manual}{Contents}

View File

@ -1314,7 +1314,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
cmd = "-$(INSTALL_FILE)";
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file);
inst << cmd;
if(!project->isActiveConfig("debug") && !project->isActiveConfig("nostrip") &&
if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
!fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP"))
inst << QString("-") + var("QMAKE_STRIP") + " " +
escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + filestr, FileFixifyAbsolute, false)));
@ -1357,7 +1357,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
QString cmd = QString(fi.isDir() ? "-$(INSTALL_DIR)" : "-$(INSTALL_FILE)") + " " +
escapeFilePath(dirstr + file) + " " + escapeFilePath(dst_file);
inst << cmd;
if(!project->isActiveConfig("debug") && !project->isActiveConfig("nostrip") &&
if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") &&
!fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP"))
inst << QString("-") + var("QMAKE_STRIP") + " " +
escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + file, FileFixifyAbsolute, false)));

View File

@ -818,7 +818,8 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
if(project->first("TEMPLATE") == "lib" && project->isActiveConfig("staticlib")) {
if(!project->isEmpty("QMAKE_RANLIB"))
ret += QString("\n\t$(RANLIB) \"") + dst_targ + "\"";
} else if(!project->isActiveConfig("debug") && !project->isActiveConfig("nostrip") && !project->isEmpty("QMAKE_STRIP")) {
} else if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip")
&& !project->isEmpty("QMAKE_STRIP")) {
ret += "\n\t-$(STRIP)";
if (project->first("TEMPLATE") == "lib") {
if (!project->isEmpty("QMAKE_STRIPFLAGS_LIB"))

View File

@ -403,6 +403,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QString incr_lflags = var("QMAKE_LFLAGS_SHLIB") + " ";
if(project->isActiveConfig("debug"))
incr_lflags += var("QMAKE_LFLAGS_DEBUG");
else if (project->isActiveConfig("debug_info"))
incr_lflags += var("QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO");
else
incr_lflags += var("QMAKE_LFLAGS_RELEASE");
t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)\n\t";
@ -498,6 +500,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
incr_lflags += var("QMAKE_LFLAGS_INCREMENTAL") + " ";
if(project->isActiveConfig("debug"))
incr_lflags += var("QMAKE_LFLAGS_DEBUG");
else if (project->isActiveConfig("debug_info"))
incr_lflags += var("QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO");
else
incr_lflags += var("QMAKE_LFLAGS_RELEASE");
t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)\n\t";

View File

@ -253,10 +253,11 @@ QString NmakeMakefileGenerator::defaultInstall(const QString &t)
if(targetdir.right(1) != Option::dir_sep)
targetdir += Option::dir_sep;
if (project->isActiveConfig("debug")) {
if (project->isActiveConfig("debug_info")) {
if (t == "dlltarget"
|| (project->first("TEMPLATE") == "lib"
&& project->isActiveConfig("shared"))) {
|| project->first("TEMPLATE") != "lib"
|| (project->isActiveConfig("shared")
&& project->values(ProKey(t + ".CONFIG")).indexOf("no_dll") == -1)) {
QString pdb_target = getPdbTarget();
pdb_target.remove('"');
QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target;
@ -407,11 +408,15 @@ void NmakeMakefileGenerator::init()
if(project->isActiveConfig("shared")) {
project->values("QMAKE_CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".exp");
}
if(project->isActiveConfig("debug")) {
project->values("QMAKE_DISTCLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".pdb");
if (project->isActiveConfig("debug_info")) {
QString pdbfile = project->first("DESTDIR") + project->first("TARGET") + version + ".pdb";
project->values("QMAKE_CFLAGS").append("/Fd" + pdbfile);
project->values("QMAKE_CXXFLAGS").append("/Fd" + pdbfile);
project->values("QMAKE_DISTCLEAN").append(pdbfile);
}
if (project->isActiveConfig("debug")) {
project->values("QMAKE_CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".ilk");
project->values("QMAKE_CLEAN").append("vc*.pdb");
project->values("QMAKE_CLEAN").append("vc*.idb");
project->values("QMAKE_CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".idb");
} else {
ProStringList &defines = project->values("DEFINES");
if (!defines.contains("NDEBUG"))

View File

@ -932,7 +932,7 @@ void VcprojGenerator::initConfiguration()
if(projectTarget == StaticLib)
initLibrarianTool();
else {
conf.linker.GenerateDebugInformation = isDebug ? _True : _False;
conf.linker.GenerateDebugInformation = project->isActiveConfig("debug_info") ? _True : _False;
initLinkerTool();
}
initManifestTool();

4
src/3rdparty/sha3/KeccakF-1600-opt64.c vendored Executable file → Normal file
View File

@ -328,7 +328,7 @@ static void KeccakPermutation(unsigned char *state)
KeccakPermutationOnWords((UINT64*)state);
}
#if 0 // Unused in the Qt configuration
#if (PLATFORM_BYTE_ORDER == IS_BIG_ENDIAN)
static void fromBytesToWord(UINT64 *word, const UINT8 *bytes)
{
unsigned int i;
@ -449,7 +449,7 @@ static void KeccakAbsorb(unsigned char *state, const unsigned char *data, unsign
#endif
}
#if 0 // Unused in the Qt configuration
#if (PLATFORM_BYTE_ORDER == IS_BIG_ENDIAN)
static void fromWordToBytes(UINT8 *bytes, const UINT64 word)
{
unsigned int i;

View File

@ -1,6 +1,7 @@
CONFIG(release, debug|release):DEFINES *= NDEBUG
DEFINES += SQLITE_OMIT_LOAD_EXTENSION SQLITE_OMIT_COMPLETE SQLITE_ENABLE_FTS3 SQLITE_ENABLE_FTS3_PARENTHESIS SQLITE_ENABLE_RTREE
!contains(CONFIG, largefile):DEFINES += SQLITE_DISABLE_LFS
contains(QT_CONFIG, posix_fallocate):DEFINES += HAVE_POSIX_FALLOCATE=1
winrt: DEFINES += SQLITE_OS_WINRT
INCLUDEPATH += $$PWD/sqlite
SOURCES += $$PWD/sqlite/sqlite3.c

View File

@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<manifest package="org.qtproject.example" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
<application android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="@string/app_name">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="@string/app_name">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"
android:name="org.qtproject.qt5.android.bindings.QtActivity"
android:label="@string/app_name"

View File

@ -26,7 +26,7 @@ qhp.QtCore.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtcore/qtcore.tags
depends += qtgui qtwidgets qtnetwork qtdoc qtquick qtlinguist qtdesigner qtconcurrent qtxml
depends += qtgui qtwidgets qtnetwork qtdoc qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake
headerdirs += ..

View File

@ -76,7 +76,7 @@
#include <CoreServices/CoreServices.h>
#endif
#if defined(Q_OS_ANDROID)
#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
#include <private/qjni_p.h>
#endif
@ -2400,7 +2400,7 @@ typedef uint SeedStorageType;
typedef QThreadStorage<SeedStorageType *> SeedStorage;
Q_GLOBAL_STATIC(SeedStorage, randTLS) // Thread Local Storage for seed value
#elif defined(Q_OS_ANDROID)
#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
typedef QThreadStorage<QJNIObjectPrivate> AndroidRandomStorage;
Q_GLOBAL_STATIC(AndroidRandomStorage, randomTLS)
#endif
@ -2436,7 +2436,7 @@ void qsrand(uint seed)
//global static object, fallback to srand(seed)
srand(seed);
}
#elif defined(Q_OS_ANDROID)
#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
if (randomTLS->hasLocalData()) {
randomTLS->localData().callMethod<void>("setSeed", "(J)V", jlong(seed));
return;
@ -2492,7 +2492,7 @@ int qrand()
//global static object, fallback to rand()
return rand();
}
#elif defined(Q_OS_ANDROID)
#elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_NO_SDK)
AndroidRandomStorage *randomStorage = randomTLS();
if (!randomStorage)
return rand();

View File

@ -85,10 +85,10 @@ static QString driveSpec(const QString &path)
//************* QDirPrivate
QDirPrivate::QDirPrivate(const QString &path, const QStringList &nameFilters_, QDir::SortFlags sort_, QDir::Filters filters_)
: QSharedData()
, fileListsInitialized(false)
, nameFilters(nameFilters_)
, sort(sort_)
, filters(filters_)
, fileListsInitialized(false)
{
setPath(path.isEmpty() ? QString::fromLatin1(".") : path);
@ -108,10 +108,10 @@ QDirPrivate::QDirPrivate(const QString &path, const QStringList &nameFilters_, Q
QDirPrivate::QDirPrivate(const QDirPrivate &copy)
: QSharedData(copy)
, fileListsInitialized(false)
, nameFilters(copy.nameFilters)
, sort(copy.sort)
, filters(copy.filters)
, fileListsInitialized(false)
, dirEntry(copy.dirEntry)
, metaData(copy.metaData)
{

View File

@ -73,16 +73,16 @@ public:
void resolveAbsoluteEntry() const;
mutable bool fileListsInitialized;
mutable QStringList files;
mutable QFileInfoList fileInfos;
QStringList nameFilters;
QDir::SortFlags sort;
QDir::Filters filters;
QScopedPointer<QAbstractFileEngine> fileEngine;
mutable bool fileListsInitialized;
mutable QStringList files;
mutable QFileInfoList fileInfos;
QFileSystemEntry dirEntry;
mutable QFileSystemEntry absoluteDirEntry;
mutable QFileSystemMetaData metaData;

View File

@ -53,9 +53,9 @@ QT_BEGIN_NAMESPACE
static const int QFILE_WRITEBUFFER_SIZE = 16384;
QFileDevicePrivate::QFileDevicePrivate()
: fileEngine(0), lastWasWrite(false),
writeBuffer(QFILE_WRITEBUFFER_SIZE), error(QFile::NoError),
cachedSize(0)
: fileEngine(0),
writeBuffer(QFILE_WRITEBUFFER_SIZE), cachedSize(0),
error(QFile::NoError), lastWasWrite(false)
{
}

View File

@ -70,21 +70,22 @@ protected:
virtual QAbstractFileEngine *engine() const;
QFileDevice::FileHandleFlags handleFlags;
mutable QAbstractFileEngine *fileEngine;
bool lastWasWrite;
QRingBuffer writeBuffer;
inline bool ensureFlushed() const;
bool putCharHelper(char c);
QFileDevice::FileError error;
void setError(QFileDevice::FileError err);
void setError(QFileDevice::FileError err, const QString &errorString);
void setError(QFileDevice::FileError err, int errNum);
mutable QAbstractFileEngine *fileEngine;
QRingBuffer writeBuffer;
mutable qint64 cachedSize;
QFileDevice::FileHandleFlags handleFlags;
QFileDevice::FileError error;
bool lastWasWrite;
};
inline bool QFileDevicePrivate::ensureFlushed() const

View File

@ -88,6 +88,21 @@ class QTextStreamPrivate
{
Q_DECLARE_PUBLIC(QTextStream)
public:
// streaming parameters
class Params
{
public:
void reset();
int realNumberPrecision;
int integerBase;
int fieldWidth;
QChar padChar;
QTextStream::FieldAlignment fieldAlignment;
QTextStream::RealNumberNotation realNumberNotation;
QTextStream::NumberFlags numberFlags;
};
QTextStreamPrivate(QTextStream *q_ptr);
~QTextStreamPrivate();
void reset();
@ -97,7 +112,6 @@ public:
#ifndef QT_NO_QOBJECT
QDeviceClosedNotifier deviceClosedNotifier;
#endif
bool deleteDevice;
// string
QString *string;
@ -110,6 +124,24 @@ public:
QTextCodec::ConverterState readConverterState;
QTextCodec::ConverterState writeConverterState;
QTextCodec::ConverterState *readConverterSavedState;
#endif
QString writeBuffer;
QString readBuffer;
int readBufferOffset;
int readConverterSavedStateOffset; //the offset between readBufferStartDevicePos and that start of the buffer
qint64 readBufferStartDevicePos;
Params params;
// status
QTextStream::Status status;
QLocale locale;
QTextStream *q_ptr;
int lastTokenSize;
bool deleteDevice;
#ifndef QT_NO_TEXTCODEC
bool autoDetectUnicode;
#endif
@ -128,7 +160,6 @@ public:
inline void consume(int nchars);
void saveConverterState(qint64 newPos);
void restoreToSavedConverterState();
int lastTokenSize;
// Return value type for getNumber()
enum NumberParsingStatus {
@ -150,34 +181,6 @@ public:
bool fillReadBuffer(qint64 maxBytes = -1);
void resetReadBuffer();
void flushWriteBuffer();
QString writeBuffer;
QString readBuffer;
int readBufferOffset;
int readConverterSavedStateOffset; //the offset between readBufferStartDevicePos and that start of the buffer
qint64 readBufferStartDevicePos;
// streaming parameters
class Params
{
public:
void reset();
int realNumberPrecision;
int integerBase;
int fieldWidth;
QChar padChar;
QTextStream::FieldAlignment fieldAlignment;
QTextStream::RealNumberNotation realNumberNotation;
QTextStream::NumberFlags numberFlags;
};
Params params;
// status
QTextStream::Status status;
QLocale locale;
QTextStream *q_ptr;
};
QT_END_NAMESPACE

View File

@ -783,6 +783,8 @@ QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const
/*!
\class QJsonObject::const_iterator
\inmodule QtCore
\ingroup json
\since 5.0
\brief The QJsonObject::const_iterator class provides an STL-style const iterator for QJsonObject.
QJsonObject::const_iterator allows you to iterate over a QJsonObject.

View File

@ -1949,7 +1949,7 @@ void QObjectPrivate::setParent_helper(QObject *o)
}
}
}
if (!isDeletingChildren && declarativeData && QAbstractDeclarativeData::parentChanged)
if (!wasDeleted && !isDeletingChildren && declarativeData && QAbstractDeclarativeData::parentChanged)
QAbstractDeclarativeData::parentChanged(declarativeData, q, o);
}

View File

@ -109,6 +109,6 @@
the required plugins to your build. For example:
\snippet code/doc_src_qplugin.pro 3
\sa {Static Plugins}, {How to Create Qt Plugins}, {qmake-getting-started}{Getting Started with qmake}
\sa {Static Plugins}, {How to Create Qt Plugins}, {Using qmake}
*/

View File

@ -49,9 +49,9 @@
iterators they accept. For example, qFill() accepts two
\l {forward iterators}. The iterator types required are specified
for each algorithm. If an iterator of the wrong type is passed (for
example, if QList::ConstIterator is passed as an \l {output
iterator}), you will always get a compiler error, although not
necessarily a very informative one.
example, if QList::ConstIterator is passed as an
\l {Output Iterators}{output iterator}), you will always get a
compiler error, although not necessarily a very informative one.
Some algorithms have special requirements on the value type
stored in the containers. For example,
@ -99,7 +99,7 @@
\section2 Output Iterators
An \e{output iterator} is an iterator that can be used for
An output iterator is an iterator that can be used for
writing data sequentially to a container or to some output
stream. It must provide the following operators: unary \c{*} for
writing a value (i.e., \c{*it = val}) and prefix \c{++} for

View File

@ -432,14 +432,14 @@ struct BezierEase : public QEasingCurveFunction
qreal p3x, p3y;
};
QVector<SingleCubicBezier> _curves;
QVector<qreal> _intervals;
int _curveCount;
bool _init;
bool _valid;
QVector<SingleCubicBezier> _curves;
int _curveCount;
QVector<qreal> _intervals;
BezierEase()
: QEasingCurveFunction(InOut), _init(false), _valid(false), _curves(10), _intervals(10)
: QEasingCurveFunction(InOut), _curves(10), _intervals(10), _init(false), _valid(false)
{ }
void init()

View File

@ -60,7 +60,7 @@ static const char ppsRegionLocalePath[] = "/pps/services/locale/settings";
static const char ppsLanguageLocalePath[] = "/pps/services/confstr/_CS_LOCALE";
static const char ppsHourFormatPath[] = "/pps/system/settings";
static const size_t ppsBufferSize = 256;
static const int MAX_PPS_SIZE = 16000;
QBBSystemLocaleData::QBBSystemLocaleData()
: languageNotifier(0)
@ -186,9 +186,24 @@ QByteArray QBBSystemLocaleData::readPpsValue(const char *ppsObject, int ppsFd)
if (!ppsObject || ppsFd == -1)
return result;
char buffer[ppsBufferSize];
// PPS objects are of unknown size, but must be read all at once.
// Relying on the file size may not be a good idea since the size may change before reading.
// Let's try with an initial size (512), and if the buffer is too small try with bigger one,
// until we succeed or until other non buffer-size-related error occurs.
// Using QVarLengthArray means the first try (of size == 512) uses a buffer on the stack - no allocation necessary.
// Hopefully that covers most use cases.
int bytes;
QVarLengthArray<char, 512> buffer;
for (;;) {
errno = 0;
bytes = qt_safe_read(ppsFd, buffer.data(), buffer.capacity() - 1);
const bool bufferIsTooSmall = (bytes == -1 && errno == EMSGSIZE && buffer.capacity() < MAX_PPS_SIZE);
if (!bufferIsTooSmall)
break;
buffer.resize(qMin(buffer.capacity()*2, MAX_PPS_SIZE));
}
int bytes = qt_safe_read(ppsFd, buffer, ppsBufferSize - 1);
// This method is called in the ctor(), so do not use qWarning to log warnings
// if qt_safe_read fails to read the pps file
// since the user code may install a message handler that invokes QLocale API again
@ -202,7 +217,7 @@ QByteArray QBBSystemLocaleData::readPpsValue(const char *ppsObject, int ppsFd)
pps_decoder_t ppsDecoder;
pps_decoder_initialize(&ppsDecoder, 0);
if (pps_decoder_parse_pps_str(&ppsDecoder, buffer) == PPS_DECODER_OK) {
if (pps_decoder_parse_pps_str(&ppsDecoder, buffer.data()) == PPS_DECODER_OK) {
pps_decoder_push(&ppsDecoder, 0);
const char *ppsBuff;
if (pps_decoder_get_string(&ppsDecoder, ppsObject, &ppsBuff) == PPS_DECODER_OK) {

View File

@ -1045,12 +1045,12 @@ public:
#endif
private:
uint c; // character classes
QVector<QRegExpCharClassRange> r; // character ranges
bool n; // negative?
#ifndef QT_NO_REGEXP_OPTIM
QVector<int> occ1; // first-occurrence array
#endif
uint c; // character classes
bool n; // negative?
};
#else
struct QRegExpCharClass

View File

@ -813,8 +813,9 @@ struct QRegularExpressionPrivate : QSharedData
int captureIndexForName(const QString &name) const;
QString pattern;
// sizeof(QSharedData) == 4, so start our members with an enum
QRegularExpression::PatternOptions patternOptions;
QString pattern;
// *All* of the following members are set managed while holding this mutex,
// except for isDirty which is set to true by QRegularExpression setters
@ -889,7 +890,7 @@ QRegularExpression::QRegularExpression(QRegularExpressionPrivate &dd)
\internal
*/
QRegularExpressionPrivate::QRegularExpressionPrivate()
: pattern(), patternOptions(0),
: patternOptions(0), pattern(),
mutex(),
compiledPattern(0), studyData(0),
errorString(0), errorOffset(-1),
@ -919,7 +920,7 @@ QRegularExpressionPrivate::~QRegularExpressionPrivate()
*/
QRegularExpressionPrivate::QRegularExpressionPrivate(const QRegularExpressionPrivate &other)
: QSharedData(other),
pattern(other.pattern), patternOptions(other.patternOptions),
patternOptions(other.patternOptions), pattern(other.pattern),
mutex(),
compiledPattern(0), studyData(0),
errorString(0),

View File

@ -53,13 +53,17 @@ class QTimeLinePrivate : public QObjectPrivate
Q_DECLARE_PUBLIC(QTimeLine)
public:
inline QTimeLinePrivate()
: startTime(0), duration(1000), startFrame(0), endFrame(0),
: easingCurve(QEasingCurve::InOutSine),
startTime(0), duration(1000), startFrame(0), endFrame(0),
updateInterval(1000 / 25),
totalLoopCount(1), currentLoopCount(0), currentTime(0), timerId(0),
direction(QTimeLine::Forward), easingCurve(QEasingCurve::InOutSine),
direction(QTimeLine::Forward),
state(QTimeLine::NotRunning)
{ }
QElapsedTimer timer;
QEasingCurve easingCurve;
int startTime;
int duration;
int startFrame;
@ -70,10 +74,8 @@ public:
int currentTime;
int timerId;
QElapsedTimer timer;
QTimeLine::Direction direction;
QEasingCurve easingCurve;
QTimeLine::State state;
inline void setState(QTimeLine::State newState)
{

View File

@ -596,9 +596,11 @@ QUtcTimeZonePrivate::QUtcTimeZonePrivate(const QByteArray &zoneId, int offsetSec
}
QUtcTimeZonePrivate::QUtcTimeZonePrivate(const QUtcTimeZonePrivate &other)
: QTimeZonePrivate(other), m_offsetFromUtc(other.m_offsetFromUtc), m_name(other.m_name),
m_abbreviation(other.m_abbreviation), m_country(other.m_country),
m_comment(other.m_comment)
: QTimeZonePrivate(other), m_name(other.m_name),
m_abbreviation(other.m_abbreviation),
m_comment(other.m_comment),
m_country(other.m_country),
m_offsetFromUtc(other.m_offsetFromUtc)
{
}

View File

@ -203,11 +203,11 @@ private:
const QString &abbreviation, QLocale::Country country,
const QString &comment);
int m_offsetFromUtc;
QString m_name;
QString m_abbreviation;
QLocale::Country m_country;
QString m_comment;
QLocale::Country m_country;
int m_offsetFromUtc;
};
#ifdef QT_USE_ICU

View File

@ -727,6 +727,12 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
Example:
\snippet code/src_gui_kernel_qevent.cpp 0
\note On platforms that support scrolling \l{phase()}{phases}, the delta may be null when:
\list
\li scrolling is about to begin, but the distance did not yet change (Qt::ScrollBegin),
\li or scrolling has ended and the distance did not change anymore (Qt::ScrollEnd).
\endlist
*/
/*!
@ -749,6 +755,12 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
Example:
\snippet code/src_gui_kernel_qevent.cpp 0
\note On platforms that support scrolling \l{phase()}{phases}, the delta may be null when:
\list
\li scrolling is about to begin, but the distance did not yet change (Qt::ScrollBegin),
\li or scrolling has ended and the distance did not change anymore (Qt::ScrollEnd).
\endlist
*/
/*!
@ -848,6 +860,9 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
\since 5.2
Returns the scrolling phase of this wheel event.
\note The Qt::ScrollBegin and Qt::ScrollEnd phases are currently
supported only on Mac OS X.
*/
@ -2281,6 +2296,7 @@ QTabletEvent::~QTabletEvent()
#endif // QT_NO_TABLETEVENT
#ifndef QT_NO_GESTURES
/*!
\class QNativeGestureEvent
\since 5.2
@ -2395,6 +2411,7 @@ QNativeGestureEvent::QNativeGestureEvent(Qt::NativeGestureType type, const QPoin
Returns the position of the gesture as a QPointF, relative to the
window that received the event.
*/
#endif // QT_NO_GESTURES
#ifndef QT_NO_DRAGANDDROP
/*!

View File

@ -238,7 +238,7 @@ static const char* const qopenglslPositionWithRadialGradientBrushVertexShader =
uniform mediump vec2 halfViewportSize; \n\
uniform highp mat3 brushTransform; \n\
uniform highp vec2 fmp; \n\
uniform highp vec3 bradius; \n\
uniform mediump vec3 bradius; \n\
varying highp float b; \n\
varying highp vec2 A; \n\
void setPosition(void) \n\
@ -264,7 +264,7 @@ static const char* const qopenglslRadialGradientBrushSrcFragmentShader = "\n\
uniform highp float sqrfr; \n\
varying highp float b; \n\
varying highp vec2 A; \n\
uniform highp vec3 bradius; \n\
uniform mediump vec3 bradius; \n\
lowp vec4 srcPixel() \n\
{ \n\
highp float c = sqrfr-dot(A, A); \n\

View File

@ -2878,6 +2878,10 @@ QFixed QTextEngine::calculateTabWidth(int item, QFixed x) const
if (item.position > tabSectionEnd || item.position <= si.position)
continue;
shape(i); // first, lets make sure relevant text is already shaped
if (item.analysis.flags == QScriptAnalysis::Object) {
length += item.width;
continue;
}
QGlyphLayout glyphs = this->shapedGlyphs(&item);
const int end = qMin(item.position + item.num_glyphs, tabSectionEnd) - item.position;
for (int i=0; i < end; i++)

View File

@ -36,7 +36,7 @@
the Secure Sockets Layer (SSL) protocol, using the OpenSSL Toolkit (\l{http://www.openssl.org/})
to perform encryption and protocol handling.
See the \l{General Qt Requirements} page for information about the
See the \l {openssl-v1later}{OpenSSL Compatibility} page for information about the
versions of OpenSSL that are known to work with Qt.
\section1 Enabling and Disabling SSL Support

View File

@ -238,7 +238,7 @@ static const char* const qglslPositionWithRadialGradientBrushVertexShader = "\n\
uniform mediump vec2 halfViewportSize; \n\
uniform highp mat3 brushTransform; \n\
uniform highp vec2 fmp; \n\
uniform highp vec3 bradius; \n\
uniform mediump vec3 bradius; \n\
varying highp float b; \n\
varying highp vec2 A; \n\
void setPosition(void) \n\
@ -264,7 +264,7 @@ static const char* const qglslRadialGradientBrushSrcFragmentShader = "\n\
uniform highp float sqrfr; \n\
varying highp float b; \n\
varying highp vec2 A; \n\
uniform highp vec3 bradius; \n\
uniform mediump vec3 bradius; \n\
lowp vec4 srcPixel() \n\
{ \n\
highp float c = sqrfr-dot(A, A); \n\

View File

@ -56,7 +56,7 @@ public:
QPlatformIntegration *QAndroidPlatformIntegrationPlugin::create(const QString &key, const QStringList &paramList)
{
Q_UNUSED(paramList);
if (key.toLower() == "android")
if (!key.compare(QLatin1String("android"), Qt::CaseInsensitive))
return new QAndroidPlatformIntegration(paramList);
return 0;
}

View File

@ -59,8 +59,8 @@
QT_BEGIN_NAMESPACE
static QAndroidInputContext *m_androidInputContext = 0;
static char const *const QtNativeInputConnectionClassName = "org/qtproject/qt5/android/QtNativeInputConnection";
static char const *const QtExtractedTextClassName = "org/qtproject/qt5/android/QtExtractedText";
static char const *const QtNativeInputConnectionClassName = "org.qtproject.qt5.android.QtNativeInputConnection";
static char const *const QtExtractedTextClassName = "org.qtproject.qt5.android.QtExtractedText";
static jclass m_extractedTextClass = 0;
static jmethodID m_classConstructorMethodID = 0;
static jfieldID m_partialEndOffsetFieldID = 0;

View File

@ -184,7 +184,7 @@ static JNINativeMethod methods[] = {
bool registerNatives(JNIEnv *env)
{
jclass clazz = QtAndroid::findClass("org/qtproject/qt5/android/QtMessageDialogHelper", env);
jclass clazz = QtAndroid::findClass("org.qtproject.qt5.android.QtMessageDialogHelper", env);
if (!clazz) {
__android_log_print(ANDROID_LOG_FATAL, QtAndroid::qtTagText(), QtAndroid::classErrorMsgFmt()
, "org/qtproject/qt5/android/QtMessageDialogHelper");

View File

@ -61,8 +61,7 @@ QPlatformIntegration * QCocoaIntegrationPlugin::create(const QString& system, co
Q_UNUSED(paramList);
QCocoaAutoReleasePool pool;
if (system.toLower() == "cocoa")
if (!system.compare(QLatin1String("cocoa"), Qt::CaseInsensitive))
return new QCocoaIntegration;
return 0;

View File

@ -75,6 +75,8 @@ public:
bool isSharing() const;
bool isValid() const;
void windowWasHidden();
private:
void setActiveWindow(QWindow *window);
void updateSurfaceFormat();

View File

@ -165,6 +165,16 @@ QSurfaceFormat QCocoaGLContext::format() const
return m_format;
}
void QCocoaGLContext::windowWasHidden()
{
// If the window is hidden, we need to unset the m_currentWindow
// variable so that succeeding makeCurrent's will not abort prematurely
// because of the optimization in setActiveWindow.
// Doing a full doneCurrent here is not preferable, because the GL context
// might be rendering in a different thread at this time.
m_currentWindow.clear();
}
void QCocoaGLContext::swapBuffers(QPlatformSurface *surface)
{
QWindow *window = static_cast<QCocoaWindow *>(surface)->window();

View File

@ -388,6 +388,8 @@ void QCocoaWindow::setVisible(bool visible)
[m_contentView setHidden:NO];
} else {
// qDebug() << "close" << this;
if (m_glContext)
m_glContext->windowWasHidden();
if (m_nsWindow) {
if (m_hasModalSession) {
QCocoaEventDispatcher *cocoaEventDispatcher = qobject_cast<QCocoaEventDispatcher *>(QGuiApplication::instance()->eventDispatcher());

View File

@ -40,8 +40,7 @@
****************************************************************************/
#include "qprintengine_mac_p.h"
#include <qdebug.h>
#include <qthread.h>
#include <quuid.h>
#include <QtCore/qcoreapplication.h>
#include <qpa/qplatformprintersupport.h>
@ -141,30 +140,51 @@ QMacPrintEnginePrivate::~QMacPrintEnginePrivate()
void QMacPrintEnginePrivate::setPaperSize(QPrinter::PaperSize ps)
{
Q_Q(QMacPrintEngine);
QSizeF newSize = QPlatformPrinterSupport::convertPaperSizeToQSizeF(ps);
QCFType<CFArrayRef> formats;
if (hasCustomPaperSize) {
PMRelease(customPaper);
customPaper = 0;
}
hasCustomPaperSize = (ps == QPrinter::Custom);
PMPrinter printer;
if (PMSessionGetCurrentPrinter(session(), &printer) == noErr
&& PMSessionCreatePageFormatList(session(), printer, &formats) == noErr) {
CFIndex total = CFArrayGetCount(formats);
PMPageFormat tmp;
PMRect paper;
for (CFIndex idx = 0; idx < total; ++idx) {
tmp = static_cast<PMPageFormat>(
const_cast<void *>(CFArrayGetValueAtIndex(formats, idx)));
PMGetUnadjustedPaperRect(tmp, &paper);
int wMM = int((paper.right - paper.left) / 72 * 25.4 + 0.5);
int hMM = int((paper.bottom - paper.top) / 72 * 25.4 + 0.5);
if (newSize.width() == wMM && newSize.height() == hMM) {
PMCopyPageFormat(tmp, format());
// reset the orientation and resolution as they are lost in the copy.
q->setProperty(QPrintEngine::PPK_Orientation, orient);
if (PMSessionValidatePageFormat(session(), format(), kPMDontWantBoolean) != noErr) {
// Don't know, warn for the moment.
qWarning("QMacPrintEngine, problem setting format and resolution for this page size");
if (PMSessionGetCurrentPrinter(session(), &printer) == noErr) {
if (ps != QPrinter::Custom) {
QSizeF newSize = QPlatformPrinterSupport::convertPaperSizeToQSizeF(ps);
QCFType<CFArrayRef> formats;
if (PMSessionCreatePageFormatList(session(), printer, &formats) == noErr) {
CFIndex total = CFArrayGetCount(formats);
PMPageFormat tmp;
PMRect paper;
for (CFIndex idx = 0; idx < total; ++idx) {
tmp = static_cast<PMPageFormat>(const_cast<void *>(CFArrayGetValueAtIndex(formats, idx)));
PMGetUnadjustedPaperRect(tmp, &paper);
int wMM = int((paper.right - paper.left) / 72 * 25.4 + 0.5);
int hMM = int((paper.bottom - paper.top) / 72 * 25.4 + 0.5);
if (newSize.width() == wMM && newSize.height() == hMM) {
PMCopyPageFormat(tmp, format());
// reset the orientation and resolution as they are lost in the copy.
q->setProperty(QPrintEngine::PPK_Orientation, orient);
if (PMSessionValidatePageFormat(session(), format(), kPMDontWantBoolean) != noErr) {
// Don't know, warn for the moment.
qWarning("QMacPrintEngine, problem setting format and resolution for this page size");
}
break;
}
}
break;
}
} else {
QCFString paperId = QCFString::toCFStringRef(QUuid::createUuid().toString());
PMPaperMargins paperMargins;
paperMargins.left = leftMargin;
paperMargins.top = topMargin;
paperMargins.right = rightMargin;
paperMargins.bottom = bottomMargin;
PMPaperCreateCustom(printer, paperId, QCFString("Custom size"), customSize.width(), customSize.height(), &paperMargins, &customPaper);
PMPageFormat tmp;
PMCreatePageFormatWithPMPaper(&tmp, customPaper);
PMCopyPageFormat(tmp, format());
if (PMSessionValidatePageFormat(session(), format(), kPMDontWantBoolean) != noErr) {
// Don't know, warn for the moment.
qWarning("QMacPrintEngine, problem setting paper name");
}
}
}
@ -183,6 +203,11 @@ QPrinter::PaperSize QMacPrintEnginePrivate::paperSize() const
void QMacPrintEnginePrivate::setPaperName(const QString &name)
{
Q_Q(QMacPrintEngine);
if (hasCustomPaperSize) {
PMRelease(customPaper);
customPaper = 0;
hasCustomPaperSize = false;
}
PMPrinter printer;
if (PMSessionGetCurrentPrinter(session(), &printer) == noErr) {
@ -419,6 +444,8 @@ void QMacPrintEnginePrivate::releaseSession()
{
PMSessionEndPageNoDialog(session());
PMSessionEndDocumentNoDialog(session());
if (hasCustomPaperSize)
PMRelease(customPaper);
[printInfo release];
printInfo = 0;
}
@ -665,10 +692,10 @@ void QMacPrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &va
{
PMOrientation orientation;
PMGetOrientation(d->format(), &orientation);
d->hasCustomPaperSize = true;
d->customSize = value.toSizeF();
if (orientation != kPMPortrait)
d->customSize = QSizeF(d->customSize.height(), d->customSize.width());
d->setPaperSize(QPrinter::Custom);
break;
}
case PPK_PageMargins:

View File

@ -135,6 +135,7 @@ public:
qreal rightMargin;
qreal bottomMargin;
QHash<QMacPrintEngine::PrintEnginePropertyKey, QVariant> valueCache;
PMPaper customPaper;
QMacPrintEnginePrivate() : mode(QPrinter::ScreenResolution), state(QPrinter::Idle),
orient(QPrinter::Portrait), printInfo(0), paintEngine(0),
hasCustomPaperSize(false), hasCustomPageMargins(false) {}

View File

@ -68,7 +68,7 @@ QPlatformIntegration * QDirectFbIntegrationPlugin::create(const QString& system,
Q_UNUSED(paramList);
QDirectFbIntegration *integration = 0;
if (system.toLower() == "directfb")
if (!system.compare(QLatin1String("directfb"), Qt::CaseInsensitive))
integration = new QDirectFbIntegration;
QT_EGL_BACKEND_CREATE(system, integration)

View File

@ -55,7 +55,7 @@ public:
QPlatformIntegration* QEglFSIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
if (system.toLower() == "eglfs")
if (!system.compare(QLatin1String("eglfs"), Qt::CaseInsensitive))
return new QEglFSIntegration;
return 0;

View File

@ -56,7 +56,7 @@ class QIOSIntegrationPlugin : public QPlatformIntegrationPlugin
QPlatformIntegration * QIOSIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
if (system.toLower() == "ios")
if (!system.compare(QLatin1String("ios"), Qt::CaseInsensitive))
return new QIOSIntegration;
return 0;

View File

@ -41,9 +41,14 @@
#include "qiosapplicationdelegate.h"
#include "qiosintegration.h"
#include "qiosservices.h"
#include "qiosviewcontroller.h"
#include "qioswindow.h"
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatformintegration.h>
#include <QtCore/QtCore>
@implementation QIOSApplicationDelegate
@ -82,6 +87,21 @@
return YES;
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
Q_UNUSED(application);
Q_UNUSED(sourceApplication);
Q_UNUSED(annotation);
if (!QGuiApplication::instance())
return NO;
QIOSIntegration *iosIntegration = static_cast<QIOSIntegration *>(QGuiApplicationPrivate::platformIntegration());
QIOSServices *iosServices = static_cast<QIOSServices *>(iosIntegration->services());
return iosServices->handleUrl(QUrl::fromNSURL(url));
}
- (void)dealloc
{
[window release];

View File

@ -189,6 +189,9 @@ void QIOSScreen::updateProperties()
void QIOSScreen::updateStatusBarVisibility()
{
if (!isQtApplication())
return;
QWindow *focusWindow = QGuiApplication::focusWindow();
// If we don't have a focus window we leave the status
@ -199,20 +202,26 @@ void QIOSScreen::updateStatusBarVisibility()
return;
UIView *view = reinterpret_cast<UIView *>(focusWindow->handle()->winId());
QIOSViewController *viewController = static_cast<QIOSViewController *>(view.viewController);
bool currentStatusBarVisibility = [UIApplication sharedApplication].statusBarHidden;
if (viewController.prefersStatusBarHidden == currentStatusBarVisibility)
return;
#if QT_IOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__IPHONE_7_0)
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_IOS_7_0) {
[view.viewController setNeedsStatusBarAppearanceUpdate];
[viewController setNeedsStatusBarAppearanceUpdate];
dispatch_async(dispatch_get_main_queue(), ^{
updateProperties();
});
} else
#endif
{
bool wasHidden = [UIApplication sharedApplication].statusBarHidden;
QIOSViewController *viewController = static_cast<QIOSViewController *>(view.viewController);
[[UIApplication sharedApplication]
setStatusBarHidden:[viewController prefersStatusBarHidden]
withAnimation:UIStatusBarAnimationNone];
if ([UIApplication sharedApplication].statusBarHidden != wasHidden)
updateProperties();
updateProperties();
}
}

View File

@ -41,6 +41,8 @@
#ifndef QIOSSERVICES_H
#define QIOSSERVICES_H
#include <qurl.h>
#include <qpa/qplatformservices.h>
QT_BEGIN_NAMESPACE
@ -50,6 +52,11 @@ class QIOSServices : public QPlatformServices
public:
bool openUrl(const QUrl &url);
bool openDocument(const QUrl &url);
bool handleUrl(const QUrl &url);
private:
QUrl m_handlingUrl;
};
QT_END_NAMESPACE

View File

@ -42,6 +42,7 @@
#include "qiosservices.h"
#include <QtCore/qurl.h>
#include <QtGui/qdesktopservices.h>
#import <UIKit/UIApplication.h>
@ -49,6 +50,9 @@ QT_BEGIN_NAMESPACE
bool QIOSServices::openUrl(const QUrl &url)
{
if (url == m_handlingUrl)
return false;
if (url.scheme().isEmpty())
return openDocument(url);
@ -66,4 +70,19 @@ bool QIOSServices::openDocument(const QUrl &url)
return QPlatformServices::openDocument(url);
}
/* Callback from iOS that the application should handle a URL */
bool QIOSServices::handleUrl(const QUrl &url)
{
QUrl previouslyHandling = m_handlingUrl;
m_handlingUrl = url;
// FIXME: Add platform services callback from QDesktopServices::setUrlHandler
// so that we can warn the user if calling setUrlHandler without also setting
// up the matching keys in the Info.plist file (CFBundleURLTypes and friends).
bool couldHandle = QDesktopServices::openUrl(url);
m_handlingUrl = previouslyHandling;
return couldHandle;
}
QT_END_NAMESPACE

View File

@ -74,6 +74,8 @@ public:
void handleContentOrientationChange(Qt::ScreenOrientation orientation);
void setVisible(bool visible);
bool isExposed() const Q_DECL_OVERRIDE;
void raise() { raiseOrLower(true); }
void lower() { raiseOrLower(false); }
void requestActivateWindow();

View File

@ -449,10 +449,18 @@ QT_BEGIN_NAMESPACE
QIOSWindow::QIOSWindow(QWindow *window)
: QPlatformWindow(window)
, m_view([[QUIView alloc] initWithQIOSWindow:this])
, m_normalGeometry(QPlatformWindow::geometry())
, m_windowLevel(0)
{
setParent(QPlatformWindow::parent());
// Resolve default window geometry in case it was not set before creating the
// platform window. This picks up eg. minimum-size if set, and defaults to
// the "maxmized" geometry (even though we're not in that window state).
// FIXME: Detect if we apply a maximized geometry and send a window state
// change event in that case.
m_normalGeometry = initialGeometry(window, QPlatformWindow::geometry(),
screen()->availableGeometry().width(), screen()->availableGeometry().height());
setWindowState(window->windowState());
}
@ -579,6 +587,11 @@ void QIOSWindow::applyGeometry(const QRect &rect)
[m_view layoutIfNeeded];
}
bool QIOSWindow::isExposed() const
{
return window()->isVisible() && !window()->geometry().isEmpty();
}
void QIOSWindow::setWindowState(Qt::WindowState state)
{
// Update the QWindow representation straight away, so that

View File

@ -55,7 +55,7 @@ public:
QPlatformIntegration *QKmsIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
if (system.toLower() == "kms")
if (!system.compare(QLatin1String("kms"), Qt::CaseInsensitive))
return new QKmsIntegration;
return 0;

View File

@ -55,7 +55,7 @@ public:
QPlatformIntegration* QLinuxFbIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
if (system.toLower() == "linuxfb")
if (!system.compare(QLatin1String("linuxfb"), Qt::CaseInsensitive))
return new QLinuxFbIntegration(paramList);
return 0;

View File

@ -55,9 +55,8 @@ public:
QPlatformIntegration *QMinimalIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
if (system.toLower() == "minimal")
return new QMinimalIntegration;
if (!system.compare(QLatin1String("minimal"), Qt::CaseInsensitive))
return new QMinimalIntegration(paramList);
return 0;
}

View File

@ -41,6 +41,7 @@
#include "qminimalbackingstore.h"
#include "qminimalintegration.h"
#include "qscreen.h"
#include <QtCore/qdebug.h>
#include <qpa/qplatformscreen.h>
@ -49,10 +50,9 @@
QT_BEGIN_NAMESPACE
QMinimalBackingStore::QMinimalBackingStore(QWindow *window)
: QPlatformBackingStore(window),mDebug(false)
: QPlatformBackingStore(window)
, mDebug(QMinimalIntegration::instance()->options() & QMinimalIntegration::DebugBackingStore)
{
if (QT_PREPEND_NAMESPACE(qgetenv)("QT_DEBUG_BACKINGSTORE").toInt() > 0)
mDebug = true;
if (mDebug)
qDebug() << "QMinimalBackingStore::QMinimalBackingStore:" << (quintptr)this;
}

View File

@ -60,7 +60,7 @@ public:
private:
QImage mImage;
bool mDebug;
const bool mDebug;
};
QT_END_NAMESPACE

View File

@ -45,6 +45,7 @@
#include <QtGui/private/qpixmap_raster_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatformwindow.h>
#include <qpa/qplatformfontdatabase.h>
#if !defined(Q_OS_WIN)
#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
@ -56,8 +57,27 @@
QT_BEGIN_NAMESPACE
QMinimalIntegration::QMinimalIntegration()
static const char debugBackingStoreEnvironmentVariable[] = "QT_DEBUG_BACKINGSTORE";
static inline unsigned parseOptions(const QStringList &paramList)
{
unsigned options = 0;
foreach (const QString &param, paramList) {
if (param == QLatin1String("enable_fonts"))
options |= QMinimalIntegration::EnableFonts;
}
return options;
}
QMinimalIntegration::QMinimalIntegration(const QStringList &parameters)
: m_dummyFontDatabase(0)
, m_options(parseOptions(parameters))
{
if (qEnvironmentVariableIsSet(debugBackingStoreEnvironmentVariable)
&& qgetenv(debugBackingStoreEnvironmentVariable).toInt() > 0) {
m_options |= DebugBackingStore | EnableFonts;
}
QMinimalScreen *mPrimaryScreen = new QMinimalScreen();
mPrimaryScreen->mGeometry = QRect(0, 0, 240, 320);
@ -67,6 +87,11 @@ QMinimalIntegration::QMinimalIntegration()
screenAdded(mPrimaryScreen);
}
QMinimalIntegration::~QMinimalIntegration()
{
delete m_dummyFontDatabase;
}
bool QMinimalIntegration::hasCapability(QPlatformIntegration::Capability cap) const
{
switch (cap) {
@ -76,6 +101,24 @@ bool QMinimalIntegration::hasCapability(QPlatformIntegration::Capability cap) co
}
}
// Dummy font database that does not scan the fonts directory to be
// used for command line tools like qmlplugindump that do not create windows
// unless DebugBackingStore is activated.
class DummyFontDatabase : public QPlatformFontDatabase
{
public:
virtual void populateFontDatabase() {}
};
QPlatformFontDatabase *QMinimalIntegration::fontDatabase() const
{
if (m_options & EnableFonts)
return QPlatformIntegration::fontDatabase();
if (!m_dummyFontDatabase)
m_dummyFontDatabase = new DummyFontDatabase;
return m_dummyFontDatabase;
}
QPlatformWindow *QMinimalIntegration::createPlatformWindow(QWindow *window) const
{
Q_UNUSED(window);
@ -102,4 +145,9 @@ QAbstractEventDispatcher *QMinimalIntegration::createEventDispatcher() const
#endif
}
QMinimalIntegration *QMinimalIntegration::instance()
{
return static_cast<QMinimalIntegration *>(QGuiApplicationPrivate::platformIntegration());
}
QT_END_NAMESPACE

View File

@ -67,13 +67,28 @@ public:
class QMinimalIntegration : public QPlatformIntegration
{
public:
QMinimalIntegration();
enum Options { // Options to be passed on command line or determined from environment
DebugBackingStore = 0x1,
EnableFonts = 0x2
};
explicit QMinimalIntegration(const QStringList &parameters);
~QMinimalIntegration();
bool hasCapability(QPlatformIntegration::Capability cap) const;
QPlatformFontDatabase *fontDatabase() const;
QPlatformWindow *createPlatformWindow(QWindow *window) const;
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
QAbstractEventDispatcher *createEventDispatcher() const;
unsigned options() const { return m_options; }
static QMinimalIntegration *instance();
private:
mutable QPlatformFontDatabase *m_dummyFontDatabase;
unsigned m_options;
};
QT_END_NAMESPACE

View File

@ -63,7 +63,7 @@ QStringList QMinimalEglIntegrationPlugin::keys() const
QPlatformIntegration* QMinimalEglIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
if (system.toLower() == "minimalegl")
if (!system.compare(QLatin1String("minimalegl"), Qt::CaseInsensitive))
return new QMinimalEglIntegration;
return 0;

View File

@ -56,7 +56,7 @@ public:
QPlatformIntegration *QOffscreenIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
if (system.toLower() == "offscreen")
if (!system.compare(QLatin1String("offscreen"), Qt::CaseInsensitive))
return QOffscreenIntegration::createOffscreenIntegration();
return 0;

View File

@ -54,7 +54,7 @@ public:
QPlatformIntegration* QOpenWFDIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
Q_UNUSED(paramList);
if (system.toLower() == "openwfd")
if (!system.compare(QLatin1String("openwfd"), Qt::CaseInsensitive))
return new QOpenWFDIntegration;
return 0;

View File

@ -46,7 +46,7 @@ QT_BEGIN_NAMESPACE
QPlatformIntegration *QQnxIntegrationPlugin::create(const QString& system, const QStringList& paramList)
{
if (system.toLower() == QLatin1String("qnx"))
if (!system.compare(QLatin1String("qnx"), Qt::CaseInsensitive))
return new QQnxIntegration(paramList);
return 0;

View File

@ -87,6 +87,9 @@ public:
Q_SIGNALS:
void dialogClosed();
private Q_SLOTS:
void emitSignals();
private:
void setNameFilter(const QString &filter);
void setNameFilters(const QStringList &filters);
@ -96,8 +99,8 @@ private:
QFileDialogOptions::AcceptMode m_acceptMode;
QString m_selectedFilter;
QPlatformDialogHelper::DialogCode m_result;
#if defined(Q_OS_BLACKBERRY_TABLET)
QPlatformDialogHelper::DialogCode m_result;
QList<QUrl> m_paths;
#endif
};

View File

@ -65,9 +65,9 @@ QQnxFileDialogHelper::QQnxFileDialogHelper(const QQnxIntegration *integration)
m_integration(integration),
m_dialog(new QQnxFilePicker),
m_acceptMode(QFileDialogOptions::AcceptOpen),
m_selectedFilter(),
m_result(QPlatformDialogHelper::Rejected)
m_selectedFilter()
{
connect(m_dialog, &QQnxFilePicker::closed, this, &QQnxFileDialogHelper::emitSignals);
}
QQnxFileDialogHelper::~QQnxFileDialogHelper()
@ -85,11 +85,6 @@ void QQnxFileDialogHelper::exec()
QEventLoop loop;
connect(m_dialog, SIGNAL(closed()), &loop, SLOT(quit()));
loop.exec();
if (m_dialog->selectedFiles().isEmpty())
Q_EMIT reject();
else
Q_EMIT accept();
}
bool QQnxFileDialogHelper::show(Qt::WindowFlags flags, Qt::WindowModality modality, QWindow *parent)
@ -197,6 +192,14 @@ QString QQnxFileDialogHelper::selectedNameFilter() const
return m_selectedFilter;
}
void QQnxFileDialogHelper::emitSignals()
{
if (m_dialog->selectedFiles().isEmpty())
Q_EMIT reject();
else
Q_EMIT accept();
}
void QQnxFileDialogHelper::setNameFilter(const QString &filter)
{
qFileDialogHelperDebug() << Q_FUNC_INFO << "filter =" << filter;

View File

@ -84,6 +84,9 @@ void QQnxFilePicker::open()
if (m_invocationHandle)
return;
// Clear any previous results
m_selectedFiles.clear();
int errorCode = BPS_SUCCESS;
errorCode = navigator_invoke_invocation_create(&m_invocationHandle);

View File

@ -54,7 +54,7 @@ public:
QPlatformIntegration* QXcbIntegrationPlugin::create(const QString& system, const QStringList& parameters, int &argc, char **argv)
{
if (system.toLower() == "xcb")
if (!system.compare(QLatin1String("xcb"), Qt::CaseInsensitive))
return new QXcbIntegration(parameters, argc, argv);
return 0;

View File

@ -274,21 +274,22 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
XSetEventQueueOwner(dpy, XCBOwnsEventQueue);
XSetErrorHandler(nullErrorHandler);
m_xlib_display = dpy;
#ifdef XCB_USE_EGL
EGLDisplay eglDisplay = eglGetDisplay(dpy);
m_egl_display = eglDisplay;
EGLint major, minor;
eglBindAPI(EGL_OPENGL_ES_API);
m_has_egl = eglInitialize(eglDisplay,&major,&minor);
#endif //XCB_USE_EGL
}
#else
EGLNativeDisplayType dpy = EGL_DEFAULT_DISPLAY;
m_connection = xcb_connect(m_displayName.constData(), &m_primaryScreen);
#endif //XCB_USE_XLIB
if (!m_connection || xcb_connection_has_error(m_connection))
qFatal("QXcbConnection: Could not connect to display %s", m_displayName.constData());
#ifdef XCB_USE_EGL
EGLDisplay eglDisplay = eglGetDisplay(dpy);
m_egl_display = eglDisplay;
EGLint major, minor;
m_has_egl = eglInitialize(eglDisplay, &major, &minor);
#endif //XCB_USE_EGL
m_reader = new QXcbEventReader(this);
m_reader->start();

View File

@ -48,7 +48,6 @@
#include <qpa/qplatformprintersupport.h>
#include "qprintengine.h"
#include "qprinterinfo.h"
#include "qlist.h"
#include <qcoreapplication.h>
#include <qfileinfo.h>
@ -163,10 +162,39 @@ Q_PRINTSUPPORT_EXPORT QSizeF qt_printerPaperSize(QPrinter::Orientation orientati
(qt_paperSizes[paperSize][height_index] * 72 / 25.4) / multiplier);
}
void QPrinterPrivate::createDefaultEngines()
QPrinterInfo QPrinterPrivate::findValidPrinter(const QPrinterInfo &printer)
{
QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get();
if (outputFormat == QPrinter::NativeFormat && ps) {
// Try find a valid printer to use, either the one given, the default or the first available
QPrinterInfo printerToUse = printer;
if (printerToUse.isNull()) {
printerToUse = QPrinterInfo::defaultPrinter();
if (printerToUse.isNull()) {
QList<QPrinterInfo> availablePrinters = QPrinterInfo::availablePrinters();
if (!availablePrinters.isEmpty())
printerToUse = availablePrinters.at(0);
}
}
return printerToUse;
}
void QPrinterPrivate::initEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer)
{
// Default to PdfFormat
outputFormat = QPrinter::PdfFormat;
QPlatformPrinterSupport *ps = 0;
QString printerName;
// Only set NativeFormat if we have a valid plugin and printer to use
if (format == QPrinter::NativeFormat) {
ps = QPlatformPrinterSupportPlugin::get();
QPrinterInfo printerToUse = findValidPrinter(printer);
if (ps && !printerToUse.isNull()) {
outputFormat = QPrinter::NativeFormat;
printerName = printerToUse.printerName();
}
}
if (outputFormat == QPrinter::NativeFormat) {
printEngine = ps->createNativePrintEngine(printerMode);
paintEngine = ps->createPaintEngine(printEngine, printerMode);
} else {
@ -174,8 +202,38 @@ void QPrinterPrivate::createDefaultEngines()
paintEngine = pdfEngine;
printEngine = pdfEngine;
}
use_default_engine = true;
had_default_engines = true;
setProperty(QPrintEngine::PPK_PrinterName, printerName);
validPrinter = true;
}
void QPrinterPrivate::changeEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer)
{
QPrintEngine *oldPrintEngine = printEngine;
const bool def_engine = use_default_engine;
initEngines(format, printer);
if (oldPrintEngine) {
foreach (QPrintEngine::PrintEnginePropertyKey key, m_properties.values()) {
QVariant prop;
// PPK_NumberOfCopies need special treatmeant since it in most cases
// will return 1, disregarding the actual value that was set
// PPK_PrinterName also needs special treatment as initEngines has set it already
if (key == QPrintEngine::PPK_NumberOfCopies)
prop = QVariant(q_ptr->copyCount());
else if (key != QPrintEngine::PPK_PrinterName)
prop = oldPrintEngine->property(key);
if (prop.isValid())
setProperty(key, prop);
}
}
if (def_engine)
delete oldPrintEngine;
}
#ifndef QT_NO_PRINTPREVIEWWIDGET
@ -205,15 +263,14 @@ void QPrinterPrivate::setPreviewMode(bool enable)
}
#endif // QT_NO_PRINTPREVIEWWIDGET
void QPrinterPrivate::addToManualSetList(QPrintEngine::PrintEnginePropertyKey key)
void QPrinterPrivate::setProperty(QPrintEngine::PrintEnginePropertyKey key, const QVariant &value)
{
for (int c = 0; c < manualSetList.size(); ++c) {
if (manualSetList[c] == key) return;
}
manualSetList.append(key);
printEngine->setProperty(key, value);
m_properties.insert(key);
}
/*!
\class QPrinter
\reentrant
@ -510,13 +567,7 @@ QPrinter::QPrinter(PrinterMode mode)
: QPagedPaintDevice(),
d_ptr(new QPrinterPrivate(this))
{
d_ptr->init(mode);
QPrinterInfo defPrn(QPrinterInfo::defaultPrinter());
if (!defPrn.isNull()) {
setPrinterName(defPrn.printerName());
} else if (QPrinterInfo::availablePrinters().isEmpty()) {
setOutputFormat(QPrinter::PdfFormat);
}
d_ptr->init(QPrinterInfo(), mode);
}
/*!
@ -528,11 +579,10 @@ QPrinter::QPrinter(const QPrinterInfo& printer, PrinterMode mode)
: QPagedPaintDevice(),
d_ptr(new QPrinterPrivate(this))
{
d_ptr->init(mode);
setPrinterName(printer.printerName());
d_ptr->init(printer, mode);
}
void QPrinterPrivate::init(QPrinter::PrinterMode mode)
void QPrinterPrivate::init(const QPrinterInfo &printer, QPrinter::PrinterMode mode)
{
if (!QCoreApplication::instance()) {
qFatal("QPrinter: Must construct a QCoreApplication before a QPrinter");
@ -540,14 +590,8 @@ void QPrinterPrivate::init(QPrinter::PrinterMode mode)
}
printerMode = mode;
outputFormat = QPrinter::NativeFormat;
createDefaultEngines();
#ifndef QT_NO_PRINTPREVIEWWIDGET
previewEngine = 0;
#endif
realPrintEngine = 0;
realPaintEngine = 0;
initEngines(QPrinter::NativeFormat, printer);
}
/*!
@ -612,40 +656,30 @@ QPrinter::~QPrinter()
\since 4.1
Sets the output format for this printer to \a format.
If \a format is the same value as currently set then no change will be made.
If \a format is NativeFormat then the printerName will be set to the default
printer. If there are no valid printers configured then no change will be made.
If you want to set NativeFormat with a specific printerName then use
setPrinterName().
\sa setPrinterName()
*/
void QPrinter::setOutputFormat(OutputFormat format)
{
Q_D(QPrinter);
if (d->validPrinter && d->outputFormat == format)
if (d->outputFormat == format)
return;
d->outputFormat = format;
QPrintEngine *oldPrintEngine = d->printEngine;
const bool def_engine = d->use_default_engine;
d->printEngine = 0;
d->createDefaultEngines();
if (oldPrintEngine) {
for (int i = 0; i < d->manualSetList.size(); ++i) {
QPrintEngine::PrintEnginePropertyKey key = d->manualSetList[i];
QVariant prop;
// PPK_NumberOfCopies need special treatmeant since it in most cases
// will return 1, disregarding the actual value that was set
if (key == QPrintEngine::PPK_NumberOfCopies)
prop = QVariant(copyCount());
else
prop = oldPrintEngine->property(key);
if (prop.isValid())
d->printEngine->setProperty(key, prop);
}
if (format == QPrinter::NativeFormat) {
QPrinterInfo printerToUse = d->findValidPrinter();
if (!printerToUse.isNull())
d->changeEngines(format, printerToUse);
} else {
d->changeEngines(format, QPrinterInfo());
}
if (def_engine)
delete oldPrintEngine;
if (d->outputFormat == QPrinter::PdfFormat)
d->validPrinter = true;
}
/*!
@ -683,30 +717,37 @@ QString QPrinter::printerName() const
/*!
Sets the printer name to \a name.
\sa printerName(), isValid()
If the \a name is empty then the output format will be set to PdfFormat.
If the \a name is not a valid printer then no change will be made.
If the \a name is a valid printer then the output format will be set to NativeFormat.
\sa printerName(), isValid(), setOutputFormat()
*/
void QPrinter::setPrinterName(const QString &name)
{
Q_D(QPrinter);
ABORT_IF_ACTIVE("QPrinter::setPrinterName");
QList<QPrinterInfo> prnList = QPrinterInfo::availablePrinters();
if (printerName() == name)
return;
if (name.isEmpty()) {
d->validPrinter = d->outputFormat == QPrinter::PdfFormat;
} else {
d->validPrinter = false;
for (int i = 0; i < prnList.size(); ++i) {
if (prnList[i].printerName() == name) {
d->validPrinter = true;
break;
}
}
setOutputFormat(QPrinter::PdfFormat);
return;
}
d->printEngine->setProperty(QPrintEngine::PPK_PrinterName, name);
d->addToManualSetList(QPrintEngine::PPK_PrinterName);
}
QPrinterInfo printerToUse = QPrinterInfo::printerInfo(name);
if (printerToUse.isNull())
return;
if (outputFormat() == QPrinter::PdfFormat) {
d->changeEngines(QPrinter::NativeFormat, printerToUse);
} else {
d->setProperty(QPrintEngine::PPK_PrinterName, name);
}
}
/*!
\since 4.4
@ -774,8 +815,7 @@ void QPrinter::setOutputFileName(const QString &fileName)
else if (fileName.isEmpty())
setOutputFormat(QPrinter::NativeFormat);
d->printEngine->setProperty(QPrintEngine::PPK_OutputFileName, fileName);
d->addToManualSetList(QPrintEngine::PPK_OutputFileName);
d->setProperty(QPrintEngine::PPK_OutputFileName, fileName);
}
@ -810,8 +850,7 @@ void QPrinter::setPrintProgram(const QString &printProg)
{
Q_D(QPrinter);
ABORT_IF_ACTIVE("QPrinter::setPrintProgram");
d->printEngine->setProperty(QPrintEngine::PPK_PrinterProgram, printProg);
d->addToManualSetList(QPrintEngine::PPK_PrinterProgram);
d->setProperty(QPrintEngine::PPK_PrinterProgram, printProg);
}
@ -841,8 +880,7 @@ void QPrinter::setDocName(const QString &name)
{
Q_D(QPrinter);
ABORT_IF_ACTIVE("QPrinter::setDocName");
d->printEngine->setProperty(QPrintEngine::PPK_DocumentName, name);
d->addToManualSetList(QPrintEngine::PPK_DocumentName);
d->setProperty(QPrintEngine::PPK_DocumentName, name);
}
@ -872,8 +910,7 @@ void QPrinter::setCreator(const QString &creator)
{
Q_D(QPrinter);
ABORT_IF_ACTIVE("QPrinter::setCreator");
d->printEngine->setProperty(QPrintEngine::PPK_Creator, creator);
d->addToManualSetList(QPrintEngine::PPK_Creator);
d->setProperty(QPrintEngine::PPK_Creator, creator);
}
@ -910,8 +947,7 @@ QPrinter::Orientation QPrinter::orientation() const
void QPrinter::setOrientation(Orientation orientation)
{
Q_D(QPrinter);
d->printEngine->setProperty(QPrintEngine::PPK_Orientation, orientation);
d->addToManualSetList(QPrintEngine::PPK_Orientation);
d->setProperty(QPrintEngine::PPK_Orientation, orientation);
}
@ -979,8 +1015,7 @@ void QPrinter::setPageSize(PageSize newPageSize)
qWarning("QPrinter::setPaperSize: Illegal paper size %d", newPageSize);
return;
}
d->printEngine->setProperty(QPrintEngine::PPK_PaperSize, newPageSize);
d->addToManualSetList(QPrintEngine::PPK_PaperSize);
d->setProperty(QPrintEngine::PPK_PaperSize, newPageSize);
d->hasUserSetPageSize = true;
}
@ -1010,8 +1045,7 @@ void QPrinter::setPageSizeMM(const QSizeF &size)
QPagedPaintDevice::setPageSizeMM(size);
QSizeF s = size * 72./25.4;
d->printEngine->setProperty(QPrintEngine::PPK_CustomPaperSize, s);
d->addToManualSetList(QPrintEngine::PPK_CustomPaperSize);
d->setProperty(QPrintEngine::PPK_CustomPaperSize, s);
d->hasUserSetPageSize = true;
}
@ -1051,8 +1085,7 @@ void QPrinter::setPaperName(const QString &paperName)
Q_D(QPrinter);
if (d->paintEngine->type() != QPaintEngine::Pdf)
ABORT_IF_ACTIVE("QPrinter::setPaperName");
d->printEngine->setProperty(QPrintEngine::PPK_PaperName, paperName);
d->addToManualSetList(QPrintEngine::PPK_PaperName);
d->setProperty(QPrintEngine::PPK_PaperName, paperName);
}
/*!
@ -1088,8 +1121,7 @@ void QPrinter::setPageOrder(PageOrder pageOrder)
Q_D(QPrinter);
ABORT_IF_ACTIVE("QPrinter::setPageOrder");
d->printEngine->setProperty(QPrintEngine::PPK_PageOrder, pageOrder);
d->addToManualSetList(QPrintEngine::PPK_PageOrder);
d->setProperty(QPrintEngine::PPK_PageOrder, pageOrder);
}
@ -1117,8 +1149,7 @@ void QPrinter::setColorMode(ColorMode newColorMode)
{
Q_D(QPrinter);
ABORT_IF_ACTIVE("QPrinter::setColorMode");
d->printEngine->setProperty(QPrintEngine::PPK_ColorMode, newColorMode);
d->addToManualSetList(QPrintEngine::PPK_ColorMode);
d->setProperty(QPrintEngine::PPK_ColorMode, newColorMode);
}
@ -1197,8 +1228,7 @@ void QPrinter::setNumCopies(int numCopies)
{
Q_D(QPrinter);
ABORT_IF_ACTIVE("QPrinter::setNumCopies");
d->printEngine->setProperty(QPrintEngine::PPK_NumberOfCopies, numCopies);
d->addToManualSetList(QPrintEngine::PPK_NumberOfCopies);
d->setProperty(QPrintEngine::PPK_NumberOfCopies, numCopies);
}
/*!
@ -1216,8 +1246,7 @@ void QPrinter::setCopyCount(int count)
{
Q_D(QPrinter);
ABORT_IF_ACTIVE("QPrinter::setCopyCount;");
d->printEngine->setProperty(QPrintEngine::PPK_CopyCount, count);
d->addToManualSetList(QPrintEngine::PPK_CopyCount);
d->setProperty(QPrintEngine::PPK_CopyCount, count);
}
/*!
@ -1286,8 +1315,7 @@ void QPrinter::setCollateCopies(bool collate)
{
Q_D(QPrinter);
ABORT_IF_ACTIVE("QPrinter::setCollateCopies");
d->printEngine->setProperty(QPrintEngine::PPK_CollateCopies, collate);
d->addToManualSetList(QPrintEngine::PPK_CollateCopies);
d->setProperty(QPrintEngine::PPK_CollateCopies, collate);
}
@ -1316,8 +1344,7 @@ void QPrinter::setCollateCopies(bool collate)
void QPrinter::setFullPage(bool fp)
{
Q_D(QPrinter);
d->printEngine->setProperty(QPrintEngine::PPK_FullPage, fp);
d->addToManualSetList(QPrintEngine::PPK_FullPage);
d->setProperty(QPrintEngine::PPK_FullPage, fp);
}
@ -1355,8 +1382,7 @@ void QPrinter::setResolution(int dpi)
{
Q_D(QPrinter);
ABORT_IF_ACTIVE("QPrinter::setResolution");
d->printEngine->setProperty(QPrintEngine::PPK_Resolution, dpi);
d->addToManualSetList(QPrintEngine::PPK_Resolution);
d->setProperty(QPrintEngine::PPK_Resolution, dpi);
}
@ -1385,8 +1411,7 @@ int QPrinter::resolution() const
void QPrinter::setPaperSource(PaperSource source)
{
Q_D(QPrinter);
d->printEngine->setProperty(QPrintEngine::PPK_PaperSource, source);
d->addToManualSetList(QPrintEngine::PPK_PaperSource);
d->setProperty(QPrintEngine::PPK_PaperSource, source);
}
/*!
@ -1412,8 +1437,7 @@ QPrinter::PaperSource QPrinter::paperSource() const
void QPrinter::setFontEmbeddingEnabled(bool enable)
{
Q_D(QPrinter);
d->printEngine->setProperty(QPrintEngine::PPK_FontEmbedding, enable);
d->addToManualSetList(QPrintEngine::PPK_FontEmbedding);
d->setProperty(QPrintEngine::PPK_FontEmbedding, enable);
}
/*!
@ -1484,8 +1508,7 @@ bool QPrinter::doubleSidedPrinting() const
void QPrinter::setDuplex(DuplexMode duplex)
{
Q_D(QPrinter);
d->printEngine->setProperty(QPrintEngine::PPK_Duplex, duplex);
d->addToManualSetList(QPrintEngine::PPK_Duplex);
d->setProperty(QPrintEngine::PPK_Duplex, duplex);
}
/*!
@ -1613,8 +1636,7 @@ void QPrinter::setMargins(const Margins &m)
QList<QVariant> margins;
margins << (m.left * multiplier) << (m.top * multiplier)
<< (m.right * multiplier) << (m.bottom * multiplier);
d->printEngine->setProperty(QPrintEngine::PPK_PageMargins, margins);
d->addToManualSetList(QPrintEngine::PPK_PageMargins);
d->setProperty(QPrintEngine::PPK_PageMargins, margins);
d->hasCustomPageMargins = true;
}
@ -1685,8 +1707,7 @@ void QPrinter::setWinPageSize(int pageSize)
{
Q_D(QPrinter);
ABORT_IF_ACTIVE("QPrinter::setWinPageSize");
d->printEngine->setProperty(QPrintEngine::PPK_WindowsPageSize, pageSize);
d->addToManualSetList(QPrintEngine::PPK_WindowsPageSize);
d->setProperty(QPrintEngine::PPK_WindowsPageSize, pageSize);
}
/*!
@ -1834,8 +1855,7 @@ QString QPrinter::printerSelectionOption() const
void QPrinter::setPrinterSelectionOption(const QString &option)
{
Q_D(QPrinter);
d->printEngine->setProperty(QPrintEngine::PPK_SelectionOption, option);
d->addToManualSetList(QPrintEngine::PPK_SelectionOption);
d->setProperty(QPrintEngine::PPK_SelectionOption, option);
}
#endif

View File

@ -59,8 +59,10 @@
#ifndef QT_NO_PRINTER
#include "QtPrintSupport/qprinter.h"
#include "QtPrintSupport/qprinterinfo.h"
#include "QtPrintSupport/qprintengine.h"
#include "QtCore/qpointer.h"
#include "QtCore/qset.h"
#include <limits.h>
@ -75,14 +77,19 @@ class Q_PRINTSUPPORT_EXPORT QPrinterPrivate
Q_DECLARE_PUBLIC(QPrinter)
public:
QPrinterPrivate(QPrinter *printer)
: printEngine(0)
, paintEngine(0)
, q_ptr(printer)
, printRange(QPrinter::AllPages)
, use_default_engine(true)
, validPrinter(false)
, hasCustomPageMargins(false)
, hasUserSetPageSize(false)
: printEngine(0),
paintEngine(0),
realPrintEngine(0),
realPaintEngine(0),
#ifndef QT_NO_PRINTPREVIEWWIDGET
previewEngine(0),
#endif
q_ptr(printer),
printRange(QPrinter::AllPages),
use_default_engine(true),
validPrinter(false),
hasCustomPageMargins(false),
hasUserSetPageSize(false)
{
}
@ -90,15 +97,17 @@ public:
}
void init(QPrinter::PrinterMode mode);
void init(const QPrinterInfo &printer, QPrinter::PrinterMode mode);
void createDefaultEngines();
QPrinterInfo findValidPrinter(const QPrinterInfo &printer = QPrinterInfo());
void initEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer);
void changeEngines(QPrinter::OutputFormat format, const QPrinterInfo &printer);
#ifndef QT_NO_PRINTPREVIEWWIDGET
QList<const QPicture *> previewPages() const;
void setPreviewMode(bool);
#endif
void addToManualSetList(QPrintEngine::PrintEnginePropertyKey key);
void setProperty(QPrintEngine::PrintEnginePropertyKey key, const QVariant &value);
QPrinter::PrinterMode printerMode;
QPrinter::OutputFormat outputFormat;
@ -123,7 +132,7 @@ public:
uint hasUserSetPageSize : 1;
// Used to remember which properties have been manually set by the user.
QList<QPrintEngine::PrintEnginePropertyKey> manualSetList;
QSet<QPrintEngine::PrintEnginePropertyKey> m_properties;
};
QT_END_NAMESPACE

View File

@ -151,9 +151,8 @@
\snippet code/doc_src_sql-driver.qdoc 3
After installing Qt, as described in the \l{Installing Qt for X11
Platforms} document, you also need to install the plugin in the
standard location:
After installing Qt, you also need to install the plugin in the standard
location:
\snippet code/doc_src_sql-driver.qdoc 4
@ -478,8 +477,8 @@
\snippet code/doc_src_sql-driver.qdoc 13
After installing Qt, as described in the \l{Installing Qt for X11 Platforms} document,
you also need to install the plugin in the standard location:
After installing Qt, you also need to install the plugin in the standard
location:
\snippet code/doc_src_sql-driver.qdoc 14
@ -565,8 +564,8 @@
\snippet code/doc_src_sql-driver.qdoc 18
After installing Qt, as described in the \l{Installing Qt for X11 Platforms} document,
you also need to install the plugin in the standard location:
After installing Qt, you also need to install the plugin in the standard
location:
\snippet code/doc_src_sql-driver.qdoc 19
@ -640,8 +639,7 @@
\snippet code/doc_src_sql-driver.qdoc 21
After installing Qt, as described in the \l{Installing Qt for X11 Platforms} document,
you also need to install the plugin in the standard location:
After installing Qt, you also need to install the plugin in the standard location:
\snippet code/doc_src_sql-driver.qdoc 22

View File

@ -1445,7 +1445,7 @@ bool QIBaseDriver::open(const QString & db,
const QString & user,
const QString & password,
const QString & host,
int /*port*/,
int port,
const QString & connOpts)
{
Q_D(QIBaseDriver);
@ -1513,9 +1513,13 @@ bool QIBaseDriver::open(const QString & db,
i += role.length();
}
QString portString;
if (port != -1)
portString = QStringLiteral("/%1").arg(port);
QString ldb;
if (!host.isEmpty())
ldb += host + QLatin1Char(':');
ldb += host + portString + QLatin1Char(':');
ldb += db;
isc_attach_database(d->status, 0, const_cast<char *>(ldb.toLocal8Bit().constData()),
&d->ibase, i, ba.data());
@ -1526,6 +1530,7 @@ bool QIBaseDriver::open(const QString & db,
}
setOpen(true);
setOpenError(false);
return true;
}

View File

@ -2159,6 +2159,7 @@ bool QOCIDriver::hasFeature(DriverFeature f) const
case SimpleLocking:
case EventNotifications:
case FinishQuery:
case CancelQuery:
case MultipleResultSets:
return false;
case Unicode:

View File

@ -597,24 +597,32 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c
if (isOpen())
close();
int timeOut = 5000;
bool sharedCache = false;
int openMode = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, timeOut=5000;
QStringList opts=QString(conOpts).remove(QLatin1Char(' ')).split(QLatin1Char(';'));
foreach(const QString &option, opts) {
bool openReadOnlyOption = false;
bool openUriOption = false;
const QStringList opts = QString(conOpts).remove(QLatin1Char(' ')).split(QLatin1Char(';'));
foreach (const QString &option, opts) {
if (option.startsWith(QLatin1String("QSQLITE_BUSY_TIMEOUT="))) {
bool ok;
int nt = option.mid(21).toInt(&ok);
const int nt = option.mid(21).toInt(&ok);
if (ok)
timeOut = nt;
}
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"))
} else if (option == QLatin1String("QSQLITE_OPEN_READONLY")) {
openReadOnlyOption = true;
} else if (option == QLatin1String("QSQLITE_OPEN_URI")) {
openUriOption = true;
} else if (option == QLatin1String("QSQLITE_ENABLE_SHARED_CACHE")) {
sharedCache = true;
}
}
int openMode = (openReadOnlyOption ? SQLITE_OPEN_READONLY : (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE));
if (openUriOption)
openMode |= SQLITE_OPEN_URI;
sqlite3_enable_shared_cache(sharedCache);
if (sqlite3_open_v2(db.toUtf8().constData(), &d->access, openMode, NULL) == SQLITE_OK) {

View File

@ -43,6 +43,7 @@
#include <qdatetime.h>
#include <qdebug.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qstring.h>
#include <qstringlist.h>
#include <qtextstream.h>
@ -65,6 +66,7 @@ static QString parentClassName;
static QString proxyFile;
static QString adaptorFile;
static QString inputFile;
static QDateTime classCreationTime;
static bool skipNamespaces;
static bool verbose;
static bool includeMocs;
@ -216,10 +218,13 @@ static void parseCmdLine(QStringList args)
static QDBusIntrospection::Interfaces readInput()
{
QFile input(inputFile);
if (inputFile.isEmpty() || inputFile == QLatin1String("-"))
if (inputFile.isEmpty() || inputFile == QLatin1String("-")) {
input.open(stdin, QIODevice::ReadOnly);
else
classCreationTime = QDateTime::currentDateTime();
} else {
input.open(QIODevice::ReadOnly);
classCreationTime = QFileInfo(input).lastModified();
}
QByteArray data = input.readAll();
@ -556,7 +561,7 @@ static void writeProxy(const QString &filename, const QDBusIntrospection::Interf
}
includeGuard = QString(QLatin1String("%1_%2"))
.arg(includeGuard)
.arg(QDateTime::currentDateTime().toTime_t());
.arg(classCreationTime.toTime_t());
hs << "#ifndef " << includeGuard << endl
<< "#define " << includeGuard << endl
<< endl;

View File

@ -127,7 +127,8 @@
/*!
\ingroup all-examples
\title Graphicsview Examples
\target Graphicsview Examples
\title Graphics View Examples
\brief Using the Graphics View framework.
\page examples-graphicsview.html

View File

@ -5036,6 +5036,8 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
return;
#endif // Q_WS_MAC
const bool asRoot = flags & DrawAsRoot;
bool onScreen = paintOnScreen();
Q_Q(QWidget);
#ifndef QT_NO_GRAPHICSEFFECT
@ -5065,12 +5067,17 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
sharedPainter->restore();
}
sourced->context = 0;
// Native widgets need to be marked dirty on screen so painting will be done in correct context
// Same check as in the no effects case below.
if (backingStore && !onScreen && !asRoot && (q->internalWinId() || !q->nativeParentWidget()->isWindow()))
backingStore->markDirtyOnScreen(rgn, q, offset);
return;
}
}
#endif //QT_NO_GRAFFICSEFFECT
const bool asRoot = flags & DrawAsRoot;
const bool alsoOnScreen = flags & DrawPaintOnScreen;
const bool recursive = flags & DrawRecursive;
const bool alsoInvisible = flags & DrawInvisible;
@ -5084,7 +5091,6 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
subtractOpaqueChildren(toBePainted, q->rect());
if (!toBePainted.isEmpty()) {
bool onScreen = paintOnScreen();
if (!onScreen || alsoOnScreen) {
//update the "in paint event" flag
if (q->testAttribute(Qt::WA_WState_InPaintEvent))

View File

@ -167,7 +167,7 @@ QT_BEGIN_NAMESPACE
QAbstractScrollAreaPrivate::QAbstractScrollAreaPrivate()
:hbar(0), vbar(0), vbarpolicy(Qt::ScrollBarAsNeeded), hbarpolicy(Qt::ScrollBarAsNeeded),
shownOnce(false), sizeAdjustPolicy(QAbstractScrollArea::AdjustIgnored),
shownOnce(false), inResize(false), sizeAdjustPolicy(QAbstractScrollArea::AdjustIgnored),
viewport(0), cornerWidget(0), left(0), top(0), right(0), bottom(0),
xoffset(0), yoffset(0), viewportFilter(0)
#ifdef Q_WS_WIN
@ -995,8 +995,12 @@ bool QAbstractScrollArea::event(QEvent *e)
d->viewport->setMouseTracking(hasMouseTracking());
break;
case QEvent::Resize:
if (!d->inResize) {
d->inResize = true;
d->layoutChildren();
break;
d->inResize = false;
}
break;
case QEvent::Show:
if (!d->shownOnce && d->sizeAdjustPolicy == QAbstractScrollArea::AdjustToContentsOnFirstShow) {
d->sizeHint = QSize();

View File

@ -76,6 +76,7 @@ public:
Qt::ScrollBarPolicy vbarpolicy, hbarpolicy;
bool shownOnce;
bool inResize;
mutable QSize sizeHint;
QAbstractScrollArea::SizeAdjustPolicy sizeAdjustPolicy;

View File

@ -485,9 +485,12 @@ void QToolBarAreaLayoutInfo::moveToolBar(QToolBar *toolbar, int pos)
QList<int> QToolBarAreaLayoutInfo::gapIndex(const QPoint &pos, int *minDistance) const
{
int p = pick(o, pos);
if (rect.contains(pos)) {
// <pos> is in QToolBarAreaLayout coordinates.
// <item.pos> is in local dockarea coordinates (see ~20 lines below)
// Since we're comparing p with item.pos, we put them in the same coordinate system.
const int p = pick(o, pos - rect.topLeft());
for (int j = 0; j < lines.count(); ++j) {
const QToolBarAreaLayoutLine &line = lines.at(j);
if (line.skip())

View File

@ -153,6 +153,7 @@ private slots:
void connectBase();
void qmlConnect();
void exceptions();
void noDeclarativeParentChangedOnDestruction();
};
struct QObjectCreatedOnShutdown
@ -6282,6 +6283,43 @@ void tst_QObject::exceptions()
#endif
}
#ifdef QT_BUILD_INTERNAL
static bool parentChangeCalled = false;
static void testParentChanged(QAbstractDeclarativeData *, QObject *, QObject *)
{
parentChangeCalled = true;
}
#endif
void tst_QObject::noDeclarativeParentChangedOnDestruction()
{
#ifdef QT_BUILD_INTERNAL
typedef void (*ParentChangedCallback)(QAbstractDeclarativeData *, QObject *, QObject *);
QScopedValueRollback<ParentChangedCallback> rollback(QAbstractDeclarativeData::parentChanged);
QAbstractDeclarativeData::parentChanged = testParentChanged;
QObject *parent = new QObject;
QObject *child = new QObject;
QAbstractDeclarativeData dummy;
QObjectPrivate::get(child)->declarativeData = &dummy;
parentChangeCalled = false;
child->setParent(parent);
QVERIFY(parentChangeCalled);
parentChangeCalled = false;
delete child;
QVERIFY(!parentChangeCalled);
delete parent;
#else
QSKIP("Needs QT_BUILD_INTERNAL");
#endif
}
// Test for QtPrivate::HasQ_OBJECT_Macro
Q_STATIC_ASSERT(QtPrivate::HasQ_OBJECT_Macro<tst_QObject>::Value);
Q_STATIC_ASSERT(!QtPrivate::HasQ_OBJECT_Macro<SiblingDeleter>::Value);

View File

@ -74,6 +74,7 @@ private slots:
void inlineImage();
void clippedTableCell();
void floatingTablePageBreak();
void imageAtRightAlignedTab();
private:
QTextDocument *doc;
@ -283,6 +284,41 @@ void tst_QTextDocumentLayout::floatingTablePageBreak()
QCOMPARE(doc->pageCount(), 2);
}
void tst_QTextDocumentLayout::imageAtRightAlignedTab()
{
doc->clear();
QTextFrameFormat fmt = doc->rootFrame()->frameFormat();
fmt.setMargin(0);
doc->rootFrame()->setFrameFormat(fmt);
QTextCursor cursor(doc);
QTextBlockFormat blockFormat;
QList<QTextOption::Tab> tabs;
QTextOption::Tab tab;
tab.position = 300;
tab.type = QTextOption::RightTab;
tabs.append(tab);
blockFormat.setTabPositions(tabs);
// First block: text, some of it right-aligned
cursor.insertBlock(blockFormat);
cursor.insertText("first line\t");
cursor.insertText("right-aligned text");
// Second block: text, then right-aligned image
cursor.insertBlock(blockFormat);
cursor.insertText("second line\t");
QImage img(48, 48, QImage::Format_RGB32);
const QString name = QString::fromLatin1("image");
doc->addResource(QTextDocument::ImageResource, QUrl(name), img);
QTextImageFormat imgFormat;
imgFormat.setName(name);
cursor.insertImage(imgFormat);
// Everything should fit into the 300 pixels
QCOMPARE(doc->idealWidth(), 300.0);
}
QTEST_MAIN(tst_QTextDocumentLayout)
#include "tst_qtextdocumentlayout.moc"

View File

@ -207,9 +207,6 @@ void tst_QPrinter::getSetCheck()
QCOMPARE(obj1.printerSelectionOption(), QString::fromLatin1("--option"));
#endif
obj1.setPrinterName(QString::fromLatin1("myPrinter"));
QCOMPARE(obj1.printerName(), QString::fromLatin1("myPrinter"));
// bool QPrinter::fontEmbeddingEnabled()
// void QPrinter::setFontEmbeddingEnabled(bool)
obj1.setFontEmbeddingEnabled(false);
@ -461,7 +458,7 @@ void tst_QPrinter::testNonExistentPrinter()
QPainter painter;
// Make sure it doesn't crash on setting or getting properties
printer.setPrinterName("some non existing printer");
printer.printEngine()->setProperty(QPrintEngine::PPK_PrinterName, "some non existing printer");
printer.setPageSize(QPrinter::A4);
printer.setOrientation(QPrinter::Portrait);
printer.setFullPage(true);
@ -709,9 +706,6 @@ void tst_QPrinter::valuePreservation()
printer.setCollateCopies(!status);
printer.setOutputFormat(newFormat);
#ifdef Q_OS_MAC
QEXPECT_FAIL("","QTBUG-26430", Abort);
#endif
QCOMPARE(printer.collateCopies(), !status);
printer.setOutputFormat(oldFormat);
QCOMPARE(printer.collateCopies(), !status);
@ -909,13 +903,6 @@ void tst_QPrinter::valuePreservation()
printer.setOutputFormat(newFormat);
printer.setOutputFormat(oldFormat);
QCOMPARE(printer.printerName(), status);
status = QString::fromLatin1("SuperDuperPrinter");
printer.setPrinterName(status);
printer.setOutputFormat(newFormat);
QCOMPARE(printer.printerName(), status);
printer.setOutputFormat(oldFormat);
QCOMPARE(printer.printerName(), status);
}
// QPrinter::printerSelectionOption is explicitly documented not to be available on Windows.
#ifndef Q_OS_WIN