From a26bd74b0da208ef9592b8dc857731207ca81ac7 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sun, 14 Oct 2018 01:56:59 +0100 Subject: [PATCH 1/6] Accept all wheel events in ViewArea --- app/ViewArea.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/ViewArea.cpp b/app/ViewArea.cpp index a89e5e4..808fc3e 100644 --- a/app/ViewArea.cpp +++ b/app/ViewArea.cpp @@ -729,6 +729,8 @@ void ViewArea::wheelEvent( QWheelEvent* event ) double scale; double usedScale; + event->accept(); + if( event->modifiers() & Qt::ControlModifier ) { scale = 0.001 * event->delta(); From 57721f5d1af7b3deb8d8e85d666137190a3d6b9a Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sun, 14 Oct 2018 19:50:14 +0100 Subject: [PATCH 2/6] Fix warning in HEVCIntraPrediction module --- modules/HEVCIntraPrediction.cpp | 32 ++++++++++++++++---------------- modules/HEVCIntraPrediction.h | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/modules/HEVCIntraPrediction.cpp b/modules/HEVCIntraPrediction.cpp index 29c7156..40536cc 100644 --- a/modules/HEVCIntraPrediction.cpp +++ b/modules/HEVCIntraPrediction.cpp @@ -41,17 +41,17 @@ HEVCIntraPrediction::HEVCIntraPrediction() CLP_MODULES_HAS_INFO | CLP_MODULE_REQUIRES_OPTIONS; - m_cModuleOptions.addOptions() /**/ - ( "mode", m_uiMode, "Intra mode (26-34) [26]" ) /**/ - ( "block_size", m_uiBlockSize, "Block size [4]" ) /**/ - ( "x_pel", m_uiXpel, "X coordinate [1]" ) /**/ + m_cModuleOptions.addOptions() /**/ + ( "mode", m_uiMode, "Intra mode (26-34) [26]" ) /**/ + ( "block_size", m_iBlockSize, "Block size [4]" ) /**/ + ( "x_pel", m_uiXpel, "X coordinate [1]" ) /**/ ( "y_pel", m_uiYpel, "Y coordinate [1]" ); m_pcPredBlock = NULL; m_referenceMem = NULL; m_uiMode = 26; - m_uiBlockSize = 4; + m_iBlockSize = 4; m_uiXpel = 1; m_uiYpel = 1; } @@ -59,9 +59,9 @@ HEVCIntraPrediction::HEVCIntraPrediction() bool HEVCIntraPrediction::create( std::vector apcFrameList ) { m_pcPredBlock = NULL; - m_pcPredBlock = new CalypFrame( m_uiBlockSize * 2 + 1, m_uiBlockSize * 2 + 1, CLP_GRAY, apcFrameList[0]->getBitsPel() ); + m_pcPredBlock = new CalypFrame( m_iBlockSize * 2 + 1, m_iBlockSize * 2 + 1, CLP_GRAY, apcFrameList[0]->getBitsPel() ); - getMem1D( &m_referenceMem, m_uiBlockSize * 4 ); + getMem1D( &m_referenceMem, m_iBlockSize * 4 ); return true; } @@ -84,6 +84,7 @@ int getInverseAngularParam( int angular_param ) return g_InverAngularParamLookup[1][i]; } assert( 0 ); + return 0; } CalypFrame* HEVCIntraPrediction::process( std::vector apcFrameList ) @@ -99,20 +100,19 @@ CalypFrame* HEVCIntraPrediction::process( std::vector apcFrameList int y, x; int *main_coordinate, *sub_cordinate; - ClpPel** predBlock = m_pcPredBlock->getPelBufferYUV()[0]; ClpPel** refFrame = apcFrameList[0]->getPelBufferYUV()[0]; // Reset block - for( y = 0; y < m_uiBlockSize * 2 + 1; y++ ) + for( y = 0; y < m_iBlockSize * 2 + 1; y++ ) { - for( x = 0; x < m_uiBlockSize * 2 + 1; x++ ) + for( x = 0; x < m_iBlockSize * 2 + 1; x++ ) { predBlock[y][x] = refFrame[m_uiYpel + y - 1][m_uiXpel + x - 1]; } } - ClpPel* refArray = &( m_referenceMem[m_uiBlockSize * 2] ); + ClpPel* refArray = &( m_referenceMem[m_iBlockSize * 2] ); int angular_param = getAngularParam( m_uiMode ); if( m_uiMode >= 2 && m_uiMode <= 17 ) @@ -128,7 +128,7 @@ CalypFrame* HEVCIntraPrediction::process( std::vector apcFrameList *main_coordinate = 0; *sub_cordinate = 0; - for( unsigned int i = 0; i < m_uiBlockSize * 2 + 1; i++ ) + for( int i = 0; i < m_iBlockSize * 2 + 1; i++ ) { *main_coordinate = i; refArray[i] = predBlock[y][x]; @@ -138,18 +138,18 @@ CalypFrame* HEVCIntraPrediction::process( std::vector apcFrameList int inverse_angular_param = getInverseAngularParam( angular_param ); *main_coordinate = 0; *sub_cordinate = 0; - for( int i = -1; i > -int( 2 * m_uiBlockSize ); i-- ) + for( int i = -1; i > -int( 2 * m_iBlockSize ); i-- ) { *sub_cordinate = ( ( i * inverse_angular_param + 128 ) >> 8 ); - if( *sub_cordinate >= 2 * m_uiBlockSize ) + if( *sub_cordinate >= 2 * int( m_iBlockSize ) ) break; refArray[i] = predBlock[y][x]; } } - for( y = 0; y < m_uiBlockSize; y++ ) + for( y = 0; y < m_iBlockSize; y++ ) { - for( x = 0; x < m_uiBlockSize; x++ ) + for( x = 0; x < m_iBlockSize; x++ ) { int ref_pos = *main_coordinate + 1 + ( ( ( *sub_cordinate + 1 ) * angular_param ) >> 5 ); int fract = ( ( *sub_cordinate + 1 ) * angular_param ) & 31; diff --git a/modules/HEVCIntraPrediction.h b/modules/HEVCIntraPrediction.h index 499320d..8ce0e57 100644 --- a/modules/HEVCIntraPrediction.h +++ b/modules/HEVCIntraPrediction.h @@ -35,9 +35,9 @@ class HEVCIntraPrediction : public CalypModuleIf private: CalypFrame* m_pcPredBlock; unsigned int m_uiMode; - unsigned int m_uiBlockSize; unsigned int m_uiXpel; unsigned int m_uiYpel; + int m_iBlockSize; ClpPel* m_referenceMem; public: From 1ea65cabf096329ab7d76768062e5bce00e78e77 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sun, 14 Oct 2018 19:55:07 +0100 Subject: [PATCH 3/6] Update QCustomPlot library to version 2.0.1 --- app/external/qcustomplot/GPL.txt | 674 ----------------------- app/external/qcustomplot/changelog.txt | 22 + app/external/qcustomplot/qcustomplot.cpp | 295 ++++++---- app/external/qcustomplot/qcustomplot.h | 157 +++--- 4 files changed, 300 insertions(+), 848 deletions(-) delete mode 100644 app/external/qcustomplot/GPL.txt diff --git a/app/external/qcustomplot/GPL.txt b/app/external/qcustomplot/GPL.txt deleted file mode 100644 index 94a9ed0..0000000 --- a/app/external/qcustomplot/GPL.txt +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - 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. - - - Copyright (C) - - 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 . - -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: - - Copyright (C) - 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 -. - - 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 -. diff --git a/app/external/qcustomplot/changelog.txt b/app/external/qcustomplot/changelog.txt index 50e3349..545d8bf 100644 --- a/app/external/qcustomplot/changelog.txt +++ b/app/external/qcustomplot/changelog.txt @@ -1,3 +1,25 @@ +#### Version 2.0.1 released on 25.06.18 #### + +Bugfixes: + - Default filling order of QCPLayoutGrid is now foColumnsFirst instead of foRowsFirst, as intended and consistent with QCP1. + Note that this also changes the indexing order of e.g. QCustomPlot::axisRect(int index), compared with 2.0.0. You can change + the filling and thus indexing order yourself by calling QCPLayoutGrid::setFillOrder. + - fixed bug in QCPColorMap, when using alpha in the gradient color stops. Used to draw falsely black data points when the associated data value is exactly + on the first or last color stop. + - QCPDataSelection::enforceType(stDataRange) would erroneously add an empty data range to the selection, if the selection was already empty. + This in turn would cause isEmpty() to erroneously return false. + - fixed hypothetical crash when selectTest is called on a QCPItemCurve which has all of its points at the same position + +Other: + - Various documentation improvements and clarifications + - Prevent conflict with windows.h min/max macros if user forgets to define NOMINMAX + - compiling QCP shared libraries with static Qt is now easier + - added defines QCUSTOMPLOT_VERSION and QCUSTOMPLOT_VERSION_STR (the same way Qt does) to provide the used QCP version number + - added missing Q_DECL_OVERRIDE declarations, thus preventing warnings some compiler settings + - QCPAxisTicker and subclasses are no longer copyable by value, as intended + - QCPBarsGroup constructor is now explicit, as intended + - Qt 5.11 compatibility + #### Version 2.0.0 released on 04.09.17 #### Added major features: diff --git a/app/external/qcustomplot/qcustomplot.cpp b/app/external/qcustomplot/qcustomplot.cpp index 154576a..51722e2 100644 --- a/app/external/qcustomplot/qcustomplot.cpp +++ b/app/external/qcustomplot/qcustomplot.cpp @@ -1,7 +1,7 @@ /*************************************************************************** ** ** ** QCustomPlot, an easy to use, modern plotting widget for Qt ** -** Copyright (C) 2011-2017 Emanuel Eichhammer ** +** Copyright (C) 2011-2018 Emanuel Eichhammer ** ** ** ** 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 ** @@ -19,15 +19,15 @@ **************************************************************************** ** Author: Emanuel Eichhammer ** ** Website/Contact: http://www.qcustomplot.com/ ** -** Date: 04.09.17 ** -** Version: 2.0.0 ** +** Date: 25.06.18 ** +** Version: 2.0.1 ** ****************************************************************************/ #include "qcustomplot.h" /* including file 'src/vector2d.cpp', size 7340 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPVector2D @@ -260,7 +260,7 @@ QCPVector2D &QCPVector2D::operator-=(const QCPVector2D &vector) /* including file 'src/painter.cpp', size 8670 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPPainter @@ -478,7 +478,7 @@ void QCPPainter::makeNonCosmetic() /* including file 'src/paintbuffer.cpp', size 18502 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPAbstractPaintBuffer @@ -950,8 +950,8 @@ void QCPPaintBufferGlFbo::reallocateBuffer() /* end of 'src/paintbuffer.cpp' */ -/* including file 'src/layer.cpp', size 37064 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/layer.cpp', size 37304 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPLayer @@ -1464,9 +1464,13 @@ bool QCPLayerable::realVisibility() const placed in \a details. So in the subsequent \ref selectEvent, the decision which part was selected doesn't have to be done a second time for a single selection operation. + In the case of 1D Plottables (\ref QCPAbstractPlottable1D, like \ref QCPGraph or \ref QCPBars) \a + details will be set to a \ref QCPDataSelection, describing the closest data point to \a pos. + You may pass 0 as \a details to indicate that you are not interested in those selection details. - \see selectEvent, deselectEvent, mousePressEvent, wheelEvent, QCustomPlot::setInteractions + \see selectEvent, deselectEvent, mousePressEvent, wheelEvent, QCustomPlot::setInteractions, + QCPAbstractPlottable1D::selectTestRect */ double QCPLayerable::selectTest(const QPointF &pos, bool onlySelectable, QVariant *details) const { @@ -1804,7 +1808,7 @@ void QCPLayerable::wheelEvent(QWheelEvent *event) /* including file 'src/axis/range.cpp', size 12221 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPRange @@ -2125,8 +2129,8 @@ bool QCPRange::validRange(const QCPRange &range) /* end of 'src/axis/range.cpp' */ -/* including file 'src/selection.cpp', size 21906 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/selection.cpp', size 21941 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPDataRange @@ -2136,8 +2140,9 @@ bool QCPRange::validRange(const QCPRange &range) \brief Describes a data range given by begin and end index QCPDataRange holds two integers describing the begin (\ref setBegin) and end (\ref setEnd) index - of a contiguous set of data points. The end index points to the data point above the last data point that's part of - the data range, similarly to the nomenclature used in standard iterators. + of a contiguous set of data points. The end index points to the data point just after the last + data point that's part of the data range, similarly to the nomenclature used in standard + iterators. Data Ranges are not bound to a certain plottable, thus they can be freely exchanged, created and modified. If a non-contiguous data set shall be described, the class \ref QCPDataSelection is @@ -2184,7 +2189,7 @@ bool QCPRange::validRange(const QCPRange &range) /*! \fn void QCPDataRange::setEnd(int end) - Sets the end of this data range. The \a end index points to the data point just above the last + Sets the end of this data range. The \a end index points to the data point just after the last data point that is part of the data range. No checks or corrections are made to ensure the resulting range is valid (\ref isValid). @@ -2300,7 +2305,7 @@ bool QCPDataRange::intersects(const QCPDataRange &other) const } /*! - Returns whether all data points described by this data range are also in \a other. + Returns whether all data points of \a other are also contained inside this data range. \see intersects */ @@ -2631,7 +2636,8 @@ void QCPDataSelection::enforceType(QCP::SelectionType type) } case QCP::stDataRange: { - mDataRanges = QList() << span(); + if (!isEmpty()) + mDataRanges = QList() << span(); break; } case QCP::stMultipleDataRanges: @@ -2726,7 +2732,7 @@ QCPDataSelection QCPDataSelection::inverse(const QCPDataRange &outerRange) const /* including file 'src/selectionrect.cpp', size 9224 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPSelectionRect @@ -2954,8 +2960,8 @@ void QCPSelectionRect::draw(QCPPainter *painter) /* end of 'src/selectionrect.cpp' */ -/* including file 'src/layout.cpp', size 79064 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/layout.cpp', size 79139 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPMarginGroup @@ -4074,7 +4080,7 @@ QCPLayoutGrid::QCPLayoutGrid() : mColumnSpacing(5), mRowSpacing(5), mWrap(0), - mFillOrder(foRowsFirst) + mFillOrder(foColumnsFirst) { } @@ -4350,7 +4356,8 @@ void QCPLayoutGrid::setWrap(int count) The specified \a order defines whether rows or columns are filled first. Using \ref setWrap, you can control at which row/column count wrapping into the next column/row will occur. If you set it to zero, no wrapping will ever occur. Changing the fill order also changes the meaning of the - linear index used e.g. in \ref elementAt and \ref takeAt. + linear index used e.g. in \ref elementAt and \ref takeAt. The default fill order for \ref + QCPLayoutGrid is \ref foColumnsFirst. If you want to have all current elements arranged in the new order, set \a rearrange to true. The elements will be rearranged in a way that tries to preserve their linear index. However, empty @@ -5125,7 +5132,7 @@ void QCPLayoutInset::addElement(QCPLayoutElement *element, const QRectF &rect) /* including file 'src/lineending.cpp', size 11536 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPLineEnding @@ -5424,7 +5431,7 @@ void QCPLineEnding::draw(QCPPainter *painter, const QCPVector2D &pos, double ang /* including file 'src/axis/axisticker.cpp', size 18664 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPAxisTicker @@ -5844,7 +5851,7 @@ double QCPAxisTicker::cleanMantissa(double input) const /* including file 'src/axis/axistickerdatetime.cpp', size 14443 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPAxisTickerDateTime @@ -6141,7 +6148,7 @@ double QCPAxisTickerDateTime::dateTimeToKey(const QDate date) /* including file 'src/axis/axistickertime.cpp', size 11747 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPAxisTickerTime @@ -6390,7 +6397,7 @@ void QCPAxisTickerTime::replaceUnit(QString &text, QCPAxisTickerTime::TimeUnit u /* including file 'src/axis/axistickerfixed.cpp', size 5583 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPAxisTickerFixed @@ -6491,8 +6498,8 @@ double QCPAxisTickerFixed::getTickStep(const QCPRange &range) /* end of 'src/axis/axistickerfixed.cpp' */ -/* including file 'src/axis/axistickertext.cpp', size 8653 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/axis/axistickertext.cpp', size 8661 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPAxisTickerText @@ -6562,7 +6569,7 @@ void QCPAxisTickerText::setTicks(const QMap &ticks) \see addTicks, addTick, clear */ -void QCPAxisTickerText::setTicks(const QVector &positions, const QVector labels) +void QCPAxisTickerText::setTicks(const QVector &positions, const QVector &labels) { clear(); addTicks(positions, labels); @@ -6600,7 +6607,7 @@ void QCPAxisTickerText::clear() \see addTicks, setTicks, clear */ -void QCPAxisTickerText::addTick(double position, QString label) +void QCPAxisTickerText::addTick(double position, const QString &label) { mTicks.insert(position, label); } @@ -6705,7 +6712,7 @@ QVector QCPAxisTickerText::createTickVector(double tickStep, const QCPRa /* including file 'src/axis/axistickerpi.cpp', size 11170 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPAxisTickerPi @@ -6992,7 +6999,7 @@ QString QCPAxisTickerPi::unicodeSubscript(int number) const /* including file 'src/axis/axistickerlog.cpp', size 7106 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPAxisTickerLog @@ -7132,8 +7139,8 @@ QVector QCPAxisTickerLog::createTickVector(double tickStep, const QCPRan /* end of 'src/axis/axistickerlog.cpp' */ -/* including file 'src/axis/axis.cpp', size 99397 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/axis/axis.cpp', size 99515 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -7653,10 +7660,14 @@ QCPLineEnding QCPAxis::upperEnding() const /*! Sets whether the axis uses a linear scale or a logarithmic scale. - Note that this method controls the coordinate transformation. You will likely also want to use a - logarithmic tick spacing and labeling, which can be achieved by setting an instance of \ref - QCPAxisTickerLog via \ref setTicker. See the documentation of \ref QCPAxisTickerLog about the - details of logarithmic axis tick creation. + Note that this method controls the coordinate transformation. For logarithmic scales, you will + likely also want to use a logarithmic tick spacing and labeling, which can be achieved by setting + the axis ticker to an instance of \ref QCPAxisTickerLog : + + \snippet documentation/doc-code-snippets/mainwindow.cpp qcpaxisticker-log-creation + + See the documentation of \ref QCPAxisTickerLog about the details of logarithmic axis tick + creation. \ref setNumberPrecision */ @@ -9819,7 +9830,7 @@ void QCPAxisPainterPrivate::getMaxTickLabelSize(const QFont &font, const QString /* including file 'src/scatterstyle.cpp', size 17450 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPScatterStyle @@ -10293,7 +10304,7 @@ void QCPScatterStyle::drawShape(QCPPainter *painter, double x, double y) const //amalgamation: add datacontainer.cpp /* including file 'src/plottable.cpp', size 38845 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPSelectionDecorator @@ -11265,8 +11276,8 @@ void QCPAbstractPlottable::deselectEvent(bool *selectionStateChanged) /* end of 'src/plottable.cpp' */ -/* including file 'src/item.cpp', size 49269 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/item.cpp', size 49271 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPItemAnchor @@ -12411,7 +12422,7 @@ double QCPAbstractItem::rectDistance(const QRectF &rect, const QPointF &pos, boo QList lines; lines << QLineF(rect.topLeft(), rect.topRight()) << QLineF(rect.bottomLeft(), rect.bottomRight()) << QLineF(rect.topLeft(), rect.bottomLeft()) << QLineF(rect.topRight(), rect.bottomRight()); - double minDistSqr = std::numeric_limits::max(); + double minDistSqr = (std::numeric_limits::max)(); for (int i=0; i QCustomPlot::axisRects() const { @@ -15718,8 +15745,8 @@ void QCustomPlot::toPainter(QCPPainter *painter, int width, int height) //amalgamation: add plottable1d.cpp -/* including file 'src/colorgradient.cpp', size 24646 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/colorgradient.cpp', size 25342 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -16282,10 +16309,22 @@ void QCPColorGradient::updateColorBuffer() QMap::const_iterator it = mColorStops.lowerBound(position); if (it == mColorStops.constEnd()) // position is on or after last stop, use color of last stop { - mColorBuffer[i] = (it-1).value().rgba(); + if (useAlpha) + { + const QColor col = (it-1).value(); + const float alphaPremultiplier = col.alpha()/255.0f; // since we use QImage::Format_ARGB32_Premultiplied + mColorBuffer[i] = qRgba(col.red()*alphaPremultiplier, col.green()*alphaPremultiplier, col.blue()*alphaPremultiplier, col.alpha()); + } else + mColorBuffer[i] = (it-1).value().rgba(); } else if (it == mColorStops.constBegin()) // position is on or before first stop, use color of first stop { - mColorBuffer[i] = it.value().rgba(); + if (useAlpha) + { + const QColor col = it.value(); + const float alphaPremultiplier = col.alpha()/255.0f; // since we use QImage::Format_ARGB32_Premultiplied + mColorBuffer[i] = qRgba(col.red()*alphaPremultiplier, col.green()*alphaPremultiplier, col.blue()*alphaPremultiplier, col.alpha()); + } else + mColorBuffer[i] = it.value().rgba(); } else // position is in between stops (or on an intermediate stop), interpolate color { QMap::const_iterator high = it; @@ -16359,7 +16398,7 @@ void QCPColorGradient::updateColorBuffer() /* including file 'src/selectiondecorator-bracket.cpp', size 12313 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPSelectionDecoratorBracket @@ -16645,7 +16684,7 @@ QPointF QCPSelectionDecoratorBracket::getPixelCoordinates(const QCPPlottableInte /* including file 'src/layoutelements/layoutelement-axisrect.cpp', size 47584 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -17919,8 +17958,8 @@ void QCPAxisRect::wheelEvent(QWheelEvent *event) /* end of 'src/layoutelements/layoutelement-axisrect.cpp' */ -/* including file 'src/layoutelements/layoutelement-legend.cpp', size 31097 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/layoutelements/layoutelement-legend.cpp', size 31153 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPAbstractLegendItem @@ -18259,7 +18298,7 @@ QSize QCPPlottableLegendItem::minimumOuterSizeHint() const Use the methods \ref setFillOrder and \ref setWrap inherited from \ref QCPLayoutGrid to control in which order (column first or row first) the legend is filled up when calling \ref addItem, and - at which column or row wrapping occurs. + at which column or row wrapping occurs. The default fill order for legends is \ref foRowsFirst. By default, every QCustomPlot has one legend (\ref QCustomPlot::legend) which is placed in the inset layout of the main axis rect (\ref QCPAxisRect::insetLayout). To move the legend to another @@ -18836,7 +18875,7 @@ void QCPLegend::parentPlotInitialized(QCustomPlot *parentPlot) /* including file 'src/layoutelements/layoutelement-textelement.cpp', size 12761 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPTextElement @@ -19239,8 +19278,8 @@ QColor QCPTextElement::mainTextColor() const /* end of 'src/layoutelements/layoutelement-textelement.cpp' */ -/* including file 'src/layoutelements/layoutelement-colorscale.cpp', size 25770 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/layoutelements/layoutelement-colorscale.cpp', size 26246 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -19459,13 +19498,22 @@ void QCPColorScale::setDataRange(const QCPRange &dataRange) } /*! - Sets the scale type of the color scale, i.e. whether values are linearly associated with colors + Sets the scale type of the color scale, i.e. whether values are associated with colors linearly or logarithmically. It is equivalent to calling QCPColorMap::setDataScaleType on any of the connected color maps. It is also equivalent to directly accessing the \ref axis and setting its scale type with \ref QCPAxis::setScaleType. + Note that this method controls the coordinate transformation. For logarithmic scales, you will + likely also want to use a logarithmic tick spacing and labeling, which can be achieved by setting + the color scale's \ref axis ticker to an instance of \ref QCPAxisTickerLog : + + \snippet documentation/doc-code-snippets/mainwindow.cpp qcpaxisticker-log-colorscale + + See the documentation of \ref QCPAxisTickerLog about the details of logarithmic axis tick + creation. + \see setDataRange, setGradient */ void QCPColorScale::setDataScaleType(QCPAxis::ScaleType scaleType) @@ -19899,8 +19947,8 @@ void QCPColorScaleAxisRectPrivate::axisSelectableChanged(QCPAxis::SelectablePart /* end of 'src/layoutelements/layoutelement-colorscale.cpp' */ -/* including file 'src/plottables/plottable-graph.cpp', size 73960 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/plottables/plottable-graph.cpp', size 74194 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPGraphData @@ -20259,7 +20307,14 @@ void QCPGraph::addData(double key, double value) mDataContainer->add(QCPGraphData(key, value)); } -/* inherits documentation from base class */ +/*! + Implements a selectTest specific to this plottable's point geometry. + + If \a details is not 0, it will be set to a \ref QCPDataSelection, describing the closest data + point to \a pos. + + \seebaseclassmethod \ref QCPAbstractPlottable::selectTest +*/ double QCPGraph::selectTest(const QPointF &pos, bool onlySelectable, QVariant *details) const { if ((onlySelectable && mSelectable == QCP::stNone) || mDataContainer->isEmpty()) @@ -20857,11 +20912,11 @@ void QCPGraph::getOptimizedLineData(QVector *lineData, const QCPGr if (begin == end) return; int dataCount = end-begin; - int maxCount = std::numeric_limits::max(); + int maxCount = (std::numeric_limits::max)(); if (mAdaptiveSampling) { double keyPixelSpan = qAbs(keyAxis->coordToPixel(begin->key)-keyAxis->coordToPixel((end-1)->key)); - if (2*keyPixelSpan+2 < (double)std::numeric_limits::max()) + if (2*keyPixelSpan+2 < static_cast((std::numeric_limits::max)())) maxCount = 2*keyPixelSpan+2; } @@ -20958,7 +21013,7 @@ void QCPGraph::getOptimizedScatterData(QVector *scatterData, QCPGr } if (begin == end) return; int dataCount = end-begin; - int maxCount = std::numeric_limits::max(); + int maxCount = (std::numeric_limits::max)(); if (mAdaptiveSampling) { int keyPixelSpan = qAbs(keyAxis->coordToPixel(begin->key)-keyAxis->coordToPixel((end-1)->key)); @@ -21583,7 +21638,7 @@ double QCPGraph::pointDistance(const QPointF &pixelPoint, QCPGraphDataContainer: return -1.0; // calculate minimum distances to graph data points and find closestData iterator: - double minDistSqr = std::numeric_limits::max(); + double minDistSqr = (std::numeric_limits::max)(); // determine which key range comes into question, taking selection tolerance around pos into account: double posKeyMin, posKeyMax, dummy; pixelsToCoords(pixelPoint-QPointF(mParentPlot->selectionTolerance(), mParentPlot->selectionTolerance()), posKeyMin, dummy); @@ -21647,8 +21702,8 @@ int QCPGraph::findIndexBelowY(const QVector *data, double y) const /* end of 'src/plottables/plottable-graph.cpp' */ -/* including file 'src/plottables/plottable-curve.cpp', size 63527 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/plottables/plottable-curve.cpp', size 63742 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPCurveData @@ -22014,7 +22069,14 @@ void QCPCurve::addData(double key, double value) mDataContainer->add(QCPCurveData(0.0, key, value)); } -/* inherits documentation from base class */ +/*! + Implements a selectTest specific to this plottable's point geometry. + + If \a details is not 0, it will be set to a \ref QCPDataSelection, describing the closest data + point to \a pos. + + \seebaseclassmethod \ref QCPAbstractPlottable::selectTest +*/ double QCPCurve::selectTest(const QPointF &pos, bool onlySelectable, QVariant *details) const { if ((onlySelectable && mSelectable == QCP::stNone) || mDataContainer->isEmpty()) @@ -23064,7 +23126,7 @@ double QCPCurve::pointDistance(const QPointF &pixelPoint, QCPCurveDataContainer: } // calculate minimum distances to curve data points and find closestData iterator: - double minDistSqr = std::numeric_limits::max(); + double minDistSqr = (std::numeric_limits::max)(); // iterate over found data points and then choose the one with the shortest distance to pos: QCPCurveDataContainer::const_iterator begin = mDataContainer->constBegin(); QCPCurveDataContainer::const_iterator end = mDataContainer->constEnd(); @@ -23096,8 +23158,8 @@ double QCPCurve::pointDistance(const QPointF &pixelPoint, QCPCurveDataContainer: /* end of 'src/plottables/plottable-curve.cpp' */ -/* including file 'src/plottables/plottable-bars.cpp', size 43512 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/plottables/plottable-bars.cpp', size 43725 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -23844,7 +23906,14 @@ QCPDataSelection QCPBars::selectTestRect(const QRectF &rect, bool onlySelectable return result; } -/* inherits documentation from base class */ +/*! + Implements a selectTest specific to this plottable's point geometry. + + If \a details is not 0, it will be set to a \ref QCPDataSelection, describing the closest data + point to \a pos. + + \seebaseclassmethod \ref QCPAbstractPlottable::selectTest +*/ double QCPBars::selectTest(const QPointF &pos, bool onlySelectable, QVariant *details) const { Q_UNUSED(details) @@ -24264,8 +24333,8 @@ void QCPBars::connectBars(QCPBars *lower, QCPBars *upper) /* end of 'src/plottables/plottable-bars.cpp' */ -/* including file 'src/plottables/plottable-statisticalbox.cpp', size 28622 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/plottables/plottable-statisticalbox.cpp', size 28837 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPStatisticalBoxData @@ -24669,7 +24738,14 @@ QCPDataSelection QCPStatisticalBox::selectTestRect(const QRectF &rect, bool only return result; } -/* inherits documentation from base class */ +/*! + Implements a selectTest specific to this plottable's point geometry. + + If \a details is not 0, it will be set to a \ref QCPDataSelection, describing the closest data + point to \a pos. + + \seebaseclassmethod \ref QCPAbstractPlottable::selectTest +*/ double QCPStatisticalBox::selectTest(const QPointF &pos, bool onlySelectable, QVariant *details) const { Q_UNUSED(details) @@ -24684,7 +24760,7 @@ double QCPStatisticalBox::selectTest(const QPointF &pos, bool onlySelectable, QV QCPStatisticalBoxDataContainer::const_iterator visibleBegin, visibleEnd; QCPStatisticalBoxDataContainer::const_iterator closestDataPoint = mDataContainer->constEnd(); getVisibleDataBounds(visibleBegin, visibleEnd); - double minDistSqr = std::numeric_limits::max(); + double minDistSqr = (std::numeric_limits::max)(); for (QCPStatisticalBoxDataContainer::const_iterator it=visibleBegin; it!=visibleEnd; ++it) { if (getQuartileBox(it).contains(pos)) // quartile box @@ -24919,7 +24995,7 @@ QVector QCPStatisticalBox::getWhiskerBarLines(QCPStatisticalBoxDataConta /* including file 'src/plottables/plottable-colormap.cpp', size 47881 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPColorMapData @@ -26053,8 +26129,8 @@ void QCPColorMap::drawLegendIcon(QCPPainter *painter, const QRectF &rect) const /* end of 'src/plottables/plottable-colormap.cpp' */ -/* including file 'src/plottables/plottable-financial.cpp', size 42610 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/plottables/plottable-financial.cpp', size 42827 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPFinancialData @@ -26459,7 +26535,14 @@ QCPDataSelection QCPFinancial::selectTestRect(const QRectF &rect, bool onlySelec return result; } -/* inherits documentation from base class */ +/*! + Implements a selectTest specific to this plottable's point geometry. + + If \a details is not 0, it will be set to a \ref QCPDataSelection, describing the closest data + point to \a pos. + + \seebaseclassmethod \ref QCPAbstractPlottable::selectTest +*/ double QCPFinancial::selectTest(const QPointF &pos, bool onlySelectable, QVariant *details) const { Q_UNUSED(details) @@ -26852,7 +26935,7 @@ double QCPFinancial::ohlcSelectTest(const QPointF &pos, const QCPFinancialDataCo QCPAxis *valueAxis = mValueAxis.data(); if (!keyAxis || !valueAxis) { qDebug() << Q_FUNC_INFO << "invalid key or value axis"; return -1; } - double minDistSqr = std::numeric_limits::max(); + double minDistSqr = (std::numeric_limits::max)(); if (keyAxis->orientation() == Qt::Horizontal) { for (QCPFinancialDataContainer::const_iterator it=begin; it!=end; ++it) @@ -26899,7 +26982,7 @@ double QCPFinancial::candlestickSelectTest(const QPointF &pos, const QCPFinancia QCPAxis *valueAxis = mValueAxis.data(); if (!keyAxis || !valueAxis) { qDebug() << Q_FUNC_INFO << "invalid key or value axis"; return -1; } - double minDistSqr = std::numeric_limits::max(); + double minDistSqr = (std::numeric_limits::max)(); if (keyAxis->orientation() == Qt::Horizontal) { for (QCPFinancialDataContainer::const_iterator it=begin; it!=end; ++it) @@ -27008,8 +27091,8 @@ QRectF QCPFinancial::selectionHitBox(QCPFinancialDataContainer::const_iterator i /* end of 'src/plottables/plottable-financial.cpp' */ -/* including file 'src/plottables/plottable-errorbar.cpp', size 37355 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/plottables/plottable-errorbar.cpp', size 37570 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPErrorBarsData @@ -27451,7 +27534,14 @@ int QCPErrorBars::findEnd(double sortKey, bool expandedRange) const return 0; } -/* inherits documentation from base class */ +/*! + Implements a selectTest specific to this plottable's point geometry. + + If \a details is not 0, it will be set to a \ref QCPDataSelection, describing the closest data + point to \a pos. + + \seebaseclassmethod \ref QCPAbstractPlottable::selectTest +*/ double QCPErrorBars::selectTest(const QPointF &pos, bool onlySelectable, QVariant *details) const { if (!mDataPlottable) return -1; @@ -27870,7 +27960,7 @@ double QCPErrorBars::pointDistance(const QPointF &pixelPoint, QCPErrorBarsDataCo getVisibleDataBounds(begin, end, QCPDataRange(0, dataCount())); // calculate minimum distances to error backbones (whiskers are ignored for speed) and find closestData iterator: - double minDistSqr = std::numeric_limits::max(); + double minDistSqr = (std::numeric_limits::max)(); QVector backbones, whiskers; for (QCPErrorBarsDataContainer::const_iterator it=begin; it!=end; ++it) { @@ -27970,7 +28060,7 @@ bool QCPErrorBars::rectIntersectsLine(const QRectF &pixelRect, const QLineF &lin /* including file 'src/items/item-straightline.cpp', size 7592 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPItemStraightLine @@ -28151,7 +28241,7 @@ QPen QCPItemStraightLine::mainPen() const /* including file 'src/items/item-line.cpp', size 8498 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPItemLine @@ -28381,8 +28471,8 @@ QPen QCPItemLine::mainPen() const /* end of 'src/items/item-line.cpp' */ -/* including file 'src/items/item-curve.cpp', size 7159 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/items/item-curve.cpp', size 7248 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPItemCurve @@ -28492,9 +28582,12 @@ double QCPItemCurve::selectTest(const QPointF &pos, bool onlySelectable, QVarian QPainterPath cubicPath(startVec); cubicPath.cubicTo(startDirVec, endDirVec, endVec); - QPolygonF polygon = cubicPath.toSubpathPolygons().first(); + QList polygons = cubicPath.toSubpathPolygons(); + if (polygons.isEmpty()) + return -1; + const QPolygonF polygon = polygons.first(); QCPVector2D p(pos); - double minDistSqr = std::numeric_limits::max(); + double minDistSqr = (std::numeric_limits::max)(); for (int i=1; i &candidates) const; double getMantissa(double input, double *magnitude=0) const; double cleanMantissa(double input) const; + +private: + Q_DISABLE_COPY(QCPAxisTicker) + }; Q_DECLARE_METATYPE(QCPAxisTicker::TickStepStrategy) Q_DECLARE_METATYPE(QSharedPointer) @@ -1589,7 +1598,7 @@ Q_DECLARE_METATYPE(QSharedPointer) /* including file 'src/axis/axistickerdatetime.h', size 3289 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPAxisTickerDateTime : public QCPAxisTicker { @@ -1630,7 +1639,7 @@ protected: /* including file 'src/axis/axistickertime.h', size 3542 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPAxisTickerTime : public QCPAxisTicker { @@ -1682,7 +1691,7 @@ Q_DECLARE_METATYPE(QCPAxisTickerTime::TimeUnit) /* including file 'src/axis/axistickerfixed.h', size 3308 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPAxisTickerFixed : public QCPAxisTicker { @@ -1723,8 +1732,8 @@ Q_DECLARE_METATYPE(QCPAxisTickerFixed::ScaleStrategy) /* end of 'src/axis/axistickerfixed.h' */ -/* including file 'src/axis/axistickertext.h', size 3085 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/axis/axistickertext.h', size 3090 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPAxisTickerText : public QCPAxisTicker { @@ -1737,12 +1746,12 @@ public: // setters: void setTicks(const QMap &ticks); - void setTicks(const QVector &positions, const QVector labels); + void setTicks(const QVector &positions, const QVector &labels); void setSubTickCount(int subTicks); // non-virtual methods: void clear(); - void addTick(double position, QString label); + void addTick(double position, const QString &label); void addTicks(const QMap &ticks); void addTicks(const QVector &positions, const QVector &labels); @@ -1756,14 +1765,13 @@ protected: virtual int getSubTickCount(double tickStep) Q_DECL_OVERRIDE; virtual QString getTickLabel(double tick, const QLocale &locale, QChar formatChar, int precision) Q_DECL_OVERRIDE; virtual QVector createTickVector(double tickStep, const QCPRange &range) Q_DECL_OVERRIDE; - }; /* end of 'src/axis/axistickertext.h' */ /* including file 'src/axis/axistickerpi.h', size 3911 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPAxisTickerPi : public QCPAxisTicker { @@ -1822,7 +1830,7 @@ Q_DECLARE_METATYPE(QCPAxisTickerPi::FractionStyle) /* including file 'src/axis/axistickerlog.h', size 2663 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPAxisTickerLog : public QCPAxisTicker { @@ -1854,8 +1862,8 @@ protected: /* end of 'src/axis/axistickerlog.h' */ -/* including file 'src/axis/axis.h', size 20634 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/axis/axis.h', size 20698 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPGrid :public QCPLayerable { @@ -2183,10 +2191,10 @@ protected: virtual void selectEvent(QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE; virtual void deselectEvent(bool *selectionStateChanged) Q_DECL_OVERRIDE; // mouse events: - virtual void mousePressEvent(QMouseEvent *event, const QVariant &details); - virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos); - virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos); - virtual void wheelEvent(QWheelEvent *event); + virtual void mousePressEvent(QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE; + virtual void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE; + virtual void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE; + virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; // non-virtual methods: void setupTickVectors(); @@ -2283,7 +2291,7 @@ protected: /* including file 'src/scatterstyle.h', size 7275 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPScatterStyle { @@ -2390,7 +2398,7 @@ Q_DECLARE_METATYPE(QCPScatterStyle::ScatterShape) /* including file 'src/datacontainer.h', size 4596 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ /*! \relates QCPDataContainer Returns whether the sort key of \a a is less than the sort key of \a b. @@ -2460,7 +2468,7 @@ protected: // include implementation in header since it is a class template: /* including file 'src/datacontainer.cpp', size 31349 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPDataContainer @@ -3234,8 +3242,8 @@ void QCPDataContainer::performAutoSqueeze() /* end of 'src/datacontainer.h' */ -/* including file 'src/plottable.h', size 8312 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/plottable.h', size 8433 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPSelectionDecorator { @@ -3329,7 +3337,7 @@ public: void setSelectionDecorator(QCPSelectionDecorator *decorator); // introduced virtual methods: - virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const = 0; + virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE = 0; // actually introduced in QCPLayerable as non-pure, but we want to force reimplementation for plottables virtual QCPPlottableInterface1D *interface1D() { return 0; } virtual QCPRange getKeyRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const = 0; virtual QCPRange getValueRange(bool &foundRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const = 0; @@ -3392,7 +3400,7 @@ private: /* including file 'src/item.h', size 9384 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPItemAnchor { @@ -3577,7 +3585,7 @@ private: /* including file 'src/core.h', size 14886 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCustomPlot : public QWidget { @@ -3845,7 +3853,7 @@ Q_DECLARE_METATYPE(QCustomPlot::RefreshPriority) /* including file 'src/plottable1d.h', size 4544 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCPPlottableInterface1D { @@ -3904,8 +3912,8 @@ private: // include implementation in header since it is a class template: -/* including file 'src/plottable1d.cpp', size 22240 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/plottable1d.cpp', size 22361 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////// QCPPlottableInterface1D @@ -4279,6 +4287,9 @@ int QCPAbstractPlottable1D::findEnd(double sortKey, bool expandedRange point-like. Most subclasses will want to reimplement this method again, to provide a more accurate hit test based on the true data visualization geometry. + If \a details is not 0, it will be set to a \ref QCPDataSelection, describing the closest data point + to \a pos. + \seebaseclassmethod */ template @@ -4290,7 +4301,7 @@ double QCPAbstractPlottable1D::selectTest(const QPointF &pos, bool onl return -1; QCPDataSelection selectionResult; - double minDistSqr = std::numeric_limits::max(); + double minDistSqr = (std::numeric_limits::max)(); int minDistIndex = mDataContainer->size(); typename QCPDataContainer::const_iterator begin = mDataContainer->constBegin(); @@ -4425,7 +4436,7 @@ void QCPAbstractPlottable1D::drawPolyline(QCPPainter *painter, const Q /* including file 'src/colorgradient.h', size 6243 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPColorGradient { @@ -4508,7 +4519,7 @@ Q_DECLARE_METATYPE(QCPColorGradient::GradientPreset) /* including file 'src/selectiondecorator-bracket.h', size 4442 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPSelectionDecoratorBracket : public QCPSelectionDecorator { @@ -4577,7 +4588,7 @@ Q_DECLARE_METATYPE(QCPSelectionDecoratorBracket::BracketStyle) /* including file 'src/layoutelements/layoutelement-axisrect.h', size 7507 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPAxisRect : public QCPLayoutElement { @@ -4703,7 +4714,7 @@ private: /* including file 'src/layoutelements/layoutelement-legend.h', size 10397 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPAbstractLegendItem : public QCPLayoutElement { @@ -4921,7 +4932,7 @@ Q_DECLARE_METATYPE(QCPLegend::SelectablePart) /* including file 'src/layoutelements/layoutelement-textelement.h', size 5353 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPTextElement : public QCPLayoutElement { @@ -5008,7 +5019,7 @@ private: /* including file 'src/layoutelements/layoutelement-colorscale.h', size 5923 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCPColorScaleAxisRectPrivate : public QCPAxisRect @@ -5116,7 +5127,7 @@ private: /* including file 'src/plottables/plottable-graph.h', size 9294 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPGraphData { @@ -5255,7 +5266,7 @@ Q_DECLARE_METATYPE(QCPGraph::LineStyle) /* including file 'src/plottables/plottable-curve.h', size 7409 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPCurveData { @@ -5369,8 +5380,8 @@ Q_DECLARE_METATYPE(QCPCurve::LineStyle) /* end of 'src/plottables/plottable-curve.h' */ -/* including file 'src/plottables/plottable-bars.h', size 8924 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* including file 'src/plottables/plottable-bars.h', size 8933 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPBarsGroup : public QObject { @@ -5392,7 +5403,7 @@ public: }; Q_ENUMS(SpacingType) - QCPBarsGroup(QCustomPlot *parentPlot); + explicit QCPBarsGroup(QCustomPlot *parentPlot); virtual ~QCPBarsGroup(); // getters: @@ -5558,7 +5569,7 @@ Q_DECLARE_METATYPE(QCPBars::WidthType) /* including file 'src/plottables/plottable-statisticalbox.h', size 7516 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPStatisticalBoxData { @@ -5675,7 +5686,7 @@ protected: /* including file 'src/plottables/plottable-colormap.h', size 7070 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPColorMapData { @@ -5811,7 +5822,7 @@ protected: /* including file 'src/plottables/plottable-financial.h', size 8622 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPFinancialData { @@ -5950,7 +5961,7 @@ Q_DECLARE_METATYPE(QCPFinancial::ChartStyle) /* including file 'src/plottables/plottable-errorbar.h', size 7727 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPErrorBarsData { @@ -6075,7 +6086,7 @@ protected: /* including file 'src/items/item-straightline.h', size 3117 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPItemStraightLine : public QCPAbstractItem { @@ -6118,7 +6129,7 @@ protected: /* including file 'src/items/item-line.h', size 3407 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPItemLine : public QCPAbstractItem { @@ -6168,7 +6179,7 @@ protected: /* including file 'src/items/item-curve.h', size 3379 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPItemCurve : public QCPAbstractItem { @@ -6219,7 +6230,7 @@ protected: /* including file 'src/items/item-rect.h', size 3688 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPItemRect : public QCPAbstractItem { @@ -6278,7 +6289,7 @@ protected: /* including file 'src/items/item-text.h', size 5554 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPItemText : public QCPAbstractItem { @@ -6375,7 +6386,7 @@ protected: /* including file 'src/items/item-ellipse.h', size 3868 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPItemEllipse : public QCPAbstractItem { @@ -6437,7 +6448,7 @@ protected: /* including file 'src/items/item-pixmap.h', size 4373 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPItemPixmap : public QCPAbstractItem { @@ -6506,7 +6517,7 @@ protected: /* including file 'src/items/item-tracer.h', size 4762 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPItemTracer : public QCPAbstractItem { @@ -6592,7 +6603,7 @@ Q_DECLARE_METATYPE(QCPItemTracer::TracerStyle) /* including file 'src/items/item-bracket.h', size 3969 */ -/* commit 9868e55d3b412f2f89766bb482fcf299e93a0988 2017-09-04 01:56:22 +0200 */ +/* commit ce344b3f96a62e5f652585e55f1ae7c7883cd45b 2018-06-25 01:03:39 +0200 */ class QCP_LIB_DECL QCPItemBracket : public QCPAbstractItem { From 8408b7ba2b9dfe4318489f9ec5645b46b8b69733 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sun, 14 Oct 2018 19:56:36 +0100 Subject: [PATCH 4/6] Add new cmake flags and fix warnings --- CMakeLists.txt | 25 ++++++++++++++++++++++++- app/VideoSubWindow.h | 5 ++--- app/dialog/ConfigureFormatDialog.h | 4 ++-- app/main.cpp | 16 ++++++++-------- examples/modules/CMakeLists.txt | 8 +++++--- 5 files changed, 41 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 52df803..7f93c6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,7 +144,7 @@ SET( CMAKE_CXX_FLAGS "" ) INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ) ###################################################################################### -# Configure targets +# Compiler options ###################################################################################### SET(CMAKE_CXX_STANDARD 14) @@ -159,6 +159,24 @@ ENDIF() SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" ) +ADD_DEFINITIONS(-DQT_NO_CAST_TO_ASCII + #-DQT_NO_CAST_FROM_ASCII + -DQT_NO_URL_CAST_FROM_STRING + -DQT_NO_CAST_FROM_BYTEARRAY + #-DQT_NO_SIGNALS_SLOTS_KEYWORDS + #-DQT_USE_QSTRINGBUILDER + ) + +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") +endif() + +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0.0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wlogical-op" ) + endif() +endif() + IF( USE_WERROR ) SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror" ) ENDIF() @@ -166,6 +184,11 @@ ENDIF() SET( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0" ) SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2" ) + +###################################################################################### +# Configure targets +###################################################################################### + ADD_FEATURE_INFO(CalypApp BUILD_APP "Build Graphical interface") ADD_FEATURE_INFO(CalypTools BUILD_TOOLS "Build Command line tool" ) ADD_FEATURE_INFO(DynLoad USE_DYNLOAD "Support for dynamic module load" ) diff --git a/app/VideoSubWindow.h b/app/VideoSubWindow.h index 8fb4054..13f7103 100644 --- a/app/VideoSubWindow.h +++ b/app/VideoSubWindow.h @@ -132,7 +132,6 @@ public: void setCurrFrame( CalypFrame* pcCurrFrame ); - QScrollArea* getScroll() { return m_pcScrollArea; } CalypFileInfo getStreamInfo() { return m_sStreamInfo; } QString getStreamInformation() { return m_cStreamInformation; } CalypStream* getInputStream() { return m_pCurrStream; } @@ -219,7 +218,7 @@ public Q_SLOTS: void updatePixelValueStatusBar( const QPoint& pos ); }; -Q_DECLARE_METATYPE( CalypFileInfo ); -Q_DECLARE_METATYPE( CalypFileInfoVector ); +Q_DECLARE_METATYPE( CalypFileInfo ) +Q_DECLARE_METATYPE( CalypFileInfoVector ) #endif // __VIDEOSUBWINDOW_H__ diff --git a/app/dialog/ConfigureFormatDialog.h b/app/dialog/ConfigureFormatDialog.h index 51b1c85..c344d75 100644 --- a/app/dialog/ConfigureFormatDialog.h +++ b/app/dialog/ConfigureFormatDialog.h @@ -81,7 +81,7 @@ private: QSpinBox* m_spinBoxFrameRate; }; -Q_DECLARE_METATYPE( CalypStandardResolution ); -Q_DECLARE_METATYPE( CalypStandardResolutionVector ); +Q_DECLARE_METATYPE( CalypStandardResolution ) +Q_DECLARE_METATYPE( CalypStandardResolutionVector ) #endif // __CONFIGUREFORMATDIALOG_H__ diff --git a/app/main.cpp b/app/main.cpp index 6bd4fdd..cbfeb34 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -47,9 +47,9 @@ int main( int argc, char* argv[] ) qRegisterMetaTypeStreamOperators(); QApplication application( argc, argv ); - QApplication::setApplicationName( "Calyp" ); - QApplication::setApplicationVersion( CALYP_VERSION_STRING ); - QApplication::setOrganizationName( "PixLRA" ); + QApplication::setApplicationName( QStringLiteral( "Calyp" ) ); + QApplication::setApplicationVersion( QStringLiteral( CALYP_VERSION_STRING ) ); + QApplication::setOrganizationName( QStringLiteral( "PixLRA" ) ); #ifdef USE_QTDBUS /** @@ -62,7 +62,7 @@ int main( int argc, char* argv[] ) QStringList filenameList; for( int i = 1; i < argc; i++ ) { - filenameList.append( QFileInfo( QString( argv[i] ) ).absoluteFilePath() ); + filenameList.append( QFileInfo( QLatin1String( argv[i] ) ).absoluteFilePath() ); } if( filenameList.isEmpty() ) { @@ -73,7 +73,7 @@ int main( int argc, char* argv[] ) bool foundRunningService = false; if( !force_new ) { - QDBusReply there = sessionBusinterface->isServiceRegistered( CALYP_DBUS_SESSION_NAME ); + QDBusReply there = sessionBusinterface->isServiceRegistered( QStringLiteral( CALYP_DBUS_SESSION_NAME ) ); foundRunningService = there.isValid() && there.value(); if( foundRunningService ) @@ -82,7 +82,7 @@ int main( int argc, char* argv[] ) // open given session QDBusMessage m = QDBusMessage::createMethodCall( - CALYP_DBUS_SESSION_NAME, QStringLiteral( CALYP_DBUS_PATH ), + QStringLiteral( CALYP_DBUS_SESSION_NAME ), QStringLiteral( CALYP_DBUS_PATH ), QStringLiteral( CALYP_DBUS_SESSION_NAME ), QStringLiteral( "activate" ) ); QDBusConnection::sessionBus().call( m ); @@ -96,7 +96,7 @@ int main( int argc, char* argv[] ) foreach( const QString& file, filenameList ) { QDBusMessage m = QDBusMessage::createMethodCall( - CALYP_DBUS_SESSION_NAME, QStringLiteral( CALYP_DBUS_PATH ), + QStringLiteral( CALYP_DBUS_SESSION_NAME ), QStringLiteral( CALYP_DBUS_PATH ), QStringLiteral( CALYP_DBUS_SESSION_NAME ), QStringLiteral( "loadFile" ) ); QList dbusargs; @@ -130,7 +130,7 @@ int main( int argc, char* argv[] ) /** * if we arrive here, we need to start a new calyp instance! */ - QDBusConnection::sessionBus().registerService( CALYP_DBUS_SESSION_NAME ); + QDBusConnection::sessionBus().registerService( QStringLiteral( CALYP_DBUS_SESSION_NAME ) ); #endif MainWindow mainwindow; mainwindow.show(); diff --git a/examples/modules/CMakeLists.txt b/examples/modules/CMakeLists.txt index 4f19c21..498122b 100644 --- a/examples/modules/CMakeLists.txt +++ b/examples/modules/CMakeLists.txt @@ -7,13 +7,15 @@ CMAKE_MINIMUM_REQUIRED( VERSION 2.8.9 ) PROJECT( "modules_example" ) +# THIS # FIND_PACKAGE( Calyp ) - -INCLUDE_DIRECTORIES( ${CALYP_INCLUDE_DIRS} ) +#INCLUDE_DIRECTORIES( ${CALYP_INCLUDE_DIRS} ) +# OR +INCLUDE_DIRECTORIES( ../../lib ) ADD_LIBRARY(FrameBinarization SHARED FrameBinarization_APIv1.cpp) TARGET_LINK_LIBRARIES( FrameBinarization ${CALYP_LINKER_LIBS} ) ADD_LIBRARY(AbsoluteFrameDifferenceExample SHARED AbsoluteFrameDifferenceExample.cpp) -TARGET_LINK_LIBRARIES( AbsoluteFrameDifferenceExample ${CALYP_LINKER_LIBS} ) +TARGET_LINK_LIBRARIES( AbsoluteFrameDifferenceExample ${PROJECT_LIBRARY} ${CALYP_LINKER_LIBS} ) From a473abc49840707b8defa9a386f0a72e8e666ccb Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Sun, 14 Oct 2018 22:13:41 +0100 Subject: [PATCH 5/6] Fix some code and remove old SSE code --- app/VideoHandle.cpp | 4 +- app/VideoHandle.h | 4 +- lib/CalypFrame.cpp | 3 +- lib/PixelFormats.cpp | 154 ------------------------------------------- 4 files changed, 6 insertions(+), 159 deletions(-) diff --git a/app/VideoHandle.cpp b/app/VideoHandle.cpp index 25a9b4e..3299fd3 100644 --- a/app/VideoHandle.cpp +++ b/app/VideoHandle.cpp @@ -660,8 +660,8 @@ void VideoHandle::playEvent() { bool bEndOfSequence = false; #if( _CONTROL_PLAYING_TIME_ == 1 ) - m_dAverageFps = Double( m_dAverageFps * m_uiNumberPlayedFrames + m_pcPlayControlTimer->elapsed() ) / - Double( m_uiNumberPlayedFrames + 1 ); + m_dAverageFps = double( m_dAverageFps * m_uiNumberPlayedFrames + m_pcPlayControlTimer->elapsed() ) / + double( m_uiNumberPlayedFrames + 1 ); m_uiNumberPlayedFrames++; m_pcPlayControlTimer->restart(); #endif diff --git a/app/VideoHandle.h b/app/VideoHandle.h index 73cd2d0..ff1fedd 100644 --- a/app/VideoHandle.h +++ b/app/VideoHandle.h @@ -34,7 +34,7 @@ #include #include -#define _CONTROL_PLAYING_TIME_ 0 +#define _CONTROL_PLAYING_TIME_ 1 class QToolBar; class QDockWidget; @@ -124,7 +124,7 @@ private: #if( _CONTROL_PLAYING_TIME_ == 1 ) unsigned int m_uiNumberPlayedFrames; - Double m_dAverageFps; + double m_dAverageFps; QElapsedTimer* m_pcPlayControlTimer; #endif diff --git a/lib/CalypFrame.cpp b/lib/CalypFrame.cpp index cf923ad..fbf5451 100644 --- a/lib/CalypFrame.cpp +++ b/lib/CalypFrame.cpp @@ -669,6 +669,7 @@ void CalypFrame::frameToBuffer( ClpByte* output_buffer, int iEndianness ) } } + void CalypFrame::fillRGBBuffer() { #define PEL_ARGB( a, r, g, b ) ( ( a & 0xff ) << 24 ) | ( ( r & 0xff ) << 16 ) | ( ( g & 0xff ) << 8 ) | ( b & 0xff ) @@ -694,7 +695,7 @@ void CalypFrame::fillRGBBuffer() unsigned char finalPel; for( unsigned int i = 0; i < d->m_uiHeight * d->m_uiWidth; i++ ) { - finalPel = (*pY++) >> shiftBits; + finalPel = ( *pY++ ) >> shiftBits; *pARGB++ = PEL_RGB( finalPel, finalPel, finalPel ); } } diff --git a/lib/PixelFormats.cpp b/lib/PixelFormats.cpp index 6ee0600..b3cc0ad 100644 --- a/lib/PixelFormats.cpp +++ b/lib/PixelFormats.cpp @@ -30,11 +30,6 @@ #ifdef USE_FFMPEG #include "StreamHandlerLibav.h" #endif -#ifdef USE_SSE -#include -#include -#include -#endif /* ************************************************************** @@ -49,155 +44,6 @@ #define ADD_FFMPEG_PEL_FMT( fmt ) 0 #endif -#if 0 -void fillARGB32bufferYUV420p( Pel*** in, UChar* out, unsigned int width, unsigned int height, unsigned int depth ) -{ -#ifdef USE_SSE - if( ( width % 16 ) == 0 ) - { - uint8_t *yp = in[LUMA][0]; - uint8_t *up = in[CHROMA_U][0]; - uint8_t *vp = in[CHROMA_V][0]; - uint32_t suv = width >> 1; - uint32_t *rgb = ( uint32_t* )out; - - __m128i y0r0, y0r1, u0, v0; - __m128i y00r0, y01r0, y00r1, y01r1; - __m128i u00, u01, v00, v01; - __m128i rv00, rv01, gu00, gu01, gv00, gv01, bu00, bu01; - __m128i r00, r01, g00, g01, b00, b01; - __m128i rgb0123, rgb4567, rgb89ab, rgbcdef; - __m128i gbgb; - __m128i ysub, uvsub; - __m128i zero, facy, facrv, facgu, facgv, facbu; - __m128i *srcy128r0, *srcy128r1; - __m128i *dstrgb128r0, *dstrgb128r1; - __m64 *srcu64, *srcv64; - unsigned int x, y; - - ysub = _mm_set1_epi32( 0x00100010 ); - uvsub = _mm_set1_epi32( 0x00800080 ); - - facy = _mm_set1_epi32( 0x004a004a ); - facrv = _mm_set1_epi32( 0x00660066 ); - facgu = _mm_set1_epi32( 0x00190019 ); - facgv = _mm_set1_epi32( 0x00340034 ); - facbu = _mm_set1_epi32( 0x00810081 ); - - zero = _mm_set1_epi32( 0x00000000 ); - - for( y = 0; y < height; y += 2 ) - { - - srcy128r0 = ( __m128i * )( yp + width * y ); - srcy128r1 = ( __m128i * )( yp + width * y + width ); - srcu64 = ( __m64 * )( up + suv * ( y / 2 ) ); - srcv64 = ( __m64 * )( vp + suv * ( y / 2 ) ); - - dstrgb128r0 = ( __m128i * )( rgb + width * y ); - dstrgb128r1 = ( __m128i * )( rgb + width * y + width ); - - for( x = 0; x < width; x += 16 ) - { - - u0 = _mm_loadl_epi64( ( __m128i * )srcu64 ); - srcu64++; - v0 = _mm_loadl_epi64( ( __m128i * )srcv64 ); - srcv64++; - - y0r0 = _mm_load_si128( srcy128r0++ ); - y0r1 = _mm_load_si128( srcy128r1++ ); - - // constant y factors - y00r0 = _mm_mullo_epi16( _mm_sub_epi16( _mm_unpacklo_epi8( y0r0, zero ), ysub ), facy ); - y01r0 = _mm_mullo_epi16( _mm_sub_epi16( _mm_unpackhi_epi8( y0r0, zero ), ysub ), facy ); - y00r1 = _mm_mullo_epi16( _mm_sub_epi16( _mm_unpacklo_epi8( y0r1, zero ), ysub ), facy ); - y01r1 = _mm_mullo_epi16( _mm_sub_epi16( _mm_unpackhi_epi8( y0r1, zero ), ysub ), facy ); - - // expand u and v so they're aligned with y values - u0 = _mm_unpacklo_epi8( u0, zero ); - u00 = _mm_sub_epi16( _mm_unpacklo_epi16( u0, u0 ), uvsub ); - u01 = _mm_sub_epi16( _mm_unpackhi_epi16( u0, u0 ), uvsub ); - - v0 = _mm_unpacklo_epi8( v0, zero ); - v00 = _mm_sub_epi16( _mm_unpacklo_epi16( v0, v0 ), uvsub ); - v01 = _mm_sub_epi16( _mm_unpackhi_epi16( v0, v0 ), uvsub ); - - // common factors on both rows. - rv00 = _mm_mullo_epi16( facrv, v00 ); - rv01 = _mm_mullo_epi16( facrv, v01 ); - gu00 = _mm_mullo_epi16( facgu, u00 ); - gu01 = _mm_mullo_epi16( facgu, u01 ); - gv00 = _mm_mullo_epi16( facgv, v00 ); - gv01 = _mm_mullo_epi16( facgv, v01 ); - bu00 = _mm_mullo_epi16( facbu, u00 ); - bu01 = _mm_mullo_epi16( facbu, u01 ); - - // row 0 - r00 = _mm_srai_epi16( _mm_add_epi16( y00r0, rv00 ), 6 ); - r01 = _mm_srai_epi16( _mm_add_epi16( y01r0, rv01 ), 6 ); - g00 = _mm_srai_epi16( _mm_sub_epi16( _mm_sub_epi16( y00r0, gu00 ), gv00 ), 6 ); - g01 = _mm_srai_epi16( _mm_sub_epi16( _mm_sub_epi16( y01r0, gu01 ), gv01 ), 6 ); - b00 = _mm_srai_epi16( _mm_add_epi16( y00r0, bu00 ), 6 ); - b01 = _mm_srai_epi16( _mm_add_epi16( y01r0, bu01 ), 6 ); - - r00 = _mm_packus_epi16( r00, r01 );// rrrr.. saturated - g00 = _mm_packus_epi16( g00, g01 );// gggg.. saturated - b00 = _mm_packus_epi16( b00, b01 );// bbbb.. saturated - - r01 = _mm_unpacklo_epi8( r00, zero );// 0r0r.. - gbgb = _mm_unpacklo_epi8( b00, g00 );// gbgb.. - rgb0123 = _mm_unpacklo_epi16( gbgb, r01 );// 0rgb0rgb.. - rgb4567 = _mm_unpackhi_epi16( gbgb, r01 );// 0rgb0rgb.. - - r01 = _mm_unpackhi_epi8( r00, zero ); - gbgb = _mm_unpackhi_epi8( b00, g00 ); - rgb89ab = _mm_unpacklo_epi16( gbgb, r01 ); - rgbcdef = _mm_unpackhi_epi16( gbgb, r01 ); - - _mm_store_si128( dstrgb128r0++, rgb0123 ); - _mm_store_si128( dstrgb128r0++, rgb4567 ); - _mm_store_si128( dstrgb128r0++, rgb89ab ); - _mm_store_si128( dstrgb128r0++, rgbcdef ); - - // row 1 - r00 = _mm_srai_epi16( _mm_add_epi16( y00r1, rv00 ), 6 ); - r01 = _mm_srai_epi16( _mm_add_epi16( y01r1, rv01 ), 6 ); - g00 = _mm_srai_epi16( _mm_sub_epi16( _mm_sub_epi16( y00r1, gu00 ), gv00 ), 6 ); - g01 = _mm_srai_epi16( _mm_sub_epi16( _mm_sub_epi16( y01r1, gu01 ), gv01 ), 6 ); - b00 = _mm_srai_epi16( _mm_add_epi16( y00r1, bu00 ), 6 ); - b01 = _mm_srai_epi16( _mm_add_epi16( y01r1, bu01 ), 6 ); - - r00 = _mm_packus_epi16( r00, r01 );// rrrr.. saturated - g00 = _mm_packus_epi16( g00, g01 );// gggg.. saturated - b00 = _mm_packus_epi16( b00, b01 );// bbbb.. saturated - - r01 = _mm_unpacklo_epi8( r00, zero );// 0r0r.. - gbgb = _mm_unpacklo_epi8( b00, g00 );// gbgb.. - rgb0123 = _mm_unpacklo_epi16( gbgb, r01 );// 0rgb0rgb.. - rgb4567 = _mm_unpackhi_epi16( gbgb, r01 );// 0rgb0rgb.. - - r01 = _mm_unpackhi_epi8( r00, zero ); - gbgb = _mm_unpackhi_epi8( b00, g00 ); - rgb89ab = _mm_unpacklo_epi16( gbgb, r01 ); - rgbcdef = _mm_unpackhi_epi16( gbgb, r01 ); - - _mm_store_si128( dstrgb128r1++, rgb0123 ); - _mm_store_si128( dstrgb128r1++, rgb4567 ); - _mm_store_si128( dstrgb128r1++, rgb89ab ); - _mm_store_si128( dstrgb128r1++, rgbcdef ); - - } - } - } - else -#endif - { - fillARGB32bufferYUV( in, out, width, height, depth, 1, 1 ); - } -} -#endif - const std::map g_CalypPixFmtDescriptorsMap = { { CLP_YUV420P, From 59c6d797f628a190690581ba671b226b39131afe Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Thu, 18 Oct 2018 02:51:15 +0100 Subject: [PATCH 6/6] Add EOF support to stream handler --- app/VideoSubWindow.cpp | 2 ++ lib/CalypStream.cpp | 4 ++-- lib/CalypStreamHandlerIf.h | 2 ++ lib/StreamHandlerLibav.cpp | 14 ++++++++++++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 797bdd9..ba1cd71 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -32,6 +32,8 @@ #include +#define QT_NO_CONCURRENT + /** * \brief Functions to control data stream from stream information */ diff --git a/lib/CalypStream.cpp b/lib/CalypStream.cpp index 8f685fb..1dd4d07 100644 --- a/lib/CalypStream.cpp +++ b/lib/CalypStream.cpp @@ -155,10 +155,10 @@ struct CalypStreamPrivate CalypStreamPrivate() { - isInit = false; - pfctCreateHandler = NULL; handler = NULL; + pfctCreateHandler = NULL; isInput = true; + isInit = false; bLoadAll = false; iCurrFrameNum = -1; cFilename = ""; diff --git a/lib/CalypStreamHandlerIf.h b/lib/CalypStreamHandlerIf.h index 1a07dcc..4259737 100644 --- a/lib/CalypStreamHandlerIf.h +++ b/lib/CalypStreamHandlerIf.h @@ -80,6 +80,7 @@ public: , m_uiTotalNumberFrames( 0 ) , m_pStreamBuffer( NULL ) , m_uiNBytesPerFrame( 0 ) + , m_isEOF( false ) { } virtual ~CalypStreamHandlerIf() {} @@ -115,6 +116,7 @@ protected: unsigned long m_uiTotalNumberFrames; ClpByte* m_pStreamBuffer; unsigned long m_uiNBytesPerFrame; + bool m_isEOF; }; #endif // __CALYPSTREAMHANDLERIF_H__ diff --git a/lib/StreamHandlerLibav.cpp b/lib/StreamHandlerLibav.cpp index a211e83..4a281c2 100644 --- a/lib/StreamHandlerLibav.cpp +++ b/lib/StreamHandlerLibav.cpp @@ -336,11 +336,12 @@ bool StreamHandlerLibav::configureBuffer( CalypFrame* pcFrame ) void StreamHandlerLibav::calculateFrameNumber() { unsigned long long int num_frames; - if( m_cStream->nb_frames ) + /*if( m_cStream->nb_frames ) { num_frames = m_cStream->nb_frames; } - else if( m_cFmtCtx->duration != AV_NOPTS_VALUE ) + else */ + if( m_cFmtCtx->duration != AV_NOPTS_VALUE ) { long long int duration = m_cFmtCtx->duration + 5000; m_uiSecs = duration / AV_TIME_BASE; @@ -371,6 +372,8 @@ bool StreamHandlerLibav::read( CalypFrame* pcFrame ) bReadPkt = true; else return false; + //if( iRet == AVERROR_EOF ) + // m_isEOF = true; } else { @@ -397,7 +400,14 @@ bool StreamHandlerLibav::read( CalypFrame* pcFrame ) bReadPkt = false; av_packet_unref( &m_cOrgPacket ); if( ( iRet = av_read_frame( m_cFmtCtx, &m_cPacket ) ) < 0 ) + { + if( iRet == AVERROR_EOF ) + { + m_isEOF = true; + return true; + } return false; + } m_cOrgPacket = m_cPacket; #ifdef FF_SEND_RECEIVE_API if( m_cPacket.stream_index == m_iStreamIdx )