Merge remote-tracking branch 'origin/5.14' into 5.15

Conflicts:
	src/network/ssl/qsslsocket.cpp
	src/widgets/kernel/qapplication.cpp

Change-Id: Ib7421cc2df59d0969f89b3fbd65a17ea76ffef3b
This commit is contained in:
Liang Qi 2019-12-16 07:05:19 +01:00
commit ee71a9ba81
38 changed files with 2458 additions and 1190 deletions

1285
LICENSE.QT-LICENSE-AGREEMENT Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,913 +0,0 @@
QT LICENSE AGREEMENT
Agreement version 4.0
This License Agreement ("Agreement") is a legal agreement between The Qt
Company (as defined below) and the Licensee (as defined below) for the license
of Licensed Software (as defined below). Capitalized terms used herein are
defined in Section 1.
WHEREAS:
(A). Licensee wishes to use the Licensed Software for the purpose of developing
and distributing Applications and/or Devices; and
(B). The Qt Company is willing to grant the Licensee a right to use Licensed
Software for such purpose pursuant to term and conditions of this Agreement.
NOW, THEREFORE, THE PARTIES HEREBY AGREE AS FOLLOWS:
1. DEFINITIONS
"Affiliate" of a Party shall mean an entity (i) which is directly or indirectly
controlling such Party; (ii) which is under the same direct or indirect
ownership or control as such Party; or (iii) which is directly or indirectly
owned or controlled by such Party. For these purposes, an entity shall be
treated as being controlled by another if that other entity has fifty percent
(50 %) or more of the votes in such entity, is able to direct its affairs
and/or to control the composition of its board of directors or equivalent body.
"Applications" shall mean Licensee's software products created using the
Licensed Software, which may include the Redistributables, or part
thereof.
"Contractor(s)" shall mean third party consultants, distributors and
contractors performing services to a Party under applicable contractual
arrangement.
"Customer(s)" shall mean Licensee's end users to whom Licensee, directly or
indirectly, distributes copies of the Redistributables.
"Deployment Platforms" shall mean operating systems specified in the License
Certificate, in which the Redistributables can be distributed pursuant to the
terms and conditions of this Agreement.
"Designated User(s)" shall mean the employee(s) of Licensee or Licensee's
Affiliates acting within the scope of their employment or Licensee's
Contractors acting within the scope of their services for Licensee and on
behalf of Licensee. Designated Users shall be named in the License Certificate.
"Development License" shall mean the license needed by the Licensee for each
Designated User to use the Licensed Software under the license grant described
in Section 3.1 of this Agreement.
"Development Platforms" shall mean those operating systems specified in the
License Certificate, in which the Licensed Software can be used under the
Development License, but not distributed in any form or used for any other
purpose.
"Devices" shall mean hardware devices or products that 1) are manufactured
and/or distributed by the Licensee or its Affiliates or Contractors, and
(2)(i) incorporate or integrate the Redistributables or parts thereof; or (ii)
do not incorporate or integrate the Redistributables at the time of
distribution, but where, when used by a Customer, the main user interface or
substantial functionality of such device is provided by Application(s) or
otherwise depends on the Licensed Software.
"Distribution License(s)" shall mean the license required for distribution of
Redistributables in connection with Devices pursuant to license grant described
in Section 3.3 of this Agreement.
"Distribution License Packs" shall mean set of prepaid Distribution Licenses
for distribution of Redistributables, as defined in The Qt Company's standard
price list, quote, Purchase Order confirmation or in an appendix hereto,
as the case may be.
"Intellectual Property Rights" shall mean patents (including utility models),
design patents, and designs (whether or not capable of registration), chip
topography rights and other like protection, copyrights, trademarks, service
marks, trade names, logos or other words or symbols and any other form of
statutory protection of any kind and applications for any of the foregoing as
well as any trade secrets.
"License Certificate" shall mean a certificate generated by The Qt Company for
each Designated User respectively upon them downloading the licensed Software.
License Certificate will be available under respective Designated User's Qt
Account at account.qt.io and it will specify the Designated User, the
Development Platforms, Deployment Platforms and the License Term. The terms of
the License Certificate are considered part of this Agreement and shall be
updated from time to time to reflect any agreed changes to the foregoing terms
relating to Designated User's rights to the Licensed Software.
"License Fee" shall mean the fee charged to the Licensee for rights granted
under the terms of this Agreement.
"License Term" shall mean the agreed validity period of the Development
License of the respective Designated User, during which time the
Designated User is entitled to use the Licensed Software, as set forth in the
respective License Certificate.
"Licensed Software" shall mean all versions of the
(i) Qt Toolkit (including Qt Essentials, Qt Add-Ons and Value-Add modules) as
described in http://doc.qt.io/qt-5/qtmodules.html,
(ii) Qt Creator (including Creator IDE tool) as described in
http://doc.qt.io/qtcreator/index.html,
(iii) Qt 3D Studio as described in http://doc.qt.io/qt3dstudio/index.html, and
as well as corresponding online or electronic documentation, associated media
and printed materials, including the source code, example programs and the
documentation, licensed to the Licensee under this Agreement. Licensed Software
does not include Third Party Software (as defined in Section 4), Open Source
Qt, or other software products of The Qt Company (for example Qt Safe Renderer
and Qt for Automation), unless such other software products of The Qt Company
are separately agreed in writing to be included in scope of the Licensed
Software.
"Licensee" shall mean the individual or legal entity that is party to this
Agreement, as identified on the signature page hereof.
"Licensee's Records" shall mean books and records that are likely to contain
information bearing on Licensee's compliance with this Agreement or the
payments due to The Qt Company under this Agreement, including, but not limited
to: assembly logs, sales records and distribution records.
"Modified Software" shall have the meaning as set forth in Section 2.3.
"Online Services" shall mean any services or access to systems made available
by The Qt Company to the Licensee over the Internet relating to the Licensed
Software or for the purpose of use by the Licensee of the Licensed Software or
Support. Use of any such Online Services is discretionary for the Licensee and
some of them may be subject to additional fees.
"Open Source Qt" shall mean the non-commercial Qt computer software products,
licensed under the terms of the GNU Lesser General Public License, version
2.1 or later ("LGPL") or the GNU General Public License, version 2.0 or later
("GPL"). For clarity, Open Source Qt shall not be provided nor governed under
this Agreement.
"Party" or "Parties" shall mean Licensee and/or The Qt Company.
"Redistributables" shall mean the portions of the Licensed Software set forth
in Appendix 1, Section 1 that may be distributed pursuant to the terms of this
Agreement in object code form only, including any relevant documentation.
Where relevant, any reference to Licensed Software in this Agreement shall
include and refer also to Redistributables.
"Renewal Term" shall mean an extension of previous License Term as agreed
between the Parties.
"Submitted Modified Software" shall have the meaning as set forth in
Section 2.3.
"Support" shall mean standard developer support that is provided by The Qt
Company to assist Designated Users in using the Licensed Software in
accordance with The Qt Company's standard support terms and as further
defined in Section 8 hereunder.
"Taxes" shall have the meaning set forth in Section 10.5.
"Term" shall have the meaning set forth in Section 12.
"The Qt Company" shall mean:
(i) in the event Licensee is an individual residing in the United States or a
legal entity incorporated in the United States or having its headquarters in
the United States, The Qt Company Inc., a Delaware corporation with its office
at 2350 Mission College Blvd., Suite 1020, Santa Clara, CA 95054, USA.; or
(ii) in the event the Licensee is an individual residing outside of the United
States or a legal entity incorporated outside of the United States or having
its registered office outside of the United States, The Qt Company Ltd., a
Finnish company with its registered office at Bertel Jungin aukio D3A, 02600
Espoo, Finland.
"Third Party Software " shall have the meaning set forth in Section 4.
"Updates" shall mean a release or version of the Licensed Software containing
bug fixes, error corrections and other changes that are generally made
available to users of the Licensed Software that have contracted for Support.
Updates are generally depicted as a change to the digits following the decimal
in the Licensed Software version number. The Qt Company shall make Updates
available to the Licensee under the Support. Updates shall be considered as
part of the Licensed Software hereunder.
"Upgrades" shall mean a release or version of the Licensed Software containing
enhancements and new features and are generally depicted as a change to the
first digit of the Licensed Software version number. In the event Upgrades are
provided to the Licensee under this Agreement, they shall be considered as
part of the Licensed Software hereunder.
2. OWNERSHIP
2.1 Ownership of The Qt Company
The Licensed Software is protected by copyright laws and international
copyright treaties, as well as other intellectual property laws and treaties.
The Licensed Software is licensed, not sold.
All The Qt Company's Intellectual Property Rights are and shall remain the
exclusive property of The Qt Company or its licensors respectively.
2.2 Ownership of Licensee
All the Licensee's Intellectual Property Rights are and shall remain the
exclusive property of the Licensee or its licensors respectively.
All Intellectual Property Rights to the Modified Software, Applications and
Devices shall remain with the Licensee and no rights thereto shall be granted
by the Licensee to The Qt Company under this Agreement (except as set forth in
Section 2.3 below).
2.3 Modified Software
Licensee may create bug-fixes, error corrections, patches or modifications to
the Licensed Software ("Modified Software"). Such Modified Software may break
the source or binary compatibility with the Licensed Software (including
without limitation through changing the application programming interfaces
("API") or by adding, changing or deleting any variable, method, or class
signature in the Licensed Software and/or any inter-process protocols, services
or standards in the Licensed Software libraries). To the extent that Licensee's
Modified Software so breaks source or binary compatibility with the Licensed
Software, Licensee acknowledges that The Qt Company's ability to provide
Support may be prevented or limited and Licensee's ability to make use of
Updates may be restricted.
Licensee may, at its sole and absolute discretion, choose to submit Modified
Software to The Qt Company ("Submitted Modified Software") in connection with
Licensee's Support request, service request or otherwise. In the event Licensee
does so, then, Licensee hereby grants The Qt Company a sublicensable,
assignable, irrevocable, perpetual, worldwide, non-exclusive, royalty-free and
fully paid-up license, under all of Licensee's Intellectual Property Rights, to
reproduce, adapt, translate, modify, and prepare derivative works of, publicly
display, publicly perform, sublicense, make available and distribute such
Submitted Modified Software as The Qt Company sees fit at its free and absolute
discretion.
3. LICENSES GRANTED
3.1 Development with Licensed Software
Subject to the terms of this Agreement, The Qt Company grants to Licensee a
personal, worldwide, non-exclusive, non-transferable license, valid for the
License Term, to use, modify and copy the Licensed Software by Designated Users
on the Development Platforms for the sole purposes of designing, developing,
demonstrating and testing Application(s) and/or Devices, and to provide thereto
related support and other related services to end-user Customers.
Licensee may install copies of the Licensed Software on an unlimited number of
computers provided that (i) only the Designated Users may use the Licensed
Software, and (ii) all Designated Users must have a valid Development License
to use Licensed Software.
Licensee may at any time designate another Designated User to replace a then-
current Designated User by notifying The Qt Company in writing, provided that
any Designated User may be replaced only once during any six-month period.
Upon expiry of the initially agreed License Term, the respective License Terms
shall be automatically extended to one or more Renewal Term(s), unless and
until either Party notifies the other Party in writing that it does not wish to
continue the License Term, such notification to be provided to the other Party
no less than ninety (90) days before expiry of the respective License Term.
Unless otherwise agreed between the Parties, Renewal Term shall be of equal
length with the initial Term.
Any such Renewal Term shall be subject to License Fees agreed between the
Parties or, if no advance agreement exists, subject to The Qt Company's
standard pricing applicable at the commencement date of any such Renewal Term.
3.2 Distribution of Applications
Subject to the terms of this Agreement, The Qt Company grants to Licensee a
personal, worldwide, non-exclusive, non-transferable, revocable (for cause
pursuant to this Agreement) right and license, valid for the Term, to
(i) distribute, by itself or through its Contractors, Redistributables as
installed, incorporated or integrated into Applications for execution on the
Deployment Platforms, and
(ii) grant sublicenses to Redistributables, as distributed hereunder, for
Customers solely for Customer's internal use and to the extent necessary in
order for the Customers to use the Applications for their respective intended
purposes.
Right to distribute the Redistributables as part of an Application as provided
herein is not royalty-bearing but is conditional upon the Licensee having paid
the agreed Development Licenses from The Qt Company before distributing any
Redistributables to Customers.
3.3 Distribution of Devices
Subject to the terms of this Agreement, The Qt Company grants to Licensee a
personal, worldwide, non-exclusive, non-transferable, revocable (for cause
pursuant to this Agreement) right and license, valid for the Term, to
(i) distribute, by itself or through one or more tiers of Contractors,
Redistributables as installed, incorporated or integrated, or intended to be
installed, incorporated or integrated into Devices for execution on the
Deployment Platforms, and
(ii) grant sublicenses to Redistributables, as distributed hereunder, for
Customers solely for Customer's internal use and to the extent necessary in
order for the Customers to use the Devices for their respective intended
purposes.
Right to distribute the Redistributables with Devices as provided herein is
conditional upon the Licensee having purchased and paid the appropriate amount
of Development and Distribution Licenses from The Qt Company before
distributing any Redistributables to Customers.
3.4 Further Requirements
The licenses granted above in this Section 3 by The Qt Company to Licensee are
conditional and subject to Licensee's compliance with the following terms:
(i) Licensee shall not remove or alter any copyright, trademark or other
proprietary rights notice contained in any portion of the Licensed Software;
(ii) Applications must add primary and substantial functionality to the
Licensed Software;
(iii) Applications may not pass on functionality which in any way makes it
possible for others to create software with the Licensed Software; provided
however that Licensee may use the Licensed Software's scripting and QML ("Qt
Quick") functionality solely in order to enable scripting, themes and styles
that augment the functionality and appearance of the Application(s) without
adding primary and substantial functionality to the Application(s);
(iv) Applications must not compete with the Licensed Software;
(v) Licensee shall not use The Qt Company's or any of its suppliers' names,
logos, or trademarks to market Applications, except that Licensee may use
"Built with Qt" logo to indicate that Application(s) was developed using the
Licensed Software;
(vi) Licensee shall not distribute, sublicense or disclose source code of
Licensed Software to any third party (provided however that Licensee may
appoint employee(s) of Contractors as Designated Users to use Licensed
Software pursuant to this Agreement). Such right may be available for the
Licensee subject to a separate software development kit ("SDK") license
agreement to be concluded with The Qt Company;
(vii) Licensee shall not grant the Customers a right to (i) make copies of the
Redistributables except when and to the extent required to use the Applications
and/or Devices for their intended purpose, (ii) modify the Redistributables or
create derivative works thereof, (iii) decompile, disassemble or otherwise
reverse engineer Redistributables, or (iv) redistribute any copy or portion of
the Redistributables to any third party, except as part of the onward sale of
the Device on which the Redistributables are installed;
(viii) Licensee shall not and shall cause that its Affiliates or Contractors
shall not a) in any way combine, incorporate or integrate Licensed Software
with, or use Licensed Software for creation of, any software created with or
incorporating Open Source Qt, or b) incorporate or integrate Applications
into a hardware device or product other than a Device, unless Licensee has
received an advance written permission from The Qt Company to do so. Absent
such written permission, any and all distribution by the Licensee during the
Term of a hardware device or product a) which incorporate or integrate any
part of Licensed Software or Open Source Qt; or b) where the main user
interface or substantial functionality is provided by software build with
Licensed Software or Open Source Qt or otherwise depends on the Licensed
Software or Open Source Qt, shall be considered as a Device distribution under
this Agreement and dependent on compliance thereof (including but not limited
to obligation to pay applicable License Fees for such distribution);
(ix) Licensee shall cause all of its Affiliates and Contractors entitled to
make use of the licenses granted under this Agreement, to be contractually
bound to comply with the relevant terms of this Agreement and not to use the
Licensed Software beyond the terms hereof and for any purposes other than
operating within the scope of their services for Licensee. Licensee shall be
responsible for any and all actions and omissions of its Affiliates and
Contractors relating to the Licensed Software and use thereof (including but
not limited to payment of all applicable License Fees);
(x) Except when and to the extent explicitly provided in this Section 3,
Licensee shall not transfer, publish, disclose, display or otherwise make
available the Licensed Software;
; and
(xi) Licensee shall not attempt or enlist a third party to conduct or attempt
to conduct any of the above.
Above terms shall not be applicable if and to the extent they conflict with any
mandatory provisions of any applicable laws.
Any use of Licensed Software beyond the provisions of this Agreement is
strictly prohibited and requires an additional license from The Qt Company.
4. THIRD PARTY SOFTWARE
The Licensed Software may provide links to third party libraries or code
(collectively "Third Party Software") to implement various functions. Third
Party Software does not comprise part of the Licensed Software. In some cases,
access to Third Party Software may be included in the Licensed Software. Such
Third Party Software will be listed in the ".../src/3rdparty" source tree
delivered with the Licensed Software or documented in the Licensed Software, as
such may be amended from time to time. Licensee acknowledges that use or
distribution of Third Party Software is in all respects subject to applicable
license terms of applicable third party right holders.
5. PRE-RELEASE CODE
The Licensed Software may contain pre-release code and functionality marked or
otherwise stated as "Technology Preview", "Alpha", "Beta" or similar
designation. Such pre-release code may be present in order to provide
experimental support for new platforms or preliminary versions of one or more
new functionalities. The pre-release code may not be at the level of
performance and compatibility of a final, generally available, product
offering of the Licensed Software. The pre-release parts of the Licensed
Software may not operate correctly, may contain errors and may be substantially
modified by The Qt Company prior to the first commercial product release, if
any. The Qt Company is under no obligation to make pre-release code
commercially available, or provide any Support or Updates relating thereto. The
Qt Company assumes no liability whatsoever regarding any pre-release code, but
any use thereof is exclusively at Licensee's own risk and expense.
6. LIMITED WARRANTY AND WARRANTY DISCLAIMER
The Qt Company hereby represents and warrants that it has the power and
authority to grant the rights and licenses granted to Licensee under this
Agreement.
Except as set forth above, the Licensed Software is licensed to Licensee
"as is" and Licensee's exclusive remedy and The Qt Company's entire liability
for errors in the Licensed Software shall be limited, at The Qt Company's
option, to correction of the error, replacement of the Licensed Software or
return of the applicable fees paid for the defective Licensed Software for the
time period during which the License is not able to utilize the Licensed
Software under the terms of this Agreement.
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE QT COMPANY ON BEHALF OF
ITSELF AND ITS LICENSORS, SUPPLIERS AND AFFILIATES, DISCLAIMS ALL OTHER
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-
INFRINGEMENT WITH REGARD TO THE LICENSED SOFTWARE. THE QT COMPANY DOES NOT
WARRANT THAT THE LICENSED SOFTWARE WILL SATISFY LICENSEE'S REQUIREMENTS OR THAT
IT WILL OPERATE WITHOUT DEFECT OR ERROR OR THAT THE OPERATION THEREOF WILL BE
UNINTERRUPTED. ALL USE OF AND RELIANCE ON THE LICENSED SOFTWARE IS AT THE SOLE
RISK OF AND RESPONSIBILITY OF LICENSEE.
7. INDEMNIFICATION AND LIMITATION OF LIABILITY
7.1 Limitation of Liability
EXCEPT FOR (I) CASES OF GROSS NEGLIGENCE OR INTENTIONAL MISCONDUCT, AND (II)
BREACH OF CONFIDENTIALITY, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, IN NO
EVENT SHALL EITHER PARTY BE LIABLE TO THE OTHER PARTY FOR ANY LOSS OF PROFIT,
LOSS OF DATA, LOSS OF BUSINESS OR GOODWILL OR ANY OTHER INDIRECT, SPECIAL,
CONSEQUENTIAL, INCIDENTAL OR PUNITIVE COST, DAMAGES OR EXPENSE OF ANY KIND,
HOWSOEVER ARISING UNDER OR IN CONNECTION WITH THIS AGREEMENT. PARTIES
SPECIFICALLY AGREE THAT LICENSEE'S OBLIGATION TO PAY LICENSE AND OTHER FEES
CORRESPONDING TO ACTUAL USAGE OF LICENSED SOFTWARE HEREUNDER SHALL BE
CONSIDERED AS A DIRECT DAMAGE.
EXCEPT FOR (I) CASES OF GROSS NEGLIGENCE OR INTENTIONAL MISCONDUCT, AND (II)
BREACH OF CONFIDENTIALITY, AND TO THE EXTENT PERMITTED BY APPLICABLE LAW, IN
NO EVENT SHALL EITHER PARTY'S TOTAL AGGREGATE LIABILITY UNDER THIS AGREEMENT
EXCEED THE AGGREGATE LICENSE FEES PAID OR PAYABLE TO THE QT COMPANY FROM
LICENSEE DURING THE PERIOD OF TWELVE (12) MONTHS IMMEDIATELY PRECEDING THE
EVENT RESULTING IN SUCH LIABILITY.
THE PROVISIONS OF THIS SECTION 7 ALLOCATE THE RISKS UNDER THIS AGREEMENT
BETWEEN THE QT COMPANY AND LICENSEE AND THE PARTIES HAVE RELIED UPON THE
LIMITATIONS SET FORTH HEREIN IN DETERMINING WHETHER TO ENTER INTO THIS AGREEMENT.
7.2 Licensee's Indemnification
Licensee shall indemnify and hold harmless The Qt Company from and against any
claim, injury, judgment, settlement, loss or expense, including attorneys' fees
related to: (a) Licensee's misrepresentation in connection with The Qt Company
or the Licensed Software or breach of this Agreement, (b) the Application or
Device (except where such cause of liability is solely attributable to the
Licensed Software).
8. SUPPORT, UPDATES AND ONLINE SERVICES
Upon due payment of the agreed License Fees the Licensee will be eligible to
receive Support and Updates and to use the Online Services during the License
Term, provided, however, that in the event the License Term is longer than 36
months, Support is provided only for the first 12 months, unless the Parties
specifically otherwise agree.
Unless otherwise decided by The Company at its free and absolute discretion,
Upgrades will not be included in the Support but may be available subject to
additional fees.
From time to time The Qt Company may change the Support terms, provided that
during the respective ongoing License Term the level of Support provided by The
Qt Company may not be reduced without the consent of the Licensee.
Unless otherwise agreed, The Qt Company shall not be responsible for providing
any service or support to Customers.
9. CONFIDENTIALITY
Each Party acknowledges that during the Term of this Agreement each Party may
receive information about the other Party's business, business methods,
business plans, customers, business relations, technology, and other
information, including the terms of this Agreement, that is confidential and
of great value to the other Party, and the value of which would be
significantly reduced if disclosed to third parties ("Confidential
Information"). Accordingly, when a Party (the "Receiving Party") receives
Confidential Information from the other Party (the "Disclosing Party"), the
Receiving Party shall only disclose such information to employees and
Contractors on a need to know basis, and shall cause its employees and
employees of its Affiliates to: (i) maintain any and all Confidential
Information in confidence; (ii) not disclose the Confidential Information to a
third party without the Disclosing Party's prior written approval; and (iii)
not, directly or indirectly, use the Confidential Information for any purpose
other than for exercising its rights and fulfilling its responsibilities
pursuant to this Agreement. Each Party shall take reasonable measures to
protect the Confidential Information of the other Party, which measures shall
not be less than the measures taken by such Party to protect its own
confidential and proprietary information.
Obligation of confidentiality shall not apply to information that (i) is or
becomes generally known to the public through no act or omission of the
Receiving Party; (ii) was in the Receiving Party's lawful possession prior to
the disclosure hereunder and was not subject to limitations on disclosure or
use; (iii) is developed independently by employees or Contractors of the
Receiving Party or other persons working for the Receiving Party who have not
had access to the Confidential Information of the Disclosing Party, as proven
by the written records of the Receiving Party; (iv) is lawfully disclosed to
the Receiving Party without restrictions, by a third party not under an
obligation of confidentiality; or (v) the Receiving Party is legally compelled
to disclose, in which case the Receiving Party shall notify the Disclosing
Party of such compelled disclosure and assert the privileged and confidential
nature of the information and cooperate fully with the Disclosing Party to
limit the scope of disclosure and the dissemination of disclosed Confidential
Information to the minimum extent necessary.
The obligations under this Section 9 shall continue to remain in force for a
period of five (5) years after the last disclosure, and, with respect to trade
secrets, for so long as such trade secrets are protected under applicable trade
secret laws.
10. FEES, DELIVERY AND PAYMENT
10.1 License Fees
License Fees are described in The Qt Company's standard price list, quote or
Purchase Order confirmation or in an appendix hereto, as the case may be.
The License Fees shall not be refunded or claimed as a credit in any event or
for any reason whatsoever.
10.2 Ordering Licenses
Licensee may purchase Development Licenses and Distribution Licenses pursuant
to agreed pricing terms or, if no specific pricing terms have been agreed upon,
at The Qt Company's standard pricing terms applicable at the time of purchase.
Licensee shall submit all purchase orders for Development Licenses and
Distribution Licenses to The Qt Company by email or any other method acceptable
to The Qt Company (each such order is referred to herein as a "Purchase Order")
for confirmation, whereupon the Purchase Order shall become binding between the
Parties.
10.3 Distribution License Packs
Unless otherwise agreed, Distribution Licenses shall be purchased by way of
Distribution License Packs.
Upon due payment of the ordered Distribution License Pack(s), the Licensee will
have an account of Distribution Licenses available for installing, bundling or
integrating (all jointly "installing") the Redistributables with the Devices or
for otherwise distributing the Redistributables in accordance with this
Agreement.
Each time Licensee "installs" or distributes a copy of Redistributables, then
one Distribution License is used, and Licensee's account of available
Distribution Licenses is decreased accordingly.
Licensee may "install" copies of the Redistributables so long as Licensee has
Distribution Licenses remaining on its account.
Redistributables will be deemed to have been "installed" into a Device when one
of the following circumstances shall have occurred: a) the Redistributables
have been loaded onto the Device and used outside of the Licensee's premises or
b) the Device has been fully tested and placed into Licensee's inventory
(or sold) for the first time (i.e., Licensee will not be required to use
(or pay for) more than one Distribution License for each individual Device,
e.g. in a situation where a Device is returned to Licensee's inventory after
delivery to a distributor or sale to a Customer). In addition, if Licensee
includes a back-up copy of the Redistributables on a CD-ROM or other storage
medium along with the product, that backup copy of the Redistributables will
not be deemed to have been "installed" and will not require an additional
Distribution License.
10.4 Payment Terms
License Fees and any other charges under this Agreement shall be paid by
Licensee no later than thirty (30) days from the date of the applicable invoice
from The Qt Company.
The Qt Company will submit an invoice to Licensee after the date of this
Agreement and/or after The Qt Company receives a Purchase Order from
Licensee.
A late payment charge of the lower of (a) one percent per month; or (b) the
interest rate stipulated by applicable law, shall be charged on any unpaid
balances that remain past due.
The Qt Company shall have the right to suspend, terminate or withhold grants
of all rights to the Licensed Software hereunder, including but not limited to
the Developer License, Distribution License, and Support, should Licensee fail
to make payment in timely fashion.
10.5 Taxes
All License Fees and other charges payable hereunder are gross amounts but
exclusive of any value added tax, use tax, sales tax and other taxes, duties or
tariffs ("Taxes"). Such applicable Taxes shall be paid by Licensee, or, where
applicable, in lieu of payment of such Taxes, Licensee shall provide an
exemption certificate to The Qt Company and any applicable authority.
11 RECORD-KEEPING AND REPORTING OBLIGATIONS; AUDIT RIGHTS
11.1 Licensee's Record-keeping
Licensee shall at all times maintain accurate and up-to-date written records of
Licensee's activities related to the use of Licensed Software and distribution
of Redistributables. The records shall be adequate to determine Licensee's
compliance with the provisions of this Agreement and to demonstrate the number
of Designated Users and Redistributables distributed by Licensee. The records
shall conform to good accounting practices reasonably acceptable to The Qt
Company.
Licensee shall, within thirty (30) days from receiving The Qt Company's request
to that effect, deliver to The Qt Company a report on Licensee's usage of
Licensed Software, such report to copies of Redistributables distributed by
Licensee during that calendar quarter, and also detailing the number of
undistributed copies of Redistributables made by Licensee and remaining in its
account contain information, in sufficient detail, on (i) amount of users
working with Licensed Software, (ii) copies of Redistributables distributed by
Licensee during that calendar quarter, (iii) number of undistributed copies of
Redistributables and corresponding number of unused Distribution Licenses
remaining on Licensee's account, and (iv) any other information as The Qt
Company may reasonably require from time to time.
11.2. The Qt Company's Audit Rights
The Qt Company or an independent auditor acting on behalf of The Qt Company's,
may, upon at least five (5) business days' prior written notice and at its
expense, audit Licensee with respect to the use of the Redistributables, but
not more frequently than once during each 6-month period. Such audit may be
conducted by mail, electronic means or through an in-person visit to Licensee's
place of business. Any such in-person audit shall be conducted during regular
business hours at Licensee's facilities and shall not unreasonably interfere
with Licensee's business activities. The Qt Company or the independent auditor
acting on behalf of The Qt Company shall be entitled to inspect Licensee's
Records. All such Licensee's Records and use thereof shall be subject to an
obligation of confidentiality under this Agreement.
If an audit reveals that Licensee is using the Licensed Software beyond scope
of the licenses Licensee has paid for, Licensee agrees to immediately pay The
Qt Company any amounts owed for such unauthorized use.
In addition, in the event the audit reveals a material violation of the terms
of this Agreement (underpayment of more than 5% of License Fees shall always be
deemed a material violation for purposes of this section), then the Licensee
shall pay The Qt Company's reasonable cost of conducting such audit.
12 TERM AND TERMINATION
12.1 Term
This Agreement shall enter into force upon due acceptance by both Parties and
remain in force for as long as there is any Development License(s) in force
("Term"), unless and until terminated pursuant to the terms of this Section 12.
12.2 Termination by The Qt Company
The Qt Company shall have the right to terminate this Agreement upon thirty
(30) days prior written notice if the Licensee is in material breach of any
obligation of this Agreement and fails to remedy such breach within such notice
period.
12.3 Mutual Right to Terminate
Either Party shall have the right to terminate this Agreement immediately upon
written notice in the event that the other Party becomes insolvent, files for
any form of bankruptcy, makes any assignment for the benefit of creditors, has
a receiver, administrative receiver or officer appointed over the whole or a
substantial part of its assets, ceases to conduct business, or an act
equivalent to any of the above occurs under the laws of the jurisdiction of the
other Party.
12.4 Parties' Rights and Duties upon Termination
Upon expiry or termination of the Agreement Licensee shall cease and shall
cause all Designated Users (including those of its Affiliates' and
Contractors') to cease using the Licensed Software and distribution of the
Redistributables under this Agreement.
Notwithstanding the above, in the event the Agreement expires or is terminated:
(i) as a result of The Qt Company choosing not to renew the Development
License(s) as set forth in Section 3.1, then all valid licenses possessed by
the Licensee at such date shall be extended to be valid in perpetuity under the
terms of this Agreement and Licensee is entitled to purchase additional
licenses as set forth in Section 10.2; or
(ii) for reason other than by The Qt Company pursuant to item (i) above or
pursuant to Section 12.2, then the Licensee is entitled, for a period of six
(6) months after the effective date of termination, to continue distribution of
Devices under the Distribution Licenses paid but unused at such effective date
of termination.
Upon any such termination the Licensee shall destroy or return to The Qt
Company all copies of the Licensed Software and all related materials and will
certify the same to The Qt Company upon its request, provided however that
Licensee may retain and exploit such copies of the Licensed Software as it may
reasonably require in providing continued support to Customers.
Expiry or termination of this Agreement for any reason whatsoever shall not
relieve Licensee of its obligation to pay any License Fees accrued or payable
to The Qt Company prior to the effective date of termination, and Licensee
shall immediately pay to The Qt Company all such fees upon the effective date
of termination. Termination of this Agreement shall not affect any rights of
Customers to continue use of Applications and Devices (and therein incorporated
Redistributables).
12.5 Extension in case of bankruptcy
In the event The Qt Company is declared bankrupt under a final, non-cancellable
decision by relevant court of law, and this Agreement is not, at the date of
expiry of the Development License(s) pursuant to Section 3.1, assigned to
party, who has assumed The Qt Company's position as a legitimate licensor of
Licensed Software under this Agreement, then all valid licenses possessed by
the Licensee at such date of expiry, and which the Licensee has not notified
for expiry, shall be extended to be valid in perpetuity under the terms of
this Agreement.
13. GOVERNING LAW AND LEGAL VENUE
In the event this Agreement is in the name of The Qt Company Inc., a Delaware
Corporation, then:
(i) this Agreement shall be construed and interpreted in accordance with the
laws of the State of California, USA, excluding its choice of law provisions;
(ii) the United Nations Convention on Contracts for the International Sale of
Goods will not apply to this Agreement; and
(iii) any dispute, claim or controversy arising out of or relating to this
Agreement or the breach, termination, enforcement, interpretation or validity
thereof, including the determination of the scope or applicability of this
Agreement to arbitrate, shall be determined by arbitration in San Francisco,
USA, before one arbitrator. The arbitration shall be administered by JAMS
pursuant to JAMS' Streamlined Arbitration Rules and Procedures. Judgment on the
Award may be entered in any court having jurisdiction. This Section shall not
preclude parties from seeking provisional remedies in aid of arbitration from a
court of appropriate jurisdiction.
In the event this Agreement is in the name of The Qt Company Ltd., a Finnish
Company, then:
(i) this Agreement shall be construed and interpreted in accordance with the
laws of Finland, excluding its choice of law provisions;
(ii) the United Nations Convention on Contracts for the International Sale of
Goods will not apply to this Agreement; and
(iii) any disputes, controversy or claim arising out of or relating to this
Agreement, or the breach, termination or validity thereof shall be shall be
finally settled by arbitration in accordance with the Arbitration Rules of
Finland Chamber of Commerce. The arbitration tribunal shall consist of one (1),
or if either Party so requires, of three (3), arbitrators. The award shall be
final and binding and enforceable in any court of competent jurisdiction. The
arbitration shall be held in Helsinki, Finland and the process shall be
conducted in the English language. This Section shall not preclude parties from
seeking provisional remedies in aid of arbitration from a court of appropriate
jurisdiction.
14. GENERAL PROVISIONS
14.1 No Assignment
Except in the case of a merger or sale of substantially all of its corporate
assets, Licensee shall not be entitled to assign or transfer all or any of its
rights, benefits and obligations under this Agreement without the prior written
consent of The Qt Company, which shall not be unreasonably withheld or delayed.
The Qt Company shall be entitled to freely assign or transfer any of its
rights, benefits or obligations under this Agreement.
14.2 No Third Party Representations
Licensee shall make no representations or warranties concerning the Licensed
Software on behalf of The Qt Company. Any representation or warranty Licensee
makes or purports to make on The Qt Company's behalf shall be void as to The
Qt Company.
14.3 Surviving Sections
Any terms and conditions that by their nature or otherwise reasonably should
survive termination of this Agreement shall so be deemed to survive.
14.4 Entire Agreement
This Agreement, the exhibits hereto, the License Certificate and any applicable
Purchase Order constitute the complete agreement between the Parties and
supersedes all prior or contemporaneous discussions, representations, and
proposals, written or oral, with respect to the subject matters discussed
herein.
In the event of any conflict or inconsistency between this Agreement and any
Purchase Order, the terms of this Agreement will prevail over the terms of the
Purchase Order with respect to such conflict or inconsistency.
Parties specifically acknowledge and agree that this Agreement prevails over
any click-to-accept or similar agreements the Designated Users may need to
accept online upon download of the Licensed Software, as may be required by
The Qt Company's applicable processes relating to Licensed Software.
14.5 Modifications
No modification of this Agreement shall be effective unless contained in a
writing executed by an authorized representative of each Party. No term or
condition contained in Licensee's Purchase Order shall apply unless expressly
accepted by The Qt Company in writing.
14.6 Force Majeure
Except for the payment obligations hereunder, neither Party shall be liable to
the other for any delay or non-performance of its obligations hereunder in the
event and to the extent that such delay or non-performance is due to an event
of act of God, terrorist attack or other similar unforeseeable catastrophic
event that prevents either Party for fulfilling its obligations under this
Agreement and which such Party cannot avoid or circumvent ("Force Majeure
Event"). If the Force Majeure Event results in a delay or non-performance of a
Party for a period of three (3) months or longer, then either Party shall have
the right to terminate this Agreement with immediate effect without any
liability (except for the obligations of payment arising prior to the event of
Force Majeure) towards the other Party.
14.7 Notices
Any notice given by one Party to the other shall be deemed properly given and
deemed received if specifically acknowledged by the receiving Party in writing
or when successfully delivered to the recipient by hand, fax, or special
courier during normal business hours on a business day to the addresses
specified for each Party on the signature page. Each communication and document
made or delivered by one Party to the other Party pursuant to this Agreement
shall be in the English language.
14.8 Export Control
Licensee acknowledges that the Redistributables may be subject to export
control restrictions under the applicable laws of respective countries.
Licensee shall fully comply with all applicable export license restrictions
and requirements as well as with all laws and regulations relating to the
Redistributables and exercise of licenses hereunder and shall procure all
necessary governmental authorizations, including without limitation, all
necessary licenses, approvals, permissions or consents, where necessary for the
re-exportation of the Redistributables, Applications and/or Devices.
14.9 No Implied License
There are no implied licenses or other implied rights granted under this
Agreement, and all rights, save for those expressly granted hereunder, shall
remain with The Qt Company and its licensors. In addition, no licenses or
immunities are granted to the combination of the Licensed Software with any
other software or hardware not delivered by The Qt Company under this Agreement.
14.10 Attorney Fees
The prevailing Party in any action to enforce this Agreement shall be entitled
to recover its attorney's fees and costs in connection with such action.
14.11 Severability
If any provision of this Agreement shall be adjudged by any court of competent
jurisdiction to be unenforceable or invalid, that provision shall be limited or
eliminated to the minimum extent necessary so that this Agreement shall
otherwise remain in full force and effect and enforceable.
IN WITNESS WHEREOF, the Parties hereto, intending to be legally bound hereby,
have caused this Agreement to be executed by Licensee's authorized
representative installing the Licensed Software and accepting the terms
hereof in connection therewith.
Appendix 1
1. Parts of the Licensed Software that are permitted for distribution in
object code form only ("Redistributables") under this Agreement:
- The Licensed Software's Qt Essentials and Qt Add-on libraries
- The Licensed Software's configuration tool ("qtconfig")
- The Licensed Software's help tool ("Qt Assistant")
- The Licensed Software's internationalization tools ("Qt Linguist", "lupdate",
"lrelease")
- The Licensed Software's QML ("Qt Quick") launcher tool ("qmlscene" or
"qmlviewer")
- The Licensed Software's installer framework
2. Parts of the Licensed Software that are not permitted for distribution
include, but are not limited to:
- The Licensed Software's source code and header files
- The Licensed Software's documentation
- The Licensed Software's documentation generation tool ("qdoc")
- The Licensed Software's tool for writing makefiles ("qmake")
- The Licensed Software's Meta Object Compiler ("moc")
- The Licensed Software's User Interface Compiler ("uic")
- The Licensed Software's Resource Compiler ("rcc")
- The Licensed Software's parts of the IDE tool ("Qt Creator")
- The Licensed Software's parts of the Design tools ("Qt 3D Studio" or
"Qt Quick Designer")
- The Licensed Software's Emulator

View File

@ -94,7 +94,7 @@ defineReplace(qtConfFunc_licenseCheck) {
hasOpenSource = true
else: \
hasOpenSource = false
exists($$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT-4.0): \
exists($$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT): \
hasCommercial = true
else: \
hasCommercial = false
@ -224,7 +224,7 @@ defineReplace(qtConfFunc_licenseCheck) {
affix = either
}
} else {
theLicense = $$cat($$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT-4.0, lines)
theLicense = $$cat($$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT, lines)
theLicense = $$first(theLicense)
showWhat = "Type '?' to view the $${theLicense}."
}
@ -251,7 +251,7 @@ defineReplace(qtConfFunc_licenseCheck) {
} else: equals(val, n)|equals(val, no) {
return(false)
} else: equals(commercial, yes):equals(val, ?) {
licenseFile = $$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT-4.0
licenseFile = $$QT_SOURCE_TREE/LICENSE.QT-LICENSE-AGREEMENT
} else: equals(commercial, no):equals(val, l) {
licenseFile = $$QT_SOURCE_TREE/LICENSE.LGPL3
} else: equals(commercial, no):equals(val, g):$$gpl2Ok {

542
dist/changes-5.14.0 vendored Normal file
View File

@ -0,0 +1,542 @@
Qt 5.14 introduces many new features and improvements as well as bugfixes
over the 5.13.x series. For more details, refer to the online documentation
included in this distribution. The documentation is also available online:
https://doc.qt.io/qt-5/index.html
The Qt version 5.14 series is binary compatible with the 5.13.x series.
Applications compiled for 5.13 will continue to run with 5.14.
Some of the changes listed in this file include issue tracking numbers
corresponding to tasks in the Qt Bug Tracker:
https://bugreports.qt.io/
Each of these identifiers can be entered in the bug tracker to obtain more
information about a particular change.
****************************************************************************
* Important Behavioral Change *
****************************************************************************
- [QTBUG-47644] WrapWord now correctly prefers line breaks between words
in Korean text. WrapAnywhere can still be used to get breaks between
syllables instead.
****************************************************************************
* Potentially Source-Incompatible Changes *
****************************************************************************
- qstringlist.h no longer includes qregexp.h.
- Prefixing Q_NAMESPACE with an export macro may no longer work. Use the
new Q_NAMESPACE_EXPORT macro for that use case.
****************************************************************************
* QtCore *
****************************************************************************
- Added support of deduction guides for QPair
- Added new Qt::SplitBehavior, for use as eventual replacement for
QString::SplitBehavior.
- Added the new Q_NAMESPACE_EXPORT macro. It can be used just like
Q_NAMESPACE to add meta-object information to a namespace; however it
also supports exporting of such information from shared libraries.
- [QTBUG-15234] Qt installations on the host system can now be relocated,
i.e. moved to other directories.
- JSON:
* Added overloads of functions taking key strings as QStringView; in
QJsonObject, QJsonValue and QJsonDocument.
- QAtomicInteger:
* Added loadRelaxed() and storeRelaxed(), to be used as replacements of
load() / store().
- QAtomicPointer:
* Added loadRelaxed() and storeRelaxed(), to be used as replacements of
load() / store().
- QBasicTimer:
* QBasicTimer is now a move-only class. Copying is now deprecated and
will be removed in Qt 6.
* Added swap() member and free function.
- QByteArray::operator[]:
* Detach immediately, instead of deferring until modification via
the returned QByteRef.
* Deprecate reliance on its implicit resizing behavior. Support for
writing past the end of QByteArray shall be removed in a future
version of Qt.
- QCalendar:
* Added QCalendar to support diverse calendars, supported by
implementing QCalendarBackend.
* Added support for Julian and Milankovic calendars. These are enabled
by default, except in bootstrap builds.
* Added support for the Jalali (Persian or Solar Hijri) calendar,
controlled by feature jalalicalendar.
* Added support for the Islamic Civil calendar, controlled by feature
islamiccivilcalendar, with locale data that can be shared with other
implementations, controlled by feature hijricalendar.
- QChar:
* Added FormFeed (FF) special character.
- QCollator:
* Added support for QStringView.
* The default QCollator now uses the system's collation locale, rather
than the system locale itself.
- QDataStream:
* Enumerations can now be serialized through QDataStream without the
need of manually defining streaming operators.
- QDate:
* [QTBUG-64485] Added startOfDay() and endOfDay() methods to provide a
QDateTime at the start and end of a given date, taking account of any
time skipped by transitions, e.g. a DST spring-forward, which can lead
to a day starting at 01:00 or ending just before 23:00.
* Allow choice of calendar in various operations, with Gregorian
remaining the default.
- QDateTime:
* Invalid datetimes are now treated as equal and less than all valid
ones. They could previously be found equal to valid datetimes.
- QDir:
* Remove Windows specific long path markers when handling file paths
with native separators.
- QEasingCurve:
* QEasingCurve now properly streams all the data needed to QDataStream.
- QFileInfo:
* [QTBUG-75869] Introduced QFileInfo::isJunction() to detect NTFS Junctions
on Windows.
- QHash:
* Added range constructor.
- QJsonObject:
* Added insert(), remove(), and take() overloads taking QLatin1String.
- QLatin1Char:
* Comparison against char now works even in QT_NO_CAST_FROM_ASCII
builds.
- QLatin1Literal:
* The undocumented QLatin1Literal type alias for QLatin1String is now
deprecated. Use QLatin1String instead.
- QLatin1String:
* Added indexOf().
* Added contains().
* Added lastIndexOf().
- QLineF:
* added QLineF::intersects() as a replacement for QLineF::intersect()
- QLinkedList:
* Added range constructor.
- QList:
* Added range constructor.
- QLocale:
* The system locale now knows what to use for collation,
QLocale::system().collation().
* The NaN obtained when reading "nan" as a floating-point value is now
quiet rather than signaling.
* The system locale's UI languages list now includes, as for that of an
ordinary locale, the results of adding likely sub-tags from each
locale name, and of removing some, where this doesn't change which
locale is specified. This gives searches for translation files a
better chance of finding a suitable file.
- QMetaObject:
* [QTBUG-38876] Some internal members of the QMetaObject class have
changed types. Those members are not public API and thus should not
cause source incompatibilities.
- QMultiHash:
* Added range constructor.
- QMutex:
* Added QRecursiveMutex as a replacement of QMutex(QMutex::Recursive).
- QPoint/QPointF:
* Added transposed().
- QPointer:
* Added a free swap function.
- QSet:
* Added range constructor.
- QSharedPointer:
* Overloads of qSharedPointerObjectCast have been added to work on
std::shared_ptr.
* The swap overload for QSharedPointer in the std namespace has been
removed; a new overload has been added in the Qt namespace.
- QSize/QSizeF:
* Added grownBy(QMargin(F))/shrunkBy(QMargin(F)).
- QString:
* The behavior of operator[] to allow implicit resizing of the string
has been deprecated, and will be removed in a future version of Qt.
* QString::operator[] detaches immediately. Previously, the detach was
delayed until a modification was made to the string through the
returned QCharRef.
* QString::arg(QString, ..., QString) can now be called with more than
nine arguments, as well as with QStringViews.
- QString/QStringRef:
* The split functions now optionally take Qt::SplitBehavior.
- QStringList:
* Added range constructor.
* Added QStringView overloads of join(), filter(), and
replaceInStrings().
- QStringView:
* Added indexOf().
* Added contains().
* Added lastIndexOf().
* Deprecated the (undocumented) QStringViewLiteral macro. Just use u""
or QStringView(u"") instead.
- QStringView/QLatin1String:
* Added arg(), taking arbitrarily many strings.
- QTextStream:
* The NaN obtained when reading "nan" as a floating-point value is now
quiet rather than signaling.
- QTimeZone:
* [QTBUG-75565] The TZDB back-end now recognizes the contents of /etc/TZ
as a fall-back for $TZ (as used by uClibc).
- QVarLengthArray:
* Added range constructor.
* Added a qHash overload.
- QVariant:
* Fixed a bug that caused isNull() to be true after downcasting a
QObject* payload using convert().
- QVector:
* Added range constructor.
- QWeakPointer:
* The data() function has been deprecated.
* A swap overload has been added.
- QtGlobal:
* Add new macros QT_DEPRECATED_VERSION and QT_DEPRECATED_VERSION_X to
conditionally display deprecation warnings
* Added qExchange(), a drop-in for C++14's std::exchange()
- Windows:
* QSysInfo::prettyProductName() now returns a version including the
Windows 10 release id or Windows 7 build number respectively,
resembling the version string displayed by the winver tool.
****************************************************************************
* QtDBus *
****************************************************************************
- QDBusAbstractInterface:
* The call() and asyncCall() methods now accept more than eight QVariant
arguments.
- QDBusObjectPath:
* Added explicit cast operator to QVariant.
****************************************************************************
* QtGui *
****************************************************************************
- QColor:
* Added QColorConstants, a namespace containing constexpr QColor
instances.
- A QColorSpace class has been added, and color spaces are now parsed from
PNG and JPEG images. No automatic color space conversion is done
however, and applications must request it.
- Added support for filtering Vulkan debug messages in QVulkanInstance.
This is especially useful for processing or suppressing messages from
the validation layers.
- Obsolete constructors and accessors in QWheelEvent now have proper
deprecation macros, and are no longer in use in any Qt modules.
What is left is intended to be compatible with planned changes in Qt 6.
- QFont:
* [QTBUG-77908] Fixed kerning error with certain fonts.
* [QTBUG-76239] Fixed an issue where application fonts would be parsed
multiple times, causing some unnecessary overhead when during
application startup.
* [QTBUG-46322] Resolving a font that just has a family set with
families set will prepend the family to the families so that it is
still the first preference for the font.
- QImage:
* [QTBUG-42540], [QTBUG-68787] Loading of image files having a file
name suffix for a different image file type has been
fixed. QImageReader will now ask the suffix format handler to
confirm the file contents (canRead()), and fall back to normal
file content recognition on failure. This implies a slight
behavior change in QImageReader::loopCount(), ::imageCount() and
::nextImageDelay(): For an unreadable file with a recognized
suffix, they would earlier return 0, while they now will
return -1, i.e. error, as per the documentation.
- QPainter:
* HighQualityAntialiasing and NonCosmeticDefaultPen are marked as
deprecated and don't have an effect anymore
- QTextDocument:
* [QTBUG-36152] CSS styling of table cell borders (styling <td> and <th>
elements) is now supported during HTML import and export, including
border-color, border-width and border-style. Setting the table's
border-width to a value >= 1 and enabling border-collapse will now draw
a simple, clean table grid (1px) with an outer border of the specified
width and color. A manual test was added, which allows editing HTML
with live preview.
* [QTBUG-43589] Fixed incorrect rounding of widths of variable-width
columns in tables, to avoid border drawing artifacts.
* [QTBUG-78318] QTextFrameFormat margins, padding and borders are now
scaled to device coordinates, and thus correctly sized on high-dpi
displays and printers.
* Markdown (CommonMark or GitHub dialect) is now a supported format for
reading into and writing from QTextDocument, via the setMarkdown() and
toMarkdown() functions. We do not guarantee that every markdown
document can be re-written exactly as it was read; but that does work
in many cases, and it's OK to report bugs about cases that don't work.
- Touch:
* [QTBUG-77142] When a stationary touchpoint contains some "interesting"
property change (pressure or velocity, so far), it is delivered normally.
****************************************************************************
* QtNetwork *
****************************************************************************
- QAuthenticator:
* [QTBUG-4117] Add support for SPNEGO/Negotiate
- QHostInfo:
* Added move contructor.
- QNetworkAccessManager:
* [QTBUG-69477] Don't fail when FTP does not implement the HELP command.
* Added setAutoDeleteReplies to QNetworkAccessManager to enable the
AutoDeleteReplyOnFinishAttribute attribute for all QNetworkRequests
that are passed to QNetworkAccessManager.
- QNetworkRequest:
* Added the AutoDeleteReplyOnFinishAttribute attribute to
QNetworkRequest, which makes QNetworkAccessManager delete the
QNetworkReply after it has emitted the "finished" signal.
* Add an ability to configure HTTP/2 protocol
- QSslKey:
* Key data is cleared as soon as possible when move-assigning.
- QSslSocket:
* [QTBUG-72016] Added runtime validation of the SSL private key when it
is loaded through a file path.
****************************************************************************
* QtSql *
****************************************************************************
- QPSQL:
* [QTBUG-79033][QTBUG-79064] added support for PostgreSQL 12
- QSqlite:
* Updated to v3.30.1
- QSqlite2:
* Marked QSQLITE2 plugin as obsolete - it will be removed with Qt6
together with the QTDS plugin
****************************************************************************
* QtTestLib *
****************************************************************************
- Comparison of QImage, QPixmap now checks for the device pixel ratio.
- It is now possible to perform static initialization before QApplication
instantiation by implementing a initMain() function in the test class.
****************************************************************************
* QtWidgets *
****************************************************************************
- QActionGroup:
* Added new exclusionPolicy property. Set it to ExclusiveOptional to
allow unchecking the active checkable action in an exclusive group.
- QCalendarWidget:
* Allow choice of calendar, with Gregorian remaining the default.
- QComboBox:
* Two new signals textHighlighted() and textActivated() were added to
replace highlighted()/activated() QString overloads.
- QDateTimeEdit:
* Allow choice of calendar, with Gregorian remaining the default.
- QFileDialog:
* The widgets-based dialog now remembers the selected files when
navigating the history.
- QFormLayout:
* Honor the vertical expanding state of a widget inside a QFormLayout.
- QGraphicsWidget:
* Added QMarginsF overloads of setContentsMargins() and
setWindowFrameMargins().
- QGroupBox:
* [QTBUG-259389 Always disable children of a checkable, unchecked group
box before showing.
- QLabel:
* Markdown is now a supported textFormat for QLabel.
- QLayout:
* Prevent clipping of group box titles on macOS (and similar styles that
draw into layout margins)
- QLineEdit:
* Behavior change: now the editingFinished signal is emitted only once
after the line edit content was edited.
* The getTextMargins() member function has been deprecated in favor of
textMargins().
- QStyle:
* Style sheets now only use the part of the stylesheet font that it
knows about. The remaining will be resolved/inherited from the
context.
- QTextBrowser:
* Markdown is now a supported format. QTextBrowser::setSource() detects
the common file extensions (.md, .mkd and .markdown). In case it
cannot be detected that way, setSource() now takes an optional
ResourceType enum argument so that the type can be overridden.
QTextBrowser inherits all the QTextEdit features: if readOnly is set
to false, the user can perform the editing operations that QTextEdit
allows. If readOnly is set to true (the default), the user can click
Markdown hyperlinks to emit the anchorClicked() signal, as with HTML.
- QTextEdit:
* [QTBUG-75931] Added support for copy-pasting foreground brushes with
textures within same document.
* Markdown (CommonMark or GitHub dialect) is now a supported format,
via the markdown property. GitHub dialect is the default, and supports
all features such as hyperlinks, images, tables, lists, checklists, etc.
* If the text was loaded from a Markdown document that contains checkboxes,
the user can click on them to toggle the states. The cursor changes to
PointingHandCursor when the mouse is hovering over a checkbox.
- QTreeView:
* Don't emit clicked signal after a doubleClicked signal.
- QWidget:
* The getContentsMargins() member function has been deprecated in favor
of contentsMargins().
****************************************************************************
* Platform Specific Changes *
****************************************************************************
- Android
* Fixed an issue where an application installation would be irrecoverably
broken if power loss or a crash occurred during its first initialization
run.
* Make it easy to run Qt tests on Android. "$ make check" is all that's
needed to run a test on an Android device.
* Remove ant support from androiddeployqt
* Introduce "make apk" target, an easy way to create an apk.
* Android depends on NDK r20+
* Android multi arch build in one go, needed to support the new .aab
packaging format.
* -android-abis configure script parameter useful to compile Qt only for a
selected Android ABIs.
* Instead of bundling QML resources in assets and extracting them on first
start, Qt now creates an .rcc file and register it before invoking the
main function.
* Fixed regression that made it impossible for an application to use the
tap-and-hold gesture.
- Linux:
* Added a device spec for Raspberry Pi 4 (32-bit, V3D)
* Added a device spec for 64-bit i.MX8 systems (Vivante graphics stack)
- MinGW:
* [QTBUG-4155] Added a suffix to debug mode pkgconfig files.
- macOS:
* The drawableSize of Metal layers is no longer updated automatically on
window resize or screen change. Update the size manually in response to
resizeEvent(), or at the start of each frame, as needed.
- Mir:
* The Mir platform plugin has been removed: use the Wayland plugin when
connecting to a Mir display server.
- Windows:
* It is now possible to enable RTL mode by passing the option -platform
windows:reverse.
* [QTBUG-74748] Fixed a bug where it would be impossible to
request different faces of a font family after a specific type face
has been in use.
****************************************************************************
* Third-Party Code *
****************************************************************************
- Upgraded bundled Freetype version to 2.10.1.
- Build sqlite without SQLITE_OMIT_LOAD_EXTENSION
- Qt Gui: Added md4c markdown parser to src/3rdparty/md4c (MIT licensed).
- [QTBUG-79418] Updated double-conversion code to upstream version 3.1.5.
- [QTBUG-79420] libjpeg-turbo was updated to version 2.0.3
- [QTBUG-79418] Updated DNS public suffix list
****************************************************************************
* Tools *
****************************************************************************
- rcc:
* Added -d option to generate a dependency file.
* Added support for Python as output format.
****************************************************************************
* configure *
****************************************************************************
- Added the configure option -qtlibinfix-plugins to rename plugins
according to QT_LIBINFIX. This option is off by default.
****************************************************************************
* CMake *
****************************************************************************
- [QTBUG-38913][QTBUG-76562] Added ability to auto-import non-qml plugins
on CMake builds
****************************************************************************
* qmake *
****************************************************************************
- Installation targets do not ignore the exit code of QINSTALL and
QINSTALL_PROGRAM anymore.
- Introduced the variables LEX_DIR and YACC_DIR which determine the
location of lex/yacc output. Fixed parallel execution of lex/yacc for
debug_and_release builds.
- The syntax 'LIBS += -frameworkFoo', or 'LIBS += "-framework Foo"' is no
longer supported. Use the canonical 'LIBS += -framework Foo' instead.
- Fixed precompiled headers for the Clang compiler.
- Android:
* Remove gcc-style PCH directives from the android-clang mkspec.

View File

@ -50,12 +50,15 @@
#include <QApplication>
#include "norwegianwoodstyle.h"
#include "widgetgallery.h"
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(styles);
QApplication::setStyle(new NorwegianWoodStyle);
QApplication app(argc, argv);
WidgetGallery gallery;
gallery.show();

View File

@ -58,6 +58,7 @@
NorwegianWoodStyle::NorwegianWoodStyle() :
QProxyStyle(QStyleFactory::create("windows"))
{
setObjectName("NorwegianWood");
}
//! [0]

View File

@ -143,6 +143,7 @@ WidgetGallery::WidgetGallery(QWidget *parent)
setLayout(mainLayout);
setWindowTitle(tr("Styles"));
styleChanged();
}
//! [4]
@ -150,12 +151,10 @@ WidgetGallery::WidgetGallery(QWidget *parent)
void WidgetGallery::changeStyle(const QString &styleName)
//! [5] //! [6]
{
if (styleName == "NorwegianWood") {
if (styleName == "NorwegianWood")
QApplication::setStyle(new NorwegianWoodStyle);
} else {
else
QApplication::setStyle(QStyleFactory::create(styleName));
}
changePalette();
}
//! [6]
@ -170,6 +169,25 @@ void WidgetGallery::changePalette()
}
//! [8]
void WidgetGallery::changeEvent(QEvent *event)
{
if (event->type() == QEvent::StyleChange)
styleChanged();
}
void WidgetGallery::styleChanged()
{
auto styleName = QApplication::style()->objectName();
for (int i = 0; i < styleComboBox->count(); ++i) {
if (QString::compare(styleComboBox->itemText(i), styleName, Qt::CaseInsensitive) == 0) {
styleComboBox->setCurrentIndex(i);
break;
}
}
changePalette();
}
//! [9]
void WidgetGallery::advanceProgressBar()
//! [9] //! [10]

View File

@ -80,8 +80,12 @@ class WidgetGallery : public QDialog
public:
WidgetGallery(QWidget *parent = nullptr);
protected:
void changeEvent(QEvent *) override;
private slots:
void changeStyle(const QString &styleName);
void styleChanged();
void changePalette();
void advanceProgressBar();

View File

@ -36,6 +36,7 @@ build_pass {
}
}
} else: contains(TEMPLATE, "lib"):!static:!QTDIR_build:android_install {
!contains(TARGET, "_$${QT_ARCH}"): TARGET = $${TARGET}_$${QT_ARCH}
target.path = /libs/$$ANDROID_TARGET_ARCH/
INSTALLS *= target
}

View File

@ -63,11 +63,12 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-embedded {
QML_ROOT_PATH = $$_PRO_FILE_PWD_
FILE_CONTENT += " \"qml-root-path\": $$emitString($$QML_ROOT_PATH),"
FILE_CONTENT += " \"stdcpp-path\": $$emitString($$ANDROID_STDCPP_PATH),"
!isEmpty(RESOURCES) {
!isEmpty(RESOURCES)|!isEmpty(QMLCACHE_RESOURCE_FILES) {
# Make sure that qmake generated qrc files are accounted for
load(resources_functions)
qtFlattenResources()
for(resource, RESOURCES) {
NEWRESOURCES = $$RESOURCES $$QMLCACHE_RESOURCE_FILES
for(resource, NEWRESOURCES) {
contains(resource, ".*\\qmake_qmake_immediate.qrc$") {
# They will be created for each architecture, since they could be different
# we need to account for all of them

View File

@ -666,6 +666,7 @@ defineTest(qtConfLibrary_inline) {
vars += $$eval(config.commandline.rev_assignments.$${iv})
defined(config.input.$${iv}, var) {
eval($${1}.builds.$${b} = $$eval(config.input.$${iv}))
export($${1}.builds.$${b})
$${1}.builds._KEYS_ *= $${b}
any = true
} else {
@ -680,11 +681,14 @@ defineTest(qtConfLibrary_inline) {
export($${1}.builds._KEYS_)
# we also reset the generic libs, to avoid surprises.
$${1}.libs =
export($${1}.libs)
}
# direct libs. overwrites inline libs.
defined(config.input.$${input}.libs, var): \
defined(config.input.$${input}.libs, var) {
eval($${1}.libs = $$eval(config.input.$${input}.libs))
export($${1}.libs)
}
includes = $$eval(config.input.$${input}.incdir)
@ -693,6 +697,7 @@ defineTest(qtConfLibrary_inline) {
!isEmpty(prefix) {
includes += $$prefix/include
$${1}.libs = -L$$prefix/lib $$eval($${1}.libs)
export($${1}.libs)
}
libdir = $$eval(config.input.$${input}.libdir)

View File

@ -5407,7 +5407,7 @@
\li The exit code of the test will be ignored during \c{make check}.
\endtable
Testcases will often be written with \l{QTest} or \l{TestCase}, but
Test cases will often be written with \l{QTest} or \l[QML]{TestCase}, but
that is not a requirement to make use of \c{CONFIG+=testcase} and \c{make check}.
The only primary requirement is that the test program exit with a zero exit code
on success, and a non-zero exit code on failure.

View File

@ -1629,17 +1629,24 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
}
// The symroot is marked by xcodebuild as excluded from Time Machine
// backups, as it's a temporary build dir, so we don't want it to be
// the same as the possibe in-source dir, as that would leave out
// sources from being backed up.
t << "\t\t\t\t" << writeSettings("SYMROOT",
Option::output_dir + Option::dir_sep + ".xcode") << ";\n";
if (Option::output_dir != qmake_getpwd()) {
// The SYMROOT is marked by Xcode as excluded from Time Machine
// backups, as it's a temporary build dir, but that's fine when
// we are shadow building.
t << "\t\t\t\t" << writeSettings("SYMROOT", "$(PROJECT_DIR)") << ";\n";
} else {
// For in-source builds we don't want to exclude the sources
// from being backed up, so we point SYMROOT to a temporary
// build directory.
t << "\t\t\t\t" << writeSettings("SYMROOT", ".xcode") << ";\n";
// The configuration build dir however is not treated as excluded,
// so we can safely point it to the root output dir.
t << "\t\t\t\t" << writeSettings("CONFIGURATION_BUILD_DIR",
Option::output_dir + Option::dir_sep + "$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)") << ";\n";
// Then we set the configuration build dir instead, so that the
// final build artifacts end up in the place Qt Creator expects.
// The disadvantage of using this over SYMROOT is that Xcode will
// fail to archive projects that override this variable.
t << "\t\t\t\t" << writeSettings("CONFIGURATION_BUILD_DIR",
"$(PROJECT_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)") << ";\n";
}
if (!project->isEmpty("DESTDIR")) {
ProString dir = project->first("DESTDIR");

View File

@ -2,7 +2,7 @@
{
"Id": "VulkanMemoryAllocator",
"Name": "Vulkan Memory Allocator",
"QDocModule": "qtrhi",
"QDocModule": "qtgui",
"Description": "Vulkan Memory Allocator",
"QtUsage": "Memory management for the Vulkan backend of QRhi.",

View File

@ -56,7 +56,7 @@
\include module-use.qdocinc using qt module
\quotefile overview/using-qt-core.cmake
See also the \l[QtDoc]{Building with CMake} overview.
See also the \l[QtDoc]{Build with CMake} overview.
\section2 Building with qmake

View File

@ -189,13 +189,13 @@
XML file to indicate a file should be most compressed, regardless of
which algorithms \c rcc supports.
\li \c{zstd}: use the \l{Zstandard}{https://zstd.net} library to compress
\li \c{zstd}: use the \l{https://zstd.net}{Zstandard} library to compress
contents. Valid compression levels range from 1 to 19, 1 is least
compression (least CPU time) and 19 is the most compression (most CPU
time). The default level is 14. A special value of 0 tells the \c{zstd}
library to choose an implementation-defined default.
\li \c{zlib}: use the \l{zlib}{https://zlib.net} library to compress
\li \c{zlib}: use the \l{https://zlib.net}{zlib} library to compress
contents. Valid compression levels range from 1 to 9, with 1the least
compression (least CPU time) and 9 the most compression (most CPU time).
The special value 0 means "no compression" and should not be used. The

View File

@ -137,7 +137,7 @@ QT_BEGIN_NAMESPACE
\sa qToLittleEndian()
*/
/*!
\fn template <typename T> T qFromLittleEndian(const void *src)
\fn template <typename T> inline T qFromLittleEndian(const void *src)
\since 4.3
\relates <QtEndian>
@ -159,7 +159,7 @@ QT_BEGIN_NAMESPACE
\sa qToLittleEndian()
*/
/*!
\fn template <typename T> T qFromLittleEndian(T src)
\fn template <typename T> inline T qFromLittleEndian(T src)
\since 4.3
\relates <QtEndian>
\overload
@ -171,7 +171,7 @@ QT_BEGIN_NAMESPACE
unmodified.
*/
/*!
\fn template <typename T> T qFromLittleEndian(const void *src, qsizetype count, void *dest)
\fn template <typename T> inline T qFromLittleEndian(const void *src, qsizetype count, void *dest)
\since 5.12
\relates <QtEndian>

View File

@ -944,6 +944,10 @@ QT_WARNING_POP
# define Q_DUMMY_COMPARISON_OPERATOR(C)
#endif
QT_WARNING_PUSH
// warning: noexcept-expression evaluates to false because of a call to void swap(..., ...)'
QT_WARNING_DISABLE_GCC("-Wnoexcept")
namespace QtPrivate
{
namespace SwapExceptionTester { // insulate users from the "using std::swap" below
@ -963,6 +967,8 @@ inline void qSwap(T &value1, T &value2)
swap(value1, value2);
}
QT_WARNING_POP
#if QT_DEPRECATED_SINCE(5, 0)
Q_CORE_EXPORT QT_DEPRECATED void *qMalloc(size_t size) Q_ALLOC_SIZE(1);
Q_CORE_EXPORT QT_DEPRECATED void qFree(void *ptr);

View File

@ -562,9 +562,39 @@ static QString getRelocatablePrefix()
HMODULE hModule = getWindowsModuleHandle();
const int kBufferSize = 4096;
wchar_t buffer[kBufferSize];
const int pathSize = GetModuleFileName(hModule, buffer, kBufferSize);
if (pathSize > 0)
prefixPath = prefixFromQtCoreLibraryHelper(QString::fromWCharArray(buffer, pathSize));
DWORD pathSize = GetModuleFileName(hModule, buffer, kBufferSize);
const QString qtCoreFilePath = QString::fromWCharArray(buffer, int(pathSize));
const QString qtCoreDirPath = QFileInfo(qtCoreFilePath).absolutePath();
pathSize = GetModuleFileName(NULL, buffer, kBufferSize);
const QString exeDirPath = QFileInfo(QString::fromWCharArray(buffer, int(pathSize))).absolutePath();
if (QFileInfo(exeDirPath) == QFileInfo(qtCoreDirPath)) {
// QtCore DLL is next to the executable. This is either a windeployqt'ed executable or an
// executable within the QT_HOST_BIN directory. We're detecting the latter case by checking
// whether there's an import library corresponding to our QtCore DLL in PREFIX/lib.
const QString libdir = QString::fromLatin1(
qt_configure_strs + qt_configure_str_offsets[QLibraryInfo::LibrariesPath - 1]);
const QLatin1Char slash('/');
#if defined(Q_CC_MINGW)
const QString implibPrefix = QStringLiteral("lib");
const QString implibSuffix = QStringLiteral(".a");
#else
const QString implibPrefix;
const QString implibSuffix = QStringLiteral(".lib");
#endif
const QString qtCoreImpLibFileName = implibPrefix
+ QFileInfo(qtCoreFilePath).completeBaseName() + implibSuffix;
const QString qtCoreImpLibPath = qtCoreDirPath
+ slash + QLatin1String(QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH)
+ slash + libdir
+ slash + qtCoreImpLibFileName;
if (!QFileInfo::exists(qtCoreImpLibPath)) {
// We did not find a corresponding import library and conclude that this is a
// windeployqt'ed executable.
return exeDirPath;
}
}
if (!qtCoreFilePath.isEmpty())
prefixPath = prefixFromQtCoreLibraryHelper(qtCoreFilePath);
#else
#error "The chosen platform / config does not support querying for a dynamic prefix."
#endif

View File

@ -280,9 +280,9 @@ static inline QStringList *resourceSearchPaths()
RCC tool used to compress the payload.
\value NoCompression Contents are not compressed
\value ZlibCompression Contents are compressed using \l{zlib}{https://zlib.net} and can
\value ZlibCompression Contents are compressed using \l{https://zlib.net}{zlib} and can
be decompressed using the qUncompress() function.
\value ZstdCompression Contents are compressed using \l{zstd}{https://zstd.net}. To
\value ZstdCompression Contents are compressed using \l{https://zstd.net}{zstd}. To
decompress, use the \c{ZSTD_decompress} function from the zstd
library.

View File

@ -1627,10 +1627,9 @@ bool QItemSelectionModel::rowIntersectsSelection(int row, const QModelIndex &par
QItemSelection sel = d->ranges;
sel.merge(d->currentSelection, d->currentCommand);
for (int i = 0; i < sel.count(); ++i) {
QItemSelectionRange range = sel.at(i);
for (const QItemSelectionRange &range : qAsConst(sel)) {
if (range.parent() != parent)
return false;
return false;
int top = range.top();
int bottom = range.bottom();
int left = range.left();
@ -1661,11 +1660,13 @@ bool QItemSelectionModel::columnIntersectsSelection(int column, const QModelInde
QItemSelection sel = d->ranges;
sel.merge(d->currentSelection, d->currentCommand);
for (int i = 0; i < sel.count(); ++i) {
int left = sel.at(i).left();
int right = sel.at(i).right();
int top = sel.at(i).top();
int bottom = sel.at(i).bottom();
for (const QItemSelectionRange &range : qAsConst(sel)) {
if (range.parent() != parent)
return false;
int top = range.top();
int bottom = range.bottom();
int left = range.left();
int right = range.right();
if (left <= column && right >= column) {
for (int j = top; j <= bottom; j++) {
const Qt::ItemFlags flags = d->model->index(j, column, parent).flags();

View File

@ -234,22 +234,26 @@
\sa QAtomicPointer
*/
/*! \fn QAtomicInt::QAtomicInt(int value)
/*!
\fn QAtomicInt::QAtomicInt(int value)
Constructs a QAtomicInt with the given \a value.
*/
/*! \fn QAtomicInteger<T>::QAtomicInteger(T value)
/*!
\fn template <typename T> QAtomicInteger<T>::QAtomicInteger(T value)
Constructs a QAtomicInteger with the given \a value.
*/
/*! \fn template <typename T> QAtomicInteger<T>::QAtomicInteger(const QAtomicInteger &other)
/*!
\fn template <typename T> QAtomicInteger<T>::QAtomicInteger(const QAtomicInteger &other)
Constructs a copy of \a other.
*/
/*! \fn template <typename T> QAtomicInteger &QAtomicInteger<T>::operator=(const QAtomicInteger &other)
/*!
\fn template <typename T> QAtomicInteger &QAtomicInteger<T>::operator=(const QAtomicInteger &other)
Assigns \a other to this QAtomicInteger and returns a reference to
this QAtomicInteger.
@ -344,19 +348,22 @@
\sa storeRelaxed(), storeRelease()
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::isReferenceCountingNative()
/*!
\fn template <typename T> bool QAtomicInteger<T>::isReferenceCountingNative()
Returns \c true if reference counting is implemented using atomic
processor instructions, false otherwise.
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::isReferenceCountingWaitFree()
/*!
\fn template <typename T> bool QAtomicInteger<T>::isReferenceCountingWaitFree()
Returns \c true if atomic reference counting is wait-free, false
otherwise.
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::ref()
/*!
\fn template <typename T> bool QAtomicInteger<T>::ref()
Atomically increments the value of this QAtomicInteger. Returns \c true
if the new value is non-zero, false otherwise.
@ -394,7 +401,8 @@
\sa ref(), operator++(), operator--(int)
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::deref()
/*!
\fn template <typename T> bool QAtomicInteger<T>::deref()
Atomically decrements the value of this QAtomicInteger. Returns \c true
if the new value is non-zero, false otherwise.
@ -432,18 +440,21 @@
\sa deref(), operator--(), operator++(int)
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::isTestAndSetNative()
/*!
\fn template <typename T> bool QAtomicInteger<T>::isTestAndSetNative()
Returns \c true if test-and-set is implemented using atomic processor
instructions, false otherwise.
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::isTestAndSetWaitFree()
/*!
\fn template <typename T> bool QAtomicInteger<T>::isTestAndSetWaitFree()
Returns \c true if atomic test-and-set is wait-free, false otherwise.
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::testAndSetRelaxed(T expectedValue, T newValue)
/*!
\fn template <typename T> bool QAtomicInteger<T>::testAndSetRelaxed(T expectedValue, T newValue)
Atomic test-and-set.
@ -457,7 +468,8 @@
processor to freely reorder memory accesses.
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::testAndSetAcquire(T expectedValue, T newValue)
/*!
\fn template <typename T> bool QAtomicInteger<T>::testAndSetAcquire(T expectedValue, T newValue)
Atomic test-and-set.
@ -472,7 +484,8 @@
be re-ordered before the atomic operation.
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::testAndSetRelease(T expectedValue, T newValue)
/*!
\fn template <typename T> bool QAtomicInteger<T>::testAndSetRelease(T expectedValue, T newValue)
Atomic test-and-set.
@ -487,7 +500,8 @@
re-ordered after the atomic operation.
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::testAndSetOrdered(T expectedValue, T newValue)
/*!
\fn template <typename T> bool QAtomicInteger<T>::testAndSetOrdered(T expectedValue, T newValue)
Atomic test-and-set.
@ -502,19 +516,22 @@
may not be re-ordered.
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::isFetchAndStoreNative()
/*!
\fn template <typename T> bool QAtomicInteger<T>::isFetchAndStoreNative()
Returns \c true if fetch-and-store is implemented using atomic
processor instructions, false otherwise.
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::isFetchAndStoreWaitFree()
/*!
\fn template <typename T> bool QAtomicInteger<T>::isFetchAndStoreWaitFree()
Returns \c true if atomic fetch-and-store is wait-free, false
otherwise.
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndStoreRelaxed(T newValue)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndStoreRelaxed(T newValue)
Atomic fetch-and-store.
@ -526,7 +543,8 @@
processor to freely reorder memory accesses.
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndStoreAcquire(T newValue)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndStoreAcquire(T newValue)
Atomic fetch-and-store.
@ -539,7 +557,8 @@
be re-ordered before the atomic operation.
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndStoreRelease(T newValue)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndStoreRelease(T newValue)
Atomic fetch-and-store.
@ -552,7 +571,8 @@
re-ordered after the atomic operation.
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndStoreOrdered(T newValue)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndStoreOrdered(T newValue)
Atomic fetch-and-store.
@ -565,19 +585,22 @@
may not be re-ordered.
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::isFetchAndAddNative()
/*!
\fn template <typename T> bool QAtomicInteger<T>::isFetchAndAddNative()
Returns \c true if fetch-and-add is implemented using atomic
processor instructions, false otherwise.
*/
/*! \fn template <typename T> bool QAtomicInteger<T>::isFetchAndAddWaitFree()
/*!
\fn template <typename T> bool QAtomicInteger<T>::isFetchAndAddWaitFree()
Returns \c true if atomic fetch-and-add is wait-free, false
otherwise.
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndAddRelaxed(T valueToAdd)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndAddRelaxed(T valueToAdd)
Atomic fetch-and-add.
@ -591,7 +614,8 @@
\sa operator+=(), fetchAndSubRelaxed()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndAddAcquire(T valueToAdd)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndAddAcquire(T valueToAdd)
Atomic fetch-and-add.
@ -606,7 +630,8 @@
\sa operator+=(), fetchAndSubAcquire()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndAddRelease(T valueToAdd)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndAddRelease(T valueToAdd)
Atomic fetch-and-add.
@ -621,7 +646,8 @@
\sa operator+=(), fetchAndSubRelease()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndAddOrdered(T valueToAdd)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndAddOrdered(T valueToAdd)
Atomic fetch-and-add.
@ -636,7 +662,8 @@
\sa operator+=(), fetchAndSubOrdered()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::operator+=(T value)
/*!
\fn template <typename T> T QAtomicInteger<T>::operator+=(T value)
\since 5.3
Atomic add-and-fetch.
@ -650,7 +677,8 @@
\sa fetchAndAddOrdered(), operator-=()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndSubRelaxed(T valueToSub)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndSubRelaxed(T valueToSub)
\since 5.3
Atomic fetch-and-sub.
@ -665,7 +693,8 @@
\sa operator-=(), fetchAndAddRelaxed()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndSubAcquire(T valueToSub)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndSubAcquire(T valueToSub)
\since 5.3
Atomic fetch-and-sub.
@ -681,7 +710,8 @@
\sa operator-=(), fetchAndAddAcquire()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndSubRelease(T valueToSub)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndSubRelease(T valueToSub)
\since 5.3
Atomic fetch-and-sub.
@ -697,7 +727,8 @@
\sa operator-=(), fetchAndAddRelease()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndSubOrdered(T valueToSub)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndSubOrdered(T valueToSub)
\since 5.3
Atomic fetch-and-sub.
@ -713,7 +744,8 @@
\sa operator-=(), fetchAndAddOrdered()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::operator-=(T value)
/*!
\fn template <typename T> T QAtomicInteger<T>::operator-=(T value)
\since 5.3
Atomic sub-and-fetch.
@ -727,7 +759,8 @@
\sa fetchAndSubOrdered(), operator+=()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndOrRelaxed(T valueToOr)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndOrRelaxed(T valueToOr)
\since 5.3
Atomic fetch-and-or.
@ -742,7 +775,8 @@
\sa operator|=()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndOrAcquire(T valueToOr)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndOrAcquire(T valueToOr)
\since 5.3
Atomic fetch-and-or.
@ -758,7 +792,8 @@
\sa operator|=()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndOrRelease(T valueToOr)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndOrRelease(T valueToOr)
\since 5.3
Atomic fetch-and-or.
@ -774,7 +809,8 @@
\sa operator|=()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndOrOrdered(T valueToOr)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndOrOrdered(T valueToOr)
\since 5.3
Atomic fetch-and-or.
@ -790,7 +826,8 @@
\sa operator|=()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::operator|=(T value)
/*!
\fn template <typename T> T QAtomicInteger<T>::operator|=(T value)
\since 5.3
Atomic or-and-fetch.
@ -804,7 +841,8 @@
\sa fetchAndOrOrdered()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndXorRelaxed(T valueToXor)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndXorRelaxed(T valueToXor)
\since 5.3
Atomic fetch-and-xor.
@ -819,7 +857,8 @@
\sa operator^=()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndXorAcquire(T valueToXor)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndXorAcquire(T valueToXor)
\since 5.3
Atomic fetch-and-xor.
@ -835,7 +874,8 @@
\sa operator^=()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndXorRelease(T valueToXor)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndXorRelease(T valueToXor)
\since 5.3
Atomic fetch-and-xor.
@ -851,7 +891,8 @@
\sa operator^=()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndXorOrdered(T valueToXor)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndXorOrdered(T valueToXor)
\since 5.3
Atomic fetch-and-xor.
@ -867,7 +908,8 @@
\sa operator^=()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::operator^=(T value)
/*!
\fn template <typename T> T QAtomicInteger<T>::operator^=(T value)
\since 5.3
Atomic xor-and-fetch.
@ -881,7 +923,8 @@
\sa fetchAndXorOrdered()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndAndRelaxed(T valueToAnd)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndAndRelaxed(T valueToAnd)
\since 5.3
Atomic fetch-and-and.
@ -896,7 +939,8 @@
\sa operator&=()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndAndAcquire(T valueToAnd)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndAndAcquire(T valueToAnd)
\since 5.3
Atomic fetch-and-and.
@ -912,7 +956,8 @@
\sa operator&=()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndAndRelease(T valueToAnd)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndAndRelease(T valueToAnd)
\since 5.3
Atomic fetch-and-and.
@ -928,7 +973,8 @@
\sa operator&=()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::fetchAndAndOrdered(T valueToAnd)
/*!
\fn template <typename T> T QAtomicInteger<T>::fetchAndAndOrdered(T valueToAnd)
\since 5.3
Atomic fetch-and-and.
@ -944,7 +990,8 @@
\sa operator&=()
*/
/*! \fn template <typename T> T QAtomicInteger<T>::operator&=(T value)
/*!
\fn template <typename T> T QAtomicInteger<T>::operator&=(T value)
\since 5.3
Atomic add-and-fetch.
@ -1287,17 +1334,20 @@
\sa QAtomicInteger
*/
/*! \fn template <typename T> QAtomicPointer<T>::QAtomicPointer(T *value)
/*!
\fn template <typename T> QAtomicPointer<T>::QAtomicPointer(T *value)
Constructs a QAtomicPointer with the given \a value.
*/
/*! \fn template <typename T> QAtomicPointer<T>::QAtomicPointer(const QAtomicPointer<T> &other)
/*!
\fn template <typename T> QAtomicPointer<T>::QAtomicPointer(const QAtomicPointer<T> &other)
Constructs a copy of \a other.
*/
/*! \fn template <typename T> QAtomicPointer &QAtomicPointer<T>::operator=(const QAtomicPointer &other)
/*!
\fn template <typename T> QAtomicPointer &QAtomicPointer<T>::operator=(const QAtomicPointer &other)
Assigns \a other to this QAtomicPointer and returns a reference to
this QAtomicPointer.
@ -1369,18 +1419,21 @@
\sa storeRelaxed(), loadRelaxed()
*/
/*! \fn template <typename T> bool QAtomicPointer<T>::isTestAndSetNative()
/*!
\fn template <typename T> bool QAtomicPointer<T>::isTestAndSetNative()
Returns \c true if test-and-set is implemented using atomic processor
instructions, false otherwise.
*/
/*! \fn template <typename T> bool QAtomicPointer<T>::isTestAndSetWaitFree()
/*!
\fn template <typename T> bool QAtomicPointer<T>::isTestAndSetWaitFree()
Returns \c true if atomic test-and-set is wait-free, false otherwise.
*/
/*! \fn template <typename T> bool QAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
/*!
\fn template <typename T> bool QAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
Atomic test-and-set.
@ -1394,7 +1447,8 @@
processor to freely reorder memory accesses.
*/
/*! \fn template <typename T> bool QAtomicPointer<T>::testAndSetAcquire(T *expectedValue, T *newValue)
/*!
\fn template <typename T> bool QAtomicPointer<T>::testAndSetAcquire(T *expectedValue, T *newValue)
Atomic test-and-set.
@ -1409,7 +1463,8 @@
be re-ordered before the atomic operation.
*/
/*! \fn template <typename T> bool QAtomicPointer<T>::testAndSetRelease(T *expectedValue, T *newValue)
/*!
\fn template <typename T> bool QAtomicPointer<T>::testAndSetRelease(T *expectedValue, T *newValue)
Atomic test-and-set.
@ -1424,7 +1479,8 @@
re-ordered after the atomic operation.
*/
/*! \fn template <typename T> bool QAtomicPointer<T>::testAndSetOrdered(T *expectedValue, T *newValue)
/*!
\fn template <typename T> bool QAtomicPointer<T>::testAndSetOrdered(T *expectedValue, T *newValue)
Atomic test-and-set.
@ -1439,19 +1495,22 @@
may not be re-ordered.
*/
/*! \fn template <typename T> bool QAtomicPointer<T>::isFetchAndStoreNative()
/*!
\fn template <typename T> bool QAtomicPointer<T>::isFetchAndStoreNative()
Returns \c true if fetch-and-store is implemented using atomic
processor instructions, false otherwise.
*/
/*! \fn template <typename T> bool QAtomicPointer<T>::isFetchAndStoreWaitFree()
/*!
\fn template <typename T> bool QAtomicPointer<T>::isFetchAndStoreWaitFree()
Returns \c true if atomic fetch-and-store is wait-free, false
otherwise.
*/
/*! \fn template <typename T> T *QAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
/*!
\fn template <typename T> T *QAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
Atomic fetch-and-store.
@ -1463,7 +1522,8 @@
processor to freely reorder memory accesses.
*/
/*! \fn template <typename T> T *QAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
/*!
\fn template <typename T> T *QAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
Atomic fetch-and-store.
@ -1476,7 +1536,8 @@
be re-ordered before the atomic operation.
*/
/*! \fn template <typename T> T *QAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
/*!
\fn template <typename T> T *QAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
Atomic fetch-and-store.
@ -1489,7 +1550,8 @@
re-ordered after the atomic operation.
*/
/*! \fn template <typename T> T *QAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
/*!
\fn template <typename T> T *QAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
Atomic fetch-and-store.
@ -1502,19 +1564,22 @@
may not be re-ordered.
*/
/*! \fn template <typename T> bool QAtomicPointer<T>::isFetchAndAddNative()
/*!
\fn template <typename T> bool QAtomicPointer<T>::isFetchAndAddNative()
Returns \c true if fetch-and-add is implemented using atomic
processor instructions, false otherwise.
*/
/*! \fn template <typename T> bool QAtomicPointer<T>::isFetchAndAddWaitFree()
/*!
\fn template <typename T> bool QAtomicPointer<T>::isFetchAndAddWaitFree()
Returns \c true if atomic fetch-and-add is wait-free, false
otherwise.
*/
/*! \fn template <typename T> T *QAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueToAdd)
/*!
\fn template <typename T> T *QAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueToAdd)
Atomic fetch-and-add.
@ -1526,7 +1591,8 @@
processor to freely reorder memory accesses.
*/
/*! \fn template <typename T> T *QAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueToAdd)
/*!
\fn template <typename T> T *QAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueToAdd)
Atomic fetch-and-add.
@ -1539,7 +1605,8 @@
be re-ordered before the atomic operation.
*/
/*! \fn template <typename T> T *QAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueToAdd)
/*!
\fn template <typename T> T *QAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueToAdd)
Atomic fetch-and-add.
@ -1552,7 +1619,8 @@
re-ordered after the atomic operation.
*/
/*! \fn template <typename T> T *QAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueToAdd)
/*!
\fn template <typename T> T *QAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueToAdd)
Atomic fetch-and-add.

View File

@ -50,6 +50,10 @@ QT_BEGIN_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wextra")
#ifdef Q_CLANG_QDOC
# undef QT_BASIC_ATOMIC_HAS_CONSTRUCTORS
#endif
// High-level atomic integer operations
template <typename T>
class QAtomicInteger : public QBasicAtomicInteger<T>
@ -194,7 +198,9 @@ public:
#ifdef Q_QDOC
T *load() const;
T *loadAcquire() const;
T *loadRelaxed() const;
void store(T *newValue);
void storeRelaxed(T *newValue);
void storeRelease(T *newValue);
static Q_DECL_CONSTEXPR bool isTestAndSetNative();

View File

@ -100,7 +100,7 @@ struct Registry {
if (id == QCalendar::System::User) {
byId.push_back(calendar);
} else {
Q_ASSERT(byId.at(size_t(id)) == nullptr);
Q_ASSERT(byId[size_t(id)] == nullptr);
byId[size_t(id)] = calendar;
}
if (id == QCalendar::System::Gregorian) {
@ -618,7 +618,7 @@ const QCalendarBackend *QCalendarBackend::fromEnum(QCalendar::System system)
if (calendarRegistry.isDestroyed() || system == QCalendar::System::User)
return nullptr;
Q_ASSERT(calendarRegistry->byId.size() >= size_t(system));
if (auto *c = calendarRegistry->byId.at(size_t(system)))
if (auto *c = calendarRegistry->byId[size_t(system)])
return c;
switch (system) {
case QCalendar::System::Gregorian:

View File

@ -373,6 +373,7 @@
},
"headers": "jpeglib.h",
"sources": [
{ "type": "pkgConfig", "args": "libjpeg" },
{ "libs": "-llibjpeg", "condition": "config.msvc" },
"-ljpeg"
]

View File

@ -62,7 +62,7 @@
\include module-use.qdocinc using qt module
\quotefile overview/using-qt-gui.cmake
See also the \l[QtDoc]{Building with CMake} overview.
See also the \l[QtDoc]{Build with CMake} overview.
\section2 Building with qmake

View File

@ -1344,7 +1344,7 @@ Qt::WindowStates QWindow::windowStates() const
This is a hint to the window manager that this window is a dialog or pop-up
on behalf of the transient parent.
In order to cause the window to be centered above its transient parent by
In order to cause the window to be centered above its transient \a parent by
default, depending on the window manager, it may also be necessary to call
setFlags() with a suitable \l Qt::WindowType (such as \c Qt::Dialog).

View File

@ -54,7 +54,7 @@
// GLES build without having included gl32.h -> GLDEBUGPROC is still need for the protos, define it here
#if defined(QT_OPENGL_ES_2) && !defined(QT_OPENGL_ES_3_2)
typedef void (QOPENGLF_APIENTRYP *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
typedef void (QOPENGLF_APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
#endif
QT_BEGIN_NAMESPACE

View File

@ -1543,7 +1543,7 @@ bool QSslSocket::addDefaultCaCertificates(const QString &path, QSsl::EncodingFor
SSL socket's CA certificate database is initialized to the default
CA certificate database.
\sa QSslConfiguration::caCertificates(), QSslConfiguration::addCaCertificates()
\sa QSslConfiguration::addCaCertificates()
*/
void QSslSocket::addDefaultCaCertificate(const QSslCertificate &certificate)
{

View File

@ -72,9 +72,10 @@ static inline QString prefixedPath(QString path)
struct AssetItem {
enum class Type {
File,
Folder
Folder,
Invalid
};
AssetItem() = default;
AssetItem (const QString &rawName)
: name(rawName)
{
@ -92,21 +93,47 @@ using AssetItemList = QVector<AssetItem>;
class FolderIterator : public AssetItemList
{
public:
static QSharedPointer<FolderIterator> fromCache(const QString &path)
static QSharedPointer<FolderIterator> fromCache(const QString &path, bool clone)
{
QMutexLocker lock(&m_assetsCacheMutex);
QSharedPointer<FolderIterator> *folder = m_assetsCache.object(path);
if (!folder) {
folder = new QSharedPointer<FolderIterator>{new FolderIterator{path}};
if (!m_assetsCache.insert(path, folder)) {
if ((*folder)->empty() || !m_assetsCache.insert(path, folder)) {
QSharedPointer<FolderIterator> res = *folder;
delete folder;
return res;
}
}
return *folder;
return clone ? QSharedPointer<FolderIterator>{new FolderIterator{*(*folder)}} : *folder;
}
static AssetItem::Type fileType(const QString &filePath)
{
const QStringList paths = filePath.split(QLatin1Char('/'));
QString fullPath;
AssetItem::Type res = AssetItem::Type::Invalid;
for (const auto &path: paths) {
auto folder = fromCache(fullPath, false);
auto it = std::lower_bound(folder->begin(), folder->end(), AssetItem{path}, [](const AssetItem &val, const AssetItem &assetItem) {
return val.name < assetItem.name;
});
if (it == folder->end() || it->name != path)
return AssetItem::Type::Invalid;
if (!fullPath.isEmpty())
fullPath.append(QLatin1Char('/'));
fullPath += path;
res = it->type;
}
return res;
}
FolderIterator(const FolderIterator &other)
: AssetItemList(other)
, m_index(-1)
, m_path(other.m_path)
{}
FolderIterator(const QString &path)
: m_path(path)
{
@ -118,8 +145,12 @@ public:
QJNIEnvironmentPrivate env;
jobjectArray jFiles = static_cast<jobjectArray>(files.object());
const jint nFiles = env->GetArrayLength(jFiles);
for (int i = 0; i < nFiles; ++i)
push_back({QJNIObjectPrivate(env->GetObjectArrayElement(jFiles, i)).toString()});
for (int i = 0; i < nFiles; ++i) {
AssetItem item{QJNIObjectPrivate(env->GetObjectArrayElement(jFiles, i)).toString()};
insert(std::upper_bound(begin(), end(), item, [](const auto &a, const auto &b){
return a.name < b.name;
}), item);
}
}
m_path = assetsPrefix + QLatin1Char('/') + m_path + QLatin1Char('/');
m_path.replace(QLatin1String("//"), QLatin1String("/"));
@ -169,7 +200,7 @@ public:
const QString &path)
: QAbstractFileEngineIterator(filters, nameFilters)
{
m_stack.push_back(FolderIterator::fromCache(cleanedAssetPath(path)));
m_stack.push_back(FolderIterator::fromCache(cleanedAssetPath(path), true));
if (m_stack.last()->empty())
m_stack.pop_back();
}
@ -215,7 +246,7 @@ public:
if (!res)
return {};
if (res->second.type == AssetItem::Type::Folder) {
m_stack.push_back(FolderIterator::fromCache(cleanedAssetPath(currentFilePath())));
m_stack.push_back(FolderIterator::fromCache(cleanedAssetPath(currentFilePath()), true));
if (m_stack.last()->empty())
m_stack.pop_back();
}
@ -257,6 +288,7 @@ public:
m_assetFile = 0;
return true;
}
m_isFolder = false;
return false;
}
@ -305,12 +337,12 @@ public:
FileFlags fileFlags(FileFlags type = FileInfoAll) const override
{
FileFlags flags(ReadOwnerPerm|ReadUserPerm|ReadGroupPerm|ReadOtherPerm|ExistsFlag);
FileFlags commonFlags(ReadOwnerPerm|ReadUserPerm|ReadGroupPerm|ReadOtherPerm|ExistsFlag);
FileFlags flags;
if (m_assetFile)
flags |= FileType;
flags = FileType | commonFlags;
else if (m_isFolder)
flags |= DirectoryType;
flags = DirectoryType | commonFlags;
return type & flags;
}
@ -341,9 +373,20 @@ public:
void setFileName(const QString &file) override
{
if (m_fileName == cleanedAssetPath(file))
return;
close();
m_fileName = cleanedAssetPath(file);
m_isFolder = !open(QIODevice::ReadOnly) && !FolderIterator::fromCache(m_fileName)->empty();
switch (FolderIterator::fileType(m_fileName)) {
case AssetItem::Type::File:
open(QIODevice::ReadOnly);
break;
case AssetItem::Type::Folder:
m_isFolder = true;
break;
case AssetItem::Type::Invalid:
break;
}
}
Iterator *beginEntryList(QDir::Filters filters, const QStringList &filterNames) override
@ -355,9 +398,9 @@ public:
private:
AAsset *m_assetFile = nullptr;
AAssetManager *m_assetManager;
AAssetManager *m_assetManager = nullptr;
QString m_fileName;
bool m_isFolder;
bool m_isFolder = false;
};

View File

@ -53,9 +53,6 @@ class QCocoaIntegration;
class QCocoaScreen : public QPlatformScreen
{
public:
static void initializeScreens();
static void cleanupScreens();
~QCocoaScreen();
// ----------------------------------------------------
@ -79,7 +76,6 @@ public:
// ----------------------------------------------------
NSScreen *nativeScreen() const;
void updateProperties();
void requestUpdate();
void deliverUpdateRequests();
@ -88,6 +84,7 @@ public:
static QCocoaScreen *primaryScreen();
static QCocoaScreen *get(NSScreen *nsScreen);
static QCocoaScreen *get(CGDirectDisplayID displayId);
static QCocoaScreen *get(CFUUIDRef uuid);
static CGPoint mapToNative(const QPointF &pos, QCocoaScreen *screen = QCocoaScreen::primaryScreen());
static CGRect mapToNative(const QRectF &rect, QCocoaScreen *screen = QCocoaScreen::primaryScreen());
@ -95,11 +92,23 @@ public:
static QRectF mapFromNative(CGRect rect, QCocoaScreen *screen = QCocoaScreen::primaryScreen());
private:
QCocoaScreen(CGDirectDisplayID displayId);
static void initializeScreens();
static void updateScreens();
static void cleanupScreens();
static bool updateScreensIfNeeded();
static NSArray *s_screenConfigurationBeforeUpdate;
static void add(CGDirectDisplayID displayId);
QCocoaScreen(CGDirectDisplayID displayId);
void update(CGDirectDisplayID displayId);
void remove();
bool isOnline() const;
bool isMirroring() const;
CGDirectDisplayID m_displayId = kCGNullDirectDisplay;
CGDirectDisplayID displayId() const { return m_displayId; }
QRect m_geometry;
QRect m_availableGeometry;
@ -116,6 +125,8 @@ private:
dispatch_source_t m_displayLinkSource = nullptr;
QAtomicInt m_pendingUpdates;
friend class QCocoaIntegration;
friend class QCocoaWindow;
friend QDebug operator<<(QDebug debug, const QCocoaScreen *screen);
};

View File

@ -57,6 +57,7 @@ QT_BEGIN_NAMESPACE
namespace CoreGraphics {
Q_NAMESPACE
enum DisplayChange {
ReconfiguredWithFlagsMissing = 0,
Moved = kCGDisplayMovedFlag,
SetMain = kCGDisplaySetMainFlag,
SetMode = kCGDisplaySetModeFlag,
@ -71,73 +72,165 @@ namespace CoreGraphics {
Q_ENUM_NS(DisplayChange)
}
NSArray *QCocoaScreen::s_screenConfigurationBeforeUpdate = nil;
void QCocoaScreen::initializeScreens()
{
uint32_t displayCount = 0;
if (CGGetActiveDisplayList(0, nullptr, &displayCount) != kCGErrorSuccess)
qFatal("Failed to get number of active displays");
CGDirectDisplayID activeDisplays[displayCount];
if (CGGetActiveDisplayList(displayCount, &activeDisplays[0], &displayCount) != kCGErrorSuccess)
qFatal("Failed to get active displays");
for (CGDirectDisplayID displayId : activeDisplays)
QCocoaScreen::add(displayId);
updateScreens();
CGDisplayRegisterReconfigurationCallback([](CGDirectDisplayID displayId, CGDisplayChangeSummaryFlags flags, void *userInfo) {
if (flags & kCGDisplayBeginConfigurationFlag)
return; // Wait for changes to apply
Q_UNUSED(userInfo);
qCDebug(lcQpaScreen).verbosity(0).nospace() << "Display reconfiguration"
<< " (" << QFlags<CoreGraphics::DisplayChange>(flags) << ")"
<< " for displayId=" << displayId;
// Displays are reconfigured in batches, and we want to update our screens
// once a batch ends, so that all the states of the displays are up to date.
static int displayReconfigurationsInProgress = 0;
QCocoaScreen *cocoaScreen = QCocoaScreen::get(displayId);
const bool beforeReconfigure = flags & kCGDisplayBeginConfigurationFlag;
qCDebug(lcQpaScreen).verbosity(0).nospace() << "Display " << displayId
<< (beforeReconfigure ? " about to reconfigure" : " was ")
<< QFlags<CoreGraphics::DisplayChange>(flags)
<< " with " << displayReconfigurationsInProgress
<< " display configuration(s) in progress";
if ((flags & kCGDisplayAddFlag) || !cocoaScreen) {
if (!CGDisplayIsActive(displayId)) {
qCDebug(lcQpaScreen) << "Not adding inactive display" << displayId;
return; // Will be added when activated
if (!flags) {
// CGDisplayRegisterReconfigurationCallback has been observed to be called
// with flags unset. This seems like a bug. The callback is not paired with
// a matching "completion" callback either, so we don't know whether to treat
// it as a begin or end of reconfigure.
return;
}
if (beforeReconfigure) {
if (!displayReconfigurationsInProgress++) {
// There might have been a screen reconfigure before this that
// we didn't process yet, so do that now if that's the case.
updateScreensIfNeeded();
Q_ASSERT(!s_screenConfigurationBeforeUpdate);
s_screenConfigurationBeforeUpdate = NSScreen.screens;
qCDebug(lcQpaScreen, "Display reconfigure transaction started"
" with screen configuration %p", s_screenConfigurationBeforeUpdate);
static void (^tryScreenUpdate)();
tryScreenUpdate = ^void () {
qCDebug(lcQpaScreen) << "Attempting screen update from runloop block";
if (!updateScreensIfNeeded())
CFRunLoopPerformBlock(CFRunLoopGetMain(), kCFRunLoopCommonModes, tryScreenUpdate);
};
CFRunLoopPerformBlock(CFRunLoopGetMain(), kCFRunLoopCommonModes, tryScreenUpdate);
}
QCocoaScreen::add(displayId);
} else if ((flags & kCGDisplayRemoveFlag) || !CGDisplayIsActive(displayId)) {
cocoaScreen->remove();
} else {
// Detect changes to the primary screen immediately, instead of
// waiting for a display reconfigure with kCGDisplaySetMainFlag.
// This ensures that any property updates to the other screens
// will be in reference to the correct primary screen.
QCocoaScreen *mainDisplay = QCocoaScreen::get(CGMainDisplayID());
if (QGuiApplication::primaryScreen()->handle() != mainDisplay) {
mainDisplay->updateProperties();
qCInfo(lcQpaScreen) << "Primary screen changed to" << mainDisplay;
QWindowSystemInterface::handlePrimaryScreenChanged(mainDisplay);
if (cocoaScreen == mainDisplay)
return; // Already reconfigured
}
Q_ASSERT_X(displayReconfigurationsInProgress, "QCococaScreen",
"Display configuration transactions are expected to be balanced");
cocoaScreen->updateProperties();
qCInfo(lcQpaScreen).nospace() << "Reconfigured " <<
(primaryScreen() == cocoaScreen ? "primary " : "")
<< cocoaScreen;
if (!--displayReconfigurationsInProgress) {
qCDebug(lcQpaScreen) << "Display reconfigure transaction completed";
// We optimistically update now, in case the NSScreens have changed
updateScreensIfNeeded();
}
}
}, nullptr);
static QMacNotificationObserver screenParameterObserver(NSApplication.sharedApplication,
NSApplicationDidChangeScreenParametersNotification, [&]() {
qCDebug(lcQpaScreen) << "Received screen parameter change notification";
updateScreensIfNeeded(); // As a last resort we update screens here
});
}
bool QCocoaScreen::updateScreensIfNeeded()
{
if (!s_screenConfigurationBeforeUpdate) {
qCDebug(lcQpaScreen) << "QScreens have already been updated, all good";
return true;
}
if (s_screenConfigurationBeforeUpdate == NSScreen.screens) {
qCDebug(lcQpaScreen) << "Still waiting for NSScreen configuration change";
return false;
}
qCDebug(lcQpaScreen, "NSScreen configuration changed to %p", NSScreen.screens);
updateScreens();
s_screenConfigurationBeforeUpdate = nil;
return true;
}
/*
Update the list of available QScreens, and the properties of existing screens.
At this point we rely on the NSScreen.screens to be up to date.
*/
void QCocoaScreen::updateScreens()
{
uint32_t displayCount = 0;
if (CGGetOnlineDisplayList(0, nullptr, &displayCount) != kCGErrorSuccess)
qFatal("Failed to get number of online displays");
QVector<CGDirectDisplayID> onlineDisplays(displayCount);
if (CGGetOnlineDisplayList(displayCount, onlineDisplays.data(), &displayCount) != kCGErrorSuccess)
qFatal("Failed to get online displays");
qCInfo(lcQpaScreen) << "Updating screens with" << displayCount
<< "online displays:" << onlineDisplays;
// TODO: Verify whether we can always assume the main display is first
int mainDisplayIndex = onlineDisplays.indexOf(CGMainDisplayID());
if (mainDisplayIndex < 0) {
qCWarning(lcQpaScreen) << "Main display not in list of online displays!";
} else if (mainDisplayIndex > 0) {
qCWarning(lcQpaScreen) << "Main display not first display, making sure it is";
onlineDisplays.move(mainDisplayIndex, 0);
}
for (CGDirectDisplayID displayId : onlineDisplays) {
Q_ASSERT(CGDisplayIsOnline(displayId));
if (CGDisplayMirrorsDisplay(displayId))
continue;
// A single physical screen can map to multiple displays IDs,
// depending on which GPU is in use or which physical port the
// screen is connected to. By mapping the display ID to a UUID,
// which are shared between displays that target the same screen,
// we can pick an existing QScreen to update instead of needlessly
// adding and removing QScreens.
QCFType<CFUUIDRef> uuid = CGDisplayCreateUUIDFromDisplayID(displayId);
Q_ASSERT(uuid);
if (QCocoaScreen *existingScreen = QCocoaScreen::get(uuid)) {
existingScreen->update(displayId);
qCInfo(lcQpaScreen) << "Updated" << existingScreen;
if (CGDisplayIsMain(displayId) && existingScreen != qGuiApp->primaryScreen()->handle()) {
qCInfo(lcQpaScreen) << "Primary screen changed to" << existingScreen;
QWindowSystemInterface::handlePrimaryScreenChanged(existingScreen);
}
} else {
QCocoaScreen::add(displayId);
}
}
for (QScreen *screen : QGuiApplication::screens()) {
QCocoaScreen *platformScreen = static_cast<QCocoaScreen*>(screen->handle());
if (!platformScreen->isOnline() || platformScreen->isMirroring())
platformScreen->remove();
}
}
void QCocoaScreen::add(CGDirectDisplayID displayId)
{
const bool isPrimary = CGDisplayIsMain(displayId);
QCocoaScreen *cocoaScreen = new QCocoaScreen(displayId);
qCInfo(lcQpaScreen).nospace() << "Adding " << (isPrimary ? "new primary " : "") << cocoaScreen;
qCInfo(lcQpaScreen) << "Adding" << cocoaScreen
<< (isPrimary ? "as new primary screen" : "");
QWindowSystemInterface::handleScreenAdded(cocoaScreen, isPrimary);
}
QCocoaScreen::QCocoaScreen(CGDirectDisplayID displayId)
: QPlatformScreen(), m_displayId(displayId)
{
updateProperties();
update(m_displayId);
m_cursor = new QCocoaCursor;
}
@ -150,8 +243,6 @@ void QCocoaScreen::cleanupScreens()
void QCocoaScreen::remove()
{
m_displayId = kCGNullDirectDisplay; // Prevent stale references during removal
// This may result in the application responding to QGuiApplication::screenRemoved
// by moving the window to another screen, either by setGeometry, or by setScreen.
// If the window isn't moved by the application, Qt will as a fallback move it to
@ -163,7 +254,7 @@ void QCocoaScreen::remove()
// QCocoaWindow::windowDidChangeScreen. At that point the window will appear to have
// already changed its screen, but that's only true if comparing the Qt screens,
// not when comparing the NSScreens.
qCInfo(lcQpaScreen).nospace() << "Removing " << (primaryScreen() == this ? "current primary " : "") << this;
qCInfo(lcQpaScreen) << "Removing " << this;
QWindowSystemInterface::handleScreenRemoved(this);
}
@ -210,9 +301,14 @@ static QString displayName(CGDirectDisplayID displayID)
return QString();
}
void QCocoaScreen::updateProperties()
void QCocoaScreen::update(CGDirectDisplayID displayId)
{
Q_ASSERT(m_displayId);
if (displayId != m_displayId) {
qCDebug(lcQpaScreen) << "Reconnecting" << this << "as display" << displayId;
m_displayId = displayId;
}
Q_ASSERT(isOnline());
const QRect previousGeometry = m_geometry;
const QRect previousAvailableGeometry = m_availableGeometry;
@ -350,8 +446,8 @@ struct DeferredDebugHelper
void QCocoaScreen::deliverUpdateRequests()
{
if (!m_displayId)
return; // Screen removed
if (!isOnline())
return;
QMacAutoReleasePool pool;
@ -562,6 +658,29 @@ QPixmap QCocoaScreen::grabWindow(WId view, int x, int y, int width, int height)
return windowPixmap;
}
bool QCocoaScreen::isOnline() const
{
// When a display is disconnected CGDisplayIsOnline and other CGDisplay
// functions that take a displayId will not return false, but will start
// returning -1 to signal that the displayId is invalid. Some functions
// will also assert or even crash in this case, so it's important that
// we double check if a display is online before calling other functions.
auto isOnline = CGDisplayIsOnline(m_displayId);
static const uint32_t kCGDisplayIsDisconnected = int32_t(-1);
return isOnline != kCGDisplayIsDisconnected && isOnline;
}
/*
Returns true if a screen is mirroring another screen
*/
bool QCocoaScreen::isMirroring() const
{
if (!isOnline())
return false;
return CGDisplayMirrorsDisplay(m_displayId);
}
/*!
The screen used as a reference for global window geometry
*/
@ -586,6 +705,12 @@ QList<QPlatformScreen*> QCocoaScreen::virtualSiblings() const
QCocoaScreen *QCocoaScreen::get(NSScreen *nsScreen)
{
if (s_screenConfigurationBeforeUpdate) {
qCWarning(lcQpaScreen) << "Trying to resolve screen while waiting for screen reconfigure!";
if (!updateScreensIfNeeded())
qCWarning(lcQpaScreen) << "Failed to do last minute screen update. Expect crashes.";
}
return get(nsScreen.qt_displayId);
}
@ -600,23 +725,34 @@ QCocoaScreen *QCocoaScreen::get(CGDirectDisplayID displayId)
return nullptr;
}
QCocoaScreen *QCocoaScreen::get(CFUUIDRef uuid)
{
for (QScreen *screen : QGuiApplication::screens()) {
auto *platformScreen = static_cast<QCocoaScreen*>(screen->handle());
if (!platformScreen->isOnline())
continue;
auto displayId = platformScreen->displayId();
QCFType<CFUUIDRef> candidateUuid(CGDisplayCreateUUIDFromDisplayID(displayId));
Q_ASSERT(candidateUuid);
if (candidateUuid == uuid)
return platformScreen;
}
return nullptr;
}
NSScreen *QCocoaScreen::nativeScreen() const
{
if (!m_displayId)
return nil; // The display has been disconnected
// A single display may have different displayIds depending on
// which GPU is in use or which physical port the display is
// connected to. By comparing UUIDs instead of display IDs we
// ensure that we always pick up the appropriate NSScreen.
QCFType<CFUUIDRef> uuid = CGDisplayCreateUUIDFromDisplayID(m_displayId);
for (NSScreen *screen in [NSScreen screens]) {
if (QCFType<CFUUIDRef>(CGDisplayCreateUUIDFromDisplayID(screen.qt_displayId)) == uuid)
for (NSScreen *screen in NSScreen.screens) {
if (screen.qt_displayId == m_displayId)
return screen;
}
qCWarning(lcQpaScreen) << "Could not find NSScreen for display ID" << m_displayId;
return nil;
}
@ -651,11 +787,21 @@ QDebug operator<<(QDebug debug, const QCocoaScreen *screen)
debug.nospace();
debug << "QCocoaScreen(" << (const void *)screen;
if (screen) {
debug << ", geometry=" << screen->geometry();
debug << ", " << screen->name();
if (screen->isOnline()) {
if (CGDisplayIsAsleep(screen->displayId()))
debug << ", Sleeping";
if (auto mirroring = CGDisplayMirrorsDisplay(screen->displayId()))
debug << ", mirroring=" << mirroring;
} else {
debug << ", Offline";
}
debug << ", " << screen->geometry();
debug << ", dpr=" << screen->devicePixelRatio();
debug << ", name=" << screen->name();
debug << ", displayId=" << screen->m_displayId;
debug << ", native=" << screen->nativeScreen();
debug << ", displayId=" << screen->displayId();
if (auto nativeScreen = screen->nativeScreen())
debug << ", " << nativeScreen;
}
debug << ')';
return debug;

View File

@ -171,7 +171,8 @@
\section3 How to Build the QMYSQL Plugin on Windows
You need to get the MySQL installation files (e.g.
\e{mysql-installer-web-community-8.0.18.0.msi}). Run the installer,
\l {https://dev.mysql.com/downloads/installer/}{mysql-installer-web-community-8.0.18.0.msi}).
Run the installer,
select custom installation and install the MySQL C Connector
which matches your Qt installation (x86 or x64).
After installation make sure that the needed files are there:
@ -192,9 +193,9 @@
When you distribute your application, remember to include libmysql.dll
in your installation package. It must be placed in the same folder
as the application executable. libmysql.dll additionally needs the
as the application executable. \e libmysql.dll additionally needs the
MSVC runtime libraries which can be installed with vcredist.exe
(\l {https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads}(vcredist.exe)
(\l {https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads}{vcredist.exe}
\target QOCI
\section2 QOCI for the Oracle Call Interface (OCI)
@ -356,10 +357,6 @@
Windows NT based systems, this is the default. Note that the ODBC
driver and the DBMS must also support Unicode.
Some driver managers and drivers do not support UNICODE. To use the
QODBC plugin with such drivers, it has to be compiled with
Q_ODBC_VERSION_2 defined.
For the Oracle 9 ODBC driver (Windows), it is necessary to check
"SQL_WCHAR support" in the ODBC driver manager otherwise Oracle
will convert all Unicode strings to local 8-bit.

View File

@ -278,8 +278,8 @@
\section2 Avoid Fixed Timeouts
Avoid using hard-coded timeouts, such as QTest::qWait() to wait for some
conditions to become true. Consider using the \l QtSignalSpy class,
the \l QTRY_VERIFY() or \l QTRY_COMPARE() macros, or the \c QtSignalSpy
conditions to become true. Consider using the \l QSignalSpy class,
the \l QTRY_VERIFY() or \l QTRY_COMPARE() macros, or the \c QSignalSpy
class in conjunction with the \c QTRY_ macro variants.
The \c qWait() function can be used to set a delay for a fixed period

View File

@ -142,16 +142,19 @@ QApplicationPrivate *QApplicationPrivate::self = nullptr;
static void initSystemPalette()
{
if (!QApplicationPrivate::sys_pal) {
QPalette defaultPlatte;
if (QApplicationPrivate::app_style)
defaultPlatte = QApplicationPrivate::app_style->standardPalette();
if (const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette()) {
QApplicationPrivate::setSystemPalette(themePalette->resolve(defaultPlatte));
QApplicationPrivate::initializeWidgetPaletteHash();
} else {
QApplicationPrivate::setSystemPalette(defaultPlatte);
}
if (QApplicationPrivate::sys_pal)
return; // Already initialized
QPalette defaultPalette;
if (QApplicationPrivate::app_style)
defaultPalette = QApplicationPrivate::app_style->standardPalette();
auto *platformTheme = QGuiApplicationPrivate::platformTheme();
if (const QPalette *themePalette = platformTheme ? platformTheme->palette() : nullptr) {
QApplicationPrivate::setSystemPalette(themePalette->resolve(defaultPalette));
QApplicationPrivate::initializeWidgetPaletteHash();
} else {
QApplicationPrivate::setSystemPalette(defaultPalette);
}
}
@ -379,7 +382,6 @@ QString QApplicationPrivate::styleSheet; // default application styles
QPointer<QWidget> QApplicationPrivate::leaveAfterRelease = nullptr;
QPalette *QApplicationPrivate::sys_pal = nullptr; // default system palette
QPalette *QApplicationPrivate::set_pal = nullptr; // default palette set by programmer
QFont *QApplicationPrivate::sys_font = nullptr; // default system font
QFont *QApplicationPrivate::set_font = nullptr; // default font set by programmer
@ -431,13 +433,6 @@ void QApplicationPrivate::process_cmdline()
if (styleOverride.isEmpty() && qEnvironmentVariableIsSet("QT_STYLE_OVERRIDE"))
styleOverride = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE"));
if (!styleOverride.isEmpty()) {
if (app_style) {
delete app_style;
app_style = nullptr;
}
}
// process platform-indep command line
if (!qt_is_gui_used || !argc)
return;
@ -552,6 +547,12 @@ void QApplicationPrivate::init()
// Must be called before initialize()
QColormap::initialize();
if (sys_pal) {
// Now that we have a platform theme we need to reset
// the system palette to pick up the theme colors.
clearSystemPalette();
initSystemPalette();
}
qt_init_tooltip_palette();
QApplicationPrivate::initializeWidgetFontHash();
@ -597,8 +598,20 @@ void QApplicationPrivate::initialize()
// needed for widgets in QML
QAbstractDeclarativeData::setWidgetParent = QWidgetPrivate::setWidgetParentHelper;
if (application_type != QApplicationPrivate::Tty)
(void) QApplication::style(); // trigger creation of application style
if (application_type != QApplicationPrivate::Tty) {
if (!styleOverride.isEmpty()) {
if (auto *style = QStyleFactory::create(styleOverride.toLower())) {
QApplication::setStyle(style);
} else {
qWarning("QApplication: invalid style override '%s' passed, ignoring it.\n"
"\tAvailable styles: %s", qPrintable(styleOverride),
qPrintable(QStyleFactory::keys().join(QLatin1String(", "))));
}
}
// Trigger default style if none was set already
Q_UNUSED(QApplication::style());
}
#if QT_CONFIG(statemachine)
// trigger registering of QStateMachine's GUI types
qRegisterGuiStateMachine();
@ -789,8 +802,6 @@ QApplication::~QApplication()
delete QApplicationPrivate::app_pal;
QApplicationPrivate::app_pal = nullptr;
clearSystemPalette();
delete QApplicationPrivate::set_pal;
QApplicationPrivate::set_pal = nullptr;
app_palettes()->clear();
delete QApplicationPrivate::sys_font;
@ -1016,55 +1027,45 @@ void QApplication::setStyleSheet(const QString& styleSheet)
*/
QStyle *QApplication::style()
{
if (QApplicationPrivate::app_style)
return QApplicationPrivate::app_style;
if (!qobject_cast<QApplication *>(QCoreApplication::instance())) {
Q_ASSERT(!"No style available without QApplication!");
return nullptr;
}
if (!QApplicationPrivate::app_style) {
// Compile-time search for default style
//
QStyle *&app_style = QApplicationPrivate::app_style;
if (!QApplicationPrivate::styleOverride.isEmpty()) {
const QString style = QApplicationPrivate::styleOverride.toLower();
app_style = QStyleFactory::create(style);
if (Q_UNLIKELY(!app_style)) {
qWarning("QApplication: invalid style override passed, ignoring it.\n"
" Available styles: %s", qPrintable(QStyleFactory::keys().join(QLatin1String(", "))));
}
// Create default style
if (!qobject_cast<QApplication *>(QCoreApplication::instance())) {
Q_ASSERT(!"No style available without QApplication!");
return nullptr;
}
if (!app_style)
app_style = QStyleFactory::create(QApplicationPrivate::desktopStyleKey());
if (!app_style) {
auto &defaultStyle = QApplicationPrivate::app_style;
defaultStyle = QStyleFactory::create(QApplicationPrivate::desktopStyleKey());
if (!defaultStyle) {
const QStringList styles = QStyleFactory::keys();
for (const auto &style : styles) {
if ((app_style = QStyleFactory::create(style)))
if ((defaultStyle = QStyleFactory::create(style)))
break;
}
}
if (!app_style) {
if (!defaultStyle) {
Q_ASSERT(!"No styles available!");
return nullptr;
}
}
// take ownership of the style
QApplicationPrivate::app_style->setParent(qApp);
initSystemPalette();
// Take ownership of the style
defaultStyle->setParent(qApp);
if (QApplicationPrivate::set_pal) // repolish set palette with the new style
QApplication::setPalette(*QApplicationPrivate::set_pal);
initSystemPalette();
if (testAttribute(Qt::AA_SetPalette))
defaultStyle->polish(*QGuiApplicationPrivate::app_pal);
#ifndef QT_NO_STYLE_STYLESHEET
if (!QApplicationPrivate::styleSheet.isEmpty()) {
qApp->setStyleSheet(QApplicationPrivate::styleSheet);
} else
if (!QApplicationPrivate::styleSheet.isEmpty()) {
qApp->setStyleSheet(QApplicationPrivate::styleSheet);
} else
#endif
QApplicationPrivate::app_style->polish(qApp);
{
defaultStyle->polish(qApp);
}
}
return QApplicationPrivate::app_style;
}
@ -1128,17 +1129,21 @@ void QApplication::setStyle(QStyle *style)
// take care of possible palette requirements of certain gui
// styles. Do it before polishing the application since the style
// might call QApplication::setPalette() itself
if (QApplicationPrivate::set_pal) {
QApplication::setPalette(*QApplicationPrivate::set_pal);
} else if (QApplicationPrivate::sys_pal) {
clearSystemPalette();
if (testAttribute(Qt::AA_SetPalette)) {
QApplicationPrivate::app_style->polish(*QGuiApplicationPrivate::app_pal);
} else {
if (QApplicationPrivate::sys_pal)
clearSystemPalette();
initSystemPalette();
QApplicationPrivate::initializeWidgetFontHash();
} else if (!QApplicationPrivate::sys_pal) {
// Initialize the sys_pal if it hasn't happened yet...
QApplicationPrivate::setSystemPalette(QApplicationPrivate::app_style->standardPalette());
}
// The default widget font hash is based on the platform theme,
// not the style, but the widget fonts could in theory have been
// affected by polish of the previous style, without a proper
// cleanup in unpolish, so reset it now before polishing the
// new style.
QApplicationPrivate::initializeWidgetFontHash();
// initialize the application with the new style
QApplicationPrivate::app_style->polish(qApp);
@ -1389,11 +1394,8 @@ void QApplicationPrivate::setPalette_helper(const QPalette &palette, const char*
// Send ApplicationPaletteChange to qApp itself, and to the widgets.
qApp->d_func()->sendApplicationPaletteChange(all, className);
}
if (!className && (!QApplicationPrivate::sys_pal || !palette.isCopyOf(*QApplicationPrivate::sys_pal))) {
if (!QApplicationPrivate::set_pal)
QApplicationPrivate::set_pal = new QPalette(palette);
else
*QApplicationPrivate::set_pal = palette;
QCoreApplication::setAttribute(Qt::AA_SetPalette);
emit qGuiApp->paletteChanged(*QGuiApplicationPrivate::app_pal);
}
@ -1436,7 +1438,7 @@ void QApplicationPrivate::setSystemPalette(const QPalette &pal)
else
*sys_pal = pal;
if (!QApplicationPrivate::set_pal)
if (!testAttribute(Qt::AA_SetPalette))
QApplication::setPalette(*sys_pal);
}

View File

@ -162,7 +162,6 @@ public:
static QWidgetList *popupWidgets;
static QStyle *app_style;
static QPalette *sys_pal;
static QPalette *set_pal;
protected:
void notifyThemeChanged() override;

View File

@ -1453,7 +1453,7 @@ QStyleOptionTab::QStyleOptionTab(int version)
\value None A normal tab button.
\value HasFrame The tab button is positioned on a tab frame
\sa features
\sa QStyleOptionToolBar::features
*/
/*!

View File

@ -2037,12 +2037,16 @@ void tst_QItemSelectionModel::rowIntersectsSelection3()
QModelIndex parent;
QVERIFY(!selectionModel.rowIntersectsSelection(0, parent));
QVERIFY(!selectionModel.columnIntersectsSelection(0, parent));
parent = model.index(0, 0, parent);
QVERIFY(selectionModel.rowIntersectsSelection(0, parent));
QVERIFY(selectionModel.columnIntersectsSelection(0, parent));
parent = model.index(0, 0, parent);
QVERIFY(!selectionModel.rowIntersectsSelection(0, parent));
QVERIFY(!selectionModel.columnIntersectsSelection(0, parent));
parent = model.index(0, 0, parent);
QVERIFY(!selectionModel.rowIntersectsSelection(0, parent));
QVERIFY(!selectionModel.columnIntersectsSelection(0, parent));
}
void tst_QItemSelectionModel::unselectable()