Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/dev
This commit is contained in:
commit
2cac171dde
10
INSTALL
10
INSTALL
@ -1,10 +1,10 @@
|
||||
INSTALLING Qt Source Package Version %VERSION%.
|
||||
|
||||
For instructions on building and installing Qt for each supported platform,
|
||||
please see http://qt-project.org/doc/qt-%SHORTVERSION%/build-sources.html,
|
||||
please see http://doc.qt.io/qt-%SHORTVERSION%/build-sources.html,
|
||||
or follow one of these links:
|
||||
|
||||
Mac OS X: http://qt-project.org/doc/qt-%SHORTVERSION%/macosx-building.html
|
||||
Windows: http://qt-project.org/doc/qt-%SHORTVERSION%/windows-building.html
|
||||
X11 Platforms: http://qt-project.org/doc/qt-%SHORTVERSION%/linux-building.html
|
||||
Windows CE: http://qt-project.org/doc/qt-%SHORTVERSION%/install-wince.html
|
||||
Mac OS X: http://doc.qt.io/qt-%SHORTVERSION%/osx-building.html
|
||||
Windows: http://doc.qt.io/qt-%SHORTVERSION%/windows-building.html
|
||||
X11 Platforms: http://doc.qt.io/qt-%SHORTVERSION%/linux-building.html
|
||||
Windows CE: http://doc.qt.io/qt-%SHORTVERSION%/install-wince.html
|
||||
|
4
configure
vendored
4
configure
vendored
@ -2589,8 +2589,8 @@ Additional options:
|
||||
-device-option <key=value> ... Add device specific options for the device mkspec
|
||||
(experimental)
|
||||
|
||||
-no-separate-debug-info . Do not store debug information in a separate file.
|
||||
* -separate-debug-info .... Strip debug information into a separate file.
|
||||
* -no-separate-debug-info . Do not store debug information in a separate file.
|
||||
-separate-debug-info .... Strip debug information into a separate file.
|
||||
|
||||
-no-xcb ............ Do not compile Xcb (X protocol C-language Binding) support.
|
||||
* -xcb ............... Compile Xcb support.
|
||||
|
184
dist/changes-5.4.1
vendored
Normal file
184
dist/changes-5.4.1
vendored
Normal file
@ -0,0 +1,184 @@
|
||||
Qt 5.4.1 is a bug-fix release. It maintains both forward and backward
|
||||
compatibility (source and binary) with Qt 5.4.0 except on Windows
|
||||
when using MSVC 2012 or MSVC 2013. See note below.
|
||||
|
||||
For more details, refer to the online documentation included in this
|
||||
distribution. The documentation is also available online:
|
||||
|
||||
http://doc.qt.io/qt-5.4/
|
||||
|
||||
The Qt version 5.4 series is binary compatible with the 5.3.x series.
|
||||
Applications compiled for 5.3 will continue to run with 5.4 with the
|
||||
exception of on Windows when using MSVC 2012 or MSVC 2013. See note
|
||||
below.
|
||||
|
||||
Some of the changes listed in this file include issue tracking numbers
|
||||
corresponding to tasks in the Qt Bug Tracker:
|
||||
|
||||
http://bugreports.qt.io/
|
||||
|
||||
Each of these identifiers can be entered in the bug tracker to obtain more
|
||||
information about a particular change.
|
||||
|
||||
****************************************************************************
|
||||
* Important Behavior Changes *
|
||||
****************************************************************************
|
||||
- Restored binary compatibility with Qt 5.3.2 on Windows when using MSVC
|
||||
2012 or MSVC 2013. This means that Qt 5.4.1 is no longer binary compatible
|
||||
with Qt 5.4.0 when using either of those compilers.
|
||||
- [QTBUG-42594] OS X binary package: fixed incorrect linking to libraries in
|
||||
/opt/local/lib
|
||||
|
||||
****************************************************************************
|
||||
* Library *
|
||||
****************************************************************************
|
||||
|
||||
QtCore
|
||||
------
|
||||
- [QTBUG-43893] Fixed memory leak in qSetMessagePattern
|
||||
- [QTBUG-43513] QXmlStreamReader: Correctly parse XML containing NUL bytes
|
||||
in the input stream
|
||||
- [QTBUG-43352] QTemporaryDirectory: Properly clean up in case of a failure
|
||||
- [QTBUG-43827] Fixed regression in QSortFilterProxyModel which crashed when
|
||||
sorting a tree model
|
||||
|
||||
QtGui
|
||||
-----
|
||||
- [QTBUG-44273] Fixed misplacement of outlined text with native text rendering
|
||||
- [QTBUG-44147] Fixed VNC not working on some VNC servers
|
||||
- [QTBUG-43850] Fixed crash with multi-threaded font usage
|
||||
- [QTBUG-43850] Made the old harfbuzz fallback available at runtime
|
||||
- Improvements to the experimental high-dpi support
|
||||
- [QTBUG-43318] Better resolving of GLES3 functions to avoid issues when deploying
|
||||
on systems with GLES 2.0 only
|
||||
|
||||
QtWidgets
|
||||
---------
|
||||
- [QTBUG-43830] Fixed crash in stylesheets when styling QProgressBar
|
||||
- [QTBUG-43663] QColorDialog: Don't lose focus while color picking
|
||||
|
||||
QtNetwork
|
||||
---------
|
||||
- [QTBUG-43793] Fixed disconnections of QSSLSocket after starting encryption
|
||||
|
||||
QtSql
|
||||
-----
|
||||
- [QTBUG-36211] qpsql: Added timezone support for datetime fields.
|
||||
- qodbc: Fixed converted string values on Microsoft SQL Server 2012
|
||||
- [QTBUG-43874] QSqlQuery: Fixed failure of multiple execBatch() calls after
|
||||
a single prepare() call
|
||||
|
||||
QtPrintSupport
|
||||
--------------
|
||||
- [QTBUG-43124] Fixed QPrinter::{width,height} return values
|
||||
|
||||
****************************************************************************
|
||||
* Platform Specific Changes *
|
||||
****************************************************************************
|
||||
|
||||
Linux/XCB
|
||||
---------
|
||||
- [QTBUG-43436] Fixed regression when drag and drop to other applications
|
||||
- [QTBUG-43809] Turned off font hinting when doing high DPI scaling
|
||||
- [QTBUG-43743] Fixed constantly resizing bigger window when devicePixelRatio is
|
||||
greater than 1
|
||||
- [QTBUG-43713] Fixed problems with multiple screens with different device pixel
|
||||
ratios regarding window mapping and font sizes.
|
||||
- [QTBUG-43688] Fixed physical DPI and size for rotated screens on X11
|
||||
- [QTBUG-43049] Fixed grabKeyboard and grabMouse
|
||||
- [QTBUG-36862] Now sends a leave event to the other window when a popup shows
|
||||
which grabs the input
|
||||
- [QTBUG-41590] Turned off subpixel gamma-correction on XCB
|
||||
- Added support for SelectionClientClose in QXcbClipboard
|
||||
- Fixed -nograb and -dograb arguments
|
||||
- [QTBUG-43623] Fixed use after free
|
||||
- [QTBUG-43436] Fixed regression in DnD. Make sure to preserve the QDrag until all
|
||||
data has been received.
|
||||
|
||||
OS X
|
||||
----
|
||||
- [QTBUG-42952] macdeployqt: Fixed incorrect links to QtQuick plugin libraries
|
||||
- [QTBUG-43061] Fixed namespacing of QNSViewMouseMoveHelper
|
||||
- [QTBUG-43471] Fixed regression with Cut/Copy/Paste menu items staying disabled
|
||||
after a filedialog was closed
|
||||
- [QTBUG-42728] Fixed crash in QAction::setFont() when the font is unknown
|
||||
- qt_mac_loadMenuNib: Prevent stale NIB files by diffing file size
|
||||
- [QTBUG-43710] Fixed memory leak in QUrl::toCFUrl()
|
||||
- [QTBUG-43061] Fixed namespacing of QNSViewMouseMoveHelper
|
||||
- [QTBUG-40449] QMacPasteboardMimeFileUri: Use file paths instead of file references
|
||||
- [QTBUG-36787] Fixed crashes occurring during PAC detection in
|
||||
QNetworkProxyFactory::systemProxyForQuery()
|
||||
|
||||
Windows
|
||||
-------
|
||||
- [QTBUG-44021][QTBUG-35734] Fixed standard shortcuts when using a
|
||||
non-Latin keyboard layout
|
||||
- ANGLE: Fixed initialization of contexts
|
||||
- [QTBUG-43832] Delayed the creation of static OpenGL context
|
||||
- [QTBUG-43870] Fallback to ANGLE when OpenGL 1.x is detected
|
||||
- [QTBUG-43466] Use the chosen DnD effect in drag enter/move for drop
|
||||
- [QTBUG-41162] Fixed regression with dialogs not rendering when WA_TransluentBackground
|
||||
is used
|
||||
- [QTBUG-43833] Fixed crash when focus window does not have a native window
|
||||
- [QTBUG-43263] Added infrastructure for GPU-specific GL renderers
|
||||
- [QTBUG-43263] Added support for GPU detection
|
||||
- [QTBUG-41782] Prevent buffer over-run when getting the glyph images
|
||||
- [QTBUG-43420] Removed check for minimum/maximum size constraints
|
||||
- [QTBUG-43308] Release mouse capture when window blocked by modal window
|
||||
- [QTBUG-43082] Fixed PDF output when embedding fonts with a large internal leading
|
||||
- [QTBUG-43343] Pass on any unhandled multimedia keys back to the system
|
||||
- [QTBUG-43252] Do not register windows obtained by QWindow::fromWinId() for touch
|
||||
- [QTBUG-43252] Fixed window geometry when using QWindow::fromWinId()
|
||||
- [QTBUG-40578] Skip calculating margins for Qt::FramelessWindowHint
|
||||
- [QTBUG-36318] Handle WM_WINDOWPOSCHANGING during window creation
|
||||
- [QTBUG-42564] Brought FreeType rendering up to par with other platforms
|
||||
- [QTBUG-36220] [QTBUG-36318] Implement heightForWidth()
|
||||
- [QTBUG-40691] Correctly associate IME contexts
|
||||
- [QTBUG-40691] Added support for capabilities to QPlatformInputContext
|
||||
- Limit cursor cache to avoid hitting GDI resource limits
|
||||
- [QTBUG-43900] rcc: Fixed build failure on Windows XP / MingW 4.9
|
||||
- [QTBUG-41782] DirectWrite: Fixed possible buffer over-run in font handling
|
||||
|
||||
Android
|
||||
-------
|
||||
- [QTBUG-39712] Fixed problems caused by surface creation/destruction
|
||||
|
||||
iOS
|
||||
---
|
||||
- [QTBUG-43716] guard text responder from clearing selection
|
||||
|
||||
WinRT
|
||||
-----
|
||||
- [QTBUG-43862] Fixed QCoreApplication::quit() to exit application.
|
||||
- [QTBUG-44196] Fixed click events being ignored when using pressAndHold.
|
||||
|
||||
Windows Embedded
|
||||
----------------
|
||||
- [QTBUG-44022] Fixed finding windows and widgets
|
||||
|
||||
QNX
|
||||
---
|
||||
- [QTBUG-43850] Fixed Harfbuzz-NG support
|
||||
|
||||
****************************************************************************
|
||||
* Tools *
|
||||
****************************************************************************
|
||||
|
||||
configure & build system
|
||||
------------------------
|
||||
|
||||
- configure will now reject invalid -no-feature-* options.
|
||||
- pkg-config assisted libudev detection was fixed.
|
||||
- [QTBUG-43302][Android] The Android style is included when cross-building
|
||||
on Windows as well.
|
||||
- [QTBUG-43205][Unix] Fixed build D-Bus headers cannot be found.
|
||||
|
||||
qmake
|
||||
-----
|
||||
|
||||
- [QTBUG-39690][Windows] Fixed file separators in 'make clean'.
|
||||
- [QTBUG-40264][Unix] Fixed 'make distclean' for a dynamic library target.
|
||||
- [QTBUG-42678] 'make distclean' now removes .qmake.{stash|super}.
|
||||
- [QTBUG-43026][VS2010+] Fixed compilation of .rc files.
|
||||
- [QTBUG-43457][MSVC] Fixed QMAKE_TARGET.arch for amd64_x86 x-build.
|
||||
- INCLUDEPATH+=. is now unnecessary with all generators.
|
@ -74,7 +74,7 @@
|
||||
\title Livecoding video effects with Qt5
|
||||
*/
|
||||
/*!
|
||||
\externalpage http://blog.qt.digia.com/2012/02/29/pimp-my-video-shader-effects-and-multimedia/
|
||||
\externalpage http://blog.qt.io/2012/02/29/pimp-my-video-shader-effects-and-multimedia/
|
||||
\title Pimp my video
|
||||
*/
|
||||
/*!
|
||||
@ -92,12 +92,12 @@
|
||||
*/
|
||||
|
||||
/*!
|
||||
\externalpage http://qt-project.org/doc/qt-4.8
|
||||
\externalpage http://doc.qt.io/qt-4.8
|
||||
\title Qt 4.8 Reference Documentation
|
||||
*/
|
||||
|
||||
/*!
|
||||
\externalpage http://qt-project.org/doc/qt-4.8/qtquick.html
|
||||
\externalpage http://doc.qt.io/qt-4.8/qtquick.html
|
||||
\title Qt Quick 1 Reference Documentation
|
||||
*/
|
||||
|
||||
|
@ -33,9 +33,9 @@ HTML.footer += \
|
||||
"</li>\n" \
|
||||
"<li id=\"menu-item-33\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-33\"><a href=\"http://qt.io/developers/\">Developers</a>\n" \
|
||||
"<ul class=\"sub-menu\">\n" \
|
||||
" <li id=\"menu-item-1365\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1365\"><a href=\"http://qt-project.org/doc/\">Documentation</a></li>\n" \
|
||||
" <li id=\"menu-item-1364\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1364\"><a href=\"http://qt-project.org/doc/qt-5/qtexamplesandtutorials.html\">Examples & Tutorials</a></li>\n" \
|
||||
" <li id=\"menu-item-1363\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1363\"><a href=\"http://qt-project.org/doc/qt-5/topics-app-development.html\">Tools</a></li>\n" \
|
||||
" <li id=\"menu-item-1365\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1365\"><a href=\"http://doc.qt.io/\">Documentation</a></li>\n" \
|
||||
" <li id=\"menu-item-1364\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1364\"><a href=\"http://doc.qt.io/qt-5/qtexamplesandtutorials.html\">Examples & Tutorials</a></li>\n" \
|
||||
" <li id=\"menu-item-1363\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1363\"><a href=\"http://doc.qt.io/qt-5/topics-app-development.html\">Tools</a></li>\n" \
|
||||
" <li id=\"menu-item-1361\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1361\"><a href=\"http://qt-project.org/wiki\">Wiki</a></li>\n" \
|
||||
" <li id=\"menu-item-1360\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1360\"><a href=\"http://qt-project.org/forums\">Forums</a></li>\n" \
|
||||
" <li id=\"menu-item-1362\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1362\"><a href=\"http://qt-project.org/wiki/Qt-Contribution-Guidelines\">Contribute to Qt</a></li>\n" \
|
||||
|
@ -79,7 +79,7 @@ HTML.postheader = \
|
||||
" </a>\n" \
|
||||
" </li>\n" \
|
||||
" <li>\n" \
|
||||
" <a target=\"_blank\" href=\"http://blog.qt.digia.com/\" data-icon=\"\">\n" \
|
||||
" <a target=\"_blank\" href=\"http://blog.qt.io/\" data-icon=\"\">\n" \
|
||||
" <span>Blog</span>\n" \
|
||||
" </a>\n" \
|
||||
" </li>\n" \
|
||||
|
@ -76,7 +76,7 @@ RSSListing::RSSListing(QWidget *parent)
|
||||
{
|
||||
|
||||
lineEdit = new QLineEdit(this);
|
||||
lineEdit->setText("http://http://blog.qt.io/feed/");
|
||||
lineEdit->setText("http://blog.qt.io/feed/");
|
||||
|
||||
fetchButton = new QPushButton(tr("Fetch"), this);
|
||||
|
||||
|
@ -5,6 +5,6 @@
|
||||
|
||||
#! [1]
|
||||
# To include a literal hash character, use the $$LITERAL_HASH variable:
|
||||
urlPieces = http://qt-project.org/doc/qt-5.0/qtgui/qtextdocument.html pageCount
|
||||
urlPieces = http://doc.qt.io/qt-5/qtextdocument.html pageCount
|
||||
message($$join(urlPieces, $$LITERAL_HASH))
|
||||
#! [1]
|
||||
|
@ -769,12 +769,7 @@
|
||||
|
||||
\section2 Creating Visual Studio Project Files
|
||||
|
||||
Developers using Visual Studio to write Qt applications can use the
|
||||
Visual Studio integration facilities provided with the
|
||||
\l{Qt Commercial License}
|
||||
and do not need to worry about how project dependencies are managed.
|
||||
|
||||
However, some developers may need to import an existing
|
||||
This section describes how to import an existing
|
||||
qmake project into Visual Studio.
|
||||
qmake is able to take a project file and create
|
||||
a Visual Studio project that contains all the necessary information
|
||||
|
@ -343,8 +343,8 @@ static QStringList unquote(const QStringList &values)
|
||||
|
||||
// Tree file generation ---------------------------------------------
|
||||
void XTreeNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName,
|
||||
VCProject &tool, const QString &filter, const QString &filterId) {
|
||||
|
||||
VCProject &tool, const QString &filter)
|
||||
{
|
||||
if (children.size()) {
|
||||
// Filter
|
||||
QString tempFilterName;
|
||||
@ -364,24 +364,24 @@ void XTreeNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString
|
||||
if ((*it)->children.size())
|
||||
{
|
||||
if ( !tempFilterName.isEmpty() )
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, tempFilterName, filterId);
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, tempFilterName);
|
||||
else
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, filter, filterId);
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, filter);
|
||||
}
|
||||
// Second round, do leafs
|
||||
for (it = children.constBegin(); it != end; ++it)
|
||||
if (!(*it)->children.size())
|
||||
{
|
||||
if ( !tempFilterName.isEmpty() )
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, tempFilterName, filterId);
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, tempFilterName);
|
||||
else
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, filter, filterId);
|
||||
(*it)->generateXML(xml, xmlFilter, it.key(), tool, filter);
|
||||
}
|
||||
} else {
|
||||
// Leaf
|
||||
xml << tag(_ItemGroup);
|
||||
xmlFilter << tag(_ItemGroup);
|
||||
VCXProjectWriter::outputFileConfigs(tool, xml, xmlFilter, info, filter, filterId);
|
||||
VCXProjectWriter::outputFileConfigs(tool, xml, xmlFilter, info, filter);
|
||||
xmlFilter << closetag();
|
||||
xml << closetag();
|
||||
}
|
||||
@ -389,14 +389,15 @@ void XTreeNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString
|
||||
|
||||
// Flat file generation ---------------------------------------------
|
||||
void XFlatNode::generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &/*tagName*/,
|
||||
VCProject &tool, const QString &filter, const QString &filterId) {
|
||||
VCProject &tool, const QString &filter)
|
||||
{
|
||||
if (children.size()) {
|
||||
ChildrenMapFlat::ConstIterator it = children.constBegin();
|
||||
ChildrenMapFlat::ConstIterator end = children.constEnd();
|
||||
xml << tag(_ItemGroup);
|
||||
xmlFilter << tag(_ItemGroup);
|
||||
for (; it != end; ++it) {
|
||||
VCXProjectWriter::outputFileConfigs(tool, xml, xmlFilter, (*it), filter, filterId);
|
||||
VCXProjectWriter::outputFileConfigs(tool, xml, xmlFilter, (*it), filter);
|
||||
}
|
||||
xml << closetag();
|
||||
xmlFilter << closetag();
|
||||
@ -1826,21 +1827,29 @@ void VCXProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, XmlOutpu
|
||||
if (!root->hasElements())
|
||||
return;
|
||||
|
||||
root->generateXML(xml, xmlFilter, "", project, filtername, filtername); // output root tree
|
||||
root->generateXML(xml, xmlFilter, "", project, filtername); // output root tree
|
||||
}
|
||||
|
||||
static QString stringBeforeFirstBackslash(const QString &str)
|
||||
{
|
||||
int idx = str.indexOf(QLatin1Char('\\'));
|
||||
return idx == -1 ? str : str.left(idx);
|
||||
}
|
||||
|
||||
// Output all configurations (by filtername) for a file (by info)
|
||||
// A filters config output is in VCFilter.outputFileConfig()
|
||||
void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter,
|
||||
const VCFilterFile &info, const QString &filtername,
|
||||
const QString &filterId)
|
||||
const VCFilterFile &info, const QString &filtername)
|
||||
{
|
||||
// In non-flat mode the filter names have directory suffixes, e.g. "Generated Files\subdir".
|
||||
const QString cleanFilterName = stringBeforeFirstBackslash(filtername);
|
||||
|
||||
// We need to check if the file has any custom build step.
|
||||
// If there is one then it has to be included with "CustomBuild Include"
|
||||
bool hasCustomBuildStep = false;
|
||||
QVarLengthArray<OutputFilterData> data(project.SingleProjects.count());
|
||||
for (int i = 0; i < project.SingleProjects.count(); ++i) {
|
||||
data[i].filter = project.SingleProjects.at(i).filterByName(filterId);
|
||||
data[i].filter = project.SingleProjects.at(i).filterByName(cleanFilterName);
|
||||
if (!data[i].filter.Config) // only if the filter is not empty
|
||||
continue;
|
||||
VCFilter &filter = data[i].filter;
|
||||
@ -1854,6 +1863,7 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml
|
||||
filter.CompilerTool.config = filter.Config;
|
||||
|
||||
VCFilterFile fileInFilter = filter.findFile(info.file, &data[i].inBuild);
|
||||
data[i].info = fileInFilter;
|
||||
data[i].inBuild &= !fileInFilter.excludeFromBuild;
|
||||
if (data[i].inBuild && filter.addExtraCompiler(fileInFilter))
|
||||
hasCustomBuildStep = true;
|
||||
@ -1861,12 +1871,13 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml
|
||||
|
||||
bool fileAdded = false;
|
||||
for (int i = 0; i < project.SingleProjects.count(); ++i) {
|
||||
const VCFilter &filter = project.SingleProjects.at(i).filterByName(filterId);
|
||||
if (!filter.Config) // only if the filter is not empty
|
||||
OutputFilterData *d = &data[i];
|
||||
if (!d->filter.Config) // only if the filter is not empty
|
||||
continue;
|
||||
if (outputFileConfig(&data[i], xml, xmlFilter, info.file, fileAdded,
|
||||
hasCustomBuildStep))
|
||||
if (outputFileConfig(d, xml, xmlFilter, info.file, filtername, fileAdded,
|
||||
hasCustomBuildStep)) {
|
||||
fileAdded = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !fileAdded )
|
||||
@ -1877,8 +1888,8 @@ void VCXProjectWriter::outputFileConfigs(VCProject &project, XmlOutput &xml, Xml
|
||||
}
|
||||
|
||||
bool VCXProjectWriter::outputFileConfig(OutputFilterData *d, XmlOutput &xml, XmlOutput &xmlFilter,
|
||||
const QString &filename, bool fileAdded,
|
||||
bool hasCustomBuildStep)
|
||||
const QString &filename, const QString &fullFilterName,
|
||||
bool fileAdded, bool hasCustomBuildStep)
|
||||
{
|
||||
VCFilter &filter = d->filter;
|
||||
if (d->inBuild) {
|
||||
@ -1901,7 +1912,7 @@ bool VCXProjectWriter::outputFileConfig(OutputFilterData *d, XmlOutput &xml, Xml
|
||||
|
||||
xmlFilter << tag("CustomBuild")
|
||||
<< attrTag("Include", Option::fixPathToTargetOS(filename))
|
||||
<< attrTagS("Filter", filter.Name);
|
||||
<< attrTagS("Filter", fullFilterName);
|
||||
|
||||
xml << tag("CustomBuild")
|
||||
<< attrTag("Include", Option::fixPathToTargetOS(filename));
|
||||
@ -1919,7 +1930,7 @@ bool VCXProjectWriter::outputFileConfig(OutputFilterData *d, XmlOutput &xml, Xml
|
||||
if (!fileAdded)
|
||||
{
|
||||
fileAdded = true;
|
||||
outputFileConfig(xml, xmlFilter, filename, filter.Name);
|
||||
outputFileConfig(xml, xmlFilter, filename, fullFilterName);
|
||||
}
|
||||
|
||||
const QString condition = generateCondition(*filter.Config);
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
virtual void addElement(const QString &filepath, const VCFilterFile &allInfo) = 0;
|
||||
virtual void removeElements()= 0;
|
||||
virtual void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName,
|
||||
VCProject &tool, const QString &filter, const QString &filterId) = 0;
|
||||
VCProject &tool, const QString &filter) = 0;
|
||||
virtual bool hasElements() = 0;
|
||||
};
|
||||
|
||||
@ -108,7 +108,7 @@ public:
|
||||
}
|
||||
|
||||
void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCProject &tool,
|
||||
const QString &filter, const QString &filterId);
|
||||
const QString &filter);
|
||||
bool hasElements() {
|
||||
return children.size() != 0;
|
||||
}
|
||||
@ -149,7 +149,7 @@ public:
|
||||
}
|
||||
|
||||
void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCProject &proj,
|
||||
const QString &filter, const QString &filterId);
|
||||
const QString &filter);
|
||||
bool hasElements() {
|
||||
return children.size() != 0;
|
||||
}
|
||||
@ -183,8 +183,11 @@ private:
|
||||
|
||||
static void addFilters(VCProject &project, XmlOutput &xmlFilter, const QString &filterName);
|
||||
static void outputFilter(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filtername);
|
||||
static void outputFileConfigs(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter, const VCFilterFile &info, const QString &filtername, const QString &filterId);
|
||||
static bool outputFileConfig(OutputFilterData *d, XmlOutput &xml, XmlOutput &xmlFilter, const QString &filename, bool fileAdded, bool hasCustomBuildStep);
|
||||
static void outputFileConfigs(VCProject &project, XmlOutput &xml, XmlOutput &xmlFilter,
|
||||
const VCFilterFile &info, const QString &filtername);
|
||||
static bool outputFileConfig(OutputFilterData *d, XmlOutput &xml, XmlOutput &xmlFilter,
|
||||
const QString &filename, const QString &fullFilterName,
|
||||
bool fileAdded, bool hasCustomBuildStep);
|
||||
static void outputFileConfig(XmlOutput &xml, XmlOutput &xmlFilter, const QString &fileName, const QString &filterName);
|
||||
static QString generateCondition(const VCConfiguration &config);
|
||||
|
||||
|
@ -970,7 +970,11 @@ static ProString msvcBinDirToQMakeArch(QString subdir)
|
||||
|
||||
static ProString defaultMsvcArchitecture()
|
||||
{
|
||||
#if defined(Q_OS_WIN64)
|
||||
return ProString("x86_64");
|
||||
#else
|
||||
return ProString("x86");
|
||||
#endif
|
||||
}
|
||||
|
||||
static ProString msvcArchitecture(const QString &vcInstallDir, const QString &pathVar)
|
||||
|
4
src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro
vendored
4
src/3rdparty/harfbuzz-ng/harfbuzz-ng.pro
vendored
@ -7,15 +7,15 @@ CONFIG += \
|
||||
|
||||
load(qt_helper_lib)
|
||||
|
||||
DEFINES += HAVE_OT HB_NO_UNICODE_FUNCS HB_DISABLE_DEPRECATED
|
||||
DEFINES += HAVE_OT HAVE_QT5_ATOMICS HB_NO_UNICODE_FUNCS HB_DISABLE_DEPRECATED
|
||||
|
||||
# platform/compiler specific definitions
|
||||
DEFINES += HAVE_ATEXIT
|
||||
gcc: DEFINES += HAVE_INTEL_ATOMIC_PRIMITIVES
|
||||
unix: DEFINES += HAVE_PTHREAD HAVE_SCHED_H HAVE_SCHED_YIELD
|
||||
win32: DEFINES += HB_NO_WIN1256
|
||||
|
||||
INCLUDEPATH += $$PWD/include
|
||||
INCLUDEPATH += $$QT.core.includes
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/src/hb-blob.cc \
|
||||
|
@ -41,6 +41,25 @@
|
||||
|
||||
#if 0
|
||||
|
||||
#elif !defined(HB_NO_MT) && defined(HAVE_QT5_ATOMICS)
|
||||
#include <QtCore/qatomic.h>
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
namespace {
|
||||
// We need to cast hb_atomic_int_t to QAtomicInt and pointers to
|
||||
// QAtomicPointer instead of using QAtomicOps, otherwise we get a failed
|
||||
// overload resolution of the template arguments for testAndSetOrdered.
|
||||
template <typename T> QAtomicPointer<T> *makeAtomicPointer(T * const &ptr)
|
||||
{
|
||||
return reinterpret_cast<QAtomicPointer<T> *>(const_cast<T **>(&ptr));
|
||||
}
|
||||
}
|
||||
|
||||
typedef int hb_atomic_int_t;
|
||||
#define hb_atomic_int_add(AI, V) reinterpret_cast<QAtomicInt &>(AI).fetchAndAddOrdered(V)
|
||||
#define hb_atomic_ptr_get(P) makeAtomicPointer(*P)->loadAcquire()
|
||||
#define hb_atomic_ptr_cmpexch(P,O,N) makeAtomicPointer(*P)->testAndSetOrdered((O), (N))
|
||||
|
||||
#elif !defined(HB_NO_MT) && (defined(_WIN32) || defined(__CYGWIN__))
|
||||
|
||||
|
10
src/3rdparty/harfbuzz-ng/src/hb-private.hh
vendored
10
src/3rdparty/harfbuzz-ng/src/hb-private.hh
vendored
@ -94,16 +94,6 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#undef inline
|
||||
#define inline __inline
|
||||
#endif
|
||||
|
||||
#ifdef __STRICT_ANSI__
|
||||
#undef inline
|
||||
#define inline __inline__
|
||||
#endif
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
#define HB_FUNC __PRETTY_FUNCTION__
|
||||
#elif defined(_MSC_VER)
|
||||
|
@ -134,12 +134,12 @@ if (NOT TARGET Qt5::WinMain)
|
||||
set(_isNotExcluded $<NOT:$<BOOL:$<TARGET_PROPERTY:Qt5_NO_LINK_QTMAIN>>>)
|
||||
set(_isPolicyNEW $<TARGET_POLICY:CMP0020>)
|
||||
get_target_property(_configs Qt5::Core IMPORTED_CONFIGURATIONS)
|
||||
set_property(TARGET Qt5::Core APPEND PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES
|
||||
$<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt5::WinMain>
|
||||
)
|
||||
# For backward compatibility with CMake < 2.8.12
|
||||
foreach(_config ${_configs})
|
||||
set_property(TARGET Qt5::Core APPEND PROPERTY
|
||||
INTERFACE_LINK_LIBRARIES
|
||||
$<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt5::WinMain>
|
||||
)
|
||||
# For backward compatibility with CMake < 2.8.12
|
||||
set_property(TARGET Qt5::Core APPEND PROPERTY
|
||||
IMPORTED_LINK_INTERFACE_LIBRARIES_${_config}
|
||||
$<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt5::WinMain>
|
||||
|
@ -44,7 +44,7 @@
|
||||
animations in parallel. The animation group finishes when the
|
||||
longest lasting animation has finished.
|
||||
|
||||
You can treat QParallelAnimation as any other QAbstractAnimation,
|
||||
You can treat QParallelAnimationGroup as any other QAbstractAnimation,
|
||||
e.g., pause, resume, or add it to other animation groups.
|
||||
|
||||
\code
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
// use compiler intrinsics for all atomic functions
|
||||
# define QT_INTERLOCKED_PREFIX _
|
||||
# define QT_INTERLOCKED_PROTOTYPE __cdecl
|
||||
# define QT_INTERLOCKED_PROTOTYPE
|
||||
# define QT_INTERLOCKED_DECLARE_PROTOTYPES
|
||||
# define QT_INTERLOCKED_INTRINSIC
|
||||
# define Q_ATOMIC_INT16_IS_SUPPORTED
|
||||
|
@ -25,7 +25,7 @@ qhp.QtCore.subprojects.classes.sortPages = true
|
||||
|
||||
tagfile = ../../../doc/qtcore/qtcore.tags
|
||||
|
||||
depends += activeqt qtdbus qtgui qtwidgets qtnetwork qtdoc qtmacextras qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake
|
||||
depends += activeqt qtdbus qtgui qtwidgets qtnetwork qtdoc qtmacextras qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake qtwinextras
|
||||
# depends += qtqml # Qt namespace collides with QtQml::Qt, see QTBUG-38630
|
||||
|
||||
headerdirs += ..
|
||||
|
@ -48,7 +48,7 @@
|
||||
|
||||
The animation framework aims to provide an easy way for creating animated
|
||||
and smooth GUIs. By animating Qt properties, the framework provides great
|
||||
freedom for animating widgets and other {QObject}s. The framework can
|
||||
freedom for animating widgets and other \l{QObject}s. The framework can
|
||||
also be used with the Graphics View framework. Many of the concepts
|
||||
available in the animation framework are also available in \l{Qt Quick},
|
||||
where it offers a declarative way of defining animations. Much of the
|
||||
@ -57,7 +57,7 @@
|
||||
|
||||
In this overview, we explain the basics of its architecture. We
|
||||
also show examples of the most common techniques that the
|
||||
framework allows for animating {QObject}s and graphics items.
|
||||
framework allows for animating \l{QObject}s and graphics items.
|
||||
|
||||
\tableofcontents
|
||||
|
||||
@ -85,7 +85,7 @@
|
||||
over the property using an easing curve. So when you want to
|
||||
animate a value, you can declare it as a property and make your
|
||||
class a QObject. Note that this gives us great freedom in
|
||||
animating already existing widgets and other {QObject}s.
|
||||
animating already existing widgets and other \l{QObject}s.
|
||||
|
||||
Complex animations can be constructed by building a tree structure
|
||||
of \l{QAbstractAnimation}s. The tree is built by using
|
||||
|
@ -87,7 +87,7 @@ There are three general ways to use QTextStream when reading text files:
|
||||
|
||||
\list
|
||||
\li Chunk by chunk, by calling \l{QBuffer::readLine()}{readLine()} or \l{QBuffer::readAll()}{readAll()}.
|
||||
\li Word by word. QTextStream supports streaming into {QString}s, {QByteArray}s
|
||||
\li Word by word. QTextStream supports streaming into \l{QString}s, \l{QByteArray}s
|
||||
and char* buffers. Words are delimited by space, and leading white space
|
||||
is automatically skipped.
|
||||
\li Character by character, by streaming into QChar or char types. This
|
||||
|
@ -173,7 +173,11 @@
|
||||
# else
|
||||
# define Q_CC_CLANG ((__clang_major__ * 100) + __clang_minor__)
|
||||
# endif
|
||||
# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
|
||||
# if __has_builtin(__builtin_assume)
|
||||
# define Q_ASSUME_IMPL(expr) __builtin_assume(expr)
|
||||
# else
|
||||
# define Q_ASSUME_IMPL(expr) if (expr){} else __builtin_unreachable()
|
||||
# endif
|
||||
# define Q_UNREACHABLE_IMPL() __builtin_unreachable()
|
||||
# if !defined(__has_extension)
|
||||
# /* Compatibility with older Clang versions */
|
||||
@ -545,7 +549,10 @@
|
||||
# define Q_COMPILER_UNRESTRICTED_UNIONS
|
||||
# endif
|
||||
# if __INTEL_COMPILER >= 1500
|
||||
# define Q_COMPILER_CONSTEXPR
|
||||
# if __INTEL_COMPILER * 100 + __INTEL_COMPILER_UPDATE >= 150001
|
||||
// the bug mentioned above is fixed in 15.0.1
|
||||
# define Q_COMPILER_CONSTEXPR
|
||||
# endif
|
||||
# define Q_COMPILER_ALIGNAS
|
||||
# define Q_COMPILER_ALIGNOF
|
||||
# define Q_COMPILER_INHERITING_CONSTRUCTORS
|
||||
|
@ -882,6 +882,7 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic
|
||||
/* make use of decltype or GCC's __typeof__ extension */
|
||||
template <typename T>
|
||||
class QForeachContainer {
|
||||
QForeachContainer &operator=(const QForeachContainer &) Q_DECL_EQ_DELETE;
|
||||
public:
|
||||
inline QForeachContainer(const T& t) : c(t), i(c.begin()), e(c.end()), control(1) { }
|
||||
const T c;
|
||||
|
@ -78,11 +78,12 @@
|
||||
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
#if !defined QT_NO_REGULAREXPRESSION
|
||||
# if (defined(__GLIBC__) && defined(__GLIBCXX__)) || (__has_include(<cxxabi.h>) && __has_include(<execinfo.h>))
|
||||
# ifdef __UCLIBC__
|
||||
# if __UCLIBC_HAS_BACKTRACE__
|
||||
# define QLOGGING_HAVE_BACKTRACE
|
||||
# endif
|
||||
# elif (defined(__GLIBC__) && defined(__GLIBCXX__)) || (__has_include(<cxxabi.h>) && __has_include(<execinfo.h>))
|
||||
# define QLOGGING_HAVE_BACKTRACE
|
||||
# include <qregularexpression.h>
|
||||
# include <cxxabi.h>
|
||||
# include <execinfo.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@ -116,6 +117,12 @@ static QT_PREPEND_NAMESPACE(qint64) qt_gettid()
|
||||
return qintptr(QThread::currentThreadId());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef QLOGGING_HAVE_BACKTRACE
|
||||
# include <qregularexpression.h>
|
||||
# include <cxxabi.h>
|
||||
# include <execinfo.h>
|
||||
#endif
|
||||
#endif // !QT_BOOTSTRAPPED
|
||||
|
||||
#include <stdio.h>
|
||||
@ -998,7 +1005,7 @@ QMessagePattern::QMessagePattern()
|
||||
|
||||
QMessagePattern::~QMessagePattern()
|
||||
{
|
||||
for (int i = 0; literals[i] != 0; ++i)
|
||||
for (int i = 0; literals[i]; ++i)
|
||||
delete [] literals[i];
|
||||
delete [] literals;
|
||||
literals = 0;
|
||||
@ -1008,8 +1015,12 @@ QMessagePattern::~QMessagePattern()
|
||||
|
||||
void QMessagePattern::setPattern(const QString &pattern)
|
||||
{
|
||||
if (literals) {
|
||||
for (int i = 0; literals[i]; ++i)
|
||||
delete [] literals[i];
|
||||
delete [] literals;
|
||||
}
|
||||
delete [] tokens;
|
||||
delete [] literals;
|
||||
|
||||
// scanner
|
||||
QList<QString> lexemes;
|
||||
@ -1285,13 +1296,13 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con
|
||||
message.append(QString::number(qlonglong(QThread::currentThread()->currentThread()), 16));
|
||||
#ifdef QLOGGING_HAVE_BACKTRACE
|
||||
} else if (token == backtraceTokenC) {
|
||||
QVarLengthArray<void*, 32> buffer(15 + pattern->backtraceDepth);
|
||||
QVarLengthArray<void*, 32> buffer(7 + pattern->backtraceDepth);
|
||||
int n = backtrace(buffer.data(), buffer.size());
|
||||
if (n > 0) {
|
||||
QScopedPointer<char*, QScopedPointerPodDeleter> strings(backtrace_symbols(buffer.data(), n));
|
||||
int numberPrinted = 0;
|
||||
for (int i = 0; i < n && numberPrinted < pattern->backtraceDepth; ++i) {
|
||||
QString trace = QString::fromLatin1(strings.data()[i]);
|
||||
QScopedPointer<char*, QScopedPointerPodDeleter> strings(backtrace_symbols(buffer.data() + i, 1));
|
||||
QString trace = QString::fromLatin1(strings.data()[0]);
|
||||
// The results of backtrace_symbols looks like this:
|
||||
// /lib/libc.so.6(__libc_start_main+0xf3) [0x4a937413]
|
||||
// The offset and function name are optional.
|
||||
|
@ -498,7 +498,7 @@
|
||||
\value TextExpandTabs Makes the U+0009 (ASCII tab) character move to
|
||||
the next tab stop.
|
||||
\value TextShowMnemonic Displays the string "\&P" as \underline{P}
|
||||
(see QButton for an example). For an ampersand, use "\&\&".
|
||||
For an ampersand, use "\&\&".
|
||||
\value TextWordWrap Breaks lines at appropriate points, e.g. at word
|
||||
boundaries.
|
||||
\value TextWrapAnywhere Breaks lines anywhere, even within words.
|
||||
@ -902,8 +902,7 @@
|
||||
on QWidget::contentsRect(). This is set by the widget's author.
|
||||
|
||||
\value WA_LayoutUsesWidgetRect Ignore the layout item rect from the style
|
||||
when laying out this widget with QLayout. This makes a difference in
|
||||
QMacStyle and QPlastiqueStyle for some widgets.
|
||||
when laying out this widget with QLayout.
|
||||
|
||||
\value WA_MacNoClickThrough When a widget that has this attribute set
|
||||
is clicked, and its window is inactive, the click will make the window
|
||||
@ -1162,7 +1161,7 @@
|
||||
_NET_WM_WINDOW_TYPE X11 window property. See
|
||||
http://standards.freedesktop.org/wm-spec/ for more details. This
|
||||
attribute has no effect on non-X11 platforms. \b Note: Qt
|
||||
automatically sets this attribute for QMenus added to a QMenuBar.
|
||||
automatically sets this attribute for QMenu objects added to a QMenuBar.
|
||||
|
||||
\value WA_X11NetWmWindowTypePopupMenu Adds _NET_WM_WINDOW_TYPE_POPUP_MENU
|
||||
to the window's _NET_WM_WINDOW_TYPE X11 window property. See
|
||||
|
@ -40,6 +40,7 @@
|
||||
#endif
|
||||
|
||||
#include "qdebug.h"
|
||||
#include "qmetaobject.h"
|
||||
#include <private/qtextstream_p.h>
|
||||
#include <private/qtools_p.h>
|
||||
|
||||
@ -284,12 +285,12 @@ void QDebug::putString(const QChar *begin, size_t length)
|
||||
if (stream->testFlag(Stream::NoQuotes)) {
|
||||
// no quotes, write the string directly too (no pretty-printing)
|
||||
// this respects the QTextStream state, though
|
||||
stream->ts.d_ptr->putString(begin, length);
|
||||
stream->ts.d_ptr->putString(begin, int(length));
|
||||
} else {
|
||||
// we'll reset the QTextStream formatting mechanisms, so save the state
|
||||
QDebugStateSaver saver(*this);
|
||||
stream->ts.d_ptr->params.reset();
|
||||
putEscapedString(stream->ts.d_ptr.data(), reinterpret_cast<const ushort *>(begin), length);
|
||||
putEscapedString(stream->ts.d_ptr.data(), reinterpret_cast<const ushort *>(begin), int(length));
|
||||
}
|
||||
}
|
||||
|
||||
@ -302,14 +303,14 @@ void QDebug::putByteArray(const char *begin, size_t length, Latin1Content conten
|
||||
if (stream->testFlag(Stream::NoQuotes)) {
|
||||
// no quotes, write the string directly too (no pretty-printing)
|
||||
// this respects the QTextStream state, though
|
||||
QString string = content == ContainsLatin1 ? QString::fromLatin1(begin, length) : QString::fromUtf8(begin, length);
|
||||
QString string = content == ContainsLatin1 ? QString::fromLatin1(begin, int(length)) : QString::fromUtf8(begin, int(length));
|
||||
stream->ts.d_ptr->putString(string);
|
||||
} else {
|
||||
// we'll reset the QTextStream formatting mechanisms, so save the state
|
||||
QDebugStateSaver saver(*this);
|
||||
stream->ts.d_ptr->params.reset();
|
||||
putEscapedString(stream->ts.d_ptr.data(), reinterpret_cast<const uchar *>(begin),
|
||||
length, content == ContainsLatin1);
|
||||
int(length), content == ContainsLatin1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -643,4 +644,23 @@ QDebugStateSaver::~QDebugStateSaver()
|
||||
d->restoreState();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_QOBJECT
|
||||
/*!
|
||||
\internal
|
||||
*/
|
||||
QDebug qt_QMetaEnum_debugOperator(QDebug &dbg, int value, const QMetaObject *meta, const char *name)
|
||||
{
|
||||
QDebugStateSaver saver(dbg);
|
||||
QMetaEnum me = meta->enumerator(meta->indexOfEnumerator(name));
|
||||
const char *key = me.valueToKey(value);
|
||||
dbg.nospace() << meta->className() << "::" << name << '(';
|
||||
if (key)
|
||||
dbg << key;
|
||||
else
|
||||
dbg << value;
|
||||
dbg << ')';
|
||||
return dbg;
|
||||
}
|
||||
#endif
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -261,6 +261,19 @@ inline QDebug operator<<(QDebug debug, const QContiguousCache<T> &cache)
|
||||
return debug.maybeSpace();
|
||||
}
|
||||
|
||||
#ifndef QT_NO_QOBJECT
|
||||
Q_CORE_EXPORT QDebug qt_QMetaEnum_debugOperator(QDebug&, int value, const QMetaObject *meta, const char *name);
|
||||
|
||||
template<typename T>
|
||||
typename QtPrivate::QEnableIf<QtPrivate::IsQEnumHelper<T>::Value, QDebug>::Type
|
||||
operator<<(QDebug dbg, T value)
|
||||
{
|
||||
const QMetaObject *obj = qt_getEnumMetaObject(value);
|
||||
const char *name = qt_getEnumName(value);
|
||||
return qt_QMetaEnum_debugOperator(dbg, typename QFlags<T>::Int(value), obj, name);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
inline QDebug operator<<(QDebug debug, const QFlags<T> &flags)
|
||||
{
|
||||
|
@ -231,7 +231,7 @@ static QString qrcScheme()
|
||||
}
|
||||
|
||||
/*!
|
||||
This is a convenience version of select operating on QUrls. If the scheme is not file or qrc,
|
||||
This is a convenience version of select operating on QUrl objects. If the scheme is not file or qrc,
|
||||
\a filePath is returned immediately. Otherwise selection is applied to the path of \a filePath
|
||||
and a QUrl is returned with the selected path and other QUrl parts the same as \a filePath.
|
||||
|
||||
|
@ -706,7 +706,7 @@ bool QIODevice::reset()
|
||||
number of bytes to allocate in a buffer before reading.
|
||||
|
||||
Subclasses that reimplement this function must call the base
|
||||
implementation in order to include the size of QIODevices' buffer. Example:
|
||||
implementation in order to include the size of the buffer of QIODevice. Example:
|
||||
|
||||
\snippet code/src_corelib_io_qiodevice.cpp 1
|
||||
|
||||
|
@ -1456,7 +1456,7 @@ void QProcess::setStandardErrorFile(const QString &fileName, OpenMode mode)
|
||||
The following shell command:
|
||||
\snippet code/src_corelib_io_qprocess.cpp 2
|
||||
|
||||
Can be accomplished with QProcesses with the following code:
|
||||
Can be accomplished with QProcess with the following code:
|
||||
\snippet code/src_corelib_io_qprocess.cpp 3
|
||||
*/
|
||||
void QProcess::setStandardOutputProcess(QProcess *destination)
|
||||
|
@ -197,7 +197,7 @@ Q_GLOBAL_STATIC(QStringList, resourceSearchPaths)
|
||||
path requested in setFileName().
|
||||
|
||||
The unregisterResource() function removes a reference to a particular
|
||||
file. If there are QResources that currently reference resources related
|
||||
file. If there are QResource objects that currently reference resources related
|
||||
to the unregistered file, they will continue to be valid but the resource
|
||||
file itself will be removed from the resource roots, and thus no further
|
||||
QResource can be created pointing into this resource data. The resource
|
||||
|
@ -77,15 +77,10 @@ QT_BEGIN_NAMESPACE
|
||||
this user, but should still be assumed to be unreachable by applications by
|
||||
other users.
|
||||
|
||||
The only exception is QStandardPaths::TempLocation (which is the same as
|
||||
QDir::tempPath()): the path returned may be application-specific, but files
|
||||
stored there may be accessed by other applications run by the same user.
|
||||
|
||||
Data interchange with other users is out of the scope of QStandardPaths.
|
||||
|
||||
\value DesktopLocation Returns the user's desktop directory. This is a generic value.
|
||||
On systems with no concept of a desktop, this is the same as
|
||||
QStandardPaths::HomeLocation.
|
||||
On systems with no concept of a desktop.
|
||||
\value DocumentsLocation Returns the directory containing user document files.
|
||||
This is a generic value. The returned path is never empty.
|
||||
\value FontsLocation Returns the directory containing user's fonts. This is a generic value.
|
||||
@ -118,9 +113,6 @@ QT_BEGIN_NAMESPACE
|
||||
\value GenericCacheLocation Returns a directory location where user-specific non-essential
|
||||
(cached) data, shared across applications, should be written. This is a generic value.
|
||||
Note that the returned path may be empty if the system has no concept of shared cache.
|
||||
\value GenericDataLocation Returns a directory location where persistent
|
||||
data shared across applications can be stored. This is a generic value. The returned
|
||||
path is never empty.
|
||||
\value RuntimeLocation Returns a directory location where runtime communication
|
||||
files should be written, like Unix local sockets. This is a generic value.
|
||||
The returned path may be empty on some systems.
|
||||
|
@ -57,7 +57,7 @@ static QJNIObjectPrivate applicationContext()
|
||||
if (appCtx.isValid())
|
||||
return appCtx;
|
||||
|
||||
QJNIObjectPrivate activity = QtAndroidPrivate::activity();
|
||||
QJNIObjectPrivate activity(QtAndroidPrivate::activity());
|
||||
if (!activity.isValid())
|
||||
return appCtx;
|
||||
|
||||
@ -131,7 +131,7 @@ static QString getExternalFilesDir(const char *directoryField = 0)
|
||||
if (!path.isEmpty())
|
||||
return path;
|
||||
|
||||
QJNIObjectPrivate activity = QtAndroidPrivate::activity();
|
||||
QJNIObjectPrivate activity(QtAndroidPrivate::activity());
|
||||
if (!activity.isValid())
|
||||
return QString();
|
||||
|
||||
|
@ -54,6 +54,7 @@
|
||||
# include <sys/statvfs.h>
|
||||
#elif defined(Q_OS_SOLARIS)
|
||||
# include <sys/mnttab.h>
|
||||
# include <sys/statvfs.h>
|
||||
#elif defined(Q_OS_HAIKU)
|
||||
# include <Directory.h>
|
||||
# include <Path.h>
|
||||
@ -210,17 +211,17 @@ inline bool QStorageIterator::next()
|
||||
|
||||
inline QString QStorageIterator::rootPath() const
|
||||
{
|
||||
return QFile::decodeName(mnt->mnt_mountp);
|
||||
return QFile::decodeName(mnt.mnt_mountp);
|
||||
}
|
||||
|
||||
inline QByteArray QStorageIterator::fileSystemType() const
|
||||
{
|
||||
return QByteArray(mnt->mnt_fstype);
|
||||
return QByteArray(mnt.mnt_fstype);
|
||||
}
|
||||
|
||||
inline QByteArray QStorageIterator::device() const
|
||||
{
|
||||
return QByteArray(mnt->mnt_mntopts);
|
||||
return QByteArray(mnt.mnt_mntopts);
|
||||
}
|
||||
|
||||
#elif defined(Q_OS_ANDROID)
|
||||
|
@ -82,7 +82,7 @@
|
||||
For the convenience of generating encoded URL strings or query
|
||||
strings, there are two static functions called
|
||||
fromPercentEncoding() and toPercentEncoding() which deal with
|
||||
percent encoding and decoding of QStrings.
|
||||
percent encoding and decoding of QString objects.
|
||||
|
||||
Calling isRelative() will tell whether or not the URL is
|
||||
relative. A relative URL can be resolved by passing it as argument
|
||||
@ -172,7 +172,7 @@
|
||||
setters setting components of a URL; it is not permitted in
|
||||
the QUrl constructor, in fromEncoded() or in setUrl().
|
||||
For more information on this mode, see the documentation for
|
||||
QUrl::FullyDecoded.
|
||||
\l {QUrl::ComponentFormattingOption}{QUrl::FullyDecoded}.
|
||||
|
||||
In TolerantMode, the parser has the following behaviour:
|
||||
|
||||
@ -3083,6 +3083,21 @@ bool QUrl::hasFragment() const
|
||||
URL does not contain a valid TLD, in which case the function returns
|
||||
an empty string.
|
||||
|
||||
Note that this function considers a TLD to be any domain that allows users
|
||||
to register subdomains under, including many home, dynamic DNS websites and
|
||||
blogging providers. This is useful for determining whether two websites
|
||||
belong to the same infrastructure and communication should be allowed, such
|
||||
as browser cookies: two domains should be considered part of the same
|
||||
website if they share at least one label in addition to the value
|
||||
returned by this function.
|
||||
|
||||
\list
|
||||
\li \c{foo.co.uk} and \c{foo.com} do not share a top-level domain
|
||||
\li \c{foo.co.uk} and \c{bar.co.uk} share the \c{.co.uk} domain, but the next label is different
|
||||
\li \c{www.foo.co.uk} and \c{ftp.foo.co.uk} share the same top-level domain and one more label,
|
||||
so they are considered part of the same site
|
||||
\endlist
|
||||
|
||||
If \a options includes EncodeUnicode, the returned string will be in
|
||||
ASCII Compatible Encoding.
|
||||
*/
|
||||
@ -4041,7 +4056,7 @@ QString QUrl::errorString() const
|
||||
/*!
|
||||
\since 5.1
|
||||
|
||||
Converts a list of \a urls into a list of QStrings, using toString(\a options).
|
||||
Converts a list of \a urls into a list of QString objects, using toString(\a options).
|
||||
*/
|
||||
QStringList QUrl::toStringList(const QList<QUrl> &urls, FormattingOptions options)
|
||||
{
|
||||
|
@ -414,7 +414,7 @@ bool QUrlQuery::operator ==(const QUrlQuery &other) const
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns \c true if this QUrlQUery object contains no key-value pairs, such as
|
||||
Returns \c true if this QUrlQuery object contains no key-value pairs, such as
|
||||
after being default-constructed or after parsing an empty query string.
|
||||
|
||||
\sa setQuery(), clear()
|
||||
|
@ -200,6 +200,7 @@ bool Object::isValid() const
|
||||
if (tableOffset + length*sizeof(offset) > size)
|
||||
return false;
|
||||
|
||||
QString lastKey;
|
||||
for (uint i = 0; i < length; ++i) {
|
||||
offset entryOffset = table()[i];
|
||||
if (entryOffset + sizeof(Entry) >= tableOffset)
|
||||
@ -208,8 +209,12 @@ bool Object::isValid() const
|
||||
int s = e->size();
|
||||
if (table()[i] + s > tableOffset)
|
||||
return false;
|
||||
QString key = e->key();
|
||||
if (key < lastKey)
|
||||
return false;
|
||||
if (!e->value.isValid(this))
|
||||
return false;
|
||||
lastKey = key;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -531,8 +531,8 @@ bool QJsonArray::contains(const QJsonValue &value) const
|
||||
\a i must be a valid index position in the array (i.e., \c{0 <= i <
|
||||
size()}).
|
||||
|
||||
The return value is of type QJsonValueRef, a helper class for QJsonArray
|
||||
and QJsonObject. When you get an object of type QJsonValueRef, you can
|
||||
The return value is of type \keyword QJsonValueRef, a helper class for QJsonArray
|
||||
and QJsonObject. When you get an object of type \keyword QJsonValueRef, you can
|
||||
use it as if it were a reference to a QJsonValue. If you assign to it,
|
||||
the assignment will apply to the character in the QJsonArray of QJsonObject
|
||||
from which you got the reference.
|
||||
@ -731,13 +731,14 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
|
||||
|
||||
/*! \fn QJsonValueRef QJsonArray::iterator::operator*() const
|
||||
|
||||
|
||||
Returns a modifiable reference to the current item.
|
||||
|
||||
You can change the value of an item by using operator*() on the
|
||||
left side of an assignment.
|
||||
|
||||
The return value is of type QJsonValueRef, a helper class for QJsonArray
|
||||
and QJsonObject. When you get an object of type QJsonValueRef, you can
|
||||
The return value is of type \keyword QJsonValueRef, a helper class for QJsonArray
|
||||
and QJsonObject. When you get an object of type \keyword QJsonValueRef, you can
|
||||
use it as if it were a reference to a QJsonValue. If you assign to it,
|
||||
the assignment will apply to the character in the QJsonArray of QJsonObject
|
||||
from which you got the reference.
|
||||
@ -756,8 +757,8 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
|
||||
This function is provided to make QJsonArray iterators behave like C++
|
||||
pointers.
|
||||
|
||||
The return value is of type QJsonValueRef, a helper class for QJsonArray
|
||||
and QJsonObject. When you get an object of type QJsonValueRef, you can
|
||||
The return value is of type \keyword QJsonValueRef, a helper class for QJsonArray
|
||||
and QJsonObject. When you get an object of type \keyword QJsonValueRef, you can
|
||||
use it as if it were a reference to a QJsonValue. If you assign to it,
|
||||
the assignment will apply to the character in the QJsonArray of QJsonObject
|
||||
from which you got the reference.
|
||||
|
@ -264,6 +264,8 @@ QVariantHash QJsonObject::toVariantHash() const
|
||||
|
||||
/*!
|
||||
Returns a list of all keys in this object.
|
||||
|
||||
The list is sorted lexographically.
|
||||
*/
|
||||
QStringList QJsonObject::keys() const
|
||||
{
|
||||
|
@ -74,6 +74,20 @@ QT_BEGIN_NAMESPACE
|
||||
conversions. This implies that converting to a type that is not stored in the value will return a default
|
||||
constructed return value.
|
||||
|
||||
\section1 QJsonValueRef
|
||||
|
||||
QJsonValueRef is a helper class for QJsonArray and QJsonObject.
|
||||
When you get an object of type QJsonValueRef, you can
|
||||
use it as if it were a reference to a QJsonValue. If you assign to it,
|
||||
the assignment will apply to the element in the QJsonArray or QJsonObject
|
||||
from which you got the reference.
|
||||
|
||||
The following methods return QJsonValueRef:
|
||||
\list
|
||||
\li \l {QJsonArray}::operator[](int i)
|
||||
\li \l {QJsonObject}::operator[](const QString & key) const
|
||||
\endlist
|
||||
|
||||
\sa {JSON Support in Qt}, {JSON Save Game Example}
|
||||
*/
|
||||
|
||||
@ -419,13 +433,13 @@ QJsonValue QJsonValue::fromVariant(const QVariant &variant)
|
||||
|
||||
The QJsonValue types will be converted as follows:
|
||||
|
||||
\value Null {QVariant::}{QVariant()}
|
||||
\value Null \l {QVariant::}{QVariant()}
|
||||
\value Bool QMetaType::Bool
|
||||
\value Double QMetaType::Double
|
||||
\value String QString
|
||||
\value Array QVariantList
|
||||
\value Object QVariantMap
|
||||
\value Undefined {QVariant::}{QVariant()}
|
||||
\value Undefined \l {QVariant::}{QVariant()}
|
||||
|
||||
\sa fromVariant()
|
||||
*/
|
||||
|
@ -386,7 +386,7 @@ void QAbstractEventDispatcher::closingDown()
|
||||
\note The filter function set here receives native messages,
|
||||
that is, MSG or XEvent structs.
|
||||
|
||||
For maximum portability, you should always try to use QEvents
|
||||
For maximum portability, you should always try to use QEvent objects
|
||||
and QObject::installEventFilter() whenever possible.
|
||||
|
||||
\sa QObject::installEventFilter()
|
||||
|
@ -80,6 +80,11 @@
|
||||
#ifdef Q_OS_WIN
|
||||
# ifdef Q_OS_WINRT
|
||||
# include "qeventdispatcher_winrt_p.h"
|
||||
# include "qfunctions_winrt.h"
|
||||
# include <wrl.h>
|
||||
# include <Windows.ApplicationModel.core.h>
|
||||
using namespace ABI::Windows::ApplicationModel::Core;
|
||||
using namespace Microsoft::WRL;
|
||||
# else
|
||||
# include "qeventdispatcher_win_p.h"
|
||||
# endif
|
||||
@ -1244,6 +1249,19 @@ void QCoreApplication::exit(int returnCode)
|
||||
QEventLoop *eventLoop = data->eventLoops.at(i);
|
||||
eventLoop->exit(returnCode);
|
||||
}
|
||||
#ifdef Q_OS_WINRT
|
||||
qWarning("QCoreApplication::exit: It is not recommended to explicitly exit an application on Windows Store Apps");
|
||||
ComPtr<ICoreApplication> app;
|
||||
HRESULT hr = RoGetActivationFactory(Wrappers::HString::MakeReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(),
|
||||
IID_PPV_ARGS(&app));
|
||||
RETURN_VOID_IF_FAILED("Could not acquire ICoreApplication object");
|
||||
ComPtr<ICoreApplicationExit> appExit;
|
||||
|
||||
hr = app.As(&appExit);
|
||||
RETURN_VOID_IF_FAILED("Could not acquire ICoreApplicationExit object");
|
||||
hr = appExit->Exit();
|
||||
RETURN_VOID_IF_FAILED("Could not exit application");
|
||||
#endif // Q_OS_WINRT
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -2405,7 +2423,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive))
|
||||
INSTALL/plugins, where \c INSTALL is the directory where Qt was
|
||||
installed). The directory of the application executable (NOT the
|
||||
working directory) is always added, as well as the colon separated
|
||||
entries of the QT_PLUGIN_PATH environment variable.
|
||||
entries of the \c QT_PLUGIN_PATH environment variable.
|
||||
|
||||
If you want to iterate over the list, you can use the \l foreach
|
||||
pseudo-keyword:
|
||||
@ -2550,7 +2568,7 @@ void QCoreApplication::removeLibraryPath(const QString &path)
|
||||
\note Native event filters will be disabled when the application the
|
||||
Qt::AA_MacPluginApplication attribute is set.
|
||||
|
||||
For maximum portability, you should always try to use QEvents
|
||||
For maximum portability, you should always try to use QEvent
|
||||
and QObject::installEventFilter() whenever possible.
|
||||
|
||||
\sa QObject::installEventFilter()
|
||||
|
@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
|
||||
send events using QCoreApplication::sendEvent() and
|
||||
QCoreApplication::postEvent() (spontaneous() returns \c false).
|
||||
|
||||
QObjects receive events by having their QObject::event() function
|
||||
\l {QObject}{QObjects} receive events by having their QObject::event() function
|
||||
called. The function can be reimplemented in subclasses to
|
||||
customize event handling and add additional event types;
|
||||
QWidget::event() is a notable example. By default, events are
|
||||
@ -102,13 +102,13 @@ QT_BEGIN_NAMESPACE
|
||||
\value ChildAdded An object gets a child (QChildEvent).
|
||||
\value ChildPolished A widget child gets polished (QChildEvent).
|
||||
\value ChildRemoved An object loses a child (QChildEvent).
|
||||
\value Clipboard The clipboard contents have changed (QClipboardEvent).
|
||||
\value Clipboard The clipboard contents have changed.
|
||||
\value Close Widget was closed (QCloseEvent).
|
||||
\value CloseSoftwareInputPanel A widget wants to close the software input panel (SIP).
|
||||
\value ContentsRectChange The margins of the widget's content rect changed.
|
||||
\value ContextMenu Context popup menu (QContextMenuEvent).
|
||||
\value CursorChange The widget's cursor has changed.
|
||||
\value DeferredDelete The object will be deleted after it has cleaned up (QDeferredDeleteEvent).
|
||||
\value DeferredDelete The object will be deleted after it has cleaned up (QDeferredDeleteEvent)
|
||||
\value DragEnter The cursor enters a widget during a drag and drop operation (QDragEnterEvent).
|
||||
\value DragLeave The cursor leaves a widget during a drag and drop operation (QDragLeaveEvent).
|
||||
\value DragMove A drag and drop operation is in progress (QDragMoveEvent).
|
||||
@ -116,7 +116,7 @@ QT_BEGIN_NAMESPACE
|
||||
\value DynamicPropertyChange A dynamic property was added, changed, or removed from the object.
|
||||
\value EnabledChange Widget's enabled state has changed.
|
||||
\value Enter Mouse enters widget's boundaries (QEnterEvent).
|
||||
\value EnterEditFocus An editor widget gains focus for editing. QT_KEYPAD_NAVIGATION must be defined.
|
||||
\value EnterEditFocus An editor widget gains focus for editing. \c QT_KEYPAD_NAVIGATION must be defined.
|
||||
\value EnterWhatsThisMode Send to toplevel widgets when the application enters "What's This?" mode.
|
||||
\value Expose Sent to a window when its on-screen contents are invalidated and need to be flushed from the backing store.
|
||||
\value FileOpen File open request (QFileOpenEvent).
|
||||
@ -177,7 +177,7 @@ QT_BEGIN_NAMESPACE
|
||||
\value MouseTrackingChange The mouse tracking state has changed.
|
||||
\value Move Widget's position changed (QMoveEvent).
|
||||
\value NativeGesture The system has detected a gesture (QNativeGestureEvent).
|
||||
\value OrientationChange The screens orientation has changes (QScreenOrientationChangeEvent)
|
||||
\value OrientationChange The screens orientation has changes (QScreenOrientationChangeEvent).
|
||||
\value Paint Screen update necessary (QPaintEvent).
|
||||
\value PaletteChange Palette of the widget changed.
|
||||
\value ParentAboutToChange The widget parent is about to change.
|
||||
|
@ -96,7 +96,7 @@ static jclass loadClassDotEnc(const QString &classDotEnc, JNIEnv *env)
|
||||
if (clazz != 0 || isCached)
|
||||
return clazz;
|
||||
|
||||
QJNIObjectPrivate classLoader = QtAndroidPrivate::classLoader();
|
||||
QJNIObjectPrivate classLoader(QtAndroidPrivate::classLoader());
|
||||
if (!classLoader.isValid())
|
||||
return 0;
|
||||
|
||||
@ -2239,6 +2239,13 @@ bool QJNIObjectPrivate::isValid() const
|
||||
return d->m_jobject;
|
||||
}
|
||||
|
||||
QJNIObjectPrivate QJNIObjectPrivate::fromLocalRef(jobject lref)
|
||||
{
|
||||
QJNIObjectPrivate o(lref);
|
||||
QJNIEnvironmentPrivate()->DeleteLocalRef(lref);
|
||||
return o;
|
||||
}
|
||||
|
||||
bool QJNIObjectPrivate::isSameObject(jobject obj) const
|
||||
{
|
||||
QJNIEnvironmentPrivate env;
|
||||
|
@ -84,7 +84,10 @@ public:
|
||||
QJNIObjectPrivate(const char *className, const char *sig, ...);
|
||||
explicit QJNIObjectPrivate(jclass clazz);
|
||||
QJNIObjectPrivate(jclass clazz, const char *sig, ...);
|
||||
QJNIObjectPrivate(jobject obj);
|
||||
// In most cases you should never call this function with a local ref. unless you intend
|
||||
// to manage the local ref. yourself.
|
||||
// NOTE: see fromLocalRef() for converting a local ref. to QJNIObjectPrivate.
|
||||
explicit QJNIObjectPrivate(jobject globalRef);
|
||||
|
||||
template <typename T>
|
||||
T callMethod(const char *methodName,
|
||||
@ -183,6 +186,9 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
// This function takes ownership of the jobject and releases the local ref. before returning.
|
||||
static QJNIObjectPrivate fromLocalRef(jobject lref);
|
||||
|
||||
private:
|
||||
friend class QAndroidJniObject;
|
||||
|
||||
|
@ -201,6 +201,8 @@ struct DefinedTypesFilter {
|
||||
\enum QMetaType::Type
|
||||
|
||||
These are the built-in types supported by QMetaType:
|
||||
Read doc on QChar
|
||||
Read doc on \l QChar
|
||||
|
||||
\value Void \c void
|
||||
\value Bool \c bool
|
||||
|
@ -4106,20 +4106,6 @@ QDebug operator<<(QDebug dbg, const QObject *o)
|
||||
dbg << ')';
|
||||
return dbg;
|
||||
}
|
||||
|
||||
QDebug qt_QMetaEnum_debugOperator(QDebug &dbg, int value, const QMetaObject *meta, const char *name)
|
||||
{
|
||||
QDebugStateSaver saver(dbg);
|
||||
QMetaEnum me = meta->enumerator(meta->indexOfEnumerator(name));
|
||||
const char *key = me.valueToKey(value);
|
||||
dbg.nospace() << meta->className() << "::" << name << '(';
|
||||
if (key)
|
||||
dbg << key;
|
||||
else
|
||||
dbg << value;
|
||||
dbg << ')';
|
||||
return dbg;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*!
|
||||
|
@ -547,16 +547,6 @@ template <class T> inline const char * qobject_interface_iid()
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
Q_CORE_EXPORT QDebug operator<<(QDebug, const QObject *);
|
||||
Q_CORE_EXPORT QDebug qt_QMetaEnum_debugOperator(QDebug&, int value, const QMetaObject *meta, const char *name);
|
||||
|
||||
template<typename T>
|
||||
typename QtPrivate::QEnableIf<QtPrivate::IsQEnumHelper<T>::Value , QDebug>::Type
|
||||
operator<<(QDebug &dbg, T value)
|
||||
{
|
||||
const QMetaObject *obj = qt_getEnumMetaObject(value);
|
||||
const char *name = qt_getEnumName(value);
|
||||
return qt_QMetaEnum_debugOperator(dbg, typename QFlags<T>::Int(value), obj, name);
|
||||
}
|
||||
#endif
|
||||
|
||||
class QSignalBlocker
|
||||
|
@ -55,7 +55,7 @@
|
||||
|
||||
\li When using QPointer on a QWidget (or a subclass of QWidget), previously
|
||||
the QPointer would be cleared by the QWidget destructor. Now, the QPointer
|
||||
is cleared by the QObject destructor (since this is when QWeakPointers are
|
||||
is cleared by the QObject destructor (since this is when QWeakPointer objects are
|
||||
cleared). Any QPointers tracking a widget will \b NOT be cleared before the
|
||||
QWidget destructor destroys the children for the widget being tracked.
|
||||
|
||||
|
@ -91,7 +91,7 @@ QT_BEGIN_NAMESPACE
|
||||
its work. This is the traditional way of implementing heavy work
|
||||
in GUI applications, but as multithreading is nowadays becoming available on
|
||||
more and more platforms, we expect that zero-millisecond
|
||||
QTimers will gradually be replaced by \l{QThread}s.
|
||||
QTimer objects will gradually be replaced by \l{QThread}s.
|
||||
|
||||
\section1 Accuracy and Timer Resolution
|
||||
|
||||
|
@ -1410,13 +1410,13 @@ QVariant::QVariant(const char *val)
|
||||
/*!
|
||||
\fn QVariant::QVariant(const QMap<QString, QVariant> &val)
|
||||
|
||||
Constructs a new variant with a map of QVariants, \a val.
|
||||
Constructs a new variant with a map of \l {QVariant}s, \a val.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn QVariant::QVariant(const QHash<QString, QVariant> &val)
|
||||
|
||||
Constructs a new variant with a hash of QVariants, \a val.
|
||||
Constructs a new variant with a hash of \l {QVariant}s, \a val.
|
||||
*/
|
||||
|
||||
/*!
|
||||
@ -3610,7 +3610,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p)
|
||||
Q_OBJECT macro.
|
||||
|
||||
If the QVariant contains a sequential container and \c{T} is QVariantList, the
|
||||
elements of the container will be converted into QVariants and returned as a QVariantList.
|
||||
elements of the container will be converted into \l {QVariant}s and returned as a QVariantList.
|
||||
|
||||
\snippet code/src_corelib_kernel_qvariant.cpp 9
|
||||
|
||||
|
@ -420,7 +420,7 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin plugin)
|
||||
/*!
|
||||
Returns a list of static plugin instances (root components) held
|
||||
by the plugin loader.
|
||||
\sa staticPlugins()
|
||||
\sa staticPlugin()
|
||||
*/
|
||||
QObjectList QPluginLoader::staticInstances()
|
||||
{
|
||||
|
@ -389,14 +389,13 @@ Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
|
||||
|
||||
int QThread::idealThreadCount() Q_DECL_NOTHROW
|
||||
{
|
||||
int cores = -1;
|
||||
int cores = 1;
|
||||
|
||||
#if defined(Q_OS_HPUX)
|
||||
// HP-UX
|
||||
struct pst_dynamic psd;
|
||||
if (pstat_getdynamic(&psd, sizeof(psd), 1, 0) == -1) {
|
||||
perror("pstat_getdynamic");
|
||||
cores = -1;
|
||||
} else {
|
||||
cores = (int)psd.psd_proc_cnt;
|
||||
}
|
||||
@ -408,7 +407,6 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW
|
||||
mib[1] = HW_NCPU;
|
||||
if (sysctl(mib, 2, &cores, &len, NULL, 0) != 0) {
|
||||
perror("sysctl");
|
||||
cores = -1;
|
||||
}
|
||||
#elif defined(Q_OS_IRIX)
|
||||
// IRIX
|
||||
@ -443,9 +441,9 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW
|
||||
#else
|
||||
// the rest: Linux, Solaris, AIX, Tru64
|
||||
cores = (int)sysconf(_SC_NPROCESSORS_ONLN);
|
||||
#endif
|
||||
if (cores == -1)
|
||||
return 1;
|
||||
#endif
|
||||
return cores;
|
||||
}
|
||||
|
||||
|
@ -52,9 +52,12 @@
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
// Android lacks pthread_condattr_setclock, but it does have a nice function
|
||||
// for relative waits. Use weakref so we can determine at runtime whether it is
|
||||
// present.
|
||||
// pthread_condattr_setclock is available only since Android 5.0. On older versions, there's
|
||||
// a private function for relative waits (hidden in 5.0).
|
||||
// Use weakref so we can determine at runtime whether each of them is present.
|
||||
static int local_condattr_setclock(pthread_condattr_t*, clockid_t)
|
||||
__attribute__((weakref("pthread_condattr_setclock")));
|
||||
|
||||
static int local_cond_timedwait_relative(pthread_cond_t*, pthread_mutex_t *, const timespec *)
|
||||
__attribute__((weakref("__pthread_cond_timedwait_relative")));
|
||||
#endif
|
||||
@ -70,9 +73,14 @@ void qt_initialize_pthread_cond(pthread_cond_t *cond, const char *where)
|
||||
pthread_condattr_t condattr;
|
||||
|
||||
pthread_condattr_init(&condattr);
|
||||
#if !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU) && (_POSIX_MONOTONIC_CLOCK-0 >= 0)
|
||||
#if (_POSIX_MONOTONIC_CLOCK-0 >= 0)
|
||||
#if defined(Q_OS_ANDROID)
|
||||
if (local_condattr_setclock && QElapsedTimer::clockType() == QElapsedTimer::MonotonicClock)
|
||||
local_condattr_setclock(&condattr, CLOCK_MONOTONIC);
|
||||
#elif !defined(Q_OS_MAC) && !defined(Q_OS_HAIKU)
|
||||
if (QElapsedTimer::clockType() == QElapsedTimer::MonotonicClock)
|
||||
pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
|
||||
#endif
|
||||
#endif
|
||||
report_error(pthread_cond_init(cond, &condattr), where, "cv init");
|
||||
pthread_condattr_destroy(&condattr);
|
||||
@ -108,7 +116,7 @@ public:
|
||||
{
|
||||
timespec ti;
|
||||
#ifdef Q_OS_ANDROID
|
||||
if (Q_LIKELY(local_cond_timedwait_relative)) {
|
||||
if (local_cond_timedwait_relative) {
|
||||
ti.tv_sec = time / 1000;
|
||||
ti.tv_nsec = time % 1000 * Q_UINT64_C(1000) * 1000;
|
||||
return local_cond_timedwait_relative(&cond, &mutex, &ti);
|
||||
|
@ -786,7 +786,7 @@ static inline char qToLower(char c)
|
||||
occurrences of a particular value with another, use one of the
|
||||
two-parameter replace() overloads.
|
||||
|
||||
{QByteArray}s can be compared using overloaded operators such as
|
||||
\l{QByteArray}s can be compared using overloaded operators such as
|
||||
operator<(), operator<=(), operator==(), operator>=(), and so on.
|
||||
The comparison is based exclusively on the numeric values
|
||||
of the characters and is very fast, but is not what a human would
|
||||
@ -831,7 +831,7 @@ static inline char qToLower(char c)
|
||||
lastIndexOf(), operator<(), operator<=(), operator>(),
|
||||
operator>=(), toLower() and toUpper().
|
||||
|
||||
This issue does not apply to {QString}s since they represent
|
||||
This issue does not apply to \l{QString}s since they represent
|
||||
characters using Unicode.
|
||||
|
||||
\sa QString, QBitArray
|
||||
|
@ -240,7 +240,7 @@ void qt_from_latin1(ushort *dst, const char *str, size_t size)
|
||||
dst += offset;
|
||||
str += offset;
|
||||
# ifdef Q_COMPILER_LAMBDA
|
||||
return UnrollTailLoop<15>::exec(size, [=](int i) { dst[i] = (uchar)str[i]; });
|
||||
return UnrollTailLoop<15>::exec(int(size), [=](int i) { dst[i] = (uchar)str[i]; });
|
||||
# endif
|
||||
#endif
|
||||
#if defined(__mips_dsp)
|
||||
|
@ -625,6 +625,15 @@ QTimeZonePrivate *QUtcTimeZonePrivate::clone()
|
||||
return new QUtcTimeZonePrivate(*this);
|
||||
}
|
||||
|
||||
QTimeZonePrivate::Data QUtcTimeZonePrivate::data(qint64 forMSecsSinceEpoch) const
|
||||
{
|
||||
Data d = invalidData();
|
||||
d.abbreviation = m_abbreviation;
|
||||
d.atMSecsSinceEpoch = forMSecsSinceEpoch;
|
||||
d.offsetFromUtc = m_offsetFromUtc;
|
||||
return d;
|
||||
}
|
||||
|
||||
void QUtcTimeZonePrivate::init(const QByteArray &zoneId)
|
||||
{
|
||||
m_id = zoneId;
|
||||
|
@ -186,6 +186,8 @@ public:
|
||||
|
||||
QTimeZonePrivate *clone() Q_DECL_OVERRIDE;
|
||||
|
||||
Data data(qint64 forMSecsSinceEpoch) const Q_DECL_OVERRIDE;
|
||||
|
||||
QLocale::Country country() const Q_DECL_OVERRIDE;
|
||||
QString comment() const Q_DECL_OVERRIDE;
|
||||
|
||||
|
@ -63,9 +63,9 @@ Q_DECL_CONSTEXPR inline char toHexLower(uint value) Q_DECL_NOTHROW
|
||||
|
||||
Q_DECL_CONSTEXPR inline int fromHex(uint c) Q_DECL_NOTHROW
|
||||
{
|
||||
return ((c >= '0') && (c <= '9')) ? c - '0' :
|
||||
((c >= 'A') && (c <= 'F')) ? c - 'A' + 10 :
|
||||
((c >= 'a') && (c <= 'f')) ? c - 'a' + 10 :
|
||||
return ((c >= '0') && (c <= '9')) ? int(c - '0') :
|
||||
((c >= 'A') && (c <= 'F')) ? int(c - 'A' + 10) :
|
||||
((c >= 'a') && (c <= 'f')) ? int(c - 'a' + 10) :
|
||||
/* otherwise */ -1;
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ Q_DECL_CONSTEXPR inline char toOct(uint value) Q_DECL_NOTHROW
|
||||
|
||||
Q_DECL_CONSTEXPR inline int fromOct(uint c) Q_DECL_NOTHROW
|
||||
{
|
||||
return ((c >= '0') && (c <= '7')) ? c - '0' : -1;
|
||||
return ((c >= '0') && (c <= '7')) ? int(c - '0') : -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,9 @@ public:
|
||||
const const_iterator ce = this->cend(), cit = std::find(this->cbegin(), ce, t);
|
||||
if (cit == ce)
|
||||
return 0;
|
||||
const iterator e = end(), it = std::remove(c2m(cit), e, t);
|
||||
// next operation detaches, so ce, cit may become invalidated:
|
||||
const int firstFoundIdx = std::distance(this->cbegin(), cit);
|
||||
const iterator e = end(), it = std::remove(begin() + firstFoundIdx, e, t);
|
||||
const int result = std::distance(it, e);
|
||||
erase(it, e);
|
||||
return result;
|
||||
|
@ -314,12 +314,20 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int
|
||||
}
|
||||
} else if (comp == BMP_BITFIELDS && (nbits == 16 || nbits == 32)) {
|
||||
red_shift = calc_shift(red_mask);
|
||||
if (((red_mask >> red_shift) + 1) == 0)
|
||||
return false;
|
||||
red_scale = 256 / ((red_mask >> red_shift) + 1);
|
||||
green_shift = calc_shift(green_mask);
|
||||
if (((green_mask >> green_shift) + 1) == 0)
|
||||
return false;
|
||||
green_scale = 256 / ((green_mask >> green_shift) + 1);
|
||||
blue_shift = calc_shift(blue_mask);
|
||||
if (((blue_mask >> blue_shift) + 1) == 0)
|
||||
return false;
|
||||
blue_scale = 256 / ((blue_mask >> blue_shift) + 1);
|
||||
alpha_shift = calc_shift(alpha_mask);
|
||||
if (((alpha_mask >> alpha_shift) + 1) == 0)
|
||||
return false;
|
||||
alpha_scale = 256 / ((alpha_mask >> alpha_shift) + 1);
|
||||
} else if (comp == BMP_RGB && (nbits == 24 || nbits == 32)) {
|
||||
blue_mask = 0x000000ff;
|
||||
|
@ -1675,15 +1675,13 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
|
||||
if (e->globalPos != QGuiApplicationPrivate::lastCursorPosition && (stateChange != Qt::NoButton)) {
|
||||
// A mouse event should not change both position and buttons at the same time. Instead we
|
||||
// should first send a move event followed by a button changed event. Since this is not the case
|
||||
// with the current event, we fake a move-only event that we recurse and process first. This
|
||||
// will update the global mouse position and cause the second event to be a button only event.
|
||||
QWindowSystemInterfacePrivate::MouseEvent moveEvent(e->window.data(),
|
||||
e->timestamp, e->type, e->localPos, e->globalPos, buttons, e->modifiers, e->source);
|
||||
// with the current event, we split it in two.
|
||||
QWindowSystemInterfacePrivate::MouseEvent *mouseButtonEvent = new QWindowSystemInterfacePrivate::MouseEvent(
|
||||
e->window.data(), e->timestamp, e->type, e->localPos, e->globalPos, e->buttons, e->modifiers);
|
||||
if (e->flags & QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic)
|
||||
moveEvent.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
|
||||
processMouseEvent(&moveEvent);
|
||||
Q_ASSERT(e->globalPos == QGuiApplicationPrivate::lastCursorPosition);
|
||||
// continue with processing mouse button change event
|
||||
mouseButtonEvent->flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
|
||||
QWindowSystemInterfacePrivate::windowSystemEventQueue.prepend(mouseButtonEvent);
|
||||
stateChange = Qt::NoButton;
|
||||
}
|
||||
|
||||
QWindow *window = e->window.data();
|
||||
|
@ -2238,10 +2238,12 @@ bool QWindow::nativeEvent(const QByteArray &eventType, void *message, long *resu
|
||||
QPoint QWindow::mapToGlobal(const QPoint &pos) const
|
||||
{
|
||||
Q_D(const QWindow);
|
||||
if (d->platformWindow && d->platformWindow->isEmbedded(0))
|
||||
// QTBUG-43252, prefer platform implementation for foreign windows.
|
||||
if (d->platformWindow
|
||||
&& (type() == Qt::ForeignWindow || d->platformWindow->isEmbedded(0))) {
|
||||
return d->platformWindow->mapToGlobal(pos);
|
||||
else
|
||||
return pos + d_func()->globalPosition();
|
||||
}
|
||||
return pos + d_func()->globalPosition();
|
||||
}
|
||||
|
||||
|
||||
@ -2256,10 +2258,12 @@ QPoint QWindow::mapToGlobal(const QPoint &pos) const
|
||||
QPoint QWindow::mapFromGlobal(const QPoint &pos) const
|
||||
{
|
||||
Q_D(const QWindow);
|
||||
if (d->platformWindow && d->platformWindow->isEmbedded(0))
|
||||
// QTBUG-43252, prefer platform implementation for foreign windows.
|
||||
if (d->platformWindow
|
||||
&& (type() == Qt::ForeignWindow || d->platformWindow->isEmbedded(0))) {
|
||||
return d->platformWindow->mapFromGlobal(pos);
|
||||
else
|
||||
return pos - d_func()->globalPosition();
|
||||
}
|
||||
return pos - d_func()->globalPosition();
|
||||
}
|
||||
|
||||
|
||||
|
@ -840,6 +840,8 @@ static QOpenGLTexture::PixelType pixelTypeCompatibleWithInternalFormat(QOpenGLTe
|
||||
return QOpenGLTexture::UInt8;
|
||||
|
||||
case QOpenGLTexture::DepthFormat:
|
||||
return QOpenGLTexture::UInt32;
|
||||
|
||||
case QOpenGLTexture::AlphaFormat:
|
||||
case QOpenGLTexture::RGBFormat:
|
||||
case QOpenGLTexture::RGBAFormat:
|
||||
@ -1859,7 +1861,7 @@ QOpenGLTexture *QOpenGLTexturePrivate::createTextureView(QOpenGLTexture::Target
|
||||
\value SRGB_Alpha_DXT5 Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
|
||||
\value SRGB_BP_UNorm Equivalent to GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
|
||||
|
||||
\value DepthFormat Equivalent to GL_DEPTH_COMPONENT (OpenGL ES 2 only and when OES_depth_texture is present)
|
||||
\value DepthFormat Equivalent to GL_DEPTH_COMPONENT (only OpenGL ES 3 or ES 2 with OES_depth_texture)
|
||||
\value AlphaFormat Equivalent to GL_ALPHA (OpenGL ES 2 only)
|
||||
\value RGBFormat Equivalent to GL_RGB (OpenGL ES 2 only)
|
||||
\value RGBAFormat Equivalent to GL_RGBA (OpenGL ES 2 only)
|
||||
|
@ -65,8 +65,6 @@ struct StrokeHandler;
|
||||
QDebug Q_GUI_EXPORT &operator<<(QDebug &, const QVectorPath &path);
|
||||
#endif
|
||||
|
||||
class QPixmapFilter;
|
||||
|
||||
class Q_GUI_EXPORT QPaintEngineEx : public QPaintEngine
|
||||
{
|
||||
Q_DECLARE_PRIVATE(QPaintEngineEx)
|
||||
@ -140,13 +138,6 @@ public:
|
||||
virtual void beginNativePainting() {}
|
||||
virtual void endNativePainting() {}
|
||||
|
||||
// Return a pixmap filter of "type" that can render the parameters
|
||||
// in "prototype". The returned filter is owned by the engine and
|
||||
// will be destroyed when the engine is destroyed. The "prototype"
|
||||
// allows the engine to pick different filters based on the parameters
|
||||
// that will be requested, and not just the "type".
|
||||
virtual QPixmapFilter *pixmapFilter(int /*type*/, const QPixmapFilter * /*prototype*/) { return 0; }
|
||||
|
||||
// These flags are needed in the implementation of paint buffers.
|
||||
enum Flags
|
||||
{
|
||||
|
@ -5536,6 +5536,11 @@ void QPainter::drawGlyphRun(const QPointF &position, const QGlyphRun &glyphRun)
|
||||
{
|
||||
Q_D(QPainter);
|
||||
|
||||
if (!d->engine) {
|
||||
qWarning("QPainter::drawGlyphRun: Painter not active");
|
||||
return;
|
||||
}
|
||||
|
||||
QRawFont font = glyphRun.rawFont();
|
||||
if (!font.isValid())
|
||||
return;
|
||||
|
@ -1051,7 +1051,7 @@ void QPdfEngine::drawPath (const QPainterPath &p)
|
||||
if (!d->hasPen && !d->hasBrush)
|
||||
return;
|
||||
|
||||
if (d->simplePen && d->opacity == 1.0) {
|
||||
if (d->simplePen) {
|
||||
// draw strokes natively in this case for better output
|
||||
*d->currentPage << QPdf::generatePath(p, QTransform(), d->hasBrush ? QPdf::FillAndStrokePath : QPdf::StrokePath);
|
||||
} else {
|
||||
@ -1198,7 +1198,7 @@ void QPdfEngine::updateState(const QPaintEngineState &state)
|
||||
d->stroker.setPen(d->pen, state.renderHints());
|
||||
QBrush penBrush = d->pen.brush();
|
||||
bool oldSimple = d->simplePen;
|
||||
d->simplePen = (d->hasPen && (penBrush.style() == Qt::SolidPattern) && penBrush.isOpaque());
|
||||
d->simplePen = (d->hasPen && (penBrush.style() == Qt::SolidPattern) && penBrush.isOpaque() && d->opacity == 1.0);
|
||||
if (oldSimple != d->simplePen)
|
||||
flags |= DirtyTransform;
|
||||
} else if (flags & DirtyHints) {
|
||||
@ -1214,8 +1214,13 @@ void QPdfEngine::updateState(const QPaintEngineState &state)
|
||||
d->brushOrigin = state.brushOrigin();
|
||||
flags |= DirtyBrush;
|
||||
}
|
||||
if (flags & DirtyOpacity)
|
||||
if (flags & DirtyOpacity) {
|
||||
d->opacity = state.opacity();
|
||||
if (d->simplePen && d->opacity != 1.0) {
|
||||
d->simplePen = false;
|
||||
flags |= DirtyTransform;
|
||||
}
|
||||
}
|
||||
|
||||
bool ce = d->clipEnabled;
|
||||
if (flags & DirtyClipPath) {
|
||||
|
@ -152,8 +152,10 @@ static int getFontWeight(const QString &weightString)
|
||||
return QFont::ExtraBold;
|
||||
|
||||
// And now the contains() checks for the translated strings.
|
||||
//: The word for "Extra" as in "Extra Bold, Extra Thin" used as a pattern for string searches
|
||||
const QString translatedExtra = QCoreApplication::translate("QFontDatabase", "Extra").toLower();
|
||||
if (s.contains(translatedBold)) {
|
||||
//: The word for "Demi" as in "Demi Bold" used as a pattern for string searches
|
||||
QString translatedDemi = QCoreApplication::translate("QFontDatabase", "Demi").toLower();
|
||||
if (s .contains(translatedDemi))
|
||||
return QFont::DemiBold;
|
||||
|
@ -510,7 +510,7 @@ void QFreetypeFace::addGlyphToPath(FT_Face face, FT_GlyphSlot g, const QFixedPoi
|
||||
|
||||
extern void qt_addBitmapToPath(qreal x0, qreal y0, const uchar *image_data, int bpl, int w, int h, QPainterPath *path);
|
||||
|
||||
void QFreetypeFace::addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point, QPainterPath *path, bool)
|
||||
void QFreetypeFace::addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point, QPainterPath *path)
|
||||
{
|
||||
if (slot->format != FT_GLYPH_FORMAT_BITMAP
|
||||
|| slot->bitmap.pixel_mode != FT_PIXEL_MODE_MONO)
|
||||
@ -1430,7 +1430,7 @@ void QFontEngineFT::addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyph
|
||||
for (int gl = 0; gl < glyphs.numGlyphs; gl++) {
|
||||
FT_UInt glyph = positioned_glyphs[gl];
|
||||
FT_Load_Glyph(face, glyph, FT_LOAD_TARGET_MONO);
|
||||
freetype->addBitmapToPath(face->glyph, positions[gl], path);
|
||||
QFreetypeFace::addBitmapToPath(face->glyph, positions[gl], path);
|
||||
}
|
||||
unlockFace();
|
||||
}
|
||||
@ -1696,7 +1696,7 @@ glyph_metrics_t QFontEngineFT::boundingBox(glyph_t glyph, const QTransform &matr
|
||||
|
||||
glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixelPosition, const QTransform &matrix, QFontEngine::GlyphFormat format)
|
||||
{
|
||||
Glyph *g = loadGlyphFor(glyph, subPixelPosition, format, matrix);
|
||||
Glyph *g = loadGlyphFor(glyph, subPixelPosition, format, matrix, true);
|
||||
|
||||
glyph_metrics_t overall;
|
||||
if (g) {
|
||||
@ -1839,7 +1839,8 @@ void QFontEngineFT::unlockAlphaMapForGlyph()
|
||||
QFontEngineFT::Glyph *QFontEngineFT::loadGlyphFor(glyph_t g,
|
||||
QFixed subPixelPosition,
|
||||
GlyphFormat format,
|
||||
const QTransform &t)
|
||||
const QTransform &t,
|
||||
bool fetchBoundingBox)
|
||||
{
|
||||
FT_Face face = 0;
|
||||
QGlyphSet *glyphSet = 0;
|
||||
@ -1852,7 +1853,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyphFor(glyph_t g,
|
||||
Q_ASSERT(glyphSet != 0);
|
||||
}
|
||||
|
||||
if (glyphSet != 0 && glyphSet->outline_drawing)
|
||||
if (glyphSet != 0 && glyphSet->outline_drawing && !fetchBoundingBox)
|
||||
return 0;
|
||||
|
||||
Glyph *glyph = glyphSet != 0 ? glyphSet->getGlyph(g, subPixelPosition) : 0;
|
||||
|
@ -102,7 +102,7 @@ public:
|
||||
int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints);
|
||||
|
||||
static void addGlyphToPath(FT_Face face, FT_GlyphSlot g, const QFixedPoint &point, QPainterPath *path, FT_Fixed x_scale, FT_Fixed y_scale);
|
||||
static void addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point, QPainterPath *path, bool = false);
|
||||
static void addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point, QPainterPath *path);
|
||||
|
||||
private:
|
||||
friend class QFontEngineFT;
|
||||
@ -266,7 +266,7 @@ private:
|
||||
inline Glyph *loadGlyph(uint glyph, QFixed subPixelPosition, GlyphFormat format = Format_None, bool fetchMetricsOnly = false) const
|
||||
{ return loadGlyph(cacheEnabled ? &defaultGlyphSet : 0, glyph, subPixelPosition, format, fetchMetricsOnly); }
|
||||
Glyph *loadGlyph(QGlyphSet *set, uint glyph, QFixed subPixelPosition, GlyphFormat = Format_None, bool fetchMetricsOnly = false) const;
|
||||
Glyph *loadGlyphFor(glyph_t g, QFixed subPixelPosition, GlyphFormat format, const QTransform &t);
|
||||
Glyph *loadGlyphFor(glyph_t g, QFixed subPixelPosition, GlyphFormat format, const QTransform &t, bool fetchBoundingBox = false);
|
||||
|
||||
QGlyphSet *loadTransformedGlyphSet(const QTransform &matrix);
|
||||
|
||||
|
@ -235,19 +235,11 @@ void QLocalSocket::connectToServer(OpenMode openMode)
|
||||
}
|
||||
|
||||
// create the socket
|
||||
if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, SOCK_STREAM, 0))) {
|
||||
if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, SOCK_STREAM, 0, O_NONBLOCK))) {
|
||||
d->errorOccurred(UnsupportedSocketOperationError,
|
||||
QLatin1String("QLocalSocket::connectToServer"));
|
||||
return;
|
||||
}
|
||||
// set non blocking so we can try to connect and it won't wait
|
||||
int flags = fcntl(d->connectingSocket, F_GETFL, 0);
|
||||
if (-1 == flags
|
||||
|| -1 == (fcntl(d->connectingSocket, F_SETFL, flags | O_NONBLOCK))) {
|
||||
d->errorOccurred(UnknownSocketError,
|
||||
QLatin1String("QLocalSocket::connectToServer"));
|
||||
return;
|
||||
}
|
||||
|
||||
// _q_connectToSocket does the actual connecting
|
||||
d->connectingName = d->serverName;
|
||||
|
@ -357,14 +357,6 @@ bool QNativeSocketEngine::initialize(QAbstractSocket::SocketType socketType, QAb
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make the socket nonblocking.
|
||||
if (!setOption(NonBlockingSocketOption, 1)) {
|
||||
d->setError(QAbstractSocket::UnsupportedSocketOperationError,
|
||||
QNativeSocketEnginePrivate::NonBlockingInitFailedErrorString);
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the broadcasting flag if it's a UDP socket.
|
||||
if (socketType == QAbstractSocket::UdpSocket
|
||||
&& !setOption(BroadcastSocketOption, 1)) {
|
||||
|
@ -138,10 +138,10 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
|
||||
int protocol = (socketProtocol == QAbstractSocket::IPv6Protocol || socketProtocol == QAbstractSocket::AnyIPProtocol) ? AF_INET6 : AF_INET;
|
||||
int type = (socketType == QAbstractSocket::UdpSocket) ? SOCK_DGRAM : SOCK_STREAM;
|
||||
|
||||
int socket = qt_safe_socket(protocol, type, 0);
|
||||
int socket = qt_safe_socket(protocol, type, 0, O_NONBLOCK);
|
||||
if (socket < 0 && socketProtocol == QAbstractSocket::AnyIPProtocol && errno == EAFNOSUPPORT) {
|
||||
protocol = AF_INET;
|
||||
socket = qt_safe_socket(protocol, type, 0);
|
||||
socket = qt_safe_socket(protocol, type, 0, O_NONBLOCK);
|
||||
socketProtocol = QAbstractSocket::IPv4Protocol;
|
||||
}
|
||||
|
||||
|
@ -383,8 +383,15 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
|
||||
#endif
|
||||
|
||||
socketDescriptor = socket;
|
||||
return true;
|
||||
|
||||
// Make the socket nonblocking.
|
||||
if (!setOption(QAbstractSocketEngine::NonBlockingSocketOption, 1)) {
|
||||
setError(QAbstractSocket::UnsupportedSocketOperationError, NonBlockingInitFailedErrorString);
|
||||
q_func()->close();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*! \internal
|
||||
|
@ -768,7 +768,7 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
|
||||
return false;
|
||||
}
|
||||
socketDescriptor = qintptr(socket.Detach());
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
case QAbstractSocket::UdpSocket: {
|
||||
ComPtr<IDatagramSocket> socket;
|
||||
@ -780,13 +780,21 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
|
||||
EventRegistrationToken token;
|
||||
socketDescriptor = qintptr(socket.Detach());
|
||||
udpSocket()->add_MessageReceived(Callback<DatagramReceivedHandler>(this, &QNativeSocketEnginePrivate::handleNewDatagram).Get(), &token);
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
qWarning("Invalid socket type");
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
|
||||
// Make the socket nonblocking.
|
||||
if (!setOption(QAbstractSocketEngine::NonBlockingSocketOption, 1)) {
|
||||
setError(QAbstractSocket::UnsupportedSocketOperationError, NonBlockingInitFailedErrorString);
|
||||
q_func()->close();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QNativeSocketEnginePrivate::QNativeSocketEnginePrivate()
|
||||
|
@ -163,7 +163,7 @@ Q_GLOBAL_STATIC(QGLSignalProxy, theSignalProxy)
|
||||
QGLSignalProxy *QGLSignalProxy::instance()
|
||||
{
|
||||
QGLSignalProxy *proxy = theSignalProxy();
|
||||
if (proxy && proxy->thread() != qApp->thread()) {
|
||||
if (proxy && qApp && proxy->thread() != qApp->thread()) {
|
||||
if (proxy->thread() == QThread::currentThread())
|
||||
proxy->moveToThread(qApp->thread());
|
||||
}
|
||||
|
@ -37,7 +37,7 @@
|
||||
a QGLWidget.
|
||||
|
||||
\obsolete
|
||||
\inmodule OpenGL
|
||||
\inmodule QtOpenGL
|
||||
\ingroup painting-3D
|
||||
\ingroup shared
|
||||
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE;
|
||||
void doneCurrent() Q_DECL_OVERRIDE;
|
||||
void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
|
||||
void (*getProcAddress(const QByteArray &procName)) () Q_DECL_OVERRIDE;
|
||||
QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE;
|
||||
|
||||
QSurfaceFormat format() const Q_DECL_OVERRIDE;
|
||||
bool isSharing() const Q_DECL_OVERRIDE { return m_shareContext != EGL_NO_CONTEXT; }
|
||||
|
@ -295,8 +295,7 @@ QList<AndroidNetworkInfo> AndroidConnectivityManager::getAllNetworkInfo() const
|
||||
if (exceptionCheckAndClear(env))
|
||||
break;
|
||||
|
||||
list << AndroidNetworkInfo(lref);
|
||||
env->DeleteLocalRef(lref);
|
||||
list << AndroidNetworkInfo(QJNIObjectPrivate::fromLocalRef(lref));
|
||||
}
|
||||
|
||||
return list;
|
||||
|
@ -80,10 +80,10 @@ QNetworkManagerEngine::QNetworkManagerEngine(QObject *parent)
|
||||
this, SLOT(ofonoUnRegistered(QString)));
|
||||
|
||||
if (QDBusConnection::systemBus().interface()->isServiceRegistered("org.ofono"))
|
||||
ofonoRegistered();
|
||||
QMetaObject::invokeMethod(this, "ofonoRegistered", Qt::QueuedConnection);
|
||||
|
||||
if (QDBusConnection::systemBus().interface()->isServiceRegistered(NM_DBUS_SERVICE))
|
||||
nmRegistered();
|
||||
QMetaObject::invokeMethod(this, "nmRegistered", Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
QNetworkManagerEngine::~QNetworkManagerEngine()
|
||||
|
@ -438,7 +438,7 @@ static QString strippedText(QString s)
|
||||
- (void)panelSelectionDidChange:(id)sender
|
||||
{
|
||||
Q_UNUSED(sender);
|
||||
if (mHelper) {
|
||||
if (mHelper && [mSavePanel isVisible]) {
|
||||
QString selection = QCFString::toQString([[mSavePanel URL] path]);
|
||||
if (selection != mCurrentSelection) {
|
||||
*mCurrentSelection = selection;
|
||||
|
@ -68,8 +68,6 @@ enum {
|
||||
D2DDebugFillRectTag,
|
||||
D2DDebugDrawRectsTag,
|
||||
D2DDebugDrawRectFsTag,
|
||||
D2DDebugDrawLinesTag,
|
||||
D2DDebugDrawLineFsTag,
|
||||
D2DDebugDrawEllipseTag,
|
||||
D2DDebugDrawEllipseFTag,
|
||||
D2DDebugDrawImageTag,
|
||||
@ -102,22 +100,28 @@ static inline ID2D1Factory1 *factory()
|
||||
return QWindowsDirect2DContext::instance()->d2dFactory();
|
||||
}
|
||||
|
||||
static inline D2D1_MATRIX_3X2_F transformFromLine(const QLineF &line, qreal penWidth)
|
||||
static inline D2D1_MATRIX_3X2_F transformFromLine(const QLineF &line, qreal penWidth, qreal dashOffset)
|
||||
{
|
||||
const qreal halfWidth = penWidth / 2;
|
||||
const qreal angle = -qDegreesToRadians(line.angle());
|
||||
QTransform transform = QTransform::fromTranslate(line.p1().x() + qSin(angle) * halfWidth,
|
||||
line.p1().y() - qCos(angle) * halfWidth);
|
||||
const qreal sinA = qSin(angle);
|
||||
const qreal cosA = qCos(angle);
|
||||
QTransform transform = QTransform::fromTranslate(line.p1().x() + dashOffset * cosA + sinA * halfWidth,
|
||||
line.p1().y() + dashOffset * sinA - cosA * halfWidth);
|
||||
transform.rotateRadians(angle);
|
||||
return to_d2d_matrix_3x2_f(transform);
|
||||
}
|
||||
|
||||
static void adjustLine(QPointF *p1, QPointF *p2);
|
||||
static bool isLinePositivelySloped(const QPointF &p1, const QPointF &p2);
|
||||
|
||||
class Direct2DPathGeometryWriter
|
||||
{
|
||||
public:
|
||||
Direct2DPathGeometryWriter()
|
||||
: m_inFigure(false)
|
||||
, m_roundCoordinates(false)
|
||||
, m_adjustPositivelySlopedLines(false)
|
||||
{
|
||||
|
||||
}
|
||||
@ -152,6 +156,11 @@ public:
|
||||
m_roundCoordinates = enable;
|
||||
}
|
||||
|
||||
void setPositiveSlopeAdjustmentEnabled(bool enable)
|
||||
{
|
||||
m_adjustPositivelySlopedLines = enable;
|
||||
}
|
||||
|
||||
bool isInFigure() const
|
||||
{
|
||||
return m_inFigure;
|
||||
@ -164,11 +173,20 @@ public:
|
||||
|
||||
m_sink->BeginFigure(adjusted(point), D2D1_FIGURE_BEGIN_FILLED);
|
||||
m_inFigure = true;
|
||||
m_previousPoint = point;
|
||||
}
|
||||
|
||||
void lineTo(const QPointF &point)
|
||||
{
|
||||
m_sink->AddLine(adjusted(point));
|
||||
QPointF pt = point;
|
||||
if (m_adjustPositivelySlopedLines && isLinePositivelySloped(m_previousPoint, point)) {
|
||||
moveTo(m_previousPoint - QPointF(0, 1));
|
||||
pt -= QPointF(0, 1);
|
||||
}
|
||||
m_sink->AddLine(adjusted(pt));
|
||||
if (pt != point)
|
||||
moveTo(point);
|
||||
m_previousPoint = point;
|
||||
}
|
||||
|
||||
void curveTo(const QPointF &p1, const QPointF &p2, const QPointF &p3)
|
||||
@ -180,6 +198,7 @@ public:
|
||||
};
|
||||
|
||||
m_sink->AddBezier(segment);
|
||||
m_previousPoint = p3;
|
||||
}
|
||||
|
||||
void close()
|
||||
@ -212,6 +231,8 @@ private:
|
||||
|
||||
bool m_inFigure;
|
||||
bool m_roundCoordinates;
|
||||
bool m_adjustPositivelySlopedLines;
|
||||
QPointF m_previousPoint;
|
||||
};
|
||||
|
||||
struct D2DVectorPathCache {
|
||||
@ -257,6 +278,7 @@ public:
|
||||
ComPtr<ID2D1Brush> brush;
|
||||
ComPtr<ID2D1StrokeStyle1> strokeStyle;
|
||||
ComPtr<ID2D1BitmapBrush1> dashBrush;
|
||||
int dashLength;
|
||||
|
||||
inline void reset() {
|
||||
emulate = false;
|
||||
@ -264,6 +286,7 @@ public:
|
||||
brush.Reset();
|
||||
strokeStyle.Reset();
|
||||
dashBrush.Reset();
|
||||
dashLength = 0;
|
||||
}
|
||||
} pen;
|
||||
|
||||
@ -566,6 +589,7 @@ public:
|
||||
D2D1_BITMAP_BRUSH_PROPERTIES1 bitmapBrushProperties = D2D1::BitmapBrushProperties1(
|
||||
D2D1_EXTEND_MODE_WRAP, D2D1_EXTEND_MODE_CLAMP, D2D1_INTERPOLATION_MODE_LINEAR);
|
||||
hr = dc()->CreateBitmapBrush(bitmap.bitmap(), bitmapBrushProperties, &pen.dashBrush);
|
||||
pen.dashLength = bitmap.size().width();
|
||||
} else {
|
||||
hr = factory()->CreateStrokeStyle(props, NULL, 0, &pen.strokeStyle);
|
||||
}
|
||||
@ -795,6 +819,8 @@ public:
|
||||
|
||||
writer.setWindingFillEnabled(path.hasWindingFill());
|
||||
writer.setAliasingEnabled(alias);
|
||||
writer.setPositiveSlopeAdjustmentEnabled(path.shape() == QVectorPath::LinesHint
|
||||
|| path.shape() == QVectorPath::PolygonHint);
|
||||
|
||||
const QPainterPath::ElementType *types = path.elements();
|
||||
const int count = path.elementCount();
|
||||
@ -910,6 +936,90 @@ public:
|
||||
DWRITE_MEASURING_MODE_GDI_CLASSIC);
|
||||
}
|
||||
|
||||
void stroke(const QVectorPath &path)
|
||||
{
|
||||
Q_Q(QWindowsDirect2DPaintEngine);
|
||||
|
||||
// Default path (no optimization)
|
||||
if (!(path.shape() == QVectorPath::LinesHint || path.shape() == QVectorPath::PolygonHint)
|
||||
|| !pen.dashBrush || q->state()->renderHints.testFlag(QPainter::HighQualityAntialiasing)) {
|
||||
ComPtr<ID2D1Geometry> geometry = vectorPathToID2D1PathGeometry(path);
|
||||
if (!geometry) {
|
||||
qWarning("%s: Could not convert path to d2d geometry", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
dc()->DrawGeometry(geometry.Get(), pen.brush.Get(), pen.qpen.widthF(), pen.strokeStyle.Get());
|
||||
return;
|
||||
}
|
||||
|
||||
// Optimized dash line drawing
|
||||
const bool isPolygon = path.shape() == QVectorPath::PolygonHint && path.elementCount() >= 3;
|
||||
const bool implicitClose = isPolygon && (path.hints() & QVectorPath::ImplicitClose);
|
||||
const bool skipJoin = !isPolygon // Non-polygons don't require joins
|
||||
|| (pen.qpen.joinStyle() == Qt::MiterJoin && qFuzzyIsNull(pen.qpen.miterLimit()));
|
||||
const qreal *points = path.points();
|
||||
const int lastElement = path.elementCount() - (implicitClose ? 1 : 2);
|
||||
qreal dashOffset = 0;
|
||||
QPointF jointStart;
|
||||
ID2D1Brush *brush = pen.dashBrush ? pen.dashBrush.Get() : pen.brush.Get();
|
||||
for (int i = 0; i <= lastElement; ++i) {
|
||||
QPointF p1(points[i * 2], points[i * 2 + 1]);
|
||||
QPointF p2 = implicitClose && i == lastElement ? QPointF(points[0], points[1])
|
||||
: QPointF(points[i * 2 + 2], points[i * 2 + 3]);
|
||||
if (!isPolygon) // Advance the count for lines
|
||||
++i;
|
||||
|
||||
// Match raster engine output
|
||||
if (p1 == p2 && pen.qpen.widthF() <= 1.0) {
|
||||
q->fillRect(QRectF(p1, QSizeF(pen.qpen.widthF(), pen.qpen.widthF())), pen.qpen.brush());
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!q->antiAliasingEnabled())
|
||||
adjustLine(&p1, &p2);
|
||||
|
||||
q->adjustForAliasing(&p1);
|
||||
q->adjustForAliasing(&p2);
|
||||
|
||||
const QLineF line(p1, p2);
|
||||
const qreal lineLength = line.length();
|
||||
if (pen.dashBrush) {
|
||||
pen.dashBrush->SetTransform(transformFromLine(line, pen.qpen.widthF(), dashOffset));
|
||||
dashOffset = pen.dashLength - fmod(lineLength - dashOffset, pen.dashLength);
|
||||
}
|
||||
dc()->DrawLine(to_d2d_point_2f(p1), to_d2d_point_2f(p2),
|
||||
brush, pen.qpen.widthF(), NULL);
|
||||
|
||||
if (skipJoin)
|
||||
continue;
|
||||
|
||||
// Patch the join with the original brush
|
||||
const qreal patchSegment = pen.dashBrush ? qBound(0.0, (pen.dashLength - dashOffset) / lineLength, 1.0)
|
||||
: pen.qpen.widthF();
|
||||
if (i > 0) {
|
||||
Direct2DPathGeometryWriter writer;
|
||||
writer.begin();
|
||||
writer.moveTo(jointStart);
|
||||
writer.lineTo(p1);
|
||||
writer.lineTo(line.pointAt(patchSegment));
|
||||
writer.close();
|
||||
dc()->DrawGeometry(writer.geometry().Get(), pen.brush.Get(), pen.qpen.widthF(), pen.strokeStyle.Get());
|
||||
}
|
||||
// Record the start position of the next joint
|
||||
jointStart = line.pointAt(1 - patchSegment);
|
||||
|
||||
if (implicitClose && i == lastElement) { // Close the polygon
|
||||
Direct2DPathGeometryWriter writer;
|
||||
writer.begin();
|
||||
writer.moveTo(jointStart);
|
||||
writer.lineTo(p2);
|
||||
writer.lineTo(QLineF(p2, QPointF(points[2], points[3])).pointAt(patchSegment));
|
||||
writer.close();
|
||||
dc()->DrawGeometry(writer.geometry().Get(), pen.brush.Get(), pen.qpen.widthF(), pen.strokeStyle.Get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ComPtr<IDWriteFontFace> fontFaceFromFontEngine(QFontEngine *fe)
|
||||
{
|
||||
const QFontDef fontDef = fe->fontDef;
|
||||
@ -1055,20 +1165,12 @@ void QWindowsDirect2DPaintEngine::setState(QPainterState *s)
|
||||
|
||||
void QWindowsDirect2DPaintEngine::draw(const QVectorPath &path)
|
||||
{
|
||||
Q_D(QWindowsDirect2DPaintEngine);
|
||||
|
||||
ComPtr<ID2D1Geometry> geometry = d->vectorPathToID2D1PathGeometry(path);
|
||||
if (!geometry) {
|
||||
qWarning("%s: Could not convert path to d2d geometry", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
const QBrush &brush = state()->brush;
|
||||
if (qbrush_style(brush) != Qt::NoBrush) {
|
||||
if (emulationRequired(BrushEmulation))
|
||||
rasterFill(path, brush);
|
||||
else
|
||||
fill(geometry.Get(), brush);
|
||||
fill(path, brush);
|
||||
}
|
||||
|
||||
const QPen &pen = state()->pen;
|
||||
@ -1076,7 +1178,7 @@ void QWindowsDirect2DPaintEngine::draw(const QVectorPath &path)
|
||||
if (emulationRequired(PenEmulation))
|
||||
QPaintEngineEx::stroke(path, pen);
|
||||
else
|
||||
stroke(geometry.Get(), pen);
|
||||
stroke(path, pen);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1106,18 +1208,6 @@ void QWindowsDirect2DPaintEngine::fill(const QVectorPath &path, const QBrush &br
|
||||
d->dc()->FillGeometry(geometry.Get(), d->brush.brush.Get());
|
||||
}
|
||||
|
||||
void QWindowsDirect2DPaintEngine::fill(ID2D1Geometry *geometry, const QBrush &brush)
|
||||
{
|
||||
Q_D(QWindowsDirect2DPaintEngine);
|
||||
D2D_TAG(D2DDebugFillTag);
|
||||
|
||||
ensureBrush(brush);
|
||||
if (!d->brush.brush)
|
||||
return;
|
||||
|
||||
d->dc()->FillGeometry(geometry, d->brush.brush.Get());
|
||||
}
|
||||
|
||||
void QWindowsDirect2DPaintEngine::stroke(const QVectorPath &path, const QPen &pen)
|
||||
{
|
||||
Q_D(QWindowsDirect2DPaintEngine);
|
||||
@ -1135,25 +1225,7 @@ void QWindowsDirect2DPaintEngine::stroke(const QVectorPath &path, const QPen &pe
|
||||
if (!d->pen.brush)
|
||||
return;
|
||||
|
||||
ComPtr<ID2D1Geometry> geometry = d->vectorPathToID2D1PathGeometry(path);
|
||||
if (!geometry) {
|
||||
qWarning("%s: Could not convert path to d2d geometry", __FUNCTION__);
|
||||
return;
|
||||
}
|
||||
|
||||
d->dc()->DrawGeometry(geometry.Get(), d->pen.brush.Get(), d->pen.qpen.widthF(), d->pen.strokeStyle.Get());
|
||||
}
|
||||
|
||||
void QWindowsDirect2DPaintEngine::stroke(ID2D1Geometry *geometry, const QPen &pen)
|
||||
{
|
||||
Q_D(QWindowsDirect2DPaintEngine);
|
||||
D2D_TAG(D2DDebugFillTag);
|
||||
|
||||
ensurePen(pen);
|
||||
if (!d->pen.brush)
|
||||
return;
|
||||
|
||||
d->dc()->DrawGeometry(geometry, d->pen.brush.Get(), d->pen.qpen.widthF(), d->pen.strokeStyle.Get());
|
||||
d->stroke(path);
|
||||
}
|
||||
|
||||
void QWindowsDirect2DPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op)
|
||||
@ -1301,88 +1373,6 @@ static void adjustLine(QPointF *p1, QPointF *p2)
|
||||
}
|
||||
}
|
||||
|
||||
void QWindowsDirect2DPaintEngine::drawLines(const QLine *lines, int lineCount)
|
||||
{
|
||||
Q_D(QWindowsDirect2DPaintEngine);
|
||||
D2D_TAG(D2DDebugDrawLinesTag);
|
||||
|
||||
ensurePen();
|
||||
|
||||
if (emulationRequired(PenEmulation)) {
|
||||
QPaintEngineEx::drawLines(lines, lineCount);
|
||||
} else if (d->pen.brush) {
|
||||
for (int i = 0; i < lineCount; i++) {
|
||||
QPointF p1 = lines[i].p1();
|
||||
QPointF p2 = lines[i].p2();
|
||||
|
||||
// Match raster engine output
|
||||
if (p1 == p2 && d->pen.qpen.widthF() <= 1.0) {
|
||||
fillRect(QRectF(p1, QSizeF(d->pen.qpen.widthF(), d->pen.qpen.widthF())),
|
||||
d->pen.qpen.brush());
|
||||
continue;
|
||||
}
|
||||
|
||||
// Match raster engine output
|
||||
if (!antiAliasingEnabled())
|
||||
adjustLine(&p1, &p2);
|
||||
|
||||
adjustForAliasing(&p1);
|
||||
adjustForAliasing(&p2);
|
||||
|
||||
D2D1_POINT_2F d2d_p1 = to_d2d_point_2f(p1);
|
||||
D2D1_POINT_2F d2d_p2 = to_d2d_point_2f(p2);
|
||||
|
||||
if (!d->pen.dashBrush || state()->renderHints.testFlag(QPainter::HighQualityAntialiasing)) {
|
||||
d->dc()->DrawLine(d2d_p1, d2d_p2, d->pen.brush.Get(), d->pen.qpen.widthF(), d->pen.strokeStyle.Get());
|
||||
} else {
|
||||
d->pen.dashBrush->SetTransform(transformFromLine(lines[i], d->pen.qpen.widthF()));
|
||||
d->dc()->DrawLine(d2d_p1, d2d_p2, d->pen.dashBrush.Get(), d->pen.qpen.widthF(), NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QWindowsDirect2DPaintEngine::drawLines(const QLineF *lines, int lineCount)
|
||||
{
|
||||
Q_D(QWindowsDirect2DPaintEngine);
|
||||
D2D_TAG(D2DDebugDrawLineFsTag);
|
||||
|
||||
ensurePen();
|
||||
|
||||
if (emulationRequired(PenEmulation)) {
|
||||
QPaintEngineEx::drawLines(lines, lineCount);
|
||||
} else if (d->pen.brush) {
|
||||
for (int i = 0; i < lineCount; i++) {
|
||||
QPointF p1 = lines[i].p1();
|
||||
QPointF p2 = lines[i].p2();
|
||||
|
||||
// Match raster engine output
|
||||
if (p1 == p2 && d->pen.qpen.widthF() <= 1.0) {
|
||||
fillRect(QRectF(p1, QSizeF(d->pen.qpen.widthF(), d->pen.qpen.widthF())),
|
||||
d->pen.qpen.brush());
|
||||
continue;
|
||||
}
|
||||
|
||||
// Match raster engine output
|
||||
if (!antiAliasingEnabled())
|
||||
adjustLine(&p1, &p2);
|
||||
|
||||
adjustForAliasing(&p1);
|
||||
adjustForAliasing(&p2);
|
||||
|
||||
D2D1_POINT_2F d2d_p1 = to_d2d_point_2f(p1);
|
||||
D2D1_POINT_2F d2d_p2 = to_d2d_point_2f(p2);
|
||||
|
||||
if (!d->pen.dashBrush || state()->renderHints.testFlag(QPainter::HighQualityAntialiasing)) {
|
||||
d->dc()->DrawLine(d2d_p1, d2d_p2, d->pen.brush.Get(), d->pen.qpen.widthF(), d->pen.strokeStyle.Get());
|
||||
} else {
|
||||
d->pen.dashBrush->SetTransform(transformFromLine(lines[i], d->pen.qpen.widthF()));
|
||||
d->dc()->DrawLine(d2d_p1, d2d_p2, d->pen.dashBrush.Get(), d->pen.qpen.widthF(), NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QWindowsDirect2DPaintEngine::drawEllipse(const QRectF &r)
|
||||
{
|
||||
Q_D(QWindowsDirect2DPaintEngine);
|
||||
|
@ -92,9 +92,6 @@ public:
|
||||
void drawRects(const QRect *rects, int rectCount) Q_DECL_OVERRIDE;
|
||||
void drawRects(const QRectF *rects, int rectCount) Q_DECL_OVERRIDE;
|
||||
|
||||
void drawLines(const QLine *lines, int lineCount) Q_DECL_OVERRIDE;
|
||||
void drawLines(const QLineF *lines, int lineCount) Q_DECL_OVERRIDE;
|
||||
|
||||
void drawEllipse(const QRectF &r) Q_DECL_OVERRIDE;
|
||||
void drawEllipse(const QRect &r) Q_DECL_OVERRIDE;
|
||||
|
||||
|
@ -138,8 +138,9 @@
|
||||
QRect previousGeometry = requestedGeometry != actualGeometry ?
|
||||
requestedGeometry : qt_window_private(m_qioswindow->window())->geometry;
|
||||
|
||||
QWindowSystemInterface::handleGeometryChange(m_qioswindow->window(), actualGeometry, previousGeometry);
|
||||
QWindowSystemInterface::flushWindowSystemEvents();
|
||||
QWindow *window = m_qioswindow->window();
|
||||
QWindowSystemInterface::handleGeometryChange(window, actualGeometry, previousGeometry);
|
||||
QWindowSystemInterface::flushWindowSystemEvents(window->inherits("QWidgetWindow") ? QEventLoop::ExcludeUserInputEvents : QEventLoop::AllEvents);
|
||||
|
||||
if (actualGeometry.size() != previousGeometry.size()) {
|
||||
// Trigger expose event on resize
|
||||
|
@ -79,6 +79,8 @@ void QLinuxFbIntegration::initialize()
|
||||
|
||||
m_inputContext = QPlatformInputContextFactory::create();
|
||||
|
||||
m_nativeInterface.reset(new QPlatformNativeInterface);
|
||||
|
||||
m_vtHandler.reset(new QFbVtHandler);
|
||||
|
||||
if (!qEnvironmentVariableIntValue("QT_QPA_FB_DISABLE_INPUT"))
|
||||
@ -141,4 +143,9 @@ void QLinuxFbIntegration::createInputHandlers()
|
||||
#endif
|
||||
}
|
||||
|
||||
QPlatformNativeInterface *QLinuxFbIntegration::nativeInterface() const
|
||||
{
|
||||
return m_nativeInterface.data();
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -61,6 +61,8 @@ public:
|
||||
QPlatformServices *services() const Q_DECL_OVERRIDE;
|
||||
QPlatformInputContext *inputContext() const Q_DECL_OVERRIDE { return m_inputContext; }
|
||||
|
||||
QPlatformNativeInterface *nativeInterface() const Q_DECL_OVERRIDE;
|
||||
|
||||
QList<QPlatformScreen *> screens() const;
|
||||
|
||||
private:
|
||||
@ -71,6 +73,7 @@ private:
|
||||
QScopedPointer<QPlatformFontDatabase> m_fontDb;
|
||||
QScopedPointer<QPlatformServices> m_services;
|
||||
QScopedPointer<QFbVtHandler> m_vtHandler;
|
||||
QScopedPointer<QPlatformNativeInterface> m_nativeInterface;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
@ -85,7 +85,7 @@ public:
|
||||
bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE;
|
||||
void doneCurrent() Q_DECL_OVERRIDE;
|
||||
void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
|
||||
void (*getProcAddress(const QByteArray &procName)) () Q_DECL_OVERRIDE;
|
||||
QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE;
|
||||
|
||||
QSurfaceFormat format() const Q_DECL_OVERRIDE;
|
||||
bool isSharing() const Q_DECL_OVERRIDE;
|
||||
|
@ -675,6 +675,8 @@ static inline bool findPlatformWindowHelper(const POINT &screenPoint, unsigned c
|
||||
#ifndef Q_OS_WINCE
|
||||
const HWND child = ChildWindowFromPointEx(*hwnd, point, cwexFlags);
|
||||
#else
|
||||
// Under Windows CE we don't use ChildWindowFromPointEx as it's not available
|
||||
// and ChildWindowFromPoint does not work properly.
|
||||
Q_UNUSED(cwexFlags)
|
||||
const HWND child = WindowFromPoint(point);
|
||||
#endif
|
||||
@ -683,7 +685,13 @@ static inline bool findPlatformWindowHelper(const POINT &screenPoint, unsigned c
|
||||
if (QWindowsWindow *window = context->findPlatformWindow(child)) {
|
||||
*result = window;
|
||||
*hwnd = child;
|
||||
#ifndef Q_OS_WINCE
|
||||
return true;
|
||||
#else
|
||||
// WindowFromPoint does not return same handle in two sequential calls, which leads
|
||||
// to an endless loop, but calling WindowFromPoint once is good enough.
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
#ifndef Q_OS_WINCE // Does not have WS_EX_TRANSPARENT .
|
||||
// QTBUG-40555: despite CWP_SKIPINVISIBLE, it is possible to hit on invisible
|
||||
|
@ -1674,8 +1674,10 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request,
|
||||
|
||||
HFONT hfont = 0;
|
||||
hfont = CreateFontIndirect(&lf);
|
||||
if (!hfont)
|
||||
if (!hfont) {
|
||||
qErrnoWarning("%s: CreateFontIndirect failed", __FUNCTION__);
|
||||
hfont = QWindowsFontDatabase::systemFont();
|
||||
}
|
||||
|
||||
bool ttf = false;
|
||||
int avWidth = 0;
|
||||
@ -1689,18 +1691,17 @@ QFontEngine *QWindowsFontDatabase::createEngine(const QFontDef &request,
|
||||
SelectObject(data->hdc, oldObj);
|
||||
|
||||
if (!useDirectWrite) {
|
||||
if (hfont && (!ttf || request.stretch != 100)) {
|
||||
if (!ttf || request.stretch != 100) {
|
||||
DeleteObject(hfont);
|
||||
if (!res)
|
||||
qErrnoWarning("%s: GetTextMetrics failed", __FUNCTION__);
|
||||
lf.lfWidth = avWidth * request.stretch/100;
|
||||
hfont = CreateFontIndirect(&lf);
|
||||
if (!hfont)
|
||||
if (!hfont) {
|
||||
qErrnoWarning("%s: CreateFontIndirect with stretch failed", __FUNCTION__);
|
||||
hfont = QWindowsFontDatabase::systemFont();
|
||||
}
|
||||
}
|
||||
|
||||
if (!hfont)
|
||||
hfont = QWindowsFontDatabase::systemFont();
|
||||
}
|
||||
|
||||
#if !defined(QT_NO_DIRECTWRITE)
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QDirIterator>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QRegularExpression>
|
||||
#include <QtGui/private/qfontengine_ft_p.h>
|
||||
#include <QtGui/QGuiApplication>
|
||||
#include <QtGui/QFontDatabase>
|
||||
@ -101,7 +102,67 @@ static FontFile * createFontFile(const QString &fileName, int index)
|
||||
extern bool localizedName(const QString &name);
|
||||
extern QString getEnglishName(const QString &familyName);
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
#ifndef Q_OS_WINCE
|
||||
|
||||
namespace {
|
||||
struct FontKey
|
||||
{
|
||||
QString fileName;
|
||||
QStringList fontNames;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
typedef QVector<FontKey> FontKeys;
|
||||
|
||||
static FontKeys &fontKeys()
|
||||
{
|
||||
static FontKeys result;
|
||||
if (result.isEmpty()) {
|
||||
const QSettings fontRegistry(QStringLiteral("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"),
|
||||
QSettings::NativeFormat);
|
||||
const QStringList allKeys = fontRegistry.allKeys();
|
||||
const QString trueType = QStringLiteral("(TrueType)");
|
||||
const QRegularExpression sizeListMatch(QStringLiteral("\\s(\\d+,)+\\d+"));
|
||||
Q_ASSERT(sizeListMatch.isValid());
|
||||
const int size = allKeys.size();
|
||||
result.reserve(size);
|
||||
for (int i = 0; i < size; ++i) {
|
||||
FontKey fontKey;
|
||||
const QString ®istryFontKey = allKeys.at(i);
|
||||
fontKey.fileName = fontRegistry.value(registryFontKey).toString();
|
||||
QString realKey = registryFontKey;
|
||||
realKey.remove(trueType);
|
||||
realKey.remove(sizeListMatch);
|
||||
const QStringList fontNames = realKey.trimmed().split(QLatin1Char('&'));
|
||||
fontKey.fontNames.reserve(fontNames.size());
|
||||
foreach (const QString &fontName, fontNames)
|
||||
fontKey.fontNames.append(fontName.trimmed());
|
||||
result.append(fontKey);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static const FontKey *findFontKey(const QString &name, int *indexIn = Q_NULLPTR)
|
||||
{
|
||||
typedef FontKeys::ConstIterator ConstIt;
|
||||
|
||||
const FontKeys &keys = fontKeys();
|
||||
for (ConstIt it = keys.constBegin(), cend = keys.constEnd(); it != cend; ++it) {
|
||||
const int index = it->fontNames.indexOf(name);
|
||||
if (index >= 0) {
|
||||
if (indexIn)
|
||||
*indexIn = index;
|
||||
return &(*it);
|
||||
}
|
||||
}
|
||||
if (indexIn)
|
||||
*indexIn = -1;
|
||||
return Q_NULLPTR;
|
||||
}
|
||||
|
||||
#else // Q_OS_WINCE
|
||||
|
||||
typedef struct {
|
||||
quint16 majorVersion;
|
||||
quint16 minorVersion;
|
||||
@ -220,24 +281,67 @@ static QString fontNameFromTTFile(const QString &filename)
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
static inline QString fontSettingsOrganization() { return QStringLiteral("Qt-Project"); }
|
||||
static inline QString fontSettingsApplication() { return QStringLiteral("Qtbase"); }
|
||||
static inline QString fontSettingsGroup() { return QStringLiteral("CEFontCache"); }
|
||||
|
||||
static QString findFontFile(const QString &faceName)
|
||||
{
|
||||
static QHash<QString, QString> fontCache;
|
||||
|
||||
if (fontCache.isEmpty()) {
|
||||
QSettings settings(QSettings::SystemScope, fontSettingsOrganization(), fontSettingsApplication());
|
||||
settings.beginGroup(fontSettingsGroup());
|
||||
foreach (const QString &fontName, settings.allKeys())
|
||||
fontCache.insert(fontName, settings.value(fontName).toString());
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
QString value = fontCache.value(faceName);
|
||||
|
||||
//Fallback if we haven't cached the font yet or the font got removed/renamed iterate again over all fonts
|
||||
if (value.isEmpty() || !QFile::exists(value)) {
|
||||
QSettings settings(QSettings::SystemScope, fontSettingsOrganization(), fontSettingsApplication());
|
||||
settings.beginGroup(fontSettingsGroup());
|
||||
|
||||
//empty the cache first, as it seems that it is dirty
|
||||
settings.remove(QString());
|
||||
|
||||
QDirIterator it(QStringLiteral("/Windows"), QStringList(QStringLiteral("*.ttf")), QDir::Files | QDir::Hidden | QDir::System);
|
||||
|
||||
while (it.hasNext()) {
|
||||
const QString fontFile = it.next();
|
||||
const QString fontName = fontNameFromTTFile(fontFile);
|
||||
if (fontName.isEmpty())
|
||||
continue;
|
||||
fontCache.insert(fontName, fontFile);
|
||||
settings.setValue(fontName, fontFile);
|
||||
|
||||
if (localizedName(fontName)) {
|
||||
QString englishFontName = getEnglishName(fontName);
|
||||
fontCache.insert(englishFontName, fontFile);
|
||||
settings.setValue(englishFontName, fontFile);
|
||||
}
|
||||
}
|
||||
settings.endGroup();
|
||||
value = fontCache.value(faceName);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
#endif // Q_OS_WINCE
|
||||
|
||||
static bool addFontToDatabase(const QString &familyName, uchar charSet,
|
||||
static bool addFontToDatabase(const QString &faceName,
|
||||
const QString &fullName,
|
||||
uchar charSet,
|
||||
const TEXTMETRIC *textmetric,
|
||||
const FONTSIGNATURE *signature,
|
||||
int type)
|
||||
{
|
||||
typedef QPair<QString, QStringList> FontKey;
|
||||
|
||||
// the "@family" fonts are just the same as "family". Ignore them.
|
||||
if (familyName.isEmpty() || familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QLatin1String("WST_")))
|
||||
if (faceName.isEmpty() || faceName.at(0) == QLatin1Char('@') || faceName.startsWith(QLatin1String("WST_")))
|
||||
return false;
|
||||
|
||||
const int separatorPos = familyName.indexOf(QStringLiteral("::"));
|
||||
const QString faceName =
|
||||
separatorPos != -1 ? familyName.left(separatorPos) : familyName;
|
||||
const QString fullName =
|
||||
separatorPos != -1 ? familyName.mid(separatorPos + 2) : QString();
|
||||
static const int SMOOTH_SCALABLE = 0xffff;
|
||||
const QString foundryName; // No such concept.
|
||||
const NEWTEXTMETRIC *tm = (NEWTEXTMETRIC *)textmetric;
|
||||
@ -254,7 +358,7 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet,
|
||||
if (QWindowsContext::verbose > 2) {
|
||||
QString message;
|
||||
QTextStream str(&message);
|
||||
str << __FUNCTION__ << ' ' << familyName << ' ' << charSet << " TTF=" << ttf;
|
||||
str << __FUNCTION__ << ' ' << faceName << "::" << fullName << ' ' << charSet << " TTF=" << ttf;
|
||||
if (type & DEVICE_FONTTYPE)
|
||||
str << " DEVICE";
|
||||
if (type & RASTER_FONTTYPE)
|
||||
@ -297,93 +401,19 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet,
|
||||
writingSystems.setSupported(ws);
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
#ifndef Q_OS_WINCE
|
||||
const QSettings fontRegistry(QStringLiteral("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts"),
|
||||
QSettings::NativeFormat);
|
||||
|
||||
static QVector<FontKey> allFonts;
|
||||
if (allFonts.isEmpty()) {
|
||||
const QStringList allKeys = fontRegistry.allKeys();
|
||||
allFonts.reserve(allKeys.size());
|
||||
const QString trueType = QStringLiteral("(TrueType)");
|
||||
const QRegExp sizeListMatch(QStringLiteral("\\s(\\d+,)+\\d+"));
|
||||
foreach (const QString &key, allKeys) {
|
||||
QString realKey = key;
|
||||
realKey.remove(trueType);
|
||||
realKey.remove(sizeListMatch);
|
||||
QStringList fonts;
|
||||
const QStringList fontNames = realKey.trimmed().split(QLatin1Char('&'));
|
||||
foreach (const QString &fontName, fontNames)
|
||||
fonts.push_back(fontName.trimmed());
|
||||
allFonts.push_back(FontKey(key, fonts));
|
||||
}
|
||||
}
|
||||
|
||||
QString value;
|
||||
int index = 0;
|
||||
for (int k = 0; k < allFonts.size(); ++k) {
|
||||
const FontKey &fontKey = allFonts.at(k);
|
||||
for (int i = 0; i < fontKey.second.length(); ++i) {
|
||||
const QString &font = fontKey.second.at(i);
|
||||
if (font == faceName || fullName == font || englishName == font) {
|
||||
value = fontRegistry.value(fontKey.first).toString();
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!value.isEmpty())
|
||||
break;
|
||||
const FontKey *key = findFontKey(faceName, &index);
|
||||
if (!key) {
|
||||
key = findFontKey(fullName, &index);
|
||||
if (!key && !englishName.isEmpty())
|
||||
key = findFontKey(englishName, &index);
|
||||
if (!key)
|
||||
return false;
|
||||
}
|
||||
QString value = key->fileName;
|
||||
#else
|
||||
QString value;
|
||||
int index = 0;
|
||||
|
||||
static QHash<QString, QString> fontCache;
|
||||
|
||||
if (fontCache.isEmpty()) {
|
||||
QSettings settings(QSettings::SystemScope, QStringLiteral("Qt-Project"), QStringLiteral("Qtbase"));
|
||||
settings.beginGroup(QStringLiteral("CEFontCache"));
|
||||
|
||||
foreach (const QString &fontName, settings.allKeys()) {
|
||||
const QString fontFileName = settings.value(fontName).toString();
|
||||
fontCache.insert(fontName, fontFileName);
|
||||
}
|
||||
|
||||
settings.endGroup(); // CEFontCache
|
||||
}
|
||||
|
||||
value = fontCache.value(faceName);
|
||||
|
||||
//Fallback if we haven't cached the font yet or the font got removed/renamed iterate again over all fonts
|
||||
if (value.isEmpty() || !QFile::exists(value)) {
|
||||
QSettings settings(QSettings::SystemScope, QStringLiteral("Qt-Project"), QStringLiteral("Qtbase"));
|
||||
settings.beginGroup(QStringLiteral("CEFontCache"));
|
||||
|
||||
//empty the cache first, as it seems that it is dirty
|
||||
foreach (const QString &fontName, settings.allKeys())
|
||||
settings.remove(fontName);
|
||||
|
||||
QDirIterator it(QStringLiteral("/Windows"), QStringList(QStringLiteral("*.ttf")), QDir::Files | QDir::Hidden | QDir::System);
|
||||
|
||||
while (it.hasNext()) {
|
||||
const QString fontFile = it.next();
|
||||
const QString fontName = fontNameFromTTFile(fontFile);
|
||||
if (fontName.isEmpty())
|
||||
continue;
|
||||
fontCache.insert(fontName, fontFile);
|
||||
settings.setValue(fontName, fontFile);
|
||||
|
||||
if (localizedName(fontName)) {
|
||||
QString englishFontName = getEnglishName(fontName);
|
||||
fontCache.insert(englishFontName, fontFile);
|
||||
settings.setValue(englishFontName, fontFile);
|
||||
}
|
||||
}
|
||||
|
||||
value = fontCache.value(faceName);
|
||||
|
||||
settings.endGroup(); // CEFontCache
|
||||
}
|
||||
QString value = findFontFile(faceName);
|
||||
#endif
|
||||
|
||||
if (value.isEmpty())
|
||||
@ -440,9 +470,9 @@ static int QT_WIN_CALLBACK storeFont(ENUMLOGFONTEX* f, NEWTEXTMETRICEX *textmetr
|
||||
int type, LPARAM namesSetIn)
|
||||
{
|
||||
typedef QSet<QString> StringSet;
|
||||
const QString familyName = QString::fromWCharArray(f->elfLogFont.lfFaceName)
|
||||
+ QStringLiteral("::")
|
||||
+ QString::fromWCharArray(f->elfFullName);
|
||||
|
||||
const QString faceName = QString::fromWCharArray(f->elfLogFont.lfFaceName);
|
||||
const QString fullName = QString::fromWCharArray(f->elfFullName);
|
||||
const uchar charSet = f->elfLogFont.lfCharSet;
|
||||
|
||||
#ifndef Q_OS_WINCE
|
||||
@ -476,8 +506,10 @@ static int QT_WIN_CALLBACK storeFont(ENUMLOGFONTEX* f, NEWTEXTMETRICEX *textmetr
|
||||
// NEWTEXTMETRICEX is a NEWTEXTMETRIC, which according to the documentation is
|
||||
// identical to a TEXTMETRIC except for the last four members, which we don't use
|
||||
// anyway
|
||||
if (addFontToDatabase(familyName, charSet, (TEXTMETRIC *)textmetric, &signature, type))
|
||||
reinterpret_cast<StringSet *>(namesSetIn)->insert(familyName);
|
||||
if (addFontToDatabase(faceName, fullName,
|
||||
charSet, (TEXTMETRIC *)textmetric, &signature, type)) {
|
||||
reinterpret_cast<StringSet *>(namesSetIn)->insert(faceName + QStringLiteral("::") + fullName);
|
||||
}
|
||||
|
||||
// keep on enumerating
|
||||
return 1;
|
||||
|
@ -567,16 +567,15 @@ static inline int toKeyOrUnicode(int vk, int scancode, unsigned char *kbdBuffer,
|
||||
Q_ASSERT(vk > 0 && vk < 256);
|
||||
int code = 0;
|
||||
QChar unicodeBuffer[5];
|
||||
// While key combinations containing alt and ctrl might trigger the third assignment of a key
|
||||
// (for example "alt+ctrl+q" causes '@' on a German layout), ToUnicode often does not return the
|
||||
// wanted character if only the ctrl modifier is used. Thus we unset this modifier temporarily
|
||||
// if it is not used together with alt.
|
||||
const unsigned char controlState = kbdBuffer[VK_MENU] ? 0 : kbdBuffer[VK_CONTROL];
|
||||
if (controlState)
|
||||
kbdBuffer[VK_CONTROL] = 0;
|
||||
int res = ToUnicode(vk, scancode, kbdBuffer, reinterpret_cast<LPWSTR>(unicodeBuffer), 5, 0);
|
||||
if (controlState)
|
||||
// When Ctrl modifier is used ToUnicode does not return correct values. In order to assign the
|
||||
// right key the control modifier is removed for just that function if the previous call failed.
|
||||
if (res == 0 && kbdBuffer[VK_CONTROL]) {
|
||||
const unsigned char controlState = kbdBuffer[VK_CONTROL];
|
||||
kbdBuffer[VK_CONTROL] = 0;
|
||||
res = ToUnicode(vk, scancode, kbdBuffer, reinterpret_cast<LPWSTR>(unicodeBuffer), 5, 0);
|
||||
kbdBuffer[VK_CONTROL] = controlState;
|
||||
}
|
||||
if (res)
|
||||
code = unicodeBuffer[0].toUpper().unicode();
|
||||
|
||||
|
@ -232,7 +232,7 @@ QVariant QWinRTTheme::styleHint(QPlatformIntegration::StyleHint hint)
|
||||
return false;
|
||||
case QPlatformIntegration::ShowIsMaximized:
|
||||
return false;
|
||||
case MousePressAndHoldInterval:
|
||||
case QPlatformIntegration::MousePressAndHoldInterval:
|
||||
return defaultThemeHint(MousePressAndHoldInterval);
|
||||
default:
|
||||
break;
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
bool makeCurrent(QPlatformSurface *surface) Q_DECL_OVERRIDE;
|
||||
void doneCurrent() Q_DECL_OVERRIDE;
|
||||
void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
|
||||
void (*getProcAddress(const QByteArray &procName)) () Q_DECL_OVERRIDE;
|
||||
QFunctionPointer getProcAddress(const QByteArray &procName) Q_DECL_OVERRIDE;
|
||||
|
||||
QSurfaceFormat format() const Q_DECL_OVERRIDE;
|
||||
bool isSharing() const Q_DECL_OVERRIDE;
|
||||
|
@ -789,6 +789,15 @@ void QXcbConnection::handleButtonRelease(xcb_generic_event_t *ev)
|
||||
qCDebug(lcQpaXInput, "xcb: released mouse button %d, button state %X", event->detail, static_cast<unsigned int>(m_buttons));
|
||||
}
|
||||
|
||||
void QXcbConnection::handleMotionNotify(xcb_generic_event_t *ev)
|
||||
{
|
||||
xcb_motion_notify_event_t *event = (xcb_motion_notify_event_t *)ev;
|
||||
|
||||
m_buttons = (m_buttons & ~0x7) | translateMouseButtons(event->state);
|
||||
if (Q_UNLIKELY(lcQpaXInput().isDebugEnabled()))
|
||||
qDebug("xcb: moved mouse to %4d, %4d; button state %X", event->event_x, event->event_y, static_cast<unsigned int>(m_buttons));
|
||||
}
|
||||
|
||||
#ifndef QT_NO_XKB
|
||||
namespace {
|
||||
typedef union {
|
||||
@ -839,11 +848,8 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
|
||||
handleButtonRelease(event);
|
||||
HANDLE_PLATFORM_WINDOW_EVENT(xcb_button_release_event_t, event, handleButtonReleaseEvent);
|
||||
case XCB_MOTION_NOTIFY:
|
||||
if (Q_UNLIKELY(lcQpaXInput().isDebugEnabled())) {
|
||||
xcb_motion_notify_event_t *mev = (xcb_motion_notify_event_t *)event;
|
||||
qDebug("xcb: moved mouse to %4d, %4d; button state %X", mev->event_x, mev->event_y, static_cast<unsigned int>(m_buttons));
|
||||
}
|
||||
m_keyboard->updateXKBStateFromCore(((xcb_motion_notify_event_t *)event)->state);
|
||||
handleMotionNotify(event);
|
||||
HANDLE_PLATFORM_WINDOW_EVENT(xcb_motion_notify_event_t, event, handleMotionNotifyEvent);
|
||||
case XCB_CONFIGURE_NOTIFY:
|
||||
HANDLE_PLATFORM_WINDOW_EVENT(xcb_configure_notify_event_t, event, handleConfigureNotifyEvent);
|
||||
|
@ -497,6 +497,7 @@ private:
|
||||
void updateScreens();
|
||||
void handleButtonPress(xcb_generic_event_t *event);
|
||||
void handleButtonRelease(xcb_generic_event_t *event);
|
||||
void handleMotionNotify(xcb_generic_event_t *event);
|
||||
|
||||
bool m_xi2Enabled;
|
||||
int m_xi2Minor;
|
||||
@ -507,6 +508,7 @@ private:
|
||||
XInput2TouchDeviceData *touchDeviceForId(int id);
|
||||
void xi2HandleEvent(xcb_ge_event_t *event);
|
||||
void xi2HandleHierachyEvent(void *event);
|
||||
void xi2HandleDeviceChangedEvent(void *event);
|
||||
int m_xiOpCode, m_xiEventBase, m_xiErrorBase;
|
||||
#ifndef QT_NO_TABLETEVENT
|
||||
struct TabletData {
|
||||
@ -540,6 +542,7 @@ private:
|
||||
Qt::Orientations legacyOrientations;
|
||||
QPointF lastScrollPosition;
|
||||
};
|
||||
void updateScrollingDevice(ScrollingDevice& scrollingDevice, int num_classes, void *classes);
|
||||
void xi2HandleScrollEvent(void *event, ScrollingDevice &scrollingDevice);
|
||||
QHash<int, ScrollingDevice> m_scrollingDevices;
|
||||
#endif // XCB_USE_XINPUT2
|
||||
|
@ -348,6 +348,7 @@ void QXcbConnection::xi2Select(xcb_window_t window)
|
||||
// Listen for hotplug events
|
||||
XIEventMask xiEventMask;
|
||||
bitMask = XI_HierarchyChangedMask;
|
||||
bitMask |= XI_DeviceChangedMask;
|
||||
xiEventMask.deviceid = XIAllDevices;
|
||||
xiEventMask.mask_len = sizeof(bitMask);
|
||||
xiEventMask.mask = xiBitMask;
|
||||
@ -468,6 +469,11 @@ void QXcbConnection::xi2HandleEvent(xcb_ge_event_t *event)
|
||||
xi2HandleHierachyEvent(xiEvent);
|
||||
return;
|
||||
}
|
||||
if (xiEvent->evtype == XI_DeviceChanged) {
|
||||
xi2HandleDeviceChangedEvent(xiEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef QT_NO_TABLETEVENT
|
||||
for (int i = 0; i < m_tabletData.count(); ++i) {
|
||||
if (m_tabletData.at(i).deviceId == xiEvent->deviceid) {
|
||||
@ -628,6 +634,64 @@ void QXcbConnection::xi2HandleHierachyEvent(void *event)
|
||||
}
|
||||
}
|
||||
|
||||
void QXcbConnection::xi2HandleDeviceChangedEvent(void *event)
|
||||
{
|
||||
xXIDeviceChangedEvent *xiEvent = reinterpret_cast<xXIDeviceChangedEvent *>(event);
|
||||
|
||||
// ### If a slave device changes (XIDeviceChange), we should probably run setup on it again.
|
||||
if (xiEvent->reason != XISlaveSwitch)
|
||||
return;
|
||||
|
||||
#ifdef XCB_USE_XINPUT21
|
||||
// This code handles broken scrolling device drivers that reset absolute positions
|
||||
// when they are made active. Whenever a new slave device is made active the
|
||||
// primary pointer sends a DeviceChanged event with XISlaveSwitch, and the new
|
||||
// active slave in sourceid.
|
||||
|
||||
QHash<int, ScrollingDevice>::iterator device = m_scrollingDevices.find(xiEvent->sourceid);
|
||||
if (device == m_scrollingDevices.end())
|
||||
return;
|
||||
|
||||
int nrDevices = 0;
|
||||
XIDeviceInfo* xiDeviceInfo = XIQueryDevice(static_cast<Display *>(m_xlib_display), xiEvent->sourceid, &nrDevices);
|
||||
if (nrDevices <= 0) {
|
||||
qCDebug(lcQpaXInputDevices, "scrolling device %d no longer present", xiEvent->sourceid);
|
||||
return;
|
||||
}
|
||||
updateScrollingDevice(*device, xiDeviceInfo->num_classes, xiDeviceInfo->classes);
|
||||
XIFreeDeviceInfo(xiDeviceInfo);
|
||||
#endif
|
||||
}
|
||||
|
||||
void QXcbConnection::updateScrollingDevice(ScrollingDevice &scrollingDevice, int num_classes, void *classInfo)
|
||||
{
|
||||
#ifdef XCB_USE_XINPUT21
|
||||
XIAnyClassInfo **classes = reinterpret_cast<XIAnyClassInfo**>(classInfo);
|
||||
QPointF lastScrollPosition;
|
||||
if (lcQpaXInput().isDebugEnabled())
|
||||
lastScrollPosition = scrollingDevice.lastScrollPosition;
|
||||
for (int c = 0; c < num_classes; ++c) {
|
||||
if (classes[c]->type == XIValuatorClass) {
|
||||
XIValuatorClassInfo *vci = reinterpret_cast<XIValuatorClassInfo *>(classes[c]);
|
||||
const int valuatorAtom = qatom(vci->label);
|
||||
if (valuatorAtom == QXcbAtom::RelHorizScroll || valuatorAtom == QXcbAtom::RelHorizWheel)
|
||||
scrollingDevice.lastScrollPosition.setX(vci->value);
|
||||
else if (valuatorAtom == QXcbAtom::RelVertScroll || valuatorAtom == QXcbAtom::RelVertWheel)
|
||||
scrollingDevice.lastScrollPosition.setY(vci->value);
|
||||
}
|
||||
}
|
||||
if (lcQpaXInput().isDebugEnabled() && lastScrollPosition != scrollingDevice.lastScrollPosition)
|
||||
qCDebug(lcQpaXInput, "scrolling device %d moved from (%f, %f) to (%f, %f)", scrollingDevice.deviceId,
|
||||
lastScrollPosition.x(), lastScrollPosition.y(),
|
||||
scrollingDevice.lastScrollPosition.x(),
|
||||
scrollingDevice.lastScrollPosition.y());
|
||||
#else
|
||||
Q_UNUSED(scrollingDevice);
|
||||
Q_UNUSED(num_classes);
|
||||
Q_UNUSED(classInfo);
|
||||
#endif
|
||||
}
|
||||
|
||||
void QXcbConnection::handleEnterEvent(const xcb_enter_notify_event_t *)
|
||||
{
|
||||
#ifdef XCB_USE_XINPUT21
|
||||
@ -638,19 +702,11 @@ void QXcbConnection::handleEnterEvent(const xcb_enter_notify_event_t *)
|
||||
int nrDevices = 0;
|
||||
XIDeviceInfo* xiDeviceInfo = XIQueryDevice(static_cast<Display *>(m_xlib_display), scrollingDevice.deviceId, &nrDevices);
|
||||
if (nrDevices <= 0) {
|
||||
qCDebug(lcQpaXInputDevices, "scrolling device %d no longer present", scrollingDevice.deviceId);
|
||||
it = m_scrollingDevices.erase(it);
|
||||
continue;
|
||||
}
|
||||
for (int c = 0; c < xiDeviceInfo->num_classes; ++c) {
|
||||
if (xiDeviceInfo->classes[c]->type == XIValuatorClass) {
|
||||
XIValuatorClassInfo *vci = reinterpret_cast<XIValuatorClassInfo *>(xiDeviceInfo->classes[c]);
|
||||
const int valuatorAtom = qatom(vci->label);
|
||||
if (valuatorAtom == QXcbAtom::RelHorizScroll || valuatorAtom == QXcbAtom::RelHorizWheel)
|
||||
scrollingDevice.lastScrollPosition.setX(vci->value);
|
||||
else if (valuatorAtom == QXcbAtom::RelVertScroll || valuatorAtom == QXcbAtom::RelVertWheel)
|
||||
scrollingDevice.lastScrollPosition.setY(vci->value);
|
||||
}
|
||||
}
|
||||
updateScrollingDevice(scrollingDevice, xiDeviceInfo->num_classes, xiDeviceInfo->classes);
|
||||
XIFreeDeviceInfo(xiDeviceInfo);
|
||||
++it;
|
||||
}
|
||||
|
@ -207,6 +207,18 @@ static inline QImage::Format imageFormatForVisual(int depth, quint32 red_mask, q
|
||||
break;
|
||||
}
|
||||
qWarning("Unsupported screen format: depth: %d, red_mask: %x, blue_mask: %x", depth, red_mask, blue_mask);
|
||||
|
||||
switch (depth) {
|
||||
case 24:
|
||||
qWarning("Using RGB32 fallback, if this works your X11 server is reporting a bad screen format.");
|
||||
return QImage::Format_RGB32;
|
||||
case 16:
|
||||
qWarning("Using RGB16 fallback, if this works your X11 server is reporting a bad screen format.");
|
||||
return QImage::Format_RGB16;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return QImage::Format_Invalid;
|
||||
}
|
||||
|
||||
|
@ -76,8 +76,11 @@ QT_USE_NAMESPACE
|
||||
PMPageFormat format = static_cast<PMPageFormat>([printInfo PMPageFormat]);
|
||||
PMRect paperRect;
|
||||
PMGetUnadjustedPaperRect(format, &paperRect);
|
||||
PMOrientation orientation;
|
||||
PMGetOrientation(format, &orientation);
|
||||
QSizeF paperSize = QSizeF(paperRect.right - paperRect.left, paperRect.bottom - paperRect.top);
|
||||
printer->printEngine()->setProperty(QPrintEngine::PPK_CustomPaperSize, paperSize);
|
||||
printer->printEngine()->setProperty(QPrintEngine::PPK_Orientation, orientation == kPMLandscape ? QPrinter::Landscape : QPrinter::Portrait);
|
||||
}
|
||||
|
||||
dialog->done((returnCode == NSOKButton) ? QDialog::Accepted : QDialog::Rejected);
|
||||
|
@ -60,34 +60,34 @@ END
|
||||
|
||||
|
||||
//! [3]
|
||||
cd $QTDIR/src/plugins/sqldrivers/mysql
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/mysql
|
||||
qmake "INCLUDEPATH+=/usr/local/include" "LIBS+=-L/usr/local/lib -lmysqlclient_r" mysql.pro
|
||||
make
|
||||
//! [3]
|
||||
|
||||
|
||||
//! [4]
|
||||
cd $QTDIR/src/plugins/sqldrivers/mysql
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/mysql
|
||||
make install
|
||||
//! [4]
|
||||
|
||||
|
||||
//! [5]
|
||||
cd %QTDIR%\src\plugins\sqldrivers\mysql
|
||||
cd %QTDIR%\qtbase\src\plugins\sqldrivers\mysql
|
||||
qmake "INCLUDEPATH+=C:/MySQL/include" "LIBS+=C:/MYSQL/MySQL Server <version>/lib/opt/libmysql.lib" mysql.pro
|
||||
nmake
|
||||
//! [5]
|
||||
|
||||
|
||||
//! [6]
|
||||
cd $QTDIR/src/plugins/sqldrivers/oci
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/oci
|
||||
qmake "INCLUDEPATH+=$ORACLE_HOME/rdbms/public $ORACLE_HOME/rdbms/demo" "LIBS+=-L$ORACLE_HOME/lib -lclntsh -lwtc9" oci.pro
|
||||
make
|
||||
//! [6]
|
||||
|
||||
|
||||
//! [7]
|
||||
cd $QTDIR/src/plugins/sqldrivers/oci
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/oci
|
||||
qmake "INCLUDEPATH+=/usr/include/oracle/10.1.0.3/client/" "LIBS+=-L/usr/lib/oracle/10.1.0.3/client/lib -lclntsh" oci.pro
|
||||
make
|
||||
//! [7]
|
||||
@ -96,7 +96,7 @@ make
|
||||
//! [8]
|
||||
set INCLUDE=%INCLUDE%;c:\oracle\oci\include
|
||||
set LIB=%LIB%;c:\oracle\oci\lib\msvc
|
||||
cd %QTDIR%\src\plugins\sqldrivers\oci
|
||||
cd %QTDIR%\qtbase\src\plugins\sqldrivers\oci
|
||||
qmake oci.pro
|
||||
nmake
|
||||
//! [8]
|
||||
@ -108,116 +108,116 @@ set PATH=%PATH%;c:\oracle\bin
|
||||
|
||||
|
||||
//! [11]
|
||||
cd $QTDIR/src/plugins/sqldrivers/odbc
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/odbc
|
||||
qmake "INCLUDEPATH+=/usr/local/unixODBC/include" "LIBS+=-L/usr/local/unixODBC/lib -lodbc"
|
||||
make
|
||||
//! [11]
|
||||
|
||||
|
||||
//! [12]
|
||||
cd %QTDIR%\src\plugins\sqldrivers\odbc
|
||||
cd %QTDIR%\qtbase\src\plugins\sqldrivers\odbc
|
||||
qmake odbc.pro
|
||||
nmake
|
||||
//! [12]
|
||||
|
||||
|
||||
//! [13]
|
||||
cd $QTDIR/src/plugins/sqldrivers/psql
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/psql
|
||||
qmake "INCLUDEPATH+=/usr/include/pgsql" "LIBS+=-L/usr/lib -lpq" psql.pro
|
||||
make
|
||||
//! [13]
|
||||
|
||||
|
||||
//! [14]
|
||||
cd $QTDIR/src/plugins/sqldrivers/psql
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/psql
|
||||
make install
|
||||
//! [14]
|
||||
|
||||
|
||||
//! [15]
|
||||
cd %QTDIR%\src\plugins\sqldrivers\psql
|
||||
cd %QTDIR%\qtbase\src\plugins\sqldrivers\psql
|
||||
qmake "INCLUDEPATH+=C:/psql/include" "LIBS+=C:/psql/lib/ms/libpq.lib" psql.pro
|
||||
nmake
|
||||
//! [15]
|
||||
|
||||
|
||||
//! [16]
|
||||
cd $QTDIR/src/plugins/sqldrivers/tds
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/tds
|
||||
qmake "INCLUDEPATH=$SYBASE/include" "LIBS=-L$SYBASE/lib -lsybdb"
|
||||
make
|
||||
//! [16]
|
||||
|
||||
|
||||
//! [17]
|
||||
cd %QTDIR%\src\plugins\sqldrivers\tds
|
||||
cd %QTDIR%\qtbase\src\plugins\sqldrivers\tds
|
||||
qmake "LIBS+=NTWDBLIB.LIB" tds.pro
|
||||
nmake
|
||||
//! [17]
|
||||
|
||||
|
||||
//! [18]
|
||||
cd $QTDIR/src/plugins/sqldrivers/db2
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/db2
|
||||
qmake "INCLUDEPATH+=$DB2DIR/include" "LIBS+=-L$DB2DIR/lib -ldb2"
|
||||
make
|
||||
//! [18]
|
||||
|
||||
|
||||
//! [19]
|
||||
cd $QTDIR/src/plugins/sqldrivers/db2
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/db2
|
||||
make install
|
||||
//! [19]
|
||||
|
||||
|
||||
//! [20]
|
||||
cd %QTDIR%\src\plugins\sqldrivers\db2
|
||||
cd %QTDIR%\qtbase\src\plugins\sqldrivers\db2
|
||||
qmake "INCLUDEPATH+=<DB2 home>/sqllib/include" "LIBS+=<DB2 home>/sqllib/lib/db2cli.lib"
|
||||
nmake
|
||||
//! [20]
|
||||
|
||||
|
||||
//! [21]
|
||||
cd $QTDIR/src/plugins/sqldrivers/sqlite
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/sqlite
|
||||
qmake "INCLUDEPATH+=$SQLITE/include" "LIBS+=-L$SQLITE/lib -lsqlite"
|
||||
make
|
||||
//! [21]
|
||||
|
||||
|
||||
//! [22]
|
||||
cd $QTDIR/src/plugins/sqldrivers/sqlite
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/sqlite
|
||||
make install
|
||||
//! [22]
|
||||
|
||||
|
||||
//! [23]
|
||||
cd %QTDIR%\src\plugins\sqldrivers\sqlite
|
||||
cd %QTDIR%\qtbase\src\plugins\sqldrivers\sqlite
|
||||
qmake "INCLUDEPATH+=C:/SQLITE/INCLUDE" "LIBS+=C:/SQLITE/LIB/SQLITE3.LIB" sqlite.pro
|
||||
nmake
|
||||
//! [23]
|
||||
|
||||
|
||||
//! [27]
|
||||
cd $QTDIR/src/plugins/sqldrivers/ibase
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/ibase
|
||||
qmake "INCLUDEPATH+=/opt/interbase/include" "LIBS+=-L/opt/interbase/lib" ibase.pro
|
||||
make
|
||||
//! [27]
|
||||
|
||||
|
||||
//! [28]
|
||||
cd $QTDIR/src/plugins/sqldrivers/ibase
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/ibase
|
||||
qmake "INCLUDEPATH+=/opt/interbase/include" "LIBS+=-L/opt/interbase/lib -lfbclient" ibase.pro
|
||||
make
|
||||
//! [28]
|
||||
|
||||
|
||||
//! [29]
|
||||
cd %QTDIR%\src\plugins\sqldrivers\ibase
|
||||
cd %QTDIR%\qtbase\src\plugins\sqldrivers\ibase
|
||||
qmake "INCLUDEPATH+=C:/interbase/include" ibase.pro
|
||||
nmake
|
||||
//! [29]
|
||||
|
||||
|
||||
//! [30]
|
||||
cd %QTDIR%\src\plugins\sqldrivers\ibase
|
||||
cd %QTDIR%\qtbase\src\plugins\sqldrivers\ibase
|
||||
qmake "INCLUDEPATH+=C:/interbase/include" "LIBS+=-lfbclient" ibase.pro
|
||||
nmake
|
||||
//! [30]
|
||||
@ -229,7 +229,7 @@ make
|
||||
//! [32]
|
||||
|
||||
//! [33]
|
||||
cd $QTDIR/src/plugins/sqldrivers/oci
|
||||
cd $QTDIR/qtbase/src/plugins/sqldrivers/oci
|
||||
qmake "INCLUDEPATH+=/usr/include/oracle/10.1.0.3/client" "LIBS+=-L/usr/lib/oracle/10.1.0.3/client/lib -Wl,-rpath,/usr/lib/oracle/10.1.0.3/client/lib -lclntsh -lnnz10" oci.pro
|
||||
make
|
||||
//! [33]
|
||||
|
@ -471,7 +471,7 @@
|
||||
|
||||
By default the Microsoft library is used on Windows, if you want to
|
||||
force the use of the Sybase Open Client, you must define \c
|
||||
Q_USE_SYBASE in \c{%QTDIR%\src\sql\drivers\tds\qsql_tds.cpp}. If you
|
||||
Q_USE_SYBASE in \c{%QTDIR%\qtbase\src\sql\drivers\tds\qsql_tds.cpp}. If you
|
||||
are not using a Microsoft compiler, replace \c nmake with \c make in
|
||||
the line above.
|
||||
|
||||
@ -751,7 +751,7 @@
|
||||
must use the Q_PLUGIN_METADATA() macro. Read \l{How to Create Qt
|
||||
Plugins} for more information on this. You can also check out how
|
||||
this is done in the SQL plugins that are provided with Qt in
|
||||
\c{QTDIR/src/plugins/sqldrivers} and \c{QTDIR/src/sql/drivers}.
|
||||
\c{QTDIR/qtbase/src/plugins/sqldrivers} and \c{QTDIR/qtbase/src/sql/drivers}.
|
||||
|
||||
The following code can be used as a skeleton for a SQL driver:
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user