diff options
249 files changed, 30 insertions, 21031 deletions
diff --git a/.prev_CMakeLists.txt b/.prev_CMakeLists.txt deleted file mode 100644 index 8bcdd46..0000000 --- a/.prev_CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Generated from qtwinextras.pro. - -cmake_minimum_required(VERSION 3.15.0) - -include(.cmake.conf) -project(QtWinExtras - VERSION "${QT_REPO_MODULE_VERSION}" - DESCRIPTION "Qt WinExtras Libraries" - HOMEPAGE_URL "https://qt.io/" - LANGUAGES CXX C -) - -find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core SET_ME_TO_SOMETHING_USEFUL) -find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS SET_ME_TO_SOMETHING_USEFUL) - -if(WINRT) - message(NOTICE "Skipping the build as the condition \"NOT WINRT\" is not met.") - return() -endif() -if(NOT TARGET Qt::Gui) - message(NOTICE "Skipping the build as the condition \"TARGET Qt::Gui\" is not met.") - return() -endif() -qt_build_repo() diff --git a/.qmake.conf b/.qmake.conf deleted file mode 100644 index 34387e8..0000000 --- a/.qmake.conf +++ /dev/null @@ -1,5 +0,0 @@ -load(qt_build_config) - -DEFINES += QT_NO_FOREACH - -MODULE_VERSION = 6.0.0 @@ -1 +0,0 @@ -$Format:%H$ diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 7b18496..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -# Generated from qtwinextras.pro. - -cmake_minimum_required(VERSION 3.15.0) - -include(.cmake.conf) -project(QtWinExtras - VERSION "${QT_REPO_MODULE_VERSION}" - DESCRIPTION "Qt WinExtras Libraries" - HOMEPAGE_URL "https://qt.io/" - LANGUAGES CXX C -) - -find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Widgets Quick) # special case -find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS) # special case - -# special case begin -if (NOT WIN32) - return() -endif() -# special case end - -qt_build_repo() diff --git a/LICENSE.FDL b/LICENSE.FDL deleted file mode 100644 index 938bb8d..0000000 --- a/LICENSE.FDL +++ /dev/null @@ -1,450 +0,0 @@ - GNU Free Documentation License - Version 1.3, 3 November 2008 - - - Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. - <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -0. PREAMBLE - -The purpose of this License is to make a manual, textbook, or other -functional and useful document "free" in the sense of freedom: to -assure everyone the effective freedom to copy and redistribute it, -with or without modifying it, either commercially or noncommercially. -Secondarily, this License preserves for the author and publisher a way -to get credit for their work, while not being considered responsible -for modifications made by others. - -This License is a kind of "copyleft", which means that derivative -works of the document must themselves be free in the same sense. It -complements the GNU General Public License, which is a copyleft -license designed for free software. - -We have designed this License in order to use it for manuals for free -software, because free software needs free documentation: a free -program should come with manuals providing the same freedoms that the -software does. But this License is not limited to software manuals; -it can be used for any textual work, regardless of subject matter or -whether it is published as a printed book. We recommend this License -principally for works whose purpose is instruction or reference. - - -1. APPLICABILITY AND DEFINITIONS - -This License applies to any manual or other work, in any medium, that -contains a notice placed by the copyright holder saying it can be -distributed under the terms of this License. Such a notice grants a -world-wide, royalty-free license, unlimited in duration, to use that -work under the conditions stated herein. The "Document", below, -refers to any such manual or work. Any member of the public is a -licensee, and is addressed as "you". You accept the license if you -copy, modify or distribute the work in a way requiring permission -under copyright law. - -A "Modified Version" of the Document means any work containing the -Document or a portion of it, either copied verbatim, or with -modifications and/or translated into another language. - -A "Secondary Section" is a named appendix or a front-matter section of -the Document that deals exclusively with the relationship of the -publishers or authors of the Document to the Document's overall -subject (or to related matters) and contains nothing that could fall -directly within that overall subject. (Thus, if the Document is in -part a textbook of mathematics, a Secondary Section may not explain -any mathematics.) The relationship could be a matter of historical -connection with the subject or with related matters, or of legal, -commercial, philosophical, ethical or political position regarding -them. - -The "Invariant Sections" are certain Secondary Sections whose titles -are designated, as being those of Invariant Sections, in the notice -that says that the Document is released under this License. If a -section does not fit the above definition of Secondary then it is not -allowed to be designated as Invariant. The Document may contain zero -Invariant Sections. If the Document does not identify any Invariant -Sections then there are none. - -The "Cover Texts" are certain short passages of text that are listed, -as Front-Cover Texts or Back-Cover Texts, in the notice that says that -the Document is released under this License. A Front-Cover Text may -be at most 5 words, and a Back-Cover Text may be at most 25 words. - -A "Transparent" copy of the Document means a machine-readable copy, -represented in a format whose specification is available to the -general public, that is suitable for revising the document -straightforwardly with generic text editors or (for images composed of -pixels) generic paint programs or (for drawings) some widely available -drawing editor, and that is suitable for input to text formatters or -for automatic translation to a variety of formats suitable for input -to text formatters. A copy made in an otherwise Transparent file -format whose markup, or absence of markup, has been arranged to thwart -or discourage subsequent modification by readers is not Transparent. -An image format is not Transparent if used for any substantial amount -of text. A copy that is not "Transparent" is called "Opaque". - -Examples of suitable formats for Transparent copies include plain -ASCII without markup, Texinfo input format, LaTeX input format, SGML -or XML using a publicly available DTD, and standard-conforming simple -HTML, PostScript or PDF designed for human modification. Examples of -transparent image formats include PNG, XCF and JPG. Opaque formats -include proprietary formats that can be read and edited only by -proprietary word processors, SGML or XML for which the DTD and/or -processing tools are not generally available, and the -machine-generated HTML, PostScript or PDF produced by some word -processors for output purposes only. - -The "Title Page" means, for a printed book, the title page itself, -plus such following pages as are needed to hold, legibly, the material -this License requires to appear in the title page. For works in -formats which do not have any title page as such, "Title Page" means -the text near the most prominent appearance of the work's title, -preceding the beginning of the body of the text. - -The "publisher" means any person or entity that distributes copies of -the Document to the public. - -A section "Entitled XYZ" means a named subunit of the Document whose -title either is precisely XYZ or contains XYZ in parentheses following -text that translates XYZ in another language. (Here XYZ stands for a -specific section name mentioned below, such as "Acknowledgements", -"Dedications", "Endorsements", or "History".) To "Preserve the Title" -of such a section when you modify the Document means that it remains a -section "Entitled XYZ" according to this definition. - -The Document may include Warranty Disclaimers next to the notice which -states that this License applies to the Document. These Warranty -Disclaimers are considered to be included by reference in this -License, but only as regards disclaiming warranties: any other -implication that these Warranty Disclaimers may have is void and has -no effect on the meaning of this License. - -2. VERBATIM COPYING - -You may copy and distribute the Document in any medium, either -commercially or noncommercially, provided that this License, the -copyright notices, and the license notice saying this License applies -to the Document are reproduced in all copies, and that you add no -other conditions whatsoever to those of this License. You may not use -technical measures to obstruct or control the reading or further -copying of the copies you make or distribute. However, you may accept -compensation in exchange for copies. If you distribute a large enough -number of copies you must also follow the conditions in section 3. - -You may also lend copies, under the same conditions stated above, and -you may publicly display copies. - - -3. COPYING IN QUANTITY - -If you publish printed copies (or copies in media that commonly have -printed covers) of the Document, numbering more than 100, and the -Document's license notice requires Cover Texts, you must enclose the -copies in covers that carry, clearly and legibly, all these Cover -Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on -the back cover. Both covers must also clearly and legibly identify -you as the publisher of these copies. The front cover must present -the full title with all words of the title equally prominent and -visible. You may add other material on the covers in addition. -Copying with changes limited to the covers, as long as they preserve -the title of the Document and satisfy these conditions, can be treated -as verbatim copying in other respects. - -If the required texts for either cover are too voluminous to fit -legibly, you should put the first ones listed (as many as fit -reasonably) on the actual cover, and continue the rest onto adjacent -pages. - -If you publish or distribute Opaque copies of the Document numbering -more than 100, you must either include a machine-readable Transparent -copy along with each Opaque copy, or state in or with each Opaque copy -a computer-network location from which the general network-using -public has access to download using public-standard network protocols -a complete Transparent copy of the Document, free of added material. -If you use the latter option, you must take reasonably prudent steps, -when you begin distribution of Opaque copies in quantity, to ensure -that this Transparent copy will remain thus accessible at the stated -location until at least one year after the last time you distribute an -Opaque copy (directly or through your agents or retailers) of that -edition to the public. - -It is requested, but not required, that you contact the authors of the -Document well before redistributing any large number of copies, to -give them a chance to provide you with an updated version of the -Document. - - -4. MODIFICATIONS - -You may copy and distribute a Modified Version of the Document under -the conditions of sections 2 and 3 above, provided that you release -the Modified Version under precisely this License, with the Modified -Version filling the role of the Document, thus licensing distribution -and modification of the Modified Version to whoever possesses a copy -of it. In addition, you must do these things in the Modified Version: - -A. Use in the Title Page (and on the covers, if any) a title distinct - from that of the Document, and from those of previous versions - (which should, if there were any, be listed in the History section - of the Document). You may use the same title as a previous version - if the original publisher of that version gives permission. -B. List on the Title Page, as authors, one or more persons or entities - responsible for authorship of the modifications in the Modified - Version, together with at least five of the principal authors of the - Document (all of its principal authors, if it has fewer than five), - unless they release you from this requirement. -C. State on the Title page the name of the publisher of the - Modified Version, as the publisher. -D. Preserve all the copyright notices of the Document. -E. Add an appropriate copyright notice for your modifications - adjacent to the other copyright notices. -F. Include, immediately after the copyright notices, a license notice - giving the public permission to use the Modified Version under the - terms of this License, in the form shown in the Addendum below. -G. Preserve in that license notice the full lists of Invariant Sections - and required Cover Texts given in the Document's license notice. -H. Include an unaltered copy of this License. -I. Preserve the section Entitled "History", Preserve its Title, and add - to it an item stating at least the title, year, new authors, and - publisher of the Modified Version as given on the Title Page. If - there is no section Entitled "History" in the Document, create one - stating the title, year, authors, and publisher of the Document as - given on its Title Page, then add an item describing the Modified - Version as stated in the previous sentence. -J. Preserve the network location, if any, given in the Document for - public access to a Transparent copy of the Document, and likewise - the network locations given in the Document for previous versions - it was based on. These may be placed in the "History" section. - You may omit a network location for a work that was published at - least four years before the Document itself, or if the original - publisher of the version it refers to gives permission. -K. For any section Entitled "Acknowledgements" or "Dedications", - Preserve the Title of the section, and preserve in the section all - the substance and tone of each of the contributor acknowledgements - and/or dedications given therein. -L. Preserve all the Invariant Sections of the Document, - unaltered in their text and in their titles. Section numbers - or the equivalent are not considered part of the section titles. -M. Delete any section Entitled "Endorsements". Such a section - may not be included in the Modified Version. -N. Do not retitle any existing section to be Entitled "Endorsements" - or to conflict in title with any Invariant Section. -O. Preserve any Warranty Disclaimers. - -If the Modified Version includes new front-matter sections or -appendices that qualify as Secondary Sections and contain no material -copied from the Document, you may at your option designate some or all -of these sections as invariant. To do this, add their titles to the -list of Invariant Sections in the Modified Version's license notice. -These titles must be distinct from any other section titles. - -You may add a section Entitled "Endorsements", provided it contains -nothing but endorsements of your Modified Version by various -parties--for example, statements of peer review or that the text has -been approved by an organization as the authoritative definition of a -standard. - -You may add a passage of up to five words as a Front-Cover Text, and a -passage of up to 25 words as a Back-Cover Text, to the end of the list -of Cover Texts in the Modified Version. Only one passage of -Front-Cover Text and one of Back-Cover Text may be added by (or -through arrangements made by) any one entity. If the Document already -includes a cover text for the same cover, previously added by you or -by arrangement made by the same entity you are acting on behalf of, -you may not add another; but you may replace the old one, on explicit -permission from the previous publisher that added the old one. - -The author(s) and publisher(s) of the Document do not by this License -give permission to use their names for publicity for or to assert or -imply endorsement of any Modified Version. - - -5. COMBINING DOCUMENTS - -You may combine the Document with other documents released under this -License, under the terms defined in section 4 above for modified -versions, provided that you include in the combination all of the -Invariant Sections of all of the original documents, unmodified, and -list them all as Invariant Sections of your combined work in its -license notice, and that you preserve all their Warranty Disclaimers. - -The combined work need only contain one copy of this License, and -multiple identical Invariant Sections may be replaced with a single -copy. If there are multiple Invariant Sections with the same name but -different contents, make the title of each such section unique by -adding at the end of it, in parentheses, the name of the original -author or publisher of that section if known, or else a unique number. -Make the same adjustment to the section titles in the list of -Invariant Sections in the license notice of the combined work. - -In the combination, you must combine any sections Entitled "History" -in the various original documents, forming one section Entitled -"History"; likewise combine any sections Entitled "Acknowledgements", -and any sections Entitled "Dedications". You must delete all sections -Entitled "Endorsements". - - -6. COLLECTIONS OF DOCUMENTS - -You may make a collection consisting of the Document and other -documents released under this License, and replace the individual -copies of this License in the various documents with a single copy -that is included in the collection, provided that you follow the rules -of this License for verbatim copying of each of the documents in all -other respects. - -You may extract a single document from such a collection, and -distribute it individually under this License, provided you insert a -copy of this License into the extracted document, and follow this -License in all other respects regarding verbatim copying of that -document. - - -7. AGGREGATION WITH INDEPENDENT WORKS - -A compilation of the Document or its derivatives with other separate -and independent documents or works, in or on a volume of a storage or -distribution medium, is called an "aggregate" if the copyright -resulting from the compilation is not used to limit the legal rights -of the compilation's users beyond what the individual works permit. -When the Document is included in an aggregate, this License does not -apply to the other works in the aggregate which are not themselves -derivative works of the Document. - -If the Cover Text requirement of section 3 is applicable to these -copies of the Document, then if the Document is less than one half of -the entire aggregate, the Document's Cover Texts may be placed on -covers that bracket the Document within the aggregate, or the -electronic equivalent of covers if the Document is in electronic form. -Otherwise they must appear on printed covers that bracket the whole -aggregate. - - -8. TRANSLATION - -Translation is considered a kind of modification, so you may -distribute translations of the Document under the terms of section 4. -Replacing Invariant Sections with translations requires special -permission from their copyright holders, but you may include -translations of some or all Invariant Sections in addition to the -original versions of these Invariant Sections. You may include a -translation of this License, and all the license notices in the -Document, and any Warranty Disclaimers, provided that you also include -the original English version of this License and the original versions -of those notices and disclaimers. In case of a disagreement between -the translation and the original version of this License or a notice -or disclaimer, the original version will prevail. - -If a section in the Document is Entitled "Acknowledgements", -"Dedications", or "History", the requirement (section 4) to Preserve -its Title (section 1) will typically require changing the actual -title. - - -9. TERMINATION - -You may not copy, modify, sublicense, or distribute the Document -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense, or distribute it is void, and -will automatically terminate your rights under this License. - -However, if you cease all violation of this License, then your license -from a particular copyright holder is reinstated (a) provisionally, -unless and until the copyright holder explicitly and finally -terminates your license, and (b) permanently, if the copyright holder -fails to notify you of the violation by some reasonable means prior to -60 days after the cessation. - -Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - -Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, receipt of a copy of some or all of the same material does -not give you any rights to use it. - - -10. FUTURE REVISIONS OF THIS LICENSE - -The Free Software Foundation may publish new, revised versions of the -GNU Free Documentation License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in -detail to address new problems or concerns. See -http://www.gnu.org/copyleft/. - -Each version of the License is given a distinguishing version number. -If the Document specifies that a particular numbered version of this -License "or any later version" applies to it, you have the option of -following the terms and conditions either of that specified version or -of any later version that has been published (not as a draft) by the -Free Software Foundation. If the Document does not specify a version -number of this License, you may choose any version ever published (not -as a draft) by the Free Software Foundation. If the Document -specifies that a proxy can decide which future versions of this -License can be used, that proxy's public statement of acceptance of a -version permanently authorizes you to choose that version for the -Document. - -11. RELICENSING - -"Massive Multiauthor Collaboration Site" (or "MMC Site") means any -World Wide Web server that publishes copyrightable works and also -provides prominent facilities for anybody to edit those works. A -public wiki that anybody can edit is an example of such a server. A -"Massive Multiauthor Collaboration" (or "MMC") contained in the site -means any set of copyrightable works thus published on the MMC site. - -"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 -license published by Creative Commons Corporation, a not-for-profit -corporation with a principal place of business in San Francisco, -California, as well as future copyleft versions of that license -published by that same organization. - -"Incorporate" means to publish or republish a Document, in whole or in -part, as part of another Document. - -An MMC is "eligible for relicensing" if it is licensed under this -License, and if all works that were first published under this License -somewhere other than this MMC, and subsequently incorporated in whole or -in part into the MMC, (1) had no cover texts or invariant sections, and -(2) were thus incorporated prior to November 1, 2008. - -The operator of an MMC Site may republish an MMC contained in the site -under CC-BY-SA on the same site at any time before August 1, 2009, -provided the MMC is eligible for relicensing. - - -ADDENDUM: How to use this License for your documents - -To use this License in a document you have written, include a copy of -the License in the document and put the following copyright and -license notices just after the title page: - - Copyright (c) YEAR YOUR NAME. - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU Free Documentation License, Version 1.3 - or any later version published by the Free Software Foundation; - with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. - A copy of the license is included in the section entitled "GNU - Free Documentation License". - -If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, -replace the "with...Texts." line with this: - - with the Invariant Sections being LIST THEIR TITLES, with the - Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. - -If you have Invariant Sections without Cover Texts, or some other -combination of the three, merge those two alternatives to suit the -situation. - -If your document contains nontrivial examples of program code, we -recommend releasing these examples in parallel under your choice of -free software license, such as the GNU General Public License, -to permit their use in free software. diff --git a/LICENSE.GPL2 b/LICENSE.GPL2 deleted file mode 100644 index d159169..0000000 --- a/LICENSE.GPL2 +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/LICENSE.GPL3 b/LICENSE.GPL3 deleted file mode 100644 index 94a9ed0..0000000 --- a/LICENSE.GPL3 +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<http://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. diff --git a/LICENSE.GPL3-EXCEPT b/LICENSE.GPL3-EXCEPT deleted file mode 100644 index b1cb1be..0000000 --- a/LICENSE.GPL3-EXCEPT +++ /dev/null @@ -1,704 +0,0 @@ -This is the GNU General Public License version 3, annotated with The -Qt Company GPL Exception 1.0: - -------------------------------------------------------------------------- - -The Qt Company GPL Exception 1.0 - -Exception 1: - -As a special exception you may create a larger work which contains the -output of this application and distribute that work under terms of your -choice, so long as the work is not otherwise derived from or based on -this application and so long as the work does not in itself generate -output that contains the output from this application in its original -or modified form. - -Exception 2: - -As a special exception, you have permission to combine this application -with Plugins licensed under the terms of your choice, to produce an -executable, and to copy and distribute the resulting executable under -the terms of your choice. However, the executable must be accompanied -by a prominent notice offering all users of the executable the entire -source code to this application, excluding the source code of the -independent modules, but including any changes you have made to this -application, under the terms of this license. - - -------------------------------------------------------------------------- - - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<http://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. diff --git a/LICENSE.LGPL3 b/LICENSE.LGPL3 deleted file mode 100644 index 65c5ca8..0000000 --- a/LICENSE.LGPL3 +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/README.md b/README.md new file mode 100644 index 0000000..ce1c60f --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# QtWinExtras + +**The QtWinExtras module has been deprecated and is no longer part of Qt.** + +The functionality of the module has been incorporated into other parts of Qt, or in some cases removed due to being obsole or better suited as cross platform APIs. + +For more details, see [QTBUG-89564](https://bugreports.qt.io/browse/QTBUG-89564) in the Qt issue tracker. + +## Porting away from QtWinExtras + +To learn more about how to port from QtWinExtras to alternative APIs please visit the [Qt 6 porting guide](https://doc.qt.io/qt-6/portingguide.html). + +## Working on Qt 5 + +To work on patches for the Qt 5 series, check out a local branch of the relevant Qt version, e.g.: + +```bash +$ git checkout 5.15 +Branch '5.15' set up to track remote branch '5.15' from 'origin' by rebasing. +Switched to a new branch '5.15' +``` + +## Going back in time + +To inspect the code in the `dev` branch prior to its removal, follow these steps: + +```bash +$ git checkout -b my-dev dev~1 +Switched to a new branch 'my-dev' +``` diff --git a/coin/module_config.yaml b/coin/module_config.yaml deleted file mode 100644 index 1000d45..0000000 --- a/coin/module_config.yaml +++ /dev/null @@ -1,25 +0,0 @@ -version: 2 -accept_configuration: - condition: property - property: features - not_contains_value: Disable - -instructions: - Build: - - !include "{{qt/qtbase}}/coin_module_build_template_v2.yaml" - - Test: - - type: Group - instructions: - - !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml" - enable_if: - condition: property - property: host.os - equals_value: Windows - - type: EnvironmentVariable - variableName: Dummy - variableValue: dummy - disable_if: - condition: property - property: host.os - equals_value: Windows diff --git a/dependencies.yaml b/dependencies.yaml deleted file mode 100644 index a061db8..0000000 --- a/dependencies.yaml +++ /dev/null @@ -1,7 +0,0 @@ -dependencies: - ../qtbase: - ref: 51e3cd89a81abdbf2fb6c60054d418084e4474c4 - required: true - ../qtdeclarative: - ref: 3debb37250b2c57aaaf81940f9dfeb540fd4e380 - required: false diff --git a/dist/changes-5.10.0 b/dist/changes-5.10.0 deleted file mode 100644 index e7365f5..0000000 --- a/dist/changes-5.10.0 +++ /dev/null @@ -1,22 +0,0 @@ -Qt 5.10 introduces many new features and improvements as well as bugfixes -over the 5.9.x series. For more details, refer to the online documentation -included in this distribution. The documentation is also available online: - -http://doc.qt.io/qt-5/index.html - -The Qt version 5.10 series is binary compatible with the 5.9.x series. -Applications compiled for 5.9 will continue to run with 5.10. - -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. - -**************************************************************************** -* Qt 5.10.0 Changes * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.10.1 b/dist/changes-5.10.1 deleted file mode 100644 index 695c4e3..0000000 --- a/dist/changes-5.10.1 +++ /dev/null @@ -1,26 +0,0 @@ -Qt 5.10.1 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.10.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - -http://doc.qt.io/qt-5/index.html - -The Qt version 5.10 series is binary compatible with the 5.9.x series. -Applications compiled for 5.9 will continue to run with 5.10. - -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. - -This release contains all fixes included in the Qt 5.9.4 release. - -**************************************************************************** -* Qt 5.10.1 Changes * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.11.0 b/dist/changes-5.11.0 deleted file mode 100644 index 162ab57..0000000 --- a/dist/changes-5.11.0 +++ /dev/null @@ -1,22 +0,0 @@ -Qt 5.11 introduces many new features and improvements as well as bugfixes -over the 5.10.x series. For more details, refer to the online documentation -included in this distribution. The documentation is also available online: - -http://doc.qt.io/qt-5/index.html - -The Qt version 5.11 series is binary compatible with the 5.10.x series. -Applications compiled for 5.10 will continue to run with 5.11. - -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. - -**************************************************************************** -* Qt 5.11.0 Changes * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.11.1 b/dist/changes-5.11.1 deleted file mode 100644 index 030ea3f..0000000 --- a/dist/changes-5.11.1 +++ /dev/null @@ -1,24 +0,0 @@ -Qt 5.11.1 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.11.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - -http://doc.qt.io/qt-5/index.html - -The Qt version 5.11 series is binary compatible with the 5.10.x series. -Applications compiled for 5.10 will continue to run with 5.11. - -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. - -**************************************************************************** -* Qt 5.11.1 Changes * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.11.2 b/dist/changes-5.11.2 deleted file mode 100644 index 8efdf5e..0000000 --- a/dist/changes-5.11.2 +++ /dev/null @@ -1,24 +0,0 @@ -Qt 5.11.2 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.11.0 through 5.11.1. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - -http://doc.qt.io/qt-5/index.html - -The Qt version 5.11 series is binary compatible with the 5.10.x series. -Applications compiled for 5.10 will continue to run with 5.11. - -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. - -**************************************************************************** -* Qt 5.11.2 Changes * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.11.3 b/dist/changes-5.11.3 deleted file mode 100644 index f71fa34..0000000 --- a/dist/changes-5.11.3 +++ /dev/null @@ -1,20 +0,0 @@ -Qt 5.11.3 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.11.0 through 5.11.2. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - -http://doc.qt.io/qt-5/index.html - -The Qt version 5.11 series is binary compatible with the 5.10.x series. -Applications compiled for 5.10 will continue to run with 5.11. - -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. - - - This release contains only minor code improvements. diff --git a/dist/changes-5.12.0 b/dist/changes-5.12.0 deleted file mode 100644 index b313545..0000000 --- a/dist/changes-5.12.0 +++ /dev/null @@ -1,24 +0,0 @@ -Qt 5.12 introduces many new features and improvements as well as bugfixes -over the 5.11.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.12 series is binary compatible with the 5.11.x series. -Applications compiled for 5.11 will continue to run with 5.12. - -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. - -**************************************************************************** -* QtWin * -**************************************************************************** - - - [QTBUG-51124] Added functions imageToHBITMAP() and imageFromHBITMAP() - for conversion between QImage and HBITMAP, preserving the format where - possible. diff --git a/dist/changes-5.12.1 b/dist/changes-5.12.1 deleted file mode 100644 index 1cb4dd7..0000000 --- a/dist/changes-5.12.1 +++ /dev/null @@ -1,20 +0,0 @@ -Qt 5.12.1 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.12.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - -http://doc.qt.io/qt-5/index.html - -The Qt version 5.12 series is binary compatible with the 5.11.x series. -Applications compiled for 5.11 will continue to run with 5.12. - -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. - - - This release contains only minor code improvements. diff --git a/dist/changes-5.12.2 b/dist/changes-5.12.2 deleted file mode 100644 index 0c8bd85..0000000 --- a/dist/changes-5.12.2 +++ /dev/null @@ -1,20 +0,0 @@ -Qt 5.12.2 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.12.0 through 5.12.1. - -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.12 series is binary compatible with the 5.11.x series. -Applications compiled for 5.11 will continue to run with 5.12. - -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. - - - This release contains only minor code improvements. diff --git a/dist/changes-5.12.3 b/dist/changes-5.12.3 deleted file mode 100644 index 8803320..0000000 --- a/dist/changes-5.12.3 +++ /dev/null @@ -1,20 +0,0 @@ -Qt 5.12.3 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.12.0 through 5.12.2. - -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.12 series is binary compatible with the 5.11.x series. -Applications compiled for 5.11 will continue to run with 5.12. - -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. - - - This release contains only minor code improvements. diff --git a/dist/changes-5.12.4 b/dist/changes-5.12.4 deleted file mode 100644 index a285cd8..0000000 --- a/dist/changes-5.12.4 +++ /dev/null @@ -1,20 +0,0 @@ -Qt 5.12.4 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.12.0 through 5.12.3. - -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.12 series is binary compatible with the 5.11.x series. -Applications compiled for 5.11 will continue to run with 5.12. - -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. - - - This release contains only minor code improvements. diff --git a/dist/changes-5.12.5 b/dist/changes-5.12.5 deleted file mode 100644 index e8be931..0000000 --- a/dist/changes-5.12.5 +++ /dev/null @@ -1,20 +0,0 @@ -Qt 5.12.5 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.12.0 through 5.12.4. - -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.12 series is binary compatible with the 5.11.x series. -Applications compiled for 5.11 will continue to run with 5.12. - -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. - - - This release contains only minor code improvements. diff --git a/dist/changes-5.13.0 b/dist/changes-5.13.0 deleted file mode 100644 index ebb4be1..0000000 --- a/dist/changes-5.13.0 +++ /dev/null @@ -1,18 +0,0 @@ -Qt 5.13 introduces many new features and improvements as well as bugfixes -over the 5.12.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.13 series is binary compatible with the 5.12.x series. -Applications compiled for 5.12 will continue to run with 5.13. - -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. - - - This release contains only minor code improvements. diff --git a/dist/changes-5.13.1 b/dist/changes-5.13.1 deleted file mode 100644 index 57ebdbe..0000000 --- a/dist/changes-5.13.1 +++ /dev/null @@ -1,20 +0,0 @@ -Qt 5.13.1 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.13.0. - -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.13 series is binary compatible with the 5.12.x series. -Applications compiled for 5.12 will continue to run with 5.13. - -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. - - - This release contains only minor code improvements. diff --git a/dist/changes-5.13.2 b/dist/changes-5.13.2 deleted file mode 100644 index e3bb833..0000000 --- a/dist/changes-5.13.2 +++ /dev/null @@ -1,20 +0,0 @@ -Qt 5.13.2 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.13.0 through 5.13.1. - -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.13 series is binary compatible with the 5.12.x series. -Applications compiled for 5.12 will continue to run with 5.13. - -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. - - - This release contains only minor code improvements. diff --git a/dist/changes-5.14.0 b/dist/changes-5.14.0 deleted file mode 100644 index 29a2c83..0000000 --- a/dist/changes-5.14.0 +++ /dev/null @@ -1,18 +0,0 @@ -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. - - - This release contains only minor code improvements. diff --git a/dist/changes-5.14.1 b/dist/changes-5.14.1 deleted file mode 100644 index d008638..0000000 --- a/dist/changes-5.14.1 +++ /dev/null @@ -1,20 +0,0 @@ -Qt 5.14.1 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.14.0. - -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. - - - This release contains only minor code improvements. diff --git a/dist/changes-5.14.2 b/dist/changes-5.14.2 deleted file mode 100644 index 68a0051..0000000 --- a/dist/changes-5.14.2 +++ /dev/null @@ -1,20 +0,0 @@ -Qt 5.14.2 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.14.0 through 5.14.1. - -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. - - - This release contains only minor code improvements. diff --git a/dist/changes-5.15.0 b/dist/changes-5.15.0 deleted file mode 100644 index 40076ce..0000000 --- a/dist/changes-5.15.0 +++ /dev/null @@ -1,18 +0,0 @@ -Qt 5.15 introduces many new features and improvements as well as bugfixes -over the 5.14.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.15 series is binary compatible with the 5.14.x series. -Applications compiled for 5.14 will continue to run with 5.15. - -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. - - - This release contains only minor code improvements. diff --git a/dist/changes-5.15.1 b/dist/changes-5.15.1 deleted file mode 100644 index 332ee9d..0000000 --- a/dist/changes-5.15.1 +++ /dev/null @@ -1,20 +0,0 @@ -Qt 5.15.1 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.15.0. - -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.15 series is binary compatible with the 5.14.x series. -Applications compiled for 5.14 will continue to run with 5.15. - -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. - - - This release contains only minor code improvements. diff --git a/dist/changes-5.4.0 b/dist/changes-5.4.0 deleted file mode 100644 index bf6ba87..0000000 --- a/dist/changes-5.4.0 +++ /dev/null @@ -1,32 +0,0 @@ -Qt 5.4 introduces many new features and improvements as well as bugfixes -over the 5.3.x series. For more details, refer to the online documentation -included in this distribution. The documentation is also available online: - - http://qt-project.org/doc/qt-5.4 - -The Qt version 5.4 series is binary compatible with the 5.3.x series. -Applications compiled for 5.3 will continue to run with 5.4. - -Some of the changes listed in this file include issue tracking numbers -corresponding to tasks in the Qt Bug Tracker: - - http://bugreports.qt-project.org/ - -Each of these identifiers can be entered in the bug tracker to obtain more -information about a particular change. - -**************************************************************************** -* Library * -**************************************************************************** - -QWinMime --------- - - - [QTBUG-39559] Added abstract class QWinMime (equivalent to WindowsMime - in Qt 4) for registering custom mime type conversions. - -QWinThumbnailToolBar --------------------- - - - [QTBUG-36730] Added pixmap properties and change notifications for - thumbnail icons and live preview. diff --git a/dist/changes-5.4.1 b/dist/changes-5.4.1 deleted file mode 100644 index 9f1911c..0000000 --- a/dist/changes-5.4.1 +++ /dev/null @@ -1,24 +0,0 @@ -Qt 5.4.1 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.4.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - - http://doc.qt.io/qt-5/index.html - -The Qt version 5.4 series is binary compatible with the 5.3.x series. -Applications compiled for 5.3 will continue to run with 5.4. - -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. - -**************************************************************************** -* Library * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.4.2 b/dist/changes-5.4.2 deleted file mode 100644 index 28cae6f..0000000 --- a/dist/changes-5.4.2 +++ /dev/null @@ -1,29 +0,0 @@ -Qt 5.4.2 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.4.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - - http://doc.qt.io/qt-5/index.html - -The Qt version 5.4 series is binary compatible with the 5.3.x series. -Applications compiled for 5.3 will continue to run with 5.4. - -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. - -**************************************************************************** -* Library * -**************************************************************************** - -QWinTaskBarButton ------------------ - - - [QTBUG-36664] Fixed an exit crash when instantiating a QWinTaskBarButton on - Windows XP and updated documentation to state that it is not supported on - this platform. diff --git a/dist/changes-5.5.0 b/dist/changes-5.5.0 deleted file mode 100644 index c361e7e..0000000 --- a/dist/changes-5.5.0 +++ /dev/null @@ -1,23 +0,0 @@ -Qt 5.5 introduces many new features and improvements as well as bugfixes -over the 5.4.x series. For more details, refer to the online documentation -included in this distribution. The documentation is also available online: - - http://doc.qt.io/qt-5/index.html - -The Qt version 5.5 series is binary compatible with the 5.4.x series. -Applications compiled for 5.5 will continue to run with 5.5. - -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. - -**************************************************************************** -* Library * -**************************************************************************** - - - This release contains only minor code improvements. - diff --git a/dist/changes-5.5.1 b/dist/changes-5.5.1 deleted file mode 100644 index 8e40d03..0000000 --- a/dist/changes-5.5.1 +++ /dev/null @@ -1,24 +0,0 @@ -Qt 5.5.1 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.5.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - - http://doc.qt.io/qt-5/index.html - -The Qt version 5.5 series is binary compatible with the 5.4.x series. -Applications compiled for 5.4 will continue to run with 5.5. - -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. - -**************************************************************************** -* Library * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.6.0 b/dist/changes-5.6.0 deleted file mode 100644 index 4882798..0000000 --- a/dist/changes-5.6.0 +++ /dev/null @@ -1,22 +0,0 @@ -Qt 5.6 introduces many new features and improvements as well as bugfixes -over the 5.5.x series. For more details, refer to the online documentation -included in this distribution. The documentation is also available online: - - http://doc.qt.io/qt-5/index.html - -The Qt version 5.6 series is binary compatible with the 5.5.x series. -Applications compiled for 5.5 will continue to run with 5.6. - -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. - -**************************************************************************** -* Library * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.6.1 b/dist/changes-5.6.1 deleted file mode 100644 index 57adbce..0000000 --- a/dist/changes-5.6.1 +++ /dev/null @@ -1,24 +0,0 @@ -Qt 5.6.1 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.6.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - - http://doc.qt.io/qt-5/index.html - -The Qt version 5.6 series is binary compatible with the 5.5.x series. -Applications compiled for 5.5 will continue to run with 5.6. - -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. - -**************************************************************************** -* Library * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.6.2 b/dist/changes-5.6.2 deleted file mode 100644 index fb770f8..0000000 --- a/dist/changes-5.6.2 +++ /dev/null @@ -1,24 +0,0 @@ -Qt 5.6.2 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.6.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - - http://doc.qt.io/qt-5/index.html - -The Qt version 5.6 series is binary compatible with the 5.5.x series. -Applications compiled for 5.5 will continue to run with 5.6. - -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. - -**************************************************************************** -* Library * -**************************************************************************** - - - Examples have been extended and improved. diff --git a/dist/changes-5.6.3 b/dist/changes-5.6.3 deleted file mode 100644 index f0feae1..0000000 --- a/dist/changes-5.6.3 +++ /dev/null @@ -1,24 +0,0 @@ -Qt 5.6.3 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.6.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - - http://doc.qt.io/qt-5/index.html - -The Qt version 5.6 series is binary compatible with the 5.5.x series. -Applications compiled for 5.5 will continue to run with 5.6. - -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. - -**************************************************************************** -* Library * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.7.0 b/dist/changes-5.7.0 deleted file mode 100644 index 0305436..0000000 --- a/dist/changes-5.7.0 +++ /dev/null @@ -1,38 +0,0 @@ -Qt 5.7 introduces many new features and improvements as well as bugfixes -over the 5.6.x series. Also, there is a change in the licensing terms. -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - - http://doc.qt.io/qt-5/index.html - -The Qt version 5.7 series is binary compatible with the 5.6.x series. -Applications compiled for 5.6 will continue to run with 5.7. - -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 License Changes * -**************************************************************************** - - This module is not available under LGPLv2.1 anymore. The libraries are - now available under the following licenses: - * Commercial License - * GNU General Public License v2.0 (LICENSE.GPL2) and later - * GNU Lesser General Public License v3.0 (LICENSE.LGPL3) - - The tools are now available under the following licenses: - * Commercial License - * GNU General Public License 3.0 (LICENSE.GPL3) with exceptions - described in The Qt Company GPL Exception 1.0 (LICENSE.GPL3-EXCEPT) - -**************************************************************************** -* Library * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.7.1 b/dist/changes-5.7.1 deleted file mode 100644 index c9480b0..0000000 --- a/dist/changes-5.7.1 +++ /dev/null @@ -1,24 +0,0 @@ -Qt 5.7.1 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.7.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - -http://doc.qt.io/qt-5/index.html - -The Qt version 5.7 series is binary compatible with the 5.6.x series. -Applications compiled for 5.6 will continue to run with 5.7. - -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. - -**************************************************************************** -* Library * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.8.0 b/dist/changes-5.8.0 deleted file mode 100644 index 91a1b8d..0000000 --- a/dist/changes-5.8.0 +++ /dev/null @@ -1,22 +0,0 @@ -Qt 5.8 introduces many new features and improvements as well as bugfixes -over the 5.7.x series. For more details, refer to the online documentation -included in this distribution. The documentation is also available online: - - http://doc.qt.io/qt-5/index.html - -The Qt version 5.8 series is binary compatible with the 5.8.x series. -Applications compiled for 5.7 will continue to run with 5.8. - -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. - -**************************************************************************** -* Library * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.9.0 b/dist/changes-5.9.0 deleted file mode 100644 index 5026982..0000000 --- a/dist/changes-5.9.0 +++ /dev/null @@ -1,22 +0,0 @@ -Qt 5.9 introduces many new features and improvements as well as bugfixes -over the 5.8.x series. For more details, refer to the online documentation -included in this distribution. The documentation is also available online: - - http://doc.qt.io/qt-5/index.html - -The Qt version 5.9 series is binary compatible with the 5.8.x series. -Applications compiled for 5.8 will continue to run with 5.9. - -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. - -**************************************************************************** -* Library * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.9.1 b/dist/changes-5.9.1 deleted file mode 100644 index e0a6a4b..0000000 --- a/dist/changes-5.9.1 +++ /dev/null @@ -1,24 +0,0 @@ -Qt 5.9.1 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.9.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - -http://doc.qt.io/qt-5/index.html - -The Qt version 5.9 series is binary compatible with the 5.8.x series. -Applications compiled for 5.8 will continue to run with 5.9. - -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. - -**************************************************************************** -* Library * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.9.2 b/dist/changes-5.9.2 deleted file mode 100644 index c8feaac..0000000 --- a/dist/changes-5.9.2 +++ /dev/null @@ -1,24 +0,0 @@ -Qt 5.9.2 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.9.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - -http://doc.qt.io/qt-5/index.html - -The Qt version 5.9 series is binary compatible with the 5.8.x series. -Applications compiled for 5.8 will continue to run with 5.9. - -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. - -**************************************************************************** -* Qt 5.9.2 Changes * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.9.3 b/dist/changes-5.9.3 deleted file mode 100644 index bb5db63..0000000 --- a/dist/changes-5.9.3 +++ /dev/null @@ -1,24 +0,0 @@ -Qt 5.9.3 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.9.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - -http://doc.qt.io/qt-5/index.html - -The Qt version 5.9 series is binary compatible with the 5.8.x series. -Applications compiled for 5.8 will continue to run with 5.9. - -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. - -**************************************************************************** -* Qt 5.9.3 Changes * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.9.4 b/dist/changes-5.9.4 deleted file mode 100644 index 1014937..0000000 --- a/dist/changes-5.9.4 +++ /dev/null @@ -1,25 +0,0 @@ -Qt 5.9.4 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.9.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - -http://doc.qt.io/qt-5/index.html - -The Qt version 5.9 series is binary compatible with the 5.8.x series. -Applications compiled for 5.8 will continue to run with 5.9. - -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. - -**************************************************************************** -* Qt 5.9.4 Changes * -**************************************************************************** - - - This release does not contain any changes to this module. - diff --git a/dist/changes-5.9.5 b/dist/changes-5.9.5 deleted file mode 100644 index 876af5f..0000000 --- a/dist/changes-5.9.5 +++ /dev/null @@ -1,24 +0,0 @@ -Qt 5.9.5 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.9.0. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - -http://doc.qt.io/qt-5/index.html - -The Qt version 5.9 series is binary compatible with the 5.8.x series. -Applications compiled for 5.8 will continue to run with 5.9. - -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. - -**************************************************************************** -* Qt 5.9.5 Changes * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/dist/changes-5.9.6 b/dist/changes-5.9.6 deleted file mode 100644 index f0179a5..0000000 --- a/dist/changes-5.9.6 +++ /dev/null @@ -1,24 +0,0 @@ -Qt 5.9.6 is a bug-fix release. It maintains both forward and backward -compatibility (source and binary) with Qt 5.9.0 through 5.9.5. - -For more details, refer to the online documentation included in this -distribution. The documentation is also available online: - -http://doc.qt.io/qt-5/index.html - -The Qt version 5.9 series is binary compatible with the 5.8.x series. -Applications compiled for 5.8 will continue to run with 5.9. - -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. - -**************************************************************************** -* Qt 5.9.6 Changes * -**************************************************************************** - - - This release contains only minor code improvements. diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt deleted file mode 100644 index d263b93..0000000 --- a/examples/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -# Generated from examples.pro. - -qt_examples_build_begin() - -if(WIN32) - add_subdirectory(winextras) -endif() - -qt_examples_build_end() diff --git a/examples/examples.pro b/examples/examples.pro deleted file mode 100644 index 7ab303c..0000000 --- a/examples/examples.pro +++ /dev/null @@ -1,2 +0,0 @@ -TEMPLATE = subdirs -win32:SUBDIRS += winextras diff --git a/examples/winextras/CMakeLists.txt b/examples/winextras/CMakeLists.txt deleted file mode 100644 index 4347a1a..0000000 --- a/examples/winextras/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Generated from winextras.pro. - -if(WIN32) - add_subdirectory(iconextractor) -endif() -if(TARGET Qt::Multimedia AND TARGET Qt::Widgets AND WIN32) - add_subdirectory(musicplayer) -endif() -if(TARGET Qt::Multimedia AND TARGET Qt::Quick AND WIN32) - add_subdirectory(quickplayer) -endif() diff --git a/examples/winextras/iconextractor/CMakeLists.txt b/examples/winextras/iconextractor/CMakeLists.txt deleted file mode 100644 index f0fc678..0000000 --- a/examples/winextras/iconextractor/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -# Generated from iconextractor.pro. - -cmake_minimum_required(VERSION 3.14) -project(iconextractor LANGUAGES CXX) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) - -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/winextras/iconextractor") - -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS WinExtras) - -add_executable(iconextractor - main.cpp -) -target_link_libraries(iconextractor PUBLIC - Qt::Core - Qt::Gui - Qt::WinExtras - shell32 - user32 -) - -install(TARGETS iconextractor - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) diff --git a/examples/winextras/iconextractor/doc/src/qtwinextras-example-iconextractor.qdoc b/examples/winextras/iconextractor/doc/src/qtwinextras-example-iconextractor.qdoc deleted file mode 100644 index f65fd8d..0000000 --- a/examples/winextras/iconextractor/doc/src/qtwinextras-example-iconextractor.qdoc +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \title Icon Extractor - \ingroup examples-qtwinextras - \example iconextractor - \brief Demonstrates accessing icons contained in Windows binaries. - - This example shows how to extract Windows icons from executables, - DLL or icon files, and write them out as numbered PNG files. -*/ diff --git a/examples/winextras/iconextractor/iconextractor.pro b/examples/winextras/iconextractor/iconextractor.pro deleted file mode 100644 index 66c6dad..0000000 --- a/examples/winextras/iconextractor/iconextractor.pro +++ /dev/null @@ -1,9 +0,0 @@ -TEMPLATE = app -TARGET = iconextractor -CONFIG += console -QT = core gui winextras -LIBS += -lshell32 -luser32 -SOURCES += main.cpp - -target.path = $$[QT_INSTALL_EXAMPLES]/winextras/iconextractor -INSTALLS += target diff --git a/examples/winextras/iconextractor/main.cpp b/examples/winextras/iconextractor/main.cpp deleted file mode 100644 index 6e11816..0000000 --- a/examples/winextras/iconextractor/main.cpp +++ /dev/null @@ -1,309 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWinExtras module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtWin> - -#include <QCommandLineParser> -#include <QCommandLineOption> -#include <QDir> -#include <QFileInfo> -#include <QGuiApplication> -#include <QImage> -#include <QPixmap> -#include <QScopedArrayPointer> -#include <QStringList> -#include <QSysInfo> - -#include <iostream> - -#include <shellapi.h> -#include <comdef.h> -#include <commctrl.h> -#include <objbase.h> -#include <commoncontrols.h> - -/* This example demonstrates the Windows-specific image conversion - * functions. */ - -struct PixmapEntry { - QString name; - QPixmap pixmap; -}; - -using PixmapEntryList = QList<PixmapEntry>; - -static std::wostream &operator<<(std::wostream &str, const QString &s) -{ -#ifdef Q_OS_WIN - str << reinterpret_cast<const wchar_t *>(s.utf16()); -#else - str << s.toStdWString(); -#endif - return str; -} - -static QString formatSize(const QSize &size) -{ - return QString::number(size.width()) + u'x' + QString::number(size.height()); -} - -// Extract icons contained in executable or DLL using the Win32 API ExtractIconEx() -static PixmapEntryList extractIcons(const QString &sourceFile, bool large) -{ - const QString nativeName = QDir::toNativeSeparators(sourceFile); - const auto *sourceFileC = reinterpret_cast<const wchar_t *>(nativeName.utf16()); - const UINT iconCount = ExtractIconEx(sourceFileC, -1, nullptr, nullptr, 0); - if (!iconCount) { - std::wcerr << sourceFile << " does not appear to contain icons.\n"; - return PixmapEntryList(); - } - - QScopedArrayPointer<HICON> icons(new HICON[iconCount]); - const UINT extractedIconCount = large ? - ExtractIconEx(sourceFileC, 0, icons.data(), nullptr, iconCount) : - ExtractIconEx(sourceFileC, 0, nullptr, icons.data(), iconCount); - if (!extractedIconCount) { - qErrnoWarning("Failed to extract icons from %s", qPrintable(sourceFile)); - return PixmapEntryList(); - } - - PixmapEntryList result; - result.reserve(int(extractedIconCount)); - - std::wcout << sourceFile << " contains " << extractedIconCount << " icon(s).\n"; - - for (UINT i = 0; i < extractedIconCount; ++i) { - PixmapEntry entry; - entry.pixmap = QtWin::fromHICON(icons[i]); - if (entry.pixmap.isNull()) { - std::wcerr << "Error converting icons.\n"; - return PixmapEntryList(); - } - entry.name = QString::fromLatin1("%1_%2x%3").arg(i, 3, 10, QLatin1Char('0')) - .arg(entry.pixmap.width()).arg(entry.pixmap.height()); - result.append(entry); - } - return result; -} - -// Helper for extracting large/jumbo icons available from Windows Vista onwards -// via SHGetImageList(). -static QPixmap pixmapFromShellImageList(int iImageList, const SHFILEINFO &info) -{ - QPixmap result; - // For MinGW: - static const IID iID_IImageList = {0x46eb5926, 0x582e, 0x4017, {0x9f, 0xdf, 0xe8, 0x99, 0x8d, 0xaa, 0x9, 0x50}}; - - IImageList *imageList = nullptr; - if (FAILED(SHGetImageList(iImageList, iID_IImageList, reinterpret_cast<void **>(&imageList)))) - return result; - - HICON hIcon = nullptr; - if (SUCCEEDED(imageList->GetIcon(info.iIcon, ILD_TRANSPARENT, &hIcon))) { - result = QtWin::fromHICON(hIcon); - DestroyIcon(hIcon); - } - return result; -} - -// Extract icons that would be displayed by the Explorer (shell) -static PixmapEntryList extractShellIcons(const QString &sourceFile, bool addOverlays) -{ - enum { // Shell image list ids - sHIL_EXTRALARGE = 0x2, // 48x48 or user-defined - sHIL_JUMBO = 0x4 // 256x256 (Vista or later) - }; - - struct FlagEntry { - const char *name; - unsigned flags; - }; - - const FlagEntry modeEntries[] = - { - {"", 0}, - {"open", SHGFI_OPENICON}, - {"sel", SHGFI_SELECTED}, - }; - const FlagEntry standardSizeEntries[] = - { - {"s", SHGFI_SMALLICON}, - {"l", SHGFI_LARGEICON}, - {"sh", SHGFI_SHELLICONSIZE}, - }; - - const QString nativeName = QDir::toNativeSeparators(sourceFile); - const auto *sourceFileC = reinterpret_cast<const wchar_t *>(nativeName.utf16()); - - SHFILEINFO info; - unsigned int baseFlags = SHGFI_ICON | SHGFI_SYSICONINDEX | SHGFI_ICONLOCATION; - if (addOverlays) - baseFlags |= SHGFI_ADDOVERLAYS | SHGFI_OVERLAYINDEX; - if (!QFileInfo(sourceFile).isDir()) - baseFlags |= SHGFI_USEFILEATTRIBUTES; - - PixmapEntryList result; - for (auto modeEntry : modeEntries) { - const unsigned modeFlags = baseFlags | modeEntry.flags; - QString modePrefix = QLatin1String("_shell_"); - if (modeEntry.name[0]) - modePrefix += QLatin1String(modeEntry.name) + u'_'; - for (auto standardSizeEntry : standardSizeEntries) { - const unsigned flags = modeFlags | standardSizeEntry.flags; - const QString prefix = modePrefix + QLatin1String(standardSizeEntry.name) - + u'_'; - ZeroMemory(&info, sizeof(SHFILEINFO)); - const HRESULT hr = SHGetFileInfo(sourceFileC, 0, &info, sizeof(SHFILEINFO), flags); - if (FAILED(hr)) { - _com_error error(hr); - std::wcerr << "SHGetFileInfo() failed for \"" << nativeName << "\", " - << std::hex << std::showbase << flags << std::dec << std::noshowbase - << " (" << prefix << "): " << error.ErrorMessage() << '\n'; - continue; - } - - if (info.hIcon) { - PixmapEntry entry; - entry.pixmap = QtWin::fromHICON(info.hIcon); - DestroyIcon(info.hIcon); - if (entry.pixmap.isNull()) { - std::wcerr << "Error converting icons.\n"; - return PixmapEntryList(); - } - entry.name = prefix + formatSize(entry.pixmap.size()); - - const int iconIndex = info.iIcon & 0xFFFFFF; - const int overlayIconIndex = info.iIcon >> 24; - - std::wcout << "Obtained icon #" << iconIndex; - if (addOverlays) - std::wcout << " (overlay #" << overlayIconIndex << ')'; - if (info.szDisplayName[0]) - std::wcout << " from " << QString::fromWCharArray(info.szDisplayName); - std::wcout << " (" << entry.pixmap.width() << 'x' - << entry.pixmap.height() << ") for " << std::hex << std::showbase << flags - << std::dec << std::noshowbase << '\n'; - - result.append(entry); - } - } // for standardSizeEntryCount - // Windows Vista onwards: extract large/jumbo icons - if (info.hIcon) { - const QPixmap extraLarge = pixmapFromShellImageList(sHIL_EXTRALARGE, info); - if (!extraLarge.isNull()) { - PixmapEntry entry; - entry.pixmap = extraLarge; - entry.name = modePrefix + QLatin1String("xl_") + formatSize(extraLarge.size()); - result.append(entry); - } - const QPixmap jumbo = pixmapFromShellImageList(sHIL_JUMBO, info); - if (!jumbo.isNull()) { - PixmapEntry entry; - entry.pixmap = jumbo; - entry.name = modePrefix + QLatin1String("jumbo_") + formatSize(extraLarge.size()); - result.append(entry); - } - } - } // for modes - return result; -} - -static const char description[] = - "\nExtracts Windows icons from executables, DLL or icon files and writes them\n" - "out as numbered .png-files.\n" - "When passing the --shell option, the icons displayed by Explorer are extracted.\n"; - -int main(int argc, char *argv[]) -{ - QGuiApplication app(argc, argv); - QCoreApplication::setApplicationName(QStringLiteral("Icon Extractor")); - QCoreApplication::setOrganizationName(QStringLiteral("QtProject")); - QCoreApplication::setApplicationVersion(QLatin1String(QT_VERSION_STR)); - QCommandLineParser parser; - parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsCompactedShortOptions); - parser.setApplicationDescription(QLatin1String(description)); - parser.addHelpOption(); - parser.addVersionOption(); - const QCommandLineOption largeIconOption(QStringLiteral("large"), QStringLiteral("Extract large icons")); - parser.addOption(largeIconOption); - const QCommandLineOption shellIconOption(QStringLiteral("shell"), QStringLiteral("Extract shell icons using SHGetFileInfo()")); - parser.addOption(shellIconOption); - const QCommandLineOption shellOverlayOption(QStringLiteral("overlay"), QStringLiteral("Extract shell overlay icons")); - parser.addOption(shellOverlayOption); - parser.addPositionalArgument(QStringLiteral("file"), QStringLiteral("The file to open.")); - parser.addPositionalArgument(QStringLiteral("image_file_folder"), QStringLiteral("The folder to store the images.")); - parser.process(app); - const QStringList &positionalArguments = parser.positionalArguments(); - if (positionalArguments.isEmpty()) - parser.showHelp(0); - - QString imageFileRoot = positionalArguments.size() > 1 ? positionalArguments.at(1) : QDir::currentPath(); - const QFileInfo imageFileRootInfo(imageFileRoot); - if (!imageFileRootInfo.isDir()) { - std::wcerr << imageFileRoot << " is not a directory.\n"; - return 1; - } - const QString &sourceFile = positionalArguments.constFirst(); - imageFileRoot = imageFileRootInfo.absoluteFilePath() + u'/' + QFileInfo(sourceFile).baseName(); - - const PixmapEntryList pixmaps = parser.isSet(shellIconOption) - ? extractShellIcons(sourceFile, parser.isSet(shellOverlayOption)) - : extractIcons(sourceFile, parser.isSet(largeIconOption)); - - for (const auto &entry : pixmaps) { - const QString fileName = imageFileRoot + entry.name + QLatin1String(".png"); - if (!entry.pixmap.save(fileName)) { - std::wcerr << "Error writing image file " << fileName << ".\n"; - return 1; - } - std::wcout << "Wrote " << QDir::toNativeSeparators(fileName) << ".\n"; - } - return 0; -} diff --git a/examples/winextras/musicplayer/CMakeLists.txt b/examples/winextras/musicplayer/CMakeLists.txt deleted file mode 100644 index 359be76..0000000 --- a/examples/winextras/musicplayer/CMakeLists.txt +++ /dev/null @@ -1,41 +0,0 @@ -# Generated from musicplayer.pro. - -cmake_minimum_required(VERSION 3.14) -project(musicplayer LANGUAGES CXX) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) - -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/winextras/musicplayer") - -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Widgets) -find_package(Qt6 COMPONENTS Multimedia) -find_package(Qt6 COMPONENTS WinExtras) - -add_qt_gui_executable(musicplayer - main.cpp - musicplayer.cpp musicplayer.h - volumebutton.cpp volumebutton.h -) -target_link_libraries(musicplayer PUBLIC - Qt::Core - Qt::Gui - Qt::Multimedia - Qt::Widgets - Qt::WinExtras -) - -install(TARGETS musicplayer - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) diff --git a/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-composited.png b/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-composited.png Binary files differdeleted file mode 100644 index 3ae91f9..0000000 --- a/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-composited.png +++ /dev/null diff --git a/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-non-composited.png b/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-non-composited.png Binary files differdeleted file mode 100644 index e0a6afe..0000000 --- a/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-non-composited.png +++ /dev/null diff --git a/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-taskbar.png b/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-taskbar.png Binary files differdeleted file mode 100644 index 8742da2..0000000 --- a/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-taskbar.png +++ /dev/null diff --git a/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-thumbnail.png b/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-thumbnail.png Binary files differdeleted file mode 100644 index 2198ec8..0000000 --- a/examples/winextras/musicplayer/doc/images/qtwinextras-musicplayer-thumbnail.png +++ /dev/null diff --git a/examples/winextras/musicplayer/doc/src/qtwinextras-musicplayer.qdoc b/examples/winextras/musicplayer/doc/src/qtwinextras-musicplayer.qdoc deleted file mode 100644 index 8b8fd57..0000000 --- a/examples/winextras/musicplayer/doc/src/qtwinextras-musicplayer.qdoc +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example musicplayer - \title Music Player - \ingroup examples-qtwinextras - \brief Demonstrates managing Windows DWM features, jump lists, - taskbar button overlay, and thumbnail toolbar. - - \image qtwinextras-musicplayer-composited.png Screenshot of the Music Player example - - The Music Player example demonstrates how to use the various features - provided by the QtWinExtras module. - - \note The example uses QMediaPlayer from the QtMultimedia module to play - the music, but this article focuses on the parts where QtWinExtras features - are used. - - \section1 DWM Features - - The example uses Windows DWM (Desktop Window Manager) features to visually - integrate the window content to the window frame and to make the main window - and the volume popup translucent and blurred. - - The example applies a different look based on whether composition is enabled - or not. When composition is enabled, the main window is made translucent and - the window frame is extended to the client area to make the window content - integrate seamlessly to the window frame as shown above. When composition - is disabled, the colorization color is used as a background color. The - following screenshot illustrates how the Music Player example looks when - composition is disabled. - - \image qtwinextras-musicplayer-non-composited.png Screenshot of the Music Player example - - The respective code is a combination of extending or resetting the system - frame, adjusting the necessary QWidget attributes, and setting an appropriate - style sheet to achieve the desired look. - - \snippet musicplayer/musicplayer.cpp 1 - - The volume popup does not have a window frame so it is enough to make the - popup blurred when composition is enabled. Additionally, a style sheet is - applied to get a border that follows the colorization color. Just like for - the main window, when composition is disabled, the colorization color is - used as a background color. - - \snippet musicplayer/volumebutton.cpp 0 - - The example application respects the user's composition settings, reacts - to dynamic composition changes, and looks solid regardless of whether - composition is enabled or not. It accomplishes this by catching - QWinEvent::CompositionChange and QWinEvent::ColorizationChange events - and adjusting its looks accordingly. - - \snippet musicplayer/musicplayer.cpp 0 - - \section1 Jump List - - The example creates a custom jump list to provide the user with fast - access to recently played music files. - - \snippet musicplayer/musicplayer.cpp 4 - - To enable the application jump list to show the desired recent files, - the corresponding file types are registered using the following helper - function. - - \snippet musicplayer/main.cpp 0 - - \section1 Taskbar Overlay and Progress - - The example uses Windows Taskbar for two things; it sets an overlay icon - that represents the current music playback state, and it indicates the - playback progress in the taskbar button. - - \image qtwinextras-musicplayer-taskbar.png Screenshot of the Music Player taskbar - - The following snippets show how the taskbar button is prepared. - - For the taskbar and the thumbnail toolbar to work, a native window handle - must be set by passing an instance of \c QWindow to - \c QWinTaskbarButton::setWindow() or \c QWinThumbnailToolBar::setWindow(), - respectively. This instance is created in the process of \c QWidget::show() - and can be retrieved by calling \c QWidget::windowHandle() afterwards. - We override \c QWidget::showEvent() for this purpose: - - \snippet musicplayer/musicplayer.cpp 7 - - The playback progress is wired directly to the taskbar progress indicator - by using signals and slots. - - \snippet musicplayer/musicplayer.cpp 5 - - The overlay icon and the progress indicator are updated whenever the state - of the music playback changes. - - \snippet musicplayer/musicplayer.cpp 2 - - \section1 Thumbnail Toolbar - - \image qtwinextras-musicplayer-thumbnail.png Screenshot of the Music Player thumbnail - - The Windows Thumbnail Toolbar is used for providing basic music playback - controls. These controls can be used to control the application without - having to activate the application. - - \snippet musicplayer/musicplayer.cpp 6 - - The buttons in the thumbnail toolbar are updated accordingly whenever the state - of the music playback changes. - - \snippet musicplayer/musicplayer.cpp 3 -*/ diff --git a/examples/winextras/musicplayer/images/qt-logo.ico b/examples/winextras/musicplayer/images/qt-logo.ico Binary files differdeleted file mode 100644 index b5ac59b..0000000 --- a/examples/winextras/musicplayer/images/qt-logo.ico +++ /dev/null diff --git a/examples/winextras/musicplayer/main.cpp b/examples/winextras/musicplayer/main.cpp deleted file mode 100644 index 3dcf1bb..0000000 --- a/examples/winextras/musicplayer/main.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "musicplayer.h" - -#include <QApplication> -#include <QCommandLineParser> -#include <QCommandLineOption> -#include <QDesktopWidget> -#include <QFileInfo> -#include <QMimeDatabase> -#include <QSettings> -#include <QIcon> -#include <QDir> -#include <QUrl> - -//! [0] -static bool associateFileTypes() -{ - QString displayName = QGuiApplication::applicationDisplayName(); - QString filePath = QCoreApplication::applicationFilePath(); - QString fileName = QFileInfo(filePath).fileName(); - - const QString key = QStringLiteral("HKEY_CURRENT_USER\\Software\\Classes\\Applications\\") + fileName; - QSettings settings(key, QSettings::NativeFormat); - if (settings.status() != QSettings::NoError) { - qWarning() << "Cannot access registry key" << key; - return false; - } - settings.setValue(QStringLiteral("FriendlyAppName"), displayName); - - settings.beginGroup(QStringLiteral("SupportedTypes")); - QMimeDatabase mimeDatabase; - const QStringList supportedMimeTypes = MusicPlayer::supportedMimeTypes(); - for (const QString &fileType : supportedMimeTypes) { - const QStringList suffixes = mimeDatabase.mimeTypeForName(fileType).suffixes(); - for (QString suffix : suffixes) { - suffix.prepend('.'); - settings.setValue(suffix, QString()); - } - } - settings.endGroup(); - - settings.beginGroup(QStringLiteral("shell")); - settings.beginGroup(QStringLiteral("open")); - settings.setValue(QStringLiteral("FriendlyAppName"), displayName); - settings.beginGroup(QStringLiteral("Command")); - settings.setValue(QStringLiteral("."), - u'"' + QDir::toNativeSeparators(filePath) + QStringLiteral("\" \"%1\"")); - - return true; -} -//! [0] - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - QCoreApplication::setApplicationName(QStringLiteral("MusicPlayer")); - QCoreApplication::setApplicationVersion( QLatin1String(QT_VERSION_STR)); - QCoreApplication::setOrganizationName(QStringLiteral("QtWinExtras")); - QCoreApplication::setOrganizationDomain(QStringLiteral("qt-project.org")); - QGuiApplication::setApplicationDisplayName(QStringLiteral("QtWinExtras Music Player")); - - if (!associateFileTypes()) - return -1; - - QCommandLineParser parser; - parser.setApplicationDescription(QGuiApplication::applicationDisplayName()); - parser.addHelpOption(); - parser.addVersionOption(); - parser.addPositionalArgument(QStringLiteral("url"), MusicPlayer::tr("The URL to open.")); - parser.process(app); - - MusicPlayer player; - - if (!parser.positionalArguments().isEmpty()) - player.playUrl(QUrl::fromUserInput(parser.positionalArguments().constFirst(), QDir::currentPath(), QUrl::AssumeLocalFile)); - - const QRect availableGeometry = QApplication::desktop()->availableGeometry(&player); - player.resize(availableGeometry.width() / 6, availableGeometry.height() / 17); - player.show(); - - return app.exec(); -} diff --git a/examples/winextras/musicplayer/musicplayer.cpp b/examples/winextras/musicplayer/musicplayer.cpp deleted file mode 100644 index 4a598d8..0000000 --- a/examples/winextras/musicplayer/musicplayer.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "musicplayer.h" -#include "volumebutton.h" - -#include <QtWidgets> -#include <QtWinExtras> - -MusicPlayer::MusicPlayer(QWidget *parent) : QWidget(parent) -{ - createWidgets(); - createShortcuts(); - createJumpList(); - createTaskbar(); - createThumbnailToolBar(); - - connect(&mediaPlayer, &QMediaPlayer::positionChanged, this, &MusicPlayer::updatePosition); - connect(&mediaPlayer, &QMediaPlayer::durationChanged, this, &MusicPlayer::updateDuration); - connect(&mediaPlayer, &QMediaObject::metaDataAvailableChanged, this, &MusicPlayer::updateInfo); - - connect(&mediaPlayer, QOverload<QMediaPlayer::Error>::of(&QMediaPlayer::error), - this, &MusicPlayer::handleError); - connect(&mediaPlayer, &QMediaPlayer::stateChanged, - this, &MusicPlayer::updateState); - - stylize(); - setAcceptDrops(true); -} - -QStringList MusicPlayer::supportedMimeTypes() -{ - QStringList result = QMediaPlayer::supportedMimeTypes(); - if (result.isEmpty()) - result.append(QStringLiteral("audio/mpeg")); - return result; -} - -void MusicPlayer::openFile() -{ - QFileDialog fileDialog(this); - fileDialog.setAcceptMode(QFileDialog::AcceptOpen); - fileDialog.setWindowTitle(tr("Open File")); - fileDialog.setMimeTypeFilters(MusicPlayer::supportedMimeTypes()); - fileDialog.setDirectory(QStandardPaths::standardLocations(QStandardPaths::MusicLocation).value(0, QDir::homePath())); - if (fileDialog.exec() == QDialog::Accepted) - playUrl(fileDialog.selectedUrls().constFirst()); -} - -void MusicPlayer::playUrl(const QUrl &url) -{ - playButton->setEnabled(true); - if (url.isLocalFile()) { - const QString filePath = url.toLocalFile(); - setWindowFilePath(filePath); - infoLabel->setText(QDir::toNativeSeparators(filePath)); - fileName = QFileInfo(filePath).fileName(); - } else { - setWindowFilePath(QString()); - infoLabel->setText(url.toString()); - fileName.clear(); - } - mediaPlayer.setMedia(url); - mediaPlayer.play(); -} - -void MusicPlayer::togglePlayback() -{ - if (mediaPlayer.mediaStatus() == QMediaPlayer::NoMedia) - openFile(); - else if (mediaPlayer.state() == QMediaPlayer::PlayingState) - mediaPlayer.pause(); - else - mediaPlayer.play(); -} - -void MusicPlayer::seekForward() -{ - positionSlider->triggerAction(QSlider::SliderPageStepAdd); -} - -void MusicPlayer::seekBackward() -{ - positionSlider->triggerAction(QSlider::SliderPageStepSub); -} - -//! [0] -bool MusicPlayer::event(QEvent *event) -{ - if (event->type() == QWinEvent::CompositionChange || event->type() == QWinEvent::ColorizationChange) - stylize(); - return QWidget::event(event); -} -//! [0] - -//! [7] -void MusicPlayer::showEvent(QShowEvent *event) -{ - QWidget::showEvent(event); - if (!taskbarButton->window()) { - auto window = windowHandle(); - taskbarButton->setWindow(window); - thumbnailToolBar->setWindow(window); - } -} -//! [7] - -static bool canHandleDrop(const QDropEvent *event) -{ - const auto urls = event->mimeData()->urls(); - if (urls.size() != 1) - return false; - QMimeDatabase mimeDatabase; - return MusicPlayer::supportedMimeTypes(). - contains(mimeDatabase.mimeTypeForUrl(urls.constFirst()).name()); -} - -void MusicPlayer::dragEnterEvent(QDragEnterEvent *event) -{ - event->setAccepted(canHandleDrop(event)); -} - -void MusicPlayer::dropEvent(QDropEvent *event) -{ - event->accept(); - playUrl(event->mimeData()->urls().constFirst()); -} - -void MusicPlayer::mousePressEvent(QMouseEvent *event) -{ - offset = event->globalPos() - pos(); - event->accept(); -} - -void MusicPlayer::mouseMoveEvent(QMouseEvent *event) -{ - move(event->globalPos() - offset); - event->accept(); -} - -void MusicPlayer::mouseReleaseEvent(QMouseEvent *event) -{ - offset = QPoint(); - event->accept(); -} - -//! [1] -void MusicPlayer::stylize() -{ - if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8) { - // Set styling options relevant only to Windows 7. - if (QtWin::isCompositionEnabled()) { - QtWin::extendFrameIntoClientArea(this, -1, -1, -1, -1); - setAttribute(Qt::WA_TranslucentBackground, true); - setAttribute(Qt::WA_NoSystemBackground, false); - setStyleSheet(QStringLiteral("MusicPlayer { background: transparent; }")); - } else { - QtWin::resetExtendedFrame(this); - setAttribute(Qt::WA_TranslucentBackground, false); - setStyleSheet(QStringLiteral("MusicPlayer { background: %1; }").arg(QtWin::realColorizationColor().name())); - } - volumeButton->stylize(); - } -} -//! [1] - -void MusicPlayer::updateState(QMediaPlayer::State state) -{ - if (state == QMediaPlayer::PlayingState) { - playButton->setToolTip(tr("Pause")); - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPause)); - } else { - playButton->setToolTip(tr("Play")); - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); - } -} - -static QString formatTime(qint64 timeMilliSeconds) -{ - qint64 seconds = timeMilliSeconds / 1000; - const qint64 minutes = seconds / 60; - seconds -= minutes * 60; - return QStringLiteral("%1:%2") - .arg(minutes, 2, 10, QLatin1Char('0')) - .arg(seconds, 2, 10, QLatin1Char('0')); -} - -void MusicPlayer::updatePosition(qint64 position) -{ - positionSlider->setValue(position); - positionLabel->setText(formatTime(position)); -} - -void MusicPlayer::updateDuration(qint64 duration) -{ - positionSlider->setRange(0, duration); - positionSlider->setEnabled(duration > 0); - positionSlider->setPageStep(duration / 10); - updateInfo(); -} - -void MusicPlayer::setPosition(int position) -{ - // avoid seeking when the slider value change is triggered from updatePosition() - if (qAbs(mediaPlayer.position() - position) > 99) - mediaPlayer.setPosition(position); -} - -void MusicPlayer::updateInfo() -{ - QStringList info; - if (!fileName.isEmpty()) - info.append(fileName); - if (mediaPlayer.isMetaDataAvailable()) { - QString author = mediaPlayer.metaData(QStringLiteral("Author")).toString(); - if (!author.isEmpty()) - info.append(author); - QString title = mediaPlayer.metaData(QStringLiteral("Title")).toString(); - if (!title.isEmpty()) - info.append(title); - } - info.append(formatTime(mediaPlayer.duration())); - infoLabel->setText(info.join(tr(" - "))); -} - -void MusicPlayer::handleError() -{ - playButton->setEnabled(false); - const QString errorString = mediaPlayer.errorString(); - infoLabel->setText(errorString.isEmpty() - ? tr("Unknown error #%1").arg(int(mediaPlayer.error())) - : tr("Error: %1").arg(errorString)); -} - -//! [2] -void MusicPlayer::updateTaskbar() -{ - switch (mediaPlayer.state()) { - case QMediaPlayer::PlayingState: - taskbarButton->setOverlayIcon(style()->standardIcon(QStyle::SP_MediaPlay)); - taskbarProgress->show(); - taskbarProgress->resume(); - break; - case QMediaPlayer::PausedState: - taskbarButton->setOverlayIcon(style()->standardIcon(QStyle::SP_MediaPause)); - taskbarProgress->show(); - taskbarProgress->pause(); - break; - case QMediaPlayer::StoppedState: - taskbarButton->setOverlayIcon(style()->standardIcon(QStyle::SP_MediaStop)); - taskbarProgress->hide(); - break; - } -} -//! [2] - -//! [3] -void MusicPlayer::updateThumbnailToolBar() -{ - playToolButton->setEnabled(mediaPlayer.duration() > 0); - backwardToolButton->setEnabled(mediaPlayer.position() > 0); - forwardToolButton->setEnabled(mediaPlayer.position() < mediaPlayer.duration()); - - if (mediaPlayer.state() == QMediaPlayer::PlayingState) { - playToolButton->setToolTip(tr("Pause")); - playToolButton->setIcon(style()->standardIcon(QStyle::SP_MediaPause)); - } else { - playToolButton->setToolTip(tr("Play")); - playToolButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); - } -} -//! [3] - -void MusicPlayer::createWidgets() -{ - playButton = new QToolButton(this); - playButton->setEnabled(false); - playButton->setToolTip(tr("Play")); - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); - connect(playButton, &QAbstractButton::clicked, this, &MusicPlayer::togglePlayback); - - QAbstractButton *openButton = new QToolButton(this); - openButton->setText(tr("...")); - openButton->setToolTip(tr("Open a file...")); - openButton->setFixedSize(playButton->sizeHint()); - connect(openButton, &QAbstractButton::clicked, this, &MusicPlayer::openFile); - - volumeButton = new VolumeButton(this); - volumeButton->setToolTip(tr("Adjust volume")); - volumeButton->setVolume(mediaPlayer.volume()); - connect(volumeButton, &VolumeButton::volumeChanged, &mediaPlayer, &QMediaPlayer::setVolume); - - positionSlider = new QSlider(Qt::Horizontal, this); - positionSlider->setEnabled(false); - positionSlider->setToolTip(tr("Seek")); - connect(positionSlider, &QAbstractSlider::valueChanged, this, &MusicPlayer::setPosition); - - infoLabel = new QLabel(this); - positionLabel = new QLabel(tr("00:00"), this); - positionLabel->setMinimumWidth(positionLabel->sizeHint().width()); - - QBoxLayout *controlLayout = new QHBoxLayout; - controlLayout->setMargin(0); - controlLayout->addWidget(openButton); - controlLayout->addWidget(playButton); - controlLayout->addWidget(positionSlider); - controlLayout->addWidget(positionLabel); - controlLayout->addWidget(volumeButton); - - QBoxLayout *mainLayout = new QVBoxLayout(this); - mainLayout->addWidget(infoLabel); - mainLayout->addLayout(controlLayout); -} - -void MusicPlayer::createShortcuts() -{ - QShortcut *quitShortcut = new QShortcut(QKeySequence::Quit, this); - connect(quitShortcut, &QShortcut::activated, QCoreApplication::quit); - - QShortcut *openShortcut = new QShortcut(QKeySequence::Open, this); - connect(openShortcut, &QShortcut::activated, this, &MusicPlayer::openFile); - - QShortcut *toggleShortcut = new QShortcut(Qt::Key_Space, this); - connect(toggleShortcut, &QShortcut::activated, this, &MusicPlayer::togglePlayback); - - QShortcut *forwardShortcut = new QShortcut(Qt::Key_Right, this); - connect(forwardShortcut, &QShortcut::activated, this, &MusicPlayer::seekForward); - - QShortcut *backwardShortcut = new QShortcut(Qt::Key_Left, this); - connect(backwardShortcut, &QShortcut::activated, this, &MusicPlayer::seekBackward); - - QShortcut *increaseShortcut = new QShortcut(Qt::Key_Up, this); - connect(increaseShortcut, &QShortcut::activated, volumeButton, &VolumeButton::increaseVolume); - - QShortcut *decreaseShortcut = new QShortcut(Qt::Key_Down, this); - connect(decreaseShortcut, &QShortcut::activated, volumeButton, &VolumeButton::descreaseVolume); -} - -//! [4] -void MusicPlayer::createJumpList() -{ - QWinJumpList jumplist; - jumplist.recent()->setVisible(true); -} -//! [4] - -//! [5] -void MusicPlayer::createTaskbar() -{ - taskbarButton = new QWinTaskbarButton(this); - - taskbarProgress = taskbarButton->progress(); - connect(positionSlider, &QAbstractSlider::valueChanged, taskbarProgress, &QWinTaskbarProgress::setValue); - connect(positionSlider, &QAbstractSlider::rangeChanged, taskbarProgress, &QWinTaskbarProgress::setRange); - - connect(&mediaPlayer, &QMediaPlayer::stateChanged, this, &MusicPlayer::updateTaskbar); -} -//! [5] - -//! [6] -void MusicPlayer::createThumbnailToolBar() -{ - thumbnailToolBar = new QWinThumbnailToolBar(this); - - playToolButton = new QWinThumbnailToolButton(thumbnailToolBar); - playToolButton->setEnabled(false); - playToolButton->setToolTip(tr("Play")); - playToolButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); - connect(playToolButton, &QWinThumbnailToolButton::clicked, this, &MusicPlayer::togglePlayback); - - forwardToolButton = new QWinThumbnailToolButton(thumbnailToolBar); - forwardToolButton->setEnabled(false); - forwardToolButton->setToolTip(tr("Fast forward")); - forwardToolButton->setIcon(style()->standardIcon(QStyle::SP_MediaSeekForward)); - connect(forwardToolButton, &QWinThumbnailToolButton::clicked, this, &MusicPlayer::seekForward); - - backwardToolButton = new QWinThumbnailToolButton(thumbnailToolBar); - backwardToolButton->setEnabled(false); - backwardToolButton->setToolTip(tr("Rewind")); - backwardToolButton->setIcon(style()->standardIcon(QStyle::SP_MediaSeekBackward)); - connect(backwardToolButton, &QWinThumbnailToolButton::clicked, this, &MusicPlayer::seekBackward); - - thumbnailToolBar->addButton(backwardToolButton); - thumbnailToolBar->addButton(playToolButton); - thumbnailToolBar->addButton(forwardToolButton); - - connect(&mediaPlayer, &QMediaPlayer::positionChanged, this, &MusicPlayer::updateThumbnailToolBar); - connect(&mediaPlayer, &QMediaPlayer::durationChanged, this, &MusicPlayer::updateThumbnailToolBar); - connect(&mediaPlayer, &QMediaPlayer::stateChanged, this, &MusicPlayer::updateThumbnailToolBar); -} -//! [6] diff --git a/examples/winextras/musicplayer/musicplayer.h b/examples/winextras/musicplayer/musicplayer.h deleted file mode 100644 index 49dd25b..0000000 --- a/examples/winextras/musicplayer/musicplayer.h +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef MUSICPLAYER_H -#define MUSICPLAYER_H - -#include <QWidget> -#include <QMediaPlayer> - -class VolumeButton; - -QT_FORWARD_DECLARE_CLASS(QLabel) -QT_FORWARD_DECLARE_CLASS(QSlider) -QT_FORWARD_DECLARE_CLASS(QAbstractButton) -QT_FORWARD_DECLARE_CLASS(QWinTaskbarButton) -QT_FORWARD_DECLARE_CLASS(QWinTaskbarProgress) -QT_FORWARD_DECLARE_CLASS(QWinThumbnailToolBar) -QT_FORWARD_DECLARE_CLASS(QWinThumbnailToolButton) - -class MusicPlayer : public QWidget -{ - Q_OBJECT -public: - explicit MusicPlayer(QWidget *parent = nullptr); - - static QStringList supportedMimeTypes(); - static QStringList supportedSuffixes(); - -public slots: - void openFile(); - void playUrl(const QUrl& url); - void togglePlayback(); - void seekForward(); - void seekBackward(); - -protected: - bool event(QEvent *event) override; - void showEvent(QShowEvent *event) override; - void dragEnterEvent(QDragEnterEvent *event) override; - void dropEvent(QDropEvent *event) override; - void mousePressEvent(QMouseEvent *event) override; - void mouseMoveEvent(QMouseEvent *event) override; - void mouseReleaseEvent(QMouseEvent *event) override; - -private slots: - void stylize(); - void updateState(QMediaPlayer::State state); - void updatePosition(qint64 position); - void updateDuration(qint64 duration); - void setPosition(int position); - void updateInfo(); - void handleError(); - - void updateTaskbar(); - void updateThumbnailToolBar(); - -private: - void createWidgets(); - void createShortcuts(); - void createJumpList(); - void createTaskbar(); - void createThumbnailToolBar(); - - QWinTaskbarButton *taskbarButton = nullptr; - QWinTaskbarProgress *taskbarProgress = nullptr; - QWinThumbnailToolBar *thumbnailToolBar = nullptr; - QWinThumbnailToolButton *playToolButton = nullptr; - QWinThumbnailToolButton *forwardToolButton = nullptr; - QWinThumbnailToolButton *backwardToolButton = nullptr; - - QMediaPlayer mediaPlayer; - QAbstractButton *playButton = nullptr; - VolumeButton *volumeButton = nullptr; - QSlider *positionSlider = nullptr; - QLabel *positionLabel = nullptr; - QLabel *infoLabel = nullptr; - QPoint offset; - QString fileName; -}; - -#endif // MUSICPLAYER_H diff --git a/examples/winextras/musicplayer/musicplayer.pro b/examples/winextras/musicplayer/musicplayer.pro deleted file mode 100644 index ae8f4eb..0000000 --- a/examples/winextras/musicplayer/musicplayer.pro +++ /dev/null @@ -1,18 +0,0 @@ -TEMPLATE = app -TARGET = musicplayer - -QT += widgets multimedia winextras - -HEADERS = \ - musicplayer.h \ - volumebutton.h - -SOURCES = \ - main.cpp \ - musicplayer.cpp \ - volumebutton.cpp - -RC_ICONS = images/qt-logo.ico - -target.path = $$[QT_INSTALL_EXAMPLES]/winextras/musicplayer -INSTALLS += target diff --git a/examples/winextras/musicplayer/volumebutton.cpp b/examples/winextras/musicplayer/volumebutton.cpp deleted file mode 100644 index 908dba1..0000000 --- a/examples/winextras/musicplayer/volumebutton.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "volumebutton.h" - -#include <QtWidgets> -#include <QtWinExtras> - -VolumeButton::VolumeButton(QWidget *parent) : - QToolButton(parent) -{ - setIcon(style()->standardIcon(QStyle::SP_MediaVolume)); - setPopupMode(QToolButton::InstantPopup); - - QWidget *popup = new QWidget(this); - - slider = new QSlider(Qt::Horizontal, popup); - slider->setRange(0, 100); - connect(slider, &QAbstractSlider::valueChanged, this, &VolumeButton::volumeChanged); - - label = new QLabel(popup); - label->setAlignment(Qt::AlignCenter); - label->setNum(100); - label->setMinimumWidth(label->sizeHint().width()); - - connect(slider, &QAbstractSlider::valueChanged, label, QOverload<int>::of(&QLabel::setNum)); - - QBoxLayout *popupLayout = new QHBoxLayout(popup); - popupLayout->setMargin(2); - popupLayout->addWidget(slider); - popupLayout->addWidget(label); - - auto *action = new QWidgetAction(this); - action->setDefaultWidget(popup); - - menu = new QMenu(this); - menu->addAction(action); - setMenu(menu); - - stylize(); -} - -void VolumeButton::increaseVolume() -{ - slider->triggerAction(QSlider::SliderPageStepAdd); -} - -void VolumeButton::descreaseVolume() -{ - slider->triggerAction(QSlider::SliderPageStepSub); -} - -int VolumeButton::volume() const -{ - return slider->value(); -} - -void VolumeButton::setVolume(int volume) -{ - slider->setValue(volume); -} - -//! [0] -void VolumeButton::stylize() -{ - if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8) { - // Set styling options relevant only to Windows 7. - if (QtWin::isCompositionEnabled()) { - QtWin::enableBlurBehindWindow(menu); - QString css("QMenu { border: 1px solid %1; border-radius: 2px; background: transparent; }"); - menu->setStyleSheet(css.arg(QtWin::realColorizationColor().name())); - } else { - QtWin::disableBlurBehindWindow(menu); - QString css("QMenu { border: 1px solid black; background: %1; }"); - menu->setStyleSheet(css.arg(QtWin::realColorizationColor().name())); - } - } -} -//! [0] diff --git a/examples/winextras/musicplayer/volumebutton.h b/examples/winextras/musicplayer/volumebutton.h deleted file mode 100644 index c6673d2..0000000 --- a/examples/winextras/musicplayer/volumebutton.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef VOLUMEBUTTON_H -#define VOLUMEBUTTON_H - -#include <QToolButton> - -QT_FORWARD_DECLARE_CLASS(QMenu) -QT_FORWARD_DECLARE_CLASS(QLabel) -QT_FORWARD_DECLARE_CLASS(QSlider) - -class VolumeButton : public QToolButton -{ - Q_OBJECT - Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged) - -public: - explicit VolumeButton(QWidget *parent = nullptr); - - int volume() const; - -public slots: - void increaseVolume(); - void descreaseVolume(); - void setVolume(int volume); - void stylize(); - -signals: - void volumeChanged(int volume); - -private: - QMenu *menu = nullptr; - QLabel *label = nullptr; - QSlider *slider = nullptr; -}; - -#endif // VOLUMEBUTTON_H diff --git a/examples/winextras/quickplayer/CMakeLists.txt b/examples/winextras/quickplayer/CMakeLists.txt deleted file mode 100644 index 9c46fb9..0000000 --- a/examples/winextras/quickplayer/CMakeLists.txt +++ /dev/null @@ -1,79 +0,0 @@ -# Generated from quickplayer.pro. - -cmake_minimum_required(VERSION 3.14) -project(quickplayer LANGUAGES CXX) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) - -if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") -endif() - -set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/winextras/quickplayer") - -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) - -add_qt_gui_executable(quickplayer - main.cpp -) -target_link_libraries(quickplayer PUBLIC - Qt::Core - Qt::Gui - Qt::Quick -) - - -# Resources: -set_source_files_properties("images/media-pause-16.png" - PROPERTIES QT_RESOURCE_ALIAS "pause-16.png" -) -set_source_files_properties("images/media-pause-32.png" - PROPERTIES QT_RESOURCE_ALIAS "pause-32.png" -) -set_source_files_properties("images/media-play-16.png" - PROPERTIES QT_RESOURCE_ALIAS "play-16.png" -) -set_source_files_properties("images/media-play-32.png" - PROPERTIES QT_RESOURCE_ALIAS "play-32.png" -) -set_source_files_properties("images/media-seek-backward-32.png" - PROPERTIES QT_RESOURCE_ALIAS "backward-32.png" -) -set_source_files_properties("images/media-seek-forward-32.png" - PROPERTIES QT_RESOURCE_ALIAS "forward-32.png" -) -set_source_files_properties("images/media-stop-32.png" - PROPERTIES QT_RESOURCE_ALIAS "stop-32.png" -) -set_source_files_properties("qml/main.qml" - PROPERTIES QT_RESOURCE_ALIAS "main.qml" -) -set(quickplayer_resource_files - "images/media-pause-16.png" - "images/media-pause-32.png" - "images/media-play-16.png" - "images/media-play-32.png" - "images/media-seek-backward-32.png" - "images/media-seek-forward-32.png" - "images/media-stop-32.png" - "qml/main.qml" -) - -qt6_add_resources(quickplayer "quickplayer" - PREFIX - "/" - FILES - ${quickplayer_resource_files} -) - -install(TARGETS quickplayer - RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" - BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" - LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" -) diff --git a/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-composited.png b/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-composited.png Binary files differdeleted file mode 100644 index 76c8734..0000000 --- a/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-composited.png +++ /dev/null diff --git a/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-non-composited.png b/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-non-composited.png Binary files differdeleted file mode 100644 index 23fdc56..0000000 --- a/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-non-composited.png +++ /dev/null diff --git a/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-taskbar.png b/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-taskbar.png Binary files differdeleted file mode 100644 index 17d62b8..0000000 --- a/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-taskbar.png +++ /dev/null diff --git a/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-thumbnail.png b/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-thumbnail.png Binary files differdeleted file mode 100644 index 0312ee2..0000000 --- a/examples/winextras/quickplayer/doc/images/qtwinextras-quickplayer-thumbnail.png +++ /dev/null diff --git a/examples/winextras/quickplayer/doc/src/qtwinextras-quickplayer.qdoc b/examples/winextras/quickplayer/doc/src/qtwinextras-quickplayer.qdoc deleted file mode 100644 index 02fe61c..0000000 --- a/examples/winextras/quickplayer/doc/src/qtwinextras-quickplayer.qdoc +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example quickplayer - \title Quick Player - \ingroup examples-qtwinextras - \brief Demonstrates using QtWinExtras in Qt Quick. - - \image qtwinextras-quickplayer-composited.png Screenshot of the Quick Player example - - The Quick Player example demonstrates how to use the various features - provided by the QtWinExtras module in Qt Quick. - - \note This example is a simplified Qt Quick-based version of the \l {Music Player} example. - - \section1 DWM Features - - The example uses Windows DWM (Desktop Window Manager) features to visually - integrate the window content to the window frame and to make the window - translucent and blurred. - - The example applies a different look based on whether composition is enabled - or not. When composition is enabled, the window is made translucent and - the window frame is extended to the client area to make the window content - integrate seamlessly to the window frame as shown above. - - \snippet quickplayer/qml/main.qml dwm - - When composition is disabled, the colorization color is used as a background - color for the window. - - \snippet quickplayer/qml/main.qml color - - The following screenshot illustrates how the Quick Player example looks when - composition is disabled. - - \image qtwinextras-quickplayer-non-composited.png Screenshot of the Quick Player example - - \section1 Taskbar Overlay and Progress - - The example uses Windows Taskbar for two things; it sets an overlay icon - that represents the current music playback state, and it indicates the - playback progress in the taskbar button. - - \image qtwinextras-quickplayer-taskbar.png Screenshot of the Quick Player taskbar - - The following snippet shows how the taskbar button is prepared. The taskbar progress - indicator and the overlay icon are bound to the music playback, and will automatically - change whenever the state or attributes of the music playback change. - - \snippet quickplayer/qml/main.qml taskbar - - \section1 Thumbnail Toolbar - - \image qtwinextras-quickplayer-thumbnail.png Screenshot of the Quick Player thumbnail - - The Windows Thumbnail Toolbar is used for providing basic music playback - controls. These controls can be used to control the application without - having to activate the application. The thumbnail toolbar buttons are bound - to the music playback, and will automatically change whenever the state or - attributes of the music playback changes. - - \snippet quickplayer/qml/main.qml thumbbar -*/ diff --git a/examples/winextras/quickplayer/images/media-pause-16.png b/examples/winextras/quickplayer/images/media-pause-16.png Binary files differdeleted file mode 100644 index 8d06287..0000000 --- a/examples/winextras/quickplayer/images/media-pause-16.png +++ /dev/null diff --git a/examples/winextras/quickplayer/images/media-pause-32.png b/examples/winextras/quickplayer/images/media-pause-32.png Binary files differdeleted file mode 100644 index 3f172a0..0000000 --- a/examples/winextras/quickplayer/images/media-pause-32.png +++ /dev/null diff --git a/examples/winextras/quickplayer/images/media-play-16.png b/examples/winextras/quickplayer/images/media-play-16.png Binary files differdeleted file mode 100644 index d7ee3cc..0000000 --- a/examples/winextras/quickplayer/images/media-play-16.png +++ /dev/null diff --git a/examples/winextras/quickplayer/images/media-play-32.png b/examples/winextras/quickplayer/images/media-play-32.png Binary files differdeleted file mode 100644 index af8d2f7..0000000 --- a/examples/winextras/quickplayer/images/media-play-32.png +++ /dev/null diff --git a/examples/winextras/quickplayer/images/media-seek-backward-32.png b/examples/winextras/quickplayer/images/media-seek-backward-32.png Binary files differdeleted file mode 100644 index c14112e..0000000 --- a/examples/winextras/quickplayer/images/media-seek-backward-32.png +++ /dev/null diff --git a/examples/winextras/quickplayer/images/media-seek-forward-32.png b/examples/winextras/quickplayer/images/media-seek-forward-32.png Binary files differdeleted file mode 100644 index 00c0747..0000000 --- a/examples/winextras/quickplayer/images/media-seek-forward-32.png +++ /dev/null diff --git a/examples/winextras/quickplayer/images/media-stop-32.png b/examples/winextras/quickplayer/images/media-stop-32.png Binary files differdeleted file mode 100644 index aae24ba..0000000 --- a/examples/winextras/quickplayer/images/media-stop-32.png +++ /dev/null diff --git a/examples/winextras/quickplayer/images/qt-logo.ico b/examples/winextras/quickplayer/images/qt-logo.ico Binary files differdeleted file mode 100644 index b5ac59b..0000000 --- a/examples/winextras/quickplayer/images/qt-logo.ico +++ /dev/null diff --git a/examples/winextras/quickplayer/main.cpp b/examples/winextras/quickplayer/main.cpp deleted file mode 100644 index caf3a01..0000000 --- a/examples/winextras/quickplayer/main.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QQmlApplicationEngine> -#include <QGuiApplication> -#include <QCommandLineParser> -#include <QCommandLineOption> -#include <QWindow> -#include <QQmlContext> -#include <QStandardPaths> -#include <QDir> - -int main(int argc, char *argv[]) -{ - QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - QGuiApplication app(argc, argv); - QCoreApplication::setApplicationName(QStringLiteral("QuickPlayer")); - QCoreApplication::setApplicationVersion(QLatin1String(QT_VERSION_STR)); - QCoreApplication::setOrganizationName(QStringLiteral("QtWinExtras")); - QCoreApplication::setOrganizationDomain(QStringLiteral("qt-project.org")); - QGuiApplication::setApplicationDisplayName(QStringLiteral("QtWinExtras Quick Player")); - - QQmlApplicationEngine engine; - const QStringList musicPaths = QStandardPaths::standardLocations(QStandardPaths::MusicLocation); - const QUrl musicUrl = QUrl::fromLocalFile(musicPaths.isEmpty() ? QDir::homePath() : musicPaths.first()); - engine.rootContext()->setContextProperty(QStringLiteral("musicUrl"), musicUrl); - - QCommandLineParser parser; - parser.setApplicationDescription(QGuiApplication::applicationDisplayName()); - parser.addHelpOption(); - parser.addVersionOption(); - parser.addPositionalArgument(QStringLiteral("url"), QStringLiteral("The URL to open.")); - parser.process(app); - QUrl commandLineUrl; - if (!parser.positionalArguments().isEmpty()) - commandLineUrl = QUrl::fromUserInput(parser.positionalArguments().constFirst(), QDir::currentPath(), QUrl::AssumeLocalFile); - engine.rootContext()->setContextProperty(QStringLiteral("url"), commandLineUrl); - - engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); - QObject *root = engine.rootObjects().value(0); - if (QWindow *window = qobject_cast<QWindow *>(root)) - window->show(); - else - return -1; - return app.exec(); -} diff --git a/examples/winextras/quickplayer/qml/main.qml b/examples/winextras/quickplayer/qml/main.qml deleted file mode 100644 index ec059e3..0000000 --- a/examples/winextras/quickplayer/qml/main.qml +++ /dev/null @@ -1,216 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.1 -import QtQuick.Window 2.1 -import QtQuick.Layouts 1.0 -import QtQuick.Controls 1.0 -import QtQuick.Dialogs 1.0 -import QtMultimedia 5.0 -import QtWinExtras 1.0 as Win - -Window { - id: window - - title: qsTr("QtWinExtras Quick Player") - - width: 300 - height: 60 - minimumWidth: row.implicitWidth + 18 - minimumHeight: column.implicitHeight + 18 - - //! [color] - color: dwm.compositionEnabled ? "transparent" : dwm.realColorizationColor - //! [color] - - //! [dwm] - Win.DwmFeatures { - id: dwm - - topGlassMargin: -1 - leftGlassMargin: -1 - rightGlassMargin: -1 - bottomGlassMargin: -1 - } - //! [dwm] - - //! [taskbar] - Win.TaskbarButton { - id: taskbar - - progress.value: mediaPlayer.position - progress.maximum: mediaPlayer.duration - progress.visible: mediaPlayer.hasAudio - progress.paused: mediaPlayer.playbackState === MediaPlayer.PausedState - - overlay.iconSource: mediaPlayer.playbackState === MediaPlayer.PlayingState ? "qrc:/play-32.png" : - mediaPlayer.playbackState === MediaPlayer.PausedState ? "qrc:/pause-32.png" : "qrc:/stop-32.png" - } - //! [taskbar] - - //! [thumbbar] - Win.ThumbnailToolBar { - id: thumbbar - - Win.ThumbnailToolButton { - tooltip: qsTr("Rewind") - iconSource: "qrc:/backward-32.png" - - enabled: mediaPlayer.position > 0 - onClicked: mediaPlayer.seek(mediaPlayer.position - mediaPlayer.duration / 10) - } - - Win.ThumbnailToolButton { - tooltip: mediaPlayer.playbackState === MediaPlayer.PlayingState ? qsTr("Pause") : qsTr("Play") - iconSource: mediaPlayer.playbackState === MediaPlayer.PlayingState ? "qrc:/pause-32.png" : "qrc:/play-32.png" - - enabled: mediaPlayer.hasAudio - onClicked: mediaPlayer.playbackState === MediaPlayer.PlayingState ? mediaPlayer.pause() : mediaPlayer.play() - } - - Win.ThumbnailToolButton { - tooltip: qsTr("Fast forward") - iconSource: "qrc:/forward-32.png" - - enabled: mediaPlayer.position < mediaPlayer.duration - onClicked: mediaPlayer.seek(mediaPlayer.position + mediaPlayer.duration / 10) - } - } - //! [thumbbar] - - MediaPlayer { - id: mediaPlayer - autoPlay: true - source : url - readonly property string title: !!metaData.author && !!metaData.title - ? qsTr("%1 - %2").arg(metaData.author).arg(metaData.title) - : metaData.author || metaData.title || source - } - - ColumnLayout { - id: column - - anchors.margins: 9 - anchors.fill: parent - - Label { - id: infoLabel - - elide: Qt.ElideLeft - verticalAlignment: Qt.AlignVCenter - text: mediaPlayer.errorString || mediaPlayer.title - Layout.minimumHeight: infoLabel.implicitHeight - Layout.fillWidth: true - Layout.fillHeight: true - } - - RowLayout { - id: row - - Button { - id: openButton - - text: qsTr("...") - Layout.preferredWidth: openButton.implicitHeight - onClicked: fileDialog.open() - - FileDialog { - id: fileDialog - - folder : musicUrl - title: qsTr("Open file") - nameFilters: [qsTr("MP3 files (*.mp3)"), qsTr("All files (*.*)")] - onAccepted: mediaPlayer.source = fileDialog.fileUrl - } - } - - Button { - id: playButton - - enabled: mediaPlayer.hasAudio - Layout.preferredWidth: playButton.implicitHeight - iconSource: mediaPlayer.playbackState === MediaPlayer.PlayingState ? "qrc:/pause-16.png" : "qrc:/play-16.png" - onClicked: mediaPlayer.playbackState === MediaPlayer.PlayingState ? mediaPlayer.pause() : mediaPlayer.play() - } - - Slider { - id: positionSlider - - Layout.fillWidth: true - maximumValue: mediaPlayer.duration - - property bool sync: false - - onValueChanged: { - if (!sync) - mediaPlayer.seek(value) - } - - Connections { - target: mediaPlayer - onPositionChanged: { - positionSlider.sync = true - positionSlider.value = mediaPlayer.position - positionSlider.sync = false - } - } - } - - Label { - id: positionLabel - - readonly property int minutes: Math.floor(mediaPlayer.position / 60000) - readonly property int seconds: Math.round((mediaPlayer.position % 60000) / 1000) - - text: Qt.formatTime(new Date(0, 0, 0, 0, minutes, seconds), qsTr("mm:ss")) - } - } - } -} diff --git a/examples/winextras/quickplayer/quickplayer.pro b/examples/winextras/quickplayer/quickplayer.pro deleted file mode 100644 index 77f9c97..0000000 --- a/examples/winextras/quickplayer/quickplayer.pro +++ /dev/null @@ -1,18 +0,0 @@ -TEMPLATE = app -TARGET = quickplayer - -QT += quick - -SOURCES = \ - main.cpp - -OTHER_FILES += \ - qml/main.qml - -RESOURCES += \ - quickplayer.qrc - -RC_ICONS = images/qt-logo.ico - -target.path = $$[QT_INSTALL_EXAMPLES]/winextras/quickplayer -INSTALLS += target diff --git a/examples/winextras/quickplayer/quickplayer.qrc b/examples/winextras/quickplayer/quickplayer.qrc deleted file mode 100644 index e046252..0000000 --- a/examples/winextras/quickplayer/quickplayer.qrc +++ /dev/null @@ -1,12 +0,0 @@ -<!DOCTYPE RCC><RCC version="1.0"> -<qresource> - <file alias="main.qml">qml/main.qml</file> - <file alias="pause-16.png">images/media-pause-16.png</file> - <file alias="pause-32.png">images/media-pause-32.png</file> - <file alias="play-16.png">images/media-play-16.png</file> - <file alias="play-32.png">images/media-play-32.png</file> - <file alias="backward-32.png">images/media-seek-backward-32.png</file> - <file alias="forward-32.png">images/media-seek-forward-32.png</file> - <file alias="stop-32.png">images/media-stop-32.png</file> -</qresource> -</RCC> diff --git a/examples/winextras/quickplayer/quickplayer.rc b/examples/winextras/quickplayer/quickplayer.rc deleted file mode 100644 index 00a51ee..0000000 --- a/examples/winextras/quickplayer/quickplayer.rc +++ /dev/null @@ -1 +0,0 @@ -IDI_ICON1 ICON DISCARDABLE "images\\musicplayer.ico" diff --git a/examples/winextras/winextras.pro b/examples/winextras/winextras.pro deleted file mode 100644 index 467d53b..0000000 --- a/examples/winextras/winextras.pro +++ /dev/null @@ -1,7 +0,0 @@ -TEMPLATE = subdirs -win32 { - SUBDIRS += \ - iconextractor - qtHaveModule(widgets):qtHaveModule(multimedia): SUBDIRS += musicplayer - qtHaveModule(quick):qtHaveModule(multimedia): SUBDIRS += quickplayer -} diff --git a/qtwinextras.pro b/qtwinextras.pro deleted file mode 100644 index a0ed379..0000000 --- a/qtwinextras.pro +++ /dev/null @@ -1,4 +0,0 @@ -requires(!winrt) -requires(qtHaveModule(gui)) - -load(qt_parts) diff --git a/src/.prev_CMakeLists.txt b/src/.prev_CMakeLists.txt deleted file mode 100644 index 92346ae..0000000 --- a/src/.prev_CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# Generated from src.pro. - -##################################################################### -## src Binary: -##################################################################### - -add_qt_executable(src - GUI - PUBLIC_LIBRARIES - Qt::Gui -) - -## Scopes: -##################################################################### - -#### Keys ignored in scope 2:.:.:src.pro:WIN32: -# SUBDIRS = "winextras" -# TEMPLATE = "subdirs" - -#### Keys ignored in scope 3:.:.:src.pro:TARGET Qt::Quick: -# SUBDIRS = "imports" - -#### Keys ignored in scope 4:.:.:src.pro:else: -# TEMPLATE = "aux" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index 8107ccb..0000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# special case begin -# Generated from src.pro. - -if(NOT WIN32) - return() -endif() - -add_subdirectory(winextras) -if(TARGET Qt::Quick) - add_subdirectory(imports) -endif() -# special case end diff --git a/src/imports/CMakeLists.txt b/src/imports/CMakeLists.txt deleted file mode 100644 index fdad931..0000000 --- a/src/imports/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Generated from imports.pro. - -add_subdirectory(winextras) diff --git a/src/imports/imports.pro b/src/imports/imports.pro deleted file mode 100644 index b8e59ad..0000000 --- a/src/imports/imports.pro +++ /dev/null @@ -1,2 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS += winextras diff --git a/src/imports/winextras/CMakeLists.txt b/src/imports/winextras/CMakeLists.txt deleted file mode 100644 index f31a6f6..0000000 --- a/src/imports/winextras/CMakeLists.txt +++ /dev/null @@ -1,65 +0,0 @@ -# Generated from winextras.pro. - -##################################################################### -## qml_winextras Plugin: -##################################################################### - -qt_add_qml_module(qml_winextras - URI "QtWinExtras" - VERSION "1.${CMAKE_PROJECT_VERSION_MINOR}" - CLASSNAME QWinExtrasQmlPlugin - SOURCES - plugin.cpp - qquickdwmfeatures.cpp qquickdwmfeatures_p.h - qquickdwmfeatures_p_p.h - qquickiconloader.cpp qquickiconloader_p.h - qquickjumplist.cpp qquickjumplist_p.h - qquickjumplistcategory.cpp qquickjumplistcategory_p.h - qquickjumplistitem.cpp qquickjumplistitem_p.h - qquicktaskbarbutton.cpp qquicktaskbarbutton_p.h - qquickthumbnailtoolbar.cpp qquickthumbnailtoolbar_p.h - qquickthumbnailtoolbutton.cpp qquickthumbnailtoolbutton_p.h - qquickwin_p.h - PUBLIC_LIBRARIES - Qt::Core - Qt::Gui - Qt::Qml - Qt::Quick - Qt::WinExtras - Qt::WinExtrasPrivate -) - -#### Keys ignored in scope 1:.:.:winextras.pro:<TRUE>: -# CXX_MODULE = "qml" -# IMPORT_VERSION = "1.$$QT_MINOR_VERSION" -# OTHER_FILES = "qmldir" "JumpListLink.qml" "JumpListDestination.qml" "JumpListSeparator.qml" -# QML_FILES = "JumpListLink.qml" "JumpListDestination.qml" "JumpListSeparator.qml" -# TARGETPATH = "QtWinExtras" - -## Scopes: -##################################################################### - -qt_extend_target(qml_winextras CONDITION QT_FEATURE_dynamicgl OR NOT TARGET Qt::OpenGL - LIBRARIES - user32 -) - -set(qml_files - "JumpListLink.qml" - "JumpListDestination.qml" - "JumpListSeparator.qml" -) -set_source_files_properties(JumpListLink.qml PROPERTIES - QT_QML_SOURCE_VERSION "1.0" -) -set_source_files_properties(JumpListDestination.qml PROPERTIES - QT_QML_SOURCE_VERSION "1.0" -) -set_source_files_properties(JumpListSeparator.qml PROPERTIES - QT_QML_SOURCE_VERSION "1.0" -) - -qt6_target_qml_files(qml_winextras - FILES - ${qml_files} -) diff --git a/src/imports/winextras/JumpListDestination.qml b/src/imports/winextras/JumpListDestination.qml deleted file mode 100644 index 2a26719..0000000 --- a/src/imports/winextras/JumpListDestination.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -import QtWinExtras 1.0 - -/*! - \qmltype JumpListDestination - \inherits JumpListItem - \inqmlmodule QtWinExtras - - \brief Represents a file that can be edited or viewed by an application. - - \since QtWinExtras 1.0 - - The JumpListDestination type contains a path to a file that users can select - from a Jump List to view or edit it with an application. - - */ - -JumpListItem { - __jumpListItemType: JumpListItem.ItemTypeDestination - - /*! - \qmlproperty string JumpListDestination::filePath - - The path to the file. - */ - property string filePath -} diff --git a/src/imports/winextras/JumpListLink.qml b/src/imports/winextras/JumpListLink.qml deleted file mode 100644 index fd27ad0..0000000 --- a/src/imports/winextras/JumpListLink.qml +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -import QtWinExtras 1.0 - -/*! - \qmltype JumpListLink - \inherits JumpListItem - \inqmlmodule QtWinExtras - - \brief Represents a command to execute an application. - - \since QtWinExtras 1.0 - - The JumpListLink type represents a command to execute an application. - - */ - -JumpListItem { - __jumpListItemType: JumpListItem.ItemTypeLink - - /*! - \qmlproperty string JumpListLink::iconPath - - The path to a link icon. - */ - property string iconPath - - /*! - \qmlproperty string JumpListLink::executablePath - - The path to an executable file. - */ - property string executablePath - - /*! - \qmlproperty string JumpListLink::arguments - - Command-line arguments. - */ - property string arguments - - /*! - \qmlproperty string JumpListLink::description - - The description of the link. - */ - property string description - - /*! - \qmlproperty string JumpListLink::title - - The title of the link. - */ - property string title -} diff --git a/src/imports/winextras/JumpListSeparator.qml b/src/imports/winextras/JumpListSeparator.qml deleted file mode 100644 index 3484afc..0000000 --- a/src/imports/winextras/JumpListSeparator.qml +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -import QtWinExtras 1.0 - -/*! - \qmltype JumpListSeparator - \inherits JumpListItem - \inqmlmodule QtWinExtras - - \brief Represents a task list separator. - - \since QtWinExtras 1.0 - - The JumpListSeparator type represents a separator in a Jump List. This value - is used only for task lists. - */ - -JumpListItem { - __jumpListItemType: JumpListItem.ItemTypeSeparator -} diff --git a/src/imports/winextras/plugin.cpp b/src/imports/winextras/plugin.cpp deleted file mode 100644 index eadf357..0000000 --- a/src/imports/winextras/plugin.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickdwmfeatures_p.h" -#include "qquicktaskbarbutton_p.h" -#include "qquickjumplist_p.h" -#include "qquickjumplistitem_p.h" -#include "qquickjumplistcategory_p.h" -#include "qquickthumbnailtoolbar_p.h" -#include "qquickthumbnailtoolbutton_p.h" -#include "qquickwin_p.h" - -#include <QtQml/qqmlextensionplugin.h> - -QT_BEGIN_NAMESPACE - -class QWinExtrasQmlPlugin : public QQmlExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid) - -public: - QWinExtrasQmlPlugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent) { } - void registerTypes(const char *uri) Q_DECL_OVERRIDE - { - Q_ASSERT(uri == QLatin1String("QtWinExtras")); - // The minor version used to be the current Qt 5 minor. For compatibility it is the last - // Qt 5 release. - qmlRegisterModule(uri, 1, 15); - qmlRegisterUncreatableType<QQuickWin>(uri, 1, 0, "QtWin", "Cannot create an instance of the QtWin namespace."); - qmlRegisterType<QQuickDwmFeatures>(uri, 1, 0, "DwmFeatures"); - qmlRegisterType<QQuickTaskbarButton>(uri, 1, 0, "TaskbarButton"); - qmlRegisterUncreatableType<QWinTaskbarProgress>(uri, 1, 0, "TaskbarProgress", "Cannot create TaskbarProgress - use TaskbarButton.progress instead."); - qmlRegisterUncreatableType<QQuickTaskbarOverlay>(uri, 1, 0, "TaskbarOverlay", "Cannot create TaskbarOverlay - use TaskbarButton.overlay instead."); - qmlRegisterType<QQuickJumpList>(uri, 1, 0, "JumpList"); - qmlRegisterType<QQuickJumpListItem>(uri, 1, 0, "JumpListItem"); - qmlRegisterType<QQuickJumpListCategory>(uri, 1, 0, "JumpListCategory"); - qmlRegisterType<QQuickThumbnailToolBar>(uri, 1, 0, "ThumbnailToolBar"); - qmlRegisterType<QQuickThumbnailToolButton>(uri, 1, 0, "ThumbnailToolButton"); - } -}; - -QT_END_NAMESPACE - -#include "plugin.moc" diff --git a/src/imports/winextras/plugins.qmltypes b/src/imports/winextras/plugins.qmltypes deleted file mode 100644 index fff1181..0000000 --- a/src/imports/winextras/plugins.qmltypes +++ /dev/null @@ -1,225 +0,0 @@ -import QtQuick.tooling 1.2 - -// This file describes the plugin-supplied types contained in the library. -// It is used for QML tooling purposes only. -// -// This file was auto-generated by: -// 'qmlplugindump -nonrelocatable QtWinExtras 1.13' - -Module { - dependencies: ["QtQuick 2.0"] - Component { - name: "QQuickDwmFeatures" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtWinExtras/DwmFeatures 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "compositionEnabled"; type: "bool" } - Property { name: "colorizationColor"; type: "QColor"; isReadonly: true } - Property { name: "realColorizationColor"; type: "QColor"; isReadonly: true } - Property { name: "colorizationOpaqueBlend"; type: "bool"; isReadonly: true } - Property { name: "topGlassMargin"; type: "int" } - Property { name: "rightGlassMargin"; type: "int" } - Property { name: "bottomGlassMargin"; type: "int" } - Property { name: "leftGlassMargin"; type: "int" } - Property { name: "blurBehindEnabled"; type: "bool" } - Property { name: "excludedFromPeek"; type: "bool" } - Property { name: "peekDisallowed"; type: "bool" } - Property { name: "flip3DPolicy"; type: "QQuickWin::WindowFlip3DPolicy" } - Property { name: "nonClientAreaRenderingPolicy"; type: "QQuickWin::WindowNonClientRenderingPolicy" } - } - Component { - name: "QQuickJumpList" - defaultProperty: "data" - prototype: "QObject" - exports: ["QtWinExtras/JumpList 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "recent"; type: "QQuickJumpListCategory"; isReadonly: true; isPointer: true } - Property { name: "frequent"; type: "QQuickJumpListCategory"; isReadonly: true; isPointer: true } - Property { name: "tasks"; type: "QQuickJumpListCategory"; isPointer: true } - Property { name: "categories"; type: "QQuickJumpListCategory"; isList: true; isReadonly: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - } - Component { - name: "QQuickJumpListCategory" - defaultProperty: "data" - prototype: "QObject" - exports: ["QtWinExtras/JumpListCategory 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "items"; type: "QQuickJumpListItem"; isList: true; isReadonly: true } - Property { name: "title"; type: "string" } - Property { name: "visible"; type: "bool" } - Signal { name: "visibilityChanged" } - } - Component { - name: "QQuickJumpListItem" - prototype: "QObject" - exports: ["QtWinExtras/JumpListItem 1.0"] - exportMetaObjectRevisions: [0] - Enum { - name: "JumpListItemType" - values: { - "ItemTypeLink": 1, - "ItemTypeDestination": 2, - "ItemTypeSeparator": 3 - } - } - Property { name: "__jumpListItemType"; type: "int" } - } - Component { - name: "QQuickTaskbarButton" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtWinExtras/TaskbarButton 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "overlay"; type: "QQuickTaskbarOverlay"; isReadonly: true; isPointer: true } - Property { name: "progress"; type: "QWinTaskbarProgress"; isReadonly: true; isPointer: true } - } - Component { - name: "QQuickTaskbarOverlay" - prototype: "QObject" - exports: ["QtWinExtras/TaskbarOverlay 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "iconSource"; type: "QUrl" } - Property { name: "accessibleDescription"; type: "string" } - } - Component { - name: "QQuickThumbnailToolBar" - defaultProperty: "data" - prototype: "QQuickItem" - exports: ["QtWinExtras/ThumbnailToolBar 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "count"; type: "int"; isReadonly: true } - Property { name: "data"; type: "QObject"; isList: true; isReadonly: true } - Property { name: "buttons"; type: "QQuickThumbnailToolButton"; isList: true; isReadonly: true } - Property { name: "iconicNotificationsEnabled"; type: "bool" } - Property { name: "iconicThumbnailSource"; type: "QUrl" } - Property { name: "iconicLivePreviewSource"; type: "QUrl" } - Signal { name: "iconicThumbnailRequested" } - Signal { name: "iconicLivePreviewRequested" } - Method { name: "clear" } - Method { - name: "addButton" - Parameter { name: "button"; type: "QQuickThumbnailToolButton"; isPointer: true } - } - Method { - name: "removeButton" - Parameter { name: "button"; type: "QQuickThumbnailToolButton"; isPointer: true } - } - } - Component { - name: "QQuickThumbnailToolButton" - prototype: "QObject" - exports: ["QtWinExtras/ThumbnailToolButton 1.0"] - exportMetaObjectRevisions: [0] - Property { name: "iconSource"; type: "QUrl" } - Property { name: "tooltip"; type: "string" } - Property { name: "enabled"; type: "bool" } - Property { name: "interactive"; type: "bool" } - Property { name: "visible"; type: "bool" } - Property { name: "dismissOnClick"; type: "bool" } - Property { name: "flat"; type: "bool" } - Signal { name: "clicked" } - } - Component { - name: "QQuickWin" - prototype: "QObject" - exports: ["QtWinExtras/QtWin 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Enum { - name: "HBitmapFormat" - values: { - "HBitmapNoAlpha": 0, - "HBitmapPremultipliedAlpha": 1, - "HBitmapAlpha": 2 - } - } - Enum { - name: "WindowFlip3DPolicy" - values: { - "FlipDefault": 0, - "FlipExcludeBelow": 1, - "FlipExcludeAbove": 2 - } - } - Enum { - name: "WindowNonClientRenderingPolicy" - values: { - "NonClientRenderingUseWindowStyle": 0, - "NonClientRenderingDisabled": 1, - "NonClientRenderingEnabled": 2 - } - } - } - Component { - name: "QWinTaskbarProgress" - prototype: "QObject" - exports: ["QtWinExtras/TaskbarProgress 1.0"] - isCreatable: false - exportMetaObjectRevisions: [0] - Property { name: "value"; type: "int" } - Property { name: "minimum"; type: "int" } - Property { name: "maximum"; type: "int" } - Property { name: "visible"; type: "bool" } - Property { name: "paused"; type: "bool" } - Property { name: "stopped"; type: "bool"; isReadonly: true } - Signal { - name: "valueChanged" - Parameter { name: "value"; type: "int" } - } - Signal { - name: "minimumChanged" - Parameter { name: "minimum"; type: "int" } - } - Signal { - name: "maximumChanged" - Parameter { name: "maximum"; type: "int" } - } - Signal { - name: "visibilityChanged" - Parameter { name: "visible"; type: "bool" } - } - Signal { - name: "pausedChanged" - Parameter { name: "paused"; type: "bool" } - } - Signal { - name: "stoppedChanged" - Parameter { name: "stopped"; type: "bool" } - } - Method { - name: "setValue" - Parameter { name: "value"; type: "int" } - } - Method { - name: "setMinimum" - Parameter { name: "minimum"; type: "int" } - } - Method { - name: "setMaximum" - Parameter { name: "maximum"; type: "int" } - } - Method { - name: "setRange" - Parameter { name: "minimum"; type: "int" } - Parameter { name: "maximum"; type: "int" } - } - Method { name: "reset" } - Method { name: "show" } - Method { name: "hide" } - Method { - name: "setVisible" - Parameter { name: "visible"; type: "bool" } - } - Method { name: "pause" } - Method { name: "resume" } - Method { - name: "setPaused" - Parameter { name: "paused"; type: "bool" } - } - Method { name: "stop" } - } -} diff --git a/src/imports/winextras/qmldir b/src/imports/winextras/qmldir deleted file mode 100644 index f3c244c..0000000 --- a/src/imports/winextras/qmldir +++ /dev/null @@ -1,6 +0,0 @@ -module QtWinExtras -plugin qml_winextras -JumpListLink 1.0 JumpListLink.qml -JumpListDestination 1.0 JumpListDestination.qml -JumpListSeparator 1.0 JumpListSeparator.qml -classname QWinExtrasQmlPlugin diff --git a/src/imports/winextras/qquickdwmfeatures.cpp b/src/imports/winextras/qquickdwmfeatures.cpp deleted file mode 100644 index 124d957..0000000 --- a/src/imports/winextras/qquickdwmfeatures.cpp +++ /dev/null @@ -1,399 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickdwmfeatures_p.h" -#include "qquickdwmfeatures_p_p.h" - -#include <QtWinExtras/private/qwineventfilter_p.h> -#include <QWinEvent> -#include <QQuickWindow> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype DwmFeatures - \instantiates QQuickDwmFeatures - \inqmlmodule QtWinExtras - - \brief Enables you to manage the Windows DWM features. - - \since QtWinExtras 1.0 - - The DwmFeatures type enables you to extend a glass frame into the client - area, as well as to control the behavior of Aero Peek and Flip3D. - */ - -/*! - \class QQuickDwmFeatures - \internal - */ - -QQuickDwmFeatures::QQuickDwmFeatures(QQuickItem *parent) : - QQuickItem(parent), d_ptr(new QQuickDwmFeaturesPrivate(this)) -{ - QWinEventFilter::setup(); -} - -QQuickDwmFeatures::~QQuickDwmFeatures() = default; - -void QQuickDwmFeatures::setCompositionEnabled(bool enabled) -{ - QtWin::setCompositionEnabled(enabled); -} - -bool QQuickDwmFeatures::isCompositionEnabled() const -{ - return QtWin::isCompositionEnabled(); -} - -QColor QQuickDwmFeatures::colorizationColor() const -{ - return QtWin::colorizationColor(); -} - -QColor QQuickDwmFeatures::realColorizationColor() const -{ - return QtWin::realColorizationColor(); -} - -bool QQuickDwmFeatures::colorizationOpaqueBlend() const -{ - bool opaque; - QtWin::colorizationColor(&opaque); - return opaque; -} - -/*! - \qmlproperty int DwmFeatures::topGlassMargin - - The top glass frame margin. The default value is 0. - */ -void QQuickDwmFeatures::setTopGlassMargin(int margin) -{ - Q_D(QQuickDwmFeatures); - if (d->topMargin == margin) - return; - - d->topMargin = margin; - if (window()) - QtWin::extendFrameIntoClientArea(window(), d->leftMargin, d->topMargin, d->rightMargin, d->bottomMargin); - emit topGlassMarginChanged(); -} - -/*! - \qmlproperty int DwmFeatures::rightGlassMargin - - The right glass frame margin. The default value is 0. - */ -void QQuickDwmFeatures::setRightGlassMargin(int margin) -{ - Q_D(QQuickDwmFeatures); - if (d->rightMargin == margin) - return; - - d->rightMargin = margin; - if (window()) - QtWin::extendFrameIntoClientArea(window(), d->leftMargin, d->topMargin, d->rightMargin, d->bottomMargin); - emit rightGlassMarginChanged(); -} - -/*! - \qmlproperty int DwmFeatures::bottomGlassMargin - - The bottom glass frame margin. The default value is 0. - */ -void QQuickDwmFeatures::setBottomGlassMargin(int margin) -{ - Q_D(QQuickDwmFeatures); - if (d->bottomMargin == margin) - return; - - d->bottomMargin = margin; - if (window()) - QtWin::extendFrameIntoClientArea(window(), d->leftMargin, d->topMargin, d->rightMargin, d->bottomMargin); - emit bottomGlassMarginChanged(); -} - -/*! - \qmlproperty int DwmFeatures::leftGlassMargin - - The left glass frame margin. The default value is 0. - */ -void QQuickDwmFeatures::setLeftGlassMargin(int margin) -{ - Q_D(QQuickDwmFeatures); - if (d->leftMargin == margin) - return; - - d->leftMargin = margin; - if (window()) - QtWin::extendFrameIntoClientArea(window(), d->leftMargin, d->topMargin, d->rightMargin, d->bottomMargin); - emit leftGlassMarginChanged(); -} - -int QQuickDwmFeatures::topGlassMargin() const -{ - Q_D(const QQuickDwmFeatures); - return d->topMargin; -} - -int QQuickDwmFeatures::rightGlassMargin() const -{ - Q_D(const QQuickDwmFeatures); - return d->rightMargin; -} - -int QQuickDwmFeatures::bottomGlassMargin() const -{ - Q_D(const QQuickDwmFeatures); - return d->bottomMargin; -} - -int QQuickDwmFeatures::leftGlassMargin() const -{ - Q_D(const QQuickDwmFeatures); - return d->leftMargin; -} - -/*! - \qmlproperty bool DwmFeatures::blurBehindEnabled - - Specifies whether the blur behind the window client area is enabled. - */ -bool QQuickDwmFeatures::isBlurBehindEnabled() const -{ - Q_D(const QQuickDwmFeatures); - return d->blurBehindEnabled; -} - -void QQuickDwmFeatures::setBlurBehindEnabled(bool enabled) -{ - Q_D(QQuickDwmFeatures); - if (d->blurBehindEnabled == enabled) - return; - - d->blurBehindEnabled = enabled; - if (window()) { - if (d->blurBehindEnabled) - QtWin::enableBlurBehindWindow(window()); - else - QtWin::disableBlurBehindWindow(window()); - } - emit blurBehindEnabledChanged(); -} - -/*! - \qmlproperty bool DwmFeatures::excludedFromPeek - - Specifies whether the window is excluded from Aero Peek. - The default value is false. - */ -bool QQuickDwmFeatures::isExcludedFromPeek() const -{ - Q_D(const QQuickDwmFeatures); - return window() ? QtWin::isWindowExcludedFromPeek(window()) : d->peekExcluded; -} - -void QQuickDwmFeatures::setExcludedFromPeek(bool exclude) -{ - Q_D(QQuickDwmFeatures); - if (d->peekExcluded == exclude) - return; - - d->peekExcluded = exclude; - if (window()) - QtWin::setWindowExcludedFromPeek(window(), d->peekExcluded); - emit excludedFromPeekChanged(); -} - -/*! - \qmlproperty bool DwmFeatures::peekDisallowed - - Set this value to true if you want to forbid Aero Peek when the user hovers - the mouse over the window thumbnail. The default value is false. -*/ -bool QQuickDwmFeatures::isPeekDisallowed() const -{ - Q_D(const QQuickDwmFeatures); - return window() ? QtWin::isWindowPeekDisallowed(window()) : d->peekDisallowed; -} - -void QQuickDwmFeatures::setPeekDisallowed(bool disallow) -{ - Q_D(QQuickDwmFeatures); - if (d->peekDisallowed == disallow) - return; - - d->peekDisallowed = disallow; - if (window()) - QtWin::setWindowDisallowPeek(window(), d->peekDisallowed); - emit peekDisallowedChanged(); -} - -/*! - \qmlproperty QtWin::WindowFlip3DPolicy DwmFeatures::flip3DPolicy - - The current Flip3D policy for the window. - */ -QQuickWin::WindowFlip3DPolicy QQuickDwmFeatures::flip3DPolicy() const -{ - Q_D(const QQuickDwmFeatures); - if (window()) - return static_cast<QQuickWin::WindowFlip3DPolicy>(QtWin::windowFlip3DPolicy(window())); - else - return d->flipPolicy; -} - -void QQuickDwmFeatures::setFlip3DPolicy(QQuickWin::WindowFlip3DPolicy policy) -{ - Q_D(QQuickDwmFeatures); - if (d->flipPolicy == policy) - return; - - d->flipPolicy = policy; - if (window()) - QtWin::setWindowFlip3DPolicy(window(), static_cast<QtWin::WindowFlip3DPolicy>(d->flipPolicy)); - emit flip3DPolicyChanged(); -} - -/*! - \qmlproperty QtWin::WindowNonClientRenderingPolicy DwmFeatures::nonClientAreaRenderingPolicy - - The current non-client area rendering policy for the window. - */ -QQuickWin::WindowNonClientRenderingPolicy QQuickDwmFeatures::nonClientAreaRenderingPolicy() const -{ - Q_D(const QQuickDwmFeatures); - if (window()) - return static_cast<QQuickWin::WindowNonClientRenderingPolicy>(QtWin::windowNonClientAreaRenderingPolicy(window())); - else - return d->nonClientRenderingPolicy; -} - -void QQuickDwmFeatures::setNonClientAreaRenderingPolicy(QQuickWin::WindowNonClientRenderingPolicy policy) -{ - Q_D(QQuickDwmFeatures); - if (d->nonClientRenderingPolicy == policy) - return; - - d->nonClientRenderingPolicy = policy; - if (window()) - QtWin::setWindowNonClientAreaRenderingPolicy(window(), static_cast<QtWin::WindowNonClientRenderingPolicy>(d->nonClientRenderingPolicy)); - emit nonClientAreaRenderingPolicyChanged(); -} - -bool QQuickDwmFeatures::eventFilter(QObject *object, QEvent *event) -{ - Q_D(QQuickDwmFeatures); - if (object == window()) { - if (event->type() == QWinEvent::CompositionChange) { - d->updateSurfaceFormat(); - if (static_cast<QWinCompositionChangeEvent *>(event)->isCompositionEnabled()) - d->updateAll(); - emit compositionEnabledChanged(); - } else if (event->type() == QWinEvent::ColorizationChange) { - emit colorizationColorChanged(); - emit realColorizationColorChanged(); - emit colorizationOpaqueBlendChanged(); - } - } - return QQuickItem::eventFilter(object, event); -} - -QQuickDwmFeatures *QQuickDwmFeatures::qmlAttachedProperties(QObject *parentObject) -{ - auto *featuresObj = new QQuickDwmFeatures(); - auto *parentItem = qobject_cast<QQuickItem *>(parentObject); - if (parentItem) - featuresObj->setParentItem(parentItem); - else - featuresObj->setParent(parentObject); - return featuresObj; -} - -void QQuickDwmFeatures::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - Q_D(QQuickDwmFeatures); - if (change == ItemSceneChange && data.window) { - d->updateAll(); - data.window->installEventFilter(this); - d->originalSurfaceColor = data.window->color(); - } - QQuickItem::itemChange(change, data); -} - - - -QQuickDwmFeaturesPrivate::QQuickDwmFeaturesPrivate(QQuickDwmFeatures *parent) : - q_ptr(parent) -{ -} - -void QQuickDwmFeaturesPrivate::updateAll() -{ - Q_Q(QQuickDwmFeatures); - QWindow *w = q->window(); - if (w) { - updateSurfaceFormat(); - QtWin::setWindowExcludedFromPeek(w, peekExcluded); - QtWin::setWindowDisallowPeek(w, peekDisallowed); - QtWin::setWindowFlip3DPolicy(w, static_cast<QtWin::WindowFlip3DPolicy>(flipPolicy)); - QtWin::setWindowNonClientAreaRenderingPolicy(w, static_cast<QtWin::WindowNonClientRenderingPolicy>(nonClientRenderingPolicy)); - if (blurBehindEnabled) - QtWin::enableBlurBehindWindow(w); - else - QtWin::disableBlurBehindWindow(w); - QtWin::extendFrameIntoClientArea(w, leftMargin, topMargin, rightMargin, bottomMargin); - } -} - -void QQuickDwmFeaturesPrivate::updateSurfaceFormat() -{ - Q_Q(QQuickDwmFeatures); - if (q->window()) { - const bool compositionEnabled = q->isCompositionEnabled(); - QSurfaceFormat format = q->window()->format(); - format.setAlphaBufferSize(compositionEnabled ? 8 : 0); - q->window()->setFormat(format); - q->window()->setColor(compositionEnabled ? QColor(Qt::transparent) : originalSurfaceColor); - } -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickdwmfeatures_p.h b/src/imports/winextras/qquickdwmfeatures_p.h deleted file mode 100644 index 3887d24..0000000 --- a/src/imports/winextras/qquickdwmfeatures_p.h +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKDWMFEATURES_P_H -#define QQUICKDWMFEATURES_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QQuickItem> -#include <QtWin> -#include <QColor> - -#include "qquickwin_p.h" - -QT_BEGIN_NAMESPACE - -class QQuickDwmFeaturesPrivate; - -class QQuickDwmFeatures : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(bool compositionEnabled READ isCompositionEnabled WRITE setCompositionEnabled NOTIFY compositionEnabledChanged) - Q_PROPERTY(QColor colorizationColor READ colorizationColor NOTIFY colorizationColorChanged) - Q_PROPERTY(QColor realColorizationColor READ realColorizationColor NOTIFY realColorizationColorChanged) - Q_PROPERTY(bool colorizationOpaqueBlend READ colorizationOpaqueBlend NOTIFY colorizationOpaqueBlendChanged) - Q_PROPERTY(int topGlassMargin READ topGlassMargin WRITE setTopGlassMargin NOTIFY topGlassMarginChanged) - Q_PROPERTY(int rightGlassMargin READ rightGlassMargin WRITE setRightGlassMargin NOTIFY rightGlassMarginChanged) - Q_PROPERTY(int bottomGlassMargin READ bottomGlassMargin WRITE setBottomGlassMargin NOTIFY bottomGlassMarginChanged) - Q_PROPERTY(int leftGlassMargin READ leftGlassMargin WRITE setLeftGlassMargin NOTIFY leftGlassMarginChanged) - Q_PROPERTY(bool blurBehindEnabled READ isBlurBehindEnabled WRITE setBlurBehindEnabled NOTIFY blurBehindEnabledChanged) - Q_PROPERTY(bool excludedFromPeek READ isExcludedFromPeek WRITE setExcludedFromPeek NOTIFY excludedFromPeekChanged) - Q_PROPERTY(bool peekDisallowed READ isPeekDisallowed WRITE setPeekDisallowed NOTIFY peekDisallowedChanged) - Q_PROPERTY(QQuickWin::WindowFlip3DPolicy flip3DPolicy READ flip3DPolicy WRITE setFlip3DPolicy NOTIFY flip3DPolicyChanged) - Q_PROPERTY(QQuickWin::WindowNonClientRenderingPolicy nonClientAreaRenderingPolicy READ nonClientAreaRenderingPolicy WRITE setNonClientAreaRenderingPolicy NOTIFY nonClientAreaRenderingPolicyChanged) - -public: - explicit QQuickDwmFeatures(QQuickItem *parent = nullptr); - ~QQuickDwmFeatures(); - - void setCompositionEnabled(bool enabled); - bool isCompositionEnabled() const; - QColor colorizationColor() const; - QColor realColorizationColor() const; - bool colorizationOpaqueBlend() const; - - void setTopGlassMargin(int margin); - void setRightGlassMargin(int margin); - void setBottomGlassMargin(int margin); - void setLeftGlassMargin(int margin); - int topGlassMargin() const; - int rightGlassMargin() const; - int bottomGlassMargin() const; - int leftGlassMargin() const; - bool isBlurBehindEnabled() const; - void setBlurBehindEnabled(bool enabled); - - bool isExcludedFromPeek() const; - void setExcludedFromPeek(bool exclude); - bool isPeekDisallowed() const; - void setPeekDisallowed(bool disallow); - QQuickWin::WindowFlip3DPolicy flip3DPolicy() const; - void setFlip3DPolicy(QQuickWin::WindowFlip3DPolicy policy); - QQuickWin::WindowNonClientRenderingPolicy nonClientAreaRenderingPolicy() const; - void setNonClientAreaRenderingPolicy(QQuickWin::WindowNonClientRenderingPolicy policy); - - bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE; - - static QQuickDwmFeatures *qmlAttachedProperties(QObject *object); - -Q_SIGNALS: - void colorizationColorChanged(); - void realColorizationColorChanged(); - void compositionEnabledChanged(); - void colorizationOpaqueBlendChanged(); - void topGlassMarginChanged(); - void rightGlassMarginChanged(); - void bottomGlassMarginChanged(); - void leftGlassMarginChanged(); - void blurBehindEnabledChanged(); - void excludedFromPeekChanged(); - void peekDisallowedChanged(); - void flip3DPolicyChanged(); - void nonClientAreaRenderingPolicyChanged(); - -protected: - void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE; - -private: - QScopedPointer<QQuickDwmFeaturesPrivate> d_ptr; - - Q_DECLARE_PRIVATE(QQuickDwmFeatures) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPEINFO(QQuickDwmFeatures, QML_HAS_ATTACHED_PROPERTIES) - -#endif // QQUICKDWMFEATURES_P_H diff --git a/src/imports/winextras/qquickdwmfeatures_p_p.h b/src/imports/winextras/qquickdwmfeatures_p_p.h deleted file mode 100644 index acf9dd6..0000000 --- a/src/imports/winextras/qquickdwmfeatures_p_p.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKDWMFEATURES_P_P_H -#define QQUICKDWMFEATURES_P_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qquickdwmfeatures_p.h" - -QT_BEGIN_NAMESPACE - -class QQuickDwmFeaturesPrivate -{ -public: - QQuickDwmFeaturesPrivate(QQuickDwmFeatures *parent); - - int topMargin = 0; - int rightMargin = 0; - int bottomMargin = 0; - int leftMargin = 0; - bool blurBehindEnabled = false; - - bool peekDisallowed = false; - bool peekExcluded = false; - QQuickWin::WindowFlip3DPolicy flipPolicy = QQuickWin::FlipDefault; - QQuickWin::WindowNonClientRenderingPolicy nonClientRenderingPolicy = QQuickWin::NonClientRenderingUseWindowStyle; - QColor originalSurfaceColor; - - void updateAll(); - void updateSurfaceFormat(); - -private: - QQuickDwmFeatures *q_ptr; - - Q_DECLARE_PUBLIC(QQuickDwmFeatures) -}; - -QT_END_NAMESPACE - -#endif // QQUICKDWMFEATURES_P_P_H diff --git a/src/imports/winextras/qquickiconloader.cpp b/src/imports/winextras/qquickiconloader.cpp deleted file mode 100644 index b5b7e5b..0000000 --- a/src/imports/winextras/qquickiconloader.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickiconloader_p.h" - -#include <QQmlEngine> -#include <QNetworkAccessManager> -#include <QFileInfo> -#include <QNetworkRequest> -#include <QNetworkReply> -#include <QQuickImageProvider> -#include <QQmlFile> -#include <qt_windows.h> - -QT_BEGIN_NAMESPACE - -QVariant QQuickIconLoader::loadFromFile(const QUrl &url, QVariant::Type type) -{ - const QString path = QQmlFile::urlToLocalFileOrQrc(url); - if (QFileInfo::exists(path)) { - switch (type) { - case QMetaType::QIcon: - return QVariant(QIcon(path)); - case QMetaType::QPixmap: - return QVariant(QPixmap(path)); - default: - qWarning("%s: Unsupported type: %d", Q_FUNC_INFO, int(type)); - break; - } - } - return QVariant(); -} - -QNetworkReply *QQuickIconLoader::loadFromNetwork(const QUrl &url, const QQmlEngine *engine) -{ - return engine->networkAccessManager()->get(QNetworkRequest(url)); -} - -QVariant QQuickIconLoader::loadFromImageProvider(const QUrl &url, const QQmlEngine *engine, - QVariant::Type type, QSize requestedSize) -{ - const QString providerId = url.host(); - const QString imageId = url.toString(QUrl::RemoveScheme | QUrl::RemoveAuthority).mid(1); - QQuickImageProvider::ImageType imageType = QQuickImageProvider::Invalid; - auto *provider = static_cast<QQuickImageProvider *>(engine->imageProvider(providerId)); - QSize size; - if (!requestedSize.isValid()) - requestedSize = QSize(GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON)); - if (provider) - imageType = provider->imageType(); - QPixmap pixmap; - switch (imageType) { - case QQuickImageProvider::Image: { - QImage image = provider->requestImage(imageId, &size, requestedSize); - if (!image.isNull()) - pixmap = QPixmap::fromImage(image); - } - break; - case QQuickImageProvider::Pixmap: - pixmap = provider->requestPixmap(imageId, &size, requestedSize); - break; - default: - break; - } - if (!pixmap.isNull()) { - switch (type) { - case QMetaType::QIcon: - return QVariant(QIcon(pixmap)); - case QMetaType::QPixmap: - return QVariant(pixmap); - default: - qWarning("%s: Unsupported type: %d", Q_FUNC_INFO, int(type)); - break; - } - } - return QVariant(); -} - -QQuickIconLoaderNetworkReplyHandler::QQuickIconLoaderNetworkReplyHandler(QNetworkReply *reply, QVariant::Type type) - : QObject(reply) - , m_type(type) -{ - connect(reply, &QNetworkReply::finished, this, &QQuickIconLoaderNetworkReplyHandler::onRequestFinished); -} - -void QQuickIconLoaderNetworkReplyHandler::onRequestFinished() -{ - auto *reply = qobject_cast<QNetworkReply *>(sender()); - Q_ASSERT(reply); - if (reply->error() != QNetworkReply::NoError) { - qWarning() << Q_FUNC_INFO << reply->url() << "failed:" << reply->errorString(); - return; - } - const QByteArray data = reply->readAll(); - QPixmap pixmap; - if (pixmap.loadFromData(data)) { - switch (m_type) { - case QMetaType::QIcon: - emit finished(QVariant(QIcon(pixmap))); - break; - case QMetaType::QPixmap: - emit finished(QVariant(pixmap)); - break; - default: - qWarning("%s: Unsupported type: %d", Q_FUNC_INFO, int(m_type)); - break; - } - } - reply->deleteLater(); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickiconloader_p.h b/src/imports/winextras/qquickiconloader_p.h deleted file mode 100644 index 22aaae6..0000000 --- a/src/imports/winextras/qquickiconloader_p.h +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKICONLOADER_P_H -#define QQUICKICONLOADER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QObject> -#include <QVariant> -#include <QUrl> -#include <QIcon> -#include <QPixmap> -#include <QDebug> - -QT_BEGIN_NAMESPACE - -class QIcon; -class QQmlEngine; -class QNetworkReply; - -class QQuickIconLoader -{ -public: - enum LoadResult { - LoadOk, - LoadError, - LoadNetworkRequestStarted, - }; - - // Load a QIcon (pass type = QMetaType::QIcon) or a QPixmap (pass type = - // QMetaType::QPixmap) from url. The function takes an object and member - // function pointer to a slot accepting a QVariant. For resources that can - // loaded synchronously ("file", "qrc" or "image"), the member function pointer - // will be invoked immediately with the result. For network resources, it will be - // connected to an object handling the network reply and invoked once it finishes. - template <typename Object> - static LoadResult load(const QUrl &url, const QQmlEngine *engine, - QVariant::Type type, const QSize &requestedSize, - Object *receiver, void (Object::*function)(const QVariant &)); - -private: - QQuickIconLoader() = default; - static QVariant loadFromFile(const QUrl &url, QVariant::Type type); - static QVariant loadFromImageProvider(const QUrl &url, const QQmlEngine *engine, - QVariant::Type type, QSize requestedSize); - static QNetworkReply *loadFromNetwork(const QUrl &url, const QQmlEngine *engine); -}; - -// Internal handler which loads the resource once QNetworkReply finishes -class QQuickIconLoaderNetworkReplyHandler : public QObject -{ - Q_OBJECT - -public: - explicit QQuickIconLoaderNetworkReplyHandler(QNetworkReply *reply, QVariant::Type); - -Q_SIGNALS: - void finished(const QVariant &); - -private Q_SLOTS: - void onRequestFinished(); - -private: - const QVariant::Type m_type; -}; - -template <typename Object> -QQuickIconLoader::LoadResult - QQuickIconLoader::load(const QUrl &url, const QQmlEngine *engine, - QVariant::Type type, const QSize &requestedSize, - Object *receiver, void (Object::*function)(const QVariant &)) -{ - const QString scheme = url.scheme(); - if (scheme.startsWith(u"http")) { - if (QNetworkReply *reply = QQuickIconLoader::loadFromNetwork(url, engine)) { - auto *handler = new QQuickIconLoaderNetworkReplyHandler(reply, type); - QObject::connect(handler, &QQuickIconLoaderNetworkReplyHandler::finished, receiver, function); - return LoadNetworkRequestStarted; - } - return LoadError; - } - const QVariant resource = scheme == u"image" - ? QQuickIconLoader::loadFromImageProvider(url, engine, type, requestedSize) - : QQuickIconLoader::loadFromFile(url, type); // qrc, file - if (resource.isValid()) { - (receiver->*function)(resource); - return LoadOk; - } - return LoadError; -} - -QT_END_NAMESPACE - -#endif // QQUICKICONLOADER_P_H diff --git a/src/imports/winextras/qquickjumplist.cpp b/src/imports/winextras/qquickjumplist.cpp deleted file mode 100644 index 615af08..0000000 --- a/src/imports/winextras/qquickjumplist.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickjumplist_p.h" -#include "qquickjumplistcategory_p.h" -#include <QWinJumpList> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype JumpList - \instantiates QQuickJumpList - \inqmlmodule QtWinExtras - - \brief Enables you to modify the application Jump List. - - \since QtWinExtras 1.0 - - The JumpList type enables you to modify Windows Jump Lists. - - An application can use Jump Lists to provide users with faster access to - files or to display shortcuts to tasks or commands. - */ - -/*! - \class QQuickJumpList - \internal - */ - -QQuickJumpList::QQuickJumpList(QObject *parent) : - QObject(parent) -{ -} - -QQuickJumpList::~QQuickJumpList() = default; - -/*! - \qmlproperty JumpListCategory JumpList::recent - \readonly - - The recent items category. - */ -QQuickJumpListCategory *QQuickJumpList::recent() const -{ - if (!m_recent) { - auto *that = const_cast<QQuickJumpList *>(this); - that->m_recent = new QQuickJumpListCategory(that); - connect(m_recent, &QQuickJumpListCategory::visibilityChanged, that, &QQuickJumpList::rebuild); - m_recent->setVisible(false); - } - return m_recent; -} - -/*! - \qmlproperty JumpListCategory JumpList::frequent - \readonly - - The frequent items category. - */ -QQuickJumpListCategory *QQuickJumpList::frequent() const -{ - if (!m_frequent) { - auto *that = const_cast<QQuickJumpList *>(this); - that->m_frequent = new QQuickJumpListCategory(that); - connect(m_frequent, &QQuickJumpListCategory::visibilityChanged, that, &QQuickJumpList::rebuild); - m_frequent->setVisible(false); - } - return m_frequent; -} - -/*! - \qmlproperty JumpListCategory JumpList::tasks - - The tasks category. - */ -QQuickJumpListCategory *QQuickJumpList::tasks() const -{ - if (!m_tasks) { - auto *that = const_cast<QQuickJumpList *>(this); - that->m_tasks = new QQuickJumpListCategory(that); - connect(m_tasks, &QQuickJumpListCategory::visibilityChanged, that, &QQuickJumpList::rebuild); - } - return m_tasks; -} - -void QQuickJumpList::setTasks(QQuickJumpListCategory *tasks) -{ - if (m_tasks != tasks) { - if (m_tasks) - disconnect(m_tasks, &QQuickJumpListCategory::visibilityChanged, this, &QQuickJumpList::rebuild); - delete m_tasks; - m_tasks = tasks; - if (m_tasks) - connect(m_tasks, &QQuickJumpListCategory::visibilityChanged, this, &QQuickJumpList::rebuild); - emit tasksChanged(); - } -} - -/*! - \qmlproperty list<QtObject> JumpList::data - \internal - */ -QQmlListProperty<QObject> QQuickJumpList::data() -{ - return QQmlListProperty<QObject>(this, this, &QQuickJumpList::data_append, nullptr, nullptr, nullptr); -} - -/*! - \qmlproperty list<JumpListCategory> JumpList::categories - - A list of custom categories. - */ -QQmlListProperty<QQuickJumpListCategory> QQuickJumpList::categories() -{ - return QQmlListProperty<QQuickJumpListCategory>(this, this, &QQuickJumpList::categories_count, &QQuickJumpList::categories_at); -} - -void QQuickJumpList::classBegin() -{ -} - -void QQuickJumpList::componentComplete() -{ - rebuild(); -} - -void QQuickJumpList::rebuild() -{ - QWinJumpList jumpList; - jumpList.recent()->setVisible(m_recent && m_recent->isVisible()); - jumpList.frequent()->setVisible(m_frequent && m_frequent->isVisible()); - if (m_tasks && m_tasks->isVisible()) { - jumpList.tasks()->setVisible(true); - const auto items = m_tasks->toItemList(); - for (QWinJumpListItem *item : items) - jumpList.tasks()->addItem(item); - } - for (QQuickJumpListCategory *category : qAsConst(m_categories)) { - if (category->isVisible()) - jumpList.addCategory(category->title(), category->toItemList())->setVisible(true); - } -} - -void QQuickJumpList::data_append(QQmlListProperty<QObject> *property, QObject *object) -{ - if (auto *category = qobject_cast<QQuickJumpListCategory *>(object)) { - auto *jumpList = static_cast<QQuickJumpList *>(property->object); - connect(category, &QQuickJumpListCategory::visibilityChanged, jumpList, &QQuickJumpList::rebuild); - jumpList->m_categories.append(category); - emit jumpList->categoriesChanged(); - } -} - -int QQuickJumpList::categories_count(QQmlListProperty<QQuickJumpListCategory> *property) -{ - return static_cast<QQuickJumpList *>(property->object)->m_categories.count(); -} - -QQuickJumpListCategory *QQuickJumpList::categories_at(QQmlListProperty<QQuickJumpListCategory> *property, int index) -{ - return static_cast<QQuickJumpList *>(property->object)->m_categories.value(index); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickjumplist_p.h b/src/imports/winextras/qquickjumplist_p.h deleted file mode 100644 index 25bf2e2..0000000 --- a/src/imports/winextras/qquickjumplist_p.h +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKJUMPLIST_P_H -#define QQUICKJUMPLIST_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qquickjumplistcategory_p.h" - -#include <QObject> -#include <QQmlParserStatus> -#include <QQmlListProperty> -#include <QList> - -QT_BEGIN_NAMESPACE - -class QQuickJumpListCategory; - -class QQuickJumpList : public QObject, public QQmlParserStatus -{ - Q_OBJECT - Q_PROPERTY(QQuickJumpListCategory *recent READ recent CONSTANT) - Q_PROPERTY(QQuickJumpListCategory *frequent READ frequent CONSTANT) - Q_PROPERTY(QQuickJumpListCategory *tasks READ tasks WRITE setTasks NOTIFY tasksChanged) - Q_PROPERTY(QQmlListProperty<QQuickJumpListCategory> categories READ categories NOTIFY categoriesChanged) - Q_PROPERTY(QQmlListProperty<QObject> data READ data) - Q_CLASSINFO("DefaultProperty", "data") - Q_INTERFACES(QQmlParserStatus) - -public: - explicit QQuickJumpList(QObject *parent = nullptr); - ~QQuickJumpList(); - - QQuickJumpListCategory *recent() const; - QQuickJumpListCategory *frequent() const; - - QQuickJumpListCategory *tasks() const; - void setTasks(QQuickJumpListCategory *tasks); - - QQmlListProperty<QObject> data(); - QQmlListProperty<QQuickJumpListCategory> categories(); - - void classBegin() override; - void componentComplete() override; - -Q_SIGNALS: - void tasksChanged(); - void categoriesChanged(); - -private Q_SLOTS: - void rebuild(); - -private: - static void data_append(QQmlListProperty<QObject> *property, QObject *object); - static int categories_count(QQmlListProperty<QQuickJumpListCategory> *property); - static QQuickJumpListCategory *categories_at(QQmlListProperty<QQuickJumpListCategory> *property, int index); - - QQuickJumpListCategory *m_recent = nullptr; - QQuickJumpListCategory *m_frequent = nullptr; - QQuickJumpListCategory *m_tasks = nullptr; - QList<QQuickJumpListCategory *> m_categories; -}; - -QT_END_NAMESPACE - -#endif // QQUICKJUMPLIST_P_H diff --git a/src/imports/winextras/qquickjumplistcategory.cpp b/src/imports/winextras/qquickjumplistcategory.cpp deleted file mode 100644 index 30183f4..0000000 --- a/src/imports/winextras/qquickjumplistcategory.cpp +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickjumplistcategory_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \qmltype JumpListCategory - \instantiates QQuickJumpListCategory - \inqmlmodule QtWinExtras - - \brief Represents a jump list category. - - \since QtWinExtras 1.0 - - The JumpListCategory type represents a category that consists of several - Jump List destinations and has a title. - */ - -/*! - \class QQuickJumpListCategory - \internal - */ - -QQuickJumpListCategory::QQuickJumpListCategory(QObject *parent) : - QObject(parent) -{ -} - -QQuickJumpListCategory::~QQuickJumpListCategory() = default; - -/*! - \qmlproperty list<QtObject> JumpListCategory::data - \internal - */ -QQmlListProperty<QObject> QQuickJumpListCategory::data() -{ - return QQmlListProperty<QObject>(this, this, &QQuickJumpListCategory::data_append, nullptr, nullptr, nullptr); -} - -/*! - \qmlproperty list<JumpListItem> JumpListCategory::items - - A list of items. - */ -QQmlListProperty<QQuickJumpListItem> QQuickJumpListCategory::items() -{ - return QQmlListProperty<QQuickJumpListItem>(this, this, &QQuickJumpListCategory::items_count, &QQuickJumpListCategory::items_at); -} - -/*! - \qmlproperty string JumpListCategory::title - - The title of the category. - */ -QString QQuickJumpListCategory::title() const -{ - return m_title; -} - -void QQuickJumpListCategory::setTitle(const QString &title) -{ - if (m_title != title) { - m_title = title; - emit titleChanged(); - } -} - -/*! - \qmlproperty bool JumpListCategory::visible - - The visibility of the category. - */ -bool QQuickJumpListCategory::isVisible() const -{ - return m_visible; -} - -void QQuickJumpListCategory::setVisible(bool visible) -{ - if (m_visible != visible) { - m_visible = visible; - emit visibilityChanged(); - } -} - -QList<QWinJumpListItem *> QQuickJumpListCategory::toItemList() const -{ - QList<QWinJumpListItem *> items; - for (QQuickJumpListItem *item : m_items) - items.append(item->toJumpListItem()); - return items; -} - -void QQuickJumpListCategory::data_append(QQmlListProperty<QObject> *property, QObject *object) -{ - if (auto *item = qobject_cast<QQuickJumpListItem *>(object)) { - auto *category = static_cast<QQuickJumpListCategory *>(property->object); - category->m_items.append(item); - emit category->itemsChanged(); - } -} - -int QQuickJumpListCategory::items_count(QQmlListProperty<QQuickJumpListItem> *property) -{ - return static_cast<QQuickJumpListCategory *>(property->object)->m_items.count(); -} - -QQuickJumpListItem *QQuickJumpListCategory::items_at(QQmlListProperty<QQuickJumpListItem> *property, int index) -{ - return static_cast<QQuickJumpListCategory *>(property->object)->m_items.value(index); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickjumplistcategory_p.h b/src/imports/winextras/qquickjumplistcategory_p.h deleted file mode 100644 index 9e1fda7..0000000 --- a/src/imports/winextras/qquickjumplistcategory_p.h +++ /dev/null @@ -1,106 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKJUMPLISTCATEGORY_P_H -#define QQUICKJUMPLISTCATEGORY_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qquickjumplistitem_p.h" - -#include <QObject> -#include <QList> -#include <QQmlListProperty> -#include <QWinJumpListCategory> -#include <QWinJumpListItem> - -QT_BEGIN_NAMESPACE - -class QQuickJumpListCategory : public QObject -{ - Q_OBJECT - Q_PROPERTY(QQmlListProperty<QObject> data READ data) - Q_PROPERTY(QQmlListProperty<QQuickJumpListItem> items READ items) - Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged) - Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibilityChanged) - Q_CLASSINFO("DefaultProperty", "data") - -public: - explicit QQuickJumpListCategory(QObject *parent = nullptr); - ~QQuickJumpListCategory(); - - QString title() const; - void setTitle(const QString &title); - - bool isVisible() const; - void setVisible(bool visible); - - QQmlListProperty<QObject> data(); - QQmlListProperty<QQuickJumpListItem> items(); - - QList<QWinJumpListItem *> toItemList() const; - -Q_SIGNALS: - void itemsChanged(); - void titleChanged(); - void visibilityChanged(); - -private: - static void data_append(QQmlListProperty<QObject> *property, QObject *object); - static int items_count(QQmlListProperty<QQuickJumpListItem> *property); - static QQuickJumpListItem *items_at(QQmlListProperty<QQuickJumpListItem> *property, int index); - - bool m_visible = true; - QString m_title; - QList<QQuickJumpListItem *> m_items; -}; - -QT_END_NAMESPACE - -#endif // QQUICKJUMPLISTCATEGORY_P_H diff --git a/src/imports/winextras/qquickjumplistitem.cpp b/src/imports/winextras/qquickjumplistitem.cpp deleted file mode 100644 index bfc9543..0000000 --- a/src/imports/winextras/qquickjumplistitem.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickjumplistitem_p.h" -#include <QVariant> - -QT_BEGIN_NAMESPACE - -QQuickJumpListItem::QQuickJumpListItem(QObject *parent) : - QObject(parent) -{ -} - -QQuickJumpListItem::~QQuickJumpListItem() = default; - -int QQuickJumpListItem::type() const -{ - return m_type; -} - -void QQuickJumpListItem::setType(int type) -{ - m_type = type; -} - -QWinJumpListItem *QQuickJumpListItem::toJumpListItem() const -{ - auto *item = new QWinJumpListItem(QWinJumpListItem::Separator); - switch (m_type) { - case ItemTypeDestination: - item->setType(QWinJumpListItem::Destination); - item->setFilePath(property("filePath").toString()); - break; - case ItemTypeLink: - item->setType(QWinJumpListItem::Link); - item->setFilePath(property("executablePath").toString()); - item->setArguments(QStringList(property("arguments").toStringList())); - item->setDescription(property("description").toString()); - item->setTitle(property("title").toString()); - item->setIcon(QIcon(property("iconPath").toString())); - break; - } - - return item; -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickjumplistitem_p.h b/src/imports/winextras/qquickjumplistitem_p.h deleted file mode 100644 index 47d92d7..0000000 --- a/src/imports/winextras/qquickjumplistitem_p.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKJUMPLISTITEM_P_H -#define QQUICKJUMPLISTITEM_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QObject> -#include <QWinJumpListItem> - -QT_BEGIN_NAMESPACE - -class QQuickJumpListItem : public QObject -{ - Q_OBJECT - Q_PROPERTY(int __jumpListItemType READ type WRITE setType) -public: - enum JumpListItemType { - ItemTypeLink = 1, - ItemTypeDestination = 2, - ItemTypeSeparator = 3 - }; - Q_ENUM(JumpListItemType) - - explicit QQuickJumpListItem(QObject *p = nullptr); - ~QQuickJumpListItem(); - - int type() const; - void setType(int type); - - QWinJumpListItem *toJumpListItem() const; - -private: - int m_type; // 1 - link, 2 - destination -}; - -QT_END_NAMESPACE - -#endif // QQUICKJUMPLISTITEM_P_H diff --git a/src/imports/winextras/qquicktaskbarbutton.cpp b/src/imports/winextras/qquicktaskbarbutton.cpp deleted file mode 100644 index 688ef35..0000000 --- a/src/imports/winextras/qquicktaskbarbutton.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquicktaskbarbutton_p.h" -#include "qquickiconloader_p.h" - -#include <QQuickWindow> -#include <QVariant> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype TaskbarButton - \instantiates QQuickTaskbarButton - \inqmlmodule QtWinExtras - - \brief Manages Windows taskbar buttons. - - \since QtWinExtras 1.0 - - The TaskbarButton type enables you to set an overlay icon and to display - a progress indicator on a taskbar button. An overlay icon indicates change - in the state of the application. A progress indicator shows how time-consuming - tasks are progressing. - - \section3 Example - - The following example illustrates how to use TaskbarButton in QML: - - \snippet code/taskbar.qml taskbar_qml - - \image taskbar-button.png Taskbar Button - - \sa QWinTaskbarButton, QWinTaskbarProgress - */ - -QQuickTaskbarOverlay::QQuickTaskbarOverlay(QWinTaskbarButton *button, QObject *parent) : - QObject(parent), m_button(button) -{ -} - -QUrl QQuickTaskbarOverlay::iconSource() const -{ - return m_iconSource; -} - -void QQuickTaskbarOverlay::setIconSource(const QUrl &iconSource) -{ - if (m_iconSource == iconSource) - return; - - if (iconSource.isEmpty()) { - m_button->clearOverlayIcon(); - m_iconSource = iconSource; - emit iconSourceChanged(); - return; - } - - if (QQuickIconLoader::load(iconSource, qmlEngine(parent()), QVariant::Icon, QSize(), - this, &QQuickTaskbarOverlay::iconLoaded) != QQuickIconLoader::LoadError) { - m_iconSource = iconSource; - emit iconSourceChanged(); - } -} - -QString QQuickTaskbarOverlay::accessibleDescription() const -{ - return m_button->overlayAccessibleDescription(); -} - -void QQuickTaskbarOverlay::setAccessibleDescription(const QString &description) -{ - if (accessibleDescription() != description) { - m_button->setOverlayAccessibleDescription(description); - emit accessibleDescriptionChanged(); - } -} - -void QQuickTaskbarOverlay::iconLoaded(const QVariant &value) -{ - m_button->setOverlayIcon(value.value<QIcon>()); -} - -QQuickTaskbarButton::QQuickTaskbarButton(QQuickItem *parent) : QQuickItem(parent), - m_button(new QWinTaskbarButton(this)), m_overlay(new QQuickTaskbarOverlay(m_button, this)) -{ -} - -QQuickTaskbarButton::~QQuickTaskbarButton() = default; - -/*! - \qmlpropertygroup ::TaskbarButton::progress - \qmlproperty int TaskbarButton::progress.value - \qmlproperty int TaskbarButton::progress.minimum - \qmlproperty int TaskbarButton::progress.maximum - \qmlproperty bool TaskbarButton::progress.visible - \qmlproperty bool TaskbarButton::progress.paused - \qmlproperty bool TaskbarButton::progress.stopped - - The taskbar progress indicator. - - \sa QWinTaskbarProgress - */ -QWinTaskbarProgress *QQuickTaskbarButton::progress() const -{ - return m_button->progress(); -} - -/*! - \qmlpropertygroup ::TaskbarButton::overlay - \qmlproperty url TaskbarButton::overlay.iconSource - \qmlproperty string TaskbarButton::overlay.accessibleDescription - - The overlay icon and a description of the overlay for accessibility purposes. - */ -QQuickTaskbarOverlay *QQuickTaskbarButton::overlay() const -{ - return m_overlay; -} - -void QQuickTaskbarButton::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - if (change == ItemSceneChange) { - m_button->setWindow(data.window); - } - QQuickItem::itemChange(change, data); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquicktaskbarbutton_p.h b/src/imports/winextras/qquicktaskbarbutton_p.h deleted file mode 100644 index a26fa67..0000000 --- a/src/imports/winextras/qquicktaskbarbutton_p.h +++ /dev/null @@ -1,114 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKTASKBARBUTTON_P_H -#define QQUICKTASKBARBUTTON_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QQuickItem> -#include <QWinTaskbarButton> -#include <QWinTaskbarProgress> - -QT_BEGIN_NAMESPACE - -class QVariant; -class QQuickTaskbarButtonPrivate; - -class QQuickTaskbarOverlay : public QObject -{ - Q_OBJECT - Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged) - Q_PROPERTY(QString accessibleDescription READ accessibleDescription WRITE setAccessibleDescription NOTIFY accessibleDescriptionChanged) - -public: - explicit QQuickTaskbarOverlay(QWinTaskbarButton *button, QObject *parent = nullptr); - - QUrl iconSource() const; - void setIconSource(const QUrl &iconSource); - - QString accessibleDescription() const; - void setAccessibleDescription(const QString &description); - -Q_SIGNALS: - void iconSourceChanged(); - void accessibleDescriptionChanged(); - -private Q_SLOTS: - void iconLoaded(const QVariant &); - -private: - QUrl m_iconSource; - QWinTaskbarButton *m_button; -}; - -class QQuickTaskbarButton : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(QQuickTaskbarOverlay *overlay READ overlay CONSTANT) - Q_PROPERTY(QWinTaskbarProgress *progress READ progress CONSTANT) - -public: - explicit QQuickTaskbarButton(QQuickItem *parent = nullptr); - ~QQuickTaskbarButton(); - - QQuickTaskbarOverlay *overlay() const; - QWinTaskbarProgress *progress() const; - -protected: - void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE; - -private: - QWinTaskbarButton *m_button; - QQuickTaskbarOverlay *m_overlay; -}; - -QT_END_NAMESPACE - -#endif // QQUICKTASKBARBUTTON_P_H diff --git a/src/imports/winextras/qquickthumbnailtoolbar.cpp b/src/imports/winextras/qquickthumbnailtoolbar.cpp deleted file mode 100644 index 7bdf112..0000000 --- a/src/imports/winextras/qquickthumbnailtoolbar.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickthumbnailtoolbar_p.h" -#include "qquickthumbnailtoolbutton_p.h" -#include "qquickiconloader_p.h" - -#include <QQuickWindow> -#include <QQmlEngine> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype ThumbnailToolBar - \instantiates QQuickThumbnailToolBar - \inqmlmodule QtWinExtras - - \brief Allows manipulating the window's thumbnail toolbar. - - This class allows an application to embed a toolbar in the thumbnail of a window, - which is shown when hovering over its taskbar icon. It provides quick access to - the window's commands without requiring the user to restore or activate the window. - - \image thumbbar.png Media player thumbnail toolbar - - \section3 Example - \snippet code/thumbbar.qml thumbbar_qml - \since QtWinExtras 1.0 - */ - -QQuickThumbnailToolBar::QQuickThumbnailToolBar(QQuickItem *parent) : - QQuickItem(parent) -{ - connect(&m_toolbar, &QWinThumbnailToolBar::iconicThumbnailPixmapRequested, - this, &QQuickThumbnailToolBar::iconicThumbnailRequested); - connect(&m_toolbar, &QWinThumbnailToolBar::iconicLivePreviewPixmapRequested, - this, &QQuickThumbnailToolBar::iconicLivePreviewRequested); -} - -QQuickThumbnailToolBar::~QQuickThumbnailToolBar() = default; - -int QQuickThumbnailToolBar::count() const -{ - return m_toolbar.count(); -} - -QQmlListProperty<QObject> QQuickThumbnailToolBar::data() -{ - return QQmlListProperty<QObject>(this, nullptr, &QQuickThumbnailToolBar::addData, nullptr, nullptr, nullptr); -} - -QQmlListProperty<QQuickThumbnailToolButton> QQuickThumbnailToolBar::buttons() -{ - return QQmlListProperty<QQuickThumbnailToolButton>(this, nullptr, &QQuickThumbnailToolBar::buttonCount, &QQuickThumbnailToolBar::buttonAt); -} - -void QQuickThumbnailToolBar::addButton(QQuickThumbnailToolButton *button) -{ - if (!m_buttons.contains(button)) { - m_toolbar.addButton(button->m_button); - m_buttons.append(button); - emit countChanged(); - emit buttonsChanged(); - } -} - -void QQuickThumbnailToolBar::removeButton(QQuickThumbnailToolButton *button) -{ - if (m_buttons.removeOne(button)) { - m_toolbar.removeButton(button->m_button); - emit countChanged(); - emit buttonsChanged(); - } -} - -void QQuickThumbnailToolBar::clear() -{ - m_toolbar.clear(); - for (QQuickThumbnailToolButton *button : qAsConst(m_buttons)) - button->deleteLater(); - m_buttons.clear(); - emit countChanged(); - emit buttonsChanged(); -} - -/*! - \qmlsignal ThumbnailToolBar::iconicThumbnailRequested() - - This signal is emitted when the operating system requests a new iconic thumbnail pixmap, - typically when the thumbnail is shown. - - \since 5.4 -*/ - -/*! - \qmlsignal ThumbnailToolBar::iconicLivePreviewRequested() - - This signal is emitted when the operating system requests a new iconic live preview pixmap, - typically when the user ALT-tabs to the application. - \since 5.4 -*/ - -/*! - \qmlproperty bool ThumbnailToolBar::iconicNotificationsEnabled - - This property holds whether the signals iconicThumbnailRequested() - or iconicLivePreviewRequested() will be emitted. - \since 5.4 - */ -bool QQuickThumbnailToolBar::iconicNotificationsEnabled() const -{ - return m_toolbar.iconicPixmapNotificationsEnabled(); -} - -void QQuickThumbnailToolBar::setIconicNotificationsEnabled(bool enabled) -{ - if (enabled != m_toolbar.iconicPixmapNotificationsEnabled()) { - m_toolbar.setIconicPixmapNotificationsEnabled(enabled); - emit iconicNotificationsEnabledChanged(); - } -} - -void QQuickThumbnailToolBar::iconicThumbnailLoaded(const QVariant &value) -{ - m_toolbar.setIconicThumbnailPixmap(value.value<QPixmap>()); -} - -/*! - \qmlproperty url ThumbnailToolBar::iconicThumbnailSource - - The pixmap for use as a thumbnail representation - \since 5.4 - */ -void QQuickThumbnailToolBar::setIconicThumbnailSource(const QUrl &source) -{ - if (source == m_iconicThumbnailSource) - return; - - if (source.isEmpty()) { - m_toolbar.setIconicThumbnailPixmap(QPixmap()); - m_iconicThumbnailSource = source; - emit iconicThumbnailSourceChanged(); - } - - if (QQuickIconLoader::load(source, qmlEngine(this), QVariant::Pixmap, QSize(), - this, &QQuickThumbnailToolBar::iconicThumbnailLoaded) != QQuickIconLoader::LoadError) { - m_iconicThumbnailSource = source; - emit iconicThumbnailSourceChanged(); - } -} - -void QQuickThumbnailToolBar::iconicLivePreviewLoaded(const QVariant &value) -{ - m_toolbar.setIconicLivePreviewPixmap(value.value<QPixmap>()); -} - -/*! - \qmlproperty url ThumbnailToolBar::iconicLivePreviewSource - - The pixmap for use as a live (peek) preview when tabbing into the application. - \since 5.4 - */ -void QQuickThumbnailToolBar::setIconicLivePreviewSource(const QUrl &source) -{ - if (source == m_iconicLivePreviewSource) - return; - - if (source.isEmpty()) { - m_toolbar.setIconicLivePreviewPixmap(QPixmap()); - m_iconicLivePreviewSource = source; - emit iconicLivePreviewSourceChanged(); - } - - if (QQuickIconLoader::load(source, qmlEngine(this), QVariant::Pixmap, QSize(), - this, &QQuickThumbnailToolBar::iconicLivePreviewLoaded) != QQuickIconLoader::LoadError) { - m_iconicLivePreviewSource = source; - emit iconicLivePreviewSourceChanged(); - } -} - -void QQuickThumbnailToolBar::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) -{ - if (change == ItemSceneChange) - m_toolbar.setWindow(data.window); - QQuickItem::itemChange(change, data); -} - -void QQuickThumbnailToolBar::addData(QQmlListProperty<QObject> *property, QObject *object) -{ - if (auto *button = qobject_cast<QQuickThumbnailToolButton *>(object)) { - auto *quickThumbbar = static_cast<QQuickThumbnailToolBar *>(property->object); - quickThumbbar->m_toolbar.addButton(button->m_button); - quickThumbbar->m_buttons.append(button); - emit quickThumbbar->countChanged(); - emit quickThumbbar->buttonsChanged(); - } -} - -int QQuickThumbnailToolBar::buttonCount(QQmlListProperty<QQuickThumbnailToolButton> *property) -{ - return static_cast<QQuickThumbnailToolBar *>(property->object)->count(); -} - -QQuickThumbnailToolButton *QQuickThumbnailToolBar::buttonAt(QQmlListProperty<QQuickThumbnailToolButton> *property, int index) -{ - return static_cast<QQuickThumbnailToolBar *>(property->object)->m_buttons.value(index); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickthumbnailtoolbar_p.h b/src/imports/winextras/qquickthumbnailtoolbar_p.h deleted file mode 100644 index fc1e67a..0000000 --- a/src/imports/winextras/qquickthumbnailtoolbar_p.h +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKTHUMBNAILTOOLBAR_P_H -#define QQUICKTHUMBNAILTOOLBAR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QQuickItem> -#include <QWinThumbnailToolBar> -#include <QUrl> -#include <QList> - -QT_BEGIN_NAMESPACE - -class QVariant; - -class QQuickThumbnailToolButton; - -class QQuickThumbnailToolBar : public QQuickItem -{ - Q_OBJECT - Q_PROPERTY(int count READ count NOTIFY countChanged) - Q_PROPERTY(QQmlListProperty<QObject> data READ data) - Q_PROPERTY(QQmlListProperty<QQuickThumbnailToolButton> buttons READ buttons NOTIFY buttonsChanged) - Q_PROPERTY(bool iconicNotificationsEnabled READ iconicNotificationsEnabled WRITE setIconicNotificationsEnabled NOTIFY iconicNotificationsEnabledChanged) - Q_PROPERTY(QUrl iconicThumbnailSource READ iconicThumbnailSource WRITE setIconicThumbnailSource NOTIFY iconicThumbnailSourceChanged) - Q_PROPERTY(QUrl iconicLivePreviewSource READ iconicLivePreviewSource WRITE setIconicLivePreviewSource NOTIFY iconicLivePreviewSourceChanged) - Q_CLASSINFO("DefaultProperty", "data") - -public: - explicit QQuickThumbnailToolBar(QQuickItem *parent = nullptr); - ~QQuickThumbnailToolBar(); - - int count() const; - - QQmlListProperty<QObject> data(); - QQmlListProperty<QQuickThumbnailToolButton> buttons(); - - Q_INVOKABLE void addButton(QQuickThumbnailToolButton *button); - Q_INVOKABLE void removeButton(QQuickThumbnailToolButton *button); - - bool iconicNotificationsEnabled() const; - void setIconicNotificationsEnabled(bool); - QUrl iconicThumbnailSource() const { return m_iconicThumbnailSource; } - void setIconicThumbnailSource(const QUrl &); - QUrl iconicLivePreviewSource() const { return m_iconicLivePreviewSource; } - void setIconicLivePreviewSource(const QUrl &); - -public Q_SLOTS: - void clear(); - -Q_SIGNALS: - void countChanged(); - void buttonsChanged(); - void iconicNotificationsEnabledChanged(); - void iconicThumbnailSourceChanged(); - void iconicThumbnailRequested(); - void iconicLivePreviewSourceChanged(); - void iconicLivePreviewRequested(); - -private Q_SLOTS: - void iconicThumbnailLoaded(const QVariant &); - void iconicLivePreviewLoaded(const QVariant &); - -protected: - void itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) override; - -private: - static void addData(QQmlListProperty<QObject> *property, QObject *button); - static int buttonCount(QQmlListProperty<QQuickThumbnailToolButton> *property); - static QQuickThumbnailToolButton *buttonAt(QQmlListProperty<QQuickThumbnailToolButton> *property, int index); - - QWinThumbnailToolBar m_toolbar; - QList<QQuickThumbnailToolButton *> m_buttons; - QUrl m_iconicThumbnailSource; - QUrl m_iconicLivePreviewSource; -}; - -QT_END_NAMESPACE - -#endif // QQUICKTHUMBNAILTOOLBAR_P_H diff --git a/src/imports/winextras/qquickthumbnailtoolbutton.cpp b/src/imports/winextras/qquickthumbnailtoolbutton.cpp deleted file mode 100644 index e4a1f81..0000000 --- a/src/imports/winextras/qquickthumbnailtoolbutton.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qquickthumbnailtoolbutton_p.h" -#include "qquickiconloader_p.h" - -#include <QWinThumbnailToolButton> - -QT_BEGIN_NAMESPACE - -/*! - \qmltype ThumbnailToolButton - \instantiates QQuickThumbnailToolButton - \inqmlmodule QtWinExtras - - \brief Represents a button in a thumbnail toolbar. - - The ThumbnailToolButton represents a button in a thumbnail toolbar. - \since QtWinExtras 1.0 - */ - -/*! - \qmlsignal ThumbnailToolButton::clicked() - This signal is emitted when the user clicks the button. The corresponding handler is \c onClicked. -*/ - -QQuickThumbnailToolButton::QQuickThumbnailToolButton(QObject *parent) : - QObject(parent), m_button(new QWinThumbnailToolButton(this)) -{ - connect(m_button, &QWinThumbnailToolButton::clicked, this, &QQuickThumbnailToolButton::clicked); -} - -QQuickThumbnailToolButton::~QQuickThumbnailToolButton() = default; - -/*! - \qmlproperty url ThumbnailToolButton::iconSource - - The button icon path. - */ -void QQuickThumbnailToolButton::setIconSource(const QUrl &iconSource) -{ - if (m_iconSource == iconSource) - return; - - if (iconSource.isEmpty()) { - m_button->setIcon(QIcon()); - m_iconSource = iconSource; - emit iconSourceChanged(); - } - - if (QQuickIconLoader::load(iconSource, qmlEngine(this), QVariant::Icon, QSize(), - this, &QQuickThumbnailToolButton::iconLoaded) != QQuickIconLoader::LoadError) { - m_iconSource = iconSource; - emit iconSourceChanged(); - } -} - -QUrl QQuickThumbnailToolButton::iconSource() -{ - return m_iconSource; -} - -/*! - \qmlproperty string ThumbnailToolButton::tooltip - - The tooltip of the button. - */ -void QQuickThumbnailToolButton::setTooltip(const QString &tooltip) -{ - if (m_button->toolTip() != tooltip) { - m_button->setToolTip(tooltip); - emit tooltipChanged(); - } -} - -QString QQuickThumbnailToolButton::tooltip() const -{ - return m_button->toolTip(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::enabled - - This property holds whether the button is enabled. - - By default, this property is set to true. - */ -void QQuickThumbnailToolButton::setEnabled(bool enabled) -{ - if (m_button->isEnabled() != enabled) { - m_button->setEnabled(enabled); - emit enabledChanged(); - } -} - -bool QQuickThumbnailToolButton::isEnabled() const -{ - return m_button->isEnabled(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::interactive - - This property holds whether the button is interactive. - If not interactive, the button remains enabled, but no pressed or mouse-over - states are drawn. Set this property to false to use this button as a - notification icon. - - By default, this property is set to true. - */ -void QQuickThumbnailToolButton::setInteractive(bool interactive) -{ - if (m_button->isInteractive() != interactive) { - m_button->setInteractive(interactive); - emit interactiveChanged(); - } -} - -bool QQuickThumbnailToolButton::isInteractive() const -{ - return m_button->isInteractive(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::visible - - This property holds whether the button is visible. - - By default, this property is set to true. - */ -void QQuickThumbnailToolButton::setVisible(bool visible) -{ - if (m_button->isVisible() != visible) { - m_button->setVisible(visible); - emit visibleChanged(); - } -} - -bool QQuickThumbnailToolButton::isVisible() const -{ - return m_button->isVisible(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::dismissOnClick - - This property holds whether the window thumbnail is dismissed after a button click. - - By default, this property is set to false. - */ -void QQuickThumbnailToolButton::setDismissOnClick(bool dismiss) -{ - if (m_button->dismissOnClick() != dismiss) { - m_button->setDismissOnClick(dismiss); - emit dismissOnClickChanged(); - } -} - -bool QQuickThumbnailToolButton::dismissOnClick() const -{ - return m_button->dismissOnClick(); -} - -/*! - \qmlproperty bool ThumbnailToolButton::flat - - This property holds whether the button background and frame are not drawn. - - By default, this property is set to false. - */ -void QQuickThumbnailToolButton::setFlat(bool flat) -{ - if (m_button->isFlat() != flat) { - m_button->setFlat(flat); - emit flatChanged(); - } -} - -bool QQuickThumbnailToolButton::isFlat() const -{ - return m_button->isFlat(); -} - -void QQuickThumbnailToolButton::iconLoaded(const QVariant &value) -{ - if (value.isValid()) - m_button->setIcon(value.value<QIcon>()); -} - -QT_END_NAMESPACE diff --git a/src/imports/winextras/qquickthumbnailtoolbutton_p.h b/src/imports/winextras/qquickthumbnailtoolbutton_p.h deleted file mode 100644 index aca0e74..0000000 --- a/src/imports/winextras/qquickthumbnailtoolbutton_p.h +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKTHUMBNAILTOOLBUTTON_P_H -#define QQUICKTHUMBNAILTOOLBUTTON_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QQuickItem> -#include <QWinThumbnailToolBar> -#include <QUrl> - -QT_BEGIN_NAMESPACE - -class QQuickThumbnailToolButton : public QObject -{ - Q_OBJECT - Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged) - Q_PROPERTY(QString tooltip READ tooltip WRITE setTooltip NOTIFY tooltipChanged) - Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged) - Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive NOTIFY interactiveChanged) - Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) - Q_PROPERTY(bool dismissOnClick READ dismissOnClick WRITE setDismissOnClick NOTIFY dismissOnClickChanged) - Q_PROPERTY(bool flat READ isFlat WRITE setFlat NOTIFY flatChanged) - -public: - explicit QQuickThumbnailToolButton(QObject *parent = nullptr); - ~QQuickThumbnailToolButton(); - - void setIconSource(const QUrl &iconSource); - QUrl iconSource(); - void setTooltip(const QString &tooltip); - QString tooltip() const; - void setEnabled(bool isEnabled); - bool isEnabled() const; - void setInteractive(bool isInteractive); - bool isInteractive() const; - void setVisible(bool isVisible); - bool isVisible() const; - void setDismissOnClick(bool dismiss); - bool dismissOnClick() const; - void setFlat(bool flat); - bool isFlat() const; - -Q_SIGNALS: - void clicked(); - void iconSourceChanged(); - void tooltipChanged(); - void enabledChanged(); - void interactiveChanged(); - void visibleChanged(); - void dismissOnClickChanged(); - void flatChanged(); - -private Q_SLOTS: - void iconLoaded(const QVariant &); - -private: - QUrl m_iconSource; - QWinThumbnailToolButton *m_button; - - friend class QQuickThumbnailToolBar; -}; - -QT_END_NAMESPACE - -#endif // QQUICKTHUMBNAILTOOLBUTTON_P_H diff --git a/src/imports/winextras/qquickwin_p.h b/src/imports/winextras/qquickwin_p.h deleted file mode 100644 index 4ed9015..0000000 --- a/src/imports/winextras/qquickwin_p.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QQUICKWIN_P_H -#define QQUICKWIN_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QObject> -#include <QtWin> - -QT_BEGIN_NAMESPACE - -class QQuickWin : public QObject -{ - Q_OBJECT - -public: - enum HBitmapFormat - { - HBitmapNoAlpha = QtWin::HBitmapNoAlpha, - HBitmapPremultipliedAlpha = QtWin::HBitmapPremultipliedAlpha, - HBitmapAlpha = QtWin::HBitmapAlpha - }; - Q_ENUM(HBitmapFormat) - - enum WindowFlip3DPolicy - { - FlipDefault = QtWin::FlipDefault, - FlipExcludeBelow = QtWin::FlipExcludeBelow, - FlipExcludeAbove = QtWin::FlipExcludeAbove - }; - Q_ENUM(WindowFlip3DPolicy) - - enum WindowNonClientRenderingPolicy - { - NonClientRenderingUseWindowStyle = QtWin::NonClientRenderingUseWindowStyle, - NonClientRenderingDisabled = QtWin::NonClientRenderingDisabled, - NonClientRenderingEnabled = QtWin::NonClientRenderingEnabled - }; - Q_ENUM(WindowNonClientRenderingPolicy) -}; - -QT_END_NAMESPACE - -#endif // QQUICKWIN_P_H diff --git a/src/imports/winextras/winextras.pro b/src/imports/winextras/winextras.pro deleted file mode 100644 index dc778e6..0000000 --- a/src/imports/winextras/winextras.pro +++ /dev/null @@ -1,44 +0,0 @@ -CXX_MODULE = qml -TARGET = qml_winextras -TARGETPATH = QtWinExtras -IMPORT_VERSION = 1.$$QT_MINOR_VERSION - -QT += qml quick winextras winextras-private - -QML_FILES += \ - JumpListLink.qml \ - JumpListDestination.qml \ - JumpListSeparator.qml - -HEADERS += \ - qquickdwmfeatures_p.h \ - qquickdwmfeatures_p_p.h \ - qquicktaskbarbutton_p.h \ - qquickjumplist_p.h \ - qquickjumplistitem_p.h \ - qquickjumplistcategory_p.h \ - qquickthumbnailtoolbar_p.h \ - qquickthumbnailtoolbutton_p.h \ - qquickiconloader_p.h \ - qquickwin_p.h - -SOURCES += \ - plugin.cpp \ - qquickdwmfeatures.cpp \ - qquicktaskbarbutton.cpp \ - qquickjumplist.cpp \ - qquickjumplistitem.cpp \ - qquickjumplistcategory.cpp \ - qquickthumbnailtoolbar.cpp \ - qquickthumbnailtoolbutton.cpp \ - qquickiconloader.cpp - -OTHER_FILES += \ - qmldir \ - JumpListLink.qml \ - JumpListDestination.qml \ - JumpListSeparator.qml - -!qtHaveModule(opengl)|qtConfig(dynamicgl):LIBS_PRIVATE += -luser32 - -load(qml_plugin) diff --git a/src/src.pro b/src/src.pro deleted file mode 100644 index fceeb21..0000000 --- a/src/src.pro +++ /dev/null @@ -1,11 +0,0 @@ -win32 { - TEMPLATE = subdirs - CONFIG += ordered - SUBDIRS += winextras - qtHaveModule(quick): SUBDIRS += imports -} else { - # fake project for creating the documentation - TEMPLATE = aux - CONFIG += force_qt - QMAKE_DOCS = $$PWD/winextras/doc/qtwinextras.qdocconf -} diff --git a/src/winextras/CMakeLists.txt b/src/winextras/CMakeLists.txt deleted file mode 100644 index 47d6eac..0000000 --- a/src/winextras/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -# Generated from winextras.pro. - -##################################################################### -## WinExtras Module: -##################################################################### - -qt_add_module(WinExtras - SOURCES - qwinevent.cpp qwinevent.h - qwineventfilter.cpp qwineventfilter_p.h - qwinextrasglobal.h - qwinfunctions.cpp qwinfunctions.h qwinfunctions_p.h - qwinjumplist.cpp qwinjumplist.h qwinjumplist_p.h - qwinjumplistcategory.cpp qwinjumplistcategory.h qwinjumplistcategory_p.h - qwinjumplistitem.cpp qwinjumplistitem.h qwinjumplistitem_p.h - qwintaskbarbutton.cpp qwintaskbarbutton.h qwintaskbarbutton_p.h - qwintaskbarprogress.cpp qwintaskbarprogress.h - qwinthumbnailtoolbar.cpp qwinthumbnailtoolbar.h qwinthumbnailtoolbar_p.h - qwinthumbnailtoolbutton.cpp qwinthumbnailtoolbutton.h qwinthumbnailtoolbutton_p.h - windowsguidsdefs.cpp windowsguidsdefs_p.h - winpropkey_p.h - winshobjidl_p.h - LIBRARIES - Qt::CorePrivate - Qt::GuiPrivate - dwmapi - ole32 - shell32 - shlwapi - PUBLIC_LIBRARIES - Qt::Core - Qt::Gui - PRIVATE_MODULE_INTERFACE - Qt::CorePrivate - Qt::GuiPrivate -) - -#### Keys ignored in scope 1:.:.:winextras.pro:<TRUE>: -# OTHER_FILES = "doc/qtwinextras.qdocconf" "doc/src/qtwinextras-index.qdoc" "doc/src/qtwinextras-module-cpp.qdoc" "doc/src/qtwinextras-module-qml.qdoc" "doc/snippets/code/use-qtwinextras.pro" "doc/snippets/code/jumplist.cpp" "doc/snippets/code/use-qtwinextras.cpp" "doc/snippets/code/thumbbar.cpp" "doc/snippets/code/thumbbar.qml" - -## Scopes: -##################################################################### - -qt_extend_target(WinExtras CONDITION QT_FEATURE_dynamicgl OR (WIN32 AND NOT TARGET Qt::OpenGL) - LIBRARIES - gdi32 -) -qt_add_docs(WinExtras - doc/qtwinextras.qdocconf -) - diff --git a/src/winextras/doc/QtWinExtras/qwinextrasglobal.h b/src/winextras/doc/QtWinExtras/qwinextrasglobal.h deleted file mode 100644 index 2da776f..0000000 --- a/src/winextras/doc/QtWinExtras/qwinextrasglobal.h +++ /dev/null @@ -1 +0,0 @@ -#include "../../qwinextrasglobal.h" diff --git a/src/winextras/doc/QtWinExtrasDoc b/src/winextras/doc/QtWinExtrasDoc deleted file mode 100644 index 7d14c34..0000000 --- a/src/winextras/doc/QtWinExtrasDoc +++ /dev/null @@ -1,22 +0,0 @@ -#include "qwinevent.h" -#include "qwinjumplist_p.h" -#include "winpropkey_p.h" -#include "qwinfunctions_p.h" -#include "qwineventfilter_p.h" -#include "winshobjidl_p.h" -#include "qwintaskbarbutton.h" -#include "qwinmime.h" -#include "qwinextrasglobal.h" -#include "qwinthumbnailtoolbar.h" -#include "qwinthumbnailtoolbutton_p.h" -#include "qwinjumplistitem.h" -#include "qwinjumplist.h" -#include "qwinthumbnailtoolbar_p.h" -#include "qwinjumplistitem_p.h" -#include "windowsguidsdefs_p.h" -#include "qwinfunctions.h" -#include "qwinjumplistcategory_p.h" -#include "qwintaskbarbutton_p.h" -#include "qwinthumbnailtoolbutton.h" -#include "qwintaskbarprogress.h" -#include "qwinjumplistcategory.h" diff --git a/src/winextras/doc/images/glass.png b/src/winextras/doc/images/glass.png Binary files differdeleted file mode 100644 index a2a6326..0000000 --- a/src/winextras/doc/images/glass.png +++ /dev/null diff --git a/src/winextras/doc/images/jumplist.png b/src/winextras/doc/images/jumplist.png Binary files differdeleted file mode 100644 index dff2487..0000000 --- a/src/winextras/doc/images/jumplist.png +++ /dev/null diff --git a/src/winextras/doc/images/peek-on.png b/src/winextras/doc/images/peek-on.png Binary files differdeleted file mode 100644 index c655639..0000000 --- a/src/winextras/doc/images/peek-on.png +++ /dev/null diff --git a/src/winextras/doc/images/taskbar-button.png b/src/winextras/doc/images/taskbar-button.png Binary files differdeleted file mode 100644 index 8c585f4..0000000 --- a/src/winextras/doc/images/taskbar-button.png +++ /dev/null diff --git a/src/winextras/doc/images/taskbar-progress-indeterminate.png b/src/winextras/doc/images/taskbar-progress-indeterminate.png Binary files differdeleted file mode 100644 index 800cf51..0000000 --- a/src/winextras/doc/images/taskbar-progress-indeterminate.png +++ /dev/null diff --git a/src/winextras/doc/images/taskbar-progress-paused.png b/src/winextras/doc/images/taskbar-progress-paused.png Binary files differdeleted file mode 100644 index 55383fd..0000000 --- a/src/winextras/doc/images/taskbar-progress-paused.png +++ /dev/null diff --git a/src/winextras/doc/images/taskbar-progress-stopped.png b/src/winextras/doc/images/taskbar-progress-stopped.png Binary files differdeleted file mode 100644 index f4b6dc1..0000000 --- a/src/winextras/doc/images/taskbar-progress-stopped.png +++ /dev/null diff --git a/src/winextras/doc/images/taskbar-progress.png b/src/winextras/doc/images/taskbar-progress.png Binary files differdeleted file mode 100644 index 97bb286..0000000 --- a/src/winextras/doc/images/taskbar-progress.png +++ /dev/null diff --git a/src/winextras/doc/images/thumbbar.png b/src/winextras/doc/images/thumbbar.png Binary files differdeleted file mode 100644 index c53077d..0000000 --- a/src/winextras/doc/images/thumbbar.png +++ /dev/null diff --git a/src/winextras/doc/qtwinextras.qdocconf b/src/winextras/doc/qtwinextras.qdocconf deleted file mode 100644 index 95547db..0000000 --- a/src/winextras/doc/qtwinextras.qdocconf +++ /dev/null @@ -1,53 +0,0 @@ -include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) -include($QT_INSTALL_DOCS/config/exampleurl-qtwinextras.qdocconf) - -project = QtWinExtras -description = Qt Windows Extras Reference Documentation -version = $QT_VERSION - -exampledirs += ../../../examples/winextras \ - snippets - -examplesinstallpath = winextras - -moduleheader = QtWinExtrasDoc - -includepaths = -I . \ - -I .. - -headerdirs = .. ../../imports/winextras -sourcedirs = .. ../../imports/winextras -imagedirs += images - -depends += qtcore qtgui qtdoc qtwidgets - -qhp.projects = QtWinExtras - -qhp.QtWinExtras.file = qtwinextras.qhp - -qhp.QtWinExtras.namespace = org.qt-project.qtwinextras.$QT_VERSION_TAG - -qhp.QtWinExtras.indexTitle = Qt Windows Extras -qhp.QtWinExtras.indexRoot = - -qhp.QtWinExtras.filterAttributes = qtwinextras $QT_VERSION qtrefdoc -qhp.QtWinExtras.customFilters.Qt.name = QtWinExtras $QT_VERSION -qhp.QtWinExtras.customFilters.Qt.filterAttributes = qtwinextras $QT_VERSION - -qhp.QtWinExtras.virtualFolder = qtwinextras -qhp.QtWinExtras.subprojects = classes examples qmltypes -qhp.QtWinExtras.subprojects.classes.title = C++ Classes and Namespaces -qhp.QtWinExtras.subprojects.classes.indexTitle = Qt Windows Extras C++ Classes -qhp.QtWinExtras.subprojects.classes.selectors = class function namespace fake:headerfile -qhp.QtWinExtras.subprojects.classes.sortPages = true -qhp.QtWinExtras.subprojects.examples.title = Examples -qhp.QtWinExtras.subprojects.examples.indexTitle = Qt Windows Extras Examples -qhp.QtWinExtras.subprojects.examples.selectors = fake:example -qhp.QtWinExtras.subprojects.qmltypes.title = QML Types -qhp.QtWinExtras.subprojects.qmltypes.indexTitle = Qt Windows Extras QML Types -qhp.QtWinExtras.subprojects.qmltypes.selectors = qmlclass -qhp.QtWinExtras.subprojects.qmltypes.sortPages = true - -navigation.landingpage = "Qt Windows Extras" -navigation.qmltypespage = "Qt Windows Extras QML Types" -navigation.cppclassespage = "Qt Windows Extras C++ Classes" diff --git a/src/winextras/doc/snippets/code/CMakeLists.txt b/src/winextras/doc/snippets/code/CMakeLists.txt deleted file mode 100644 index 36ad466..0000000 --- a/src/winextras/doc/snippets/code/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -# Generated from use-qtwinextras.pro. - -##################################################################### -## use-qtwinextras Binary: -##################################################################### - -qt_add_executable(use-qtwinextras - GUI - PUBLIC_LIBRARIES - Qt::Gui - Qt::WinExtras -) diff --git a/src/winextras/doc/snippets/code/jumplist.cpp b/src/winextras/doc/snippets/code/jumplist.cpp deleted file mode 100644 index 6f8221e..0000000 --- a/src/winextras/doc/snippets/code/jumplist.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QWinJumpList> - -void foo() -{ -//! [jumplist] - QWinJumpList jumplist; - - QWinJumpListCategory *tasks = jumplist.tasks(); - QWinJumpListItem *newProject = new QWinJumpListItem(QWinJumpListItem::Link); - newProject->setTitle(tr("Create new project")); - newProject->setFilePath(QDir::toNativeSeparators(QCoreApplication::applicationFilePath())); - newProject->setArguments(QStringList("--new-project")); - tasks->addItem(newProject); - - tasks->addLink(tr("Launch SDK Manager"), QDir::toNativeSeparators(QCoreApplication::applicationDirPath()) + "\\sdk-manager.exe"); - - tasks->setVisible(true); -//! [jumplist] -} diff --git a/src/winextras/doc/snippets/code/taskbar.cpp b/src/winextras/doc/snippets/code/taskbar.cpp deleted file mode 100644 index 5636174..0000000 --- a/src/winextras/doc/snippets/code/taskbar.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtWinExtras> - -void initializeTaskbarButton(QWidget *widget) -{ - Q_ASSERT(widget->windowHandle()); // Note: this requires the window to be shown. -//! [taskbar_cpp] - QWinTaskbarButton *button = new QWinTaskbarButton(widget); - button->setWindow(widget->windowHandle()); - button->setOverlayIcon(QIcon(":/loading.png")); - - QWinTaskbarProgress *progress = button->progress(); - progress->setVisible(true); - progress->setValue(50); -//! [taskbar_cpp] -} diff --git a/src/winextras/doc/snippets/code/taskbar.qml b/src/winextras/doc/snippets/code/taskbar.qml deleted file mode 100644 index e46a370..0000000 --- a/src/winextras/doc/snippets/code/taskbar.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Window 2.0 -import QtWinExtras 1.0 - -//! [taskbar_qml] -Window { - TaskbarButton { - overlay.iconSource: "loading.png" - overlay.accessibleDescription: "Loading" - - progress.visible: true - progress.value: 50 - } -} -//! [taskbar_qml] diff --git a/src/winextras/doc/snippets/code/thumbbar.cpp b/src/winextras/doc/snippets/code/thumbbar.cpp deleted file mode 100644 index e5924ea..0000000 --- a/src/winextras/doc/snippets/code/thumbbar.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtWinExtras> - -void initializeThumbnailToolBar(QWidget *widget) -{ - Q_ASSERT(widget->windowHandle()); // Note: this requires the window to be shown. -//! [thumbbar_cpp] - QWinThumbnailToolBar *thumbbar = new QWinThumbnailToolBar(widget); - thumbbar->setWindow(widget->windowHandle()); - - QWinThumbnailToolButton *settings = new QWinThumbnailToolButton(thumbbar); - settings->setToolTip("Settings"); - settings->setIcon(":/settings.png"); - settings->setDismissOnClick(true); - connect(settings, SIGNAL(clicked()), settingsPage, SLOT(show())); - - QWinThumbnailToolButton *playPause = new QWinThumbnailToolButton(thumbbar); - playPause->setToolTip("Play/Pause"); - playPause->setIcon(":/play.png"); - connect(playPause, SIGNAL(clicked()), mediaPlayer, SLOT(play())); - - thumbbar->addButton(settings); - thumbbar->addButton(playPause); -//! [thumbbar_cpp] -} diff --git a/src/winextras/doc/snippets/code/thumbbar.qml b/src/winextras/doc/snippets/code/thumbbar.qml deleted file mode 100644 index d521a0a..0000000 --- a/src/winextras/doc/snippets/code/thumbbar.qml +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Window 2.0 -import QtWinExtras 1.0 - -//! [thumbbar_qml] -Window { - ThumbnailToolBar { - ThumbnailToolButton { iconSource: "qrc:///player_rew.png"; tooltip: "Rewind"; onClicked: player.rewind() } - ThumbnailToolButton { iconSource: "qrc:///player_pause.png"; tooltip: "Pause"; onClicked: player.togglePlay() } - ThumbnailToolButton { iconSource: "qrc:///player_fwd.png"; tooltip: "Forward"; onClicked: player.forward() } - ThumbnailToolButton { interactive: false; flat: true } - ThumbnailToolButton { iconSource: "qrc:///configure.png"; tooltip: "Settings"; onClicked: settingsWindow.show() } - ThumbnailToolButton { iconSource: "qrc:///document_open_folder.png"; tooltip: "Open"; onClicked: player.open() } - } -} -//! [thumbbar_qml] diff --git a/src/winextras/doc/snippets/code/use-qtwinextras.cpp b/src/winextras/doc/snippets/code/use-qtwinextras.cpp deleted file mode 100644 index 51f3718..0000000 --- a/src/winextras/doc/snippets/code/use-qtwinextras.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//! [include] -#include <QtWinExtras> -//! [include] diff --git a/src/winextras/doc/snippets/code/use-qtwinextras.pro b/src/winextras/doc/snippets/code/use-qtwinextras.pro deleted file mode 100644 index fd6cfdb..0000000 --- a/src/winextras/doc/snippets/code/use-qtwinextras.pro +++ /dev/null @@ -1,3 +0,0 @@ -#! [link] -QT += winextras -#! [link] diff --git a/src/winextras/doc/src/qtwinextras-examples.qdoc b/src/winextras/doc/src/qtwinextras-examples.qdoc deleted file mode 100644 index e51189c..0000000 --- a/src/winextras/doc/src/qtwinextras-examples.qdoc +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - -\group examples-qtwinextras -\title Qt Windows Extras Examples -\brief Examples for the Qt Windows Extras module. -\ingroup all-examples - -Here is a list of example applications demonstrating the functionality -provided by the \l{Qt Windows Extras} module. - -\note These examples work only on \l{Qt for Windows}{Windows} operating system. -*/
\ No newline at end of file diff --git a/src/winextras/doc/src/qtwinextras-index.qdoc b/src/winextras/doc/src/qtwinextras-index.qdoc deleted file mode 100644 index 00ab266..0000000 --- a/src/winextras/doc/src/qtwinextras-index.qdoc +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page qtwinextras-index.html - \title Qt Windows Extras - \brief Provides classes and functions for using some Windows APIs in a Qt way - - Qt Windows Extras provide classes and functions that enable you to use - miscellaneous Windows-specific functions. For example, you can convert Qt - objects to Windows object handles and manipulate DWM glass frames. - - In addition, you can use features introduced with Windows 7, such as Aero - Peek, Jump Lists, a progress indicator on a taskbar button, or a thumbnail - toolbar. - - \section1 Getting Started - - To include the definitions of the module's classes and functions, use the - following directive: - - \snippet code/use-qtwinextras.cpp include - - To link against the module, add this line to your qmake .pro file: - - \snippet code/use-qtwinextras.pro link - - \section1 Articles and Guides - - \list - \li \l {Qt Windows Extras Overview} - \endlist - - \section1 Examples - - \list - \li \l {Qt Windows Extras Examples} - \endlist - - \section1 API Reference - - These are links to the API reference materials. - - \list - \li \l {Qt Windows Extras C++ Classes}{C++ Classes and Namespaces} - \li \l {Qt Windows Extras QML Types}{QML Types} - \endlist -*/ diff --git a/src/winextras/doc/src/qtwinextras-module-cpp.qdoc b/src/winextras/doc/src/qtwinextras-module-cpp.qdoc deleted file mode 100644 index 92e74e0..0000000 --- a/src/winextras/doc/src/qtwinextras-module-cpp.qdoc +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \module QtWinExtras - \title Qt Windows Extras C++ Classes - \brief Provides classes and functions for using some Windows APIs in a Qt way. - - \ingroup modules - \ingroup technology-apis - \qtvariable winextras - - The QtWin namespace contains Windows-specific functions for type - conversions and DWM glass frame manipulation. - - The classes enable you to use features introduced with Windows 7, such as - Jump Lists, a progress indicator on a taskbar button, or a thumbnail - toolbar. -*/ diff --git a/src/winextras/doc/src/qtwinextras-module-qml.qdoc b/src/winextras/doc/src/qtwinextras-module-qml.qdoc deleted file mode 100644 index 62797ef..0000000 --- a/src/winextras/doc/src/qtwinextras-module-qml.qdoc +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \qmlmodule QtWinExtras 1.\QtMinorVersion - \title Qt Windows Extras QML Types - \ingroup qmlmodules - \brief Enables the use of Windows features with QML. - - \section1 QML Types - - The QML types can be imported into your application using the - following import statement in your .qml file. - - \qml \QtMinorVersion - import QtWinExtras 1.\1 - \endqml - */ diff --git a/src/winextras/doc/src/qtwinextras-overview.qdoc b/src/winextras/doc/src/qtwinextras-overview.qdoc deleted file mode 100644 index 39bdcd4..0000000 --- a/src/winextras/doc/src/qtwinextras-overview.qdoc +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Ivan Vizir <define-true-false@yandex.com> -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page qtwinextras-Overview.html - \title Qt Windows Extras Overview - \brief Qt Windows Extras provides classes and functions for using some - Windows APIs in a Qt way - - Qt Windows Extras provide classes and functions that enable you to use - miscellaneous Windows-specific functions. For example, you can convert Qt - objects to Windows object handles and manipulate DWM glass frames. - - In addition, you can use features introduced with Windows 7, such as Aero - Peek, Jump Lists, a progress indicator on a taskbar button, or a thumbnail - toolbar. - - \section1 Type Conversion - - The QtWin namespace provides functions to convert Qt objects of classes - such as QPixmap or QImage to Windows HBITMAP or HICON handles, and vice - versa. - - \section1 DWM and Glass Frame - - You can determine whether a window is included in the DWM Flip3D rendering. - - The glass frame that was first introduced with Windows Vista can be easily - manipulated using the QtWin::extendFrameIntoClientArea() and - QtWin::enableBlurBehindWindow() functions. Windows 8 lost the glass - effect, but applications can still integrate their windows into the system - frame to visually separate window controls from the rest of the window or to - focus the user's attention on window content. - - \image glass.png "Glass frame extended into client area of a window" - - \section1 Aero Peek - - The Windows 7 \b {Aero Peek} feature gives the users the powers of X-ray - vision that enable them to peek past all open windows straight at the - desktop and the gadgets placed there. They can view the contents of a window - without actually switching to it. You can enable Aero Peek for a - gadget-like window or for a window that constantly displays monitoring data. - - You can use the QtWin::setWindowExcludedFromPeek() function to exclude - an application window from Aero Peek. - - \note Aero Peek is disabled in Windows 8 by default but can be enabled - by the user. - - \image peek-on.png "A window excluded from Aero Peek" - - \section1 Taskbar - - The taskbar provides users with access to applications that are open on the - desktop. Windows automatically creates buttons on the taskbar for accessing - application windows. Windows 7 adds new features to the taskbar buttons - that are discussed in the following sections. - - \section2 Overlay Icons and Progress Indicators - - You can use the QWinTaskbarButton class to set an overlay icon and the - QWinTaskbarProgress class to display a progress indicator on a taskbar button. - An overlay icon indicates change in the state of the application. A progress - indicator shows how time-consuming tasks are progressing. - - \image taskbar-button.png Taskbar Button - - \section3 Taskbar Example - - The following example code illustrates how to use the QWinTaskbarButton - and QWinTaskbarProgress classes to adjust the look of the taskbar button: - - \snippet code/taskbar.cpp taskbar_cpp - - \section2 Jump Lists - - An application can use Jump Lists to provide users with faster access to - files or to display shortcuts to tasks or commands. - - \image jumplist.png Jump List - - \list - - \li \b Destinations — categorized shortcuts to files and URLs that the - application can handle and even links to other applications. - Windows provides two standard categories that can be added to the - custom Jump List, in addition to the ones that the application can - create itself. - \li \b Recent and \b Frequent — so called \e known categories that are - populated automatically by Windows when the application uses the - QFileDialog::getOpenFileName() function or when the application is - launched to open a file from the Windows shell. - - \li \b Tasks — shortcuts to application functionality. An application - can display its most frequently used context-independent functions - on task lists. - - \endlist - - \note To be able to add destinations to its Jump Lists, the application - should associate itself with the file types it can handle. - - \section3 Jump List Example - - The following example code illustrates how to use the classes in the - QWinJumpList and QWinJumpListItem classes to implement Jump Lists: - - \snippet code/jumplist.cpp jumplist - - \section2 Thumbnail Toolbar - - Applications can embed a toolbar in the thumbnail of a window, which is - shown when hovering over its taskbar icon. A thumbnail toolbar may provide - quick access to the window's commands without requiring the user to restore - or activate the window. - - \image thumbbar.png Media player thumbnail toolbar - - \section3 Thumbnail Toolbar Example - - The following example code illustrates how to use the functions in the - QWinThumbnailToolBar and QWinThumbnailToolButton class to implement a - thumbnail toolbar: - - \snippet code/thumbbar.cpp thumbbar_cpp - -*/ diff --git a/src/winextras/qwinevent.cpp b/src/winextras/qwinevent.cpp deleted file mode 100644 index a1e77b4..0000000 --- a/src/winextras/qwinevent.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qwinevent.h" - -const int QWinEvent::ColorizationChange = QEvent::registerEventType(); -const int QWinEvent::CompositionChange = QEvent::registerEventType(); -const int QWinEvent::TaskbarButtonCreated = QEvent::registerEventType(); -const int QWinEvent::ThemeChange = QEvent::registerEventType(); - -QWinEvent::QWinEvent(int type) : QEvent(static_cast<QEvent::Type>(type)) -{ -} - -QWinEvent::~QWinEvent() = default; - -QWinColorizationChangeEvent::QWinColorizationChangeEvent(QRgb color, bool opaque) - : QWinEvent(ColorizationChange), rgb(color), opaque(opaque) -{ -} - -QWinColorizationChangeEvent::~QWinColorizationChangeEvent() = default; - -QWinCompositionChangeEvent::QWinCompositionChangeEvent(bool enabled) - : QWinEvent(CompositionChange), enabled(enabled) -{ -} - -QWinCompositionChangeEvent::~QWinCompositionChangeEvent() = default; diff --git a/src/winextras/qwinevent.h b/src/winextras/qwinevent.h deleted file mode 100644 index ad77eb3..0000000 --- a/src/winextras/qwinevent.h +++ /dev/null @@ -1,90 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINEVENT_H -#define QWINEVENT_H - -#include <QtGui/qrgb.h> -#include <QtCore/qcoreevent.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class Q_WINEXTRAS_EXPORT QWinEvent : public QEvent -{ -public: - static const int ColorizationChange; - static const int CompositionChange; - static const int TaskbarButtonCreated; - static const int ThemeChange; - - explicit QWinEvent(int type); - ~QWinEvent(); -}; - -class Q_WINEXTRAS_EXPORT QWinColorizationChangeEvent : public QWinEvent -{ -public: - QWinColorizationChangeEvent(QRgb color, bool opaque); - ~QWinColorizationChangeEvent(); - - inline QRgb color() const { return rgb; } - inline bool opaqueBlend() const { return opaque; } - -private: - QRgb rgb; - bool opaque; -}; - -class Q_WINEXTRAS_EXPORT QWinCompositionChangeEvent : public QWinEvent -{ -public: - explicit QWinCompositionChangeEvent(bool enabled); - ~QWinCompositionChangeEvent(); - - inline bool isCompositionEnabled() const { return enabled; } - -private: - bool enabled; -}; - -QT_END_NAMESPACE - -#endif // QWINEVENT_H diff --git a/src/winextras/qwineventfilter.cpp b/src/winextras/qwineventfilter.cpp deleted file mode 100644 index 4b88f54..0000000 --- a/src/winextras/qwineventfilter.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qwineventfilter_p.h" -#include "qwinfunctions.h" -#include "qwinevent.h" -#include <QtGui/qguiapplication.h> -#include <QtGui/qwindow.h> - -#ifndef WM_DWMCOLORIZATIONCOLORCHANGED -# define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320 -#endif - -#ifndef WM_DWMCOMPOSITIONCHANGED -# define WM_DWMCOMPOSITIONCHANGED 0x031E -#endif - -QWinEventFilter *QWinEventFilter::instance = nullptr; - -QWinEventFilter::QWinEventFilter() : - tbButtonCreatedMsgId(RegisterWindowMessageW(L"TaskbarButtonCreated")) -{ -} - -QWinEventFilter::~QWinEventFilter() -{ - instance = nullptr; -} - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) -bool QWinEventFilter::nativeEventFilter(const QByteArray &, void *message, qintptr *result) -#else -bool QWinEventFilter::nativeEventFilter(const QByteArray &, void *message, long *result) -#endif -{ - MSG *msg = static_cast<MSG *>(message); - bool filterOut = false; - - QEvent *event = nullptr; - QWindow *window = nullptr; - switch (msg->message) { - case WM_DWMCOLORIZATIONCOLORCHANGED : - event = new QWinColorizationChangeEvent(QRgb(msg->wParam), msg->lParam); - break; - case WM_DWMCOMPOSITIONCHANGED : - event = new QWinCompositionChangeEvent(QtWin::isCompositionEnabled()); - break; - case WM_THEMECHANGED : - event = new QWinEvent(QWinEvent::ThemeChange); - break; - default : - if (tbButtonCreatedMsgId == msg->message) { - event = new QWinEvent(QWinEvent::TaskbarButtonCreated); - filterOut = true; - } - break; - } - - if (event) { - window = findWindow(msg->hwnd); - if (window) - QCoreApplication::sendEvent(window, event); - delete event; - } - - if (filterOut && result) { - *result = 0; - } - - return filterOut; -} - -void QWinEventFilter::setup() -{ - if (!instance) { - instance = new QWinEventFilter; - qApp->installNativeEventFilter(instance); - } -} - -QWindow *QWinEventFilter::findWindow(HWND handle) -{ - const WId wid = reinterpret_cast<WId>(handle); - const auto topLevels = QGuiApplication::topLevelWindows(); - for (QWindow *topLevel : topLevels) { - if (topLevel->handle() && topLevel->winId() == wid) - return topLevel; - } - return nullptr; -} diff --git a/src/winextras/qwineventfilter_p.h b/src/winextras/qwineventfilter_p.h deleted file mode 100644 index ad37177..0000000 --- a/src/winextras/qwineventfilter_p.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINEVENTFILTER_H -#define QWINEVENTFILTER_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtWinExtras/qwinextrasglobal.h> -#include <QtCore/qabstractnativeeventfilter.h> -#include <QtCore/qt_windows.h> - -QT_BEGIN_NAMESPACE - -class QWindow; - -class Q_WINEXTRAS_EXPORT QWinEventFilter : public QAbstractNativeEventFilter -{ -public: - QWinEventFilter(); - ~QWinEventFilter(); -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override; -#else - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; -#endif - - static void setup(); - -private: - static QWinEventFilter *instance; - QWindow *findWindow(HWND); - UINT tbButtonCreatedMsgId; -}; - -QT_END_NAMESPACE - -#endif // QWINEVENTFILTER_H diff --git a/src/winextras/qwinextrasglobal.h b/src/winextras/qwinextrasglobal.h deleted file mode 100644 index e66326d..0000000 --- a/src/winextras/qwinextrasglobal.h +++ /dev/null @@ -1,59 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWinExtras module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWINEXTRASGLOBAL_H -#define QWINEXTRASGLOBAL_H - -#include <QtCore/qglobal.h> - -QT_BEGIN_NAMESPACE - -#ifndef QT_STATIC -# if defined(QT_BUILD_WINEXTRAS_LIB) -# define Q_WINEXTRAS_EXPORT Q_DECL_EXPORT -# else -# define Q_WINEXTRAS_EXPORT Q_DECL_IMPORT -# endif -#else -# define Q_WINEXTRAS_EXPORT -#endif - -QT_END_NAMESPACE - -#endif // QWINEXTRASGLOBAL_H diff --git a/src/winextras/qwinfunctions.cpp b/src/winextras/qwinfunctions.cpp deleted file mode 100644 index b0e0ff4..0000000 --- a/src/winextras/qwinfunctions.cpp +++ /dev/null @@ -1,2111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWinExtras module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#if defined(NTDDI_VERSION) && NTDDI_VERSION < 0x06010000 // NTDDI_WIN7 -# undef NTDDI_VERSION -#endif -#if !defined(NTDDI_VERSION) -# define NTDDI_VERSION 0x06010000 // Enable functions for MinGW -#endif - -#include "qwinfunctions.h" -#include "qwinfunctions_p.h" -#include "qwineventfilter_p.h" -#include "windowsguidsdefs_p.h" - -#include <QtGui/qguiapplication.h> -#include <QtGui/qwindow.h> -#include <QtGui/qpixmap.h> -#include <QtGui/qbitmap.h> -#include <QtGui/qimage.h> -#include <QtGui/qcolor.h> -#include <QtGui/qregion.h> -#include <QtCore/qmargins.h> -#include <QtCore/qsettings.h> - -#include <comdef.h> -#include "winshobjidl_p.h" - -QT_BEGIN_NAMESPACE - -Q_GUI_EXPORT HBITMAP qt_createIconMask(const QBitmap &bitmap); -Q_GUI_EXPORT HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat = 0); -Q_GUI_EXPORT QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0); -Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &p); -Q_GUI_EXPORT HBITMAP qt_imageToWinHBITMAP(const QImage &imageIn, int hbitmapFormat = 0); -Q_GUI_EXPORT QImage qt_imageFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat = 0); -Q_GUI_EXPORT QImage qt_imageFromWinHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h); -Q_GUI_EXPORT QPixmap qt_pixmapFromWinHICON(HICON icon); - -/*! - \namespace QtWin - \inmodule QtWinExtras - \brief The QtWin namespace contains miscellaneous Windows-specific functions. - \inheaderfile QtWin - - */ - -/*! - \since 5.2 - - Creates a \c HBITMAP equivalent of the QBitmap \a bitmap. - - It is the caller's responsibility to free the \c HBITMAP data after use. - - \sa toHBITMAP() -*/ -HBITMAP QtWin::createMask(const QBitmap &bitmap) -{ - return qt_createIconMask(bitmap); -} - -/*! - \since 5.2 - - Creates a \c HBITMAP equivalent of the QPixmap \a p, - based on the given \a format. Returns the \c HBITMAP handle. - - It is the caller's responsibility to free the \c HBITMAP data - after use. - - \sa fromHBITMAP() -*/ -HBITMAP QtWin::toHBITMAP(const QPixmap &p, QtWin::HBitmapFormat format) -{ - return qt_pixmapToWinHBITMAP(p, format); -} - -/*! - \since 5.2 - - Returns a QPixmap that is equivalent to the - given \a bitmap. The conversion is based on the specified \a format. - - \sa toHBITMAP() -*/ -QPixmap QtWin::fromHBITMAP(HBITMAP bitmap, QtWin::HBitmapFormat format) -{ - return qt_pixmapFromWinHBITMAP(bitmap, format); -} - -/*! - \since 5.2 - - Creates a \c HICON equivalent of the QPixmap \a p. - Returns the \c HICON handle. - - It is the caller's responsibility to free the \c HICON data after use. - - \sa fromHICON() -*/ -HICON QtWin::toHICON(const QPixmap &p) -{ - return qt_pixmapToWinHICON(p); -} - -/*! - \since 5.12 - - Creates a \c HBITMAP equivalent of the QImage \a image, - based on the given \a format. Returns the \c HBITMAP handle. - - It is the caller's responsibility to free the \c HBITMAP data - after use. - - \sa imageFromHBITMAP() -*/ -HBITMAP QtWin::imageToHBITMAP(const QImage &image, QtWin::HBitmapFormat format) -{ - return qt_imageToWinHBITMAP(image, format); -} - -/*! - \since 5.2 - - Returns a QImage that is equivalent to the - given \a bitmap. The conversion is based on the specified \c HDC context \a hdc - using the specified \a width and \a height. - - \sa toHBITMAP() -*/ -QImage QtWin::imageFromHBITMAP(HDC hdc, HBITMAP bitmap, int width, int height) -{ - return qt_imageFromWinHBITMAP(hdc, bitmap, width, height); -} - -/*! - \since 5.12 - - Returns a QImage that is equivalent to the - given \a bitmap. The conversion is based on the specified \a format. - - \sa imageToHBITMAP() -*/ -QImage QtWin::imageFromHBITMAP(HBITMAP bitmap, QtWin::HBitmapFormat format) -{ - return qt_imageFromWinHBITMAP(bitmap, format); -} - -/*! - \since 5.2 - - Returns a QPixmap that is equivalent to the given \a icon. - - \sa toHICON() -*/ -QPixmap QtWin::fromHICON(HICON icon) -{ - return qt_pixmapFromWinHICON(icon); -} - -HRGN qt_RectToHRGN(const QRect &rc) -{ - return CreateRectRgn(rc.left(), rc.top(), rc.right()+1, rc.bottom()+1); -} - -/*! - \since 5.2 - \obsolete - - This function is equivalent to QRegion::toHRGN() - - \sa QRegion::toHRGN() - */ -HRGN QtWin::toHRGN(const QRegion ®ion) -{ - return region.toHRGN(); -} - -/*! - \since 5.2 - \obsolete - - This function is equivalent to QRegion::fromHRGN(). - - \sa QRegion::fromHRGN() - */ -QRegion QtWin::fromHRGN(HRGN hrgn) -{ - return QRegion::fromHRGN(hrgn); -} - -/*! - \since 5.2 - - Returns a message string that explains the \a hresult error id specified or - an empty string if the explanation cannot be found. - */ -QString QtWin::stringFromHresult(HRESULT hresult) -{ - _com_error error(hresult); - return QString::fromWCharArray(error.ErrorMessage()); -} - -/*! - \since 5.2 - - Returns the code name of the \a hresult error id specified (usually the name - of the WinAPI macro) or an empty string if the message is unknown. - */ -QString QtWin::errorStringFromHresult(HRESULT hresult) -{ - switch (hresult) { - case HRESULT(0x8000FFFF) : return QStringLiteral("E_UNEXPECTED"); - case HRESULT(0x80004001) : return QStringLiteral("E_NOTIMPL"); - case HRESULT(0x8007000E) : return QStringLiteral("E_OUTOFMEMORY"); - case HRESULT(0x80070057) : return QStringLiteral("E_INVALIDARG"); - case HRESULT(0x80004002) : return QStringLiteral("E_NOINTERFACE"); - case HRESULT(0x80004003) : return QStringLiteral("E_POINTER"); - case HRESULT(0x80070006) : return QStringLiteral("E_HANDLE"); - case HRESULT(0x80004004) : return QStringLiteral("E_ABORT"); - case HRESULT(0x80004005) : return QStringLiteral("E_FAIL"); - case HRESULT(0x80070005) : return QStringLiteral("E_ACCESSDENIED"); - case HRESULT(0x8000000A) : return QStringLiteral("E_PENDING"); - case HRESULT(0x80004006) : return QStringLiteral("CO_E_INIT_TLS"); - case HRESULT(0x80004007) : return QStringLiteral("CO_E_INIT_SHARED_ALLOCATOR"); - case HRESULT(0x80004008) : return QStringLiteral("CO_E_INIT_MEMORY_ALLOCATOR"); - case HRESULT(0x80004009) : return QStringLiteral("CO_E_INIT_CLASS_CACHE"); - case HRESULT(0x8000400A) : return QStringLiteral("CO_E_INIT_RPC_CHANNEL"); - case HRESULT(0x8000400B) : return QStringLiteral("CO_E_INIT_TLS_SET_CHANNEL_CONTROL"); - case HRESULT(0x8000400C) : return QStringLiteral("CO_E_INIT_TLS_CHANNEL_CONTROL"); - case HRESULT(0x8000400D) : return QStringLiteral("CO_E_INIT_UNACCEPTED_USER_ALLOCATOR"); - case HRESULT(0x8000400E) : return QStringLiteral("CO_E_INIT_SCM_MUTEX_EXISTS"); - case HRESULT(0x8000400F) : return QStringLiteral("CO_E_INIT_SCM_FILE_MAPPING_EXISTS"); - case HRESULT(0x80004010) : return QStringLiteral("CO_E_INIT_SCM_MAP_VIEW_OF_FILE"); - case HRESULT(0x80004011) : return QStringLiteral("CO_E_INIT_SCM_EXEC_FAILURE"); - case HRESULT(0x80004012) : return QStringLiteral("CO_E_INIT_ONLY_SINGLE_THREADED"); - case HRESULT(0x80004013) : return QStringLiteral("CO_E_CANT_REMOTE"); - case HRESULT(0x80004014) : return QStringLiteral("CO_E_BAD_SERVER_NAME"); - case HRESULT(0x80004015) : return QStringLiteral("CO_E_WRONG_SERVER_IDENTITY"); - case HRESULT(0x80004016) : return QStringLiteral("CO_E_OLE1DDE_DISABLED"); - case HRESULT(0x80004017) : return QStringLiteral("CO_E_RUNAS_SYNTAX"); - case HRESULT(0x80004018) : return QStringLiteral("CO_E_CREATEPROCESS_FAILURE"); - case HRESULT(0x80004019) : return QStringLiteral("CO_E_RUNAS_CREATEPROCESS_FAILURE"); - case HRESULT(0x8000401A) : return QStringLiteral("CO_E_RUNAS_LOGON_FAILURE"); - case HRESULT(0x8000401B) : return QStringLiteral("CO_E_LAUNCH_PERMSSION_DENIED"); - case HRESULT(0x8000401C) : return QStringLiteral("CO_E_START_SERVICE_FAILURE"); - case HRESULT(0x8000401D) : return QStringLiteral("CO_E_REMOTE_COMMUNICATION_FAILURE"); - case HRESULT(0x8000401E) : return QStringLiteral("CO_E_SERVER_START_TIMEOUT"); - case HRESULT(0x8000401F) : return QStringLiteral("CO_E_CLSREG_INCONSISTENT"); - case HRESULT(0x80004020) : return QStringLiteral("CO_E_IIDREG_INCONSISTENT"); - case HRESULT(0x80004021) : return QStringLiteral("CO_E_NOT_SUPPORTED"); - case HRESULT(0x80004022) : return QStringLiteral("CO_E_RELOAD_DLL"); - case HRESULT(0x80004023) : return QStringLiteral("CO_E_MSI_ERROR"); - case HRESULT(0x80004024) : return QStringLiteral("CO_E_ATTEMPT_TO_CREATE_OUTSIDE_CLIENT_CONTEXT"); - case HRESULT(0x80004025) : return QStringLiteral("CO_E_SERVER_PAUSED"); - case HRESULT(0x80004026) : return QStringLiteral("CO_E_SERVER_NOT_PAUSED"); - case HRESULT(0x80004027) : return QStringLiteral("CO_E_CLASS_DISABLED"); - case HRESULT(0x80004028) : return QStringLiteral("CO_E_CLRNOTAVAILABLE"); - case HRESULT(0x80004029) : return QStringLiteral("CO_E_ASYNC_WORK_REJECTED"); - case HRESULT(0x8000402A) : return QStringLiteral("CO_E_SERVER_INIT_TIMEOUT"); - case HRESULT(0x8000402B) : return QStringLiteral("CO_E_NO_SECCTX_IN_ACTIVATE"); - case HRESULT(0x80004030) : return QStringLiteral("CO_E_TRACKER_CONFIG"); - case HRESULT(0x80004031) : return QStringLiteral("CO_E_THREADPOOL_CONFIG"); - case HRESULT(0x80004032) : return QStringLiteral("CO_E_SXS_CONFIG"); - case HRESULT(0x80004033) : return QStringLiteral("CO_E_MALFORMED_SPN"); - case HRESULT(0x80040000) : return QStringLiteral("OLE_E_OLEVERB"); - case HRESULT(0x80040001) : return QStringLiteral("OLE_E_ADVF"); - case HRESULT(0x80040002) : return QStringLiteral("OLE_E_ENUM_NOMORE"); - case HRESULT(0x80040003) : return QStringLiteral("OLE_E_ADVISENOTSUPPORTED"); - case HRESULT(0x80040004) : return QStringLiteral("OLE_E_NOCONNECTION"); - case HRESULT(0x80040005) : return QStringLiteral("OLE_E_NOTRUNNING"); - case HRESULT(0x80040006) : return QStringLiteral("OLE_E_NOCACHE"); - case HRESULT(0x80040007) : return QStringLiteral("OLE_E_BLANK"); - case HRESULT(0x80040008) : return QStringLiteral("OLE_E_CLASSDIFF"); - case HRESULT(0x80040009) : return QStringLiteral("OLE_E_CANT_GETMONIKER"); - case HRESULT(0x8004000A) : return QStringLiteral("OLE_E_CANT_BINDTOSOURCE"); - case HRESULT(0x8004000B) : return QStringLiteral("OLE_E_STATIC"); - case HRESULT(0x8004000C) : return QStringLiteral("OLE_E_PROMPTSAVECANCELLED"); - case HRESULT(0x8004000D) : return QStringLiteral("OLE_E_INVALIDRECT"); - case HRESULT(0x8004000E) : return QStringLiteral("OLE_E_WRONGCOMPOBJ"); - case HRESULT(0x8004000F) : return QStringLiteral("OLE_E_INVALIDHWND"); - case HRESULT(0x80040010) : return QStringLiteral("OLE_E_NOT_INPLACEACTIVE"); - case HRESULT(0x80040011) : return QStringLiteral("OLE_E_CANTCONVERT"); - case HRESULT(0x80040012) : return QStringLiteral("OLE_E_NOSTORAGE"); - case HRESULT(0x80040064) : return QStringLiteral("DV_E_FORMATETC"); - case HRESULT(0x80040065) : return QStringLiteral("DV_E_DVTARGETDEVICE"); - case HRESULT(0x80040066) : return QStringLiteral("DV_E_STGMEDIUM"); - case HRESULT(0x80040067) : return QStringLiteral("DV_E_STATDATA"); - case HRESULT(0x80040068) : return QStringLiteral("DV_E_LINDEX"); - case HRESULT(0x80040069) : return QStringLiteral("DV_E_TYMED"); - case HRESULT(0x8004006A) : return QStringLiteral("DV_E_CLIPFORMAT"); - case HRESULT(0x8004006B) : return QStringLiteral("DV_E_DVASPECT"); - case HRESULT(0x8004006C) : return QStringLiteral("DV_E_DVTARGETDEVICE_SIZE"); - case HRESULT(0x8004006D) : return QStringLiteral("DV_E_NOIVIEWOBJECT"); - case HRESULT(0x80040100) : return QStringLiteral("DRAGDROP_E_NOTREGISTERED"); - case HRESULT(0x80040101) : return QStringLiteral("DRAGDROP_E_ALREADYREGISTERED"); - case HRESULT(0x80040102) : return QStringLiteral("DRAGDROP_E_INVALIDHWND"); - case HRESULT(0x80040110) : return QStringLiteral("CLASS_E_NOAGGREGATION"); - case HRESULT(0x80040111) : return QStringLiteral("CLASS_E_CLASSNOTAVAILABLE"); - case HRESULT(0x80040112) : return QStringLiteral("CLASS_E_NOTLICENSED"); - case HRESULT(0x80040140) : return QStringLiteral("VIEW_E_DRAW"); - case HRESULT(0x80040150) : return QStringLiteral("REGDB_E_READREGDB"); - case HRESULT(0x80040151) : return QStringLiteral("REGDB_E_WRITEREGDB"); - case HRESULT(0x80040152) : return QStringLiteral("REGDB_E_KEYMISSING"); - case HRESULT(0x80040153) : return QStringLiteral("REGDB_E_INVALIDVALUE"); - case HRESULT(0x80040154) : return QStringLiteral("REGDB_E_CLASSNOTREG"); - case HRESULT(0x80040155) : return QStringLiteral("REGDB_E_IIDNOTREG"); - case HRESULT(0x80040156) : return QStringLiteral("REGDB_E_BADTHREADINGMODEL"); - case HRESULT(0x80040160) : return QStringLiteral("CAT_E_CATIDNOEXIST"); - case HRESULT(0x80040161) : return QStringLiteral("CAT_E_NODESCRIPTION"); - case HRESULT(0x80040164) : return QStringLiteral("CS_E_PACKAGE_NOTFOUND"); - case HRESULT(0x80040165) : return QStringLiteral("CS_E_NOT_DELETABLE"); - case HRESULT(0x80040166) : return QStringLiteral("CS_E_CLASS_NOTFOUND"); - case HRESULT(0x80040167) : return QStringLiteral("CS_E_INVALID_VERSION"); - case HRESULT(0x80040168) : return QStringLiteral("CS_E_NO_CLASSSTORE"); - case HRESULT(0x80040169) : return QStringLiteral("CS_E_OBJECT_NOTFOUND"); - case HRESULT(0x8004016A) : return QStringLiteral("CS_E_OBJECT_ALREADY_EXISTS"); - case HRESULT(0x8004016B) : return QStringLiteral("CS_E_INVALID_PATH"); - case HRESULT(0x8004016C) : return QStringLiteral("CS_E_NETWORK_ERROR"); - case HRESULT(0x8004016D) : return QStringLiteral("CS_E_ADMIN_LIMIT_EXCEEDED"); - case HRESULT(0x8004016E) : return QStringLiteral("CS_E_SCHEMA_MISMATCH"); - case HRESULT(0x8004016F) : return QStringLiteral("CS_E_INTERNAL_ERROR"); - case HRESULT(0x80040170) : return QStringLiteral("CACHE_E_NOCACHE_UPDATED"); - case HRESULT(0x80040180) : return QStringLiteral("OLEOBJ_E_NOVERBS"); - case HRESULT(0x80040181) : return QStringLiteral("OLEOBJ_E_INVALIDVERB"); - case HRESULT(0x800401A0) : return QStringLiteral("INPLACE_E_NOTUNDOABLE"); - case HRESULT(0x800401A1) : return QStringLiteral("INPLACE_E_NOTOOLSPACE"); - case HRESULT(0x800401C0) : return QStringLiteral("CONVERT10_E_OLESTREAM_GET"); - case HRESULT(0x800401C1) : return QStringLiteral("CONVERT10_E_OLESTREAM_PUT"); - case HRESULT(0x800401C2) : return QStringLiteral("CONVERT10_E_OLESTREAM_FMT"); - case HRESULT(0x800401C3) : return QStringLiteral("CONVERT10_E_OLESTREAM_BITMAP_TO_DIB"); - case HRESULT(0x800401C4) : return QStringLiteral("CONVERT10_E_STG_FMT"); - case HRESULT(0x800401C5) : return QStringLiteral("CONVERT10_E_STG_NO_STD_STREAM"); - case HRESULT(0x800401C6) : return QStringLiteral("CONVERT10_E_STG_DIB_TO_BITMAP"); - case HRESULT(0x800401D0) : return QStringLiteral("CLIPBRD_E_CANT_OPEN"); - case HRESULT(0x800401D1) : return QStringLiteral("CLIPBRD_E_CANT_EMPTY"); - case HRESULT(0x800401D2) : return QStringLiteral("CLIPBRD_E_CANT_SET"); - case HRESULT(0x800401D3) : return QStringLiteral("CLIPBRD_E_BAD_DATA"); - case HRESULT(0x800401D4) : return QStringLiteral("CLIPBRD_E_CANT_CLOSE"); - case HRESULT(0x800401E0) : return QStringLiteral("MK_E_CONNECTMANUALLY"); - case HRESULT(0x800401E1) : return QStringLiteral("MK_E_EXCEEDEDDEADLINE"); - case HRESULT(0x800401E2) : return QStringLiteral("MK_E_NEEDGENERIC"); - case HRESULT(0x800401E3) : return QStringLiteral("MK_E_UNAVAILABLE"); - case HRESULT(0x800401E4) : return QStringLiteral("MK_E_SYNTAX"); - case HRESULT(0x800401E5) : return QStringLiteral("MK_E_NOOBJECT"); - case HRESULT(0x800401E6) : return QStringLiteral("MK_E_INVALIDEXTENSION"); - case HRESULT(0x800401E7) : return QStringLiteral("MK_E_INTERMEDIATEINTERFACENOTSUPPORTED"); - case HRESULT(0x800401E8) : return QStringLiteral("MK_E_NOTBINDABLE"); - case HRESULT(0x800401E9) : return QStringLiteral("MK_E_NOTBOUND"); - case HRESULT(0x800401EA) : return QStringLiteral("MK_E_CANTOPENFILE"); - case HRESULT(0x800401EB) : return QStringLiteral("MK_E_MUSTBOTHERUSER"); - case HRESULT(0x800401EC) : return QStringLiteral("MK_E_NOINVERSE"); - case HRESULT(0x800401ED) : return QStringLiteral("MK_E_NOSTORAGE"); - case HRESULT(0x800401EE) : return QStringLiteral("MK_E_NOPREFIX"); - case HRESULT(0x800401EF) : return QStringLiteral("MK_E_ENUMERATION_FAILED"); - case HRESULT(0x800401F0) : return QStringLiteral("CO_E_NOTINITIALIZED"); - case HRESULT(0x800401F1) : return QStringLiteral("CO_E_ALREADYINITIALIZED"); - case HRESULT(0x800401F2) : return QStringLiteral("CO_E_CANTDETERMINECLASS"); - case HRESULT(0x800401F3) : return QStringLiteral("CO_E_CLASSSTRING"); - case HRESULT(0x800401F4) : return QStringLiteral("CO_E_IIDSTRING"); - case HRESULT(0x800401F5) : return QStringLiteral("CO_E_APPNOTFOUND"); - case HRESULT(0x800401F6) : return QStringLiteral("CO_E_APPSINGLEUSE"); - case HRESULT(0x800401F7) : return QStringLiteral("CO_E_ERRORINAPP"); - case HRESULT(0x800401F8) : return QStringLiteral("CO_E_DLLNOTFOUND"); - case HRESULT(0x800401F9) : return QStringLiteral("CO_E_ERRORINDLL"); - case HRESULT(0x800401FA) : return QStringLiteral("CO_E_WRONGOSFORAPP"); - case HRESULT(0x800401FB) : return QStringLiteral("CO_E_OBJNOTREG"); - case HRESULT(0x800401FC) : return QStringLiteral("CO_E_OBJISREG"); - case HRESULT(0x800401FD) : return QStringLiteral("CO_E_OBJNOTCONNECTED"); - case HRESULT(0x800401FE) : return QStringLiteral("CO_E_APPDIDNTREG"); - case HRESULT(0x800401FF) : return QStringLiteral("CO_E_RELEASED"); - case HRESULT(0x00040200) : return QStringLiteral("EVENT_S_SOME_SUBSCRIBERS_FAILED"); - case HRESULT(0x80040201) : return QStringLiteral("EVENT_E_ALL_SUBSCRIBERS_FAILED"); - case HRESULT(0x00040202) : return QStringLiteral("EVENT_S_NOSUBSCRIBERS"); - case HRESULT(0x80040203) : return QStringLiteral("EVENT_E_QUERYSYNTAX"); - case HRESULT(0x80040204) : return QStringLiteral("EVENT_E_QUERYFIELD"); - case HRESULT(0x80040205) : return QStringLiteral("EVENT_E_INTERNALEXCEPTION"); - case HRESULT(0x80040206) : return QStringLiteral("EVENT_E_INTERNALERROR"); - case HRESULT(0x80040207) : return QStringLiteral("EVENT_E_INVALID_PER_USER_SID"); - case HRESULT(0x80040208) : return QStringLiteral("EVENT_E_USER_EXCEPTION"); - case HRESULT(0x80040209) : return QStringLiteral("EVENT_E_TOO_MANY_METHODS"); - case HRESULT(0x8004020A) : return QStringLiteral("EVENT_E_MISSING_EVENTCLASS"); - case HRESULT(0x8004020B) : return QStringLiteral("EVENT_E_NOT_ALL_REMOVED"); - case HRESULT(0x8004020C) : return QStringLiteral("EVENT_E_COMPLUS_NOT_INSTALLED"); - case HRESULT(0x8004020D) : return QStringLiteral("EVENT_E_CANT_MODIFY_OR_DELETE_UNCONFIGURED_OBJECT"); - case HRESULT(0x8004020E) : return QStringLiteral("EVENT_E_CANT_MODIFY_OR_DELETE_CONFIGURED_OBJECT"); - case HRESULT(0x8004020F) : return QStringLiteral("EVENT_E_INVALID_EVENT_CLASS_PARTITION"); - case HRESULT(0x80040210) : return QStringLiteral("EVENT_E_PER_USER_SID_NOT_LOGGED_ON"); - case HRESULT(0x8004D000) : return QStringLiteral("XACT_E_ALREADYOTHERSINGLEPHASE"); - case HRESULT(0x8004D001) : return QStringLiteral("XACT_E_CANTRETAIN"); - case HRESULT(0x8004D002) : return QStringLiteral("XACT_E_COMMITFAILED"); - case HRESULT(0x8004D003) : return QStringLiteral("XACT_E_COMMITPREVENTED"); - case HRESULT(0x8004D004) : return QStringLiteral("XACT_E_HEURISTICABORT"); - case HRESULT(0x8004D005) : return QStringLiteral("XACT_E_HEURISTICCOMMIT"); - case HRESULT(0x8004D006) : return QStringLiteral("XACT_E_HEURISTICDAMAGE"); - case HRESULT(0x8004D007) : return QStringLiteral("XACT_E_HEURISTICDANGER"); - case HRESULT(0x8004D008) : return QStringLiteral("XACT_E_ISOLATIONLEVEL"); - case HRESULT(0x8004D009) : return QStringLiteral("XACT_E_NOASYNC"); - case HRESULT(0x8004D00A) : return QStringLiteral("XACT_E_NOENLIST"); - case HRESULT(0x8004D00B) : return QStringLiteral("XACT_E_NOISORETAIN"); - case HRESULT(0x8004D00C) : return QStringLiteral("XACT_E_NORESOURCE"); - case HRESULT(0x8004D00D) : return QStringLiteral("XACT_E_NOTCURRENT"); - case HRESULT(0x8004D00E) : return QStringLiteral("XACT_E_NOTRANSACTION"); - case HRESULT(0x8004D00F) : return QStringLiteral("XACT_E_NOTSUPPORTED"); - case HRESULT(0x8004D010) : return QStringLiteral("XACT_E_UNKNOWNRMGRID"); - case HRESULT(0x8004D011) : return QStringLiteral("XACT_E_WRONGSTATE"); - case HRESULT(0x8004D012) : return QStringLiteral("XACT_E_WRONGUOW"); - case HRESULT(0x8004D013) : return QStringLiteral("XACT_E_XTIONEXISTS"); - case HRESULT(0x8004D014) : return QStringLiteral("XACT_E_NOIMPORTOBJECT"); - case HRESULT(0x8004D015) : return QStringLiteral("XACT_E_INVALIDCOOKIE"); - case HRESULT(0x8004D016) : return QStringLiteral("XACT_E_INDOUBT"); - case HRESULT(0x8004D017) : return QStringLiteral("XACT_E_NOTIMEOUT"); - case HRESULT(0x8004D018) : return QStringLiteral("XACT_E_ALREADYINPROGRESS"); - case HRESULT(0x8004D019) : return QStringLiteral("XACT_E_ABORTED"); - case HRESULT(0x8004D01A) : return QStringLiteral("XACT_E_LOGFULL"); - case HRESULT(0x8004D01B) : return QStringLiteral("XACT_E_TMNOTAVAILABLE"); - case HRESULT(0x8004D01C) : return QStringLiteral("XACT_E_CONNECTION_DOWN"); - case HRESULT(0x8004D01D) : return QStringLiteral("XACT_E_CONNECTION_DENIED"); - case HRESULT(0x8004D01E) : return QStringLiteral("XACT_E_REENLISTTIMEOUT"); - case HRESULT(0x8004D01F) : return QStringLiteral("XACT_E_TIP_CONNECT_FAILED"); - case HRESULT(0x8004D020) : return QStringLiteral("XACT_E_TIP_PROTOCOL_ERROR"); - case HRESULT(0x8004D021) : return QStringLiteral("XACT_E_TIP_PULL_FAILED"); - case HRESULT(0x8004D022) : return QStringLiteral("XACT_E_DEST_TMNOTAVAILABLE"); - case HRESULT(0x8004D023) : return QStringLiteral("XACT_E_TIP_DISABLED"); - case HRESULT(0x8004D024) : return QStringLiteral("XACT_E_NETWORK_TX_DISABLED"); - case HRESULT(0x8004D025) : return QStringLiteral("XACT_E_PARTNER_NETWORK_TX_DISABLED"); - case HRESULT(0x8004D026) : return QStringLiteral("XACT_E_XA_TX_DISABLED"); - case HRESULT(0x8004D027) : return QStringLiteral("XACT_E_UNABLE_TO_READ_DTC_CONFIG"); - case HRESULT(0x8004D028) : return QStringLiteral("XACT_E_UNABLE_TO_LOAD_DTC_PROXY"); - case HRESULT(0x8004D029) : return QStringLiteral("XACT_E_ABORTING"); - case HRESULT(0x8004D080) : return QStringLiteral("XACT_E_CLERKNOTFOUND"); - case HRESULT(0x8004D081) : return QStringLiteral("XACT_E_CLERKEXISTS"); - case HRESULT(0x8004D082) : return QStringLiteral("XACT_E_RECOVERYINPROGRESS"); - case HRESULT(0x8004D083) : return QStringLiteral("XACT_E_TRANSACTIONCLOSED"); - case HRESULT(0x8004D084) : return QStringLiteral("XACT_E_INVALIDLSN"); - case HRESULT(0x8004D085) : return QStringLiteral("XACT_E_REPLAYREQUEST"); - case HRESULT(0x0004D000) : return QStringLiteral("XACT_S_ASYNC"); - case HRESULT(0x0004D001) : return QStringLiteral("XACT_S_DEFECT"); - case HRESULT(0x0004D002) : return QStringLiteral("XACT_S_READONLY"); - case HRESULT(0x0004D003) : return QStringLiteral("XACT_S_SOMENORETAIN"); - case HRESULT(0x0004D004) : return QStringLiteral("XACT_S_OKINFORM"); - case HRESULT(0x0004D005) : return QStringLiteral("XACT_S_MADECHANGESCONTENT"); - case HRESULT(0x0004D006) : return QStringLiteral("XACT_S_MADECHANGESINFORM"); - case HRESULT(0x0004D007) : return QStringLiteral("XACT_S_ALLNORETAIN"); - case HRESULT(0x0004D008) : return QStringLiteral("XACT_S_ABORTING"); - case HRESULT(0x0004D009) : return QStringLiteral("XACT_S_SINGLEPHASE"); - case HRESULT(0x0004D00A) : return QStringLiteral("XACT_S_LOCALLY_OK"); - case HRESULT(0x0004D010) : return QStringLiteral("XACT_S_LASTRESOURCEMANAGER"); - case HRESULT(0x8004E002) : return QStringLiteral("CONTEXT_E_ABORTED"); - case HRESULT(0x8004E003) : return QStringLiteral("CONTEXT_E_ABORTING"); - case HRESULT(0x8004E004) : return QStringLiteral("CONTEXT_E_NOCONTEXT"); - case HRESULT(0x8004E005) : return QStringLiteral("CONTEXT_E_WOULD_DEADLOCK"); - case HRESULT(0x8004E006) : return QStringLiteral("CONTEXT_E_SYNCH_TIMEOUT"); - case HRESULT(0x8004E007) : return QStringLiteral("CONTEXT_E_OLDREF"); - case HRESULT(0x8004E00C) : return QStringLiteral("CONTEXT_E_ROLENOTFOUND"); - case HRESULT(0x8004E00F) : return QStringLiteral("CONTEXT_E_TMNOTAVAILABLE"); - case HRESULT(0x8004E021) : return QStringLiteral("CO_E_ACTIVATIONFAILED"); - case HRESULT(0x8004E022) : return QStringLiteral("CO_E_ACTIVATIONFAILED_EVENTLOGGED"); - case HRESULT(0x8004E023) : return QStringLiteral("CO_E_ACTIVATIONFAILED_CATALOGERROR"); - case HRESULT(0x8004E024) : return QStringLiteral("CO_E_ACTIVATIONFAILED_TIMEOUT"); - case HRESULT(0x8004E025) : return QStringLiteral("CO_E_INITIALIZATIONFAILED"); - case HRESULT(0x8004E026) : return QStringLiteral("CONTEXT_E_NOJIT"); - case HRESULT(0x8004E027) : return QStringLiteral("CONTEXT_E_NOTRANSACTION"); - case HRESULT(0x8004E028) : return QStringLiteral("CO_E_THREADINGMODEL_CHANGED"); - case HRESULT(0x8004E029) : return QStringLiteral("CO_E_NOIISINTRINSICS"); - case HRESULT(0x8004E02A) : return QStringLiteral("CO_E_NOCOOKIES"); - case HRESULT(0x8004E02B) : return QStringLiteral("CO_E_DBERROR"); - case HRESULT(0x8004E02C) : return QStringLiteral("CO_E_NOTPOOLED"); - case HRESULT(0x8004E02D) : return QStringLiteral("CO_E_NOTCONSTRUCTED"); - case HRESULT(0x8004E02E) : return QStringLiteral("CO_E_NOSYNCHRONIZATION"); - case HRESULT(0x8004E02F) : return QStringLiteral("CO_E_ISOLEVELMISMATCH"); - case HRESULT(0x00040000) : return QStringLiteral("OLE_S_USEREG"); - case HRESULT(0x00040001) : return QStringLiteral("OLE_S_STATIC"); - case HRESULT(0x00040002) : return QStringLiteral("OLE_S_MAC_CLIPFORMAT"); - case HRESULT(0x00040100) : return QStringLiteral("DRAGDROP_S_DROP"); - case HRESULT(0x00040101) : return QStringLiteral("DRAGDROP_S_CANCEL"); - case HRESULT(0x00040102) : return QStringLiteral("DRAGDROP_S_USEDEFAULTCURSORS"); - case HRESULT(0x00040130) : return QStringLiteral("DATA_S_SAMEFORMATETC"); - case HRESULT(0x00040140) : return QStringLiteral("VIEW_S_ALREADY_FROZEN"); - case HRESULT(0x00040170) : return QStringLiteral("CACHE_S_FORMATETC_NOTSUPPORTED"); - case HRESULT(0x00040171) : return QStringLiteral("CACHE_S_SAMECACHE"); - case HRESULT(0x00040172) : return QStringLiteral("CACHE_S_SOMECACHES_NOTUPDATED"); - case HRESULT(0x00040180) : return QStringLiteral("OLEOBJ_S_INVALIDVERB"); - case HRESULT(0x00040181) : return QStringLiteral("OLEOBJ_S_CANNOT_DOVERB_NOW"); - case HRESULT(0x00040182) : return QStringLiteral("OLEOBJ_S_INVALIDHWND"); - case HRESULT(0x000401A0) : return QStringLiteral("INPLACE_S_TRUNCATED"); - case HRESULT(0x000401C0) : return QStringLiteral("CONVERT10_S_NO_PRESENTATION"); - case HRESULT(0x000401E2) : return QStringLiteral("MK_S_REDUCED_TO_SELF"); - case HRESULT(0x000401E4) : return QStringLiteral("MK_S_ME"); - case HRESULT(0x000401E5) : return QStringLiteral("MK_S_HIM"); - case HRESULT(0x000401E6) : return QStringLiteral("MK_S_US"); - case HRESULT(0x000401E7) : return QStringLiteral("MK_S_MONIKERALREADYREGISTERED"); - case HRESULT(0x00041300) : return QStringLiteral("SCHED_S_TASK_READY"); - case HRESULT(0x00041301) : return QStringLiteral("SCHED_S_TASK_RUNNING"); - case HRESULT(0x00041302) : return QStringLiteral("SCHED_S_TASK_DISABLED"); - case HRESULT(0x00041303) : return QStringLiteral("SCHED_S_TASK_HAS_NOT_RUN"); - case HRESULT(0x00041304) : return QStringLiteral("SCHED_S_TASK_NO_MORE_RUNS"); - case HRESULT(0x00041305) : return QStringLiteral("SCHED_S_TASK_NOT_SCHEDULED"); - case HRESULT(0x00041306) : return QStringLiteral("SCHED_S_TASK_TERMINATED"); - case HRESULT(0x00041307) : return QStringLiteral("SCHED_S_TASK_NO_VALID_TRIGGERS"); - case HRESULT(0x00041308) : return QStringLiteral("SCHED_S_EVENT_TRIGGER"); - case HRESULT(0x80041309) : return QStringLiteral("SCHED_E_TRIGGER_NOT_FOUND"); - case HRESULT(0x8004130A) : return QStringLiteral("SCHED_E_TASK_NOT_READY"); - case HRESULT(0x8004130B) : return QStringLiteral("SCHED_E_TASK_NOT_RUNNING"); - case HRESULT(0x8004130C) : return QStringLiteral("SCHED_E_SERVICE_NOT_INSTALLED"); - case HRESULT(0x8004130D) : return QStringLiteral("SCHED_E_CANNOT_OPEN_TASK"); - case HRESULT(0x8004130E) : return QStringLiteral("SCHED_E_INVALID_TASK"); - case HRESULT(0x8004130F) : return QStringLiteral("SCHED_E_ACCOUNT_INFORMATION_NOT_SET"); - case HRESULT(0x80041310) : return QStringLiteral("SCHED_E_ACCOUNT_NAME_NOT_FOUND"); - case HRESULT(0x80041311) : return QStringLiteral("SCHED_E_ACCOUNT_DBASE_CORRUPT"); - case HRESULT(0x80041312) : return QStringLiteral("SCHED_E_NO_SECURITY_SERVICES"); - case HRESULT(0x80041313) : return QStringLiteral("SCHED_E_UNKNOWN_OBJECT_VERSION"); - case HRESULT(0x80041314) : return QStringLiteral("SCHED_E_UNSUPPORTED_ACCOUNT_OPTION"); - case HRESULT(0x80041315) : return QStringLiteral("SCHED_E_SERVICE_NOT_RUNNING"); - case HRESULT(0x80080001) : return QStringLiteral("CO_E_CLASS_CREATE_FAILED"); - case HRESULT(0x80080002) : return QStringLiteral("CO_E_SCM_ERROR"); - case HRESULT(0x80080003) : return QStringLiteral("CO_E_SCM_RPC_FAILURE"); - case HRESULT(0x80080004) : return QStringLiteral("CO_E_BAD_PATH"); - case HRESULT(0x80080005) : return QStringLiteral("CO_E_SERVER_EXEC_FAILURE"); - case HRESULT(0x80080006) : return QStringLiteral("CO_E_OBJSRV_RPC_FAILURE"); - case HRESULT(0x80080007) : return QStringLiteral("MK_E_NO_NORMALIZED"); - case HRESULT(0x80080008) : return QStringLiteral("CO_E_SERVER_STOPPING"); - case HRESULT(0x80080009) : return QStringLiteral("MEM_E_INVALID_ROOT"); - case HRESULT(0x80080010) : return QStringLiteral("MEM_E_INVALID_LINK"); - case HRESULT(0x80080011) : return QStringLiteral("MEM_E_INVALID_SIZE"); - case HRESULT(0x00080012) : return QStringLiteral("CO_S_NOTALLINTERFACES"); - case HRESULT(0x00080013) : return QStringLiteral("CO_S_MACHINENAMENOTFOUND"); - case HRESULT(0x80020001) : return QStringLiteral("DISP_E_UNKNOWNINTERFACE"); - case HRESULT(0x80020003) : return QStringLiteral("DISP_E_MEMBERNOTFOUND"); - case HRESULT(0x80020004) : return QStringLiteral("DISP_E_PARAMNOTFOUND"); - case HRESULT(0x80020005) : return QStringLiteral("DISP_E_TYPEMISMATCH"); - case HRESULT(0x80020006) : return QStringLiteral("DISP_E_UNKNOWNNAME"); - case HRESULT(0x80020007) : return QStringLiteral("DISP_E_NONAMEDARGS"); - case HRESULT(0x80020008) : return QStringLiteral("DISP_E_BADVARTYPE"); - case HRESULT(0x80020009) : return QStringLiteral("DISP_E_EXCEPTION"); - case HRESULT(0x8002000A) : return QStringLiteral("DISP_E_OVERFLOW"); - case HRESULT(0x8002000B) : return QStringLiteral("DISP_E_BADINDEX"); - case HRESULT(0x8002000C) : return QStringLiteral("DISP_E_UNKNOWNLCID"); - case HRESULT(0x8002000D) : return QStringLiteral("DISP_E_ARRAYISLOCKED"); - case HRESULT(0x8002000E) : return QStringLiteral("DISP_E_BADPARAMCOUNT"); - case HRESULT(0x8002000F) : return QStringLiteral("DISP_E_PARAMNOTOPTIONAL"); - case HRESULT(0x80020010) : return QStringLiteral("DISP_E_BADCALLEE"); - case HRESULT(0x80020011) : return QStringLiteral("DISP_E_NOTACOLLECTION"); - case HRESULT(0x80020012) : return QStringLiteral("DISP_E_DIVBYZERO"); - case HRESULT(0x80020013) : return QStringLiteral("DISP_E_BUFFERTOOSMALL"); - case HRESULT(0x80028016) : return QStringLiteral("TYPE_E_BUFFERTOOSMALL"); - case HRESULT(0x80028017) : return QStringLiteral("TYPE_E_FIELDNOTFOUND"); - case HRESULT(0x80028018) : return QStringLiteral("TYPE_E_INVDATAREAD"); - case HRESULT(0x80028019) : return QStringLiteral("TYPE_E_UNSUPFORMAT"); - case HRESULT(0x8002801C) : return QStringLiteral("TYPE_E_REGISTRYACCESS"); - case HRESULT(0x8002801D) : return QStringLiteral("TYPE_E_LIBNOTREGISTERED"); - case HRESULT(0x80028027) : return QStringLiteral("TYPE_E_UNDEFINEDTYPE"); - case HRESULT(0x80028028) : return QStringLiteral("TYPE_E_QUALIFIEDNAMEDISALLOWED"); - case HRESULT(0x80028029) : return QStringLiteral("TYPE_E_INVALIDSTATE"); - case HRESULT(0x8002802A) : return QStringLiteral("TYPE_E_WRONGTYPEKIND"); - case HRESULT(0x8002802B) : return QStringLiteral("TYPE_E_ELEMENTNOTFOUND"); - case HRESULT(0x8002802C) : return QStringLiteral("TYPE_E_AMBIGUOUSNAME"); - case HRESULT(0x8002802D) : return QStringLiteral("TYPE_E_NAMECONFLICT"); - case HRESULT(0x8002802E) : return QStringLiteral("TYPE_E_UNKNOWNLCID"); - case HRESULT(0x8002802F) : return QStringLiteral("TYPE_E_DLLFUNCTIONNOTFOUND"); - case HRESULT(0x800288BD) : return QStringLiteral("TYPE_E_BADMODULEKIND"); - case HRESULT(0x800288C5) : return QStringLiteral("TYPE_E_SIZETOOBIG"); - case HRESULT(0x800288C6) : return QStringLiteral("TYPE_E_DUPLICATEID"); - case HRESULT(0x800288CF) : return QStringLiteral("TYPE_E_INVALIDID"); - case HRESULT(0x80028CA0) : return QStringLiteral("TYPE_E_TYPEMISMATCH"); - case HRESULT(0x80028CA1) : return QStringLiteral("TYPE_E_OUTOFBOUNDS"); - case HRESULT(0x80028CA2) : return QStringLiteral("TYPE_E_IOERROR"); - case HRESULT(0x80028CA3) : return QStringLiteral("TYPE_E_CANTCREATETMPFILE"); - case HRESULT(0x80029C4A) : return QStringLiteral("TYPE_E_CANTLOADLIBRARY"); - case HRESULT(0x80029C83) : return QStringLiteral("TYPE_E_INCONSISTENTPROPFUNCS"); - case HRESULT(0x80029C84) : return QStringLiteral("TYPE_E_CIRCULARTYPE"); - case HRESULT(0x80030001) : return QStringLiteral("STG_E_INVALIDFUNCTION"); - case HRESULT(0x80030002) : return QStringLiteral("STG_E_FILENOTFOUND"); - case HRESULT(0x80030003) : return QStringLiteral("STG_E_PATHNOTFOUND"); - case HRESULT(0x80030004) : return QStringLiteral("STG_E_TOOMANYOPENFILES"); - case HRESULT(0x80030005) : return QStringLiteral("STG_E_ACCESSDENIED"); - case HRESULT(0x80030006) : return QStringLiteral("STG_E_INVALIDHANDLE"); - case HRESULT(0x80030008) : return QStringLiteral("STG_E_INSUFFICIENTMEMORY"); - case HRESULT(0x80030009) : return QStringLiteral("STG_E_INVALIDPOINTER"); - case HRESULT(0x80030012) : return QStringLiteral("STG_E_NOMOREFILES"); - case HRESULT(0x80030013) : return QStringLiteral("STG_E_DISKISWRITEPROTECTED"); - case HRESULT(0x80030019) : return QStringLiteral("STG_E_SEEKERROR"); - case HRESULT(0x8003001D) : return QStringLiteral("STG_E_WRITEFAULT"); - case HRESULT(0x8003001E) : return QStringLiteral("STG_E_READFAULT"); - case HRESULT(0x80030020) : return QStringLiteral("STG_E_SHAREVIOLATION"); - case HRESULT(0x80030021) : return QStringLiteral("STG_E_LOCKVIOLATION"); - case HRESULT(0x80030050) : return QStringLiteral("STG_E_FILEALREADYEXISTS"); - case HRESULT(0x80030057) : return QStringLiteral("STG_E_INVALIDPARAMETER"); - case HRESULT(0x80030070) : return QStringLiteral("STG_E_MEDIUMFULL"); - case HRESULT(0x800300F0) : return QStringLiteral("STG_E_PROPSETMISMATCHED"); - case HRESULT(0x800300FA) : return QStringLiteral("STG_E_ABNORMALAPIEXIT"); - case HRESULT(0x800300FB) : return QStringLiteral("STG_E_INVALIDHEADER"); - case HRESULT(0x800300FC) : return QStringLiteral("STG_E_INVALIDNAME"); - case HRESULT(0x800300FD) : return QStringLiteral("STG_E_UNKNOWN"); - case HRESULT(0x800300FE) : return QStringLiteral("STG_E_UNIMPLEMENTEDFUNCTION"); - case HRESULT(0x800300FF) : return QStringLiteral("STG_E_INVALIDFLAG"); - case HRESULT(0x80030100) : return QStringLiteral("STG_E_INUSE"); - case HRESULT(0x80030101) : return QStringLiteral("STG_E_NOTCURRENT"); - case HRESULT(0x80030102) : return QStringLiteral("STG_E_REVERTED"); - case HRESULT(0x80030103) : return QStringLiteral("STG_E_CANTSAVE"); - case HRESULT(0x80030104) : return QStringLiteral("STG_E_OLDFORMAT"); - case HRESULT(0x80030105) : return QStringLiteral("STG_E_OLDDLL"); - case HRESULT(0x80030106) : return QStringLiteral("STG_E_SHAREREQUIRED"); - case HRESULT(0x80030107) : return QStringLiteral("STG_E_NOTFILEBASEDSTORAGE"); - case HRESULT(0x80030108) : return QStringLiteral("STG_E_EXTANTMARSHALLINGS"); - case HRESULT(0x80030109) : return QStringLiteral("STG_E_DOCFILECORRUPT"); - case HRESULT(0x80030110) : return QStringLiteral("STG_E_BADBASEADDRESS"); - case HRESULT(0x80030111) : return QStringLiteral("STG_E_DOCFILETOOLARGE"); - case HRESULT(0x80030112) : return QStringLiteral("STG_E_NOTSIMPLEFORMAT"); - case HRESULT(0x80030201) : return QStringLiteral("STG_E_INCOMPLETE"); - case HRESULT(0x80030202) : return QStringLiteral("STG_E_TERMINATED"); - case HRESULT(0x00030200) : return QStringLiteral("STG_S_CONVERTED"); - case HRESULT(0x00030201) : return QStringLiteral("STG_S_BLOCK"); - case HRESULT(0x00030202) : return QStringLiteral("STG_S_RETRYNOW"); - case HRESULT(0x00030203) : return QStringLiteral("STG_S_MONITORING"); - case HRESULT(0x00030204) : return QStringLiteral("STG_S_MULTIPLEOPENS"); - case HRESULT(0x00030205) : return QStringLiteral("STG_S_CONSOLIDATIONFAILED"); - case HRESULT(0x00030206) : return QStringLiteral("STG_S_CANNOTCONSOLIDATE"); - case HRESULT(0x80030305) : return QStringLiteral("STG_E_STATUS_COPY_PROTECTION_FAILURE"); - case HRESULT(0x80030306) : return QStringLiteral("STG_E_CSS_AUTHENTICATION_FAILURE"); - case HRESULT(0x80030307) : return QStringLiteral("STG_E_CSS_KEY_NOT_PRESENT"); - case HRESULT(0x80030308) : return QStringLiteral("STG_E_CSS_KEY_NOT_ESTABLISHED"); - case HRESULT(0x80030309) : return QStringLiteral("STG_E_CSS_SCRAMBLED_SECTOR"); - case HRESULT(0x8003030A) : return QStringLiteral("STG_E_CSS_REGION_MISMATCH"); - case HRESULT(0x8003030B) : return QStringLiteral("STG_E_RESETS_EXHAUSTED"); - case HRESULT(0x80010001) : return QStringLiteral("RPC_E_CALL_REJECTED"); - case HRESULT(0x80010002) : return QStringLiteral("RPC_E_CALL_CANCELED"); - case HRESULT(0x80010003) : return QStringLiteral("RPC_E_CANTPOST_INSENDCALL"); - case HRESULT(0x80010004) : return QStringLiteral("RPC_E_CANTCALLOUT_INASYNCCALL"); - case HRESULT(0x80010005) : return QStringLiteral("RPC_E_CANTCALLOUT_INEXTERNALCALL"); - case HRESULT(0x80010006) : return QStringLiteral("RPC_E_CONNECTION_TERMINATED"); - case HRESULT(0x80010007) : return QStringLiteral("RPC_E_SERVER_DIED"); - case HRESULT(0x80010008) : return QStringLiteral("RPC_E_CLIENT_DIED"); - case HRESULT(0x80010009) : return QStringLiteral("RPC_E_INVALID_DATAPACKET"); - case HRESULT(0x8001000A) : return QStringLiteral("RPC_E_CANTTRANSMIT_CALL"); - case HRESULT(0x8001000B) : return QStringLiteral("RPC_E_CLIENT_CANTMARSHAL_DATA"); - case HRESULT(0x8001000C) : return QStringLiteral("RPC_E_CLIENT_CANTUNMARSHAL_DATA"); - case HRESULT(0x8001000D) : return QStringLiteral("RPC_E_SERVER_CANTMARSHAL_DATA"); - case HRESULT(0x8001000E) : return QStringLiteral("RPC_E_SERVER_CANTUNMARSHAL_DATA"); - case HRESULT(0x8001000F) : return QStringLiteral("RPC_E_INVALID_DATA"); - case HRESULT(0x80010010) : return QStringLiteral("RPC_E_INVALID_PARAMETER"); - case HRESULT(0x80010011) : return QStringLiteral("RPC_E_CANTCALLOUT_AGAIN"); - case HRESULT(0x80010012) : return QStringLiteral("RPC_E_SERVER_DIED_DNE"); - case HRESULT(0x80010100) : return QStringLiteral("RPC_E_SYS_CALL_FAILED"); - case HRESULT(0x80010101) : return QStringLiteral("RPC_E_OUT_OF_RESOURCES"); - case HRESULT(0x80010102) : return QStringLiteral("RPC_E_ATTEMPTED_MULTITHREAD"); - case HRESULT(0x80010103) : return QStringLiteral("RPC_E_NOT_REGISTERED"); - case HRESULT(0x80010104) : return QStringLiteral("RPC_E_FAULT"); - case HRESULT(0x80010105) : return QStringLiteral("RPC_E_SERVERFAULT"); - case HRESULT(0x80010106) : return QStringLiteral("RPC_E_CHANGED_MODE"); - case HRESULT(0x80010107) : return QStringLiteral("RPC_E_INVALIDMETHOD"); - case HRESULT(0x80010108) : return QStringLiteral("RPC_E_DISCONNECTED"); - case HRESULT(0x80010109) : return QStringLiteral("RPC_E_RETRY"); - case HRESULT(0x8001010A) : return QStringLiteral("RPC_E_SERVERCALL_RETRYLATER"); - case HRESULT(0x8001010B) : return QStringLiteral("RPC_E_SERVERCALL_REJECTED"); - case HRESULT(0x8001010C) : return QStringLiteral("RPC_E_INVALID_CALLDATA"); - case HRESULT(0x8001010D) : return QStringLiteral("RPC_E_CANTCALLOUT_ININPUTSYNCCALL"); - case HRESULT(0x8001010E) : return QStringLiteral("RPC_E_WRONG_THREAD"); - case HRESULT(0x8001010F) : return QStringLiteral("RPC_E_THREAD_NOT_INIT"); - case HRESULT(0x80010110) : return QStringLiteral("RPC_E_VERSION_MISMATCH"); - case HRESULT(0x80010111) : return QStringLiteral("RPC_E_INVALID_HEADER"); - case HRESULT(0x80010112) : return QStringLiteral("RPC_E_INVALID_EXTENSION"); - case HRESULT(0x80010113) : return QStringLiteral("RPC_E_INVALID_IPID"); - case HRESULT(0x80010114) : return QStringLiteral("RPC_E_INVALID_OBJECT"); - case HRESULT(0x80010115) : return QStringLiteral("RPC_S_CALLPENDING"); - case HRESULT(0x80010116) : return QStringLiteral("RPC_S_WAITONTIMER"); - case HRESULT(0x80010117) : return QStringLiteral("RPC_E_CALL_COMPLETE"); - case HRESULT(0x80010118) : return QStringLiteral("RPC_E_UNSECURE_CALL"); - case HRESULT(0x80010119) : return QStringLiteral("RPC_E_TOO_LATE"); - case HRESULT(0x8001011A) : return QStringLiteral("RPC_E_NO_GOOD_SECURITY_PACKAGES"); - case HRESULT(0x8001011B) : return QStringLiteral("RPC_E_ACCESS_DENIED"); - case HRESULT(0x8001011C) : return QStringLiteral("RPC_E_REMOTE_DISABLED"); - case HRESULT(0x8001011D) : return QStringLiteral("RPC_E_INVALID_OBJREF"); - case HRESULT(0x8001011E) : return QStringLiteral("RPC_E_NO_CONTEXT"); - case HRESULT(0x8001011F) : return QStringLiteral("RPC_E_TIMEOUT"); - case HRESULT(0x80010120) : return QStringLiteral("RPC_E_NO_SYNC"); - case HRESULT(0x80010121) : return QStringLiteral("RPC_E_FULLSIC_REQUIRED"); - case HRESULT(0x80010122) : return QStringLiteral("RPC_E_INVALID_STD_NAME"); - case HRESULT(0x80010123) : return QStringLiteral("CO_E_FAILEDTOIMPERSONATE"); - case HRESULT(0x80010124) : return QStringLiteral("CO_E_FAILEDTOGETSECCTX"); - case HRESULT(0x80010125) : return QStringLiteral("CO_E_FAILEDTOOPENTHREADTOKEN"); - case HRESULT(0x80010126) : return QStringLiteral("CO_E_FAILEDTOGETTOKENINFO"); - case HRESULT(0x80010127) : return QStringLiteral("CO_E_TRUSTEEDOESNTMATCHCLIENT"); - case HRESULT(0x80010128) : return QStringLiteral("CO_E_FAILEDTOQUERYCLIENTBLANKET"); - case HRESULT(0x80010129) : return QStringLiteral("CO_E_FAILEDTOSETDACL"); - case HRESULT(0x8001012A) : return QStringLiteral("CO_E_ACCESSCHECKFAILED"); - case HRESULT(0x8001012B) : return QStringLiteral("CO_E_NETACCESSAPIFAILED"); - case HRESULT(0x8001012C) : return QStringLiteral("CO_E_WRONGTRUSTEENAMESYNTAX"); - case HRESULT(0x8001012D) : return QStringLiteral("CO_E_INVALIDSID"); - case HRESULT(0x8001012E) : return QStringLiteral("CO_E_CONVERSIONFAILED"); - case HRESULT(0x8001012F) : return QStringLiteral("CO_E_NOMATCHINGSIDFOUND"); - case HRESULT(0x80010130) : return QStringLiteral("CO_E_LOOKUPACCSIDFAILED"); - case HRESULT(0x80010131) : return QStringLiteral("CO_E_NOMATCHINGNAMEFOUND"); - case HRESULT(0x80010132) : return QStringLiteral("CO_E_LOOKUPACCNAMEFAILED"); - case HRESULT(0x80010133) : return QStringLiteral("CO_E_SETSERLHNDLFAILED"); - case HRESULT(0x80010134) : return QStringLiteral("CO_E_FAILEDTOGETWINDIR"); - case HRESULT(0x80010135) : return QStringLiteral("CO_E_PATHTOOLONG"); - case HRESULT(0x80010136) : return QStringLiteral("CO_E_FAILEDTOGENUUID"); - case HRESULT(0x80010137) : return QStringLiteral("CO_E_FAILEDTOCREATEFILE"); - case HRESULT(0x80010138) : return QStringLiteral("CO_E_FAILEDTOCLOSEHANDLE"); - case HRESULT(0x80010139) : return QStringLiteral("CO_E_EXCEEDSYSACLLIMIT"); - case HRESULT(0x8001013A) : return QStringLiteral("CO_E_ACESINWRONGORDER"); - case HRESULT(0x8001013B) : return QStringLiteral("CO_E_INCOMPATIBLESTREAMVERSION"); - case HRESULT(0x8001013C) : return QStringLiteral("CO_E_FAILEDTOOPENPROCESSTOKEN"); - case HRESULT(0x8001013D) : return QStringLiteral("CO_E_DECODEFAILED"); - case HRESULT(0x8001013F) : return QStringLiteral("CO_E_ACNOTINITIALIZED"); - case HRESULT(0x80010140) : return QStringLiteral("CO_E_CANCEL_DISABLED"); - case HRESULT(0x8001FFFF) : return QStringLiteral("RPC_E_UNEXPECTED"); - case HRESULT(0xC0090001) : return QStringLiteral("ERROR_AUDITING_DISABLED"); - case HRESULT(0xC0090002) : return QStringLiteral("ERROR_ALL_SIDS_FILTERED"); - case HRESULT(0x80090001) : return QStringLiteral("NTE_BAD_UID"); - case HRESULT(0x80090002) : return QStringLiteral("NTE_BAD_HASH"); - case HRESULT(0x80090003) : return QStringLiteral("NTE_BAD_KEY"); - case HRESULT(0x80090004) : return QStringLiteral("NTE_BAD_LEN"); - case HRESULT(0x80090005) : return QStringLiteral("NTE_BAD_DATA"); - case HRESULT(0x80090006) : return QStringLiteral("NTE_BAD_SIGNATURE"); - case HRESULT(0x80090007) : return QStringLiteral("NTE_BAD_VER"); - case HRESULT(0x80090008) : return QStringLiteral("NTE_BAD_ALGID"); - case HRESULT(0x80090009) : return QStringLiteral("NTE_BAD_FLAGS"); - case HRESULT(0x8009000A) : return QStringLiteral("NTE_BAD_TYPE"); - case HRESULT(0x8009000B) : return QStringLiteral("NTE_BAD_KEY_STATE"); - case HRESULT(0x8009000C) : return QStringLiteral("NTE_BAD_HASH_STATE"); - case HRESULT(0x8009000D) : return QStringLiteral("NTE_NO_KEY"); - case HRESULT(0x8009000E) : return QStringLiteral("NTE_NO_MEMORY"); - case HRESULT(0x8009000F) : return QStringLiteral("NTE_EXISTS"); - case HRESULT(0x80090010) : return QStringLiteral("NTE_PERM"); - case HRESULT(0x80090011) : return QStringLiteral("NTE_NOT_FOUND"); - case HRESULT(0x80090012) : return QStringLiteral("NTE_DOUBLE_ENCRYPT"); - case HRESULT(0x80090013) : return QStringLiteral("NTE_BAD_PROVIDER"); - case HRESULT(0x80090014) : return QStringLiteral("NTE_BAD_PROV_TYPE"); - case HRESULT(0x80090015) : return QStringLiteral("NTE_BAD_PUBLIC_KEY"); - case HRESULT(0x80090016) : return QStringLiteral("NTE_BAD_KEYSET"); - case HRESULT(0x80090017) : return QStringLiteral("NTE_PROV_TYPE_NOT_DEF"); - case HRESULT(0x80090018) : return QStringLiteral("NTE_PROV_TYPE_ENTRY_BAD"); - case HRESULT(0x80090019) : return QStringLiteral("NTE_KEYSET_NOT_DEF"); - case HRESULT(0x8009001A) : return QStringLiteral("NTE_KEYSET_ENTRY_BAD"); - case HRESULT(0x8009001B) : return QStringLiteral("NTE_PROV_TYPE_NO_MATCH"); - case HRESULT(0x8009001C) : return QStringLiteral("NTE_SIGNATURE_FILE_BAD"); - case HRESULT(0x8009001D) : return QStringLiteral("NTE_PROVIDER_DLL_FAIL"); - case HRESULT(0x8009001E) : return QStringLiteral("NTE_PROV_DLL_NOT_FOUND"); - case HRESULT(0x8009001F) : return QStringLiteral("NTE_BAD_KEYSET_PARAM"); - case HRESULT(0x80090020) : return QStringLiteral("NTE_FAIL"); - case HRESULT(0x80090021) : return QStringLiteral("NTE_SYS_ERR"); - case HRESULT(0x80090022) : return QStringLiteral("NTE_SILENT_CONTEXT"); - case HRESULT(0x80090023) : return QStringLiteral("NTE_TOKEN_KEYSET_STORAGE_FULL"); - case HRESULT(0x80090024) : return QStringLiteral("NTE_TEMPORARY_PROFILE"); - case HRESULT(0x80090025) : return QStringLiteral("NTE_FIXEDPARAMETER"); - case HRESULT(0x80090300) : return QStringLiteral("SEC_E_INSUFFICIENT_MEMORY"); - case HRESULT(0x80090301) : return QStringLiteral("SEC_E_INVALID_HANDLE"); - case HRESULT(0x80090302) : return QStringLiteral("SEC_E_UNSUPPORTED_FUNCTION"); - case HRESULT(0x80090303) : return QStringLiteral("SEC_E_TARGET_UNKNOWN"); - case HRESULT(0x80090304) : return QStringLiteral("SEC_E_INTERNAL_ERROR"); - case HRESULT(0x80090305) : return QStringLiteral("SEC_E_SECPKG_NOT_FOUND"); - case HRESULT(0x80090306) : return QStringLiteral("SEC_E_NOT_OWNER"); - case HRESULT(0x80090307) : return QStringLiteral("SEC_E_CANNOT_INSTALL"); - case HRESULT(0x80090308) : return QStringLiteral("SEC_E_INVALID_TOKEN"); - case HRESULT(0x80090309) : return QStringLiteral("SEC_E_CANNOT_PACK"); - case HRESULT(0x8009030A) : return QStringLiteral("SEC_E_QOP_NOT_SUPPORTED"); - case HRESULT(0x8009030B) : return QStringLiteral("SEC_E_NO_IMPERSONATION"); - case HRESULT(0x8009030C) : return QStringLiteral("SEC_E_LOGON_DENIED"); - case HRESULT(0x8009030D) : return QStringLiteral("SEC_E_UNKNOWN_CREDENTIALS"); - case HRESULT(0x8009030E) : return QStringLiteral("SEC_E_NO_CREDENTIALS"); - case HRESULT(0x8009030F) : return QStringLiteral("SEC_E_MESSAGE_ALTERED"); - case HRESULT(0x80090310) : return QStringLiteral("SEC_E_OUT_OF_SEQUENCE"); - case HRESULT(0x80090311) : return QStringLiteral("SEC_E_NO_AUTHENTICATING_AUTHORITY"); - case HRESULT(0x00090312) : return QStringLiteral("SEC_I_CONTINUE_NEEDED"); - case HRESULT(0x00090313) : return QStringLiteral("SEC_I_COMPLETE_NEEDED"); - case HRESULT(0x00090314) : return QStringLiteral("SEC_I_COMPLETE_AND_CONTINUE"); - case HRESULT(0x00090315) : return QStringLiteral("SEC_I_LOCAL_LOGON"); - case HRESULT(0x80090316) : return QStringLiteral("SEC_E_BAD_PKGID"); - case HRESULT(0x80090317) : return QStringLiteral("SEC_E_CONTEXT_EXPIRED"); - case HRESULT(0x00090317) : return QStringLiteral("SEC_I_CONTEXT_EXPIRED"); - case HRESULT(0x80090318) : return QStringLiteral("SEC_E_INCOMPLETE_MESSAGE"); - case HRESULT(0x80090320) : return QStringLiteral("SEC_E_INCOMPLETE_CREDENTIALS"); - case HRESULT(0x80090321) : return QStringLiteral("SEC_E_BUFFER_TOO_SMALL"); - case HRESULT(0x00090320) : return QStringLiteral("SEC_I_INCOMPLETE_CREDENTIALS"); - case HRESULT(0x00090321) : return QStringLiteral("SEC_I_RENEGOTIATE"); - case HRESULT(0x80090322) : return QStringLiteral("SEC_E_WRONG_PRINCIPAL"); - case HRESULT(0x00090323) : return QStringLiteral("SEC_I_NO_LSA_CONTEXT"); - case HRESULT(0x80090324) : return QStringLiteral("SEC_E_TIME_SKEW"); - case HRESULT(0x80090325) : return QStringLiteral("SEC_E_UNTRUSTED_ROOT"); - case HRESULT(0x80090326) : return QStringLiteral("SEC_E_ILLEGAL_MESSAGE"); - case HRESULT(0x80090327) : return QStringLiteral("SEC_E_CERT_UNKNOWN"); - case HRESULT(0x80090328) : return QStringLiteral("SEC_E_CERT_EXPIRED"); - case HRESULT(0x80090329) : return QStringLiteral("SEC_E_ENCRYPT_FAILURE"); - case HRESULT(0x80090330) : return QStringLiteral("SEC_E_DECRYPT_FAILURE"); - case HRESULT(0x80090331) : return QStringLiteral("SEC_E_ALGORITHM_MISMATCH"); - case HRESULT(0x80090332) : return QStringLiteral("SEC_E_SECURITY_QOS_FAILED"); - case HRESULT(0x80090333) : return QStringLiteral("SEC_E_UNFINISHED_CONTEXT_DELETED"); - case HRESULT(0x80090334) : return QStringLiteral("SEC_E_NO_TGT_REPLY"); - case HRESULT(0x80090335) : return QStringLiteral("SEC_E_NO_IP_ADDRESSES"); - case HRESULT(0x80090336) : return QStringLiteral("SEC_E_WRONG_CREDENTIAL_HANDLE"); - case HRESULT(0x80090337) : return QStringLiteral("SEC_E_CRYPTO_SYSTEM_INVALID"); - case HRESULT(0x80090338) : return QStringLiteral("SEC_E_MAX_REFERRALS_EXCEEDED"); - case HRESULT(0x80090339) : return QStringLiteral("SEC_E_MUST_BE_KDC"); - case HRESULT(0x8009033A) : return QStringLiteral("SEC_E_STRONG_CRYPTO_NOT_SUPPORTED"); - case HRESULT(0x8009033B) : return QStringLiteral("SEC_E_TOO_MANY_PRINCIPALS"); - case HRESULT(0x8009033C) : return QStringLiteral("SEC_E_NO_PA_DATA"); - case HRESULT(0x8009033D) : return QStringLiteral("SEC_E_PKINIT_NAME_MISMATCH"); - case HRESULT(0x8009033E) : return QStringLiteral("SEC_E_SMARTCARD_LOGON_REQUIRED"); - case HRESULT(0x8009033F) : return QStringLiteral("SEC_E_SHUTDOWN_IN_PROGRESS"); - case HRESULT(0x80090340) : return QStringLiteral("SEC_E_KDC_INVALID_REQUEST"); - case HRESULT(0x80090341) : return QStringLiteral("SEC_E_KDC_UNABLE_TO_REFER"); - case HRESULT(0x80090342) : return QStringLiteral("SEC_E_KDC_UNKNOWN_ETYPE"); - case HRESULT(0x80090343) : return QStringLiteral("SEC_E_UNSUPPORTED_PREAUTH"); - case HRESULT(0x80090345) : return QStringLiteral("SEC_E_DELEGATION_REQUIRED"); - case HRESULT(0x80090346) : return QStringLiteral("SEC_E_BAD_BINDINGS"); - case HRESULT(0x80090347) : return QStringLiteral("SEC_E_MULTIPLE_ACCOUNTS"); - case HRESULT(0x80090348) : return QStringLiteral("SEC_E_NO_KERB_KEY"); - case HRESULT(0x80090349) : return QStringLiteral("SEC_E_CERT_WRONG_USAGE"); - case HRESULT(0x80090350) : return QStringLiteral("SEC_E_DOWNGRADE_DETECTED"); - case HRESULT(0x80090351) : return QStringLiteral("SEC_E_SMARTCARD_CERT_REVOKED"); - case HRESULT(0x80090352) : return QStringLiteral("SEC_E_ISSUING_CA_UNTRUSTED"); - case HRESULT(0x80090353) : return QStringLiteral("SEC_E_REVOCATION_OFFLINE_C"); - case HRESULT(0x80090354) : return QStringLiteral("SEC_E_PKINIT_CLIENT_FAILURE"); - case HRESULT(0x80090355) : return QStringLiteral("SEC_E_SMARTCARD_CERT_EXPIRED"); - case HRESULT(0x80090356) : return QStringLiteral("SEC_E_NO_S4U_PROT_SUPPORT"); - case HRESULT(0x80090357) : return QStringLiteral("SEC_E_CROSSREALM_DELEGATION_FAILURE"); - case HRESULT(0x80090358) : return QStringLiteral("SEC_E_REVOCATION_OFFLINE_KDC"); - case HRESULT(0x80090359) : return QStringLiteral("SEC_E_ISSUING_CA_UNTRUSTED_KDC"); - case HRESULT(0x8009035A) : return QStringLiteral("SEC_E_KDC_CERT_EXPIRED"); - case HRESULT(0x8009035B) : return QStringLiteral("SEC_E_KDC_CERT_REVOKED"); - case HRESULT(0x80091001) : return QStringLiteral("CRYPT_E_MSG_ERROR"); - case HRESULT(0x80091002) : return QStringLiteral("CRYPT_E_UNKNOWN_ALGO"); - case HRESULT(0x80091003) : return QStringLiteral("CRYPT_E_OID_FORMAT"); - case HRESULT(0x80091004) : return QStringLiteral("CRYPT_E_INVALID_MSG_TYPE"); - case HRESULT(0x80091005) : return QStringLiteral("CRYPT_E_UNEXPECTED_ENCODING"); - case HRESULT(0x80091006) : return QStringLiteral("CRYPT_E_AUTH_ATTR_MISSING"); - case HRESULT(0x80091007) : return QStringLiteral("CRYPT_E_HASH_VALUE"); - case HRESULT(0x80091008) : return QStringLiteral("CRYPT_E_INVALID_INDEX"); - case HRESULT(0x80091009) : return QStringLiteral("CRYPT_E_ALREADY_DECRYPTED"); - case HRESULT(0x8009100A) : return QStringLiteral("CRYPT_E_NOT_DECRYPTED"); - case HRESULT(0x8009100B) : return QStringLiteral("CRYPT_E_RECIPIENT_NOT_FOUND"); - case HRESULT(0x8009100C) : return QStringLiteral("CRYPT_E_CONTROL_TYPE"); - case HRESULT(0x8009100D) : return QStringLiteral("CRYPT_E_ISSUER_SERIALNUMBER"); - case HRESULT(0x8009100E) : return QStringLiteral("CRYPT_E_SIGNER_NOT_FOUND"); - case HRESULT(0x8009100F) : return QStringLiteral("CRYPT_E_ATTRIBUTES_MISSING"); - case HRESULT(0x80091010) : return QStringLiteral("CRYPT_E_STREAM_MSG_NOT_READY"); - case HRESULT(0x80091011) : return QStringLiteral("CRYPT_E_STREAM_INSUFFICIENT_DATA"); - case HRESULT(0x00091012) : return QStringLiteral("CRYPT_I_NEW_PROTECTION_REQUIRED"); - case HRESULT(0x80092001) : return QStringLiteral("CRYPT_E_BAD_LEN"); - case HRESULT(0x80092002) : return QStringLiteral("CRYPT_E_BAD_ENCODE"); - case HRESULT(0x80092003) : return QStringLiteral("CRYPT_E_FILE_ERROR"); - case HRESULT(0x80092004) : return QStringLiteral("CRYPT_E_NOT_FOUND"); - case HRESULT(0x80092005) : return QStringLiteral("CRYPT_E_EXISTS"); - case HRESULT(0x80092006) : return QStringLiteral("CRYPT_E_NO_PROVIDER"); - case HRESULT(0x80092007) : return QStringLiteral("CRYPT_E_SELF_SIGNED"); - case HRESULT(0x80092008) : return QStringLiteral("CRYPT_E_DELETED_PREV"); - case HRESULT(0x80092009) : return QStringLiteral("CRYPT_E_NO_MATCH"); - case HRESULT(0x8009200A) : return QStringLiteral("CRYPT_E_UNEXPECTED_MSG_TYPE"); - case HRESULT(0x8009200B) : return QStringLiteral("CRYPT_E_NO_KEY_PROPERTY"); - case HRESULT(0x8009200C) : return QStringLiteral("CRYPT_E_NO_DECRYPT_CERT"); - case HRESULT(0x8009200D) : return QStringLiteral("CRYPT_E_BAD_MSG"); - case HRESULT(0x8009200E) : return QStringLiteral("CRYPT_E_NO_SIGNER"); - case HRESULT(0x8009200F) : return QStringLiteral("CRYPT_E_PENDING_CLOSE"); - case HRESULT(0x80092010) : return QStringLiteral("CRYPT_E_REVOKED"); - case HRESULT(0x80092011) : return QStringLiteral("CRYPT_E_NO_REVOCATION_DLL"); - case HRESULT(0x80092012) : return QStringLiteral("CRYPT_E_NO_REVOCATION_CHECK"); - case HRESULT(0x80092013) : return QStringLiteral("CRYPT_E_REVOCATION_OFFLINE"); - case HRESULT(0x80092014) : return QStringLiteral("CRYPT_E_NOT_IN_REVOCATION_DATABASE"); - case HRESULT(0x80092020) : return QStringLiteral("CRYPT_E_INVALID_NUMERIC_STRING"); - case HRESULT(0x80092021) : return QStringLiteral("CRYPT_E_INVALID_PRINTABLE_STRING"); - case HRESULT(0x80092022) : return QStringLiteral("CRYPT_E_INVALID_IA5_STRING"); - case HRESULT(0x80092023) : return QStringLiteral("CRYPT_E_INVALID_X500_STRING"); - case HRESULT(0x80092024) : return QStringLiteral("CRYPT_E_NOT_CHAR_STRING"); - case HRESULT(0x80092025) : return QStringLiteral("CRYPT_E_FILERESIZED"); - case HRESULT(0x80092026) : return QStringLiteral("CRYPT_E_SECURITY_SETTINGS"); - case HRESULT(0x80092027) : return QStringLiteral("CRYPT_E_NO_VERIFY_USAGE_DLL"); - case HRESULT(0x80092028) : return QStringLiteral("CRYPT_E_NO_VERIFY_USAGE_CHECK"); - case HRESULT(0x80092029) : return QStringLiteral("CRYPT_E_VERIFY_USAGE_OFFLINE"); - case HRESULT(0x8009202A) : return QStringLiteral("CRYPT_E_NOT_IN_CTL"); - case HRESULT(0x8009202B) : return QStringLiteral("CRYPT_E_NO_TRUSTED_SIGNER"); - case HRESULT(0x8009202C) : return QStringLiteral("CRYPT_E_MISSING_PUBKEY_PARA"); - case HRESULT(0x80093000) : return QStringLiteral("CRYPT_E_OSS_ERROR"); - case HRESULT(0x80093001) : return QStringLiteral("OSS_MORE_BUF"); - case HRESULT(0x80093002) : return QStringLiteral("OSS_NEGATIVE_UINTEGER"); - case HRESULT(0x80093003) : return QStringLiteral("OSS_PDU_RANGE"); - case HRESULT(0x80093004) : return QStringLiteral("OSS_MORE_INPUT"); - case HRESULT(0x80093005) : return QStringLiteral("OSS_DATA_ERROR"); - case HRESULT(0x80093006) : return QStringLiteral("OSS_BAD_ARG"); - case HRESULT(0x80093007) : return QStringLiteral("OSS_BAD_VERSION"); - case HRESULT(0x80093008) : return QStringLiteral("OSS_OUT_MEMORY"); - case HRESULT(0x80093009) : return QStringLiteral("OSS_PDU_MISMATCH"); - case HRESULT(0x8009300A) : return QStringLiteral("OSS_LIMITED"); - case HRESULT(0x8009300B) : return QStringLiteral("OSS_BAD_PTR"); - case HRESULT(0x8009300C) : return QStringLiteral("OSS_BAD_TIME"); - case HRESULT(0x8009300D) : return QStringLiteral("OSS_INDEFINITE_NOT_SUPPORTED"); - case HRESULT(0x8009300E) : return QStringLiteral("OSS_MEM_ERROR"); - case HRESULT(0x8009300F) : return QStringLiteral("OSS_BAD_TABLE"); - case HRESULT(0x80093010) : return QStringLiteral("OSS_TOO_LONG"); - case HRESULT(0x80093011) : return QStringLiteral("OSS_CONSTRAINT_VIOLATED"); - case HRESULT(0x80093012) : return QStringLiteral("OSS_FATAL_ERROR"); - case HRESULT(0x80093013) : return QStringLiteral("OSS_ACCESS_SERIALIZATION_ERROR"); - case HRESULT(0x80093014) : return QStringLiteral("OSS_NULL_TBL"); - case HRESULT(0x80093015) : return QStringLiteral("OSS_NULL_FCN"); - case HRESULT(0x80093016) : return QStringLiteral("OSS_BAD_ENCRULES"); - case HRESULT(0x80093017) : return QStringLiteral("OSS_UNAVAIL_ENCRULES"); - case HRESULT(0x80093018) : return QStringLiteral("OSS_CANT_OPEN_TRACE_WINDOW"); - case HRESULT(0x80093019) : return QStringLiteral("OSS_UNIMPLEMENTED"); - case HRESULT(0x8009301A) : return QStringLiteral("OSS_OID_DLL_NOT_LINKED"); - case HRESULT(0x8009301B) : return QStringLiteral("OSS_CANT_OPEN_TRACE_FILE"); - case HRESULT(0x8009301C) : return QStringLiteral("OSS_TRACE_FILE_ALREADY_OPEN"); - case HRESULT(0x8009301D) : return QStringLiteral("OSS_TABLE_MISMATCH"); - case HRESULT(0x8009301E) : return QStringLiteral("OSS_TYPE_NOT_SUPPORTED"); - case HRESULT(0x8009301F) : return QStringLiteral("OSS_REAL_DLL_NOT_LINKED"); - case HRESULT(0x80093020) : return QStringLiteral("OSS_REAL_CODE_NOT_LINKED"); - case HRESULT(0x80093021) : return QStringLiteral("OSS_OUT_OF_RANGE"); - case HRESULT(0x80093022) : return QStringLiteral("OSS_COPIER_DLL_NOT_LINKED"); - case HRESULT(0x80093023) : return QStringLiteral("OSS_CONSTRAINT_DLL_NOT_LINKED"); - case HRESULT(0x80093024) : return QStringLiteral("OSS_COMPARATOR_DLL_NOT_LINKED"); - case HRESULT(0x80093025) : return QStringLiteral("OSS_COMPARATOR_CODE_NOT_LINKED"); - case HRESULT(0x80093026) : return QStringLiteral("OSS_MEM_MGR_DLL_NOT_LINKED"); - case HRESULT(0x80093027) : return QStringLiteral("OSS_PDV_DLL_NOT_LINKED"); - case HRESULT(0x80093028) : return QStringLiteral("OSS_PDV_CODE_NOT_LINKED"); - case HRESULT(0x80093029) : return QStringLiteral("OSS_API_DLL_NOT_LINKED"); - case HRESULT(0x8009302A) : return QStringLiteral("OSS_BERDER_DLL_NOT_LINKED"); - case HRESULT(0x8009302B) : return QStringLiteral("OSS_PER_DLL_NOT_LINKED"); - case HRESULT(0x8009302C) : return QStringLiteral("OSS_OPEN_TYPE_ERROR"); - case HRESULT(0x8009302D) : return QStringLiteral("OSS_MUTEX_NOT_CREATED"); - case HRESULT(0x8009302E) : return QStringLiteral("OSS_CANT_CLOSE_TRACE_FILE"); - case HRESULT(0x80093100) : return QStringLiteral("CRYPT_E_ASN1_ERROR"); - case HRESULT(0x80093101) : return QStringLiteral("CRYPT_E_ASN1_INTERNAL"); - case HRESULT(0x80093102) : return QStringLiteral("CRYPT_E_ASN1_EOD"); - case HRESULT(0x80093103) : return QStringLiteral("CRYPT_E_ASN1_CORRUPT"); - case HRESULT(0x80093104) : return QStringLiteral("CRYPT_E_ASN1_LARGE"); - case HRESULT(0x80093105) : return QStringLiteral("CRYPT_E_ASN1_CONSTRAINT"); - case HRESULT(0x80093106) : return QStringLiteral("CRYPT_E_ASN1_MEMORY"); - case HRESULT(0x80093107) : return QStringLiteral("CRYPT_E_ASN1_OVERFLOW"); - case HRESULT(0x80093108) : return QStringLiteral("CRYPT_E_ASN1_BADPDU"); - case HRESULT(0x80093109) : return QStringLiteral("CRYPT_E_ASN1_BADARGS"); - case HRESULT(0x8009310A) : return QStringLiteral("CRYPT_E_ASN1_BADREAL"); - case HRESULT(0x8009310B) : return QStringLiteral("CRYPT_E_ASN1_BADTAG"); - case HRESULT(0x8009310C) : return QStringLiteral("CRYPT_E_ASN1_CHOICE"); - case HRESULT(0x8009310D) : return QStringLiteral("CRYPT_E_ASN1_RULE"); - case HRESULT(0x8009310E) : return QStringLiteral("CRYPT_E_ASN1_UTF8"); - case HRESULT(0x80093133) : return QStringLiteral("CRYPT_E_ASN1_PDU_TYPE"); - case HRESULT(0x80093134) : return QStringLiteral("CRYPT_E_ASN1_NYI"); - case HRESULT(0x80093201) : return QStringLiteral("CRYPT_E_ASN1_EXTENDED"); - case HRESULT(0x80093202) : return QStringLiteral("CRYPT_E_ASN1_NOEOD"); - case HRESULT(0x80094001) : return QStringLiteral("CERTSRV_E_BAD_REQUESTSUBJECT"); - case HRESULT(0x80094002) : return QStringLiteral("CERTSRV_E_NO_REQUEST"); - case HRESULT(0x80094003) : return QStringLiteral("CERTSRV_E_BAD_REQUESTSTATUS"); - case HRESULT(0x80094004) : return QStringLiteral("CERTSRV_E_PROPERTY_EMPTY"); - case HRESULT(0x80094005) : return QStringLiteral("CERTSRV_E_INVALID_CA_CERTIFICATE"); - case HRESULT(0x80094006) : return QStringLiteral("CERTSRV_E_SERVER_SUSPENDED"); - case HRESULT(0x80094007) : return QStringLiteral("CERTSRV_E_ENCODING_LENGTH"); - case HRESULT(0x80094008) : return QStringLiteral("CERTSRV_E_ROLECONFLICT"); - case HRESULT(0x80094009) : return QStringLiteral("CERTSRV_E_RESTRICTEDOFFICER"); - case HRESULT(0x8009400A) : return QStringLiteral("CERTSRV_E_KEY_ARCHIVAL_NOT_CONFIGURED"); - case HRESULT(0x8009400B) : return QStringLiteral("CERTSRV_E_NO_VALID_KRA"); - case HRESULT(0x8009400C) : return QStringLiteral("CERTSRV_E_BAD_REQUEST_KEY_ARCHIVAL"); - case HRESULT(0x8009400D) : return QStringLiteral("CERTSRV_E_NO_CAADMIN_DEFINED"); - case HRESULT(0x8009400E) : return QStringLiteral("CERTSRV_E_BAD_RENEWAL_CERT_ATTRIBUTE"); - case HRESULT(0x8009400F) : return QStringLiteral("CERTSRV_E_NO_DB_SESSIONS"); - case HRESULT(0x80094010) : return QStringLiteral("CERTSRV_E_ALIGNMENT_FAULT"); - case HRESULT(0x80094011) : return QStringLiteral("CERTSRV_E_ENROLL_DENIED"); - case HRESULT(0x80094012) : return QStringLiteral("CERTSRV_E_TEMPLATE_DENIED"); - case HRESULT(0x80094013) : return QStringLiteral("CERTSRV_E_DOWNLEVEL_DC_SSL_OR_UPGRADE"); - case HRESULT(0x80094800) : return QStringLiteral("CERTSRV_E_UNSUPPORTED_CERT_TYPE"); - case HRESULT(0x80094801) : return QStringLiteral("CERTSRV_E_NO_CERT_TYPE"); - case HRESULT(0x80094802) : return QStringLiteral("CERTSRV_E_TEMPLATE_CONFLICT"); - case HRESULT(0x80094803) : return QStringLiteral("CERTSRV_E_SUBJECT_ALT_NAME_REQUIRED"); - case HRESULT(0x80094804) : return QStringLiteral("CERTSRV_E_ARCHIVED_KEY_REQUIRED"); - case HRESULT(0x80094805) : return QStringLiteral("CERTSRV_E_SMIME_REQUIRED"); - case HRESULT(0x80094806) : return QStringLiteral("CERTSRV_E_BAD_RENEWAL_SUBJECT"); - case HRESULT(0x80094807) : return QStringLiteral("CERTSRV_E_BAD_TEMPLATE_VERSION"); - case HRESULT(0x80094808) : return QStringLiteral("CERTSRV_E_TEMPLATE_POLICY_REQUIRED"); - case HRESULT(0x80094809) : return QStringLiteral("CERTSRV_E_SIGNATURE_POLICY_REQUIRED"); - case HRESULT(0x8009480A) : return QStringLiteral("CERTSRV_E_SIGNATURE_COUNT"); - case HRESULT(0x8009480B) : return QStringLiteral("CERTSRV_E_SIGNATURE_REJECTED"); - case HRESULT(0x8009480C) : return QStringLiteral("CERTSRV_E_ISSUANCE_POLICY_REQUIRED"); - case HRESULT(0x8009480D) : return QStringLiteral("CERTSRV_E_SUBJECT_UPN_REQUIRED"); - case HRESULT(0x8009480E) : return QStringLiteral("CERTSRV_E_SUBJECT_DIRECTORY_GUID_REQUIRED"); - case HRESULT(0x8009480F) : return QStringLiteral("CERTSRV_E_SUBJECT_DNS_REQUIRED"); - case HRESULT(0x80094810) : return QStringLiteral("CERTSRV_E_ARCHIVED_KEY_UNEXPECTED"); - case HRESULT(0x80094811) : return QStringLiteral("CERTSRV_E_KEY_LENGTH"); - case HRESULT(0x80094812) : return QStringLiteral("CERTSRV_E_SUBJECT_EMAIL_REQUIRED"); - case HRESULT(0x80094813) : return QStringLiteral("CERTSRV_E_UNKNOWN_CERT_TYPE"); - case HRESULT(0x80094814) : return QStringLiteral("CERTSRV_E_CERT_TYPE_OVERLAP"); - case HRESULT(0x80095000) : return QStringLiteral("XENROLL_E_KEY_NOT_EXPORTABLE"); - case HRESULT(0x80095001) : return QStringLiteral("XENROLL_E_CANNOT_ADD_ROOT_CERT"); - case HRESULT(0x80095002) : return QStringLiteral("XENROLL_E_RESPONSE_KA_HASH_NOT_FOUND"); - case HRESULT(0x80095003) : return QStringLiteral("XENROLL_E_RESPONSE_UNEXPECTED_KA_HASH"); - case HRESULT(0x80095004) : return QStringLiteral("XENROLL_E_RESPONSE_KA_HASH_MISMATCH"); - case HRESULT(0x80095005) : return QStringLiteral("XENROLL_E_KEYSPEC_SMIME_MISMATCH"); - case HRESULT(0x80096001) : return QStringLiteral("TRUST_E_SYSTEM_ERROR"); - case HRESULT(0x80096002) : return QStringLiteral("TRUST_E_NO_SIGNER_CERT"); - case HRESULT(0x80096003) : return QStringLiteral("TRUST_E_COUNTER_SIGNER"); - case HRESULT(0x80096004) : return QStringLiteral("TRUST_E_CERT_SIGNATURE"); - case HRESULT(0x80096005) : return QStringLiteral("TRUST_E_TIME_STAMP"); - case HRESULT(0x80096010) : return QStringLiteral("TRUST_E_BAD_DIGEST"); - case HRESULT(0x80096019) : return QStringLiteral("TRUST_E_BASIC_CONSTRAINTS"); - case HRESULT(0x8009601E) : return QStringLiteral("TRUST_E_FINANCIAL_CRITERIA"); - case HRESULT(0x80097001) : return QStringLiteral("MSSIPOTF_E_OUTOFMEMRANGE"); - case HRESULT(0x80097002) : return QStringLiteral("MSSIPOTF_E_CANTGETOBJECT"); - case HRESULT(0x80097003) : return QStringLiteral("MSSIPOTF_E_NOHEADTABLE"); - case HRESULT(0x80097004) : return QStringLiteral("MSSIPOTF_E_BAD_MAGICNUMBER"); - case HRESULT(0x80097005) : return QStringLiteral("MSSIPOTF_E_BAD_OFFSET_TABLE"); - case HRESULT(0x80097006) : return QStringLiteral("MSSIPOTF_E_TABLE_TAGORDER"); - case HRESULT(0x80097007) : return QStringLiteral("MSSIPOTF_E_TABLE_LONGWORD"); - case HRESULT(0x80097008) : return QStringLiteral("MSSIPOTF_E_BAD_FIRST_TABLE_PLACEMENT"); - case HRESULT(0x80097009) : return QStringLiteral("MSSIPOTF_E_TABLES_OVERLAP"); - case HRESULT(0x8009700A) : return QStringLiteral("MSSIPOTF_E_TABLE_PADBYTES"); - case HRESULT(0x8009700B) : return QStringLiteral("MSSIPOTF_E_FILETOOSMALL"); - case HRESULT(0x8009700C) : return QStringLiteral("MSSIPOTF_E_TABLE_CHECKSUM"); - case HRESULT(0x8009700D) : return QStringLiteral("MSSIPOTF_E_FILE_CHECKSUM"); - case HRESULT(0x80097010) : return QStringLiteral("MSSIPOTF_E_FAILED_POLICY"); - case HRESULT(0x80097011) : return QStringLiteral("MSSIPOTF_E_FAILED_HINTS_CHECK"); - case HRESULT(0x80097012) : return QStringLiteral("MSSIPOTF_E_NOT_OPENTYPE"); - case HRESULT(0x80097013) : return QStringLiteral("MSSIPOTF_E_FILE"); - case HRESULT(0x80097014) : return QStringLiteral("MSSIPOTF_E_CRYPT"); - case HRESULT(0x80097015) : return QStringLiteral("MSSIPOTF_E_BADVERSION"); - case HRESULT(0x80097016) : return QStringLiteral("MSSIPOTF_E_DSIG_STRUCTURE"); - case HRESULT(0x80097017) : return QStringLiteral("MSSIPOTF_E_PCONST_CHECK"); - case HRESULT(0x80097018) : return QStringLiteral("MSSIPOTF_E_STRUCTURE"); - case HRESULT(0x800B0001) : return QStringLiteral("TRUST_E_PROVIDER_UNKNOWN"); - case HRESULT(0x800B0002) : return QStringLiteral("TRUST_E_ACTION_UNKNOWN"); - case HRESULT(0x800B0003) : return QStringLiteral("TRUST_E_SUBJECT_FORM_UNKNOWN"); - case HRESULT(0x800B0004) : return QStringLiteral("TRUST_E_SUBJECT_NOT_TRUSTED"); - case HRESULT(0x800B0005) : return QStringLiteral("DIGSIG_E_ENCODE"); - case HRESULT(0x800B0006) : return QStringLiteral("DIGSIG_E_DECODE"); - case HRESULT(0x800B0007) : return QStringLiteral("DIGSIG_E_EXTENSIBILITY"); - case HRESULT(0x800B0008) : return QStringLiteral("DIGSIG_E_CRYPTO"); - case HRESULT(0x800B0009) : return QStringLiteral("PERSIST_E_SIZEDEFINITE"); - case HRESULT(0x800B000A) : return QStringLiteral("PERSIST_E_SIZEINDEFINITE"); - case HRESULT(0x800B000B) : return QStringLiteral("PERSIST_E_NOTSELFSIZING"); - case HRESULT(0x800B0100) : return QStringLiteral("TRUST_E_NOSIGNATURE"); - case HRESULT(0x800B0101) : return QStringLiteral("CERT_E_EXPIRED"); - case HRESULT(0x800B0102) : return QStringLiteral("CERT_E_VALIDITYPERIODNESTING"); - case HRESULT(0x800B0103) : return QStringLiteral("CERT_E_ROLE"); - case HRESULT(0x800B0104) : return QStringLiteral("CERT_E_PATHLENCONST"); - case HRESULT(0x800B0105) : return QStringLiteral("CERT_E_CRITICAL"); - case HRESULT(0x800B0106) : return QStringLiteral("CERT_E_PURPOSE"); - case HRESULT(0x800B0107) : return QStringLiteral("CERT_E_ISSUERCHAINING"); - case HRESULT(0x800B0108) : return QStringLiteral("CERT_E_MALFORMED"); - case HRESULT(0x800B0109) : return QStringLiteral("CERT_E_UNTRUSTEDROOT"); - case HRESULT(0x800B010A) : return QStringLiteral("CERT_E_CHAINING"); - case HRESULT(0x800B010B) : return QStringLiteral("TRUST_E_FAIL"); - case HRESULT(0x800B010C) : return QStringLiteral("CERT_E_REVOKED"); - case HRESULT(0x800B010D) : return QStringLiteral("CERT_E_UNTRUSTEDTESTROOT"); - case HRESULT(0x800B010E) : return QStringLiteral("CERT_E_REVOCATION_FAILURE"); - case HRESULT(0x800B010F) : return QStringLiteral("CERT_E_CN_NO_MATCH"); - case HRESULT(0x800B0110) : return QStringLiteral("CERT_E_WRONG_USAGE"); - case HRESULT(0x800B0111) : return QStringLiteral("TRUST_E_EXPLICIT_DISTRUST"); - case HRESULT(0x800B0112) : return QStringLiteral("CERT_E_UNTRUSTEDCA"); - case HRESULT(0x800B0113) : return QStringLiteral("CERT_E_INVALID_POLICY"); - case HRESULT(0x800B0114) : return QStringLiteral("CERT_E_INVALID_NAME"); - case HRESULT(0x800F0000) : return QStringLiteral("SPAPI_E_EXPECTED_SECTION_NAME"); - case HRESULT(0x800F0001) : return QStringLiteral("SPAPI_E_BAD_SECTION_NAME_LINE"); - case HRESULT(0x800F0002) : return QStringLiteral("SPAPI_E_SECTION_NAME_TOO_LONG"); - case HRESULT(0x800F0003) : return QStringLiteral("SPAPI_E_GENERAL_SYNTAX"); - case HRESULT(0x800F0100) : return QStringLiteral("SPAPI_E_WRONG_INF_STYLE"); - case HRESULT(0x800F0101) : return QStringLiteral("SPAPI_E_SECTION_NOT_FOUND"); - case HRESULT(0x800F0102) : return QStringLiteral("SPAPI_E_LINE_NOT_FOUND"); - case HRESULT(0x800F0103) : return QStringLiteral("SPAPI_E_NO_BACKUP"); - case HRESULT(0x800F0200) : return QStringLiteral("SPAPI_E_NO_ASSOCIATED_CLASS"); - case HRESULT(0x800F0201) : return QStringLiteral("SPAPI_E_CLASS_MISMATCH"); - case HRESULT(0x800F0202) : return QStringLiteral("SPAPI_E_DUPLICATE_FOUND"); - case HRESULT(0x800F0203) : return QStringLiteral("SPAPI_E_NO_DRIVER_SELECTED"); - case HRESULT(0x800F0204) : return QStringLiteral("SPAPI_E_KEY_DOES_NOT_EXIST"); - case HRESULT(0x800F0205) : return QStringLiteral("SPAPI_E_INVALID_DEVINST_NAME"); - case HRESULT(0x800F0206) : return QStringLiteral("SPAPI_E_INVALID_CLASS"); - case HRESULT(0x800F0207) : return QStringLiteral("SPAPI_E_DEVINST_ALREADY_EXISTS"); - case HRESULT(0x800F0208) : return QStringLiteral("SPAPI_E_DEVINFO_NOT_REGISTERED"); - case HRESULT(0x800F0209) : return QStringLiteral("SPAPI_E_INVALID_REG_PROPERTY"); - case HRESULT(0x800F020A) : return QStringLiteral("SPAPI_E_NO_INF"); - case HRESULT(0x800F020B) : return QStringLiteral("SPAPI_E_NO_SUCH_DEVINST"); - case HRESULT(0x800F020C) : return QStringLiteral("SPAPI_E_CANT_LOAD_CLASS_ICON"); - case HRESULT(0x800F020D) : return QStringLiteral("SPAPI_E_INVALID_CLASS_INSTALLER"); - case HRESULT(0x800F020E) : return QStringLiteral("SPAPI_E_DI_DO_DEFAULT"); - case HRESULT(0x800F020F) : return QStringLiteral("SPAPI_E_DI_NOFILECOPY"); - case HRESULT(0x800F0210) : return QStringLiteral("SPAPI_E_INVALID_HWPROFILE"); - case HRESULT(0x800F0211) : return QStringLiteral("SPAPI_E_NO_DEVICE_SELECTED"); - case HRESULT(0x800F0212) : return QStringLiteral("SPAPI_E_DEVINFO_LIST_LOCKED"); - case HRESULT(0x800F0213) : return QStringLiteral("SPAPI_E_DEVINFO_DATA_LOCKED"); - case HRESULT(0x800F0214) : return QStringLiteral("SPAPI_E_DI_BAD_PATH"); - case HRESULT(0x800F0215) : return QStringLiteral("SPAPI_E_NO_CLASSINSTALL_PARAMS"); - case HRESULT(0x800F0216) : return QStringLiteral("SPAPI_E_FILEQUEUE_LOCKED"); - case HRESULT(0x800F0217) : return QStringLiteral("SPAPI_E_BAD_SERVICE_INSTALLSECT"); - case HRESULT(0x800F0218) : return QStringLiteral("SPAPI_E_NO_CLASS_DRIVER_LIST"); - case HRESULT(0x800F0219) : return QStringLiteral("SPAPI_E_NO_ASSOCIATED_SERVICE"); - case HRESULT(0x800F021A) : return QStringLiteral("SPAPI_E_NO_DEFAULT_DEVICE_INTERFACE"); - case HRESULT(0x800F021B) : return QStringLiteral("SPAPI_E_DEVICE_INTERFACE_ACTIVE"); - case HRESULT(0x800F021C) : return QStringLiteral("SPAPI_E_DEVICE_INTERFACE_REMOVED"); - case HRESULT(0x800F021D) : return QStringLiteral("SPAPI_E_BAD_INTERFACE_INSTALLSECT"); - case HRESULT(0x800F021E) : return QStringLiteral("SPAPI_E_NO_SUCH_INTERFACE_CLASS"); - case HRESULT(0x800F021F) : return QStringLiteral("SPAPI_E_INVALID_REFERENCE_STRING"); - case HRESULT(0x800F0220) : return QStringLiteral("SPAPI_E_INVALID_MACHINENAME"); - case HRESULT(0x800F0221) : return QStringLiteral("SPAPI_E_REMOTE_COMM_FAILURE"); - case HRESULT(0x800F0222) : return QStringLiteral("SPAPI_E_MACHINE_UNAVAILABLE"); - case HRESULT(0x800F0223) : return QStringLiteral("SPAPI_E_NO_CONFIGMGR_SERVICES"); - case HRESULT(0x800F0224) : return QStringLiteral("SPAPI_E_INVALID_PROPPAGE_PROVIDER"); - case HRESULT(0x800F0225) : return QStringLiteral("SPAPI_E_NO_SUCH_DEVICE_INTERFACE"); - case HRESULT(0x800F0226) : return QStringLiteral("SPAPI_E_DI_POSTPROCESSING_REQUIRED"); - case HRESULT(0x800F0227) : return QStringLiteral("SPAPI_E_INVALID_COINSTALLER"); - case HRESULT(0x800F0228) : return QStringLiteral("SPAPI_E_NO_COMPAT_DRIVERS"); - case HRESULT(0x800F0229) : return QStringLiteral("SPAPI_E_NO_DEVICE_ICON"); - case HRESULT(0x800F022A) : return QStringLiteral("SPAPI_E_INVALID_INF_LOGCONFIG"); - case HRESULT(0x800F022B) : return QStringLiteral("SPAPI_E_DI_DONT_INSTALL"); - case HRESULT(0x800F022C) : return QStringLiteral("SPAPI_E_INVALID_FILTER_DRIVER"); - case HRESULT(0x800F022D) : return QStringLiteral("SPAPI_E_NON_WINDOWS_NT_DRIVER"); - case HRESULT(0x800F022E) : return QStringLiteral("SPAPI_E_NON_WINDOWS_DRIVER"); - case HRESULT(0x800F022F) : return QStringLiteral("SPAPI_E_NO_CATALOG_FOR_OEM_INF"); - case HRESULT(0x800F0230) : return QStringLiteral("SPAPI_E_DEVINSTALL_QUEUE_NONNATIVE"); - case HRESULT(0x800F0231) : return QStringLiteral("SPAPI_E_NOT_DISABLEABLE"); - case HRESULT(0x800F0232) : return QStringLiteral("SPAPI_E_CANT_REMOVE_DEVINST"); - case HRESULT(0x800F0233) : return QStringLiteral("SPAPI_E_INVALID_TARGET"); - case HRESULT(0x800F0234) : return QStringLiteral("SPAPI_E_DRIVER_NONNATIVE"); - case HRESULT(0x800F0235) : return QStringLiteral("SPAPI_E_IN_WOW64"); - case HRESULT(0x800F0236) : return QStringLiteral("SPAPI_E_SET_SYSTEM_RESTORE_POINT"); - case HRESULT(0x800F0237) : return QStringLiteral("SPAPI_E_INCORRECTLY_COPIED_INF"); - case HRESULT(0x800F0238) : return QStringLiteral("SPAPI_E_SCE_DISABLED"); - case HRESULT(0x800F0239) : return QStringLiteral("SPAPI_E_UNKNOWN_EXCEPTION"); - case HRESULT(0x800F023A) : return QStringLiteral("SPAPI_E_PNP_REGISTRY_ERROR"); - case HRESULT(0x800F023B) : return QStringLiteral("SPAPI_E_REMOTE_REQUEST_UNSUPPORTED"); - case HRESULT(0x800F023C) : return QStringLiteral("SPAPI_E_NOT_AN_INSTALLED_OEM_INF"); - case HRESULT(0x800F023D) : return QStringLiteral("SPAPI_E_INF_IN_USE_BY_DEVICES"); - case HRESULT(0x800F023E) : return QStringLiteral("SPAPI_E_DI_FUNCTION_OBSOLETE"); - case HRESULT(0x800F023F) : return QStringLiteral("SPAPI_E_NO_AUTHENTICODE_CATALOG"); - case HRESULT(0x800F0240) : return QStringLiteral("SPAPI_E_AUTHENTICODE_DISALLOWED"); - case HRESULT(0x800F0241) : return QStringLiteral("SPAPI_E_AUTHENTICODE_TRUSTED_PUBLISHER"); - case HRESULT(0x800F0242) : return QStringLiteral("SPAPI_E_AUTHENTICODE_TRUST_NOT_ESTABLISHED"); - case HRESULT(0x800F0243) : return QStringLiteral("SPAPI_E_AUTHENTICODE_PUBLISHER_NOT_TRUSTED"); - case HRESULT(0x800F0244) : return QStringLiteral("SPAPI_E_SIGNATURE_OSATTRIBUTE_MISMATCH"); - case HRESULT(0x800F0245) : return QStringLiteral("SPAPI_E_ONLY_VALIDATE_VIA_AUTHENTICODE"); - case HRESULT(0x800F0300) : return QStringLiteral("SPAPI_E_UNRECOVERABLE_STACK_OVERFLOW"); - case HRESULT(0x800F1000) : return QStringLiteral("SPAPI_E_ERROR_NOT_INSTALLED"); - case HRESULT(0x80100001) : return QStringLiteral("SCARD_F_INTERNAL_ERROR"); - case HRESULT(0x80100002) : return QStringLiteral("SCARD_E_CANCELLED"); - case HRESULT(0x80100003) : return QStringLiteral("SCARD_E_INVALID_HANDLE"); - case HRESULT(0x80100004) : return QStringLiteral("SCARD_E_INVALID_PARAMETER"); - case HRESULT(0x80100005) : return QStringLiteral("SCARD_E_INVALID_TARGET"); - case HRESULT(0x80100006) : return QStringLiteral("SCARD_E_NO_MEMORY"); - case HRESULT(0x80100007) : return QStringLiteral("SCARD_F_WAITED_TOO_LONG"); - case HRESULT(0x80100008) : return QStringLiteral("SCARD_E_INSUFFICIENT_BUFFER"); - case HRESULT(0x80100009) : return QStringLiteral("SCARD_E_UNKNOWN_READER"); - case HRESULT(0x8010000A) : return QStringLiteral("SCARD_E_TIMEOUT"); - case HRESULT(0x8010000B) : return QStringLiteral("SCARD_E_SHARING_VIOLATION"); - case HRESULT(0x8010000C) : return QStringLiteral("SCARD_E_NO_SMARTCARD"); - case HRESULT(0x8010000D) : return QStringLiteral("SCARD_E_UNKNOWN_CARD"); - case HRESULT(0x8010000E) : return QStringLiteral("SCARD_E_CANT_DISPOSE"); - case HRESULT(0x8010000F) : return QStringLiteral("SCARD_E_PROTO_MISMATCH"); - case HRESULT(0x80100010) : return QStringLiteral("SCARD_E_NOT_READY"); - case HRESULT(0x80100011) : return QStringLiteral("SCARD_E_INVALID_VALUE"); - case HRESULT(0x80100012) : return QStringLiteral("SCARD_E_SYSTEM_CANCELLED"); - case HRESULT(0x80100013) : return QStringLiteral("SCARD_F_COMM_ERROR"); - case HRESULT(0x80100014) : return QStringLiteral("SCARD_F_UNKNOWN_ERROR"); - case HRESULT(0x80100015) : return QStringLiteral("SCARD_E_INVALID_ATR"); - case HRESULT(0x80100016) : return QStringLiteral("SCARD_E_NOT_TRANSACTED"); - case HRESULT(0x80100017) : return QStringLiteral("SCARD_E_READER_UNAVAILABLE"); - case HRESULT(0x80100018) : return QStringLiteral("SCARD_P_SHUTDOWN"); - case HRESULT(0x80100019) : return QStringLiteral("SCARD_E_PCI_TOO_SMALL"); - case HRESULT(0x8010001A) : return QStringLiteral("SCARD_E_READER_UNSUPPORTED"); - case HRESULT(0x8010001B) : return QStringLiteral("SCARD_E_DUPLICATE_READER"); - case HRESULT(0x8010001C) : return QStringLiteral("SCARD_E_CARD_UNSUPPORTED"); - case HRESULT(0x8010001D) : return QStringLiteral("SCARD_E_NO_SERVICE"); - case HRESULT(0x8010001E) : return QStringLiteral("SCARD_E_SERVICE_STOPPED"); - case HRESULT(0x8010001F) : return QStringLiteral("SCARD_E_UNEXPECTED"); - case HRESULT(0x80100020) : return QStringLiteral("SCARD_E_ICC_INSTALLATION"); - case HRESULT(0x80100021) : return QStringLiteral("SCARD_E_ICC_CREATEORDER"); - case HRESULT(0x80100022) : return QStringLiteral("SCARD_E_UNSUPPORTED_FEATURE"); - case HRESULT(0x80100023) : return QStringLiteral("SCARD_E_DIR_NOT_FOUND"); - case HRESULT(0x80100024) : return QStringLiteral("SCARD_E_FILE_NOT_FOUND"); - case HRESULT(0x80100025) : return QStringLiteral("SCARD_E_NO_DIR"); - case HRESULT(0x80100026) : return QStringLiteral("SCARD_E_NO_FILE"); - case HRESULT(0x80100027) : return QStringLiteral("SCARD_E_NO_ACCESS"); - case HRESULT(0x80100028) : return QStringLiteral("SCARD_E_WRITE_TOO_MANY"); - case HRESULT(0x80100029) : return QStringLiteral("SCARD_E_BAD_SEEK"); - case HRESULT(0x8010002A) : return QStringLiteral("SCARD_E_INVALID_CHV"); - case HRESULT(0x8010002B) : return QStringLiteral("SCARD_E_UNKNOWN_RES_MNG"); - case HRESULT(0x8010002C) : return QStringLiteral("SCARD_E_NO_SUCH_CERTIFICATE"); - case HRESULT(0x8010002D) : return QStringLiteral("SCARD_E_CERTIFICATE_UNAVAILABLE"); - case HRESULT(0x8010002E) : return QStringLiteral("SCARD_E_NO_READERS_AVAILABLE"); - case HRESULT(0x8010002F) : return QStringLiteral("SCARD_E_COMM_DATA_LOST"); - case HRESULT(0x80100030) : return QStringLiteral("SCARD_E_NO_KEY_CONTAINER"); - case HRESULT(0x80100031) : return QStringLiteral("SCARD_E_SERVER_TOO_BUSY"); - case HRESULT(0x80100065) : return QStringLiteral("SCARD_W_UNSUPPORTED_CARD"); - case HRESULT(0x80100066) : return QStringLiteral("SCARD_W_UNRESPONSIVE_CARD"); - case HRESULT(0x80100067) : return QStringLiteral("SCARD_W_UNPOWERED_CARD"); - case HRESULT(0x80100068) : return QStringLiteral("SCARD_W_RESET_CARD"); - case HRESULT(0x80100069) : return QStringLiteral("SCARD_W_REMOVED_CARD"); - case HRESULT(0x8010006A) : return QStringLiteral("SCARD_W_SECURITY_VIOLATION"); - case HRESULT(0x8010006B) : return QStringLiteral("SCARD_W_WRONG_CHV"); - case HRESULT(0x8010006C) : return QStringLiteral("SCARD_W_CHV_BLOCKED"); - case HRESULT(0x8010006D) : return QStringLiteral("SCARD_W_EOF"); - case HRESULT(0x8010006E) : return QStringLiteral("SCARD_W_CANCELLED_BY_USER"); - case HRESULT(0x8010006F) : return QStringLiteral("SCARD_W_CARD_NOT_AUTHENTICATED"); - case HRESULT(0x80100070) : return QStringLiteral("SCARD_W_CACHE_ITEM_NOT_FOUND"); - case HRESULT(0x80100071) : return QStringLiteral("SCARD_W_CACHE_ITEM_STALE"); - case HRESULT(0x80110401) : return QStringLiteral("COMADMIN_E_OBJECTERRORS"); - case HRESULT(0x80110402) : return QStringLiteral("COMADMIN_E_OBJECTINVALID"); - case HRESULT(0x80110403) : return QStringLiteral("COMADMIN_E_KEYMISSING"); - case HRESULT(0x80110404) : return QStringLiteral("COMADMIN_E_ALREADYINSTALLED"); - case HRESULT(0x80110407) : return QStringLiteral("COMADMIN_E_APP_FILE_WRITEFAIL"); - case HRESULT(0x80110408) : return QStringLiteral("COMADMIN_E_APP_FILE_READFAIL"); - case HRESULT(0x80110409) : return QStringLiteral("COMADMIN_E_APP_FILE_VERSION"); - case HRESULT(0x8011040A) : return QStringLiteral("COMADMIN_E_BADPATH"); - case HRESULT(0x8011040B) : return QStringLiteral("COMADMIN_E_APPLICATIONEXISTS"); - case HRESULT(0x8011040C) : return QStringLiteral("COMADMIN_E_ROLEEXISTS"); - case HRESULT(0x8011040D) : return QStringLiteral("COMADMIN_E_CANTCOPYFILE"); - case HRESULT(0x8011040F) : return QStringLiteral("COMADMIN_E_NOUSER"); - case HRESULT(0x80110410) : return QStringLiteral("COMADMIN_E_INVALIDUSERIDS"); - case HRESULT(0x80110411) : return QStringLiteral("COMADMIN_E_NOREGISTRYCLSID"); - case HRESULT(0x80110412) : return QStringLiteral("COMADMIN_E_BADREGISTRYPROGID"); - case HRESULT(0x80110413) : return QStringLiteral("COMADMIN_E_AUTHENTICATIONLEVEL"); - case HRESULT(0x80110414) : return QStringLiteral("COMADMIN_E_USERPASSWDNOTVALID"); - case HRESULT(0x80110418) : return QStringLiteral("COMADMIN_E_CLSIDORIIDMISMATCH"); - case HRESULT(0x80110419) : return QStringLiteral("COMADMIN_E_REMOTEINTERFACE"); - case HRESULT(0x8011041A) : return QStringLiteral("COMADMIN_E_DLLREGISTERSERVER"); - case HRESULT(0x8011041B) : return QStringLiteral("COMADMIN_E_NOSERVERSHARE"); - case HRESULT(0x8011041D) : return QStringLiteral("COMADMIN_E_DLLLOADFAILED"); - case HRESULT(0x8011041E) : return QStringLiteral("COMADMIN_E_BADREGISTRYLIBID"); - case HRESULT(0x8011041F) : return QStringLiteral("COMADMIN_E_APPDIRNOTFOUND"); - case HRESULT(0x80110423) : return QStringLiteral("COMADMIN_E_REGISTRARFAILED"); - case HRESULT(0x80110424) : return QStringLiteral("COMADMIN_E_COMPFILE_DOESNOTEXIST"); - case HRESULT(0x80110425) : return QStringLiteral("COMADMIN_E_COMPFILE_LOADDLLFAIL"); - case HRESULT(0x80110426) : return QStringLiteral("COMADMIN_E_COMPFILE_GETCLASSOBJ"); - case HRESULT(0x80110427) : return QStringLiteral("COMADMIN_E_COMPFILE_CLASSNOTAVAIL"); - case HRESULT(0x80110428) : return QStringLiteral("COMADMIN_E_COMPFILE_BADTLB"); - case HRESULT(0x80110429) : return QStringLiteral("COMADMIN_E_COMPFILE_NOTINSTALLABLE"); - case HRESULT(0x8011042A) : return QStringLiteral("COMADMIN_E_NOTCHANGEABLE"); - case HRESULT(0x8011042B) : return QStringLiteral("COMADMIN_E_NOTDELETEABLE"); - case HRESULT(0x8011042C) : return QStringLiteral("COMADMIN_E_SESSION"); - case HRESULT(0x8011042D) : return QStringLiteral("COMADMIN_E_COMP_MOVE_LOCKED"); - case HRESULT(0x8011042E) : return QStringLiteral("COMADMIN_E_COMP_MOVE_BAD_DEST"); - case HRESULT(0x80110430) : return QStringLiteral("COMADMIN_E_REGISTERTLB"); - case HRESULT(0x80110433) : return QStringLiteral("COMADMIN_E_SYSTEMAPP"); - case HRESULT(0x80110434) : return QStringLiteral("COMADMIN_E_COMPFILE_NOREGISTRAR"); - case HRESULT(0x80110435) : return QStringLiteral("COMADMIN_E_COREQCOMPINSTALLED"); - case HRESULT(0x80110436) : return QStringLiteral("COMADMIN_E_SERVICENOTINSTALLED"); - case HRESULT(0x80110437) : return QStringLiteral("COMADMIN_E_PROPERTYSAVEFAILED"); - case HRESULT(0x80110438) : return QStringLiteral("COMADMIN_E_OBJECTEXISTS"); - case HRESULT(0x80110439) : return QStringLiteral("COMADMIN_E_COMPONENTEXISTS"); - case HRESULT(0x8011043B) : return QStringLiteral("COMADMIN_E_REGFILE_CORRUPT"); - case HRESULT(0x8011043C) : return QStringLiteral("COMADMIN_E_PROPERTY_OVERFLOW"); - case HRESULT(0x8011043E) : return QStringLiteral("COMADMIN_E_NOTINREGISTRY"); - case HRESULT(0x8011043F) : return QStringLiteral("COMADMIN_E_OBJECTNOTPOOLABLE"); - case HRESULT(0x80110446) : return QStringLiteral("COMADMIN_E_APPLID_MATCHES_CLSID"); - case HRESULT(0x80110447) : return QStringLiteral("COMADMIN_E_ROLE_DOES_NOT_EXIST"); - case HRESULT(0x80110448) : return QStringLiteral("COMADMIN_E_START_APP_NEEDS_COMPONENTS"); - case HRESULT(0x80110449) : return QStringLiteral("COMADMIN_E_REQUIRES_DIFFERENT_PLATFORM"); - case HRESULT(0x8011044A) : return QStringLiteral("COMADMIN_E_CAN_NOT_EXPORT_APP_PROXY"); - case HRESULT(0x8011044B) : return QStringLiteral("COMADMIN_E_CAN_NOT_START_APP"); - case HRESULT(0x8011044C) : return QStringLiteral("COMADMIN_E_CAN_NOT_EXPORT_SYS_APP"); - case HRESULT(0x8011044D) : return QStringLiteral("COMADMIN_E_CANT_SUBSCRIBE_TO_COMPONENT"); - case HRESULT(0x8011044E) : return QStringLiteral("COMADMIN_E_EVENTCLASS_CANT_BE_SUBSCRIBER"); - case HRESULT(0x8011044F) : return QStringLiteral("COMADMIN_E_LIB_APP_PROXY_INCOMPATIBLE"); - case HRESULT(0x80110450) : return QStringLiteral("COMADMIN_E_BASE_PARTITION_ONLY"); - case HRESULT(0x80110451) : return QStringLiteral("COMADMIN_E_START_APP_DISABLED"); - case HRESULT(0x80110457) : return QStringLiteral("COMADMIN_E_CAT_DUPLICATE_PARTITION_NAME"); - case HRESULT(0x80110458) : return QStringLiteral("COMADMIN_E_CAT_INVALID_PARTITION_NAME"); - case HRESULT(0x80110459) : return QStringLiteral("COMADMIN_E_CAT_PARTITION_IN_USE"); - case HRESULT(0x8011045A) : return QStringLiteral("COMADMIN_E_FILE_PARTITION_DUPLICATE_FILES"); - case HRESULT(0x8011045B) : return QStringLiteral("COMADMIN_E_CAT_IMPORTED_COMPONENTS_NOT_ALLOWED"); - case HRESULT(0x8011045C) : return QStringLiteral("COMADMIN_E_AMBIGUOUS_APPLICATION_NAME"); - case HRESULT(0x8011045D) : return QStringLiteral("COMADMIN_E_AMBIGUOUS_PARTITION_NAME"); - case HRESULT(0x80110472) : return QStringLiteral("COMADMIN_E_REGDB_NOTINITIALIZED"); - case HRESULT(0x80110473) : return QStringLiteral("COMADMIN_E_REGDB_NOTOPEN"); - case HRESULT(0x80110474) : return QStringLiteral("COMADMIN_E_REGDB_SYSTEMERR"); - case HRESULT(0x80110475) : return QStringLiteral("COMADMIN_E_REGDB_ALREADYRUNNING"); - case HRESULT(0x80110480) : return QStringLiteral("COMADMIN_E_MIG_VERSIONNOTSUPPORTED"); - case HRESULT(0x80110481) : return QStringLiteral("COMADMIN_E_MIG_SCHEMANOTFOUND"); - case HRESULT(0x80110482) : return QStringLiteral("COMADMIN_E_CAT_BITNESSMISMATCH"); - case HRESULT(0x80110483) : return QStringLiteral("COMADMIN_E_CAT_UNACCEPTABLEBITNESS"); - case HRESULT(0x80110484) : return QStringLiteral("COMADMIN_E_CAT_WRONGAPPBITNESS"); - case HRESULT(0x80110485) : return QStringLiteral("COMADMIN_E_CAT_PAUSE_RESUME_NOT_SUPPORTED"); - case HRESULT(0x80110486) : return QStringLiteral("COMADMIN_E_CAT_SERVERFAULT"); - case HRESULT(0x80110600) : return QStringLiteral("COMQC_E_APPLICATION_NOT_QUEUED"); - case HRESULT(0x80110601) : return QStringLiteral("COMQC_E_NO_QUEUEABLE_INTERFACES"); - case HRESULT(0x80110602) : return QStringLiteral("COMQC_E_QUEUING_SERVICE_NOT_AVAILABLE"); - case HRESULT(0x80110603) : return QStringLiteral("COMQC_E_NO_IPERSISTSTREAM"); - case HRESULT(0x80110604) : return QStringLiteral("COMQC_E_BAD_MESSAGE"); - case HRESULT(0x80110605) : return QStringLiteral("COMQC_E_UNAUTHENTICATED"); - case HRESULT(0x80110606) : return QStringLiteral("COMQC_E_UNTRUSTED_ENQUEUER"); - case HRESULT(0x80110701) : return QStringLiteral("MSDTC_E_DUPLICATE_RESOURCE"); - case HRESULT(0x80110808) : return QStringLiteral("COMADMIN_E_OBJECT_PARENT_MISSING"); - case HRESULT(0x80110809) : return QStringLiteral("COMADMIN_E_OBJECT_DOES_NOT_EXIST"); - case HRESULT(0x8011080A) : return QStringLiteral("COMADMIN_E_APP_NOT_RUNNING"); - case HRESULT(0x8011080B) : return QStringLiteral("COMADMIN_E_INVALID_PARTITION"); - case HRESULT(0x8011080D) : return QStringLiteral("COMADMIN_E_SVCAPP_NOT_POOLABLE_OR_RECYCLABLE"); - case HRESULT(0x8011080E) : return QStringLiteral("COMADMIN_E_USER_IN_SET"); - case HRESULT(0x8011080F) : return QStringLiteral("COMADMIN_E_CANTRECYCLELIBRARYAPPS"); - case HRESULT(0x80110811) : return QStringLiteral("COMADMIN_E_CANTRECYCLESERVICEAPPS"); - case HRESULT(0x80110812) : return QStringLiteral("COMADMIN_E_PROCESSALREADYRECYCLED"); - case HRESULT(0x80110813) : return QStringLiteral("COMADMIN_E_PAUSEDPROCESSMAYNOTBERECYCLED"); - case HRESULT(0x80110814) : return QStringLiteral("COMADMIN_E_CANTMAKEINPROCSERVICE"); - case HRESULT(0x80110815) : return QStringLiteral("COMADMIN_E_PROGIDINUSEBYCLSID"); - case HRESULT(0x80110816) : return QStringLiteral("COMADMIN_E_DEFAULT_PARTITION_NOT_IN_SET"); - case HRESULT(0x80110817) : return QStringLiteral("COMADMIN_E_RECYCLEDPROCESSMAYNOTBEPAUSED"); - case HRESULT(0x80110818) : return QStringLiteral("COMADMIN_E_PARTITION_ACCESSDENIED"); - case HRESULT(0x80110819) : return QStringLiteral("COMADMIN_E_PARTITION_MSI_ONLY"); - case HRESULT(0x8011081A) : return QStringLiteral("COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_1_0_FORMAT"); - case HRESULT(0x8011081B) : return QStringLiteral("COMADMIN_E_LEGACYCOMPS_NOT_ALLOWED_IN_NONBASE_PARTITIONS"); - case HRESULT(0x8011081C) : return QStringLiteral("COMADMIN_E_COMP_MOVE_SOURCE"); - case HRESULT(0x8011081D) : return QStringLiteral("COMADMIN_E_COMP_MOVE_DEST"); - case HRESULT(0x8011081E) : return QStringLiteral("COMADMIN_E_COMP_MOVE_PRIVATE"); - case HRESULT(0x8011081F) : return QStringLiteral("COMADMIN_E_BASEPARTITION_REQUIRED_IN_SET"); - case HRESULT(0x80110820) : return QStringLiteral("COMADMIN_E_CANNOT_ALIAS_EVENTCLASS"); - case HRESULT(0x80110821) : return QStringLiteral("COMADMIN_E_PRIVATE_ACCESSDENIED"); - case HRESULT(0x80110822) : return QStringLiteral("COMADMIN_E_SAFERINVALID"); - case HRESULT(0x80110823) : return QStringLiteral("COMADMIN_E_REGISTRY_ACCESSDENIED"); - case HRESULT(0x80110824) : return QStringLiteral("COMADMIN_E_PARTITIONS_DISABLED"); - case HRESULT(0x80042301) : return QStringLiteral("VSS_E_BAD_STATE"); - case HRESULT(0x800423F7) : return QStringLiteral("VSS_E_LEGACY_PROVIDER"); - case HRESULT(0x800423FF) : return QStringLiteral("VSS_E_RESYNC_IN_PROGRESS"); - case HRESULT(0x8004232B) : return QStringLiteral("VSS_E_SNAPSHOT_NOT_IN_SET"); - case HRESULT(0x80042312) : return QStringLiteral("VSS_E_MAXIMUM_NUMBER_OF_VOLUMES_REACHED"); - case HRESULT(0x80042317) : return QStringLiteral("VSS_E_MAXIMUM_NUMBER_OF_SNAPSHOTS_REACHED"); - case HRESULT(0x8004232C) : return QStringLiteral("VSS_E_NESTED_VOLUME_LIMIT"); - case HRESULT(0x80042308) : return QStringLiteral("VSS_E_OBJECT_NOT_FOUND"); - case HRESULT(0x80042304) : return QStringLiteral("VSS_E_PROVIDER_NOT_REGISTERED"); - case HRESULT(0x80042306) : return QStringLiteral("VSS_E_PROVIDER_VETO"); - case HRESULT(0x8004230C) : return QStringLiteral("VSS_E_VOLUME_NOT_SUPPORTED"); - case HRESULT(0x8004230E) : return QStringLiteral("VSS_E_VOLUME_NOT_SUPPORTED_BY_PROVIDER"); - case HRESULT(0x80042302) : return QStringLiteral("VSS_E_UNEXPECTED"); - case HRESULT(0x8004230F) : return QStringLiteral("VSS_E_UNEXPECTED_PROVIDER_ERROR"); - case HRESULT(0x8004232A) : return QStringLiteral("VSS_E_UNSELECTED_VOLUME"); - case HRESULT(0x800423FE) : return QStringLiteral("VSS_E_CANNOT_REVERT_DISKID"); - case HRESULT(0x80042311) : return QStringLiteral("VSS_E_INVALID_XML_DOCUMENT"); - case HRESULT(0x8004230D) : return QStringLiteral("VSS_E_OBJECT_ALREADY_EXISTS"); - case HRESULT(0x80284001) : return QStringLiteral("TBS_E_INTERNAL_ERROR"); - case HRESULT(0x80284002) : return QStringLiteral("TBS_E_BAD_PARAMETER"); - case HRESULT(0x80284003) : return QStringLiteral("TBS_E_INVALID_OUTPUT_POINTER"); - case HRESULT(0x80284005) : return QStringLiteral("TBS_E_INSUFFICIENT_BUFFER"); - case HRESULT(0x80284006) : return QStringLiteral("TBS_E_IOERROR"); - case HRESULT(0x80284007) : return QStringLiteral("TBS_E_INVALID_CONTEXT_PARAM"); - case HRESULT(0x80284008) : return QStringLiteral("TBS_E_SERVICE_NOT_RUNNING"); - case HRESULT(0x80284009) : return QStringLiteral("TBS_E_TOO_MANY_TBS_CONTEXTS"); - case HRESULT(0x8028400B) : return QStringLiteral("TBS_E_SERVICE_START_PENDING"); - case HRESULT(0x8028400E) : return QStringLiteral("TBS_E_BUFFER_TOO_LARGE"); - case HRESULT(0x8028400F) : return QStringLiteral("TBS_E_TPM_NOT_FOUND"); - case HRESULT(0x80284010) : return QStringLiteral("TBS_E_SERVICE_DISABLED"); - case HRESULT(0x80284016) : return QStringLiteral("TBS_E_DEACTIVATED"); - case HRESULT(0x80320001) : return QStringLiteral("FWP_E_CALLOUT_NOT_FOUND"); - case HRESULT(0x80320002) : return QStringLiteral("FWP_E_CONDITION_NOT_FOUND"); - case HRESULT(0x80320003) : return QStringLiteral("FWP_E_FILTER_NOT_FOUND"); - case HRESULT(0x80320004) : return QStringLiteral("FWP_E_LAYER_NOT_FOUND"); - case HRESULT(0x80320005) : return QStringLiteral("FWP_E_PROVIDER_NOT_FOUND"); - case HRESULT(0x80320006) : return QStringLiteral("FWP_E_PROVIDER_CONTEXT_NOT_FOUND"); - case HRESULT(0x80320007) : return QStringLiteral("FWP_E_SUBLAYER_NOT_FOUND"); - case HRESULT(0x80320008) : return QStringLiteral("FWP_E_NOT_FOUND"); - case HRESULT(0x80320009) : return QStringLiteral("FWP_E_ALREADY_EXISTS"); - case HRESULT(0x8032000A) : return QStringLiteral("FWP_E_IN_USE"); - case HRESULT(0x8032000B) : return QStringLiteral("FWP_E_DYNAMIC_SESSION_IN_PROGRESS"); - case HRESULT(0x8032000C) : return QStringLiteral("FWP_E_WRONG_SESSION"); - case HRESULT(0x8032000D) : return QStringLiteral("FWP_E_NO_TXN_IN_PROGRESS"); - case HRESULT(0x8032000E) : return QStringLiteral("FWP_E_TXN_IN_PROGRESS"); - case HRESULT(0x8032000F) : return QStringLiteral("FWP_E_TXN_ABORTED"); - case HRESULT(0x80320010) : return QStringLiteral("FWP_E_SESSION_ABORTED"); - case HRESULT(0x80320011) : return QStringLiteral("FWP_E_INCOMPATIBLE_TXN"); - case HRESULT(0x80320012) : return QStringLiteral("FWP_E_TIMEOUT"); - case HRESULT(0x80320013) : return QStringLiteral("FWP_E_NET_EVENTS_DISABLED"); - case HRESULT(0x80320014) : return QStringLiteral("FWP_E_INCOMPATIBLE_LAYER"); - case HRESULT(0x80320015) : return QStringLiteral("FWP_E_KM_CLIENTS_ONLY"); - case HRESULT(0x80320016) : return QStringLiteral("FWP_E_LIFETIME_MISMATCH"); - case HRESULT(0x80320017) : return QStringLiteral("FWP_E_BUILTIN_OBJECT"); - case HRESULT(0x80320018) : return QStringLiteral("FWP_E_TOO_MANY_CALLOUTS"); - case HRESULT(0x80320019) : return QStringLiteral("FWP_E_NOTIFICATION_DROPPED"); - case HRESULT(0x8032001A) : return QStringLiteral("FWP_E_TRAFFIC_MISMATCH"); - case HRESULT(0x8032001B) : return QStringLiteral("FWP_E_INCOMPATIBLE_SA_STATE"); - case HRESULT(0x8032001C) : return QStringLiteral("FWP_E_NULL_POINTER"); - case HRESULT(0x8032001D) : return QStringLiteral("FWP_E_INVALID_ENUMERATOR"); - case HRESULT(0x8032001E) : return QStringLiteral("FWP_E_INVALID_FLAGS"); - case HRESULT(0x8032001F) : return QStringLiteral("FWP_E_INVALID_NET_MASK"); - case HRESULT(0x80320020) : return QStringLiteral("FWP_E_INVALID_RANGE"); - case HRESULT(0x80320021) : return QStringLiteral("FWP_E_INVALID_INTERVAL"); - case HRESULT(0x80320022) : return QStringLiteral("FWP_E_ZERO_LENGTH_ARRAY"); - case HRESULT(0x80320023) : return QStringLiteral("FWP_E_NULL_DISPLAY_NAME"); - case HRESULT(0x80320024) : return QStringLiteral("FWP_E_INVALID_ACTION_TYPE"); - case HRESULT(0x80320025) : return QStringLiteral("FWP_E_INVALID_WEIGHT"); - case HRESULT(0x80320026) : return QStringLiteral("FWP_E_MATCH_TYPE_MISMATCH"); - case HRESULT(0x80320027) : return QStringLiteral("FWP_E_TYPE_MISMATCH"); - case HRESULT(0x80320028) : return QStringLiteral("FWP_E_OUT_OF_BOUNDS"); - case HRESULT(0x80320029) : return QStringLiteral("FWP_E_RESERVED"); - case HRESULT(0x8032002A) : return QStringLiteral("FWP_E_DUPLICATE_CONDITION"); - case HRESULT(0x8032002B) : return QStringLiteral("FWP_E_DUPLICATE_KEYMOD"); - case HRESULT(0x8032002C) : return QStringLiteral("FWP_E_ACTION_INCOMPATIBLE_WITH_LAYER"); - case HRESULT(0x8032002D) : return QStringLiteral("FWP_E_ACTION_INCOMPATIBLE_WITH_SUBLAYER"); - case HRESULT(0x8032002E) : return QStringLiteral("FWP_E_CONTEXT_INCOMPATIBLE_WITH_LAYER"); - case HRESULT(0x8032002F) : return QStringLiteral("FWP_E_CONTEXT_INCOMPATIBLE_WITH_CALLOUT"); - case HRESULT(0x80320030) : return QStringLiteral("FWP_E_INCOMPATIBLE_AUTH_METHOD"); - case HRESULT(0x80320031) : return QStringLiteral("FWP_E_INCOMPATIBLE_DH_GROUP"); - case HRESULT(0x80320032) : return QStringLiteral("FWP_E_EM_NOT_SUPPORTED"); - case HRESULT(0x80320033) : return QStringLiteral("FWP_E_NEVER_MATCH"); - case HRESULT(0x80320034) : return QStringLiteral("FWP_E_PROVIDER_CONTEXT_MISMATCH"); - case HRESULT(0x80320035) : return QStringLiteral("FWP_E_INVALID_PARAMETER"); - case HRESULT(0x80320036) : return QStringLiteral("FWP_E_TOO_MANY_SUBLAYERS"); - case HRESULT(0x80320037) : return QStringLiteral("FWP_E_CALLOUT_NOTIFICATION_FAILED"); - case HRESULT(0x80320038) : return QStringLiteral("FWP_E_INVALID_AUTH_TRANSFORM"); - case HRESULT(0x80320039) : return QStringLiteral("FWP_E_INVALID_CIPHER_TRANSFORM"); - default : return QString(); - } -} - -/*! - \since 5.2 - - Returns the DWM colorization color. After the function returns, the optional - \a opaqueBlend will contain true if the color is an opaque blend and false - otherwise. - */ -QColor QtWin::colorizationColor(bool *opaqueBlend) -{ - QWinEventFilter::setup(); - - DWORD colorization = 0; - BOOL dummy = false; - DwmGetColorizationColor(&colorization, &dummy); - if (opaqueBlend) - *opaqueBlend = dummy; - return QColor::fromRgba(colorization); -} - -/*! - \since 5.2 - - Returns the real colorization color, set by the user, using an undocumented - registry key. The API-based function \c getColorizationColor() returns an - alpha-blended color which often turns out a semitransparent gray rather - than something similar to what is chosen by the user. - - \sa colorizationColor() - */ -QColor QtWin::realColorizationColor() -{ - QWinEventFilter::setup(); - - bool ok = false; - const QLatin1String path("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\DWM"); - QSettings registry(path, QSettings::NativeFormat); - QRgb color = registry.value(QLatin1String("ColorizationColor")).toUInt(&ok); - if (!ok) - qDebug("Failed to read colorization color."); - return ok ? QColor::fromRgba(color) : QColor(); -} - -/*! - \fn QtWin::setWindowExcludedFromPeek(QWidget *window, bool exclude) - \since 5.2 - \overload QtWin::setWindowExcludedFromPeek() -*/ - -/*! - \since 5.2 - - Excludes the specified \a window from Aero Peek if \a exclude is true. - */ -void QtWin::setWindowExcludedFromPeek(QWindow *window, bool exclude) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - QtDwmApiDll::setBooleanWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_EXCLUDED_FROM_PEEK, exclude); -} - -/*! - \fn bool QtWin::isWindowExcludedFromPeek(QWidget *window) - \since 5.2 - \overload QtWin::isWindowExcludedFromPeek() -*/ - -/*! - \since 5.2 - - Returns true if the specified \a window is excluded from Aero Peek. - */ -bool QtWin::isWindowExcludedFromPeek(QWindow *window) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - return QtDwmApiDll::booleanWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_EXCLUDED_FROM_PEEK); -} - -/*! - \fn void QtWin::setWindowDisallowPeek(QWidget *window, bool disallow) - \since 5.2 - \overload QtWin::setWindowDisallowPeek() -*/ - -/*! - \since 5.2 - - Disables Aero Peek for the specified \a window when hovering over the - taskbar thumbnail of the window with the mouse pointer if \a disallow is - true; otherwise allows it. - - The default is false. - */ -void QtWin::setWindowDisallowPeek(QWindow *window, bool disallow) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - QtDwmApiDll::setBooleanWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_DISALLOW_PEEK, disallow); -} - -/*! - \fn bool QtWin::isWindowPeekDisallowed(QWidget *window) - \since 5.2 - \overload QtWin::isWindowPeekDisallowed() -*/ - -/*! - \since 5.2 - - Returns true if Aero Peek is disallowed on the thumbnail of the specified - \a window. - */ -bool QtWin::isWindowPeekDisallowed(QWindow *window) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - return QtDwmApiDll::booleanWindowAttribute(reinterpret_cast<HWND>(window->winId()), qt_DWMWA_DISALLOW_PEEK); -} - -/*! - \fn void QtWin::setWindowFlip3DPolicy(QWidget *window, QtWin::WindowFlip3DPolicy policy) - \since 5.2 - \overload QtWin::setWindowFlip3DPolicy() -*/ - -/*! - \since 5.2 - - Sets the Flip3D policy \a policy for the specified \a window. - */ -void QtWin::setWindowFlip3DPolicy(QWindow *window, QtWin::WindowFlip3DPolicy policy) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - - HWND handle = reinterpret_cast<HWND>(window->winId()); - - // Policy should be defaulted first, bug or smth. - DWORD value = DWMFLIP3D_DEFAULT; - QtDwmApiDll::setWindowAttribute(handle, DWMWA_FLIP3D_POLICY, value); - - switch (policy) { - default : - case FlipDefault : - value = -1; - break; - case FlipExcludeBelow : - value = DWMFLIP3D_EXCLUDEBELOW; - break; - case FlipExcludeAbove : - value = DWMFLIP3D_EXCLUDEABOVE; - break; - } - - if (DWMFLIP3D_DEFAULT != value) - QtDwmApiDll::setWindowAttribute(handle, DWMWA_FLIP3D_POLICY, value); -} - -/*! - \fn QtWin::WindowFlip3DPolicy QtWin::windowFlip3DPolicy(QWidget *window) - \since 5.2 - \overload QtWin::windowFlip3DPolicy() - */ - -/*! - \since 5.2 - - Returns the current Flip3D policy for the specified \a window. - */ -QtWin::WindowFlip3DPolicy QtWin::windowFlip3DPolicy(QWindow *window) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - - const auto value = - QtDwmApiDll::windowAttribute<DWORD>(reinterpret_cast<HWND>(window->winId()), - DWMWA_FLIP3D_POLICY, DWORD(DWMFLIP3D_DEFAULT)); - QtWin::WindowFlip3DPolicy policy = QtWin::FlipDefault; - switch (value) { - case DWMFLIP3D_EXCLUDEABOVE : - policy = QtWin::FlipExcludeAbove; - break; - case DWMFLIP3D_EXCLUDEBELOW : - policy = QtWin::FlipExcludeBelow; - break; - default : - break; - } - return policy; -} - -/*! - \since 6.0 - - Sets the non-client area rendering policy \a policy for the specified \a window. - - \note Disabling non-client area rendering will cause any previous calls to - QtWin::enableBlurBehindWindow() or to QtWin::extendFrameIntoClientArea() to be disabled. - */ -void QtWin::setWindowNonClientAreaRenderingPolicy(QWindow *window, QtWin::WindowNonClientRenderingPolicy policy) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - - HWND handle = reinterpret_cast<HWND>(window->winId()); - - DWORD value = DWMNCRP_USEWINDOWSTYLE; - - switch (policy) { - default : - case NonClientRenderingUseWindowStyle : - break; - case NonClientRenderingDisabled : - value = DWMNCRP_DISABLED; - break; - case NonClientRenderingEnabled : - value = DWMNCRP_ENABLED; - break; - } - - QtDwmApiDll::setWindowAttribute(handle, DWMWA_NCRENDERING_POLICY, value); -} - -/*! - \fn QtWin::WindowNonClientRenderingPolicy QtWin::windowNonClientAreaRenderingPolicy(QWidget *window) - \since 6.0 - \overload QtWin::windowNonClientAreaRenderingPolicy() - */ - -/*! - \since 6.0 - - Returns the current non-client area rendering policy for the specified \a window. - */ -QtWin::WindowNonClientRenderingPolicy QtWin::windowNonClientAreaRenderingPolicy(QWindow *window) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - - const auto value = - QtDwmApiDll::windowAttribute<DWORD>(reinterpret_cast<HWND>(window->winId()), - DWMWA_NCRENDERING_POLICY, DWORD(DWMNCRP_USEWINDOWSTYLE)); - WindowNonClientRenderingPolicy policy = NonClientRenderingUseWindowStyle; - switch (value) { - case DWMNCRP_DISABLED : - policy = NonClientRenderingDisabled; - break; - case DWMNCRP_ENABLED : - policy = NonClientRenderingEnabled; - break; - default : - break; - } - return policy; -} - -void qt_ExtendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom) -{ - QWinEventFilter::setup(); - MARGINS margins = {left, right, top, bottom}; - DwmExtendFrameIntoClientArea(reinterpret_cast<HWND>(window->winId()), &margins); -} - -/*! \fn void QtWin::extendFrameIntoClientArea(QWidget *window, int left, int top, int right, int bottom) - \since 5.2 - \overload QtWin::extendFrameIntoClientArea() - */ - -/*! - \since 5.2 - - Extends the glass frame into the client area of the specified \a window - using the \a left, \a top, \a right, and \a bottom margin values. - - Pass -1 as values for any of the four margins to fully extend the frame, - creating a \e {sheet of glass} effect. If it doesn't work, change - non-client area rendering policy to QtWin::NonClientRenderingEnabled and - try again. - - If you want the extended frame to act like a standard window border, you - should handle that yourself. - - \note Qt::WA_NoSystemBackground must not be set on widgets for - extendFrameIntoClientArea() to work. - - \sa resetExtendedFrame(), setWindowNonClientAreaRenderingPolicy() - */ -void QtWin::extendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - qt_ExtendFrameIntoClientArea(window, left, top, right, bottom); -} - -/*! \fn void QtWin::extendFrameIntoClientArea(QWidget *window, const QMargins &margins) - \since 5.2 - \overload QtWin::extendFrameIntoClientArea() - - Convenience overload that allows passing frame sizes in a \a margins - structure. - */ - -/*! - \since 5.2 - \overload QtWin::extendFrameIntoClientArea() - - Extends the glass frame into the client area of the specified \a window - using the specified \a margins. - */ -void QtWin::extendFrameIntoClientArea(QWindow *window, const QMargins &margins) -{ - QtWin::extendFrameIntoClientArea(window, margins.left(), margins.top(), margins.right(), margins.bottom()); -} - -/*! - \fn void QtWin::resetExtendedFrame(QWidget *window) - \since 5.2 - \overload QtWin::resetExtendedFrame() - */ - -/*! - \since 5.2 - - Resets the glass frame and restores the \a window attributes. - - This convenience function calls extendFrameIntoClientArea() with margins set - to 0. - - \note Qt::WA_NoSystemBackground must not be set on widgets for - extendFrameIntoClientArea() to work. - - \sa extendFrameIntoClientArea() - */ -void QtWin::resetExtendedFrame(QWindow *window) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - qt_ExtendFrameIntoClientArea(window, 0, 0, 0, 0); -} - -/*! - \fn void QtWin::enableBlurBehindWindow(QWidget *window, const QRegion ®ion) - \since 5.2 - \overload QtWin::enableBlurBehindWindow() - */ - -/*! - \since 5.2 - - Enables the blur effect for the specified \a region of the specified - \a window. - - \sa disableBlurBehindWindow() - */ -void QtWin::enableBlurBehindWindow(QWindow *window, const QRegion ®ion) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - - DWM_BLURBEHIND dwmbb = {0, 0, nullptr, 0}; - dwmbb.dwFlags = DWM_BB_ENABLE; - dwmbb.fEnable = TRUE; - HRGN rgn = nullptr; - if (!region.isNull()) { - rgn = toHRGN(region); - if (rgn) { - dwmbb.hRgnBlur = rgn; - dwmbb.dwFlags |= DWM_BB_BLURREGION; - } - } - DwmEnableBlurBehindWindow(reinterpret_cast<HWND>(window->winId()), &dwmbb); - if (rgn) - DeleteObject(rgn); -} - -/*! - \fn void QtWin::enableBlurBehindWindow(QWidget *window) - \since 5.2 - \overload QtWin::enableBlurBehindWindow() - */ - -/*! - \since 5.2 - - Enables the blur effect for the specified \a window. - - \sa disableBlurBehindWindow() - */ -void QtWin::enableBlurBehindWindow(QWindow *window) -{ - QtWin::enableBlurBehindWindow(window, QRegion()); -} - -/*! - \fn void QtWin::disableBlurBehindWindow(QWidget *window) - \since 5.2 - \overload QtWin::disableBlurBehindWindow() - */ - -/*! - \since 5.2 - - Disables the previously enabled blur effect for the specified \a window. - - \sa enableBlurBehindWindow() - */ -void QtWin::disableBlurBehindWindow(QWindow *window) -{ - Q_ASSERT_X(window, Q_FUNC_INFO, "window is null"); - DWM_BLURBEHIND dwmbb = {0, 0, nullptr, 0}; - dwmbb.dwFlags = DWM_BB_ENABLE; - DwmEnableBlurBehindWindow(reinterpret_cast<HWND>(window->winId()), &dwmbb); -} - -/*! - \since 5.2 - - Returns the DWM composition state. - */ -bool QtWin::isCompositionEnabled() -{ - QWinEventFilter::setup(); - - BOOL enabled = FALSE; - DwmIsCompositionEnabled(&enabled); - return enabled; -} - -/*! - \since 5.2 - - Sets whether the Windows Desktop composition is \a enabled. - - \note The underlying function was declared deprecated as of Windows 8 and - takes no effect. - */ - -QT_WARNING_PUSH -QT_WARNING_DISABLE_MSVC(4995) -void QtWin::setCompositionEnabled(bool enabled) -{ - QWinEventFilter::setup(); - - UINT compositionEnabled = enabled; - DwmEnableComposition(compositionEnabled); -} -QT_WARNING_POP - -/*! - \since 5.2 - - Returns whether the colorization color is an opaque blend. - */ -bool QtWin::isCompositionOpaque() -{ - bool opaque; - colorizationColor(&opaque); - return opaque; -} - -/*! - \since 5.2 - - Sets the Application User Model ID \a id. - - For more information, see - \l{http://msdn.microsoft.com/en-us/library/windows/desktop/dd378459.aspx} - {Application User Model IDs}. - */ -void QtWin::setCurrentProcessExplicitAppUserModelID(const QString &id) -{ - QScopedArrayPointer<wchar_t> wid(qt_qstringToNullTerminated(id)); - SetCurrentProcessExplicitAppUserModelID(wid.data()); -} - -/*! - \internal - */ -ITaskbarList3 *qt_createITaskbarList3() -{ - ITaskbarList3 *pTbList = nullptr; - HRESULT result = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, qIID_ITaskbarList3, reinterpret_cast<void **>(&pTbList)); - if (SUCCEEDED(result)) { - if (FAILED(pTbList->HrInit())) { - pTbList->Release(); - pTbList = nullptr; - } - } - return pTbList; -} - -/*! - \internal - */ -ITaskbarList2 *qt_createITaskbarList2() -{ - ITaskbarList3 *pTbList = nullptr; - HRESULT result = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, qIID_ITaskbarList2, reinterpret_cast<void **>(&pTbList)); - if (SUCCEEDED(result)) { - if (FAILED(pTbList->HrInit())) { - pTbList->Release(); - pTbList = nullptr; - } - } - return pTbList; -} - -/*! - \fn void QtWin::markFullscreenWindow(QWidget *window, bool fullscreen) - \since 5.2 - \overload QtWin::markFullscreenWindow() - */ - -/*! - \since 5.2 - - Marks the specified \a window as running in the full-screen mode if - \a fullscreen is true, so that the shell handles it correctly. Otherwise, - removes the mark. - - \note You do not usually need to call this function, because the Windows - taskbar always tries to determine whether a window is running in the - full-screen mode. - */ -void QtWin::markFullscreenWindow(QWindow *window, bool fullscreen) -{ - ITaskbarList2 *pTbList = qt_createITaskbarList2(); - if (pTbList) { - pTbList->MarkFullscreenWindow(reinterpret_cast<HWND>(window->winId()), fullscreen); - pTbList->Release(); - } -} - -/*! - \fn void QtWin::taskbarActivateTab(QWidget *window) - \since 5.2 - \overload QtWin::taskbarActivateTab() - */ - -/*! - \since 5.2 - - Activates an item on the taskbar without activating the \a window itself. - */ -void QtWin::taskbarActivateTab(QWindow *window) -{ - ITaskbarList *pTbList = qt_createITaskbarList2(); - if (pTbList) { - pTbList->ActivateTab(reinterpret_cast<HWND>(window->winId())); - pTbList->Release(); - } -} - -/*! - \fn void QtWin::taskbarActivateTabAlt(QWidget *window) - \since 5.2 - \overload QtWin::taskbarActivateTabAlt() - */ - -/*! - \since 5.2 - - Marks the item that represents the specified \a window on the taskbar - as active, but does not activate it visually. - */ -void QtWin::taskbarActivateTabAlt(QWindow *window) -{ - ITaskbarList *pTbList = qt_createITaskbarList2(); - if (pTbList) { - pTbList->SetActiveAlt(reinterpret_cast<HWND>(window->winId())); - pTbList->Release(); - } -} - -/*! - \fn void QtWin::taskbarAddTab(QWidget *window) - \since 5.2 - \overload QtWin::taskbarAddTab() - */ - -/*! - \since 5.2 - - Adds an item for the specified \a window to the taskbar. - */ -void QtWin::taskbarAddTab(QWindow *window) -{ - ITaskbarList *pTbList = qt_createITaskbarList2(); - if (pTbList) { - pTbList->AddTab(reinterpret_cast<HWND>(window->winId())); - pTbList->Release(); - } -} - -/*! - \fn void QtWin::taskbarDeleteTab(QWidget *window) - \since 5.2 - \overload QtWin::taskbarDeleteTab() - */ - -/*! - \since 5.2 - - Removes the specified \a window from the taskbar. - */ -void QtWin::taskbarDeleteTab(QWindow *window) -{ - ITaskbarList *pTbList = qt_createITaskbarList3(); - if (pTbList) { - pTbList->DeleteTab(reinterpret_cast<HWND>(window->winId())); - pTbList->Release(); - } -} - -/*! - \enum QtWin::HBitmapFormat - - \since 5.2 - - This enum defines how the conversion between \c - HBITMAP and QPixmap is performed. - - \value HBitmapNoAlpha - The alpha channel is ignored and always treated as - being set to fully opaque. This is preferred if the \c HBITMAP is - used with standard GDI calls, such as \c BitBlt(). - - \value HBitmapPremultipliedAlpha - The \c HBITMAP is treated as having an - alpha channel and premultiplied colors. This is preferred if the - \c HBITMAP is accessed through the \c AlphaBlend() GDI function. - - \value HBitmapAlpha - The \c HBITMAP is treated as having a plain alpha - channel. This is the preferred format if the \c HBITMAP is going - to be used as an application icon or a systray icon. - - \sa fromHBITMAP(), toHBITMAP() -*/ - -/*! - \enum QtWin::WindowFlip3DPolicy - - \since 5.2 - - This enum type specifies the Flip3D window policy. - - \value FlipDefault - Let the OS decide whether to include the window in the Flip3D - rendering. - - \value FlipExcludeAbove - Exclude the window from Flip3D and display it above the Flip3D - rendering. - - \value FlipExcludeBelow - Exclude the window from Flip3D and display it below the Flip3D - rendering. - - \sa setWindowFlip3DPolicy() - */ - -/*! - \enum QtWin::WindowNonClientRenderingPolicy - - \since 6.0 - - This enum type specifies the non-client area rendering policy. - - \value NonClientRenderingUseWindowStyle - The non-client rendering area is rendered based on the window - style. - - \value NonClientRenderingDisabled - The non-client area rendering is disabled and the window style - is ignored. - Note that disabling non-client area rendering will cause any - previous calls to QtWin::enableBlurBehindWindow() or to - QtWin::extendFrameIntoClientArea() to be disabled. - - \value NonClientRenderingEnabled - The non-client area rendering is enabled and the window style - is ignored. - If you want to bring frame shadow back to a frameless window, - enable this policy and call QtWin::extendFrameIntoClientArea() - with a negative height. - - \sa setWindowNonClientAreaRenderingPolicy() - */ - -QT_END_NAMESPACE diff --git a/src/winextras/qwinfunctions.h b/src/winextras/qwinfunctions.h deleted file mode 100644 index 8f27a6f..0000000 --- a/src/winextras/qwinfunctions.h +++ /dev/null @@ -1,253 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtWinExtras module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QWINFUNCTIONS_H -#define QWINFUNCTIONS_H - -#if 0 -#pragma qt_class(QtWin) -#endif - -#include <QtCore/qobject.h> -#include <QtCore/qt_windows.h> -#include <QtWinExtras/qwinextrasglobal.h> -#ifdef QT_WIDGETS_LIB -#include <QtWidgets/qwidget.h> -#endif - -QT_BEGIN_NAMESPACE - -class QPixmap; -class QImage; -class QBitmap; -class QColor; -class QWindow; -class QString; -class QMargins; - -namespace QtWin -{ - enum HBitmapFormat - { - HBitmapNoAlpha, - HBitmapPremultipliedAlpha, - HBitmapAlpha - }; - - enum WindowFlip3DPolicy - { - FlipDefault, - FlipExcludeBelow, - FlipExcludeAbove - }; - - enum WindowNonClientRenderingPolicy - { - NonClientRenderingUseWindowStyle, - NonClientRenderingDisabled, - NonClientRenderingEnabled - }; - - Q_WINEXTRAS_EXPORT HBITMAP createMask(const QBitmap &bitmap); - Q_WINEXTRAS_EXPORT HBITMAP toHBITMAP(const QPixmap &p, HBitmapFormat format = HBitmapNoAlpha); - Q_WINEXTRAS_EXPORT QPixmap fromHBITMAP(HBITMAP bitmap, HBitmapFormat format = HBitmapNoAlpha); - Q_WINEXTRAS_EXPORT HICON toHICON(const QPixmap &p); - Q_WINEXTRAS_EXPORT HBITMAP imageToHBITMAP(const QImage &image, QtWin::HBitmapFormat format = HBitmapNoAlpha); - Q_WINEXTRAS_EXPORT QImage imageFromHBITMAP(HDC hdc, HBITMAP bitmap, int width, int height); - Q_WINEXTRAS_EXPORT QImage imageFromHBITMAP(HBITMAP bitmap, QtWin::HBitmapFormat format = HBitmapNoAlpha); - Q_WINEXTRAS_EXPORT QPixmap fromHICON(HICON icon); - Q_WINEXTRAS_EXPORT HRGN toHRGN(const QRegion ®ion); - Q_WINEXTRAS_EXPORT QRegion fromHRGN(HRGN hrgn); - - Q_WINEXTRAS_EXPORT QString stringFromHresult(HRESULT hresult); - Q_WINEXTRAS_EXPORT QString errorStringFromHresult(HRESULT hresult); - - Q_WINEXTRAS_EXPORT QColor colorizationColor(bool *opaqueBlend = nullptr); - Q_WINEXTRAS_EXPORT QColor realColorizationColor(); - - Q_WINEXTRAS_EXPORT void setWindowExcludedFromPeek(QWindow *window, bool exclude); - Q_WINEXTRAS_EXPORT bool isWindowExcludedFromPeek(QWindow *window); - Q_WINEXTRAS_EXPORT void setWindowDisallowPeek(QWindow *window, bool disallow); - Q_WINEXTRAS_EXPORT bool isWindowPeekDisallowed(QWindow *window); - Q_WINEXTRAS_EXPORT void setWindowFlip3DPolicy(QWindow *window, WindowFlip3DPolicy policy); - Q_WINEXTRAS_EXPORT WindowFlip3DPolicy windowFlip3DPolicy(QWindow *); - Q_WINEXTRAS_EXPORT void setWindowNonClientAreaRenderingPolicy(QWindow *window, WindowNonClientRenderingPolicy policy); - Q_WINEXTRAS_EXPORT WindowNonClientRenderingPolicy windowNonClientAreaRenderingPolicy(QWindow *); - - Q_WINEXTRAS_EXPORT void extendFrameIntoClientArea(QWindow *window, int left, int top, int right, int bottom); - Q_WINEXTRAS_EXPORT void extendFrameIntoClientArea(QWindow *window, const QMargins &margins); - Q_WINEXTRAS_EXPORT void resetExtendedFrame(QWindow *window); - - Q_WINEXTRAS_EXPORT void enableBlurBehindWindow(QWindow *window, const QRegion ®ion); - Q_WINEXTRAS_EXPORT void enableBlurBehindWindow(QWindow *window); - Q_WINEXTRAS_EXPORT void disableBlurBehindWindow(QWindow *window); - - Q_WINEXTRAS_EXPORT bool isCompositionEnabled(); - Q_WINEXTRAS_EXPORT void setCompositionEnabled(bool enabled); - Q_WINEXTRAS_EXPORT bool isCompositionOpaque(); - - Q_WINEXTRAS_EXPORT void setCurrentProcessExplicitAppUserModelID(const QString &id); - - Q_WINEXTRAS_EXPORT void markFullscreenWindow(QWindow *, bool fullscreen = true); - - Q_WINEXTRAS_EXPORT void taskbarActivateTab(QWindow *); - Q_WINEXTRAS_EXPORT void taskbarActivateTabAlt(QWindow *); - Q_WINEXTRAS_EXPORT void taskbarAddTab(QWindow *); - Q_WINEXTRAS_EXPORT void taskbarDeleteTab(QWindow *); - -#ifdef QT_WIDGETS_LIB - inline void setWindowExcludedFromPeek(QWidget *window, bool exclude) - { - window->createWinId(); - setWindowExcludedFromPeek(window->windowHandle(), exclude); - } - - inline bool isWindowExcludedFromPeek(QWidget *window) - { - auto handle = window->windowHandle(); - return handle && isWindowExcludedFromPeek(handle); - } - - inline void setWindowDisallowPeek(QWidget *window, bool disallow) - { - window->createWinId(); - setWindowDisallowPeek(window->windowHandle(), disallow); - } - - inline bool isWindowPeekDisallowed(QWidget *window) - { - auto handle = window->windowHandle(); - return handle && isWindowPeekDisallowed(handle); - } - - inline void setWindowFlip3DPolicy(QWidget *window, WindowFlip3DPolicy policy) - { - window->createWinId(); - setWindowFlip3DPolicy(window->windowHandle(), policy); - } - - inline WindowFlip3DPolicy windowFlip3DPolicy(QWidget *window) - { - auto handle = window->windowHandle(); - return handle ? windowFlip3DPolicy(handle) : FlipDefault; - } - - inline void setWindowNonClientAreaRenderingPolicy(QWidget *window, WindowNonClientRenderingPolicy policy) - { - window->createWinId(); - setWindowNonClientAreaRenderingPolicy(window->windowHandle(), policy); - } - - inline WindowNonClientRenderingPolicy windowNonClientAreaRenderingPolicy(QWidget *window) - { - auto handle = window->windowHandle(); - return handle ? windowNonClientAreaRenderingPolicy(handle) : NonClientRenderingUseWindowStyle; - } - - inline void extendFrameIntoClientArea(QWidget *window, const QMargins &margins) - { - window->createWinId(); - extendFrameIntoClientArea(window->windowHandle(), margins); - } - - inline void extendFrameIntoClientArea(QWidget *window, int left, int top, int right, int bottom) - { - window->createWinId(); - extendFrameIntoClientArea(window->windowHandle(), left, top, right, bottom); - } - - inline void resetExtendedFrame(QWidget *window) - { - if (window->windowHandle()) - resetExtendedFrame(window->windowHandle()); - } - - inline void enableBlurBehindWindow(QWidget *window, const QRegion ®ion) - { - window->createWinId(); - enableBlurBehindWindow(window->windowHandle(), region); - } - - inline void enableBlurBehindWindow(QWidget *window) - { - window->createWinId(); - enableBlurBehindWindow(window->windowHandle()); - } - - inline void disableBlurBehindWindow(QWidget *window) - { - if (window->windowHandle()) - disableBlurBehindWindow(window->windowHandle()); - } - - inline void markFullscreenWindow(QWidget *window, bool fullscreen = true) - { - window->createWinId(); - markFullscreenWindow(window->windowHandle(), fullscreen); - } - - inline void taskbarActivateTab(QWidget *window) - { - window->createWinId(); - taskbarActivateTab(window->windowHandle()); - } - - inline void taskbarActivateTabAlt(QWidget *window) - { - window->createWinId(); - taskbarActivateTabAlt(window->windowHandle()); - } - - inline void taskbarAddTab(QWidget *window) - { - window->createWinId(); - taskbarAddTab(window->windowHandle()); - } - - inline void taskbarDeleteTab(QWidget *window) - { - window->createWinId(); - taskbarDeleteTab(window->windowHandle()); - } -#endif // QT_WIDGETS_LIB -} - -QT_END_NAMESPACE - -#endif // QWINFUNCTIONS_H diff --git a/src/winextras/qwinfunctions_p.h b/src/winextras/qwinfunctions_p.h deleted file mode 100644 index 0ee73cb..0000000 --- a/src/winextras/qwinfunctions_p.h +++ /dev/null @@ -1,108 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINFUNCTIONS_P_H -#define QWINFUNCTIONS_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtCore/qstring.h> -#include <QtCore/qt_windows.h> -#include <uxtheme.h> -#include <dwmapi.h> - -QT_BEGIN_NAMESPACE - -enum qt_DWMWINDOWATTRIBUTE // Not present in MinGW 4.9 -{ - qt_DWMWA_DISALLOW_PEEK = 11, - qt_DWMWA_EXCLUDED_FROM_PEEK = 12, -}; - -namespace QtDwmApiDll -{ - template <class T> static T windowAttribute(HWND hwnd, DWORD attribute, T defaultValue); - template <class T> static void setWindowAttribute(HWND hwnd, DWORD attribute, T value); - - inline bool booleanWindowAttribute(HWND hwnd, DWORD attribute) - { return QtDwmApiDll::windowAttribute<BOOL>(hwnd, attribute, FALSE) != FALSE; } - - inline void setBooleanWindowAttribute(HWND hwnd, DWORD attribute, bool value) - { setWindowAttribute<BOOL>(hwnd, attribute, BOOL(value ? TRUE : FALSE)); } -}; - -inline void qt_qstringToNullTerminated(const QString &src, wchar_t *dst) -{ - dst[src.toWCharArray(dst)] = 0; -} - -inline wchar_t *qt_qstringToNullTerminated(const QString &src) -{ - auto *buffer = new wchar_t[src.length() + 1]; - qt_qstringToNullTerminated(src, buffer); - return buffer; -} - -template <class T> -T QtDwmApiDll::windowAttribute(HWND hwnd, DWORD attribute, T defaultValue) -{ - T value; - if (FAILED(DwmGetWindowAttribute(hwnd, attribute, &value, sizeof(value)))) - value = defaultValue; - return value; -} - -template <class T> -void QtDwmApiDll::setWindowAttribute(HWND hwnd, DWORD attribute, T value) -{ - DwmSetWindowAttribute(hwnd, attribute, &value, sizeof(value)); -} - -QT_END_NAMESPACE - -#endif // QWINFUNCTIONS_P_H diff --git a/src/winextras/qwinjumplist.cpp b/src/winextras/qwinjumplist.cpp deleted file mode 100644 index f479096..0000000 --- a/src/winextras/qwinjumplist.cpp +++ /dev/null @@ -1,608 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include <QtCore/qglobal.h> - -#ifdef Q_CC_MINGW // MinGW: Enable SHCreateItemFromParsingName() -# if defined(_WIN32_IE) && _WIN32_IE < 0x0700 // _WIN32_IE_IE70 -# undef _WIN32_IE -# endif -# ifndef _WIN32_IE -# define _WIN32_IE 0x0700 -# endif -#endif // Q_CC_MINGW - -#include "qwinjumplist.h" -#include "qwinjumplist_p.h" -#include "qwinjumplistitem.h" -#include "qwinjumplistcategory.h" -#include "qwinjumplistcategory_p.h" -#include "windowsguidsdefs_p.h" -#include "winpropkey_p.h" - -#include <QtCore/qdir.h> -#include <QtCore/qdebug.h> -#include <QtCore/qcoreapplication.h> -#include <QtCore/qregularexpression.h> -#include <QtCore/qt_windows.h> -#include <propvarutil.h> - -#include "qwinfunctions.h" -#include "qwinfunctions_p.h" -#include "winpropkey_p.h" - -#include <shobjidl.h> - -QT_BEGIN_NAMESPACE - -/*! - \class QWinJumpList - \inmodule QtWinExtras - \brief The QWinJumpList class represents a transparent wrapper around Windows - Jump Lists. - - \since 5.2 - - An application can use Jump Lists to provide users with faster access to - files or to display shortcuts to tasks or commands. - */ - -/*! - \title Application User Model IDs - \externalpage http://msdn.microsoft.com/en-us/library/windows/desktop/dd378459%28v=vs.85%29.aspx - */ - -// partial copy of qprocess_win.cpp:qt_create_commandline() -static QString createArguments(const QStringList &arguments) -{ - QString args; - for (int i=0; i<arguments.size(); ++i) { - QString tmp = arguments.at(i); - // Quotes are escaped and their preceding backslashes are doubled. - tmp.replace(QRegularExpression(QLatin1String("(\\\\*)\"")), QLatin1String("\\1\\1\\\"")); - if (tmp.isEmpty() || tmp.contains(u' ') || tmp.contains(u'\t')) { - // The argument must not end with a \ since this would be interpreted - // as escaping the quote -- rather put the \ behind the quote: e.g. - // rather use "foo"\ than "foo\" - int i = tmp.length(); - while (i > 0 && tmp.at(i - 1) == u'\\') - --i; - tmp.insert(i, u'"'); - tmp.prepend(u'"'); - } - args += u' ' + tmp; - } - return args; -} - -void QWinJumpListPrivate::warning(const char *function, HRESULT hresult) -{ - const QString err = QtWin::errorStringFromHresult(hresult); - qWarning("QWinJumpList: %s() failed: %#010x, %s.", function, unsigned(hresult), qPrintable(err)); -} - -QString QWinJumpListPrivate::iconsDirPath() -{ - QString iconDirPath = QDir::tempPath() + u'/' - + QCoreApplication::applicationName() + QLatin1String("/qt-jl-icons/"); - QDir().mkpath(iconDirPath); - return iconDirPath; -} - -void QWinJumpListPrivate::invalidate() -{ - Q_Q(QWinJumpList); - if (!pDestList) - return; - - if (!dirty) { - dirty = true; - QMetaObject::invokeMethod(q, "_q_rebuild", Qt::QueuedConnection); - } -} - -void QWinJumpListPrivate::_q_rebuild() -{ - if (beginList()) { - if (recent && recent->isVisible()) - appendKnownCategory(KDC_RECENT); - if (frequent && frequent->isVisible()) - appendKnownCategory(KDC_FREQUENT); - for (QWinJumpListCategory *category : qAsConst(categories)) { - if (category->isVisible()) - appendCustomCategory(category); - } - if (tasks && tasks->isVisible()) - appendTasks(tasks->items()); - commitList(); - } - dirty = false; -} - -void QWinJumpListPrivate::destroy() -{ - delete recent; - recent = nullptr; - delete frequent; - frequent = nullptr; - delete tasks; - tasks = nullptr; - qDeleteAll(categories); - categories.clear(); - invalidate(); -} - -bool QWinJumpListPrivate::beginList() -{ - HRESULT hresult = S_OK; - if (!identifier.isEmpty()) { - wchar_t *id = qt_qstringToNullTerminated(identifier); - hresult = pDestList->SetAppID(id); - delete[] id; - } - if (SUCCEEDED(hresult)) { - UINT maxSlots = 0; - IUnknown *array = nullptr; - hresult = pDestList->BeginList(&maxSlots, qIID_IUnknown, reinterpret_cast<void **>(&array)); - if (array) - array->Release(); - } - if (FAILED(hresult)) - QWinJumpListPrivate::warning("BeginList", hresult); - return SUCCEEDED(hresult); -} - -bool QWinJumpListPrivate::commitList() -{ - HRESULT hresult = pDestList->CommitList(); - if (FAILED(hresult)) - QWinJumpListPrivate::warning("CommitList", hresult); - return SUCCEEDED(hresult); -} - -void QWinJumpListPrivate::appendKnownCategory(KNOWNDESTCATEGORY category) -{ - HRESULT hresult = pDestList->AppendKnownCategory(category); - if (FAILED(hresult)) - QWinJumpListPrivate::warning("AppendKnownCategory", hresult); -} - -void QWinJumpListPrivate::appendCustomCategory(QWinJumpListCategory *category) -{ - IObjectCollection *collection = toComCollection(category->items()); - if (collection) { - wchar_t *title = qt_qstringToNullTerminated(category->title()); - HRESULT hresult = pDestList->AppendCategory(title, collection); - if (FAILED(hresult)) - QWinJumpListPrivate::warning("AppendCategory", hresult); - delete[] title; - collection->Release(); - } -} - -void QWinJumpListPrivate::appendTasks(const QList<QWinJumpListItem *> &items) -{ - IObjectCollection *collection = toComCollection(items); - if (collection) { - HRESULT hresult = pDestList->AddUserTasks(collection); - if (FAILED(hresult)) - QWinJumpListPrivate::warning("AddUserTasks", hresult); - collection->Release(); - } -} - -QList<QWinJumpListItem *> QWinJumpListPrivate::fromComCollection(IObjectArray *array) -{ - QList<QWinJumpListItem *> list; - UINT count = 0; - array->GetCount(&count); - for (UINT i = 0; i < count; ++i) { - IUnknown *collectionItem = nullptr; - HRESULT hresult = array->GetAt(i, qIID_IUnknown, reinterpret_cast<void **>(&collectionItem)); - if (FAILED(hresult)) { - QWinJumpListPrivate::warning("GetAt", hresult); - continue; - } - IShellItem2 *shellItem = nullptr; - IShellLinkW *shellLink = nullptr; - QWinJumpListItem *jumplistItem = nullptr; - if (SUCCEEDED(collectionItem->QueryInterface(qIID_IShellItem2, reinterpret_cast<void **>(&shellItem)))) { - jumplistItem = fromIShellItem(shellItem); - shellItem->Release(); - } else if (SUCCEEDED(collectionItem->QueryInterface(qIID_IShellLinkW, reinterpret_cast<void **>(&shellLink)))) { - jumplistItem = fromIShellLink(shellLink); - shellLink->Release(); - } else { - qWarning("QWinJumpList: object of unexpected class found"); - } - collectionItem->Release(); - if (jumplistItem) - list.append(jumplistItem); - } - return list; -} - -IObjectCollection *QWinJumpListPrivate::toComCollection(const QList<QWinJumpListItem *> &list) -{ - if (list.isEmpty()) - return nullptr; - IObjectCollection *collection = nullptr; - HRESULT hresult = CoCreateInstance(qCLSID_EnumerableObjectCollection, nullptr, CLSCTX_INPROC_SERVER, qIID_IObjectCollection, reinterpret_cast<void **>(&collection)); - if (FAILED(hresult)) { - QWinJumpListPrivate::warning("QWinJumpList: failed to instantiate IObjectCollection", hresult); - return nullptr; - } - for (QWinJumpListItem *item : list) { - IUnknown *iitem = toICustomDestinationListItem(item); - if (iitem) { - collection->AddObject(iitem); - iitem->Release(); - } - } - return collection; -} - -QWinJumpListItem *QWinJumpListPrivate::fromIShellLink(IShellLinkW *link) -{ - auto *item = new QWinJumpListItem(QWinJumpListItem::Link); - - IPropertyStore *linkProps; - link->QueryInterface(qIID_IPropertyStore, reinterpret_cast<void **>(&linkProps)); - PROPVARIANT var; - linkProps->GetValue(qPKEY_Link_Arguments, &var); - item->setArguments(QStringList(QString::fromWCharArray(var.pwszVal))); - PropVariantClear(&var); - linkProps->Release(); - - const int buffersize = 2048; - wchar_t buffer[buffersize]; - - link->GetDescription(buffer, INFOTIPSIZE); - item->setDescription(QString::fromWCharArray(buffer)); - - int dummyindex; - link->GetIconLocation(buffer, buffersize-1, &dummyindex); - item->setIcon(QIcon(QString::fromWCharArray(buffer))); - - link->GetPath(buffer, buffersize-1, 0, 0); - item->setFilePath(QDir::fromNativeSeparators(QString::fromWCharArray(buffer))); - - return item; -} - -QWinJumpListItem *QWinJumpListPrivate::fromIShellItem(IShellItem2 *shellitem) -{ - auto *item = new QWinJumpListItem(QWinJumpListItem::Destination); - wchar_t *strPtr; - shellitem->GetDisplayName(SIGDN_FILESYSPATH, &strPtr); - item->setFilePath(QDir::fromNativeSeparators(QString::fromWCharArray(strPtr))); - CoTaskMemFree(strPtr); - return item; -} - -IUnknown *QWinJumpListPrivate::toICustomDestinationListItem(const QWinJumpListItem *item) -{ - switch (item->type()) { - case QWinJumpListItem::Destination : - return toIShellItem(item); - case QWinJumpListItem::Link : - return toIShellLink(item); - case QWinJumpListItem::Separator : - return makeSeparatorShellItem(); - default: - return nullptr; - } -} - -IShellLinkW *QWinJumpListPrivate::toIShellLink(const QWinJumpListItem *item) -{ - IShellLinkW *link = nullptr; - HRESULT hresult = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, qIID_IShellLinkW, reinterpret_cast<void **>(&link)); - if (FAILED(hresult)) { - QWinJumpListPrivate::warning("QWinJumpList: failed to instantiate IShellLinkW", hresult); - return nullptr; - } - - const QString args = createArguments(item->arguments()); - const int iconPathSize = QWinJumpListPrivate::iconsDirPath().size() - + int(sizeof(void *)) * 2 + 4; // path + ptr-name-in-hex + .ico - const int bufferSize = qMax(args.size(), - qMax(item->workingDirectory().size(), - qMax(item->description().size(), - qMax(item->title().size(), - qMax(item->filePath().size(), iconPathSize))))) + 1; - auto *buffer = new wchar_t[bufferSize]; - - if (!item->description().isEmpty()) { - qt_qstringToNullTerminated(item->description(), buffer); - link->SetDescription(buffer); - } - - qt_qstringToNullTerminated(item->filePath(), buffer); - link->SetPath(buffer); - - if (!item->workingDirectory().isEmpty()) { - qt_qstringToNullTerminated(item->workingDirectory(), buffer); - link->SetWorkingDirectory(buffer); - } - - qt_qstringToNullTerminated(args, buffer); - link->SetArguments(buffer); - - if (!item->icon().isNull()) { - QString iconPath = QWinJumpListPrivate::iconsDirPath() + QString::number(reinterpret_cast<quintptr>(item), 16) + QLatin1String(".ico"); - bool iconSaved = item->icon().pixmap(GetSystemMetrics(SM_CXICON)).save(iconPath, "ico"); - if (iconSaved) { - qt_qstringToNullTerminated(iconPath, buffer); - link->SetIconLocation(buffer, 0); - } - } - - IPropertyStore *properties; - PROPVARIANT titlepv; - hresult = link->QueryInterface(qIID_IPropertyStore, reinterpret_cast<void **>(&properties)); - if (FAILED(hresult)) { - link->Release(); - return nullptr; - } - - qt_qstringToNullTerminated(item->title(), buffer); - InitPropVariantFromString(buffer, &titlepv); - properties->SetValue(qPKEY_Title, titlepv); - properties->Commit(); - properties->Release(); - PropVariantClear(&titlepv); - - delete[] buffer; - return link; -} - -IShellItem2 *QWinJumpListPrivate::toIShellItem(const QWinJumpListItem *item) -{ - IShellItem2 *shellitem = nullptr; - QScopedArrayPointer<wchar_t> buffer(qt_qstringToNullTerminated(item->filePath())); - SHCreateItemFromParsingName(buffer.data(), nullptr, qIID_IShellItem2, reinterpret_cast<void **>(&shellitem)); - return shellitem; -} - -IShellLinkW *QWinJumpListPrivate::makeSeparatorShellItem() -{ - IShellLinkW *separator; - HRESULT res = CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, qIID_IShellLinkW, reinterpret_cast<void **>(&separator)); - if (FAILED(res)) - return nullptr; - - IPropertyStore *properties; - res = separator->QueryInterface(qIID_IPropertyStore, reinterpret_cast<void **>(&properties)); - if (FAILED(res)) { - separator->Release(); - return nullptr; - } - - PROPVARIANT isSeparator; - InitPropVariantFromBoolean(TRUE, &isSeparator); - properties->SetValue(qPKEY_AppUserModel_IsDestListSeparator, isSeparator); - properties->Commit(); - properties->Release(); - PropVariantClear(&isSeparator); - - return separator; -} - -/*! - Constructs a QWinJumpList with the parent object \a parent. - */ -QWinJumpList::QWinJumpList(QObject *parent) : - QObject(parent), d_ptr(new QWinJumpListPrivate) -{ - Q_D(QWinJumpList); - d->q_ptr = this; - HRESULT hresult = CoCreateInstance(qCLSID_DestinationList, nullptr, CLSCTX_INPROC_SERVER, qIID_ICustomDestinationList, reinterpret_cast<void **>(&d_ptr->pDestList)); - if (FAILED(hresult)) - QWinJumpListPrivate::warning("CoCreateInstance", hresult); - d->invalidate(); -} - -/*! - Destroys the QWinJumpList. - */ -QWinJumpList::~QWinJumpList() -{ - Q_D(QWinJumpList); - if (d->dirty) - d->_q_rebuild(); - if (d->pDestList) { - d->pDestList->Release(); - d->pDestList = nullptr; - } - d->destroy(); -} - -/*! - \property QWinJumpList::identifier - \brief the jump list identifier - - Specifies an optional explicit unique identifier for the - application jump list. - - The default value is empty; a system-defined internal identifier - is used instead. See \l {Application User Model IDs} on MSDN for - further details. - - \note The identifier cannot have more than \c 128 characters and - cannot contain spaces. A too long identifier is automatically truncated - to \c 128 characters, and spaces are replaced by underscores. - */ -QString QWinJumpList::identifier() const -{ - Q_D(const QWinJumpList); - return d->identifier; -} - -void QWinJumpList::setIdentifier(const QString &identifier) -{ - Q_D(QWinJumpList); - QString id = identifier; - id.replace(u' ', u'_'); - if (id.size() > 128) - id.truncate(128); - if (d->identifier != id) { - d->identifier = id; - d->invalidate(); - } -} - -/*! - Returns the recent items category in the jump list. - */ -QWinJumpListCategory *QWinJumpList::recent() const -{ - Q_D(const QWinJumpList); - if (!d->recent) { - auto *that = const_cast<QWinJumpList *>(this); - that->d_func()->recent = QWinJumpListCategoryPrivate::create(QWinJumpListCategory::Recent, that); - } - return d->recent; -} - -/*! - Returns the frequent items category in the jump list. - */ -QWinJumpListCategory *QWinJumpList::frequent() const -{ - Q_D(const QWinJumpList); - if (!d->frequent) { - auto *that = const_cast<QWinJumpList *>(this); - that->d_func()->frequent = QWinJumpListCategoryPrivate::create(QWinJumpListCategory::Frequent, that); - } - return d->frequent; -} - -/*! - Returns the tasks category in the jump list. - */ -QWinJumpListCategory *QWinJumpList::tasks() const -{ - Q_D(const QWinJumpList); - if (!d->tasks) { - auto *that = const_cast<QWinJumpList *>(this); - that->d_func()->tasks = QWinJumpListCategoryPrivate::create(QWinJumpListCategory::Tasks, that); - } - return d->tasks; -} - -/*! - Returns the custom categories in the jump list. - */ -QList<QWinJumpListCategory *> QWinJumpList::categories() const -{ - Q_D(const QWinJumpList); - return d->categories; -} - -/*! - Adds a custom \a category to the jump list. - */ -void QWinJumpList::addCategory(QWinJumpListCategory *category) -{ - Q_D(QWinJumpList); - if (!category) - return; - - QWinJumpListCategoryPrivate::get(category)->jumpList = this; - d->categories.append(category); - d->invalidate(); -} - -/*! - \overload addCategory() - Creates a custom category with provided \a title and optional \a items, - and adds it to the jump list. - */ -QWinJumpListCategory *QWinJumpList::addCategory(const QString &title, const QList<QWinJumpListItem *> items) -{ - auto *category = new QWinJumpListCategory(title); - for (QWinJumpListItem *item : items) - category->addItem(item); - addCategory(category); - return category; -} - -/*! - Clears the jump list. - - \sa QWinJumpListCategory::clear() - */ -void QWinJumpList::clear() -{ - Q_D(QWinJumpList); - recent()->clear(); - frequent()->clear(); - if (d->tasks) - d->tasks->clear(); - for (QWinJumpListCategory *category : qAsConst(d->categories)) - category->clear(); - d->destroy(); -} - -#ifndef QT_NO_DEBUG_STREAM - -QDebug operator<<(QDebug debug, const QWinJumpList *jumplist) -{ - QDebugStateSaver saver(debug); - debug.nospace(); - debug.noquote(); - debug << "QWinJumpList("; - if (jumplist) { - debug << "(identifier=\"" << jumplist->identifier() << "\", recent=" - << jumplist->recent() << ", frequent=" << jumplist->frequent() - << ", tasks=" << jumplist->tasks() - << ", categories=" << jumplist->categories(); - } else { - debug << '0'; - } - debug << ')'; - return debug; -} -#endif // !QT_NO_DEBUG_STREAM - -QT_END_NAMESPACE - -#include "moc_qwinjumplist.cpp" diff --git a/src/winextras/qwinjumplist.h b/src/winextras/qwinjumplist.h deleted file mode 100644 index b4807dd..0000000 --- a/src/winextras/qwinjumplist.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINJUMPLIST_H -#define QWINJUMPLIST_H - -#include <QtCore/qobject.h> -#include <QtCore/qstringlist.h> -#include <QtCore/qscopedpointer.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class QWinJumpListItem; -class QWinJumpListPrivate; -class QWinJumpListCategory; - -class Q_WINEXTRAS_EXPORT QWinJumpList : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString identifier READ identifier WRITE setIdentifier) - -public: - explicit QWinJumpList(QObject *parent = nullptr); - ~QWinJumpList(); - - QString identifier() const; - void setIdentifier(const QString &identifier); - - QWinJumpListCategory *recent() const; - QWinJumpListCategory *frequent() const; - QWinJumpListCategory *tasks() const; - - QList<QWinJumpListCategory *> categories() const; - void addCategory(QWinJumpListCategory *category); - QWinJumpListCategory *addCategory(const QString &title, const QList<QWinJumpListItem *> items = QList<QWinJumpListItem *>()); - -public Q_SLOTS: - void clear(); - -private: - Q_DISABLE_COPY(QWinJumpList) - Q_DECLARE_PRIVATE(QWinJumpList) - QScopedPointer<QWinJumpListPrivate> d_ptr; - - Q_PRIVATE_SLOT(d_func(), void _q_rebuild()) -}; - -#ifndef QT_NO_DEBUG_STREAM -Q_WINEXTRAS_EXPORT QDebug operator<<(QDebug, const QWinJumpList *); -#endif - -QT_END_NAMESPACE - -#endif // QWINJUMPLIST_H diff --git a/src/winextras/qwinjumplist_p.h b/src/winextras/qwinjumplist_p.h deleted file mode 100644 index ff54f96..0000000 --- a/src/winextras/qwinjumplist_p.h +++ /dev/null @@ -1,105 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINJUMPLIST_P_H -#define QWINJUMPLIST_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qwinjumplist.h" -#include "winshobjidl_p.h" - -QT_BEGIN_NAMESPACE - -class QWinJumpListPrivate -{ - Q_DECLARE_PUBLIC(QWinJumpList) - -public: - static QWinJumpListPrivate *get(QWinJumpList *list) - { - return list->d_func(); - } - - static void warning(const char *function, HRESULT hresult); - static QString iconsDirPath(); - - void invalidate(); - void _q_rebuild(); - void destroy(); - - bool beginList(); - bool commitList(); - - void appendKnownCategory(KNOWNDESTCATEGORY category); - void appendCustomCategory(QWinJumpListCategory *category); - void appendTasks(const QList<QWinJumpListItem *> &items); - - static QList<QWinJumpListItem *> fromComCollection(IObjectArray *array); - static IObjectCollection *toComCollection(const QList<QWinJumpListItem *> &list); - static QWinJumpListItem *fromIShellLink(IShellLinkW *link); - static QWinJumpListItem *fromIShellItem(IShellItem2 *shellitem); - static IUnknown *toICustomDestinationListItem(const QWinJumpListItem *item); - static IShellLinkW *toIShellLink(const QWinJumpListItem *item); - static IShellItem2 *toIShellItem(const QWinJumpListItem *item); - static IShellLinkW *makeSeparatorShellItem(); - - QWinJumpList *q_ptr = nullptr; - ICustomDestinationList *pDestList = nullptr; - QWinJumpListCategory *recent = nullptr; - QWinJumpListCategory *frequent = nullptr; - QWinJumpListCategory *tasks = nullptr; - QList<QWinJumpListCategory *> categories; - QString identifier; - bool dirty = false; -}; - -QT_END_NAMESPACE - -#endif // QWINJUMPLIST_P_H diff --git a/src/winextras/qwinjumplistcategory.cpp b/src/winextras/qwinjumplistcategory.cpp deleted file mode 100644 index a29c37e..0000000 --- a/src/winextras/qwinjumplistcategory.cpp +++ /dev/null @@ -1,380 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include <QtCore/qglobal.h> - -#ifdef Q_CC_MINGW // MinGW: Include the correct definition of SHARDAPPIDINFOLINK -# if defined(NTDDI_VERSION) && NTDDI_VERSION < 0x06010000 -# undef NTDDI_VERSION -# endif -# ifndef NTDDI_VERSION -# define NTDDI_VERSION 0x06010000 -# endif -#endif // Q_CC_MINGW - -#include "qwinjumplistcategory.h" -#include "qwinjumplistcategory_p.h" -#include "qwinjumplistitem_p.h" -#include "qwinfunctions_p.h" -#include "qwinjumplist_p.h" -#include "winshobjidl_p.h" -#include "windowsguidsdefs_p.h" - -#include <QtCore/qdebug.h> - -#include <shlobj.h> - -QT_BEGIN_NAMESPACE - -/*! - \class QWinJumpListCategory - \inmodule QtWinExtras - \since 5.2 - \brief The QWinJumpListCategory class represents a jump list category. - */ - -/*! - \enum QWinJumpListCategory::Type - - This enum describes the available QWinJumpListCategory types. - - \value Custom - A custom jump list category. - \value Recent - A jump list category of "recent" items. - \value Frequent - A jump list category of "frequent" items. - \value Tasks - A jump list category of tasks. - */ - -QWinJumpListCategory *QWinJumpListCategoryPrivate::create(QWinJumpListCategory::Type type, QWinJumpList *jumpList) -{ - QWinJumpListCategory *category = new QWinJumpListCategory; - category->d_func()->type = type; - category->d_func()->jumpList = jumpList; - if (type == QWinJumpListCategory::Recent || type == QWinJumpListCategory::Frequent) - category->d_func()->loadRecents(); - return category; -} - -void QWinJumpListCategoryPrivate::invalidate() -{ - if (jumpList) - QWinJumpListPrivate::get(jumpList)->invalidate(); -} - -void QWinJumpListCategoryPrivate::loadRecents() -{ - Q_ASSERT(jumpList); - IApplicationDocumentLists *pDocList = nullptr; - HRESULT hresult = CoCreateInstance(qCLSID_ApplicationDocumentLists, nullptr, CLSCTX_INPROC_SERVER, qIID_IApplicationDocumentLists, reinterpret_cast<void **>(&pDocList)); - if (SUCCEEDED(hresult)) { - if (!jumpList->identifier().isEmpty()) { - wchar_t *id = qt_qstringToNullTerminated(jumpList->identifier()); - hresult = pDocList->SetAppID(id); - delete[] id; - } - if (SUCCEEDED(hresult)) { - IObjectArray *array = nullptr; - hresult = pDocList->GetList(type == QWinJumpListCategory::Recent ? ADLT_RECENT : ADLT_FREQUENT, - 0, qIID_IObjectArray, reinterpret_cast<void **>(&array)); - if (SUCCEEDED(hresult)) { - items = QWinJumpListPrivate::fromComCollection(array); - array->Release(); - } - } - pDocList->Release(); - } - if (FAILED(hresult)) - QWinJumpListPrivate::warning("loadRecents", hresult); -} - -void QWinJumpListCategoryPrivate::addRecent(QWinJumpListItem *item) -{ - Q_ASSERT(item->type() == QWinJumpListItem::Link); - wchar_t *id = nullptr; - if (jumpList && !jumpList->identifier().isEmpty()) - id = qt_qstringToNullTerminated(jumpList->identifier()); - - SHARDAPPIDINFOLINK info; - info.pszAppID = id; - info.psl = QWinJumpListPrivate::toIShellLink(item); - if (info.psl) { - SHAddToRecentDocs(SHARD_APPIDINFOLINK, &info); - info.psl->Release(); - } - delete[] id; -} - -void QWinJumpListCategoryPrivate::clearRecents() -{ - IApplicationDestinations *pDest = nullptr; - HRESULT hresult = CoCreateInstance(qCLSID_ApplicationDestinations, nullptr, CLSCTX_INPROC_SERVER, qIID_IApplicationDestinations, reinterpret_cast<void **>(&pDest)); - if (SUCCEEDED(hresult)) { - const QString identifier = jumpList ? jumpList->identifier() : QString(); - if (!identifier.isEmpty()) { - wchar_t *id = qt_qstringToNullTerminated(identifier); - hresult = pDest->SetAppID(id); - delete[] id; - } - hresult = pDest->RemoveAllDestinations(); - pDest->Release(); - } - if (FAILED(hresult)) - QWinJumpListPrivate::warning("clearRecents", hresult); -} - -/*! - Constructs a custom QWinJumpListCategory with the specified \a title. - */ -QWinJumpListCategory::QWinJumpListCategory(const QString &title) : - d_ptr(new QWinJumpListCategoryPrivate) -{ - d_ptr->title = title; -} - -/*! - Destroys the QWinJumpListCategory. - */ -QWinJumpListCategory::~QWinJumpListCategory() -{ - Q_D(QWinJumpListCategory); - qDeleteAll(d->items); - d->items.clear(); -} - -/*! - Returns the category type. - */ -QWinJumpListCategory::Type QWinJumpListCategory::type() const -{ - Q_D(const QWinJumpListCategory); - return d->type; -} - -/*! - Returns whether the category is visible. - */ -bool QWinJumpListCategory::isVisible() const -{ - Q_D(const QWinJumpListCategory); - return d->visible; -} - -/*! - Sets the category \a visible. - */ -void QWinJumpListCategory::setVisible(bool visible) -{ - Q_D(QWinJumpListCategory); - if (d->visible != visible) { - d->visible = visible; - d->invalidate(); - } -} - -/*! - Returns the category title. - */ -QString QWinJumpListCategory::title() const -{ - Q_D(const QWinJumpListCategory); - return d->title; -} - -/*! - Sets the category \a title. - */ -void QWinJumpListCategory::setTitle(const QString &title) -{ - Q_D(QWinJumpListCategory); - if (d->title != title) { - d->title = title; - d->invalidate(); - } -} - -/*! - Returns the amount of items in the category. - */ -int QWinJumpListCategory::count() const -{ - Q_D(const QWinJumpListCategory); - return d->items.count(); -} - -/*! - Returns whether the category is empty. - */ -bool QWinJumpListCategory::isEmpty() const -{ - Q_D(const QWinJumpListCategory); - return d->items.isEmpty(); -} - -/*! - Returns the list of items in the category. - */ -QList<QWinJumpListItem *> QWinJumpListCategory::items() const -{ - Q_D(const QWinJumpListCategory); - return d->items; -} - -/*! - Adds an \a item to the category. - */ -void QWinJumpListCategory::addItem(QWinJumpListItem *item) -{ - Q_D(QWinJumpListCategory); - if (!item) - return; - - if (d->type == Recent || d->type == Frequent) { - if (item->type() == QWinJumpListItem::Separator) { - qWarning("QWinJumpListCategory::addItem(): only tasks/custom categories support separators."); - return; - } - if (item->type() == QWinJumpListItem::Destination) { - qWarning("QWinJumpListCategory::addItem(): only tasks/custom categories support destinations."); - return; - } - } - - QWinJumpListItemPrivate *p = QWinJumpListItemPrivate::get(item); - if (p->category != this) { - p->category = this; - d->items.append(item); - if (d->type == QWinJumpListCategory::Recent || d->type == QWinJumpListCategory::Frequent) - d->addRecent(item); - d->invalidate(); - } -} - -/*! - Adds a destination to the category pointing to \a filePath. - */ -QWinJumpListItem *QWinJumpListCategory::addDestination(const QString &filePath) -{ - auto *item = new QWinJumpListItem(QWinJumpListItem::Destination); - item->setFilePath(filePath); - addItem(item); - return item; -} - -/*! - Adds a link to the category using \a title, \a executablePath, and - optionally \a arguments. - */ -QWinJumpListItem *QWinJumpListCategory::addLink(const QString &title, const QString &executablePath, const QStringList &arguments) -{ - return addLink(QIcon(), title, executablePath, arguments); -} - -/*! - \overload addLink() - - Adds a link to the category using \a icon, \a title, \a executablePath, - and optionally \a arguments. - */ -QWinJumpListItem *QWinJumpListCategory::addLink(const QIcon &icon, const QString &title, const QString &executablePath, const QStringList &arguments) -{ - auto *item = new QWinJumpListItem(QWinJumpListItem::Link); - item->setFilePath(executablePath); - item->setTitle(title); - item->setArguments(arguments); - item->setIcon(icon); - addItem(item); - return item; -} - -/*! - Adds a separator to the category. - - \note Only tasks category supports separators. - */ -QWinJumpListItem *QWinJumpListCategory::addSeparator() -{ - auto *item = new QWinJumpListItem(QWinJumpListItem::Separator); - addItem(item); - return item; -} - -/*! - Clears the category. - */ -void QWinJumpListCategory::clear() -{ - Q_D(QWinJumpListCategory); - if (!d->items.isEmpty()) { - qDeleteAll(d->items); - d->items.clear(); - if (d->type == QWinJumpListCategory::Recent || d->type == QWinJumpListCategory::Frequent) - d->clearRecents(); - d->invalidate(); - } -} - -#ifndef QT_NO_DEBUG_STREAM - -QDebug operator<<(QDebug debug, const QWinJumpListCategory *category) -{ - QDebugStateSaver saver(debug); - debug.nospace(); - debug.noquote(); - debug << "QWinJumpListCategory("; - if (category) { - debug << "type=" << category->type() << ", isVisible=" - << category->isVisible() << ", title=\"" << category->title() - << "\", items=" << category->items(); - } else { - debug << '0'; - } - debug << ')'; - return debug; - - - return debug; -} - -#endif // !QT_NO_DEBUG_STREAM - -QT_END_NAMESPACE diff --git a/src/winextras/qwinjumplistcategory.h b/src/winextras/qwinjumplistcategory.h deleted file mode 100644 index d063cc2..0000000 --- a/src/winextras/qwinjumplistcategory.h +++ /dev/null @@ -1,99 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINJUMPLISTCATEGORY_H -#define QWINJUMPLISTCATEGORY_H - -#include <QtGui/qicon.h> -#include <QtCore/qstring.h> -#include <QtCore/qstringlist.h> -#include <QtCore/qscopedpointer.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class QWinJumpListItem; -class QWinJumpListCategoryPrivate; - -class Q_WINEXTRAS_EXPORT QWinJumpListCategory -{ -public: - enum Type { - Custom, - Recent, - Frequent, - Tasks - }; - explicit QWinJumpListCategory(const QString &title = QString()); - ~QWinJumpListCategory(); - - Type type() const; - - bool isVisible() const; - void setVisible(bool visible); - - QString title() const; - void setTitle(const QString &title); - - int count() const; - bool isEmpty() const; - QList<QWinJumpListItem *> items() const; - - void addItem(QWinJumpListItem *item); - QWinJumpListItem *addDestination(const QString &filePath); - QWinJumpListItem *addLink(const QString &title, const QString &executablePath, const QStringList &arguments = QStringList()); - QWinJumpListItem *addLink(const QIcon &icon, const QString &title, const QString &executablePath, const QStringList &arguments = QStringList()); - QWinJumpListItem *addSeparator(); - - void clear(); - -private: - Q_DISABLE_COPY(QWinJumpListCategory) - Q_DECLARE_PRIVATE(QWinJumpListCategory) - QScopedPointer<QWinJumpListCategoryPrivate> d_ptr; -}; - -#ifndef QT_NO_DEBUG_STREAM -Q_WINEXTRAS_EXPORT QDebug operator<<(QDebug d, const QWinJumpListCategory *); -#endif - -QT_END_NAMESPACE - -#endif // QWINJUMPLISTCATEGORY_H diff --git a/src/winextras/qwinjumplistcategory_p.h b/src/winextras/qwinjumplistcategory_p.h deleted file mode 100644 index eee17b4..0000000 --- a/src/winextras/qwinjumplistcategory_p.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINJUMPLISTCATEGORY_P_H -#define QWINJUMPLISTCATEGORY_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qwinjumplistcategory.h" - -QT_BEGIN_NAMESPACE - -class QWinJumpList; - -class QWinJumpListCategoryPrivate -{ -public: - static QWinJumpListCategoryPrivate *get(QWinJumpListCategory *category) - { - return category->d_func(); - } - - static QWinJumpListCategory *create(QWinJumpListCategory::Type type, QWinJumpList *jumpList); - - void invalidate(); - void loadRecents(); - void addRecent(QWinJumpListItem *item); - void clearRecents(); - - bool visible = false; - QString title; - QWinJumpList *jumpList = nullptr; - QWinJumpListCategory::Type type = QWinJumpListCategory::Custom; - QList<QWinJumpListItem *> items; -}; - -QT_END_NAMESPACE - -#endif // QWINJUMPLISTCATEGORY_P_H diff --git a/src/winextras/qwinjumplistitem.cpp b/src/winextras/qwinjumplistitem.cpp deleted file mode 100644 index ee117bc..0000000 --- a/src/winextras/qwinjumplistitem.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qwinjumplistitem.h" -#include "qwinjumplistitem_p.h" -#include "qwinjumplistcategory_p.h" - -#include <QtCore/qdebug.h> -#include <QtCore/qdir.h> - -QT_BEGIN_NAMESPACE - -/*! - \class QWinJumpListItem - \inmodule QtWinExtras - \since 5.2 - \brief The QWinJumpListItem class represents a jump list item. - */ - -/*! - \enum QWinJumpListItem::Type - - This enum describes the available QWinJumpListItem types. - - \value Destination - Item acts as a link to a file that the application can open. - \value Link - Item represents a link to an application. - \value Separator - Item is a separator. Only tasks category supports separators. - */ - -void QWinJumpListItemPrivate::invalidate() -{ - if (category) - QWinJumpListCategoryPrivate::get(category)->invalidate(); -} - -/*! - Constructs a QWinJumpListItem with the specified \a type. - */ -QWinJumpListItem::QWinJumpListItem(QWinJumpListItem::Type type) : - d_ptr(new QWinJumpListItemPrivate) -{ - d_ptr->type = type; - d_ptr->category = nullptr; -} - -/*! - Destroys the QWinJumpListItem. - */ -QWinJumpListItem::~QWinJumpListItem() = default; - -/*! - Sets the item \a type. - */ -void QWinJumpListItem::setType(QWinJumpListItem::Type type) -{ - Q_D(QWinJumpListItem); - if (d->type != type) { - d->type = type; - d->invalidate(); - } -} - -/*! - Returns the item type. - */ -QWinJumpListItem::Type QWinJumpListItem::type() const -{ - Q_D(const QWinJumpListItem); - return d->type; -} - -/*! - Sets the item \a filePath, the meaning of which depends on the type of this - item: - - \list - - \li If the item type is QWinJumpListItem::Destination, \a filePath is the - path to a file that can be opened by an application. - - \li If the item type is QWinJumpListItem::Link, \a filePath is the path to - an executable that is executed when this item is clicked by the - user. - - \endlist - - \sa setWorkingDirectory(), setArguments() - */ -void QWinJumpListItem::setFilePath(const QString &filePath) -{ - Q_D(QWinJumpListItem); - if (d->filePath != filePath) { - d->filePath = filePath; - d->invalidate(); - } -} - -/*! - Returns the file path set by setFilePath(). - */ -QString QWinJumpListItem::filePath() const -{ - Q_D(const QWinJumpListItem); - return d->filePath; -} - -/*! - Sets the path to the working directory of this item to \a workingDirectory. - - This value is used only if the type of this item is QWinJumpListItem::Link. - - \sa setFilePath() - */ -void QWinJumpListItem::setWorkingDirectory(const QString &workingDirectory) -{ - Q_D(QWinJumpListItem); - if (d->workingDirectory != workingDirectory) { - d->workingDirectory = workingDirectory; - d->invalidate(); - } -} - -/*! - Returns the working directory path. - */ -QString QWinJumpListItem::workingDirectory() const -{ - Q_D(const QWinJumpListItem); - return d->workingDirectory; -} - -/*! - Sets the \a icon of this item. - - This value is used only if the type of this item is QWinJumpListItem::Link. - */ -void QWinJumpListItem::setIcon(const QIcon &icon) -{ - Q_D(QWinJumpListItem); - if (d->icon.cacheKey() != icon.cacheKey()) { - d->icon = icon; - d->invalidate(); - } -} - -/*! - Returns the icon set for this item. - */ -QIcon QWinJumpListItem::icon() const -{ - Q_D(const QWinJumpListItem); - return d->icon; -} - -/*! - Sets the \a title of this item. - - This value is used only if the type of this item is QWinJumpListItem::Link. - */ -void QWinJumpListItem::setTitle(const QString &title) -{ - Q_D(QWinJumpListItem); - if (d->title != title) { - d->title = title; - d->invalidate(); - } -} - -/*! - Returns the title of this item. - */ -QString QWinJumpListItem::title() const -{ - Q_D(const QWinJumpListItem); - return d->title; -} - -/*! - Sets a \a description for this item. - - This value is used only if the type of this item is QWinJumpListItem::Link. - */ -void QWinJumpListItem::setDescription(const QString &description) -{ - Q_D(QWinJumpListItem); - if (d->description != description) { - d->description = description; - d->invalidate(); - } -} - -/*! - Returns the description of this item. - */ -QString QWinJumpListItem::description() const -{ - Q_D(const QWinJumpListItem); - return d->description; -} - -/*! - Sets command-line \a arguments for this item. - - This value is used only if the type of this item is QWinJumpListItem::Link. - - \sa setFilePath() - */ -void QWinJumpListItem::setArguments(const QStringList &arguments) -{ - Q_D(QWinJumpListItem); - if (d->arguments != arguments) { - d->arguments = arguments; - d->invalidate(); - } -} - -/*! - Returns the command-line arguments of this item. - */ -QStringList QWinJumpListItem::arguments() const -{ - Q_D(const QWinJumpListItem); - return d->arguments; -} - -#ifndef QT_NO_DEBUG_STREAM - -QDebug operator<<(QDebug debug, const QWinJumpListItem *item) -{ - QDebugStateSaver saver(debug); - debug.nospace(); - debug.noquote(); - debug << "QWinJumpListItem("; - if (item) { - debug << "type=" << item->type() << ", title=\"" << item->title() - << "\", description=\"" << item->description() - << "\", filePath=\"" << QDir::toNativeSeparators(item->filePath()) - << "\", arguments="; - debug.quote(); - debug << item->arguments(); - debug.noquote(); - debug << ", workingDirectory=\"" << QDir::toNativeSeparators(item->workingDirectory()) - << "\", icon=" << item->icon(); - } else { - debug << '0'; - } - debug << ')'; - return debug; -} - -#endif // !QT_NO_DEBUG_STREAM - -QT_END_NAMESPACE diff --git a/src/winextras/qwinjumplistitem.h b/src/winextras/qwinjumplistitem.h deleted file mode 100644 index 391546f..0000000 --- a/src/winextras/qwinjumplistitem.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINJUMPLISTITEM_H -#define QWINJUMPLISTITEM_H - -#include <QtGui/qicon.h> -#include <QtCore/qobject.h> -#include <QtCore/qstringlist.h> -#include <QtCore/qscopedpointer.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class QWinJumpListItemPrivate; - -class Q_WINEXTRAS_EXPORT QWinJumpListItem -{ -public: - enum Type { - Destination, - Link, - Separator - }; - - explicit QWinJumpListItem(Type type); - ~QWinJumpListItem(); - - void setType(Type type); - Type type() const; - void setFilePath(const QString &filePath); - QString filePath() const; - void setWorkingDirectory(const QString &workingDirectory); - QString workingDirectory() const; - void setIcon(const QIcon &icon); - QIcon icon() const; - void setTitle(const QString &title); - QString title() const; - void setDescription(const QString &description); - QString description() const; - void setArguments(const QStringList &arguments); - QStringList arguments() const; - -private: - Q_DISABLE_COPY(QWinJumpListItem) - Q_DECLARE_PRIVATE(QWinJumpListItem) - QScopedPointer<QWinJumpListItemPrivate> d_ptr; -}; - -#ifndef QT_NO_DEBUG_STREAM -Q_WINEXTRAS_EXPORT QDebug operator<<(QDebug, const QWinJumpListItem *); -#endif - -QT_END_NAMESPACE - -#endif // QWINJUMPLISTITEM_H diff --git a/src/winextras/qwinjumplistitem_p.h b/src/winextras/qwinjumplistitem_p.h deleted file mode 100644 index 3857ea7..0000000 --- a/src/winextras/qwinjumplistitem_p.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINJUMPLISTITEM_P_H -#define QWINJUMPLISTITEM_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qwinjumplistitem.h" - -QT_BEGIN_NAMESPACE - -class QWinJumpListCategory; - -class QWinJumpListItemPrivate -{ -public: - static QWinJumpListItemPrivate *get(QWinJumpListItem *item) - { - return item->d_func(); - } - - void invalidate(); - - QString filePath; - QString workingDirectory; - QString title; - QString description; - QIcon icon; - QStringList arguments; - QWinJumpListItem::Type type = QWinJumpListItem::Destination; - QWinJumpListCategory *category = nullptr; -}; - -QT_END_NAMESPACE - -#endif // QWINJUMPLISTITEM_P_H diff --git a/src/winextras/qwintaskbarbutton.cpp b/src/winextras/qwintaskbarbutton.cpp deleted file mode 100644 index 9df4c30..0000000 --- a/src/winextras/qwintaskbarbutton.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qwintaskbarbutton.h" -#include "qwintaskbarbutton_p.h" -#include "qwintaskbarprogress.h" -#include "qwinfunctions.h" -#include "qwinfunctions_p.h" -#include "qwineventfilter_p.h" -#include "qwinevent.h" -#include "winshobjidl_p.h" -#include "windowsguidsdefs_p.h" - -#include <QtGui/qwindow.h> -#include <QtGui/qicon.h> -#include <QtCore/qpair.h> -#include <dwmapi.h> -#include <shobjidl.h> - -QT_BEGIN_NAMESPACE - -/*! - \class QWinTaskbarButton - \inmodule QtWinExtras - \brief The QWinTaskbarButton class represents the Windows taskbar button for - a top-level window (Windows 7 and newer). - - \since 5.2 - - The QWinTaskbarButton class enables you to set overlay icons on a taskbar - button, and provides access to its progress indicator. - - An overlay icon indicates change in the state of an application, whereas - a progress indicator shows how time-consuming tasks are progressing. - - \image taskbar-button.png Taskbar Button - - The following example code illustrates how to use the QWinTaskbarButton - and QWinTaskbarProgress classes to adjust the look of the taskbar button: - - \snippet code/taskbar.cpp taskbar_cpp - - \note QWidget::windowHandle() returns a valid instance of a QWindow only - after the widget has been shown. It is therefore recommended to delay the - initialization of the QWinTaskbarButton instances until QWidget::showEvent(). - - \note The class wraps API only available since Windows 7. Instantiating it - on Windows XP or Windows Vista causes a runtime warning. - - \sa QWinTaskbarProgress - */ - -static TBPFLAG nativeProgressState(QWinTaskbarProgress *progress) -{ - if (!progress || !progress->isVisible()) - return TBPF_NOPROGRESS; - if (progress->isStopped()) - return TBPF_ERROR; - if (progress->isPaused()) - return TBPF_PAUSED; - if (progress->minimum() == 0 && progress->maximum() == 0) - return TBPF_INDETERMINATE; - return TBPF_NORMAL; -} - -QWinTaskbarButtonPrivate::QWinTaskbarButtonPrivate() -{ - HRESULT hresult = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, qIID_ITaskbarList4, reinterpret_cast<void **>(&pTbList)); - if (FAILED(hresult)) { - pTbList = nullptr; - const QString err = QtWin::errorStringFromHresult(hresult); - qWarning("QWinTaskbarButton: qIID_ITaskbarList4 was not created: %#010x, %s.", unsigned(hresult), qPrintable(err)); - } else if (FAILED(pTbList->HrInit())) { - pTbList->Release(); - pTbList = nullptr; - const QString err = QtWin::errorStringFromHresult(hresult); - qWarning("QWinTaskbarButton: qIID_ITaskbarList4 was not initialized: %#010x, %s.", unsigned(hresult), qPrintable(err)); - } -} - -QWinTaskbarButtonPrivate::~QWinTaskbarButtonPrivate() -{ - if (pTbList) - pTbList->Release(); -} - -HWND QWinTaskbarButtonPrivate::handle() -{ - return reinterpret_cast<HWND>(window->winId()); -} - -int QWinTaskbarButtonPrivate::iconSize() const -{ - return GetSystemMetrics(SM_CXSMICON); -} - -void QWinTaskbarButtonPrivate::updateOverlayIcon() -{ - if (!pTbList || !window) - return; - - wchar_t *descrPtr = nullptr; - HICON hicon = nullptr; - if (!overlayAccessibleDescription.isEmpty()) - descrPtr = qt_qstringToNullTerminated(overlayAccessibleDescription); - if (!overlayIcon.isNull()) - hicon = QtWin::toHICON(overlayIcon.pixmap(iconSize())); - - if (hicon) - pTbList->SetOverlayIcon(handle(), hicon, descrPtr); - else if (!hicon && !overlayIcon.isNull()) - pTbList->SetOverlayIcon(handle(), static_cast<HICON>(LoadImage(nullptr, IDI_APPLICATION, IMAGE_ICON, SM_CXSMICON, SM_CYSMICON, LR_SHARED)), descrPtr); - else - pTbList->SetOverlayIcon(handle(), nullptr, descrPtr); - - if (hicon) - DestroyIcon(hicon); - delete[] descrPtr; -} - -void QWinTaskbarButtonPrivate::_q_updateProgress() -{ - if (!pTbList || !window) - return; - - if (progressBar) { - const int min = progressBar->minimum(); - const int max = progressBar->maximum(); - const int range = max - min; - if (range > 0) { - const int value = qRound(double(100) * (double(progressBar->value() - min)) / double(range)); - pTbList->SetProgressValue(handle(), ULONGLONG(value), 100); - } - } - pTbList->SetProgressState(handle(), nativeProgressState(progressBar)); -} - -/*! - Constructs a QWinTaskbarButton with the specified \a parent. - - If \a parent is an instance of QWindow, it is automatically - assigned as the taskbar button's \l window. - */ -QWinTaskbarButton::QWinTaskbarButton(QObject *parent) : - QObject(parent), d_ptr(new QWinTaskbarButtonPrivate) -{ - QWinEventFilter::setup(); - setWindow(qobject_cast<QWindow *>(parent)); -} - -/*! - Destroys the QWinTaskbarButton. - */ -QWinTaskbarButton::~QWinTaskbarButton() = default; - -/*! - \property QWinTaskbarButton::window - \brief the window whose taskbar button is manipulated - */ -void QWinTaskbarButton::setWindow(QWindow *window) -{ - Q_D(QWinTaskbarButton); - if (d->window) - d->window->removeEventFilter(this); - d->window = window; - if (d->window) { - d->window->installEventFilter(this); - if (d->window->isVisible()) { - d->_q_updateProgress(); - d->updateOverlayIcon(); - } - } -} - -QWindow *QWinTaskbarButton::window() const -{ - Q_D(const QWinTaskbarButton); - return d->window; -} - -/*! - \property QWinTaskbarButton::overlayIcon - \brief the overlay icon of the taskbar button - */ -QIcon QWinTaskbarButton::overlayIcon() const -{ - Q_D(const QWinTaskbarButton); - return d->overlayIcon; -} - -void QWinTaskbarButton::setOverlayIcon(const QIcon &icon) -{ - Q_D(QWinTaskbarButton); - - d->overlayIcon = icon; - d->updateOverlayIcon(); -} - -void QWinTaskbarButton::clearOverlayIcon() -{ - setOverlayAccessibleDescription(QString()); - setOverlayIcon(QIcon()); -} - -/*! - \property QWinTaskbarButton::overlayAccessibleDescription - \brief the description of the overlay for accessibility purposes - - \sa overlayIcon - */ -QString QWinTaskbarButton::overlayAccessibleDescription() const -{ - Q_D(const QWinTaskbarButton); - return d->overlayAccessibleDescription; -} - -void QWinTaskbarButton::setOverlayAccessibleDescription(const QString &description) -{ - Q_D(QWinTaskbarButton); - - d->overlayAccessibleDescription = description; - d->updateOverlayIcon(); -} - -/*! - \property QWinTaskbarButton::progress - \brief the progress indicator of the taskbar button - - \note The progress indicator is not \l{QWinTaskbarProgress::visible}{visible} by default. - */ -QWinTaskbarProgress *QWinTaskbarButton::progress() const -{ - Q_D(const QWinTaskbarButton); - if (!d->progressBar) { - auto *that = const_cast<QWinTaskbarButton *>(this); - auto *pbar = new QWinTaskbarProgress(that); - connect(pbar, SIGNAL(destroyed()), this, SLOT(_q_updateProgress())); - connect(pbar, SIGNAL(valueChanged(int)), this, SLOT(_q_updateProgress())); - connect(pbar, SIGNAL(minimumChanged(int)), this, SLOT(_q_updateProgress())); - connect(pbar, SIGNAL(maximumChanged(int)), this, SLOT(_q_updateProgress())); - connect(pbar, SIGNAL(visibilityChanged(bool)), this, SLOT(_q_updateProgress())); - connect(pbar, SIGNAL(pausedChanged(bool)), this, SLOT(_q_updateProgress())); - connect(pbar, SIGNAL(stoppedChanged(bool)), this, SLOT(_q_updateProgress())); - that->d_func()->progressBar = pbar; - that->d_func()->_q_updateProgress(); - } - return d->progressBar; -} - -/*! - \internal - Intercepts TaskbarButtonCreated messages. - */ -bool QWinTaskbarButton::eventFilter(QObject *object, QEvent *event) -{ - Q_D(QWinTaskbarButton); - if (object == d->window && event->type() == QWinEvent::TaskbarButtonCreated) { - d->_q_updateProgress(); - d->updateOverlayIcon(); - } - return false; -} - -QT_END_NAMESPACE - -#include "moc_qwintaskbarbutton.cpp" diff --git a/src/winextras/qwintaskbarbutton.h b/src/winextras/qwintaskbarbutton.h deleted file mode 100644 index 627beee..0000000 --- a/src/winextras/qwintaskbarbutton.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINTASKBARBUTTON_H -#define QWINTASKBARBUTTON_H - -#include <QtGui/qicon.h> -#include <QtCore/qobject.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class QWindow; -class QWinTaskbarProgress; -class QWinTaskbarButtonPrivate; - -class Q_WINEXTRAS_EXPORT QWinTaskbarButton : public QObject -{ - Q_OBJECT - Q_PROPERTY(QIcon overlayIcon READ overlayIcon WRITE setOverlayIcon RESET clearOverlayIcon) - Q_PROPERTY(QString overlayAccessibleDescription READ overlayAccessibleDescription WRITE setOverlayAccessibleDescription) - Q_PROPERTY(QWinTaskbarProgress *progress READ progress) - Q_PROPERTY(QWindow *window READ window WRITE setWindow) - -public: - explicit QWinTaskbarButton(QObject *parent = nullptr); - ~QWinTaskbarButton(); - - void setWindow(QWindow *window); - QWindow *window() const; - - QIcon overlayIcon() const; - QString overlayAccessibleDescription() const; - - QWinTaskbarProgress *progress() const; - - bool eventFilter(QObject *, QEvent *) override; - -public Q_SLOTS: - void setOverlayIcon(const QIcon &icon); - void setOverlayAccessibleDescription(const QString &description); - - void clearOverlayIcon(); - -private: - Q_DISABLE_COPY(QWinTaskbarButton) - Q_DECLARE_PRIVATE(QWinTaskbarButton) - QScopedPointer<QWinTaskbarButtonPrivate> d_ptr; - - Q_PRIVATE_SLOT(d_func(), void _q_updateProgress()) -}; - -QT_END_NAMESPACE - -#endif // QWINTASKBARBUTTON_H diff --git a/src/winextras/qwintaskbarbutton_p.h b/src/winextras/qwintaskbarbutton_p.h deleted file mode 100644 index e5445b2..0000000 --- a/src/winextras/qwintaskbarbutton_p.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINTASKBARBUTTON_P_H -#define QWINTASKBARBUTTON_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qwintaskbarbutton.h" - -#include <QtGui/qwindow.h> -#include <QtCore/qpointer.h> -#include <QtCore/qt_windows.h> - -struct ITaskbarList4; - -QT_BEGIN_NAMESPACE - -class QWinTaskbarProgress; - -class QWinTaskbarButtonPrivate -{ -public: - QWinTaskbarButtonPrivate(); - ~QWinTaskbarButtonPrivate(); - - QPointer<QWinTaskbarProgress> progressBar; - QIcon overlayIcon; - QString overlayAccessibleDescription; - - HWND handle(); - int iconSize() const; - - void updateOverlayIcon(); - - void _q_updateProgress(); - - ITaskbarList4 *pTbList = nullptr; - QWindow *window = nullptr; -}; - -QT_END_NAMESPACE - -#endif // QWINTASKBARBUTTON_P_H diff --git a/src/winextras/qwintaskbarprogress.cpp b/src/winextras/qwintaskbarprogress.cpp deleted file mode 100644 index de77a40..0000000 --- a/src/winextras/qwintaskbarprogress.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qwintaskbarprogress.h" - -QT_BEGIN_NAMESPACE - -/*! - \class QWinTaskbarProgress - \inmodule QtWinExtras - \brief The QWinTaskbarProgress class represents a progress indicator in the Windows taskbar. - - \since 5.2 - - A progress indicator is used to give the user an indication of the progress - of an operation and to reassure them that the application is still running. - - The progress indicator uses the concept of \e steps. It is set up by specifying - the minimum and maximum possible step values, and it will display the percentage - of steps that have been completed when you later give it the current step value. - The percentage is calculated by dividing the progress (value() - minimum()) - divided by maximum() - minimum(). - - The minimum and maximum number of steps can be specified by calling setMinimum() - and setMaximum(). The current number of steps is set with setValue(). The progress - indicator can be rewound to the beginning with reset(). - - If minimum and maximum both are set to \c 0, the indicator shows up as a busy - (indeterminate) indicator instead of a percentage of steps. This is useful when - it is not possible to determine the number of steps. - - \table - \row \li \inlineimage taskbar-progress.png Screenshot of a progress indicator - \li A progress indicator at 50%. - \row \li \inlineimage taskbar-progress-paused.png Screenshot of a paused progress indicator - \li A paused progress indicator at 50%. - \row \li \inlineimage taskbar-progress-stopped.png Screenshot of a stopped progress indicator - \li A stopped progress indicator at 50%. - \row \li \inlineimage taskbar-progress-indeterminate.png Screenshot of an indeterminate progress indicator - \li An indeterminate progress indicator. - \endtable - - \note The final appearance of the progress indicator varies depending on the active Windows theme. - - \sa QWinTaskbarButton - */ - -/*! - \fn void QWinTaskbarProgress::pausedChanged(bool paused) - \internal (for QWinTaskbarButton and QML compatibility) - */ - -/*! - \fn void QWinTaskbarProgress::stoppedChanged(bool stopped) - \internal (for QWinTaskbarButton and QML compatibility) - */ - -class QWinTaskbarProgressPrivate -{ -public: - int value = 0; - int minimum = 0; - int maximum = 100; - bool visible = false; - bool paused = false; - bool stopped = false; -}; - -/*! - Constructs a QWinTaskbarProgress with the parent object \a parent. - */ -QWinTaskbarProgress::QWinTaskbarProgress(QObject *parent) : - QObject(parent), d_ptr(new QWinTaskbarProgressPrivate) -{ -} - -/*! - Destroys the QWinTaskbarProgress. - */ -QWinTaskbarProgress::~QWinTaskbarProgress() -{ -} - -/*! - \property QWinTaskbarProgress::value - \brief the current value of the progress indicator - - The default value is \c 0. - */ -int QWinTaskbarProgress::value() const -{ - Q_D(const QWinTaskbarProgress); - return d->value; -} - -void QWinTaskbarProgress::setValue(int value) -{ - Q_D(QWinTaskbarProgress); - if ((value == d->value) || value < d->minimum || value > d->maximum) - return; - - d->value = value; - emit valueChanged(d->value); -} - -/*! - \property QWinTaskbarProgress::minimum - \brief the minimum value of the progress indicator - - The default value is \c 0. - */ -int QWinTaskbarProgress::minimum() const -{ - Q_D(const QWinTaskbarProgress); - return d->minimum; -} - -void QWinTaskbarProgress::setMinimum(int minimum) -{ - Q_D(QWinTaskbarProgress); - setRange(minimum, qMax(minimum, d->maximum)); -} - -/*! - \property QWinTaskbarProgress::maximum - \brief the maximum value of the progress indicator - - The default value is \c 100. - */ -int QWinTaskbarProgress::maximum() const -{ - Q_D(const QWinTaskbarProgress); - return d->maximum; -} - -void QWinTaskbarProgress::setMaximum(int maximum) -{ - Q_D(QWinTaskbarProgress); - setRange(qMin(d->minimum, maximum), maximum); -} - -/*! - \property QWinTaskbarProgress::visible - \brief whether the progress indicator is visible. - - The default value is \c false. - */ -bool QWinTaskbarProgress::isVisible() const -{ - Q_D(const QWinTaskbarProgress); - return d->visible; -} - -void QWinTaskbarProgress::setVisible(bool visible) -{ - Q_D(QWinTaskbarProgress); - if (visible == d->visible) - return; - - d->visible = visible; - emit visibilityChanged(d->visible); -} - -/*! - Shows the progress indicator. - */ -void QWinTaskbarProgress::show() -{ - setVisible(true); -} - -/*! - Hides the progress indicator. - */ -void QWinTaskbarProgress::hide() -{ - setVisible(false); -} - -/*! - Sets both the \a minimum and \a maximum values. - */ -void QWinTaskbarProgress::setRange(int minimum, int maximum) -{ - Q_D(QWinTaskbarProgress); - const bool minChanged = minimum != d->minimum; - const bool maxChanged = maximum != d->maximum; - if (minChanged || maxChanged) { - d->minimum = minimum; - d->maximum = qMax(minimum, maximum); - - if (d->value < d->minimum || d->value > d->maximum) - reset(); - - if (minChanged) - emit minimumChanged(d->minimum); - if (maxChanged) - emit maximumChanged(d->maximum); - } -} - -/*! - Resets the progress indicator. - - This function rewinds the value to the minimum value. - */ -void QWinTaskbarProgress::reset() -{ - setValue(minimum()); -} - -/*! - \property QWinTaskbarProgress::paused - \brief whether the progress indicator is paused. - - The default value is \c false. - - The final appearance of a paused progress indicator depends on the active - Windows theme. Typically, a paused progress indicator turns yellow to indicate - that the progress is currently paused. Unlike a \l stopped progress indicator, - a paused progress should not be used to indicate an error. - - \sa pause(), resume() - */ -bool QWinTaskbarProgress::isPaused() const -{ - Q_D(const QWinTaskbarProgress); - return d->paused; -} - -void QWinTaskbarProgress::setPaused(bool paused) -{ - Q_D(QWinTaskbarProgress); - if (paused == d->paused || d->stopped) - return; - - d->paused = paused; - emit pausedChanged(d->paused); -} - -/*! - Pauses the progress indicator. - - \sa paused - */ -void QWinTaskbarProgress::pause() -{ - setPaused(true); -} - -/*! - Resumes a paused or stopped progress indicator. - - \sa paused, stopped - */ -void QWinTaskbarProgress::resume() -{ - Q_D(QWinTaskbarProgress); - setPaused(false); - if (d->stopped) { - d->stopped = false; - emit stoppedChanged(false); - } -} - -/*! - \property QWinTaskbarProgress::stopped - \brief whether the progress indicator is stopped. - - The default value is \c false. - - The final appearance of a stopped progress indicator depends on the active - Windows theme. Typically, a stopped progress indicator turns red to indicate - that the progress is currently stopped. Unlike a \l paused progress indicator, - a stopped progress may be used to indicate an error. - - \sa stop(), resume() - */ -bool QWinTaskbarProgress::isStopped() const -{ - Q_D(const QWinTaskbarProgress); - return d->stopped; -} - -/*! - Stops the progress indicator. - - \sa stopped - */ -void QWinTaskbarProgress::stop() -{ - Q_D(QWinTaskbarProgress); - setPaused(false); - if (!d->stopped) { - d->stopped = true; - emit stoppedChanged(true); - } -} - -QT_END_NAMESPACE diff --git a/src/winextras/qwintaskbarprogress.h b/src/winextras/qwintaskbarprogress.h deleted file mode 100644 index ca64046..0000000 --- a/src/winextras/qwintaskbarprogress.h +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINTASKBARPROGRESS_H -#define QWINTASKBARPROGRESS_H - -#include <QtCore/qobject.h> -#include <QtCore/qscopedpointer.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class QWinTaskbarProgressPrivate; - -class Q_WINEXTRAS_EXPORT QWinTaskbarProgress : public QObject -{ - Q_OBJECT - Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged) - Q_PROPERTY(int minimum READ minimum WRITE setMinimum NOTIFY minimumChanged) - Q_PROPERTY(int maximum READ maximum WRITE setMaximum NOTIFY maximumChanged) - Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibilityChanged) - Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged) - Q_PROPERTY(bool stopped READ isStopped NOTIFY stoppedChanged) - -public: - explicit QWinTaskbarProgress(QObject *parent = nullptr); - ~QWinTaskbarProgress(); - - int value() const; - int minimum() const; - int maximum() const; - bool isVisible() const; - bool isPaused() const; - bool isStopped() const; - -public Q_SLOTS: - void setValue(int value); - void setMinimum(int minimum); - void setMaximum(int maximum); - void setRange(int minimum, int maximum); - void reset(); - void show(); - void hide(); - void setVisible(bool visible); - void pause(); - void resume(); - void setPaused(bool paused); - void stop(); - -Q_SIGNALS: - void valueChanged(int value); - void minimumChanged(int minimum); - void maximumChanged(int maximum); - void visibilityChanged(bool visible); - void pausedChanged(bool paused); - void stoppedChanged(bool stopped); - -private: - Q_DISABLE_COPY(QWinTaskbarProgress) - Q_DECLARE_PRIVATE(QWinTaskbarProgress) - QScopedPointer<QWinTaskbarProgressPrivate> d_ptr; -}; - -QT_END_NAMESPACE - -#endif // QWINTASKBARPROGRESS_H diff --git a/src/winextras/qwinthumbnailtoolbar.cpp b/src/winextras/qwinthumbnailtoolbar.cpp deleted file mode 100644 index fc8d76e..0000000 --- a/src/winextras/qwinthumbnailtoolbar.cpp +++ /dev/null @@ -1,629 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0601 -# undef _WIN32_WINNT -#endif -#if !defined(_WIN32_WINNT) -# define _WIN32_WINNT 0x0601 // Enable functions for MinGW -#endif - -#include "qwinthumbnailtoolbar.h" -#include "qwinthumbnailtoolbar_p.h" -#include "qwinthumbnailtoolbutton.h" -#include "qwinthumbnailtoolbutton_p.h" -#include "windowsguidsdefs_p.h" -#include "qwinfunctions.h" - -#include <QtGui/qwindow.h> -#include <QtCore/qcoreapplication.h> -#include <QtCore/qtimer.h> -#include <QtCore/qdebug.h> - -#include "qwinevent.h" -#include "qwinfunctions_p.h" -#include "qwineventfilter_p.h" - -#ifndef THBN_CLICKED -# define THBN_CLICKED 0x1800 -#endif - -#ifndef WM_DWMSENDICONICLIVEPREVIEWBITMAP -# define WM_DWMSENDICONICLIVEPREVIEWBITMAP 0x0326 -#endif - -#ifndef WM_DWMSENDICONICTHUMBNAIL -# define WM_DWMSENDICONICTHUMBNAIL 0x0323 -#endif - -QT_BEGIN_NAMESPACE - -enum { dWM_SIT_DISPLAYFRAME = 1 , dWMWA_FORCE_ICONIC_REPRESENTATION = 7, dWMWA_HAS_ICONIC_BITMAP = 10 }; - -static const int windowsLimitedThumbbarSize = 7; - -/*! - \class QWinThumbnailToolBar - \inmodule QtWinExtras - \since 5.2 - \brief The QWinThumbnailToolBar class allows manipulating the thumbnail toolbar of a window. - - Applications can embed a toolbar in the thumbnail of a window, which is - shown when hovering over its taskbar icon. A thumbnail toolbar may provide - quick access to the commands of a window without requiring the user to restore - or activate the window. - - \image thumbbar.png Media player thumbnail toolbar - - The following example code illustrates how to use the functions in the - QWinThumbnailToolBar and QWinThumbnailToolButton class to implement a - thumbnail toolbar: - - \snippet code/thumbbar.cpp thumbbar_cpp - - \sa QWinThumbnailToolButton - */ - -/*! - Constructs a QWinThumbnailToolBar with the specified \a parent. - - If \a parent is an instance of QWindow, it is automatically - assigned as the thumbnail toolbar's \l window. - */ -QWinThumbnailToolBar::QWinThumbnailToolBar(QObject *parent) : - QObject(parent), d_ptr(new QWinThumbnailToolBarPrivate) -{ - Q_D(QWinThumbnailToolBar); - d->q_ptr = this; - QWinEventFilter::setup(); - setWindow(qobject_cast<QWindow *>(parent)); -} - -/*! - Destroys and clears the QWinThumbnailToolBar. - */ -QWinThumbnailToolBar::~QWinThumbnailToolBar() = default; - -/*! - \property QWinThumbnailToolBar::window - \brief the window whose thumbnail toolbar is manipulated - */ -void QWinThumbnailToolBar::setWindow(QWindow *window) -{ - Q_D(QWinThumbnailToolBar); - if (d->window != window) { - if (d->window) { - d->window->removeEventFilter(d); - if (d->window->handle()) { - d->clearToolbar(); - setIconicPixmapNotificationsEnabled(false); - } - } - d->window = window; - if (d->window) { - d->window->installEventFilter(d); - if (d->window->isVisible()) { - d->initToolbar(); - d->_q_scheduleUpdate(); - } - } - } -} - -QWindow *QWinThumbnailToolBar::window() const -{ - Q_D(const QWinThumbnailToolBar); - return d->window; -} - -/*! - Adds a \a button to the thumbnail toolbar. - - \note The number of buttons is limited to \c 7. - */ -void QWinThumbnailToolBar::addButton(QWinThumbnailToolButton *button) -{ - Q_D(QWinThumbnailToolBar); - if (d->buttonList.size() >= windowsLimitedThumbbarSize) { - qWarning() << "Cannot add " << button << " maximum number of buttons (" - << windowsLimitedThumbbarSize << ") reached."; - return; - } - if (button && button->d_func()->toolbar != this) { - if (button->d_func()->toolbar) { - button->d_func()->toolbar->removeButton(button); - } - button->d_func()->toolbar = this; - connect(button, &QWinThumbnailToolButton::changed, - d, &QWinThumbnailToolBarPrivate::_q_scheduleUpdate); - d->buttonList.append(button); - d->_q_scheduleUpdate(); - } -} - -/*! - Removes the \a button from the thumbnail toolbar. - */ -void QWinThumbnailToolBar::removeButton(QWinThumbnailToolButton *button) -{ - Q_D(QWinThumbnailToolBar); - if (button && d->buttonList.contains(button)) { - button->d_func()->toolbar = nullptr; - disconnect(button, &QWinThumbnailToolButton::changed, - d, &QWinThumbnailToolBarPrivate::_q_scheduleUpdate); - - d->buttonList.removeAll(button); - d->_q_scheduleUpdate(); - } -} - -/*! - Sets the list of \a buttons in the thumbnail toolbar. - - \note Any existing buttons are replaced. - */ -void QWinThumbnailToolBar::setButtons(const QList<QWinThumbnailToolButton *> &buttons) -{ - Q_D(QWinThumbnailToolBar); - d->buttonList.clear(); - for (QWinThumbnailToolButton *button : buttons) - addButton(button); - d->_q_updateToolbar(); -} - -/*! - Returns the list of buttons in the thumbnail toolbar. - */ -QList<QWinThumbnailToolButton *> QWinThumbnailToolBar::buttons() const -{ - Q_D(const QWinThumbnailToolBar); - return d->buttonList; -} - -/*! - \property QWinThumbnailToolBar::count - \brief the number of buttons in the thumbnail toolbar - - \note The number of buttons is limited to \c 7. - */ -int QWinThumbnailToolBar::count() const -{ - Q_D(const QWinThumbnailToolBar); - return d->buttonList.size(); -} - -void QWinThumbnailToolBarPrivate::updateIconicPixmapsEnabled(bool invalidate) -{ - Q_Q(QWinThumbnailToolBar); - const HWND hwnd = handle(); - if (!hwnd) { - qWarning() << Q_FUNC_INFO << "invoked with hwnd=0"; - return; - } - const bool enabled = iconicThumbnail || iconicLivePreview; - q->setIconicPixmapNotificationsEnabled(enabled); - if (enabled && invalidate) { - const HRESULT hr = DwmInvalidateIconicBitmaps(hwnd); - if (FAILED(hr)) - qWarning() << QWinThumbnailToolBarPrivate::msgComFailed("DwmInvalidateIconicBitmaps", hr); - } -} - -/* - QWinThumbnailToolBarPrivate::IconicPixmapCache caches a HBITMAP of for one of - the iconic thumbnail or live preview pixmaps. When the messages - WM_DWMSENDICONICLIVEPREVIEWBITMAP or WM_DWMSENDICONICTHUMBNAIL are received - (after setting the DWM window attributes accordingly), the bitmap matching the - maximum size is constructed on demand. - */ - -void QWinThumbnailToolBarPrivate::IconicPixmapCache::deleteBitmap() -{ - if (m_bitmap) { - DeleteObject(m_bitmap); - m_size = QSize(); - m_bitmap = nullptr; - } -} - -bool QWinThumbnailToolBarPrivate::IconicPixmapCache::setPixmap(const QPixmap &pixmap) -{ - if (pixmap.cacheKey() == m_pixmap.cacheKey()) - return false; - deleteBitmap(); - m_pixmap = pixmap; - return true; -} - -HBITMAP QWinThumbnailToolBarPrivate::IconicPixmapCache::bitmap(const QSize &maxSize) -{ - if (m_pixmap.isNull()) - return nullptr; - if (m_bitmap && m_size.width() <= maxSize.width() && m_size.height() <= maxSize.height()) - return m_bitmap; - deleteBitmap(); - QPixmap pixmap = m_pixmap; - if (pixmap.width() >= maxSize.width() || pixmap.height() >= maxSize.width()) - pixmap = pixmap.scaled(maxSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); - if (const HBITMAP bitmap = QtWin::toHBITMAP(pixmap, QtWin::HBitmapAlpha)) { - m_size = pixmap.size(); - m_bitmap = bitmap; - } - return m_bitmap; -} - -/*! - \fn QWinThumbnailToolBar::iconicThumbnailPixmapRequested() - - This signal is emitted when the operating system requests a new iconic thumbnail pixmap, - typically when the thumbnail is shown. - - \since 5.4 - \sa iconicThumbnailPixmap -*/ - -/*! - \fn QWinThumbnailToolBar::iconicLivePreviewPixmapRequested() - - This signal is emitted when the operating system requests a new iconic live preview pixmap, - typically when the user ALT-tabs to the application. - - \since 5.4 - \sa iconicLivePreviewPixmap -*/ - -/*! - \property QWinThumbnailToolBar::iconicPixmapNotificationsEnabled - \brief whether signals iconicThumbnailPixmapRequested() and iconicLivePreviewPixmapRequested() - will be emitted - - \since 5.4 - \sa QWinThumbnailToolBar::iconicThumbnailPixmap, QWinThumbnailToolBar::iconicLivePreviewPixmap - */ - -bool QWinThumbnailToolBar::iconicPixmapNotificationsEnabled() const -{ - Q_D(const QWinThumbnailToolBar); - const HWND hwnd = d->handle(); - if (!hwnd) - return false; - return QtDwmApiDll::booleanWindowAttribute(hwnd, dWMWA_FORCE_ICONIC_REPRESENTATION); -} - -void QWinThumbnailToolBar::setIconicPixmapNotificationsEnabled(bool enabled) -{ - Q_D(const QWinThumbnailToolBar); - const HWND hwnd = d->handle(); - if (!hwnd) { - qWarning() << Q_FUNC_INFO << "invoked with hwnd=0"; - return; - } - if (iconicPixmapNotificationsEnabled() == enabled) - return; - QtDwmApiDll::setBooleanWindowAttribute(hwnd, dWMWA_FORCE_ICONIC_REPRESENTATION, enabled); - QtDwmApiDll::setBooleanWindowAttribute(hwnd, dWMWA_HAS_ICONIC_BITMAP, enabled); -} - -/*! - \property QWinThumbnailToolBar::iconicThumbnailPixmap - \brief the pixmap for use as a thumbnail representation - - \since 5.4 - \sa QWinThumbnailToolBar::iconicPixmapNotificationsEnabled - */ - -void QWinThumbnailToolBar::setIconicThumbnailPixmap(const QPixmap &pixmap) -{ - Q_D(QWinThumbnailToolBar); - const bool changed = d->iconicThumbnail.setPixmap(pixmap); - if (d->hasHandle()) // Potentially 0 when invoked from QML loading, see _q_updateToolbar() - d->updateIconicPixmapsEnabled(changed && !d->withinIconicThumbnailRequest); -} - -QPixmap QWinThumbnailToolBar::iconicThumbnailPixmap() const -{ - Q_D(const QWinThumbnailToolBar); - return d->iconicThumbnail.pixmap(); -} - -/*! - \property QWinThumbnailToolBar::iconicLivePreviewPixmap - \brief the pixmap for use as a live (peek) preview when tabbing into the application - - \since 5.4 - */ - -void QWinThumbnailToolBar::setIconicLivePreviewPixmap(const QPixmap &pixmap) -{ - Q_D(QWinThumbnailToolBar); - const bool changed = d->iconicLivePreview.setPixmap(pixmap); - if (d->hasHandle()) // Potentially 0 when invoked from QML loading, see _q_updateToolbar() - d->updateIconicPixmapsEnabled(changed && !d->withinIconicLivePreviewRequest); -} - -QPixmap QWinThumbnailToolBar::iconicLivePreviewPixmap() const -{ - Q_D(const QWinThumbnailToolBar); - return d->iconicLivePreview.pixmap(); -} - -inline void QWinThumbnailToolBarPrivate::updateIconicThumbnail(const MSG *message) -{ - if (!iconicThumbnail) - return; - const QSize maxSize(HIWORD(message->lParam), LOWORD(message->lParam)); - if (const HBITMAP bitmap = iconicThumbnail.bitmap(maxSize)) { - const HRESULT hr = DwmSetIconicThumbnail(message->hwnd, bitmap, dWM_SIT_DISPLAYFRAME); - if (FAILED(hr)) - qWarning() << QWinThumbnailToolBarPrivate::msgComFailed("DwmSetIconicThumbnail", hr); - } -} - -inline void QWinThumbnailToolBarPrivate::updateIconicLivePreview(const MSG *message) -{ - if (!iconicLivePreview) - return; - RECT rect; - GetClientRect(message->hwnd, &rect); - const QSize maxSize(rect.right, rect.bottom); - POINT offset = {0, 0}; - if (const HBITMAP bitmap = iconicLivePreview.bitmap(maxSize)) { - const HRESULT hr = DwmSetIconicLivePreviewBitmap(message->hwnd, bitmap, &offset, dWM_SIT_DISPLAYFRAME); - if (FAILED(hr)) - qWarning() << QWinThumbnailToolBarPrivate::msgComFailed("DwmSetIconicLivePreviewBitmap", hr); - } -} - -/*! - Removes all buttons from the thumbnail toolbar. - */ -void QWinThumbnailToolBar::clear() -{ - setButtons(QList<QWinThumbnailToolButton *>()); -} - -static inline ITaskbarList4 *createTaskbarList() -{ - ITaskbarList4 *result = nullptr; - HRESULT hresult = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, qIID_ITaskbarList4, reinterpret_cast<void **>(&result)); - if (FAILED(hresult)) { - const QString err = QtWin::errorStringFromHresult(hresult); - qWarning("QWinThumbnailToolBar: qIID_ITaskbarList4 was not created: %#010x, %s.", - unsigned(hresult), qPrintable(err)); - return nullptr; - } - hresult = result->HrInit(); - if (FAILED(hresult)) { - result->Release(); - const QString err = QtWin::errorStringFromHresult(hresult); - qWarning("QWinThumbnailToolBar: qIID_ITaskbarList4 was not initialized: %#010x, %s.", - unsigned(hresult), qPrintable(err)); - return nullptr; - } - return result; -} - -QWinThumbnailToolBarPrivate::QWinThumbnailToolBarPrivate() : - QObject(nullptr), pTbList(createTaskbarList()) -{ - buttonList.reserve(windowsLimitedThumbbarSize); - QCoreApplication::instance()->installNativeEventFilter(this); -} - -QWinThumbnailToolBarPrivate::~QWinThumbnailToolBarPrivate() -{ - if (pTbList) - pTbList->Release(); - QCoreApplication::instance()->removeNativeEventFilter(this); -} - -inline bool QWinThumbnailToolBarPrivate::hasHandle() const -{ - return window && window->handle(); -} - -inline HWND QWinThumbnailToolBarPrivate::handle() const -{ - return hasHandle() ? reinterpret_cast<HWND>(window->winId()) : nullptr; -} - -void QWinThumbnailToolBarPrivate::initToolbar() -{ - if (!pTbList || !window) - return; - THUMBBUTTON buttons[windowsLimitedThumbbarSize]; - initButtons(buttons); - HRESULT hresult = pTbList->ThumbBarAddButtons(handle(), windowsLimitedThumbbarSize, buttons); - if (FAILED(hresult)) - qWarning() << msgComFailed("ThumbBarAddButtons", hresult); -} - -void QWinThumbnailToolBarPrivate::clearToolbar() -{ - if (!pTbList || !window) - return; - THUMBBUTTON buttons[windowsLimitedThumbbarSize]; - initButtons(buttons); - HRESULT hresult = pTbList->ThumbBarUpdateButtons(handle(), windowsLimitedThumbbarSize, buttons); - if (FAILED(hresult)) - qWarning() << msgComFailed("ThumbBarUpdateButtons", hresult); -} - -void QWinThumbnailToolBarPrivate::_q_updateToolbar() -{ - updateScheduled = false; - if (!pTbList || !window) - return; - THUMBBUTTON buttons[windowsLimitedThumbbarSize]; - QList<HICON> createdIcons; - initButtons(buttons); - const int thumbbarSize = qMin(buttonList.size(), windowsLimitedThumbbarSize); - // filling from the right fixes some strange bug which makes last button bg look like first btn bg - for (int i = (windowsLimitedThumbbarSize - thumbbarSize); i < windowsLimitedThumbbarSize; i++) { - QWinThumbnailToolButton *button = buttonList.at(i - (windowsLimitedThumbbarSize - thumbbarSize)); - buttons[i].dwFlags = static_cast<THUMBBUTTONFLAGS>(makeNativeButtonFlags(button)); - buttons[i].dwMask = static_cast<THUMBBUTTONMASK>(makeButtonMask(button)); - if (!button->icon().isNull()) {; - buttons[i].hIcon = QtWin::toHICON(button->icon().pixmap(GetSystemMetrics(SM_CXSMICON))); - if (!buttons[i].hIcon) - buttons[i].hIcon = static_cast<HICON>(LoadImage(nullptr, IDI_APPLICATION, IMAGE_ICON, SM_CXSMICON, SM_CYSMICON, LR_SHARED)); - else - createdIcons << buttons[i].hIcon; - } - if (!button->toolTip().isEmpty()) { - buttons[i].szTip[button->toolTip().left(sizeof(buttons[i].szTip)/sizeof(buttons[i].szTip[0]) - 1).toWCharArray(buttons[i].szTip)] = 0; - } - } - HRESULT hresult = pTbList->ThumbBarUpdateButtons(handle(), windowsLimitedThumbbarSize, buttons); - if (FAILED(hresult)) - qWarning() << msgComFailed("ThumbBarUpdateButtons", hresult); - updateIconicPixmapsEnabled(false); - for (auto & button : buttons) { - if (button.hIcon) { - if (createdIcons.contains(button.hIcon)) - DestroyIcon(button.hIcon); - else - DeleteObject(button.hIcon); - } - } -} - -void QWinThumbnailToolBarPrivate::_q_scheduleUpdate() -{ - if (updateScheduled) - return; - updateScheduled = true; - QTimer::singleShot(0, this, &QWinThumbnailToolBarPrivate::_q_updateToolbar); -} - -bool QWinThumbnailToolBarPrivate::eventFilter(QObject *object, QEvent *event) -{ - if (object == window && event->type() == QWinEvent::TaskbarButtonCreated) { - initToolbar(); - _q_scheduleUpdate(); - } - return QObject::eventFilter(object, event); -} - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) -bool QWinThumbnailToolBarPrivate::nativeEventFilter(const QByteArray &, void *message, qintptr *result) -#else -bool QWinThumbnailToolBarPrivate::nativeEventFilter(const QByteArray &, void *message, long *result) -#endif -{ - const MSG *msg = static_cast<const MSG *>(message); - if (handle() != msg->hwnd) - return false; - switch (msg->message) { - case WM_COMMAND: - if (HIWORD(msg->wParam) == THBN_CLICKED) { - const int buttonId = LOWORD(msg->wParam) - (windowsLimitedThumbbarSize - qMin(windowsLimitedThumbbarSize, buttonList.size())); - buttonList.at(buttonId)->click(); - if (result) - *result = 0; - return true; - } - break; - case WM_DWMSENDICONICTHUMBNAIL: - withinIconicThumbnailRequest = true; - emit q_func()->iconicThumbnailPixmapRequested(); - withinIconicThumbnailRequest = false; - updateIconicThumbnail(msg); - return true; - case WM_DWMSENDICONICLIVEPREVIEWBITMAP: - withinIconicLivePreviewRequest = true; - emit q_func()->iconicLivePreviewPixmapRequested(); - withinIconicLivePreviewRequest = false; - updateIconicLivePreview(msg); - return true; - } - return false; -} - -void QWinThumbnailToolBarPrivate::initButtons(THUMBBUTTON *buttons) -{ - for (int i = 0; i < windowsLimitedThumbbarSize; i++) { - memset(&buttons[i], 0, sizeof buttons[i]); - buttons[i].iId = UINT(i); - buttons[i].dwFlags = THBF_HIDDEN; - buttons[i].dwMask = THB_FLAGS; - } -} - -int QWinThumbnailToolBarPrivate::makeNativeButtonFlags(const QWinThumbnailToolButton *button) -{ - int nativeFlags = 0; - if (button->isEnabled()) - nativeFlags |= THBF_ENABLED; - else - nativeFlags |= THBF_DISABLED; - if (button->dismissOnClick()) - nativeFlags |= THBF_DISMISSONCLICK; - if (button->isFlat()) - nativeFlags |= THBF_NOBACKGROUND; - if (!button->isVisible()) - nativeFlags |= THBF_HIDDEN; - if (!button->isInteractive()) - nativeFlags |= THBF_NONINTERACTIVE; - return nativeFlags; -} - -int QWinThumbnailToolBarPrivate::makeButtonMask(const QWinThumbnailToolButton *button) -{ - int mask = 0; - mask |= THB_FLAGS; - if (!button->icon().isNull()) - mask |= THB_ICON; - if (!button->toolTip().isEmpty()) - mask |= THB_TOOLTIP; - return mask; -} - -QString QWinThumbnailToolBarPrivate::msgComFailed(const char *function, HRESULT hresult) -{ - return QString::fromLatin1("QWinThumbnailToolBar: %1() failed: #%2: %3") - .arg(QLatin1String(function)) - .arg(unsigned(hresult), 10, 16, QLatin1Char('0')) - .arg(QtWin::errorStringFromHresult(hresult)); -} - -QT_END_NAMESPACE - -#include "moc_qwinthumbnailtoolbar.cpp" diff --git a/src/winextras/qwinthumbnailtoolbar.h b/src/winextras/qwinthumbnailtoolbar.h deleted file mode 100644 index 83e2f2b..0000000 --- a/src/winextras/qwinthumbnailtoolbar.h +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINTHUMBNAILTOOLBAR_H -#define QWINTHUMBNAILTOOLBAR_H - -#include <QtCore/qobject.h> -#include <QtCore/qscopedpointer.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class QPixmap; -class QWindow; -class QWinThumbnailToolButton; -class QWinThumbnailToolBarPrivate; - -class Q_WINEXTRAS_EXPORT QWinThumbnailToolBar : public QObject -{ - Q_OBJECT - Q_PROPERTY(int count READ count STORED false) - Q_PROPERTY(QWindow *window READ window WRITE setWindow) - Q_PROPERTY(bool iconicPixmapNotificationsEnabled READ iconicPixmapNotificationsEnabled WRITE setIconicPixmapNotificationsEnabled) - Q_PROPERTY(QPixmap iconicThumbnailPixmap READ iconicThumbnailPixmap WRITE setIconicThumbnailPixmap) - Q_PROPERTY(QPixmap iconicLivePreviewPixmap READ iconicLivePreviewPixmap WRITE setIconicLivePreviewPixmap) - -public: - explicit QWinThumbnailToolBar(QObject *parent = nullptr); - ~QWinThumbnailToolBar(); - - void setWindow(QWindow *window); - QWindow *window() const; - - void addButton(QWinThumbnailToolButton *button); - void removeButton(QWinThumbnailToolButton *button); - void setButtons(const QList<QWinThumbnailToolButton *> &buttons); - QList<QWinThumbnailToolButton *> buttons() const; - int count() const; - - bool iconicPixmapNotificationsEnabled() const; - void setIconicPixmapNotificationsEnabled(bool enabled); - - QPixmap iconicThumbnailPixmap() const; - QPixmap iconicLivePreviewPixmap() const; - -public Q_SLOTS: - void clear(); - void setIconicThumbnailPixmap(const QPixmap &); - void setIconicLivePreviewPixmap(const QPixmap &); - -Q_SIGNALS: - void iconicThumbnailPixmapRequested(); - void iconicLivePreviewPixmapRequested(); - -private: - Q_DISABLE_COPY(QWinThumbnailToolBar) - Q_DECLARE_PRIVATE(QWinThumbnailToolBar) - QScopedPointer<QWinThumbnailToolBarPrivate> d_ptr; - friend class QWinThumbnailToolButton; -}; - -QT_END_NAMESPACE - -#endif // QWINTHUMBNAILTOOLBAR_H diff --git a/src/winextras/qwinthumbnailtoolbar_p.h b/src/winextras/qwinthumbnailtoolbar_p.h deleted file mode 100644 index c3180f3..0000000 --- a/src/winextras/qwinthumbnailtoolbar_p.h +++ /dev/null @@ -1,132 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINTHUMBNAILTOOLBAR_P_H -#define QWINTHUMBNAILTOOLBAR_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include "qwinthumbnailtoolbar.h" - -#include <QtCore/qhash.h> -#include <QtCore/qlist.h> -#include <QtGui/qicon.h> -#include <QtGui/qpixmap.h> -#include <QtCore/qabstractnativeeventfilter.h> - -#include "winshobjidl_p.h" - -QT_BEGIN_NAMESPACE - -class QWinThumbnailToolBarPrivate : public QObject, QAbstractNativeEventFilter -{ -public: - class IconicPixmapCache - { - public: - IconicPixmapCache() = default; - ~IconicPixmapCache() { deleteBitmap(); } - - operator bool() const { return !m_pixmap.isNull(); } - - QPixmap pixmap() const { return m_pixmap; } - bool setPixmap(const QPixmap &p); - - HBITMAP bitmap(const QSize &maxSize); - - private: - void deleteBitmap(); - - QPixmap m_pixmap; - QSize m_size; - HBITMAP m_bitmap = nullptr; - }; - - QWinThumbnailToolBarPrivate(); - ~QWinThumbnailToolBarPrivate(); - void initToolbar(); - void clearToolbar(); - void _q_updateToolbar(); - void _q_scheduleUpdate(); - bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE; - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override; -#else - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override; -#endif - - static void initButtons(THUMBBUTTON *buttons); - static int makeNativeButtonFlags(const QWinThumbnailToolButton *button); - static int makeButtonMask(const QWinThumbnailToolButton *button); - static QString msgComFailed(const char *function, HRESULT hresult); - - bool updateScheduled = false; - QList<QWinThumbnailToolButton *> buttonList; - QWindow *window = nullptr; - ITaskbarList4 * const pTbList; - - IconicPixmapCache iconicThumbnail; - IconicPixmapCache iconicLivePreview; - -private: - bool hasHandle() const; - HWND handle() const; - void updateIconicPixmapsEnabled(bool invalidate); - void updateIconicThumbnail(const MSG *message); - void updateIconicLivePreview(const MSG *message); - - QWinThumbnailToolBar *q_ptr = nullptr; - Q_DECLARE_PUBLIC(QWinThumbnailToolBar) - bool withinIconicThumbnailRequest = false; - bool withinIconicLivePreviewRequest = false; -}; - -QT_END_NAMESPACE - -#endif // QWINTHUMBNAILTOOLBAR_P_H diff --git a/src/winextras/qwinthumbnailtoolbutton.cpp b/src/winextras/qwinthumbnailtoolbutton.cpp deleted file mode 100644 index 9d04324..0000000 --- a/src/winextras/qwinthumbnailtoolbutton.cpp +++ /dev/null @@ -1,254 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "qwinthumbnailtoolbutton.h" -#include "qwinthumbnailtoolbutton_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \class QWinThumbnailToolButton - \inmodule QtWinExtras - \since 5.2 - \brief The QWinThumbnailToolButton class represents a button in a thumbnail toolbar. - - Buttons in a QWinThumbnailToolBar are instances of QWinThumbnailToolButton. - It provides a set of properties for specifying the attributes of a thumbnail - toolbar button. It also provides a signal that is emitted whenever the button - is \l{clicked()}{clicked}, and a slot to perform \l{click()}{clicks} - programmatically. - - \sa QWinThumbnailToolBar - */ - -/*! - \fn void QWinThumbnailToolButton::clicked() - - This signal is emitted when the button is clicked. - */ - -/*! - \internal - \fn void QWinThumbnailToolButton::changed() - */ - -/*! - Constructs a QWinThumbnailToolButton with the specified \a parent. - */ -QWinThumbnailToolButton::QWinThumbnailToolButton(QObject *parent) : - QObject(parent), d_ptr(new QWinThumbnailToolButtonPrivate) -{ -} - -/*! - Destroys the QWinThumbnailToolButton. - */ -QWinThumbnailToolButton::~QWinThumbnailToolButton() = default; - -/*! - \property QWinThumbnailToolButton::toolTip - \brief the tooltip of the button - */ -void QWinThumbnailToolButton::setToolTip(const QString &toolTip) -{ - Q_D(QWinThumbnailToolButton); - if (d->toolTip != toolTip) { - d->toolTip = toolTip; - emit changed(); - } -} - -QString QWinThumbnailToolButton::toolTip() const -{ - Q_D(const QWinThumbnailToolButton); - return d->toolTip; -} - -/*! - \property QWinThumbnailToolButton::icon - \brief the icon of the button - */ -void QWinThumbnailToolButton::setIcon(const QIcon &icon) -{ - Q_D(QWinThumbnailToolButton); - if (d->icon.cacheKey() != icon.cacheKey()) { - d->icon = icon; - emit changed(); - } -} - -QIcon QWinThumbnailToolButton::icon() const -{ - Q_D(const QWinThumbnailToolButton); - return d->icon; -} - -/*! - \property QWinThumbnailToolButton::enabled - \brief whether the button is enabled - - The default value is \c true. - - A disabled button does not react to user interaction, - and is also visually disabled. - - \sa interactive - */ -void QWinThumbnailToolButton::setEnabled(bool enabled) -{ - Q_D(QWinThumbnailToolButton); - if (d->enabled != enabled) { - d->enabled = enabled; - emit changed(); - } -} - -bool QWinThumbnailToolButton::isEnabled() const -{ - Q_D(const QWinThumbnailToolButton); - return d->enabled; -} - -/*! - \property QWinThumbnailToolButton::interactive - \brief whether the button is interactive - - The default value is \c true. - - A non-interactive button does not react to user interaction, - but is still visually enabled. A typical use case for non- - interactive buttons are notification icons. - - \sa enabled - */ -void QWinThumbnailToolButton::setInteractive(bool interactive) -{ - Q_D(QWinThumbnailToolButton); - if (d->interactive != interactive) { - d->interactive = interactive; - emit changed(); - } -} - -bool QWinThumbnailToolButton::isInteractive() const -{ - Q_D(const QWinThumbnailToolButton); - return d->interactive; -} - -/*! - \property QWinThumbnailToolButton::visible - \brief whether the button is visible - - The default value is \c true. - */ -void QWinThumbnailToolButton::setVisible(bool visible) -{ - Q_D(QWinThumbnailToolButton); - if (d->visible != visible) { - d->visible = visible; - emit changed(); - } -} - -bool QWinThumbnailToolButton::isVisible() const -{ - Q_D(const QWinThumbnailToolButton); - return d->visible; -} - -/*! - \property QWinThumbnailToolButton::dismissOnClick - \brief whether the window thumbnail is dismissed after a button click - - The default value is \c false. - */ -void QWinThumbnailToolButton::setDismissOnClick(bool dismiss) -{ - Q_D(QWinThumbnailToolButton); - if (d->dismiss != dismiss) { - d->dismiss = dismiss; - emit changed(); - } -} - -bool QWinThumbnailToolButton::dismissOnClick() const -{ - Q_D(const QWinThumbnailToolButton); - return d->dismiss; -} - -/*! - \property QWinThumbnailToolButton::flat - \brief whether the button is flat - - The default value is \c false. - - A flat button does not draw a background nor a frame - only an icon. - */ -void QWinThumbnailToolButton::setFlat(bool flat) -{ - Q_D(QWinThumbnailToolButton); - if (d->flat != flat) { - d->flat = flat; - emit changed(); - } -} - -bool QWinThumbnailToolButton::isFlat() const -{ - Q_D(const QWinThumbnailToolButton); - return d->flat; -} - -/*! - Performs a click. The clicked() signal is emitted as appropriate. - - This function does nothing if the button is \l{enabled}{disabled} - or \l{interactive}{non-interactive}. - */ -void QWinThumbnailToolButton::click() -{ - Q_D(QWinThumbnailToolButton); - if (d->enabled && d->interactive) - emit clicked(); -} - -QT_END_NAMESPACE diff --git a/src/winextras/qwinthumbnailtoolbutton.h b/src/winextras/qwinthumbnailtoolbutton.h deleted file mode 100644 index 0ab970f..0000000 --- a/src/winextras/qwinthumbnailtoolbutton.h +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINTHUMBNAILTOOLBUTTON_H -#define QWINTHUMBNAILTOOLBUTTON_H - -#include <QtGui/qicon.h> -#include <QtCore/qobject.h> -#include <QtCore/qscopedpointer.h> -#include <QtWinExtras/qwinextrasglobal.h> - -QT_BEGIN_NAMESPACE - -class QWinThumbnailToolButtonPrivate; - -class Q_WINEXTRAS_EXPORT QWinThumbnailToolButton : public QObject -{ - Q_OBJECT - Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip) - Q_PROPERTY(QIcon icon READ icon WRITE setIcon) - Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) - Q_PROPERTY(bool interactive READ isInteractive WRITE setInteractive) - Q_PROPERTY(bool visible READ isVisible WRITE setVisible) - Q_PROPERTY(bool dismissOnClick READ dismissOnClick WRITE setDismissOnClick) - Q_PROPERTY(bool flat READ isFlat WRITE setFlat) - -public: - explicit QWinThumbnailToolButton(QObject *parent = nullptr); - ~QWinThumbnailToolButton(); - - void setToolTip(const QString &toolTip); - QString toolTip() const; - void setIcon(const QIcon &icon); - QIcon icon() const; - void setEnabled(bool enabled); - bool isEnabled() const; - void setInteractive(bool interactive); - bool isInteractive() const; - void setVisible(bool visible); - bool isVisible() const; - void setDismissOnClick(bool dismiss); - bool dismissOnClick() const; - void setFlat(bool flat); - bool isFlat() const; - -public Q_SLOTS: - void click(); - -Q_SIGNALS: - void clicked(); - void changed(); - -private: - Q_DISABLE_COPY(QWinThumbnailToolButton) - Q_DECLARE_PRIVATE(QWinThumbnailToolButton) - QScopedPointer<QWinThumbnailToolButtonPrivate> d_ptr; - friend class QWinThumbnailToolBar; -}; - -QT_END_NAMESPACE - -#endif // QWINTHUMBNAILTOOLBUTTON_H diff --git a/src/winextras/qwinthumbnailtoolbutton_p.h b/src/winextras/qwinthumbnailtoolbutton_p.h deleted file mode 100644 index 9ff02d6..0000000 --- a/src/winextras/qwinthumbnailtoolbutton_p.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef QWINTHUMBNAILTOOLBUTTON_P_H -#define QWINTHUMBNAILTOOLBUTTON_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtGui/qicon.h> -#include <QtCore/qstring.h> - -QT_BEGIN_NAMESPACE - -class QWinThumbnailToolBar; - -class QWinThumbnailToolButtonPrivate -{ -public: - QString toolTip; - QIcon icon; - bool enabled = true; - bool interactive = true; - bool dismiss = false; - bool visible = true; - bool flat = false; - - QWinThumbnailToolBar *toolbar = nullptr; -}; - -QT_END_NAMESPACE - -#endif // QWINTHUMBNAILTOOLBUTTON_P_H diff --git a/src/winextras/windowsguidsdefs.cpp b/src/winextras/windowsguidsdefs.cpp deleted file mode 100644 index dd4284d..0000000 --- a/src/winextras/windowsguidsdefs.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "windowsguidsdefs_p.h" -#include "winpropkey_p.h" -#include "winshobjidl_p.h" - -QT_BEGIN_NAMESPACE - -// Some of these symbols are defined to varying extents in the various -// MinGW versions. To avoid potential conflicts, we provide them prefixed with -// 'q' in Qt's namespace. - -const GUID qCLSID_DestinationList = {0x77f10cf0, 0x3db5, 0x4966, {0xb5,0x20,0xb7,0xc5,0x4f,0xd3,0x5e,0xd6}}; -const GUID qCLSID_EnumerableObjectCollection = {0x2d3468c1, 0x36a7, 0x43b6, {0xac,0x24,0xd3,0xf0,0x2f,0xd9,0x60,0x7a}}; -const GUID qIID_ICustomDestinationList = {0x6332debf, 0x87b5, 0x4670, {0x90,0xc0,0x5e,0x57,0xb4,0x08,0xa4,0x9e}}; -const GUID qIID_IApplicationDestinations = {0x12337d35, 0x94c6, 0x48a0, {0xbc,0xe7,0x6a,0x9c,0x69,0xd4,0xd6,0x00}}; -const GUID qCLSID_ApplicationDestinations = {0x86c14003, 0x4d6b, 0x4ef3, {0xa7,0xb4,0x05,0x06,0x66,0x3b,0x2e,0x68}}; -const GUID qIID_IApplicationDocumentLists = {0x3c594f9f, 0x9f30, 0x47a1, {0x97,0x9a,0xc9,0xe8,0x3d,0x3d,0x0a,0x06}}; -const GUID qCLSID_ApplicationDocumentLists = {0x86bec222, 0x30f2, 0x47e0, {0x9f,0x25,0x60,0xd1,0x1c,0xd7,0x5c,0x28}}; -const GUID qIID_IObjectArray = {0x92ca9dcd, 0x5622, 0x4bba, {0xa8,0x05,0x5e,0x9f,0x54,0x1b,0xd8,0xc9}}; -const GUID qIID_IObjectCollection = {0x5632b1a4, 0xe38a, 0x400a, {0x92,0x8a,0xd4,0xcd,0x63,0x23,0x02,0x95}}; -const GUID qIID_IPropertyStore = {0x886d8eeb, 0x8cf2, 0x4446, {0x8d,0x02,0xcd,0xba,0x1d,0xbd,0xcf,0x99}}; -const GUID qIID_ITaskbarList3 = {0xea1afb91, 0x9e28, 0x4b86, {0x90,0xe9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf}}; -const GUID qIID_ITaskbarList4 = {0xc43dc798, 0x95d1, 0x4bea, {0x90,0x30, 0xbb,0x99,0xe2,0x98,0x3a,0x1a}}; -const PROPERTYKEY qPKEY_Title = {{0xf29f85e0, 0x4ff9, 0x1068, {0xab,0x91,0x08,0x00,0x2b,0x27,0xb3,0xd9}}, 2}; -const PROPERTYKEY qPKEY_Link_Arguments = {{0x436f2667, 0x14e2, 0x4feb, {0xb3,0x0a,0x14,0x6c,0x53,0xb5,0xb6,0x74}}, 100}; -const PROPERTYKEY qPKEY_AppUserModel_IsDestListSeparator = {{0x9f4c2855, 0x9f79, 0x4b39, {0xa8,0xd0,0xe1,0xd4,0x2d,0xe1,0xd5,0xf3}}, 6}; -const GUID qIID_IShellItem2 = {0x7e9fb0d3, 0x919f, 0x4307, {0xab,0x2e,0x9b,0x18,0x60,0x31,0x0c,0x93}}; -const GUID qIID_IShellLinkW = {0x000214f9, 0x0000, 0x0000, {0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}; -const GUID qIID_ITaskbarList = {0xea1afb91, 0x9e28, 0x4b86, {0x90,0xe9,0x9e,0x9f,0x8a,0x5e,0xef,0xaf}}; -const GUID qIID_ITaskbarList2 = {0x602d4995, 0xb13a, 0x429b, {0xa6,0x6e,0x19,0x35,0xe4,0x4f,0x43,0x17}}; -const GUID qIID_IUnknown = {0x00000000, 0x0000, 0x0000, {0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}}; -const GUID qGUID_NULL = {0x00000000, 0x0000, 0x0000, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; - -QT_END_NAMESPACE diff --git a/src/winextras/windowsguidsdefs_p.h b/src/winextras/windowsguidsdefs_p.h deleted file mode 100644 index 73dc0e7..0000000 --- a/src/winextras/windowsguidsdefs_p.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef WINDOWSGUIDSDEFS_P_H -#define WINDOWSGUIDSDEFS_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of QtWinExtras. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtCore/qglobal.h> -#include <QtCore/qt_windows.h> - -QT_BEGIN_NAMESPACE - -extern const GUID qCLSID_DestinationList; -extern const GUID qCLSID_EnumerableObjectCollection; -extern const GUID qIID_ICustomDestinationList; -extern const GUID qIID_IApplicationDestinations; -extern const GUID qCLSID_ApplicationDestinations; -extern const GUID qIID_IApplicationDocumentLists; -extern const GUID qCLSID_ApplicationDocumentLists; -extern const GUID qIID_IObjectArray; -extern const GUID qIID_IObjectCollection; -extern const GUID qIID_IPropertyStore; -extern const GUID qIID_ITaskbarList3; -extern const GUID qIID_ITaskbarList4; -extern const GUID qIID_IShellItem2; -extern const GUID qIID_IShellLinkW; -extern const GUID qIID_ITaskbarList; -extern const GUID qIID_ITaskbarList2; -extern const GUID qIID_IUnknown; -extern const GUID qGUID_NULL; - -QT_END_NAMESPACE - -#endif // WINDOWSGUIDSDEFS_P_H diff --git a/src/winextras/winextras.pro b/src/winextras/winextras.pro deleted file mode 100644 index caedc0a..0000000 --- a/src/winextras/winextras.pro +++ /dev/null @@ -1,57 +0,0 @@ -TARGET = QtWinExtras - -QT += gui-private core-private - -SOURCES += \ - qwinfunctions.cpp \ - qwintaskbarbutton.cpp \ - qwintaskbarprogress.cpp \ - windowsguidsdefs.cpp \ - qwinjumplist.cpp \ - qwinjumplistcategory.cpp \ - qwinjumplistitem.cpp \ - qwineventfilter.cpp \ - qwinthumbnailtoolbar.cpp \ - qwinthumbnailtoolbutton.cpp \ - qwinevent.cpp - -HEADERS += \ - qwinfunctions.h \ - qwinextrasglobal.h \ - qwinfunctions_p.h \ - qwintaskbarbutton_p.h \ - qwintaskbarbutton.h \ - qwintaskbarprogress.h \ - qwinjumplist.h \ - qwinjumplist_p.h \ - qwinjumplistcategory.h \ - qwinjumplistcategory_p.h \ - qwinjumplistitem.h \ - qwinjumplistitem_p.h \ - winshobjidl_p.h \ - winpropkey_p.h \ - qwineventfilter_p.h \ - qwinthumbnailtoolbar.h \ - qwinthumbnailtoolbar_p.h \ - qwinthumbnailtoolbutton.h \ - qwinthumbnailtoolbutton_p.h \ - qwinevent.h \ - windowsguidsdefs_p.h - -QMAKE_DOCS = $$PWD/doc/qtwinextras.qdocconf - -LIBS_PRIVATE += -lole32 -lshlwapi -lshell32 -ldwmapi -win32:!qtHaveModule(opengl)|qtConfig(dynamicgl):LIBS_PRIVATE += -lgdi32 - -OTHER_FILES += \ - doc/qtwinextras.qdocconf \ - doc/src/qtwinextras-index.qdoc \ - doc/src/qtwinextras-module-cpp.qdoc \ - doc/src/qtwinextras-module-qml.qdoc \ - doc/snippets/code/use-qtwinextras.pro \ - doc/snippets/code/jumplist.cpp \ - doc/snippets/code/use-qtwinextras.cpp \ - doc/snippets/code/thumbbar.cpp \ - doc/snippets/code/thumbbar.qml - -load(qt_module) diff --git a/src/winextras/winpropkey_p.h b/src/winextras/winpropkey_p.h deleted file mode 100644 index 53646fc..0000000 --- a/src/winextras/winpropkey_p.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef WINPROPKEY_P_H -#define WINPROPKEY_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of QtWinExtras. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtCore/qglobal.h> -#include <propkey.h> - -QT_BEGIN_NAMESPACE - -extern const PROPERTYKEY qPKEY_Title; -extern const PROPERTYKEY qPKEY_AppUserModel_IsDestListSeparator; -extern const PROPERTYKEY qPKEY_Link_Arguments; - -QT_END_NAMESPACE - -#endif // WINPROPKEY_P_H diff --git a/src/winextras/winshobjidl_p.h b/src/winextras/winshobjidl_p.h deleted file mode 100644 index efd28c6..0000000 --- a/src/winextras/winshobjidl_p.h +++ /dev/null @@ -1,248 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef WINSHOBJIDL_P_H -#define WINSHOBJIDL_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <shobjidl.h> - -#ifndef __ITaskbarList_INTERFACE_DEFINED__ -#define __ITaskbarList_INTERFACE_DEFINED__ - -struct ITaskbarList : IUnknown -{ - virtual HRESULT STDMETHODCALLTYPE HrInit() = 0; - virtual HRESULT STDMETHODCALLTYPE AddTab(HWND hwnd) = 0; - virtual HRESULT STDMETHODCALLTYPE DeleteTab(HWND hwnd) = 0; - virtual HRESULT STDMETHODCALLTYPE ActivateTab(HWND hwnd) = 0; - virtual HRESULT STDMETHODCALLTYPE SetActiveAlt(HWND hwnd) = 0; -}; - -#endif - -#ifndef __ITaskbarList2_INTERFACE_DEFINED__ -#define __ITaskbarList2_INTERFACE_DEFINED__ - -struct ITaskbarList2 : ITaskbarList -{ - virtual HRESULT STDMETHODCALLTYPE MarkFullscreenWindow(HWND hwnd, BOOL fullscreen) = 0; -}; - -#endif - -#ifndef __ITaskbarList3_INTERFACE_DEFINED__ -#define __ITaskbarList3_INTERFACE_DEFINED__ - -enum THUMBBUTTONMASK { - THB_BITMAP = 0x00000001, - THB_ICON = 0x00000002, - THB_TOOLTIP = 0x00000004, - THB_FLAGS = 0x00000008 -}; - -enum THUMBBUTTONFLAGS { - THBF_ENABLED = 0x00000000, - THBF_DISABLED = 0x00000001, - THBF_DISMISSONCLICK = 0x00000002, - THBF_NOBACKGROUND = 0x00000004, - THBF_HIDDEN = 0x00000008, - THBF_NONINTERACTIVE = 0x00000010 -}; - -enum TBPFLAG { - TBPF_NOPROGRESS = 0x00000000, - TBPF_INDETERMINATE = 0x00000001, - TBPF_NORMAL = 0x00000002, - TBPF_ERROR = 0x00000004, - TBPF_PAUSED = 0x00000008 -}; - -enum STPFLAG { - STPF_NONE = 0x00000000, - STPF_USEAPPTHUMBNAILALWAYS = 0x00000001, - STPF_USEAPPTHUMBNAILWHENACTIVE = 0x00000002, - STPF_USEAPPPEEKALWAYS = 0x00000004, - STPF_USEAPPPEEKWHENACTIVE = 0x00000008 -}; - -struct THUMBBUTTON -{ - THUMBBUTTONMASK dwMask; - UINT iId; - UINT iBitmap; - HICON hIcon; - WCHAR szTip[260]; - THUMBBUTTONFLAGS dwFlags; -}; - -struct ITaskbarList3 : ITaskbarList2 -{ - virtual HRESULT STDMETHODCALLTYPE SetProgressValue(HWND hwnd, ULONGLONG completed, ULONGLONG total) = 0; - virtual HRESULT STDMETHODCALLTYPE SetProgressState(HWND hwnd, TBPFLAG tbpFlags) = 0; - virtual HRESULT STDMETHODCALLTYPE RegisterTab(HWND tab, HWND window) = 0; - virtual HRESULT STDMETHODCALLTYPE UnregisterTab(HWND tab) = 0; - virtual HRESULT STDMETHODCALLTYPE SetTabOrder(HWND tab, HWND insertBefore) = 0; - virtual HRESULT STDMETHODCALLTYPE SetTabActive(HWND tab, HWND window, DWORD reserved = 0) = 0; - virtual HRESULT STDMETHODCALLTYPE ThumbBarAddButtons(HWND hwnd, UINT count, THUMBBUTTON buttons) = 0; - virtual HRESULT STDMETHODCALLTYPE ThumbBarUpdateButtons(HWND hwnd, UINT count, THUMBBUTTON *buttons) = 0; - virtual HRESULT STDMETHODCALLTYPE ThumbBarSetImageList(HWND hwnd, HIMAGELIST imglist) = 0; - virtual HRESULT STDMETHODCALLTYPE SetOverlayIcon(HWND hwnd, HICON icon, LPCWSTR description) = 0; - virtual HRESULT STDMETHODCALLTYPE SetThumbnailTooltip(HWND hwnd, LPCWSTR tooltip) = 0; - virtual HRESULT STDMETHODCALLTYPE SetThumbnailClip(HWND hwnd, RECT *clip) = 0; -}; - -#endif - -#ifndef __ITaskbarList4_INTERFACE_DEFINED__ -#define __ITaskbarList4_INTERFACE_DEFINED__ - -struct ITaskbarList4 : ITaskbarList3 -{ - virtual HRESULT STDMETHODCALLTYPE SetTabProperties(HWND tab, STPFLAG flags) = 0; -}; - -#endif - -#ifndef __IObjectArray_INTERFACE_DEFINED__ -#define __IObjectArray_INTERFACE_DEFINED__ - -struct IObjectArray : IUnknown -{ -public: - virtual HRESULT STDMETHODCALLTYPE GetCount(UINT *count) = 0; - virtual HRESULT STDMETHODCALLTYPE GetAt(UINT index, REFIID iid, void **ppv) = 0; -}; - -#endif - -#ifndef __IObjectCollection_INTERFACE_DEFINED__ -#define __IObjectCollection_INTERFACE_DEFINED__ - -struct IObjectCollection : IObjectArray -{ -public: - virtual HRESULT STDMETHODCALLTYPE AddObject(IUnknown *punk) = 0; - virtual HRESULT STDMETHODCALLTYPE AddFromArray(IObjectArray *poaSource) = 0; - virtual HRESULT STDMETHODCALLTYPE RemoveObjectAt(UINT uiIndex) = 0; - virtual HRESULT STDMETHODCALLTYPE Clear() = 0; -}; - -#endif - -#ifndef __ICustomDestinationList_INTERFACE_DEFINED__ -#define __ICustomDestinationList_INTERFACE_DEFINED__ - -enum KNOWNDESTCATEGORY { - KDC_FREQUENT = 1, - KDC_RECENT -}; - -struct ICustomDestinationList : IUnknown -{ -public: - virtual HRESULT STDMETHODCALLTYPE SetAppID(LPCWSTR pszAppID) = 0; - virtual HRESULT STDMETHODCALLTYPE BeginList(UINT *pcMinSlots, REFIID riid, void **ppv) = 0; - virtual HRESULT STDMETHODCALLTYPE AppendCategory(LPCWSTR pszCategory, IObjectArray *poa) = 0; - virtual HRESULT STDMETHODCALLTYPE AppendKnownCategory(KNOWNDESTCATEGORY category) = 0; - virtual HRESULT STDMETHODCALLTYPE AddUserTasks(IObjectArray *poa) = 0; - virtual HRESULT STDMETHODCALLTYPE CommitList() = 0; - virtual HRESULT STDMETHODCALLTYPE GetRemovedDestinations(REFIID riid, void **ppv) = 0; - virtual HRESULT STDMETHODCALLTYPE DeleteList(LPCWSTR pszAppID) = 0; - virtual HRESULT STDMETHODCALLTYPE AbortList() = 0; -}; - -#endif - -#ifndef __IApplicationDocumentLists_INTERFACE_DEFINED__ -#define __IApplicationDocumentLists_INTERFACE_DEFINED__ - -enum APPDOCLISTTYPE { - ADLT_RECENT = 0, - ADLT_FREQUENT -}; - -struct IApplicationDocumentLists : public IUnknown -{ -public: - virtual HRESULT STDMETHODCALLTYPE SetAppID(LPCWSTR pszAppID) = 0; - virtual HRESULT STDMETHODCALLTYPE GetList(APPDOCLISTTYPE listtype, UINT cItemsDesired, REFIID riid, void **ppv) = 0; -}; -#endif - -#ifndef __IApplicationDestinations_INTERFACE_DEFINED__ -#define __IApplicationDestinations_INTERFACE_DEFINED__ - -struct IApplicationDestinations : public IUnknown -{ -public: - virtual HRESULT STDMETHODCALLTYPE SetAppID(LPCWSTR pszAppID) = 0; - virtual HRESULT STDMETHODCALLTYPE RemoveDestination(IUnknown *punk) = 0; - virtual HRESULT STDMETHODCALLTYPE RemoveAllDestinations( void) = 0; -}; - -#endif - -#ifdef Q_CC_MINGW - -# if !defined(__MINGW64_VERSION_MAJOR) || !defined(__MINGW64_VERSION_MINOR) || __MINGW64_VERSION_MAJOR * 100 + __MINGW64_VERSION_MINOR < 301 - -typedef struct SHARDAPPIDINFOLINK -{ - IShellLink *psl; // An IShellLink instance that when launched opens a recently used item in the specified - // application. This link is not added to the recent docs folder, but will be added to the - // specified application's destination list. - PCWSTR pszAppID; // The id of the application that should be associated with this recent doc. -} SHARDAPPIDINFOLINK; - -# endif // !defined(__MINGW64_VERSION_MAJOR) || !defined(__MINGW64_VERSION_MINOR) || __MINGW64_VERSION_MAJOR * 100 + __MINGW64_VERSION_MINOR < 301 - -#endif - -#endif // WINSHOBJIDL_P_H diff --git a/sync.profile b/sync.profile deleted file mode 100644 index 4a980a7..0000000 --- a/sync.profile +++ /dev/null @@ -1,3 +0,0 @@ -%modules = ( - "QtWinExtras" => "$basedir/src/winextras", -); diff --git a/tests/.prev_CMakeLists.txt b/tests/.prev_CMakeLists.txt deleted file mode 100644 index 2214137..0000000 --- a/tests/.prev_CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Generated from tests.pro. - -if(QT_BUILD_STANDALONE_TESTS) - # Add qt_find_package calls for extra dependencies that need to be found when building - # the standalone tests here. -endif() -qt_build_tests() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt deleted file mode 100644 index 2214137..0000000 --- a/tests/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -# Generated from tests.pro. - -if(QT_BUILD_STANDALONE_TESTS) - # Add qt_find_package calls for extra dependencies that need to be found when building - # the standalone tests here. -endif() -qt_build_tests() diff --git a/tests/auto/.prev_CMakeLists.txt b/tests/auto/.prev_CMakeLists.txt deleted file mode 100644 index bac7e9e..0000000 --- a/tests/auto/.prev_CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Generated from auto.pro. - -add_subdirectory(cmake) -add_subdirectory(qwinthumbnailtoolbar) -add_subdirectory(qpixmap) -add_subdirectory(qwintaskbarbutton) -add_subdirectory(qwintaskbarprogress) -add_subdirectory(qwinjumplist) diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt deleted file mode 100644 index e8a3f77..0000000 --- a/tests/auto/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Generated from auto.pro. - -# add_subdirectory(cmake) # special case remove -add_subdirectory(qwinthumbnailtoolbar) -add_subdirectory(qpixmap) -add_subdirectory(qwintaskbarbutton) -add_subdirectory(qwintaskbarprogress) -add_subdirectory(qwinjumplist) diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro deleted file mode 100644 index 331bf7a..0000000 --- a/tests/auto/auto.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS += \ - cmake \ - qwinthumbnailtoolbar \ - qpixmap \ - qwintaskbarbutton \ - qwintaskbarprogress \ - qwinjumplist diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt deleted file mode 100644 index 989b8f8..0000000 --- a/tests/auto/cmake/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -# Generated from cmake.pro. - diff --git a/tests/auto/cmake/cmake.pro b/tests/auto/cmake/cmake.pro deleted file mode 100644 index 0afd8fe..0000000 --- a/tests/auto/cmake/cmake.pro +++ /dev/null @@ -1,7 +0,0 @@ - -# Cause make to do nothing. -TEMPLATE = subdirs - -CMAKE_QT_MODULES_UNDER_TEST = winextras - -CONFIG += ctest_testcase diff --git a/tests/auto/qpixmap/CMakeLists.txt b/tests/auto/qpixmap/CMakeLists.txt deleted file mode 100644 index 3fa1407..0000000 --- a/tests/auto/qpixmap/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -# Generated from qpixmap.pro. - -##################################################################### -## tst_qpixmap Test: -##################################################################### - -qt_add_test(tst_qpixmap - SOURCES - tst_qpixmap.cpp - PUBLIC_LIBRARIES - Qt::Gui - Qt::WinExtras -) - -## Scopes: -##################################################################### - -qt_extend_target(tst_qpixmap CONDITION QT_FEATURE_dynamicgl OR (WIN32 AND NOT TARGET Qt::OpenGL) - PUBLIC_LIBRARIES - gdi32 - user32 -) diff --git a/tests/auto/qpixmap/data/icon_32bpp.ico b/tests/auto/qpixmap/data/icon_32bpp.ico Binary files differdeleted file mode 100644 index dbb55cd..0000000 --- a/tests/auto/qpixmap/data/icon_32bpp.ico +++ /dev/null diff --git a/tests/auto/qpixmap/data/icon_32bpp_16x16.png b/tests/auto/qpixmap/data/icon_32bpp_16x16.png Binary files differdeleted file mode 100644 index f23f398..0000000 --- a/tests/auto/qpixmap/data/icon_32bpp_16x16.png +++ /dev/null diff --git a/tests/auto/qpixmap/data/icon_32bpp_256x256.png b/tests/auto/qpixmap/data/icon_32bpp_256x256.png Binary files differdeleted file mode 100644 index 293f1c5..0000000 --- a/tests/auto/qpixmap/data/icon_32bpp_256x256.png +++ /dev/null diff --git a/tests/auto/qpixmap/data/icon_32bpp_32x32.png b/tests/auto/qpixmap/data/icon_32bpp_32x32.png Binary files differdeleted file mode 100644 index bfdb1fe..0000000 --- a/tests/auto/qpixmap/data/icon_32bpp_32x32.png +++ /dev/null diff --git a/tests/auto/qpixmap/data/icon_32bpp_48x48.png b/tests/auto/qpixmap/data/icon_32bpp_48x48.png Binary files differdeleted file mode 100644 index 7dd2d13..0000000 --- a/tests/auto/qpixmap/data/icon_32bpp_48x48.png +++ /dev/null diff --git a/tests/auto/qpixmap/data/icon_8bpp.ico b/tests/auto/qpixmap/data/icon_8bpp.ico Binary files differdeleted file mode 100644 index 4341a33..0000000 --- a/tests/auto/qpixmap/data/icon_8bpp.ico +++ /dev/null diff --git a/tests/auto/qpixmap/data/icon_8bpp_16x16.png b/tests/auto/qpixmap/data/icon_8bpp_16x16.png Binary files differdeleted file mode 100644 index 03b1a65..0000000 --- a/tests/auto/qpixmap/data/icon_8bpp_16x16.png +++ /dev/null diff --git a/tests/auto/qpixmap/data/icon_8bpp_32x32.png b/tests/auto/qpixmap/data/icon_8bpp_32x32.png Binary files differdeleted file mode 100644 index 0ef47c5..0000000 --- a/tests/auto/qpixmap/data/icon_8bpp_32x32.png +++ /dev/null diff --git a/tests/auto/qpixmap/data/icon_8bpp_48x48.png b/tests/auto/qpixmap/data/icon_8bpp_48x48.png Binary files differdeleted file mode 100644 index 2060854..0000000 --- a/tests/auto/qpixmap/data/icon_8bpp_48x48.png +++ /dev/null diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro deleted file mode 100644 index 47c70fc..0000000 --- a/tests/auto/qpixmap/qpixmap.pro +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG += testcase -TARGET = tst_qpixmap -QT += gui testlib winextras -SOURCES += tst_qpixmap.cpp -win32:!qtHaveModule(opengl)|qtConfig(dynamicgl):LIBS += -lgdi32 -luser32 diff --git a/tests/auto/qpixmap/tst_qpixmap.cpp b/tests/auto/qpixmap/tst_qpixmap.cpp deleted file mode 100644 index e16889d..0000000 --- a/tests/auto/qpixmap/tst_qpixmap.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtTest/QtTest> -#include <QtCore/qt_windows.h> -#include <QtCore/QFileInfo> -#include <QtGui/QPainter> -#include <QtGui/QPixmap> -#include <QtGui/QImage> -#include <QtWinExtras/QtWin> - -class tst_QPixmap : public QObject -{ - Q_OBJECT - -public: - tst_QPixmap() : m_dataDirectory(QFINDTESTDATA("data")) {} - -private slots: - void initTestCase(); - - void toHBITMAP_data(); - void toHBITMAP(); - void fromHBITMAP_data(); - void fromHBITMAP(); - - void toHICON_data(); - void toHICON(); - void fromHICON_data(); - void fromHICON(); - - void imageConversion(); - -private: - const QString m_dataDirectory; -}; - -void tst_QPixmap::initTestCase() -{ - QVERIFY(!m_dataDirectory.isEmpty()); -} - -void tst_QPixmap::toHBITMAP_data() -{ - QTest::addColumn<int>("red"); - QTest::addColumn<int>("green"); - QTest::addColumn<int>("blue"); - - QTest::newRow("red") << 255 << 0 << 0; - QTest::newRow("green") << 0 << 255 << 0; - QTest::newRow("blue") << 0 << 0 << 255; -} - -void tst_QPixmap::toHBITMAP() -{ - QFETCH(int, red); - QFETCH(int, green); - QFETCH(int, blue); - - QPixmap pm(100, 100); - pm.fill(QColor(red, green, blue)); - - const HBITMAP bitmap = QtWin::toHBITMAP(pm); - - QVERIFY(bitmap != nullptr); - - // Verify size - BITMAP bitmapInfo; - memset(&bitmapInfo, 0, sizeof(BITMAP)); - - QVERIFY(GetObject(bitmap, sizeof(BITMAP), &bitmapInfo)); - - QCOMPARE(LONG(100), bitmapInfo.bmWidth); - QCOMPARE(LONG(100), bitmapInfo.bmHeight); - - const HDC displayDc = GetDC(nullptr); - const HDC bitmapDc = CreateCompatibleDC(displayDc); - - const auto nullBitmap = static_cast<HBITMAP>(SelectObject(bitmapDc, bitmap)); - - const COLORREF pixel = GetPixel(bitmapDc, 0, 0); - QCOMPARE(int(GetRValue(pixel)), red); - QCOMPARE(int(GetGValue(pixel)), green); - QCOMPARE(int(GetBValue(pixel)), blue); - - // Clean up - SelectObject(bitmapDc, nullBitmap); - DeleteObject(bitmap); - DeleteDC(bitmapDc); - ReleaseDC(nullptr, displayDc); -} - -void tst_QPixmap::fromHBITMAP_data() -{ - toHBITMAP_data(); -} - -void tst_QPixmap::fromHBITMAP() -{ - QFETCH(int, red); - QFETCH(int, green); - QFETCH(int, blue); - - const HDC displayDc = GetDC(nullptr); - const HDC bitmapDc = CreateCompatibleDC(displayDc); - const HBITMAP bitmap = CreateCompatibleBitmap(displayDc, 100, 100); - SelectObject(bitmapDc, bitmap); - - SelectObject(bitmapDc, GetStockObject(NULL_PEN)); - const HGDIOBJ oldBrush = SelectObject(bitmapDc, CreateSolidBrush(RGB(red, green, blue))); - Rectangle(bitmapDc, 0, 0, 100, 100); - - const QPixmap pixmap = QtWin::fromHBITMAP(bitmap); - QCOMPARE(pixmap.width(), 100); - QCOMPARE(pixmap.height(), 100); - - const QImage image = pixmap.toImage(); - const QRgb pixel = image.pixel(0, 0); - QCOMPARE(qRed(pixel), red); - QCOMPARE(qGreen(pixel), green); - QCOMPARE(qBlue(pixel), blue); - - DeleteObject(SelectObject(bitmapDc, oldBrush)); - DeleteObject(SelectObject(bitmapDc, bitmap)); - DeleteDC(bitmapDc); - ReleaseDC(nullptr, displayDc); -} - -static bool compareImages(const QImage &actual, const QImage &expected, - QByteArray *errorMessage) -{ - if (actual.size() != expected.size()) { - QString s; - QDebug(&s) << "Size mismatch, actual: " << actual.size() << " expected: " << expected.size(); - *errorMessage = s.toLocal8Bit(); - return false; - } - if (actual.format() != expected.format()) { - *errorMessage = QByteArrayLiteral("Format mismatch, actual: ") - + QByteArray::number(actual.format()) - + QByteArrayLiteral(", expected: ") + QByteArray::number(expected.format()); - return false; - } - - static const int fuzz = 1; - - for (int y = 0; y < actual.height(); ++y) { - for (int x = 0; x < expected.width(); ++x) { - const QRgb actualRgb = actual.pixel(x, y); - const QRgb expectedRgb = expected.pixel(x, y); - const bool pixelMatches = - qAbs(qRed(actualRgb) - qRed(expectedRgb)) <= fuzz - && qAbs(qGreen(actualRgb) - qGreen(expectedRgb)) <= fuzz - && qAbs(qBlue(actualRgb) - qBlue(expectedRgb)) <= fuzz - && qAbs(qAlpha(actualRgb) - qAlpha(expectedRgb)) <= fuzz; - if (!pixelMatches) { - QString s; - QDebug(&s) << "Pixmal mismatch at " << x << ',' << y << " actual: " - << QColor(actualRgb) << " expected: " << QColor(expectedRgb); - *errorMessage = s.toLocal8Bit(); - return false; - } - } - } - return true; -} - -static inline QString pngFileName(const QString &image, int width, int height) -{ - return image + u'_' + QString::number(width) - + u'x' + QString::number(height) + QStringLiteral(".png"); -} - -void tst_QPixmap::toHICON_data() -{ - QTest::addColumn<QString>("image"); - QTest::addColumn<int>("width"); - QTest::addColumn<int>("height"); - - QTest::newRow("32bpp_16x16") << m_dataDirectory + QStringLiteral("/icon_32bpp") << 16 << 16; - QTest::newRow("32bpp_32x32") << m_dataDirectory + QStringLiteral("/icon_32bpp") << 32 << 32; - QTest::newRow("32bpp_48x48") << m_dataDirectory + QStringLiteral("/icon_32bpp") << 48 << 48; - QTest::newRow("32bpp_256x256") << m_dataDirectory + QStringLiteral("/icon_32bpp") << 256 << 256; - - QTest::newRow("8bpp_16x16") << m_dataDirectory + QStringLiteral("/icon_8bpp") << 16 << 16; - QTest::newRow("8bpp_32x32") << m_dataDirectory + QStringLiteral("/icon_8bpp") << 32 << 32; - QTest::newRow("8bpp_48x48") << m_dataDirectory + QStringLiteral("/icon_8bpp") << 48 << 48; -} - -void tst_QPixmap::toHICON() -{ - QFETCH(int, width); - QFETCH(int, height); - QFETCH(QString, image); - - QPixmap empty(width, height); - empty.fill(Qt::transparent); - - const HDC displayDc = GetDC(nullptr); - const HDC bitmapDc = CreateCompatibleDC(displayDc); - const HBITMAP bitmap = QtWin::toHBITMAP(empty, QtWin::HBitmapAlpha); - SelectObject(bitmapDc, bitmap); - - const QString imageFileName = pngFileName(image, width, height); - QVERIFY2(QFileInfo::exists(imageFileName), qPrintable(imageFileName)); - - const QImage imageFromFile = QImage(imageFileName).convertToFormat(QImage::Format_ARGB32_Premultiplied); - QVERIFY(!imageFromFile.isNull()); - - const HICON icon = QtWin::toHICON(QPixmap::fromImage(imageFromFile)); - - DrawIconEx(bitmapDc, 0, 0, icon, width, height, 0, nullptr, DI_NORMAL); - - DestroyIcon(icon); - DeleteDC(bitmapDc); - - const QImage imageFromHICON = QtWin::fromHBITMAP(bitmap, QtWin::HBitmapAlpha).toImage(); - QVERIFY(!imageFromHICON.isNull()); - - ReleaseDC(nullptr, displayDc); - - // fuzzy comparison must be used, as the pixel values change slightly during conversion - // between QImage::Format_ARGB32 and QImage::Format_ARGB32_Premultiplied, or elsewhere - QByteArray errorMessage; - QVERIFY2(compareImages(imageFromHICON, imageFromFile, &errorMessage), errorMessage.constData()); -} - -void tst_QPixmap::fromHICON_data() -{ - toHICON_data(); -} - -void tst_QPixmap::fromHICON() -{ - QFETCH(int, width); - QFETCH(int, height); - QFETCH(QString, image); - - const QString iconFileName = image + QStringLiteral(".ico"); - QVERIFY2(QFileInfo::exists(iconFileName), qPrintable(iconFileName)); - - const auto icon = - static_cast<HICON>(LoadImage(nullptr, reinterpret_cast<const wchar_t *>(iconFileName.utf16()), - IMAGE_ICON, width, height, LR_LOADFROMFILE)); - const QImage imageFromHICON = QtWin::fromHICON(icon).toImage(); - DestroyIcon(icon); - - const QString imageFileName = pngFileName(image, width, height); - QVERIFY2(QFileInfo::exists(imageFileName), qPrintable(imageFileName)); - - const QImage imageFromFile = QImage(imageFileName).convertToFormat(QImage::Format_ARGB32_Premultiplied); - QVERIFY(!imageFromFile.isNull()); - - // fuzzy comparison must be used, as the pixel values change slightly during conversion - // between QImage::Format_ARGB32 and QImage::Format_ARGB32_Premultiplied, or elsewhere - QByteArray errorMessage; - QVERIFY2(compareImages(imageFromHICON, imageFromFile, &errorMessage), errorMessage.constData()); -} - -void tst_QPixmap::imageConversion() -{ - // Extensive testing of all formats is done in QtGui; this merely tests - // the exports/linkage. - QImage image(73, 57, QImage::Format_ARGB32_Premultiplied); - image.fill(Qt::red); - QPainter painter(&image); - painter.drawLine(0, 0, image.width(), image.height()); - const HBITMAP hBitMap = QtWin::imageToHBITMAP(image); - QVERIFY(hBitMap); - const QImage fromHBitMap = QtWin::imageFromHBITMAP(hBitMap, QtWin::HBitmapPremultipliedAlpha); - QCOMPARE(fromHBitMap, image); - DeleteObject(hBitMap); -} - -QTEST_MAIN(tst_QPixmap) - -#include "tst_qpixmap.moc" diff --git a/tests/auto/qwinjumplist/CMakeLists.txt b/tests/auto/qwinjumplist/CMakeLists.txt deleted file mode 100644 index a300ee8..0000000 --- a/tests/auto/qwinjumplist/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Generated from qwinjumplist.pro. - -##################################################################### -## tst_qwinjumplist Test: -##################################################################### - -qt_add_test(tst_qwinjumplist - SOURCES - tst_qwinjumplist.cpp - PUBLIC_LIBRARIES - Qt::Gui - Qt::WinExtras -) diff --git a/tests/auto/qwinjumplist/qwinjumplist.pro b/tests/auto/qwinjumplist/qwinjumplist.pro deleted file mode 100644 index 70657b4..0000000 --- a/tests/auto/qwinjumplist/qwinjumplist.pro +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG += testcase -TARGET = tst_qwinjumplist -QT += testlib winextras -SOURCES += tst_qwinjumplist.cpp diff --git a/tests/auto/qwinjumplist/tst_qwinjumplist.cpp b/tests/auto/qwinjumplist/tst_qwinjumplist.cpp deleted file mode 100644 index 4676524..0000000 --- a/tests/auto/qwinjumplist/tst_qwinjumplist.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtTest/QtTest> -#include <QWinJumpList> -#include <QWinJumpListItem> -#include <QWinJumpListCategory> -#include <QOperatingSystemVersion> - -Q_DECLARE_METATYPE(QWinJumpListItem::Type) - -class tst_QWinJumpList : public QObject -{ - Q_OBJECT - -private slots: - void testRecent(); - void testFrequent(); - void testTasks(); - void testCategories(); - void testItems_data(); - void testItems(); -}; - -static inline QByteArray msgFileNameMismatch(const QString &f1, const QString &f2) -{ - const QString result = u'"' + f1 + QStringLiteral("\" != \"") - + f2 + u'"'; - return result.toLocal8Bit(); -} - -void tst_QWinJumpList::testRecent() -{ - if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows8_1) - QSKIP("QTBUG-48751: Recent items do not work on Windows 8.1 or 10", Continue); - QScopedPointer<QWinJumpList> jumplist(new QWinJumpList); - QWinJumpListCategory *recent1 = jumplist->recent(); - QVERIFY(recent1); - QVERIFY(!recent1->isVisible()); - QVERIFY(recent1->title().isEmpty()); - - recent1->clear(); - QVERIFY(recent1->isEmpty()); - - recent1->addItem(nullptr); - QVERIFY(recent1->isEmpty()); - - recent1->setVisible(true); - QVERIFY(recent1->isVisible()); - recent1->addLink(QStringLiteral("tst_QWinJumpList"), QCoreApplication::applicationFilePath()); - - QTest::ignoreMessage(QtWarningMsg, "QWinJumpListCategory::addItem(): only tasks/custom categories support separators."); - recent1->addSeparator(); - - QTest::ignoreMessage(QtWarningMsg, "QWinJumpListCategory::addItem(): only tasks/custom categories support destinations."); - recent1->addDestination(QCoreApplication::applicationDirPath()); - - // cleanup the first jumplist instance and give the system a little time to update. - // then test that another jumplist instance loads up the recent item(s) added above - jumplist.reset(); - QTest::qWait(100); - - jumplist.reset(new QWinJumpList); - QWinJumpListCategory *recent2 = jumplist->recent(); - QVERIFY(recent2); - QCOMPARE(recent2->count(), 1); - - QWinJumpListItem* item = recent2->items().value(0); - QVERIFY(item); - const QString itemPath = item->filePath(); - const QString applicationFilePath = QCoreApplication::applicationFilePath(); - QVERIFY2(!itemPath.compare(applicationFilePath, Qt::CaseInsensitive), - msgFileNameMismatch(itemPath, applicationFilePath)); - QEXPECT_FAIL("", "QWinJumpListItem::title not supported for recent items", Continue); - QCOMPARE(item->title(), QStringLiteral("tst_QWinJumpList")); - - recent2->clear(); - QVERIFY(recent2->isEmpty()); -} - -void tst_QWinJumpList::testFrequent() -{ - if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows8_1) - QSKIP("QTBUG-48751: Frequent items do not work on Windows 8.1 or 10", Continue); - QScopedPointer<QWinJumpList> jumplist(new QWinJumpList); - QWinJumpListCategory *frequent1 = jumplist->frequent(); - QVERIFY(frequent1); - QVERIFY(!frequent1->isVisible()); - QVERIFY(frequent1->title().isEmpty()); - - frequent1->clear(); - QVERIFY(frequent1->isEmpty()); - - frequent1->addItem(nullptr); - QVERIFY(frequent1->isEmpty()); - - frequent1->setVisible(true); - QVERIFY(frequent1->isVisible()); - frequent1->addLink(QStringLiteral("tst_QWinJumpList"), QCoreApplication::applicationFilePath()); - - QTest::ignoreMessage(QtWarningMsg, "QWinJumpListCategory::addItem(): only tasks/custom categories support separators."); - frequent1->addSeparator(); - - QTest::ignoreMessage(QtWarningMsg, "QWinJumpListCategory::addItem(): only tasks/custom categories support destinations."); - frequent1->addDestination(QCoreApplication::applicationDirPath()); - - // cleanup the first jumplist instance and give the system a little time to update. - // then test that another jumplist instance loads up the frequent item(s) added above - jumplist.reset(); - QTest::qWait(100); - - jumplist.reset(new QWinJumpList); - QWinJumpListCategory *frequent2 = jumplist->frequent(); - QVERIFY(frequent2); - QCOMPARE(frequent2->count(), 1); - - QWinJumpListItem* item = frequent2->items().value(0); - QVERIFY(item); - const QString itemPath = item->filePath(); - const QString applicationFilePath = QCoreApplication::applicationFilePath(); - QVERIFY2(!itemPath.compare(applicationFilePath, Qt::CaseInsensitive), - msgFileNameMismatch(itemPath, applicationFilePath)); - QEXPECT_FAIL("", "QWinJumpListItem::title not supported for frequent items", Continue); - QCOMPARE(item->title(), QStringLiteral("tst_QWinJumpList")); - - frequent2->clear(); - QVERIFY(frequent2->isEmpty()); -} - -void tst_QWinJumpList::testTasks() -{ - QWinJumpList jumplist; - QWinJumpListCategory *tasks = jumplist.tasks(); - QVERIFY(tasks); - QVERIFY(!tasks->isVisible()); - QVERIFY(tasks->isEmpty()); - QVERIFY(tasks->title().isEmpty()); - - tasks->setVisible(true); - QVERIFY(tasks->isVisible()); - - tasks->addItem(nullptr); - QVERIFY(tasks->isEmpty()); - - QWinJumpListItem* link1 = tasks->addLink(QStringLiteral("tst_QWinJumpList"), QCoreApplication::applicationFilePath()); - QCOMPARE(link1->type(), QWinJumpListItem::Link); - QCOMPARE(link1->title(), QStringLiteral("tst_QWinJumpList")); - QCOMPARE(link1->filePath(), QCoreApplication::applicationFilePath()); - QCOMPARE(tasks->count(), 1); - QCOMPARE(tasks->items(), QList<QWinJumpListItem *>() << link1); - - QWinJumpListItem* link2 = tasks->addLink(QStringLiteral("tst_QWinJumpList"), QCoreApplication::applicationFilePath(), QStringList(QStringLiteral("-test"))); - QCOMPARE(link2->type(), QWinJumpListItem::Link); - QCOMPARE(link2->title(), QStringLiteral("tst_QWinJumpList")); - QCOMPARE(link2->filePath(), QCoreApplication::applicationFilePath()); - QCOMPARE(link2->arguments(), QStringList(QStringLiteral("-test"))); - QCOMPARE(tasks->count(), 2); - QCOMPARE(tasks->items(), QList<QWinJumpListItem *>() << link1 << link2); - - QWinJumpListItem* separator = tasks->addSeparator(); - QCOMPARE(separator->type(), QWinJumpListItem::Separator); - QCOMPARE(tasks->count(), 3); - QCOMPARE(tasks->items(), QList<QWinJumpListItem *>() << link1 << link2 << separator); - - QWinJumpListItem* destination = tasks->addDestination(QCoreApplication::applicationDirPath()); - QCOMPARE(destination->type(), QWinJumpListItem::Destination); - QCOMPARE(destination->filePath(), QCoreApplication::applicationDirPath()); - QCOMPARE(tasks->count(), 4); - QCOMPARE(tasks->items(), QList<QWinJumpListItem *>() << link1 << link2 << separator << destination); - - tasks->clear(); - QVERIFY(tasks->isEmpty()); - QVERIFY(tasks->items().isEmpty()); -} - -void tst_QWinJumpList::testCategories() -{ - QWinJumpList jumplist; - QVERIFY(jumplist.categories().isEmpty()); - - jumplist.addCategory(nullptr); - - QWinJumpListCategory *cat1 = new QWinJumpListCategory(QStringLiteral("tmp")); - QCOMPARE(cat1->title(), QStringLiteral("tmp")); - cat1->setTitle(QStringLiteral("cat1")); - QCOMPARE(cat1->title(), QStringLiteral("cat1")); - - jumplist.addCategory(cat1); - QCOMPARE(jumplist.categories().count(), 1); - QCOMPARE(jumplist.categories().at(0), cat1); - - QWinJumpListCategory *cat2 = jumplist.addCategory(QStringLiteral("cat2")); - QCOMPARE(cat2->title(), QStringLiteral("cat2")); - - QCOMPARE(jumplist.categories().count(), 2); - QCOMPARE(jumplist.categories().at(0), cat1); - QCOMPARE(jumplist.categories().at(1), cat2); - - jumplist.clear(); - QVERIFY(jumplist.categories().isEmpty()); -} - -void tst_QWinJumpList::testItems_data() -{ - QTest::addColumn<QWinJumpListItem::Type>("type"); - - QTest::newRow("destination") << QWinJumpListItem::Destination; - QTest::newRow("separator") << QWinJumpListItem::Separator; - QTest::newRow("link") << QWinJumpListItem::Link; -} - -void tst_QWinJumpList::testItems() -{ - QFETCH(QWinJumpListItem::Type, type); - - QWinJumpListItem item(type); - QCOMPARE(item.type(), type); - QVERIFY(item.filePath().isNull()); - QVERIFY(item.workingDirectory().isNull()); - QVERIFY(item.icon().isNull()); - QVERIFY(item.title().isNull()); - QVERIFY(item.description().isNull()); - QVERIFY(item.arguments().isEmpty()); - - item.setType(QWinJumpListItem::Destination); - QCOMPARE(item.type(), QWinJumpListItem::Destination); - - item.setFilePath(QCoreApplication::applicationFilePath()); - QCOMPARE(item.filePath(), QCoreApplication::applicationFilePath()); - - item.setWorkingDirectory(QCoreApplication::applicationDirPath()); - QCOMPARE(item.workingDirectory(), QCoreApplication::applicationDirPath()); - - QIcon icon("qrc:/qt-project.org/qmessagebox/images/qtlogo-64.png"); - item.setIcon(icon); - QCOMPARE(item.icon().cacheKey(), icon.cacheKey()); - - item.setTitle(QStringLiteral("tst_QWinJumpList")); - QCOMPARE(item.title(), QStringLiteral("tst_QWinJumpList")); - - item.setDescription(QStringLiteral("QtWinExras - tst_QWinJumpList")); - QCOMPARE(item.description(), QStringLiteral("QtWinExras - tst_QWinJumpList")); - - item.setArguments(QCoreApplication::arguments()); - QCOMPARE(item.arguments(), QCoreApplication::arguments()); -} - -QTEST_MAIN(tst_QWinJumpList) - -#include "tst_qwinjumplist.moc" diff --git a/tests/auto/qwinmime/CMakeLists.txt b/tests/auto/qwinmime/CMakeLists.txt deleted file mode 100644 index e502d1f..0000000 --- a/tests/auto/qwinmime/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -# Generated from qwinmime.pro. - -##################################################################### -## tst_qwinmime Test: -##################################################################### - -qt_add_test(tst_qwinmime - SOURCES - tst_qwinmime.cpp - PUBLIC_LIBRARIES - Qt::Gui - Qt::Widgets - Qt::WinExtras -) diff --git a/tests/auto/qwintaskbarbutton/CMakeLists.txt b/tests/auto/qwintaskbarbutton/CMakeLists.txt deleted file mode 100644 index f313e0d..0000000 --- a/tests/auto/qwintaskbarbutton/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Generated from qwintaskbarbutton.pro. - -##################################################################### -## tst_qwintaskbarbutton Test: -##################################################################### - -qt_add_test(tst_qwintaskbarbutton - SOURCES - tst_qwintaskbarbutton.cpp - PUBLIC_LIBRARIES - Qt::Gui - Qt::WinExtras -) diff --git a/tests/auto/qwintaskbarbutton/qwintaskbarbutton.pro b/tests/auto/qwintaskbarbutton/qwintaskbarbutton.pro deleted file mode 100644 index fda7013..0000000 --- a/tests/auto/qwintaskbarbutton/qwintaskbarbutton.pro +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG += testcase -TARGET = tst_qwintaskbarbutton -QT += testlib winextras -SOURCES += tst_qwintaskbarbutton.cpp diff --git a/tests/auto/qwintaskbarbutton/tst_qwintaskbarbutton.cpp b/tests/auto/qwintaskbarbutton/tst_qwintaskbarbutton.cpp deleted file mode 100644 index a9287a0..0000000 --- a/tests/auto/qwintaskbarbutton/tst_qwintaskbarbutton.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtTest/QtTest> -#include <QWinTaskbarButton> -#include <QWinTaskbarProgress> - -class tst_QWinTaskbarButton : public QObject -{ - Q_OBJECT - -private slots: - void testWindow(); - void testOverlayIcon(); - void testOverlayAccessibleDescription(); - void testProgress(); -}; - -void tst_QWinTaskbarButton::testWindow() -{ - QWindow window; - - QWinTaskbarButton btn1; - QVERIFY(!btn1.window()); - btn1.setWindow(&window); - QCOMPARE(btn1.window(), &window); - - auto *btn2 = new QWinTaskbarButton(&window); - QCOMPARE(btn2->window(), &window); - btn2->setWindow(nullptr); - QVERIFY(!btn2->window()); -} - -void tst_QWinTaskbarButton::testOverlayIcon() -{ - QWinTaskbarButton btn; - QVERIFY(btn.overlayIcon().isNull()); - - QIcon icon; - QPixmap pixmap(64, 64); - pixmap.fill(Qt::transparent); - icon.addPixmap(pixmap); - - btn.setOverlayIcon(icon); - QCOMPARE(btn.overlayIcon(), icon); - - btn.clearOverlayIcon(); - QVERIFY(btn.overlayIcon().isNull()); -} - -void tst_QWinTaskbarButton::testOverlayAccessibleDescription() -{ - QWinTaskbarButton btn; - QVERIFY(btn.overlayAccessibleDescription().isNull()); - - btn.setOverlayAccessibleDescription(QStringLiteral("Qt")); - QCOMPARE(btn.overlayAccessibleDescription(), QStringLiteral("Qt")); - - btn.setOverlayAccessibleDescription(QString()); - QVERIFY(btn.overlayAccessibleDescription().isNull()); -} - -void tst_QWinTaskbarButton::testProgress() -{ - QWinTaskbarButton btn; - QVERIFY(btn.progress()); - QVERIFY(btn.progress()->objectName().isEmpty()); - - btn.progress()->setObjectName(QStringLiteral("DEAD")); - delete btn.progress(); - - QVERIFY(btn.progress()); - QVERIFY(btn.progress()->objectName().isEmpty()); -} - -QTEST_MAIN(tst_QWinTaskbarButton) - -#include "tst_qwintaskbarbutton.moc" diff --git a/tests/auto/qwintaskbarprogress/CMakeLists.txt b/tests/auto/qwintaskbarprogress/CMakeLists.txt deleted file mode 100644 index e218e3e..0000000 --- a/tests/auto/qwintaskbarprogress/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Generated from qwintaskbarprogress.pro. - -##################################################################### -## tst_qwintaskbarprogress Test: -##################################################################### - -qt_add_test(tst_qwintaskbarprogress - SOURCES - tst_qwintaskbarprogress.cpp - PUBLIC_LIBRARIES - Qt::Gui - Qt::WinExtras -) diff --git a/tests/auto/qwintaskbarprogress/qwintaskbarprogress.pro b/tests/auto/qwintaskbarprogress/qwintaskbarprogress.pro deleted file mode 100644 index 76b5697..0000000 --- a/tests/auto/qwintaskbarprogress/qwintaskbarprogress.pro +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG += testcase -TARGET = tst_qwintaskbarprogress -QT += testlib winextras -SOURCES += tst_qwintaskbarprogress.cpp diff --git a/tests/auto/qwintaskbarprogress/tst_qwintaskbarprogress.cpp b/tests/auto/qwintaskbarprogress/tst_qwintaskbarprogress.cpp deleted file mode 100644 index f27ba21..0000000 --- a/tests/auto/qwintaskbarprogress/tst_qwintaskbarprogress.cpp +++ /dev/null @@ -1,218 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtTest/QtTest> -#include <QWinTaskbarButton> -#include <QWinTaskbarProgress> - -class tst_QWinTaskbarProgress : public QObject -{ - Q_OBJECT - -private slots: - void testValue(); - void testRange(); - void testPause(); - void testVisibility(); - void testStop(); -}; - -void tst_QWinTaskbarProgress::testValue() -{ - QWinTaskbarButton btn; - QWinTaskbarProgress *progress = btn.progress(); - QVERIFY(progress); - QCOMPARE(progress->value(), 0); - QCOMPARE(progress->minimum(), 0); - QCOMPARE(progress->maximum(), 100); - - QSignalSpy valueSpy(progress, SIGNAL(valueChanged(int))); - QVERIFY(valueSpy.isValid()); - - progress->setValue(25); - QCOMPARE(progress->value(), 25); - QCOMPARE(valueSpy.count(), 1); - QCOMPARE(valueSpy.last().at(0).toInt(), 25); - - // under valid range -> no effect - progress->setValue(-50); - QCOMPARE(progress->value(), 25); - QCOMPARE(valueSpy.count(), 1); - - progress->setValue(75); - QCOMPARE(progress->value(), 75); - QCOMPARE(valueSpy.count(), 2); - QCOMPARE(valueSpy.last().at(0).toInt(), 75); - - // over valid range -> no effect - progress->setValue(150); - QCOMPARE(progress->value(), 75); - QCOMPARE(valueSpy.count(), 2); -} - -void tst_QWinTaskbarProgress::testRange() -{ - QWinTaskbarButton btn; - QWinTaskbarProgress *progress = btn.progress(); - QVERIFY(progress); - QCOMPARE(progress->value(), 0); - QCOMPARE(progress->minimum(), 0); - QCOMPARE(progress->maximum(), 100); - - QSignalSpy valueSpy(progress, SIGNAL(valueChanged(int))); - QSignalSpy minimumSpy(progress, SIGNAL(minimumChanged(int))); - QSignalSpy maximumSpy(progress, SIGNAL(maximumChanged(int))); - QVERIFY(valueSpy.isValid()); - QVERIFY(minimumSpy.isValid()); - QVERIFY(maximumSpy.isValid()); - - // value must remain intact - progress->setValue(50); - QCOMPARE(valueSpy.count(), 1); - - progress->setMinimum(25); - QCOMPARE(progress->minimum(), 25); - QCOMPARE(minimumSpy.count(), 1); - QCOMPARE(minimumSpy.last().at(0).toInt(), 25); - - progress->setMaximum(75); - QCOMPARE(progress->maximum(), 75); - QCOMPARE(maximumSpy.count(), 1); - QCOMPARE(maximumSpy.last().at(0).toInt(), 75); - - QCOMPARE(progress->value(), 50); - QCOMPARE(valueSpy.count(), 1); - - // value under valid range -> reset - progress->setMinimum(55); - QCOMPARE(progress->value(), 55); - QCOMPARE(progress->minimum(), 55); - QCOMPARE(valueSpy.count(), 2); - QCOMPARE(valueSpy.last().at(0).toInt(), 55); - QCOMPARE(minimumSpy.count(), 2); - QCOMPARE(minimumSpy.last().at(0).toInt(), 55); - - progress->setValue(70); - QCOMPARE(valueSpy.count(), 3); - - // value over valid range -> reset - progress->setMaximum(65); - QCOMPARE(progress->value(), 55); - QCOMPARE(progress->maximum(), 65); - QCOMPARE(valueSpy.count(), 4); - QCOMPARE(valueSpy.last().at(0).toInt(), 55); - QCOMPARE(maximumSpy.count(), 2); - QCOMPARE(maximumSpy.last().at(0).toInt(), 65); -} - -void tst_QWinTaskbarProgress::testPause() -{ - QWinTaskbarButton btn; - QWinTaskbarProgress *progress = btn.progress(); - QVERIFY(progress); - QVERIFY(!progress->isPaused()); - - QSignalSpy pausedSpy(progress, SIGNAL(pausedChanged(bool))); - QVERIFY(pausedSpy.isValid()); - - progress->setPaused(true); - QVERIFY(progress->isPaused()); - QCOMPARE(pausedSpy.count(), 1); - QCOMPARE(pausedSpy.last().at(0).toBool(), true); - - progress->setPaused(false); - QVERIFY(!progress->isPaused()); - QCOMPARE(pausedSpy.count(), 2); - QCOMPARE(pausedSpy.last().at(0).toBool(), false); - - progress->stop(); - progress->pause(); - QVERIFY(!progress->isPaused()); - QCOMPARE(pausedSpy.count(), 2); - - progress->resume(); - progress->pause(); - QVERIFY(progress->isPaused()); - QCOMPARE(pausedSpy.count(), 3); - QCOMPARE(pausedSpy.last().at(0).toBool(), true); - - progress->resume(); - QVERIFY(!progress->isPaused()); - QCOMPARE(pausedSpy.count(), 4); - QCOMPARE(pausedSpy.last().at(0).toBool(), false); -} - -void tst_QWinTaskbarProgress::testVisibility() -{ - QWinTaskbarButton btn; - QWinTaskbarProgress *progress = btn.progress(); - QVERIFY(progress); - QVERIFY(!progress->isVisible()); - - QSignalSpy visibleSpy(progress, SIGNAL(visibilityChanged(bool))); - QVERIFY(visibleSpy.isValid()); - - progress->setVisible(true); - QVERIFY(progress->isVisible()); - QCOMPARE(visibleSpy.count(), 1); - QCOMPARE(visibleSpy.last().at(0).toBool(), true); - - progress->setVisible(false); - QVERIFY(!progress->isVisible()); - QCOMPARE(visibleSpy.count(), 2); - QCOMPARE(visibleSpy.last().at(0).toBool(), false); -} - -void tst_QWinTaskbarProgress::testStop() -{ - QWinTaskbarButton btn; - QWinTaskbarProgress *progress = btn.progress(); - QVERIFY(progress); - QVERIFY(!progress->isStopped()); - - QSignalSpy stoppedSpy(progress, SIGNAL(stoppedChanged(bool))); - QVERIFY(stoppedSpy.isValid()); - - progress->pause(); - QVERIFY(progress->isPaused()); - QVERIFY(!progress->isStopped()); - progress->stop(); - QVERIFY(!progress->isPaused()); - QVERIFY(progress->isStopped()); - QCOMPARE(stoppedSpy.count(), 1); - QCOMPARE(stoppedSpy.last().at(0).toBool(), true); - - progress->resume(); - QVERIFY(!progress->isStopped()); - QCOMPARE(stoppedSpy.count(), 2); - QCOMPARE(stoppedSpy.last().at(0).toBool(), false); -} - -QTEST_MAIN(tst_QWinTaskbarProgress) - -#include "tst_qwintaskbarprogress.moc" diff --git a/tests/auto/qwinthumbnailtoolbar/CMakeLists.txt b/tests/auto/qwinthumbnailtoolbar/CMakeLists.txt deleted file mode 100644 index ec17682..0000000 --- a/tests/auto/qwinthumbnailtoolbar/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# Generated from qwinthumbnailtoolbar.pro. - -##################################################################### -## tst_qwinthumbnailtoolbar Test: -##################################################################### - -qt_add_test(tst_qwinthumbnailtoolbar - SOURCES - tst_qwinthumbnailtoolbar.cpp - PUBLIC_LIBRARIES - Qt::Gui - Qt::WinExtras -) diff --git a/tests/auto/qwinthumbnailtoolbar/qwinthumbnailtoolbar.pro b/tests/auto/qwinthumbnailtoolbar/qwinthumbnailtoolbar.pro deleted file mode 100644 index 7f091f5..0000000 --- a/tests/auto/qwinthumbnailtoolbar/qwinthumbnailtoolbar.pro +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG += testcase -TARGET = tst_qwinthumbnailtoolbar -QT += testlib winextras -SOURCES += tst_qwinthumbnailtoolbar.cpp diff --git a/tests/auto/qwinthumbnailtoolbar/tst_qwinthumbnailtoolbar.cpp b/tests/auto/qwinthumbnailtoolbar/tst_qwinthumbnailtoolbar.cpp deleted file mode 100644 index fc53a24..0000000 --- a/tests/auto/qwinthumbnailtoolbar/tst_qwinthumbnailtoolbar.cpp +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtTest/QtTest> -#include <QWinThumbnailToolBar> -#include <QWinThumbnailToolButton> - -class tst_QWinThumbnailToolBar : public QObject -{ - Q_OBJECT - -private slots: - void testWindow(); - void testButtons(); -}; - -void tst_QWinThumbnailToolBar::testWindow() -{ - QWindow window; - - QWinThumbnailToolBar tbar1; - QVERIFY(!tbar1.window()); - tbar1.setWindow(&window); - QCOMPARE(tbar1.window(), &window); - - auto *tbar2 = new QWinThumbnailToolBar(&window); - QCOMPARE(tbar2->window(), &window); - tbar2->setWindow(nullptr); - QVERIFY(!tbar2->window()); -} - -void tst_QWinThumbnailToolBar::testButtons() -{ - QWinThumbnailToolBar tbar; - QCOMPARE(tbar.count(), 0); - QVERIFY(tbar.buttons().isEmpty()); - - tbar.addButton(nullptr); - QCOMPARE(tbar.count(), 0); - QVERIFY(tbar.buttons().isEmpty()); - - auto *btn1 = new QWinThumbnailToolButton; - auto *btn2 = new QWinThumbnailToolButton; - - tbar.addButton(btn1); - QCOMPARE(tbar.count(), 1); - QCOMPARE(tbar.buttons().count(), 1); - QCOMPARE(tbar.buttons().at(0), btn1); - - tbar.addButton(btn2); - QCOMPARE(tbar.count(), 2); - QCOMPARE(tbar.buttons().count(), 2); - QCOMPARE(tbar.buttons().at(0), btn1); - QCOMPARE(tbar.buttons().at(1), btn2); - - tbar.clear(); - QCOMPARE(tbar.count(), 0); - QVERIFY(tbar.buttons().isEmpty()); - - QList<QWinThumbnailToolButton *> buttons; - for (int i = 0; i < 3; ++i) - buttons << new QWinThumbnailToolButton; - - tbar.setButtons(buttons); - QCOMPARE(tbar.count(), buttons.count()); - QCOMPARE(tbar.buttons().count(), buttons.count()); - for (int i = 0; i < buttons.count(); ++i) - QCOMPARE(tbar.buttons().at(i), buttons.at(i)); - - tbar.removeButton(buttons.at(1)); - QCOMPARE(tbar.count(), 2); - QCOMPARE(tbar.buttons().count(), 2); - QCOMPARE(tbar.buttons().at(0), buttons.at(0)); - QCOMPARE(tbar.buttons().at(1), buttons.at(2)); - - tbar.removeButton(buttons.at(2)); - QCOMPARE(tbar.count(), 1); - QCOMPARE(tbar.buttons().count(), 1); - QCOMPARE(tbar.buttons().at(0), buttons.at(0)); - - tbar.removeButton(buttons.at(0)); - QCOMPARE(tbar.count(), 0); - QVERIFY(tbar.buttons().isEmpty()); -} - -QTEST_MAIN(tst_QWinThumbnailToolBar) - -#include "tst_qwinthumbnailtoolbar.moc" diff --git a/tests/manual/CMakeLists.txt b/tests/manual/CMakeLists.txt deleted file mode 100644 index 7b01593..0000000 --- a/tests/manual/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -# Generated from manual.pro. - -if(TARGET Qt::Widgets) - add_subdirectory(dwmfeatures) - add_subdirectory(jumplist) - add_subdirectory(thumbnail) - add_subdirectory(imageconversion) -endif() diff --git a/tests/manual/dwmfeatures/.prev_CMakeLists.txt b/tests/manual/dwmfeatures/.prev_CMakeLists.txt deleted file mode 100644 index 60c8dd1..0000000 --- a/tests/manual/dwmfeatures/.prev_CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -# Generated from dwmfeatures.pro. - -##################################################################### -## dwmfeatures Binary: -##################################################################### - -qt_add_executable(dwmfeatures - GUI - SOURCES - main.cpp - testwidget.cpp testwidget.h testwidget.ui - PUBLIC_LIBRARIES - Qt::Gui - Qt::Widgets - Qt::WinExtras - ENABLE_AUTOGEN_TOOLS - uic -) - -#### Keys ignored in scope 1:.:.:dwmfeatures.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/manual/dwmfeatures/CMakeLists.txt b/tests/manual/dwmfeatures/CMakeLists.txt deleted file mode 100644 index 30a090d..0000000 --- a/tests/manual/dwmfeatures/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -# Generated from dwmfeatures.pro. - -##################################################################### -## dwmfeatures Binary: -##################################################################### - -qt_add_manual_test(dwmfeatures # special case - GUI - SOURCES - main.cpp - testwidget.cpp testwidget.h testwidget.ui - PUBLIC_LIBRARIES - Qt::Gui - Qt::Widgets - Qt::WinExtras - ENABLE_AUTOGEN_TOOLS - uic -) - -#### Keys ignored in scope 1:.:.:dwmfeatures.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/manual/dwmfeatures/dwmfeatures.pro b/tests/manual/dwmfeatures/dwmfeatures.pro deleted file mode 100644 index 2848d9c..0000000 --- a/tests/manual/dwmfeatures/dwmfeatures.pro +++ /dev/null @@ -1,11 +0,0 @@ -QT += widgets winextras - -TARGET = dwmfeatures -TEMPLATE = app - -SOURCES += main.cpp\ - testwidget.cpp - -HEADERS += testwidget.h - -FORMS += testwidget.ui diff --git a/tests/manual/dwmfeatures/main.cpp b/tests/manual/dwmfeatures/main.cpp deleted file mode 100644 index d29a989..0000000 --- a/tests/manual/dwmfeatures/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the test suite of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 3 as published by the Free Software - ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "testwidget.h" -#include <QApplication> - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - TestWidget w; - w.show(); - - return a.exec(); -} diff --git a/tests/manual/dwmfeatures/testwidget.cpp b/tests/manual/dwmfeatures/testwidget.cpp deleted file mode 100644 index e289946..0000000 --- a/tests/manual/dwmfeatures/testwidget.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the test suite of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 3 as published by the Free Software - ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "testwidget.h" -#include "ui_testwidget.h" - -#include <QtWin> -#include <QWinEvent> -#include <QDebug> -#include <qt_windows.h> - -TestWidget::TestWidget(QWidget *parent) : - QWidget(parent), - ui(new Ui::TestWidget) -{ - ui->setupUi(this); - - connect(ui->btnPeekDisallow, &QAbstractButton::clicked, this, &TestWidget::onDisallowPeekClicked); - connect(ui->btnPeekExclude, &QAbstractButton::clicked, this, &TestWidget::onExcludeFromPeekClicked); - connect(ui->radioFlipDefault, &QAbstractButton::clicked, this, &TestWidget::onFlip3DPolicyChanged); - connect(ui->radioFlipAbove, &QAbstractButton::clicked, this, &TestWidget::onFlip3DPolicyChanged); - connect(ui->radioFlipBelow, &QAbstractButton::clicked, this, &TestWidget::onFlip3DPolicyChanged); - connect(ui->radioNcrpUseWindowStyle, &QAbstractButton::clicked, this, &TestWidget::onNonClientAreaRenderingPolicyChanged); - connect(ui->radioNcrpDisable, &QAbstractButton::clicked, this, &TestWidget::onNonClientAreaRenderingPolicyChanged); - connect(ui->radioNcrpEnable, &QAbstractButton::clicked, this, &TestWidget::onNonClientAreaRenderingPolicyChanged); - connect(ui->btnFrameReset, &QAbstractButton::clicked, this, &TestWidget::onResetGlassFrameClicked); - connect(ui->frameTop, QOverload<int>::of(&QSpinBox::valueChanged), - this, &TestWidget::onGlassMarginsChanged); - connect(ui->frameRight, QOverload<int>::of(&QSpinBox::valueChanged), - this, &TestWidget::onGlassMarginsChanged); - connect(ui->frameBottom, QOverload<int>::of(&QSpinBox::valueChanged), - this, &TestWidget::onGlassMarginsChanged); - connect(ui->frameLeft, QOverload<int>::of(&QSpinBox::valueChanged), - this, &TestWidget::onGlassMarginsChanged); -} - -TestWidget::~TestWidget() -{ - delete ui; -} - -void TestWidget::changeEvent(QEvent *e) -{ - QWidget::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -} - -bool TestWidget::event(QEvent *e) -{ - if (e->type() == QWinEvent::CompositionChange) { - auto *event = static_cast<QWinCompositionChangeEvent *>(e); - qDebug() << "Composition state change: " << event->isCompositionEnabled(); - } else if (e->type() == QWinEvent::ThemeChange) { - qDebug() << "Theme change."; - } - return QWidget::event(e); -} - -void TestWidget::onDisallowPeekClicked() -{ - QtWin::setWindowDisallowPeek(this, ui->btnPeekDisallow->isChecked()); -} - -void TestWidget::onExcludeFromPeekClicked() -{ - QtWin::setWindowExcludedFromPeek(this, ui->btnPeekExclude->isChecked()); -} - -void TestWidget::onFlip3DPolicyChanged() -{ - QtWin::WindowFlip3DPolicy policy; - if (ui->radioFlipAbove->isChecked()) - policy = QtWin::FlipExcludeAbove; - else if (ui->radioFlipBelow->isChecked()) - policy = QtWin::FlipExcludeBelow; - else - policy = QtWin::FlipDefault; - QtWin::setWindowFlip3DPolicy(this, policy); -} - -void TestWidget::onNonClientAreaRenderingPolicyChanged() -{ - QtWin::WindowNonClientRenderingPolicy policy; - if (ui->radioNcrpDisable->isChecked()) - policy = QtWin::NonClientRenderingDisabled; - else if (ui->radioNcrpEnable->isChecked()) - policy = QtWin::NonClientRenderingEnabled; - else - policy = QtWin::NonClientRenderingUseWindowStyle; - QtWin::setWindowNonClientAreaRenderingPolicy(this, policy); -} - -void TestWidget::onGlassMarginsChanged() -{ - if (!QtWin::isCompositionEnabled()) - return; - - // what you see here is the only way to force widget to redraw itself - // so it actually redraws itself without caching and without any glitch - // but causes flickering :( - // and yes, update() and redraw() do nothing - - if (!testAttribute(Qt::WA_NoSystemBackground)) { - - QSize original = size(); - QSize modified = original; - modified.setWidth(original.height() + 1); - resize(modified); - - setAttribute(Qt::WA_NoSystemBackground); - QtWin::extendFrameIntoClientArea(this, - ui->frameTop->value(), - ui->frameRight->value(), - ui->frameBottom->value(), - ui->frameLeft->value()); - - resize(original); - - ui->groupBox_2->setAutoFillBackground(true); - ui->groupBox_3->setAutoFillBackground(true); - ui->groupBox_4->setAutoFillBackground(true); - } else { - QtWin::extendFrameIntoClientArea(this, - ui->frameLeft->value(), - ui->frameTop->value(), - ui->frameRight->value(), - ui->frameBottom->value()); - } -} - -void TestWidget::onResetGlassFrameClicked() -{ - if (!testAttribute(Qt::WA_NoSystemBackground)) - return; - - ui->frameTop->setValue(0); - ui->frameRight->setValue(0); - ui->frameBottom->setValue(0); - ui->frameLeft->setValue(0); - - QtWin::resetExtendedFrame(this); - setAttribute(Qt::WA_NoSystemBackground, false); - - QSize original = size(); - QSize modified = original; - modified.setHeight(original.height() + 1); - resize(modified); - - ui->groupBox_2->setAutoFillBackground(false); - ui->groupBox_3->setAutoFillBackground(false); - ui->groupBox_4->setAutoFillBackground(false); - - resize(original); -} diff --git a/tests/manual/dwmfeatures/testwidget.h b/tests/manual/dwmfeatures/testwidget.h deleted file mode 100644 index 70c39c6..0000000 --- a/tests/manual/dwmfeatures/testwidget.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the test suite of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 3 as published by the Free Software - ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef TESTWIDGET_H -#define TESTWIDGET_H - -#include <QWidget> - -QT_BEGIN_NAMESPACE -namespace Ui { -class TestWidget; -} -QT_END_NAMESPACE - -#if defined(QT_NAMESPACE) -namespace Ui = QT_NAMESPACE::Ui; -#endif - -class TestWidget : public QWidget -{ - Q_OBJECT - -public: - explicit TestWidget(QWidget *parent = nullptr); - ~TestWidget(); - -protected: - void changeEvent(QEvent *e) override; - bool event(QEvent *) override; - -private: - Ui::TestWidget *ui; - -private slots: - void onDisallowPeekClicked(); - void onExcludeFromPeekClicked(); - void onFlip3DPolicyChanged(); - void onNonClientAreaRenderingPolicyChanged(); - void onGlassMarginsChanged(); - void onResetGlassFrameClicked(); -}; - -#endif // TESTWIDGET_H diff --git a/tests/manual/dwmfeatures/testwidget.ui b/tests/manual/dwmfeatures/testwidget.ui deleted file mode 100644 index 2ef17d8..0000000 --- a/tests/manual/dwmfeatures/testwidget.ui +++ /dev/null @@ -1,379 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>TestWidget</class> - <widget class="QWidget" name="TestWidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>569</width> - <height>451</height> - </rect> - </property> - <property name="windowTitle"> - <string>QtWinExtras DWM Features</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QGroupBox" name="groupBox_2"> - <property name="minimumSize"> - <size> - <width>150</width> - <height>0</height> - </size> - </property> - <property name="title"> - <string>Aero Peek</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <property name="spacing"> - <number>3</number> - </property> - <property name="leftMargin"> - <number>4</number> - </property> - <property name="topMargin"> - <number>4</number> - </property> - <property name="rightMargin"> - <number>4</number> - </property> - <property name="bottomMargin"> - <number>4</number> - </property> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_7"> - <item> - <spacer name="horizontalSpacer_11"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="btnPeekDisallow"> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>Disallow peek</string> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_12"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_8"> - <item> - <spacer name="horizontalSpacer_13"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="btnPeekExclude"> - <property name="minimumSize"> - <size> - <width>100</width> - <height>0</height> - </size> - </property> - <property name="text"> - <string>Exclude from peek</string> - </property> - <property name="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_14"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer_2"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QGroupBox" name="groupBox_4"> - <property name="title"> - <string>Flip3D</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <property name="spacing"> - <number>3</number> - </property> - <property name="leftMargin"> - <number>4</number> - </property> - <property name="topMargin"> - <number>4</number> - </property> - <property name="rightMargin"> - <number>4</number> - </property> - <property name="bottomMargin"> - <number>4</number> - </property> - <item> - <widget class="QRadioButton" name="radioFlipDefault"> - <property name="text"> - <string>Default</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioFlipAbove"> - <property name="text"> - <string>Exclude above</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioFlipBelow"> - <property name="text"> - <string>Exclude below</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox"> - <property name="title"> - <string>Non-client area rendering</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <widget class="QRadioButton" name="radioNcrpUseWindowStyle"> - <property name="text"> - <string>Use window style</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioNcrpDisable"> - <property name="text"> - <string>Disable</string> - </property> - </widget> - </item> - <item> - <widget class="QRadioButton" name="radioNcrpEnable"> - <property name="text"> - <string>Enable</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_3"> - <property name="title"> - <string>Glass frame</string> - </property> - <layout class="QFormLayout" name="formLayout_2"> - <property name="horizontalSpacing"> - <number>3</number> - </property> - <property name="verticalSpacing"> - <number>3</number> - </property> - <property name="leftMargin"> - <number>4</number> - </property> - <property name="topMargin"> - <number>4</number> - </property> - <property name="rightMargin"> - <number>4</number> - </property> - <property name="bottomMargin"> - <number>4</number> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="label_5"> - <property name="text"> - <string>Left</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_6"> - <property name="text"> - <string>Right</string> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_7"> - <property name="text"> - <string>Top</string> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_8"> - <property name="text"> - <string>Bottom</string> - </property> - </widget> - </item> - <item row="4" column="0" colspan="2"> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> - <spacer name="horizontalSpacer_5"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="btnFrameReset"> - <property name="text"> - <string>Reset</string> - </property> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_6"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item row="0" column="1"> - <widget class="QSpinBox" name="frameLeft"> - <property name="minimum"> - <number>-1</number> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QSpinBox" name="frameRight"> - <property name="minimum"> - <number>-1</number> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QSpinBox" name="frameTop"> - <property name="minimum"> - <number>-1</number> - </property> - </widget> - </item> - <item row="3" column="1"> - <widget class="QSpinBox" name="frameBottom"> - <property name="minimum"> - <number>-1</number> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - </layout> - </widget> - <layoutdefault spacing="6" margin="11"/> - <resources/> - <connections/> -</ui> diff --git a/tests/manual/imageconversion/.prev_CMakeLists.txt b/tests/manual/imageconversion/.prev_CMakeLists.txt deleted file mode 100644 index b75901a..0000000 --- a/tests/manual/imageconversion/.prev_CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -# Generated from imageconversion.pro. - -##################################################################### -## imageconversion Binary: -##################################################################### - -qt_add_executable(imageconversion - SOURCES - main.cpp - PUBLIC_LIBRARIES - Qt::Gui - Qt::Widgets - Qt::WinExtras - gdi32 - user32 -) - -#### Keys ignored in scope 1:.:.:imageconversion.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/manual/imageconversion/CMakeLists.txt b/tests/manual/imageconversion/CMakeLists.txt deleted file mode 100644 index a90d080..0000000 --- a/tests/manual/imageconversion/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -# Generated from imageconversion.pro. - -##################################################################### -## imageconversion Binary: -##################################################################### - -qt_add_manual_test(imageconversion # special case - SOURCES - main.cpp - PUBLIC_LIBRARIES - Qt::Gui - Qt::Widgets - Qt::WinExtras - gdi32 - user32 -) - -#### Keys ignored in scope 1:.:.:imageconversion.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/manual/imageconversion/imageconversion.pro b/tests/manual/imageconversion/imageconversion.pro deleted file mode 100644 index 3442e28..0000000 --- a/tests/manual/imageconversion/imageconversion.pro +++ /dev/null @@ -1,5 +0,0 @@ -CONFIG += console c++11 -QT += widgets winextras -TEMPLATE = app -SOURCES += main.cpp -LIBS += -luser32 -lgdi32 diff --git a/tests/manual/imageconversion/main.cpp b/tests/manual/imageconversion/main.cpp deleted file mode 100644 index 5404348..0000000 --- a/tests/manual/imageconversion/main.cpp +++ /dev/null @@ -1,404 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtWinExtras/QtWin> - -#include <QtGui/QAction> -#include <QtGui/QShortcut> -#include <QtWidgets/QApplication> -#include <QtWidgets/QDialogButtonBox> -#include <QtWidgets/QFileDialog> -#include <QtWidgets/QLabel> -#include <QtWidgets/QMainWindow> -#include <QtWidgets/QMenu> -#include <QtWidgets/QMenuBar> -#include <QtWidgets/QPushButton> -#include <QtWidgets/QVBoxLayout> - -#include <QtGui/QImage> -#include <QtGui/QPainter> -#include <QtGui/QPaintEvent> - -#include <QtCore/QCommandLineOption> -#include <QtCore/QCommandLineParser> -#include <QtCore/QDebug> -#include <QtCore/QTimer> -#include <QtCore/qt_windows.h> - -static void formatData(QDebug d, const void *data, qsizetype size) -{ - QDebugStateSaver saver(d); - d.noquote(); - d.nospace(); - const qsizetype minSize = 20; - d << "\nData: " << QByteArray(reinterpret_cast<const char *>(data), qMin(minSize, size)).toHex(); - if (size > minSize) - d << "..."; - d << "\n 0000000011111111222222223333333344444444"; -} - -QDebug operator<<(QDebug d, const BITMAP &b) -{ - QDebugStateSaver saver(d); - d.nospace(); - d << "BITMAP(type=" << b.bmType << ", " << b.bmWidth << 'x' << b.bmHeight - << ", widthBytes=" << b.bmWidthBytes << ", planes=" << b.bmPlanes - << ", bitsPixel=" << b.bmBitsPixel << ", bits=" << b.bmBits << ')'; - return d; -} - -QDebug operator<<(QDebug d, const BITMAPINFOHEADER &bih) -{ - QDebugStateSaver saver(d); - d.nospace(); - d << "BITMAPINFOHEADER(" << bih.biWidth << 'x' << qAbs(bih.biHeight) - << (bih.biHeight < 0 ? ", top-down" : ", bottom-up") - << ", planes=" << bih.biPlanes << ", bitCount=" << bih.biBitCount - << ", compression=" << bih.biCompression << ", size=" - << bih.biSizeImage << ')'; - return d; -} - -static void formatImage(QDebug d, const QImage &image) -{ - QDebugStateSaver s(d); - d.noquote(); - d.nospace(); - d << image; - if (const int colorTableSize = image.colorCount()) { - QList<QRgb> colorTable = image.colorTable(); - d << " Color table: " << colorTableSize << " (" << Qt::showbase << Qt::hex; // 256 by standard - int c = 0; - for ( ; c < qMin(8, colorTableSize); ++c) { - if (c) - d << ", "; - d << colorTable[c]; - } - if (c < colorTableSize) - d << "..."; - d << ')' << Qt::noshowbase << Qt::dec; - } - formatData(d, image.constBits(), image.sizeInBytes()); -} - -enum ParseOptionResult { - OptionError, - OptionUnset, - OptionSet -}; - -static ParseOptionResult parseIntOption(const QCommandLineParser &parser, const QCommandLineOption &option, - int minValue, int maxValue, int *target) -{ - if (!parser.isSet(option)) - return OptionUnset; - - const QString spec = parser.value(option); - bool ok; - const int value = spec.toInt(&ok); - if (!ok || value < minValue || value > maxValue) { - qWarning() << "Invalid value" << spec << "for" << option.names(); - return OptionError; - } - *target = value; - return OptionSet; -} - -template <typename Enum> -static ParseOptionResult parseEnumOption(const QCommandLineParser &parser, const QCommandLineOption &option, - Enum minValue, Enum maxValue, Enum *target) -{ - int intValue; - const ParseOptionResult result = parseIntOption(parser, option, int(minValue), int(maxValue), &intValue); - if (result == OptionSet) - *target = static_cast<Enum>(intValue); - return result; -} - -// Display a QImage in a dialog. -class PreviewDialog : public QDialog -{ -public: - explicit PreviewDialog(const QImage &image, QWidget *parent = nullptr); -}; - -PreviewDialog::PreviewDialog(const QImage &image, QWidget *parent) : QDialog(parent) -{ - setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - QString description; - QDebug(&description) << image.size() << ", format=" << image.format(); - QLabel *descriptionLabel = new QLabel(description, this); - descriptionLabel->setWordWrap(true); - auto *layout = new QVBoxLayout(this); - layout->addWidget(descriptionLabel); - auto *hLayout = new QHBoxLayout; - QLabel *label = new QLabel(this); - label->setFrameShape(QFrame::Box); - label->setPixmap(QPixmap::fromImage(image)); - hLayout->addStretch(); - hLayout->addWidget(label); - hLayout->addStretch(); - layout->addLayout(hLayout); - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, this); - connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject); - layout->addWidget(buttonBox); -} - -// Widget that paints a HBITMAP using GDI API in WM_PAINT. -class PaintWidget : public QWidget -{ - Q_OBJECT -public: - explicit PaintWidget(HBITMAP hBitmap, QWidget *p = nullptr) : QWidget(p), m_hBitmap(hBitmap) { } - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override; -#else - bool nativeEvent(const QByteArray &eventType, void *message, long *result) override; -#endif - -public slots: - void saveBitmap(); - void convertBack(); - -protected: - void contextMenuEvent(QContextMenuEvent *) override; - -private: - const HBITMAP m_hBitmap; -}; - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) -bool PaintWidget::nativeEvent(const QByteArray &eventType, void *messageIn, qintptr *result) -#else -bool PaintWidget::nativeEvent(const QByteArray &eventType, void *messageIn, long *result) -#endif -{ - MSG *message = reinterpret_cast<MSG *>(messageIn); - if (message->message != WM_PAINT) - return QWidget::nativeEvent(eventType, message, result); - - PAINTSTRUCT paintStruct; - BITMAP bitmap; - - const HDC hdc = BeginPaint(message->hwnd, &paintStruct); - SelectObject(hdc, GetStockObject(BLACK_PEN)); - Rectangle(hdc, 1, 1, width() - 1, height() - 1); - - const HDC hdcMem = CreateCompatibleDC(hdc); - const HGDIOBJ oldBitmap = SelectObject(hdcMem, m_hBitmap); - - GetObject(m_hBitmap, sizeof(bitmap), &bitmap); - { - QDebug d = qDebug(); - d << __FUNCTION__ << bitmap; - formatData(d, bitmap.bmBits, bitmap.bmHeight * bitmap.bmWidthBytes); - } - BitBlt(hdc, 5, 5, bitmap.bmWidth, bitmap.bmHeight, hdcMem, 0, 0, SRCCOPY); - SelectObject(hdcMem, oldBitmap); - DeleteDC(hdcMem); - - EndPaint(message->hwnd, &paintStruct); - return true; -} - -void PaintWidget::convertBack() -{ - QImage image = QtWin::imageFromHBITMAP(m_hBitmap); - formatImage(qDebug(), image); - auto *dialog = new PreviewDialog(image, this); - dialog->setAttribute(Qt::WA_DeleteOnClose); - dialog->setModal(false); - dialog->setWindowTitle(QLatin1String("QImage - Qt ") + QLatin1String(QT_VERSION_STR)); - dialog->show(); -} - -void PaintWidget::saveBitmap() -{ - QImage image = QtWin::imageFromHBITMAP(m_hBitmap); - formatImage(qDebug(), image); - QFileDialog fileDialog(this); - fileDialog.setAcceptMode(QFileDialog::AcceptSave); - fileDialog.setMimeTypeFilters(QStringList(QStringLiteral("image/png"))); - fileDialog.setDefaultSuffix(QStringLiteral("png")); - fileDialog.selectFile(QStringLiteral("test.png")); - while (fileDialog.exec() == QDialog::Accepted) { - const QString fileName = fileDialog.selectedFiles().first(); - if (image.save(fileName)) { - qDebug().noquote() << "saved" << QDir::toNativeSeparators(fileName); - break; - } - qWarning().noquote() << "Could not save" << QDir::toNativeSeparators(fileName); - } -} - -void PaintWidget::contextMenuEvent(QContextMenuEvent *e) -{ - QMenu contextMenu; - contextMenu.addAction(QStringLiteral("Convert into QImage"), this, &PaintWidget::convertBack); - QAction *saveAction = contextMenu.addAction(QStringLiteral("Save"), this, &PaintWidget::saveBitmap); - saveAction->setShortcut(Qt::CTRL + Qt::Key_S); - contextMenu.exec(e->globalPos()); -} - -static const char description[] = -"\nCreates a HBITMAP from a QImage either passed as file name or by drawing in a\n" -"format determined by a command line option and draws it onto a native window\n" -"for comparison. Provides a context menu for converting the HBITMAP back to a\n" -"QImage and saving that for checking the reverse conversion."; - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - QCoreApplication::setApplicationName("imageconversion"); - QCoreApplication::setOrganizationName("QtProject"); - QCoreApplication::setApplicationVersion(QT_VERSION_STR); - QCommandLineParser parser; - parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions); - parser.setApplicationDescription("Qt Windows Extras Image Conversion Tester"); - parser.addHelpOption(); - parser.addVersionOption(); - parser.setApplicationDescription(description); - - const QCommandLineOption formatOption(QStringList{"format", "f"}, - "QImage format", "format"); - parser.addOption(formatOption); - const QCommandLineOption colorOption(QStringList{"color", "c"}, - "Fill color", "color-spec"); - parser.addOption(colorOption); - const QCommandLineOption globalColorOption(QStringList{"globalColor", "g"}, - "Fill color (global color enum value)", "global-color"); - parser.addOption(globalColorOption); - const QCommandLineOption widthOption(QStringList{"width", "w"}, - "Width", "width"); - parser.addOption(widthOption); - const QCommandLineOption heightOption(QStringList{"height", "h"}, - "Height", "height"); - parser.addOption(heightOption); - const QCommandLineOption previewOption(QStringList{"preview", "p"}, - "Show a preview"); - parser.addOption(previewOption); - - parser.addPositionalArgument("file", "The image file to open."); - parser.process(app); - - QColor defaultColor(Qt::red); - if (parser.isSet(colorOption)) { - const QString spec = parser.value(colorOption); - defaultColor = QColor(spec); - if (!defaultColor.isValid()) { - qWarning() << "Invalid color specification" << spec; - return -1; - } - } else { - // Color 0: color0, 1: color1, 2: black, 3: white, 7:red, 9: blue, 8: green - Qt::GlobalColor globalColor = Qt::color0; - if (!parseEnumOption(parser, globalColorOption, Qt::black, Qt::transparent, &globalColor)) - return -1; - if (globalColor != Qt::color0) - defaultColor = QColor(defaultColor); - } - - // Format: 1: mono, 3: Indexed8, 7: RGB 16, 11: RGB555, 13: RGB888 - QImage::Format targetFormat = QImage::Format_ARGB32_Premultiplied; - if (!parseEnumOption(parser, formatOption, QImage::Format_Mono, QImage::Format_Grayscale8, &targetFormat)) - return -1; - // Can't paint on indexed nor mono, need transform? - const QImage::Format drawFormat = targetFormat == QImage::Format_Indexed8 - || targetFormat == QImage::Format_Mono || targetFormat == QImage::Format_MonoLSB - ? QImage::Format_ARGB32_Premultiplied : targetFormat; - - if (targetFormat == QImage::Format_Mono || targetFormat == QImage::Format_MonoLSB) - defaultColor = Qt::white; - - int width = 73; - int height = 57; - if (!parseIntOption(parser, widthOption, 1, 2000, &width) || !parseIntOption(parser, heightOption, 1, 2000, &height)) - return -1; - - const bool preview = parser.isSet(previewOption); - - QImage image; - if (!parser.positionalArguments().isEmpty()) { - QString fileName = parser.positionalArguments().constFirst(); - image = QImage(fileName); - if (image.isNull() || image.size().isEmpty()) { - qWarning().noquote() << "Image load fail" << QDir::toNativeSeparators(fileName); - return -1; - } - } - - if (image.isNull()) { - qDebug() << "Default image color=" << defaultColor - << Qt::showbase << Qt::hex << defaultColor.rgba() << Qt::noshowbase << Qt::dec - << ", format=" << drawFormat; - image = QImage(width, height, drawFormat); - image.fill(defaultColor); - QPainter painter(&image); - painter.drawLine(0, 0, image.width(), image.height()); - } - - if (image.format() != targetFormat) { - qDebug() << "Converting " << image.format() << targetFormat; - image = image.convertToFormat(targetFormat); - } - - formatImage(qDebug(), image); - - const HBITMAP bitmap = QtWin::imageToHBITMAP(image); - if (!bitmap) { - qWarning() << "Failed to create HBITMAP"; - return -1; - } - - int exitCode = 0; - { - PaintWidget paintWidget(bitmap); - auto *quitShortcut = new QShortcut(&paintWidget); - quitShortcut->setKey(Qt::CTRL + Qt::Key_Q); - quitShortcut->setContext(Qt::ApplicationShortcut); - QObject::connect(quitShortcut, &QShortcut::activated, qApp, &QCoreApplication::quit); - paintWidget.setWindowTitle(QLatin1String("HBITMAP - Qt ") + QLatin1String(QT_VERSION_STR)); - paintWidget.show(); - if (preview) { - auto *dialog = new PreviewDialog(image); - dialog->setModal(false); - dialog->setWindowTitle(QLatin1String("QImage - Qt ") + QLatin1String(QT_VERSION_STR)); - dialog->move(paintWidget.frameGeometry().topRight() + QPoint(50, 0)); - dialog->show(); - } - exitCode = app.exec(); - } - - DeleteObject(bitmap); - - return exitCode; -} - -#include "main.moc" diff --git a/tests/manual/jumplist/.prev_CMakeLists.txt b/tests/manual/jumplist/.prev_CMakeLists.txt deleted file mode 100644 index b73180a..0000000 --- a/tests/manual/jumplist/.prev_CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -# Generated from jumplist.pro. - -##################################################################### -## jumplist Binary: -##################################################################### - -qt_add_executable(jumplist - GUI - SOURCES - main.cpp - testwidget.cpp testwidget.h testwidget.ui - PUBLIC_LIBRARIES - Qt::Gui - Qt::Widgets - Qt::WinExtras - ENABLE_AUTOGEN_TOOLS - uic -) - -#### Keys ignored in scope 1:.:.:jumplist.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/manual/jumplist/CMakeLists.txt b/tests/manual/jumplist/CMakeLists.txt deleted file mode 100644 index 916c125..0000000 --- a/tests/manual/jumplist/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -# Generated from jumplist.pro. - -##################################################################### -## jumplist Binary: -##################################################################### - -qt_add_manual_test(jumplist # special case - GUI - SOURCES - main.cpp - testwidget.cpp testwidget.h testwidget.ui - PUBLIC_LIBRARIES - Qt::Gui - Qt::Widgets - Qt::WinExtras - ENABLE_AUTOGEN_TOOLS - uic -) - -#### Keys ignored in scope 1:.:.:jumplist.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/manual/jumplist/jumplist.pro b/tests/manual/jumplist/jumplist.pro deleted file mode 100644 index c8a061d..0000000 --- a/tests/manual/jumplist/jumplist.pro +++ /dev/null @@ -1,11 +0,0 @@ -QT += widgets winextras - -TARGET = jumplist -TEMPLATE = app - -SOURCES += main.cpp\ - testwidget.cpp - -HEADERS += testwidget.h - -FORMS += testwidget.ui diff --git a/tests/manual/jumplist/main.cpp b/tests/manual/jumplist/main.cpp deleted file mode 100644 index 464b915..0000000 --- a/tests/manual/jumplist/main.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the test suite of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 3 as published by the Free Software - ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "testwidget.h" - -#include <QApplication> -#include <QCommandLineParser> -#include <QCommandLineOption> -#include <QDir> -#include <QDebug> -#include <QMimeDatabase> -#include <QSettings> -#include <QStatusBar> - -#include <algorithm> -#include <iterator> - -static bool associateFileType() -{ - const QString applicationBinary = QCoreApplication::applicationFilePath(); - QString exeFileName = applicationBinary; - const int lastSlashPos = exeFileName.lastIndexOf(u'/'); - exeFileName.remove(0, lastSlashPos + 1); - QSettings regApplications("HKEY_CURRENT_USER\\Software\\Classes\\Applications\\" + exeFileName, QSettings::NativeFormat); - regApplications.setValue("FriendlyAppName", QGuiApplication::applicationDisplayName()); - - regApplications.beginGroup("SupportedTypes"); - QMimeDatabase mimeDatabase; - const auto types = TestWidget::supportedMimeTypes(); - for (const QString &t : types) { - const auto suffixes = mimeDatabase.mimeTypeForName(t).suffixes(); - for (const QString &s : suffixes) - regApplications.setValue('.' + s, QString()); - } - regApplications.endGroup(); - - regApplications.beginGroup("shell"); - regApplications.beginGroup("open"); - regApplications.setValue("FriendlyAppName", QGuiApplication::applicationDisplayName()); - regApplications.beginGroup("command"); - regApplications.setValue(".", '"' + QDir::toNativeSeparators(applicationBinary) + "\" \"%1\""); - regApplications.endGroup(); - regApplications.endGroup(); - regApplications.endGroup(); - return regApplications.status() == QSettings::NoError; -} - -int main(int argc, char *argv[]) -{ - QStringList allArgs; // Show all arguments including style. - std::copy(argv + 1, argv + argc, std::back_inserter(allArgs)); - - QApplication app(argc, argv); - QGuiApplication::setApplicationDisplayName(QStringLiteral("QtWinExtras JumpList Test")); - if (!associateFileType()) { - qWarning() << "Unable to create registry entries."; - return -1; - } - - QCoreApplication::setOrganizationName("QtProject"); - QCoreApplication::setApplicationVersion(QT_VERSION_STR); - QCommandLineParser parser; - parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions); - parser.setApplicationDescription(QGuiApplication::applicationDisplayName()); - parser.addHelpOption(); - parser.addVersionOption(); - QCommandLineOption textOption("text", "Show some text"); - parser.addOption(textOption); - QCommandLineOption fullScreenOption("fullscreen", "Show fullscreen"); - parser.addOption(fullScreenOption); - QCommandLineOption idOption("id", "Jump list identifier", "id"); - parser.addOption(idOption); - parser.addPositionalArgument("file", "The file to open."); - parser.process(app); - - TestWidget w; - - if (parser.isSet(idOption)) - w.setId(parser.value(idOption)); - - if (parser.isSet(fullScreenOption)) - w.showFullScreen(); - else - w.show(); - - if (parser.isSet(textOption)) - w.setText("Hello, world!"); - - if (!parser.positionalArguments().isEmpty()) - w.showFile(parser.positionalArguments().first()); - - if (allArgs.isEmpty()) - w.statusBar()->showMessage("Remember to run windeployqt"); - else - w.statusBar()->showMessage("Arguments: " + allArgs.join(' ')); - - return app.exec(); -} diff --git a/tests/manual/jumplist/testwidget.cpp b/tests/manual/jumplist/testwidget.cpp deleted file mode 100644 index 01a1275..0000000 --- a/tests/manual/jumplist/testwidget.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the test suite of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 3 as published by the Free Software - ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include "testwidget.h" -#include "ui_testwidget.h" - -#include <QApplication> -#include <QStyle> -#include <QFile> -#include <QFileDialog> -#include <QDesktopServices> -#include <QMessageBox> -#include <QProcess> -#include <QStatusBar> -#include <QUrl> -#include <QWinJumpList> -#include <QWinJumpListItem> -#include <QWinJumpListCategory> -#include <QDebug> - -TestWidget::TestWidget(QWidget *parent) : - QMainWindow(parent), - ui(new Ui::TestWidget) -{ - ui->setupUi(this); - - connect(ui->actionUpdate, &QAction::triggered, this, &TestWidget::updateJumpList); - connect(ui->actionOpen, &QAction::triggered, this, &TestWidget::openFile); - connect(ui->actionExit, &QAction::triggered, QCoreApplication::quit); - connect(ui->actionShow_in_Explorer, &QAction::triggered, this, &TestWidget::showInExplorer); - connect(ui->actionRun_JumpListView, &QAction::triggered, this, &TestWidget::runJumpListView); -} - -TestWidget::~TestWidget() -{ - delete ui; -} - -QStringList TestWidget::supportedMimeTypes() -{ - return QStringList() << "text/x-c++src" << "text/x-csrc" << "text/x-chdr" - << "text/x-c++hdr" << "text/x-qml" << "text/plain"; -} - -void TestWidget::changeEvent(QEvent *e) -{ - QWidget::changeEvent(e); - switch (e->type()) { - case QEvent::LanguageChange: - ui->retranslateUi(this); - break; - default: - break; - } -} - -void TestWidget::showFile(const QString &path) -{ - QFile file(path); - if (!file.open(QIODevice::ReadOnly|QIODevice::Text)) { - const QString error = "Failed to open file " + QDir::toNativeSeparators(path) - + ": " + file.errorString(); - QMessageBox::warning(this, "Error", error); - return; - } - setText(QString::fromUtf8(file.readAll())); -} - -void TestWidget::setText(const QString &text) -{ - ui->text->setPlainText(text); -} - -void TestWidget::updateJumpList() -{ - QWinJumpList jumplist; - if (!m_id.isEmpty()) - jumplist.setIdentifier(m_id); - const QString applicationBinary = QDir::toNativeSeparators(QCoreApplication::applicationFilePath()); - jumplist.recent()->setVisible(ui->cbShowRecent->isChecked()); - jumplist.frequent()->setVisible(ui->cbShowFrequent->isChecked()); - if (ui->cbRunFullscreen->isChecked()) { - auto *item = new QWinJumpListItem(QWinJumpListItem::Link); - item->setTitle(ui->cbRunFullscreen->text()); - item->setFilePath(applicationBinary); - item->setArguments(QStringList("-fullscreen")); - item->setIcon(style()->standardIcon(QStyle::SP_TitleBarMaxButton)); - jumplist.tasks()->addItem(item); - } - if (ui->cbRunFusion->isChecked()) { - jumplist.tasks()->addLink(style()->standardIcon(QStyle::SP_DesktopIcon), - ui->cbRunFusion->text(), - applicationBinary, - (QStringList() << "-style" << "fusion")); - } - if (ui->cbRunText->isChecked()) { - jumplist.tasks()->addSeparator(); - jumplist.tasks()->addLink(ui->cbRunText->text(), - applicationBinary, - QStringList("-text")); - } - jumplist.tasks()->setVisible(!jumplist.tasks()->isEmpty()); -} - -void TestWidget::openFile() -{ - QFileDialog fileDialog(this, "Open a Text File"); - fileDialog.setAcceptMode(QFileDialog::AcceptOpen); - fileDialog.setMimeTypeFilters(TestWidget::supportedMimeTypes()); - // Note: The native file dialog creates the frequent/recent entries. - if (!ui->actionUse_Native_File_Dialog->isChecked()) - fileDialog.setOption(QFileDialog::DontUseNativeDialog); - if (fileDialog.exec() == QDialog::Accepted) - showFile(fileDialog.selectedFiles().first()); -} - -void TestWidget::showInExplorer() -{ - const QString path = QFile::decodeName(qgetenv("APPDATA")) - + "/Microsoft/Windows/Recent/Automaticdestinations"; - QDesktopServices::openUrl(QUrl::fromLocalFile(path)); -} - -void TestWidget::runJumpListView() -{ - const char binary[] = "JumpListsView"; - if (!QProcess::startDetached(binary, QStringList())) - statusBar()->showMessage(QLatin1String("Unable to run ") + binary); -} diff --git a/tests/manual/jumplist/testwidget.h b/tests/manual/jumplist/testwidget.h deleted file mode 100644 index 0cae1ea..0000000 --- a/tests/manual/jumplist/testwidget.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the test suite of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 3 as published by the Free Software - ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#ifndef TESTWIDGET_H -#define TESTWIDGET_H - -#include <QMainWindow> - -QT_BEGIN_NAMESPACE -namespace Ui { -class TestWidget; -} -QT_END_NAMESPACE - -#if defined(QT_NAMESPACE) -namespace Ui = QT_NAMESPACE::Ui; -#endif - -class TestWidget : public QMainWindow -{ - Q_OBJECT - -public: - explicit TestWidget(QWidget *parent = nullptr); - ~TestWidget(); - - void showFile(const QString &path); - void setText(const QString &text); - - static QStringList supportedMimeTypes(); - - QString id() const { return m_id; } - void setId(const QString &id) { m_id = id; } - -protected: - void changeEvent(QEvent *e) Q_DECL_OVERRIDE; - -private slots: - void updateJumpList(); - void showInExplorer(); - void runJumpListView(); - void openFile(); - -private: - Ui::TestWidget *ui; - QString m_id; -}; - -#endif // TESTWIDGET_H diff --git a/tests/manual/jumplist/testwidget.ui b/tests/manual/jumplist/testwidget.ui deleted file mode 100644 index abcb078..0000000 --- a/tests/manual/jumplist/testwidget.ui +++ /dev/null @@ -1,237 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>TestWidget</class> - <widget class="QMainWindow" name="TestWidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>800</width> - <height>600</height> - </rect> - </property> - <widget class="QWidget" name="centralwidget"> - <property name="windowTitle"> - <string>QtWinExtras JumpList</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QGroupBox" name="groupBox"> - <property name="title"> - <string>Known categories</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>3</number> - </property> - <property name="leftMargin"> - <number>3</number> - </property> - <property name="topMargin"> - <number>3</number> - </property> - <property name="rightMargin"> - <number>3</number> - </property> - <property name="bottomMargin"> - <number>3</number> - </property> - <item> - <widget class="QCheckBox" name="cbShowFrequent"> - <property name="text"> - <string>Frequent</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="cbShowRecent"> - <property name="text"> - <string>Recent</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_2"> - <property name="title"> - <string>Tasks</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <property name="spacing"> - <number>3</number> - </property> - <property name="leftMargin"> - <number>3</number> - </property> - <property name="topMargin"> - <number>3</number> - </property> - <property name="rightMargin"> - <number>3</number> - </property> - <property name="bottomMargin"> - <number>3</number> - </property> - <item> - <widget class="QCheckBox" name="cbRunFullscreen"> - <property name="text"> - <string>Run in fullscreen</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="cbRunFusion"> - <property name="text"> - <string>Run with Fusion style</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="cbRunText"> - <property name="text"> - <string>Run with some text displayed</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - </layout> - </item> - <item> - <widget class="QTextEdit" name="text"> - <property name="font"> - <font> - <family>Consolas</family> - <pointsize>10</pointsize> - </font> - </property> - <property name="readOnly"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QMenuBar" name="menuBar"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>800</width> - <height>21</height> - </rect> - </property> - <widget class="QMenu" name="menuFile"> - <property name="title"> - <string>File</string> - </property> - <addaction name="actionOpen"/> - <addaction name="actionExit"/> - </widget> - <widget class="QMenu" name="menuJumplist"> - <property name="title"> - <string>Jumplist</string> - </property> - <addaction name="actionUpdate"/> - <addaction name="actionShow_in_Explorer"/> - <addaction name="actionRun_JumpListView"/> - </widget> - <widget class="QMenu" name="menuSettings"> - <property name="title"> - <string>Settings</string> - </property> - <addaction name="actionUse_Native_File_Dialog"/> - </widget> - <addaction name="menuFile"/> - <addaction name="menuJumplist"/> - <addaction name="menuSettings"/> - </widget> - <action name="actionOpen"> - <property name="text"> - <string>Open</string> - </property> - <property name="shortcut"> - <string>Ctrl+O</string> - </property> - </action> - <action name="actionExit"> - <property name="text"> - <string>Exit</string> - </property> - <property name="shortcut"> - <string>Ctrl+Q</string> - </property> - </action> - <action name="actionUpdate"> - <property name="text"> - <string>Update</string> - </property> - <property name="shortcut"> - <string>Ctrl+U</string> - </property> - </action> - <action name="actionShow_in_Explorer"> - <property name="text"> - <string>Show in Explorer</string> - </property> - <property name="shortcut"> - <string>Ctrl+E</string> - </property> - </action> - <action name="actionRun_JumpListView"> - <property name="text"> - <string>Run JumpListView</string> - </property> - <property name="toolTip"> - <string>Run JumpListView utility</string> - </property> - </action> - <action name="actionUse_Native_File_Dialog"> - <property name="checkable"> - <bool>true</bool> - </property> - <property name="checked"> - <bool>true</bool> - </property> - <property name="text"> - <string>Use Native File Dialog</string> - </property> - </action> - </widget> - <layoutdefault spacing="6" margin="11"/> - <resources/> - <connections/> -</ui> diff --git a/tests/manual/manual.pro b/tests/manual/manual.pro deleted file mode 100644 index be1698c..0000000 --- a/tests/manual/manual.pro +++ /dev/null @@ -1,8 +0,0 @@ -TEMPLATE = subdirs -qtHaveModule(widgets) { - SUBDIRS += \ - dwmfeatures \ - jumplist \ - thumbnail \ - imageconversion -} diff --git a/tests/manual/quickdwmfeatures/main.qml b/tests/manual/quickdwmfeatures/main.qml deleted file mode 100644 index 3448a1f..0000000 --- a/tests/manual/quickdwmfeatures/main.qml +++ /dev/null @@ -1,136 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 Ivan Vizir <define-true-false@yandex.com> - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtWinExtras module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 3 as published by the Free Software - ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -import QtQuick 2.0 -import QtQuick.Controls 1.0 -import QtQuick.Window 2.0 -import QtQuick.Layouts 1.0 -import QtWinExtras 1.0 -import QtGraphicalEffects 1.0 - -Window { - title: "DWM Features QtWinExtras manual test" - width: 350 - height: 261 - - DwmFeatures { - id: dwm - leftGlassMargin: sboxLeft.value - rightGlassMargin: sboxRight.value - topGlassMargin: sboxTop.value - bottomGlassMargin: sboxBottom.value - blurBehindEnabled: cbBlurBehind.checked - - excludedFromPeek: cbExcludedFromPeek.checked - peekDisallowed: cbPeekDisallowed.checked - - Component.onCompleted: { - cbCompositionEnabled.checked = compositionEnabled - compositionEnabled = Qt.binding(function () { return cbCompositionEnabled.checked }) - } - } - - Rectangle { - anchors.fill: parent - anchors.leftMargin: dwm.compositionEnabled ? dwm.leftGlassMargin : 0 - anchors.rightMargin: dwm.compositionEnabled ? dwm.rightGlassMargin : 0 - anchors.topMargin: dwm.compositionEnabled ? dwm.topGlassMargin : 0 - anchors.bottomMargin: dwm.compositionEnabled ? dwm.bottomGlassMargin : 0 - - visible: !dwm.compositionEnabled || dwm.topGlassMargin > -1 && dwm.leftGlassMargin > -1 && dwm.rightGlassMargin > -1 && dwm.bottomGlassMargin > -1 && !cbBlurBehind.checked - } - - GridLayout { - anchors.fill: parent - anchors.margins: 2 - columns: 2 - - CheckBox { - id: cbCompositionEnabled - text: "Composition enabled" - Layout.columnSpan: 2 - } - - CheckBox { - id: cbBlurBehind - text: "Blur behind enabled" - Layout.columnSpan: 2 - enabled: cbCompositionEnabled.checked - } - - Label { text: "Top glass frame margin" } - SpinBox { id: sboxTop; minimumValue: -1; maximumValue: 40; value: 0; Layout.alignment: Qt.AlignRight; enabled: cbCompositionEnabled.checked } - Label { text: "Right glass frame margin" } - SpinBox { id: sboxRight; minimumValue: -1; maximumValue: 40; value: 0; Layout.alignment: Qt.AlignRight; enabled: cbCompositionEnabled.checked } - Label { text: "Bottom glass frame margin" } - SpinBox { id: sboxBottom; minimumValue: -1; maximumValue: 40; value: 0; Layout.alignment: Qt.AlignRight; enabled: cbCompositionEnabled.checked } - Label { text: "Left glass frame margin" } - SpinBox { id: sboxLeft; minimumValue: -1; maximumValue: 40; value: 0; Layout.alignment: Qt.AlignRight; enabled: cbCompositionEnabled.checked } - - CheckBox { - id: cbExcludedFromPeek - text: "Excluded from peek" - Layout.columnSpan: 2 - enabled: cbCompositionEnabled.checked - } - - CheckBox { - id: cbPeekDisallowed - text: "Peek disallowed" - Layout.columnSpan: 2 - enabled: cbCompositionEnabled.checked - } - - Rectangle { - id: rcColorization - width: parent.width - height: 32 - color: dwm.realColorizationColor - Layout.fillWidth: true - Layout.columnSpan: 2 - border.width: 4 - border.color: ''+dwm.realColorizationColor - - Label { text: "Real colorization color"; anchors.centerIn: parent} - } - - Rectangle { - width: parent.width - height: 32 - color: dwm.colorizationColor - Layout.fillWidth: true - Layout.columnSpan: 2 - border.width: 4 - border.color: ''+dwm.colorizationColor - - Label { text: "API-given colorization color (blended)"; anchors.centerIn: parent} - } - - Item { Layout.fillHeight: true } - } -} diff --git a/tests/manual/quickdwmfeatures/quickdwmfeatures.qmlproject b/tests/manual/quickdwmfeatures/quickdwmfeatures.qmlproject deleted file mode 100644 index e5a8bf0..0000000 --- a/tests/manual/quickdwmfeatures/quickdwmfeatures.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "main.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/tests/manual/quickjumplist/main.qml b/tests/manual/quickjumplist/main.qml deleted file mode 100644 index ba32654..0000000 --- a/tests/manual/quickjumplist/main.qml +++ /dev/null @@ -1,103 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.1 -import QtWinExtras 1.0 -import QtQuick.Dialogs 1.0 -import QtQuick.Layouts 1.0 -import QtQuick.Controls 1.0 - -ApplicationWindow { - id: window - - title: "JumpList" - - width: 800 - height: 400 - minimumWidth: groupBox.implicitWidth + 40 - minimumHeight: groupBox.implicitHeight + 40 - - JumpList { - id: jumpList - recent.visible: recentBox.checked - frequent.visible: frequentBox.checked - tasks: JumpListCategory { - visible: tasksBox.checked - JumpListLink { - title: "qmlscene" - description: "qmlscene main.qml" - executablePath: Qt.application.arguments[0] - arguments: Qt.application.arguments[1] - } - } - JumpListCategory { - title: "Custom" - visible: customBox.checked - JumpListLink { - title: "qmlscene" - description: "qmlscene main.qml" - executablePath: Qt.application.arguments[0] - arguments: Qt.application.arguments[1] - } - } - } - - GroupBox { - id: groupBox - title: "JumpList" - anchors.centerIn: parent - RowLayout { - anchors.fill: parent - anchors.margins: 20 - ColumnLayout { - CheckBox { - id: recentBox - text: "Recent" - } - CheckBox { - id: frequentBox - text: "Frequent" - } - CheckBox { - id: tasksBox - text: "Tasks" - } - CheckBox { - id: customBox - text: "Custom" - } - } - Button { - text: "Open..." - onClicked: dialog.open() - FileDialog { - id: dialog - } - } - } - } -} diff --git a/tests/manual/quickjumplist/quickjumplist.qmlproject b/tests/manual/quickjumplist/quickjumplist.qmlproject deleted file mode 100644 index e5a8bf0..0000000 --- a/tests/manual/quickjumplist/quickjumplist.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "main.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/tests/manual/quicktaskbar/main.qml b/tests/manual/quicktaskbar/main.qml deleted file mode 100644 index 9dbbb88..0000000 --- a/tests/manual/quicktaskbar/main.qml +++ /dev/null @@ -1,161 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.1 -import QtWinExtras 1.0 -import QtQuick.Layouts 1.0 -import QtQuick.Controls 1.0 - -ApplicationWindow { - id: window - - title: "TaskbarButton" - - width: column.implicitWidth + 240 - height: column.implicitHeight + 160 - minimumWidth: column.implicitWidth + 40 - minimumHeight: column.implicitHeight + 40 - - TaskbarButton { - id: taskbar - - progress.visible: progressBox.checked - progress.minimum: indeterminateBox.checked ? 0 : minSpinBox.value - progress.maximum: indeterminateBox.checked ? 0 : maxSpinBox.value - progress.value: indeterminateBox.checked ? 0 : valueSlider.value - - overlay.iconSource: overlayBox.checked && overlayCombo.currentIndex >= 0 ? overlayModel.get(overlayCombo.currentIndex).source : "" - overlay.accessibleDescription: "TaskbarButton" - } - - ColumnLayout { - id: column - - spacing: 20 - anchors.centerIn: parent - Layout.preferredWidth: window.width / 2 - - GroupBox { - id: overlayBox - - checked: false - checkable: true - title: "Overlay icon" - Layout.fillWidth: true - - ComboBox { - id: overlayCombo - - anchors.fill: parent - anchors.margins: 10 - - textRole: "name" - model: ListModel { - id: overlayModel - ListElement { name: "Qt logo (64)"; source: "qrc:/qt-project.org/qmessagebox/images/qtlogo-64.png" } - ListElement { name: "Up (16)"; source: "qrc:/qt-project.org/styles/commonstyle/images/up-16.png" } - ListElement { name: "Left (32)"; source: "qrc:/qt-project.org/styles/commonstyle/images/left-32.png" } - ListElement { name: "Right (32)"; source: "qrc:/qt-project.org/styles/commonstyle/images/right-32.png" } - ListElement { name: "Down (128)"; source: "qrc:/qt-project.org/styles/commonstyle/images/down-128.png" } - ListElement { name: "Remote"; source: "http://qt-project.org/images/qt13a/Qt-logo.png" } - ListElement { name: "Non-existing"; source: "do not crash explorer" } - } - } - } - - GroupBox { - id: progressBox - - checked: false - checkable: true - title: qsTr("Progress (%1)").arg(taskbar.progress.value) - Layout.fillWidth: true - - GridLayout { - columns: 3 - rowSpacing: 10 - columnSpacing: 20 - anchors.fill: parent - anchors.margins: 10 - - Label { text: "Value:" } - Slider { - id: valueSlider - - value: 82 - stepSize: 1 - minimumValue: minSpinBox.value - maximumValue: maxSpinBox.value - enabled: !indeterminateBox.checked - Layout.columnSpan: 2 - } - - Label { text: "Minimum:" } - SpinBox { - id: minSpinBox - - value: 0 - stepSize: 1 - minimumValue: -1000 - maximumValue: 1000 - enabled: !indeterminateBox.checked - Layout.fillWidth: true - } - - Button { - readonly property string playSymbol: "\u25BA" // BLACK RIGHT-POINTING POINTER - readonly property string pauseSymbol: "\u25AE\u25AE" // BLACK VERTICAL RECTANGLE - readonly property string stopSymbol: "\u2587" // BLACK SQUARE - - text: taskbar.progress.stopped ? playSymbol : taskbar.progress.paused ? stopSymbol : pauseSymbol - onClicked: taskbar.progress.stopped ? taskbar.progress.resume() : taskbar.progress.paused ? taskbar.progress.stop() : taskbar.progress.pause() - Layout.fillHeight: true - Layout.rowSpan: 3 - } - - Label { text: "Maximum:" } - SpinBox { - id: maxSpinBox - - value: 100 - stepSize: 1 - minimumValue: -1000 - maximumValue: 1000 - enabled: !indeterminateBox.checked - Layout.fillWidth: true - } - - Item { Layout.fillWidth: true } - - CheckBox { - id: indeterminateBox - text: "Indeterminate" - } - } - } - } -} diff --git a/tests/manual/quicktaskbar/quicktaskbar.qmlproject b/tests/manual/quicktaskbar/quicktaskbar.qmlproject deleted file mode 100644 index e5a8bf0..0000000 --- a/tests/manual/quicktaskbar/quicktaskbar.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "main.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/tests/manual/quickthumbnail/main.qml b/tests/manual/quickthumbnail/main.qml deleted file mode 100644 index e73b59f..0000000 --- a/tests/manual/quickthumbnail/main.qml +++ /dev/null @@ -1,231 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -import QtQuick 2.1 -import QtWinExtras 1.0 -import QtQuick.Layouts 1.0 -import QtQuick.Controls 1.0 - -ApplicationWindow { - id: window - - title: "ThumbnailToolBar" - - width: 800 - height: 400 - minimumWidth: 480 - minimumHeight: 320 - - ThumbnailToolBar { - id: toolBar - iconicThumbnailSource : "qrc:/qt-project.org/qmessagebox/images/qtlogo-64.png" - iconicLivePreviewSource : "qrc:/qt-project.org/qmessagebox/images/qtlogo-64.png" - - ThumbnailToolButton { - tooltip: "Button #1" - iconSource: "qrc:/qt-project.org/qmessagebox/images/qtlogo-64.png" - } - - Component { - id: buttonComponent - ThumbnailToolButton { - iconSource: "qrc:/qt-project.org/qmessagebox/images/qtlogo-64.png" - } - } - } - - RowLayout { - id: row - - spacing: 10 - anchors.margins: 10 - anchors.fill: parent - - Item { - width: window.width / 3 * 2 - Layout.fillWidth: true - Layout.fillHeight: true - - GroupBox { - anchors.fill: parent - title: qsTr("Buttons (%1)").arg(toolBar.count) - - ColumnLayout { - anchors.fill: parent - anchors.margins: 10 - - TableView { - id: tableView - - currentRow: 0 - model: toolBar.buttons - - Layout.fillWidth: true - Layout.fillHeight: true - - TableViewColumn { role: "tooltip"; title: "Tooltip"; width: 132 } - TableViewColumn { role: "iconSource"; title: "Icon"; width: 88 } - TableViewColumn { role: "visible"; title: "Visible"; width: 64 } - TableViewColumn { role: "enabled"; title: "Enabled"; width: 64 } - TableViewColumn { role: "interactive"; title: "Interactive"; width: 64 } - TableViewColumn { role: "flat"; title: "Flat"; width: 64 } - TableViewColumn { role: "dismissOnClick"; title: "Dismissable"; width: 64 } - } - - RowLayout { - spacing: 10 - anchors.horizontalCenter: parent.horizontalCenter - - ToolButton { - property int counter: 1 - - text: "Add" - onClicked: { - var btn = buttonComponent.createObject(toolBar) - btn.tooltip = qsTr("Button #%1").arg(++counter) - toolBar.addButton(btn) - tableView.currentRow = toolBar.count - 1 - } - } - - ToolButton { - text: "Remove" - enabled: toolBar.count > 0 && tableView.currentRow !== -1 - onClicked: { - toolBar.removeButton(toolBar.buttons[tableView.currentRow]) - } - } - - ToolButton { - text: "Clear" - enabled: toolBar.count > 0 - onClicked: { - toolBar.clear() - } - } - } - } - } - } - - Item { - Layout.fillHeight: true - width: repeater.count ? repeater.itemAt(0).implicitWidth : 0 - - Repeater { - id: repeater - - model: toolBar.buttons - - GroupBox { - title: "Properties" - - anchors.fill: parent - visible: index === tableView.currentRow - implicitWidth: grid.implicitWidth + 20 - - GridLayout { - id: grid - - columns: 2 - rowSpacing: 10 - columnSpacing: 10 - anchors.fill: parent - anchors.margins: 10 - - property ThumbnailToolButton button: toolBar.buttons[index] - - Label { text: "Tooltip:" } - TextField { - text: grid.button ? grid.button.tooltip : "" - onTextChanged: if (grid.button) grid.button.tooltip = text - Layout.fillWidth: true - } - - Label { text: "Icon:" } - ComboBox { - currentIndex: 1 - textRole: "name" - Layout.fillWidth: true - model: ListModel { - id: iconModel - ListElement { name: "None"; source: "" } - ListElement { name: "Qt logo (64)"; source: "qrc:/qt-project.org/qmessagebox/images/qtlogo-64.png" } - ListElement { name: "Up (16)"; source: "qrc:/qt-project.org/styles/commonstyle/images/up-16.png" } - ListElement { name: "Left (32)"; source: "qrc:/qt-project.org/styles/commonstyle/images/left-32.png" } - ListElement { name: "Right (32)"; source: "qrc:/qt-project.org/styles/commonstyle/images/right-32.png" } - ListElement { name: "Down (128)"; source: "qrc:/qt-project.org/styles/commonstyle/images/down-128.png" } - ListElement { name: "Non-existing"; source: "something that does not exist" } - } - onCurrentIndexChanged: { - if (grid.button && currentIndex !== -1) - grid.button.iconSource = iconModel.get(currentIndex).source - } - } - - CheckBox { - text: "Visible" - checked: grid.button && grid.button.visible - onCheckedChanged: if (grid.button) grid.button.visible = checked - Layout.columnSpan: 2 - } - - CheckBox { - text: "Enabled" - checked: grid.button && grid.button.enabled - onCheckedChanged: if (grid.button) grid.button.enabled = checked - Layout.columnSpan: 2 - } - - CheckBox { - text: "Interactive" - checked: grid.button && grid.button.interactive - onCheckedChanged: if (grid.button) grid.button.interactive = checked - Layout.columnSpan: 2 - } - - CheckBox { - text: "Flat" - checked: grid.button && grid.button.flat - onCheckedChanged: if (grid.button) grid.button.flat = checked - Layout.columnSpan: 2 - } - - CheckBox { - text: "Dismissable" - checked: grid.button && grid.button.dismissOnClick - onCheckedChanged: if (grid.button) grid.button.dismissOnClick = checked - Layout.columnSpan: 2 - } - - Item { Layout.fillHeight: true } - } - } - } - } - } -} diff --git a/tests/manual/quickthumbnail/quickthumbnail.qmlproject b/tests/manual/quickthumbnail/quickthumbnail.qmlproject deleted file mode 100644 index e5a8bf0..0000000 --- a/tests/manual/quickthumbnail/quickthumbnail.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "main.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/tests/manual/thumbnail/.prev_CMakeLists.txt b/tests/manual/thumbnail/.prev_CMakeLists.txt deleted file mode 100644 index 9c1d8e3..0000000 --- a/tests/manual/thumbnail/.prev_CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# Generated from thumbnail.pro. - -##################################################################### -## thumbnail Binary: -##################################################################### - -qt_add_executable(thumbnail - SOURCES - main.cpp - PUBLIC_LIBRARIES - Qt::Gui - Qt::Widgets - Qt::WinExtras -) - -#### Keys ignored in scope 1:.:.:thumbnail.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/manual/thumbnail/CMakeLists.txt b/tests/manual/thumbnail/CMakeLists.txt deleted file mode 100644 index 03c66c4..0000000 --- a/tests/manual/thumbnail/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# Generated from thumbnail.pro. - -##################################################################### -## thumbnail Binary: -##################################################################### - -qt_add_manual_test(thumbnail # special case - SOURCES - main.cpp - PUBLIC_LIBRARIES - Qt::Gui - Qt::Widgets - Qt::WinExtras -) - -#### Keys ignored in scope 1:.:.:thumbnail.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/manual/thumbnail/main.cpp b/tests/manual/thumbnail/main.cpp deleted file mode 100644 index 8266a0a..0000000 --- a/tests/manual/thumbnail/main.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************** - ** - ** Copyright (C) 2016 The Qt Company Ltd. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the test suite of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 3 as published by the Free Software - ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ - -#include <QApplication> -#include <QMainWindow> -#include <QPlainTextEdit> -#include <QMenuBar> -#include <QMenu> -#include <QAction> -#include <QStyle> -#include <QScreen> -#include <QShortcut> -#include <QPixmap> -#include <QPainter> -#include <QFontMetrics> -#include <QtWinExtras> -#include <QDebug> - -static QPixmap drawColoredPixmap(const QSize &size, const QColor &color, - const QString &text = QString()) -{ - QPixmap result(size); - result.fill(color); - QPainter painter(&result); - painter.drawRect(QRect(QPoint(0, 0), size - QSize(1, 1))); - if (!text.isEmpty()) { - QFont font = painter.font(); - font.setPointSize(20); - painter.setFont(font); - const QFontMetrics fontMetrics(font); - QRect boundingRect(fontMetrics.boundingRect(text)); - const int x = (size.width() - boundingRect.width()) / 2; - const int y = size.height() - (size.height() - boundingRect.height()) / 2; - painter.drawText(x, y, text); - } - return result; -} - -class MainWindow : public QMainWindow { - Q_OBJECT -public: - MainWindow(); - void initThumbnailToolBar(); - -public slots: - void testButtonClicked(); - void updateIconicThumbnailPixmap(); - void updateIconicLivePreviewPixmap(); - void logText(const QString &text); - -private: - QWinThumbnailToolBar *m_thumbnailToolBar; - QPlainTextEdit *m_logEdit; - QAction *m_enableIconicPixmapAction; - QAction *m_enableIconicLivePreviewAction; -}; - -MainWindow::MainWindow() - : m_thumbnailToolBar(new QWinThumbnailToolBar(this)) - , m_logEdit(new QPlainTextEdit) - , m_enableIconicPixmapAction(new QAction("Enable Iconic Pixmap", this)) - , m_enableIconicLivePreviewAction(new QAction("Enable LivePreview", this)) -{ - setMinimumWidth(400); - setWindowTitle(QStringLiteral("QWinThumbnailToolBar ") + QLatin1String(QT_VERSION_STR)); - QMenu *fileMenu = menuBar()->addMenu("&File"); - m_enableIconicPixmapAction->setCheckable(true); - m_enableIconicPixmapAction->setChecked(true); - m_enableIconicLivePreviewAction->setCheckable(true); - m_enableIconicLivePreviewAction->setChecked(true); - fileMenu->addAction(m_enableIconicPixmapAction); - fileMenu->addAction(m_enableIconicLivePreviewAction); - QAction *quitAction = fileMenu->addAction("&Quit"); - quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); - connect(quitAction, &QAction::triggered, QCoreApplication::quit); - setCentralWidget(m_logEdit); -} - -void MainWindow::initThumbnailToolBar() -{ - m_thumbnailToolBar->setWindow(windowHandle()); - auto *testButton = new QWinThumbnailToolButton(m_thumbnailToolBar); - testButton->setToolTip("Test"); - testButton->setIcon(style()->standardIcon(QStyle::SP_ComputerIcon)); - connect(testButton, &QWinThumbnailToolButton::clicked, this, &MainWindow::testButtonClicked); - m_thumbnailToolBar->addButton(testButton); - m_thumbnailToolBar->setIconicPixmapNotificationsEnabled(true); - connect(m_thumbnailToolBar, &QWinThumbnailToolBar::iconicLivePreviewPixmapRequested, - this, &MainWindow::updateIconicLivePreviewPixmap); - connect(m_thumbnailToolBar, &QWinThumbnailToolBar::iconicThumbnailPixmapRequested, - this, &MainWindow::updateIconicThumbnailPixmap); -} - -void MainWindow::logText(const QString &text) -{ - m_logEdit->appendPlainText(text); - qDebug("%s", qPrintable(text)); -} - -void MainWindow::testButtonClicked() -{ - static int n = 1; - logText(QStringLiteral("Clicked #") + QString::number(n++)); -} - -void MainWindow::updateIconicThumbnailPixmap() -{ - static int n = 1; - if (!m_enableIconicPixmapAction->isChecked()) - return; - const QString number = QString::number(n++); - logText(QLatin1String(__FUNCTION__) + u' ' + number); - const QPixmap pixmap = - drawColoredPixmap(QSize(200, 50), Qt::yellow, QStringLiteral("ITP ") + number); - m_thumbnailToolBar->setIconicThumbnailPixmap(pixmap); -} - -void MainWindow::updateIconicLivePreviewPixmap() -{ - static int n = 1; - if (!m_enableIconicLivePreviewAction->isChecked()) - return; - const QString number = QString::number(n++); - logText(QLatin1String(__FUNCTION__) + u' ' + number); - const QPixmap pixmap = - drawColoredPixmap(QSize(200, 50), Qt::red, QStringLiteral("ILP ") + number); - m_thumbnailToolBar->setIconicLivePreviewPixmap(pixmap); -} - -int main(int argc, char* argv[]) -{ - QApplication a(argc, argv); - MainWindow w; - w.move(QGuiApplication::primaryScreen()->availableGeometry().center() - - QPoint(w.width() / 2, w.height() / 2)); - w.show(); - w.initThumbnailToolBar(); - return a.exec(); -} - -#include "main.moc" diff --git a/tests/manual/thumbnail/thumbnail.pro b/tests/manual/thumbnail/thumbnail.pro deleted file mode 100644 index 2259b9b..0000000 --- a/tests/manual/thumbnail/thumbnail.pro +++ /dev/null @@ -1,4 +0,0 @@ -TEMPLATE = app -QT += widgets winextras -CONFIG -= app_bundle -SOURCES += main.cpp diff --git a/tests/tests.pro b/tests/tests.pro deleted file mode 100644 index 1a05245..0000000 --- a/tests/tests.pro +++ /dev/null @@ -1,2 +0,0 @@ -TEMPLATE = subdirs -win32: SUBDIRS += auto manual |