[
  {
    "path": ".github/FUNDING.yml",
    "content": "custom: ['https://www.paypal.com/paypalme/louisren666', 'https://pic4.zhimg.com/v2-6cad70f5aeeb9cc1a8a95c66b36a7ab7_r.jpg']\n"
  },
  {
    "path": ".gitignore",
    "content": "__pycache__\ndist\n.idea\n.DS_Store\npyproject.toml"
  },
  {
    "path": "CHANGELOG",
    "content": "v1.2.0\n1. Fixed known bugs.\n2. Updated the project structure.\n3. Added C++/Qt code for each demo.\n4. Adapted to high resolution screen. Thank @panhaovue for the tip.\n\n\nv1.1.5\n1. Fixed icon size.\n2. Made window resizable.\n3. Added exe for users without Python environment.\n\n\nv1.1.4\n1. Added 1 style demo and 2 func demos for QTableWidget.\n2. Enriched widget choices in QSS Editor.\n3. Optimized suppress_stdout_stderr() in output.py.\n4. Eliminate the framework's QSS effect (e.g. QScrollBar's QSS effect) on demos.\n\n\nv1.1.3\n1. Added 1 func demo for QLineEdit.\n2. Added 1 func demo for QWidget.\n3. Added a sponsor part.\n4. Fixed a crash problem.\n\n\nv1.1.2\n1. Added 1 style demo for QListWidget.\n2. Added 1 style demo for QPushButton.\n3. Added new version release notice.\n4. Fixed known issues of QSS Editor.\n\n\nv1.1.1\n1. Added 1 func demo for QLabel.\n2. Added 1 style demo for QPushButton.\n3. Added 1 style demo and 1 func demo for QListWidget.\n4. Fixed crash problem when showing QDial, QProgress and QPushButton style demos.\n\n\nv1.1.0\n1. Added QSS Editor.\n2. Added 2 style demos and 1 func demo for QWidget.\n\n\nv1.0.0\n1. Added 4 style demos and 2 func demos for QCheckBox.\n2. Added 3 style demos and 2 func demos for QComboBox.\n3. Added 3 style demos and 1 func demo for QDial.\n4. Added 4 style demos and 6 func demos for QLabel.\n5. Added 5 style demos and 3 func demos for QLCDNumber.\n6. Added 7 style demos and 4 func demos for QLineEdit.\n7. Added 9 style demos and 2 func demos for QProgressBar.\n8. Added 10 style demos and 3 func demos for QPushButton.\n9. Added 5 style demos and 1 func demo for QSlider.\n10. Added 1 style demo and 1 func demo for QSpinBox.\n11. Added two themes: white and black."
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>."
  },
  {
    "path": "README.md",
    "content": "# Qt Box ([中文](https://zhuanlan.zhihu.com/p/606612591))\n<p dir=\"auto\">\n    <a href=\"javascript:;\">\n        <img src=\"https://img.shields.io/badge/Qt Box-Open Source-green.svg\" />\n    </a>\n    <a href=\"javascript:;\">\n        <img src=\"https://static.pepy.tech/personalized-badge/qtbox?period=total&units=international_system&left_color=grey&right_color=blue&left_text=Downloads\" />\n    </a>\n    <a href=\"javascript:;\">\n        <img src=\"https://img.shields.io/badge/For-PyQt and PySide-dark.svg\" />\n    </a>\n    <a href=\"javascript:;\">\n        <img src=\"https://img.shields.io/badge/Language-Python-purple.svg\" />\n    </a>\n    <a href=\"javascript:;\">\n        <img src=\"https://img.shields.io/badge/Author-Louis Ren-orange.svg\" />\n    </a>\n    <a href=\"javascript:;\">\n        <img src=\"https://img.shields.io/badge/License-GPL v3-red.svg\" />\n    </a>\n    <a href=\"javascript:;\">\n        <img src=\"https://img.shields.io/badge/With-QSS Editor-brown.svg\" />\n    </a>\n</p>\n\nQt Box contains many common and useful PyQt & PySide & C++/Qt widget demos, which may save your time during development.\n\n## Installation\n```markdown\npip install qtbox\n```\n\n## How to use\nOpen a command window and use command `qtbox` to show Qt Box GUI.\n<img src=\"https://img-blog.csdnimg.cn/5aa9084276a44804a3a49eac54f7e7c3.png\" width=\"600\">\n\nRight-click on a widget shown in the Style tab or Function tab, then you can view or download the code.\n<img src=\"https://img-blog.csdnimg.cn/501983f31ebe4cbfbdb9d95dbed96d53.png\" width=\"600\">\n\nWhen viewing the code, you can click on the switch button to show PyQt, PySide or C++/Qt code.\n<img src=\"https://img-blog.csdnimg.cn/ab1828e5b1024ece81e4388ff96ac48a.png\" width=\"600\">\n\nOn the main window, click on the switch button to change the window theme.\n<img src=\"https://img-blog.csdnimg.cn/a0a84cf9b50b4f92a52f0f65e1664196.png\" width=\"600\">\n\nClick on the edit button or type `qtbox-qss` in the command window to open QSS Editor.\n<img src=\"https://img-blog.csdnimg.cn/7289f04c21824d0986f6adcb96a4be2e.png\" width=\"600\">\n\n## For C++ Qt users\nIf you don't have a Python environment, download [QtBox.zip](https://la-vie-est-belle.github.io/qtbox/Qt%20Box.zip) which includes `qtbox.exe` executable file.\n<img src=\"https://img-blog.csdnimg.cn/edb04ba49468484696efec78f07bb740.jpeg\" width=\"300\">\n\n## Support author\nSupport author to make this project better. Thanks a lot. :)\n- [PayPal](https://www.paypal.com/paypalme/louisren666)\n- [WeChat or AliPay](https://pic4.zhimg.com/v2-6cad70f5aeeb9cc1a8a95c66b36a7ab7_r.jpg)\n\n## Other links\n- [Github](https://github.com/la-vie-est-belle/qtbox)\n- [CSDN](https://blog.csdn.net/La_vie_est_belle/article/details/129037040)\n- [Bilibili](https://space.bilibili.com/414891732)\n- [知乎](https://zhuanlan.zhihu.com/p/606612591)\n- [PyPi](https://pypi.org/project/qtbox/)\n"
  },
  {
    "path": "src/qtbox/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/checkbox/__init__.py",
    "content": "from .func import demo1, demo2\nfrom .style import demo1, demo2, demo3, demo4"
  },
  {
    "path": "src/qtbox/demo/checkbox/func/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/checkbox/func/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QCheckBox\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQCheckBox = createWidgetMenuBase(QCheckBox)\n\nclass QtBoxFuncCheckBox1(QCheckBox):\n    def __init__(self):\n        super(QtBoxFuncCheckBox1, self).__init__(str(Path(__file__)))\n        self.setTristate(True)\n        self.setText(\"UnChecked\")\n        self.stateChanged.connect(self.update_text)\n\n    def update_text(self):\n        if self.checkState() == Qt.Unchecked:\n            self.setText(\"UnChecked\")\n        elif self.checkState() == Qt.PartiallyChecked:\n            self.setText(\"PartiallyChecked\")\n        elif self.checkState() == Qt.Checked:\n            self.setText(\"Checked\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QCheckBox\n\n\n# class QtBoxFuncCheckBox1(QCheckBox):\n#     def __init__(self):\n#         super(QtBoxFuncCheckBox1, self).__init__()\n#         self.setTristate(True)\n#         self.setText(\"UnChecked\")\n#         self.stateChanged.connect(self.update_text)\n\n#     def update_text(self):\n#         if self.checkState() == Qt.Unchecked:\n#             self.setText(\"UnChecked\")\n#         elif self.checkState() == Qt.PartiallyChecked:\n#             self.setText(\"PartiallyChecked\")\n#         elif self.checkState() == Qt.Checked:\n#             self.setText(\"Checked\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCCHECKBOX1_H\n# #define QTBOXFUNCCHECKBOX1_H\n# #include <QCheckBox>\n\n# class QtBoxFuncCheckBox1 : public QCheckBox\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncCheckBox1(QWidget *parent = nullptr);\n\n# private slots:\n#     void updateText();\n# };\n# #endif // QTBOXFUNCCHECKBOX1_H\n\n\n\n# #include \"qtboxfunccheckbox1.h\"\n# #include <Qt>\n\n# QtBoxFuncCheckBox1::QtBoxFuncCheckBox1(QWidget *parent)\n#     : QCheckBox(parent)\n# {\n#     setTristate(true);\n#     setText(\"UnChecked\");\n#     connect(this, SIGNAL(stateChanged(int)), this, SLOT(updateText()));\n# }\n\n# void QtBoxFuncCheckBox1::updateText()\n# {\n#     if (checkState() == Qt::Unchecked) {\n#         setText(\"UnChecked\");\n#     }\n#     else if (checkState() == Qt::PartiallyChecked) {\n#         setText(\"PartiallyChecked\");\n#     }\n#     else if (checkState() == Qt::Checked) {\n#         setText(\"Checked\");\n#     }\n# }\n# C++/Qt\n"
  },
  {
    "path": "src/qtbox/demo/checkbox/func/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QCheckBox\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQCheckBox = createWidgetMenuBase(QCheckBox)\n\nclass QtBoxFuncCheckBox2(QCheckBox):\n    def __init__(self):\n        super(QtBoxFuncCheckBox2, self).__init__(str(Path(__file__)))\n        self.setText(\"Text on the left\")\n        self.setLayoutDirection(Qt.RightToLeft)\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QCheckBox\n\n\n# class QtBoxFuncCheckBox2(QCheckBox):\n#     def __init__(self):\n#         super(QtBoxFuncCheckBox2, self).__init__()\n#         self.setText(\"Text on the left\")\n#         self.setLayoutDirection(Qt.RightToLeft)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCCHECKBOX2_H\n# #define QTBOXFUNCCHECKBOX2_H\n# #include <QCheckBox>\n\n# class QtBoxFuncCheckBox2 : public QCheckBox\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncCheckBox2(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXFUNCCHECKBOX2_H\n\n\n\n# #include \"qtboxfunccheckbox2.h\"\n# #include <Qt>\n\n# QtBoxFuncCheckBox2::QtBoxFuncCheckBox2(QWidget *parent)\n#     : QCheckBox(parent)\n# {\n#     setText(\"Text on the left\");\n#     setLayoutDirection(Qt::RightToLeft);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/checkbox/style/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/checkbox/style/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QCheckBox\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQCheckBox = createWidgetMenuBase(QCheckBox)\nPATH_TO_IMG1 = str(Path(__file__).parent.parent.parent.parent / \"res/images/close.png\").replace(\"\\\\\", \"/\")\nPATH_TO_IMG2 = str(Path(__file__).parent.parent.parent.parent / \"res/images/minimize.png\").replace(\"\\\\\", \"/\")\nPATH_TO_IMG3 = str(Path(__file__).parent.parent.parent.parent / \"res/images/check.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleCheckBox1(QCheckBox):\n    def __init__(self):\n        super(QtBoxStyleCheckBox1, self).__init__(str(Path(__file__)))\n        self.setText(\"Qt Box\")\n        self.setTristate(True)\n        self.setStyleSheet(\"\"\"\n        QCheckBox {\n            spacing: 5px;\n            font-size: 15px;\n            font-weight: bold;\n        }\n        \n        QCheckBox::indicator {\n            width: 16px;\n            height: 16px;\n            border: 2px solid black;\n            border-radius: 6px;\n        }\n        \n        QCheckBox::indicator:unchecked {\n            image: url(%s);\n            background-color: black;\n        }\n        \n        QCheckBox::indicator:indeterminate {\n            image: url(%s);\n            background-color: black;\n        }\n        \n        QCheckBox::indicator:checked {\n            image: url(%s);\n            background-color: black;\n        }\n        \"\"\" % (PATH_TO_IMG1, PATH_TO_IMG2, PATH_TO_IMG3))\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QCheckBox\n\n\n# class QtBoxStyleCheckBox1(QCheckBox):\n#     def __init__(self):\n#         super(QtBoxStyleCheckBox1, self).__init__()\n#         self.setText(\"Qt Box\")\n#         self.setTristate(True)\n#         self.setStyleSheet(\"\"\"\n#         QCheckBox {\n#             spacing: 5px;\n#             font-size: 15px;\n#             font-weight: bold;\n#         }\n\n#         QCheckBox::indicator {\n#             width: 16px;\n#             height: 16px;\n#             border: 2px solid black;\n#             border-radius: 6px;\n#         }\n\n#         QCheckBox::indicator:unchecked {\n#             image: url(%s);\n#             background-color: black;\n#         }\n\n#         QCheckBox::indicator:indeterminate {\n#             image: url(%s);\n#             background-color: black;\n#         }\n\n#         QCheckBox::indicator:checked {\n#             image: url(%s);\n#             background-color: black;\n#         }\n#         \"\"\" % (PATH_TO_IMG1, PATH_TO_IMG2, PATH_TO_IMG3))\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLECHECKBOX1_H\n# #define QTBOXSTYLECHECKBOX1_H\n# #include <QCheckBox>\n\n# class QtBoxStyleCheckBox1 : public QCheckBox\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleCheckBox1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLECHECKBOX1_H\n\n\n\n# #include \"qtboxstylecheckbox1.h\"\n\n# QtBoxStyleCheckBox1::QtBoxStyleCheckBox1(QWidget *parent)\n#     : QCheckBox(parent)\n# {\n#     setText(\"Qt Box\");\n#     setTristate(true);\n#     setStyleSheet(R\"(\n#     QCheckBox {\n#         spacing: 5px;\n#         font-size: 15px;\n#         font-weight: bold;\n#     }\n\n#     QCheckBox::indicator {\n#         width: 16px;\n#         height: 16px;\n#         border: 2px solid black;\n#         border-radius: 6px;\n#     }\n\n#     QCheckBox::indicator:unchecked {\n#         image: url(PATH_TO_IMG);\n#         background-color: black;\n#     }\n\n#     QCheckBox::indicator:indeterminate {\n#         image: url(PATH_TO_IMG);\n#         background-color: black;\n#     }\n\n#     QCheckBox::indicator:checked {\n#         image: url(PATH_TO_IMG);\n#         background-color: black;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/checkbox/style/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QCheckBox\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQCheckBox = createWidgetMenuBase(QCheckBox)\nPATH_TO_IMG1 = str(Path(__file__).parent.parent.parent.parent / \"res/images/switch_off.png\").replace(\"\\\\\", \"/\")\nPATH_TO_IMG2 = str(Path(__file__).parent.parent.parent.parent / \"res/images/switch_on.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleCheckBox2(QCheckBox):\n    def __init__(self):\n        super(QtBoxStyleCheckBox2, self).__init__(str(Path(__file__)))\n        self.setText(\"Qt Box\")\n        self.setStyleSheet(\"\"\"\n        QCheckBox {\n            font-size: 15px;\n        }\n\n        QCheckBox::indicator {\n            padding-top: 1px;\n            width: 40px;\n            height: 30px;\n            border: none;\n        }\n\n        QCheckBox::indicator:unchecked {\n            image: url(%s);\n        }\n\n        QCheckBox::indicator:checked {\n            image: url(%s);\n        }\n        \"\"\" % (PATH_TO_IMG1, PATH_TO_IMG2))\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QCheckBox\n\n\n# class QtBoxStyleCheckBox2(QCheckBox):\n#     def __init__(self):\n#         super(QtBoxStyleCheckBox2, self).__init__()\n#         self.setText(\"Qt Box\")\n#         self.setStyleSheet(\"\"\"\n#         QCheckBox {\n#             font-size: 15px;\n#         }\n\n#         QCheckBox::indicator {\n#             padding-top: 1px;\n#             width: 40px;\n#             height: 30px;\n#             border: none;\n#         }\n\n#         QCheckBox::indicator:unchecked {\n#             image: url(%s);\n#         }\n\n#         QCheckBox::indicator:checked {\n#             image: url(%s);\n#         }\n#         \"\"\" % (PATH_TO_IMG1, PATH_TO_IMG2))\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLECHECKBOX2_H\n# #define QTBOXSTYLECHECKBOX2_H\n# #include <QCheckBox>\n\n# class QtBoxStyleCheckBox2 : public QCheckBox\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleCheckBox2(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLECHECKBOX2_H\n\n\n\n# #include \"qtboxstylecheckbox2.h\"\n\n# QtBoxStyleCheckBox2::QtBoxStyleCheckBox2(QWidget *parent)\n#     : QCheckBox(parent)\n# {\n#     setText(\"Qt Box\");\n#     setStyleSheet(R\"(\n#     QCheckBox {\n#         font-size: 15px;\n#     }\n\n#     QCheckBox::indicator {\n#         padding-top: 1px;\n#         width: 40px;\n#         height: 30px;\n#         border: none;\n#     }\n\n#     QCheckBox::indicator:unchecked {\n#         image: url(PATH_TO_IMG);\n#     }\n\n#     QCheckBox::indicator:checked {\n#         image: url(PATH_TO_IMG);\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/checkbox/style/demo3.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QCheckBox\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQCheckBox = createWidgetMenuBase(QCheckBox)\nPATH_TO_IMG1 = str(Path(__file__).parent.parent.parent.parent / \"res/images/off.png\").replace(\"\\\\\", \"/\")\nPATH_TO_IMG2 = str(Path(__file__).parent.parent.parent.parent / \"res/images/on.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleCheckBox3(QCheckBox):\n    def __init__(self):\n        super(QtBoxStyleCheckBox3, self).__init__(str(Path(__file__)))\n        self.setText(\"Qt Box\")\n        self.setStyleSheet(\"\"\"\n        QCheckBox {\n            font-size: 15px;\n        }\n\n        QCheckBox::indicator {\n            width: 30px;\n            height: 30px;\n            border: none;\n        }\n\n        QCheckBox::indicator:unchecked {\n            image: url(%s);\n        }\n\n        QCheckBox::indicator:checked {\n            image: url(%s);\n        }\n        \"\"\" % (PATH_TO_IMG1, PATH_TO_IMG2))\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QCheckBox\n\n\n# class QtBoxStyleCheckBox3(QCheckBox):\n#     def __init__(self):\n#         super(QtBoxStyleCheckBox3, self).__init__()\n#         self.setText(\"Qt Box\")\n#         self.setStyleSheet(\"\"\"\n#         QCheckBox {\n#             font-size: 15px;\n#         }\n\n#         QCheckBox::indicator {\n#             width: 30px;\n#             height: 30px;\n#             border: none;\n#         }\n\n#         QCheckBox::indicator:unchecked {\n#             image: url(%s);\n#         }\n\n#         QCheckBox::indicator:checked {\n#             image: url(%s);\n#         }\n#         \"\"\" % (PATH_TO_IMG1, PATH_TO_IMG2))\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLECHECKBOX3_H\n# #define QTBOXSTYLECHECKBOX3_H\n# #include <QCheckBox>\n\n# class QtBoxStyleCheckBox3 : public QCheckBox\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleCheckBox3(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLECHECKBOX3_H\n\n\n\n# #include \"qtboxstylecheckbox3.h\"\n\n# QtBoxStyleCheckBox3::QtBoxStyleCheckBox3(QWidget *parent)\n#     : QCheckBox(parent)\n# {\n#     setText(\"Qt Box\");\n#     setStyleSheet(R\"(\n#     QCheckBox {\n#         font-size: 15px;\n#     }\n\n#     QCheckBox::indicator {\n#         width: 30px;\n#         height: 30px;\n#         border: none;\n#     }\n\n#     QCheckBox::indicator:unchecked {\n#         image: url(PATH_TO_IMG);\n#     }\n\n#     QCheckBox::indicator:checked {\n#         image: url(PATH_TO_IMG);\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/checkbox/style/demo4.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QCheckBox\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQCheckBox = createWidgetMenuBase(QCheckBox)\nPATH_TO_IMG1 = str(Path(__file__).parent.parent.parent.parent / \"res/images/circle_black.png\").replace(\"\\\\\", \"/\")\nPATH_TO_IMG2 = str(Path(__file__).parent.parent.parent.parent / \"res/images/circle_blue.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleCheckBox4(QCheckBox):\n    def __init__(self):\n        super(QtBoxStyleCheckBox4, self).__init__(str(Path(__file__)))\n        self.setText(\"Qt Box\")\n        self.setStyleSheet(\"\"\"\n        QCheckBox {\n            font-size: 15px;\n        }\n        \n        QCheckBox:hover {\n            color: rgba(0, 0, 0, 180);\n        }\n\n        QCheckBox::indicator {\n            width: 20px;\n            height: 20px;\n            border: none;\n        }\n\n        QCheckBox::indicator:unchecked {\n            image: url(%s);\n        }\n\n        QCheckBox::indicator:checked {\n            image: url(%s);\n        }\n        \"\"\" % (PATH_TO_IMG1, PATH_TO_IMG2))\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QCheckBox\n\n\n# class QtBoxStyleCheckBox4(QCheckBox):\n#     def __init__(self):\n#         super(QtBoxStyleCheckBox4, self).__init__()\n#         self.setText(\"Qt Box\")\n#         self.setStyleSheet(\"\"\"\n#         QCheckBox {\n#             font-size: 15px;\n#         }\n\n#         QCheckBox:hover {\n#             color: rgba(0, 0, 0, 180);\n#         }\n\n#         QCheckBox::indicator {\n#             width: 20px;\n#             height: 20px;\n#             border: none;\n#         }\n\n#         QCheckBox::indicator:unchecked {\n#             image: url(%s);\n#         }\n\n#         QCheckBox::indicator:checked {\n#             image: url(%s);\n#         }\n#         \"\"\" % (PATH_TO_IMG1, PATH_TO_IMG2))\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLECHECKBOX4_H\n# #define QTBOXSTYLECHECKBOX4_H\n# #include <QCheckBox>\n\n# class QtBoxStyleCheckBox4 : public QCheckBox\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleCheckBox4(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLECHECKBOX4_H\n\n\n\n# #include \"qtboxstylecheckbox4.h\"\n\n# QtBoxStyleCheckBox4::QtBoxStyleCheckBox4(QWidget *parent)\n#     : QCheckBox(parent)\n# {\n#     setText(\"Qt Box\");\n#     setStyleSheet(R\"(\n#     QCheckBox {\n#         font-size: 15px;\n#     }\n\n#     QCheckBox:hover {\n#         color: rgba(0, 0, 0, 180);\n#     }\n\n#     QCheckBox::indicator {\n#         width: 20px;\n#         height: 20px;\n#         border: none;\n#     }\n\n#     QCheckBox::indicator:unchecked {\n#         image: url(PATH_TO_IMG);\n#     }\n\n#     QCheckBox::indicator:checked {\n#         image: url(PATH_TO_IMG);\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/combobox/__init__.py",
    "content": "from .func import demo1, demo2\nfrom .style import demo1, demo2, demo3"
  },
  {
    "path": "src/qtbox/demo/combobox/func/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/combobox/func/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QComboBox\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQComboBox = createWidgetMenuBase(QComboBox)\n\nclass QtBoxFuncComboBox1(QComboBox):\n    def __init__(self):\n        super(QtBoxFuncComboBox1, self).__init__(str(Path(__file__)))\n        self.setEditable(True)\n        self.addItems(['1', '2', '3', '4', '5', '6'])\n        self.currentTextChanged.connect(self.update_item)\n\n    def update_item(self, txt):\n        self.setItemText(self.currentIndex(), txt)\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QComboBox\n\n\n# class QtBoxFuncComboBox1(QComboBox):\n#     def __init__(self):\n#         super(QtBoxFuncComboBox1, self).__init__()\n#         self.setEditable(True)\n#         self.addItems(['1', '2', '3', '4', '5', '6'])\n#         self.currentTextChanged.connect(self.update_item)\n\n#     def update_item(self, txt):\n#         self.setItemText(self.currentIndex(), txt)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCCOMBOBOX1_H\n# #define QTBOXFUNCCOMBOBOX1_H\n# #include <QComboBox>\n\n# class QtBoxFuncComboBox1 : public QComboBox\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncComboBox1(QWidget *parent = nullptr);\n\n# private slots:\n#     void updateItem(const QString &txt);\n# };\n# #endif // QTBOXFUNCCOMBOBOX1_H\n\n\n\n# #include \"qtboxfunccombobox1.h\"\n\n# QtBoxFuncComboBox1::QtBoxFuncComboBox1(QWidget *parent)\n#     : QComboBox(parent)\n# {\n#     setEditable(true);\n#     addItems({\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"});\n#     connect(this, SIGNAL(currentTextChanged(const QString &)), this, SLOT(updateItem(const QString &)));\n# }\n\n# void QtBoxFuncComboBox1::updateItem(const QString &txt)\n# {\n#     setItemText(currentIndex(), txt);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/combobox/func/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QComboBox, QCompleter\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQComboBox = createWidgetMenuBase(QComboBox)\n\nclass QtBoxFuncComboBox2(QComboBox):\n    def __init__(self):\n        super(QtBoxFuncComboBox2, self).__init__(str(Path(__file__)))\n        self.setEditable(True)\n        self.addItems(['1', '2', '3', '4', '5', '6'])\n        comp = QCompleter([\"1a\", \"1b\", \"1c\"])\n        comp.setFilterMode(Qt.MatchContains)\n        self.setCompleter(comp)\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QComboBox, QCompleter\n\n\n# class QtBoxFuncComboBox2(QComboBox):\n#     def __init__(self):\n#         super(QtBoxFuncComboBox2, self).__init__()\n#         self.setEditable(True)\n#         self.addItems(['1', '2', '3', '4', '5', '6'])\n#         comp = QCompleter([\"1a\", \"1b\", \"1c\"])\n#         comp.setFilterMode(Qt.MatchContains)\n#         self.setCompleter(comp)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCCOMBOBOX2_H\n# #define QTBOXFUNCCOMBOBOX2_H\n# #include <QComboBox>\n\n# class QtBoxFuncComboBox2 : public QComboBox\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncComboBox2(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXFUNCCOMBOBOX2_H\n\n\n\n# #include \"qtboxfunccombobox2.h\"\n# #include <QCompleter>\n# #include <Qt>\n\n# QtBoxFuncComboBox2::QtBoxFuncComboBox2(QWidget *parent)\n#     : QComboBox(parent)\n# {\n#     setEditable(true);\n#     addItems({\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"});\n#     QCompleter *comp = new QCompleter({\"1a\", \"1b\", \"1c\"});\n#     comp->setFilterMode(Qt::MatchContains);\n#     setCompleter(comp);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/combobox/style/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/combobox/style/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QComboBox\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQComboBox = createWidgetMenuBase(QComboBox)\nPATH_TO_IMG1 = str(Path(__file__).parent.parent.parent.parent / \"res/images/down.png\").replace(\"\\\\\", \"/\")\nPATH_TO_IMG2 = str(Path(__file__).parent.parent.parent.parent / \"res/images/up.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleComboBox1(QComboBox):\n    def __init__(self):\n        super(QtBoxStyleComboBox1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 30)\n        self.addItems(['1', '2', '3', '4', '5', '6'])\n        self.setStyleSheet(\"\"\"\n        QComboBox {\n            background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #555555, stop:1 #313131);\n            border: 1px solid lightgray;\n            border-radius: 3px;\n            font-weight: bold;\n            color: white;\n            padding-left: 15px;\n        }\n        \n        QComboBox::drop-down {\n            width: 22px;\n            border-left: 1px solid darkgray;\n            border-top-right-radius: 3px;\n            border-bottom-right-radius: 3px;\n        }\n        \n        QComboBox::down-arrow {\n            width: 16px;\n            height: 16px;\n            image: url(%s);\n        }\n        \n        QComboBox::down-arrow:on {\n            image: url(%s);\n        }\n        \n        QComboBox QAbstractItemView {\n            color: white;\n            border: none;\n            outline: none;\n            background-color: #313131;\n        }\n        \n        QComboBox QScrollBar:vertical {\n            width: 2px;\n            background-color: white;\n        }\n        \n        QComboBox QScrollBar::handle:vertical {\n            background-color: #b2bdaf;\n        }\n        \"\"\" % (PATH_TO_IMG1, PATH_TO_IMG2))\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QComboBox\n\n\n# class QtBoxStyleComboBox1(QComboBox):\n#     def __init__(self):\n#         super(QtBoxStyleComboBox1, self).__init__()\n#         self.setFixedSize(150, 30)\n#         self.addItems(['1', '2', '3', '4', '5', '6'])\n#         self.setStyleSheet(\"\"\"\n#         QComboBox {\n#             background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #555555, stop:1 #313131);\n#             border: 1px solid lightgray;\n#             border-radius: 3px;\n#             font-weight: bold;\n#             color: white;\n#             padding-left: 15px;\n#         }\n\n#         QComboBox::drop-down {\n#             width: 22px;\n#             border-left: 1px solid darkgray;\n#             border-top-right-radius: 3px;\n#             border-bottom-right-radius: 3px;\n#         }\n\n#         QComboBox::down-arrow {\n#             width: 16px;\n#             height: 16px;\n#             image: url(%s);\n#         }\n\n#         QComboBox::down-arrow:on {\n#             image: url(%s);\n#         }\n\n#         QComboBox QAbstractItemView {\n#             color: white;\n#             border: none;\n#             outline: none;\n#             background-color: #313131;\n#         }\n\n#         QComboBox QScrollBar:vertical {\n#             width: 2px;\n#             background-color: white;\n#         }\n\n#         QComboBox QScrollBar::handle:vertical {\n#             background-color: #b2bdaf;\n#         }\n#         \"\"\" % (PATH_TO_IMG1, PATH_TO_IMG2))\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLECOMBOBOX1_H\n# #define QTBOXSTYLECOMBOBOX1_H\n# #include <QComboBox>\n\n# class QtBoxStyleComboBox1 : public QComboBox\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleComboBox1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLECOMBOBOX1_H\n\n\n\n# #include \"qtboxstylecombobox1.h\"\n\n# QtBoxStyleComboBox1::QtBoxStyleComboBox1(QWidget *parent)\n#     : QComboBox(parent)\n# {\n#     setFixedSize(150, 30);\n#     addItems({\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"});\n#     setStyleSheet(R\"(\n#     QComboBox {\n#             background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #555555, stop:1 #313131);\n#             border: 1px solid lightgray;\n#             border-radius: 3px;\n#             font-weight: bold;\n#             color: white;\n#             padding-left: 15px;\n#         }\n\n#         QComboBox::drop-down {\n#             width: 22px;\n#             border-left: 1px solid darkgray;\n#             border-top-right-radius: 3px;\n#             border-bottom-right-radius: 3px;\n#         }\n\n#         QComboBox::down-arrow {\n#             width: 16px;\n#             height: 16px;\n#             image: url(PATH_TO_IMG);\n#         }\n\n#         QComboBox::down-arrow:on {\n#             image: url(PATH_TO_IMG);\n#         }\n\n#         QComboBox QAbstractItemView {\n#             color: white;\n#             border: none;\n#             outline: none;\n#             background-color: #313131;\n#         }\n\n#         QComboBox QScrollBar:vertical {\n#             width: 2px;\n#             background-color: white;\n#         }\n\n#         QComboBox QScrollBar::handle:vertical {\n#             background-color: #b2bdaf;\n#         }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/combobox/style/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QComboBox\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQComboBox = createWidgetMenuBase(QComboBox)\nPATH_TO_IMG1 = str(Path(__file__).parent.parent.parent.parent / \"res/images/down.png\").replace(\"\\\\\", \"/\")\nPATH_TO_IMG2 = str(Path(__file__).parent.parent.parent.parent / \"res/images/up.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleComboBox2(QComboBox):\n    def __init__(self):\n        super(QtBoxStyleComboBox2, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 30)\n        self.addItems(['1', '2', '3', '4', '5', '6'])\n        self.setStyleSheet(\"\"\"\n        QComboBox {\n            background-color: white;\n            color: black;\n            border: 1px solid lightgray;\n            border-radius: 15px;\n            padding-left: 15px;\n        }\n        \n        QComboBox:on {\n            border: 1px solid #63acfb;\n        }\n\n        QComboBox::drop-down {\n            width: 22px;\n            border-left: 1px solid lightgray;\n            border-top-right-radius: 15px;\n            border-bottom-right-radius: 15px;\n        }\n        \n        QComboBox::drop-down:on {\n            border-left: 1px solid #63acfb;\n        }\n\n        QComboBox::down-arrow {\n            width: 16px;\n            height: 16px;\n            image: url(%s);\n        }\n\n        QComboBox::down-arrow:on {\n            image: url(%s);\n        }\n\n        QComboBox QAbstractItemView {\n            color: black;\n            border: none;\n            outline: none;\n            background-color: whitesmoke;\n        }\n\n        QComboBox QScrollBar:vertical {\n            width: 2px;\n            background-color: white;\n        }\n\n        QComboBox QScrollBar::handle:vertical {\n            background-color: #b2bdaf;\n        }\n        \"\"\" % (PATH_TO_IMG1, PATH_TO_IMG2))\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QComboBox\n\n\n# class QtBoxStyleComboBox2(QComboBox):\n#     def __init__(self):\n#         super(QtBoxStyleComboBox2, self).__init__()\n#         self.setFixedSize(150, 30)\n#         self.addItems(['1', '2', '3', '4', '5', '6'])\n#         self.setStyleSheet(\"\"\"\n#         QComboBox {\n#             background-color: white;\n#             color: black;\n#             border: 1px solid lightgray;\n#             border-radius: 15px;\n#             padding-left: 15px;\n#         }\n\n#         QComboBox:on {\n#             border: 1px solid #63acfb;\n#         }\n\n#         QComboBox::drop-down {\n#             width: 22px;\n#             border-left: 1px solid lightgray;\n#             border-top-right-radius: 15px;\n#             border-bottom-right-radius: 15px;\n#         }\n\n#         QComboBox::drop-down:on {\n#             border-left: 1px solid #63acfb;\n#         }\n\n#         QComboBox::down-arrow {\n#             width: 16px;\n#             height: 16px;\n#             image: url(%s);\n#         }\n\n#         QComboBox::down-arrow:on {\n#             image: url(%s);\n#         }\n\n#         QComboBox QAbstractItemView {\n#             color: black;\n#             border: none;\n#             outline: none;\n#             background-color: whitesmoke;\n#         }\n\n#         QComboBox QScrollBar:vertical {\n#             width: 2px;\n#             background-color: white;\n#         }\n\n#         QComboBox QScrollBar::handle:vertical {\n#             background-color: #b2bdaf;\n#         }\n#         \"\"\" % (PATH_TO_IMG1, PATH_TO_IMG2))\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLECOMBOBOX2_H\n# #define QTBOXSTYLECOMBOBOX2_H\n# #include <QComboBox>\n\n# class QtBoxStyleComboBox2 : public QComboBox\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleComboBox2(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLECOMBOBOX2_H\n\n\n\n# #include \"qtboxstylecombobox2.h\"\n\n# QtBoxStyleComboBox2::QtBoxStyleComboBox2(QWidget *parent)\n#     : QComboBox(parent)\n# {\n#     setFixedSize(150, 30);\n#     addItems({\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"});\n#     setStyleSheet(R\"(\n#     QComboBox {\n#         background-color: white;\n#         color: black;\n#         border: 1px solid lightgray;\n#         border-radius: 15px;\n#         padding-left: 15px;\n#     }\n\n#     QComboBox:on {\n#         border: 1px solid #63acfb;\n#     }\n\n#     QComboBox::drop-down {\n#         width: 22px;\n#         border-left: 1px solid lightgray;\n#         border-top-right-radius: 15px;\n#         border-bottom-right-radius: 15px;\n#     }\n\n#     QComboBox::drop-down:on {\n#         border-left: 1px solid #63acfb;\n#     }\n\n#     QComboBox::down-arrow {\n#         width: 16px;\n#         height: 16px;\n#         image: url(PATH_TO_IMG);\n#     }\n\n#     QComboBox::down-arrow:on {\n#         image: url(PATH_TO_IMG);\n#     }\n\n#     QComboBox QAbstractItemView {\n#         color: black;\n#         border: none;\n#         outline: none;\n#         background-color: whitesmoke;\n#     }\n\n#     QComboBox QScrollBar:vertical {\n#         width: 2px;\n#         background-color: white;\n#     }\n\n#     QComboBox QScrollBar::handle:vertical {\n#         background-color: #b2bdaf;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/combobox/style/demo3.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QComboBox\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQComboBox = createWidgetMenuBase(QComboBox)\nPATH_TO_IMG = str(Path(__file__).parent.parent.parent.parent / \"res/images/up_down.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleComboBox3(QComboBox):\n    def __init__(self):\n        super(QtBoxStyleComboBox3, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 30)\n        self.addItems(['1', '2', '3', '4', '5', '6'])\n        self.setStyleSheet(\"\"\"\n        QComboBox {\n            background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #f5f5f7, stop:1 #dedee0);\n            border: 1px solid whitesmoke;\n            border-radius: 3px;\n            padding-left: 15px;\n            color: gray;\n        }\n\n        QComboBox::drop-down {\n            width: 22px;\n            border-top-right-radius: 3px;\n            border-bottom-right-radius: 3px;\n        }\n\n        QComboBox::down-arrow {\n            width: 16px;\n            height: 16px;\n            image: url(%s);\n        }\n\n        QComboBox QAbstractItemView {\n            color: gray;\n            border: none;\n            outline: none;\n            background-color: #dedee0;\n        }\n\n        QComboBox QScrollBar:vertical {\n            width: 2px;\n            background-color: white;\n        }\n\n        QComboBox QScrollBar::handle:vertical {\n            background-color: #b2bdaf;\n        }\n        \"\"\" % (PATH_TO_IMG))\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QComboBox\n\n\n# class QtBoxStyleComboBox3(QComboBox):\n#     def __init__(self):\n#         super(QtBoxStyleComboBox3, self).__init__()\n#         self.setFixedSize(150, 30)\n#         self.addItems(['1', '2', '3', '4', '5', '6'])\n#         self.setStyleSheet(\"\"\"\n#         QComboBox {\n#             background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #f5f5f7, stop:1 #dedee0);\n#             border: 1px solid whitesmoke;\n#             border-radius: 3px;\n#             padding-left: 15px;\n#             color: gray;\n#         }\n\n#         QComboBox::drop-down {\n#             width: 22px;\n#             border-top-right-radius: 3px;\n#             border-bottom-right-radius: 3px;\n#         }\n\n#         QComboBox::down-arrow {\n#             width: 16px;\n#             height: 16px;\n#             image: url(%s);\n#         }\n\n#         QComboBox QAbstractItemView {\n#             color: gray;\n#             border: none;\n#             outline: none;\n#             background-color: #dedee0;\n#         }\n\n#         QComboBox QScrollBar:vertical {\n#             width: 2px;\n#             background-color: white;\n#         }\n\n#         QComboBox QScrollBar::handle:vertical {\n#             background-color: #b2bdaf;\n#         }\n#         \"\"\" % (PATH_TO_IMG))\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLECOMBOBOX3_H\n# #define QTBOXSTYLECOMBOBOX3_H\n# #include <QComboBox>\n\n# class QtBoxStyleComboBox3 : public QComboBox\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleComboBox3(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLECOMBOBOX3_H\n\n\n\n# #include \"qtboxstylecombobox3.h\"\n\n# QtBoxStyleComboBox3::QtBoxStyleComboBox3(QWidget *parent)\n#     : QComboBox(parent)\n# {\n#     setFixedSize(150, 30);\n#     addItems({\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"});\n#     setStyleSheet(R\"(\n#     QComboBox {\n#         background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #f5f5f7, stop:1 #dedee0);\n#         border: 1px solid whitesmoke;\n#         border-radius: 3px;\n#         padding-left: 15px;\n#         color: gray;\n#     }\n\n#     QComboBox::drop-down {\n#         width: 22px;\n#         border-top-right-radius: 3px;\n#         border-bottom-right-radius: 3px;\n#     }\n\n#     QComboBox::down-arrow {\n#         width: 16px;\n#         height: 16px;\n#         image: url(PATH_TO_IMG);\n#     }\n\n#     QComboBox QAbstractItemView {\n#         color: gray;\n#         border: none;\n#         outline: none;\n#         background-color: #dedee0;\n#     }\n\n#     QComboBox QScrollBar:vertical {\n#         width: 2px;\n#         background-color: white;\n#     }\n\n#     QComboBox QScrollBar::handle:vertical {\n#         background-color: #b2bdaf;\n#     }\n#     )\");\n# }\n# C++/Qt\n"
  },
  {
    "path": "src/qtbox/demo/dial/__init__.py",
    "content": "from .func import demo1\nfrom .style import demo1, demo2"
  },
  {
    "path": "src/qtbox/demo/dial/func/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/dial/func/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtGui import QPainter, QFont, QFontMetricsF\nfrom PyQt5.QtWidgets import QDial\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQDial = createWidgetMenuBase(QDial)\n\nclass QtBoxFuncDial1(QDial):\n    def __init__(self):\n        super(QtBoxFuncDial1, self).__init__(str(Path(__file__)))\n        self.setRange(0, 100)\n        self.setWrapping(True)\n        self.setNotchTarget(10)\n        self.setNotchesVisible(True)\n\n    def paintEvent(self, event):\n        super(QtBoxFuncDial1, self).paintEvent(event)\n        painter = QPainter(self)\n\n        font = QFont()\n        font.setPixelSize(18)\n        painter.setFont(font)\n        font_metrics = QFontMetricsF(font)\n        text_width = font_metrics.width(str(self.value()))\n        painter.drawText(int(self.width()/2-text_width/2), int(self.height()/2), str(self.value()))\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtGui import QPainter, QFont, QFontMetricsF\n# from PySide2.QtWidgets import QDial\n\n\n# class QtBoxFuncDial1(QDial):\n#     def __init__(self):\n#         super(QtBoxFuncDial1, self).__init__(str(Path(__file__)))\n#         self.setRange(0, 100)\n#         self.setWrapping(True)\n#         self.setNotchTarget(10)\n#         self.setNotchesVisible(True)\n\n#     def paintEvent(self, event):\n#         super(QtBoxFuncDial1, self).paintEvent(event)\n#         painter = QPainter(self)\n\n#         font = QFont()\n#         font.setPixelSize(18)\n#         painter.setFont(font)\n#         font_metrics = QFontMetricsF(font)\n#         text_width = font_metrics.width(str(self.value()))\n#         painter.drawText(int(self.width()/2-text_width/2), int(self.height()/2), str(self.value()))\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCDIAL1_H\n# #define QTBOXFUNCDIAL1_H\n# #include <QDial>\n\n# class QtBoxFuncDial1 : public QDial\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncDial1(QWidget *parent = nullptr);\n\n# protected:\n#     void paintEvent(QPaintEvent *event);\n# };\n# #endif // QTBOXFUNCDIAL1_H\n\n\n\n# #include \"qtboxfuncdial1.h\"\n# #include <QPainter>\n# #include <QFont>\n# #include <Qt>\n# #include <QString>\n# #include <QFontMetricsF>\n\n# QtBoxFuncDial1::QtBoxFuncDial1(QWidget *parent)\n#     : QDial(parent)\n# {\n#     setRange(0, 100);\n#     setWrapping(true);\n#     setNotchTarget(10);\n#     setNotchesVisible(true);\n# }\n\n# void QtBoxFuncDial1::paintEvent(QPaintEvent *event)\n# {\n#     QDial::paintEvent(event);\n#     QPainter painter(this);\n\n#     QFont font = QFont();\n#     font.setPixelSize(18);\n#     painter.setFont(font);\n#     QFontMetricsF fontMetrics = QFontMetricsF(font);\n#     float textWidth = fontMetrics.size(Qt::TextSingleLine, QString(\"%1\").arg(value())).width();\n#     painter.drawText(int(this->width()/2-textWidth/2), int(this->height()/2), QString(\"%1\").arg(value()));\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/dial/style/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/dial/style/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QDial\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQDial = createWidgetMenuBase(QDial)\n\nclass QtBoxStyleDial1(QDial):\n    def __init__(self):\n        super(QtBoxStyleDial1, self).__init__(str(Path(__file__)))\n        self.setStyleSheet(\"\"\"\n        QDial {\n            background-color: gray;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QDial\n\n\n# class QtBoxStyleDial1(QDial):\n#     def __init__(self):\n#         super(QtBoxStyleDial1, self).__init__(str(Path(__file__)))\n#         self.setStyleSheet(\"\"\"\n#         QDial {\n#             background-color: gray;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEDIAL1_H\n# #define QTBOXSTYLEDIAL1_H\n# #include <QDial>\n\n# class QtBoxStyleDial1 : public QDial\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleDial1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEDIAL1_H\n\n\n\n# #include \"qtboxstyledial1.h\"\n\n# QtBoxStyleDial1::QtBoxStyleDial1(QWidget *parent)\n#     : QDial(parent)\n# {\n#     setStyleSheet(\"QDial {background-color: gray}\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/dial/style/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtGui import QPainter, QColor, QLinearGradient, QFont, QFontMetricsF, QPen\nfrom PyQt5.QtCore import Qt, QPointF\nfrom PyQt5.QtWidgets import QDial\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\nimport math\n\nQDial = createWidgetMenuBase(QDial)\n\nclass QtBoxStyleDial2(QDial):\n    def __init__(self):\n        super(QtBoxStyleDial2, self).__init__(str(Path(__file__)))\n        self.setFixedSize(100, 100)\n        self.setRange(100, 200)\n        self.setWrapping(True)\n        self.mouse_x = 0\n        self.mouse_y = 0\n        self.is_first_paint = True\n\n    def mousePressEvent(self, event):\n        super(QtBoxStyleDial2, self).mousePressEvent(event)\n        if event.button() == Qt.LeftButton:\n            self.mouse_x = event.x()\n            self.mouse_y = event.y()\n\n    def mouseMoveEvent(self, event):\n        super(QtBoxStyleDial2, self).mouseMoveEvent(event)\n        if event.buttons() == Qt.LeftButton:\n            self.mouse_x = event.x()\n            self.mouse_y = event.y()\n\n    def paintEvent(self, event):\n        painter = QPainter(self)\n        painter.setRenderHint(QPainter.Antialiasing)\n        pen = QPen()\n        pen.setColor(Qt.lightGray)\n        painter.setPen(pen)\n\n        linear_gradient = QLinearGradient(self.rect().topLeft(), self.rect().bottomRight())\n        linear_gradient.setColorAt(0, QColor(Qt.white))\n        linear_gradient.setColorAt(1, QColor(Qt.black))\n        painter.setBrush(linear_gradient)\n        painter.drawEllipse(self.rect())\n\n        if self.is_first_paint:\n            self.mouse_x = self.rect().center().x()\n            self.mouse_y = self.rect().bottom()\n            self.is_first_paint = False\n\n        handle_radius = 10\n        painter.setBrush(Qt.white)\n        handle_x, handle_y = self.get_handle_pos()\n        painter.drawEllipse(QPointF(handle_x, handle_y), handle_radius, handle_radius)\n\n        angle = self.get_angle([handle_x, handle_y])\n        self.setValue(round(angle / 360 * (self.maximum() - self.minimum())) + self.minimum())\n\n        font = QFont()\n        font.setPixelSize(18)\n        painter.setFont(font)\n        font_metrics = QFontMetricsF(font)\n        text_width = font_metrics.width(str(self.value()))\n        painter.drawText(int(self.width() / 2 - text_width / 2), int(self.height() / 2), str(self.value()))\n\n    def get_handle_pos(self):\n        center_x = self.rect().center().x()\n        center_y = self.rect().center().y()\n\n        if self.mouse_x - center_x == 0 and self.mouse_y - center_y == 0:\n            diff_x = center_x\n            diff_y = center_y\n        else:\n            diff_x = self.mouse_x - center_x\n            diff_y = self.mouse_y - center_y\n\n        pos_adjust_value = 1.5\n        length = math.sqrt(diff_x ** 2 + diff_y ** 2)\n        ratio = length / (self.rect().width() / 2) * pos_adjust_value\n        handle_x = diff_x / ratio + center_x\n        handle_y = diff_y / ratio + center_y\n        return handle_x, handle_y\n\n    def get_angle(self, handle_pos):\n        \"\"\"get the angle between handle and the start pos\"\"\"\n        center_x = self.rect().center().x()\n        center_y = self.rect().center().y()\n        start_pos = [self.rect().center().x(), self.rect().bottom()]\n\n        vx1 = start_pos[0] - center_x\n        vy1 = start_pos[1] - center_y\n        vx2 = handle_pos[0] - center_x\n        vy2 = handle_pos[1] - center_y\n        angle1 = math.atan2(vy1, vx1)\n        angle1 = angle1 * 180 / math.pi\n        angle2 = math.atan2(vy2, vx2)\n        angle2 = angle2 * 180 / math.pi\n        if angle2 >= 0:\n            diff_angle = angle2 - angle1\n            if diff_angle < 0:\n                diff_angle = 360 - abs(diff_angle)\n        else:\n            diff_angle = 180 + angle2 + angle1\n        return diff_angle\n# PyQt\n\n# PySide\n# from PySide2.QtGui import QPainter, QColor, QLinearGradient, QFont, QFontMetricsF, QPen\n# from PySide2.QtCore import Qt, QPointF\n# from PySide2.QtWidgets import QDial\n# import math\n\n\n# class QtBoxStyleDial2(QDial):\n#     def __init__(self):\n#         super(QtBoxStyleDial2, self).__init__(str(Path(__file__)))\n#         self.setFixedSize(100, 100)\n#         self.setRange(100, 200)\n#         self.setWrapping(True)\n#         self.mouse_x = 0\n#         self.mouse_y = 0\n#         self.is_first_paint = True\n\n#     def mousePressEvent(self, event):\n#         super(QtBoxStyleDial2, self).mousePressEvent(event)\n#         if event.button() == Qt.LeftButton:\n#             self.mouse_x = event.x()\n#             self.mouse_y = event.y()\n\n#     def mouseMoveEvent(self, event):\n#         super(QtBoxStyleDial2, self).mouseMoveEvent(event)\n#         if event.buttons() == Qt.LeftButton:\n#             self.mouse_x = event.x()\n#             self.mouse_y = event.y()\n\n#     def paintEvent(self, event):\n#         painter = QPainter(self)\n#         painter.setRenderHint(QPainter.Antialiasing)\n#         pen = QPen()\n#         pen.setColor(Qt.lightGray)\n#         painter.setPen(pen)\n\n#         linear_gradient = QLinearGradient(self.rect().topLeft(), self.rect().bottomRight())\n#         linear_gradient.setColorAt(0, QColor(Qt.white))\n#         linear_gradient.setColorAt(1, QColor(Qt.black))\n#         painter.setBrush(linear_gradient)\n#         painter.drawEllipse(self.rect())\n\n#         if self.is_first_paint:\n#             self.mouse_x = self.rect().center().x()\n#             self.mouse_y = self.rect().bottom()\n#             self.is_first_paint = False\n\n#         handle_radius = 10\n#         painter.setBrush(Qt.white)\n#         handle_x, handle_y = self.get_handle_pos()\n#         painter.drawEllipse(QPointF(handle_x, handle_y), handle_radius, handle_radius)\n\n#         angle = self.get_angle([handle_x, handle_y])\n#         self.setValue(round(angle / 360 * (self.maximum() - self.minimum())) + self.minimum())\n\n#         font = QFont()\n#         font.setPixelSize(18)\n#         painter.setFont(font)\n#         font_metrics = QFontMetricsF(font)\n#         text_width = font_metrics.width(str(self.value()))\n#         painter.drawText(int(self.width() / 2 - text_width / 2), int(self.height() / 2), str(self.value()))\n\n#     def get_handle_pos(self):\n#         center_x = self.rect().center().x()\n#         center_y = self.rect().center().y()\n\n#         if self.mouse_x - center_x == 0 and self.mouse_y - center_y == 0:\n#             diff_x = center_x\n#             diff_y = center_y\n#         else:\n#             diff_x = self.mouse_x - center_x\n#             diff_y = self.mouse_y - center_y\n\n#         pos_adjust_value = 1.5\n#         length = math.sqrt(diff_x ** 2 + diff_y ** 2)\n#         ratio = length / (self.rect().width() / 2) * pos_adjust_value\n#         handle_x = diff_x / ratio + center_x\n#         handle_y = diff_y / ratio + center_y\n#         return handle_x, handle_y\n\n#     def get_angle(self, handle_pos):\n#         \"\"\"get the angle between handle and the start pos\"\"\"\n#         center_x = self.rect().center().x()\n#         center_y = self.rect().center().y()\n#         start_pos = [self.rect().center().x(), self.rect().bottom()]\n\n#         vx1 = start_pos[0] - center_x\n#         vy1 = start_pos[1] - center_y\n#         vx2 = handle_pos[0] - center_x\n#         vy2 = handle_pos[1] - center_y\n#         angle1 = math.atan2(vy1, vx1)\n#         angle1 = angle1 * 180 / math.pi\n#         angle2 = math.atan2(vy2, vx2)\n#         angle2 = angle2 * 180 / math.pi\n\n#         if angle2 >= 0:\n#             diff_angle = angle2 - angle1\n#             if diff_angle < 0:\n#                 diff_angle = 360 - abs(diff_angle)\n#         else:\n#             diff_angle = 180 + angle2 + angle1\n#         return diff_angle\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEDIAL2_H\n# #define QTBOXSTYLEDIAL2_H\n# #include <QDial>\n\n# class QtBoxStyleDial2 : public QDial\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleDial2(QWidget *parent = nullptr);\n\n# protected:\n#     void mousePressEvent(QMouseEvent *event);\n#     void mouseMoveEvent(QMouseEvent *event);\n#     void paintEvent(QPaintEvent *event);\n\n# private:\n#     int mouseX = 0;\n#     int mouseY = 0;\n#     bool isFirstPaint = true;\n\n#     float* getHandlePos();\n#     float getAngle(float *handlePos);\n# };\n# #endif // QTBOXSTYLEDIAL2_H\n\n\n\n# #include \"qtboxstyledial2.h\"\n# #include <math.h>\n# #include <QMouseEvent>\n# #include <QPainter>\n# #include <QPen>\n# #include <QLinearGradient>\n# #include <QColor>\n# #include <QPointF>\n# #include <QFont>\n# #include <QFontMetricsF>\n# #include <Qt>\n\n# QtBoxStyleDial2::QtBoxStyleDial2(QWidget *parent)\n#     : QDial(parent)\n# {\n#     setFixedSize(100, 100);\n#     setRange(100, 200);\n#     setWrapping(true);\n# }\n\n# void QtBoxStyleDial2::mousePressEvent(QMouseEvent *event)\n# {\n#     QDial::mousePressEvent(event);\n#     if (event->button() == Qt::LeftButton) {\n#         mouseX = event->x();\n#         mouseY = event->y();\n#     }\n# }\n#\n# void QtBoxStyleDial2::mouseMoveEvent(QMouseEvent *event)\n# {\n#     QDial::mouseMoveEvent(event);\n#     if (event->buttons() == Qt::LeftButton) {\n#         mouseX = event->x();\n#         mouseY = event->y();\n#     }\n# }\n\n# void QtBoxStyleDial2::paintEvent(QPaintEvent *event)\n# {\n#     QPainter painter(this);\n#     painter.setRenderHint(QPainter::Antialiasing);\n#     QPen pen = QPen();\n#     pen.setColor(Qt::lightGray);\n#     painter.setPen(pen);\n\n#     QLinearGradient linearGradient = QLinearGradient(rect().topLeft(), rect().bottomRight());\n#     linearGradient.setColorAt(0, QColor(Qt::white));\n#     linearGradient.setColorAt(1, QColor(Qt::black));\n#     painter.setBrush(linearGradient);\n#     painter.drawEllipse(rect());\n\n#     if (isFirstPaint) {\n#         mouseX = rect().center().x();\n#         mouseY = rect().bottom();\n#         isFirstPaint = false;\n#     }\n\n#     int handleRadius = 10;\n#     painter.setBrush(Qt::white);\n#     float *handlePos = getHandlePos();\n#     float handleX = handlePos[0];\n#     float handleY = handlePos[1];\n#     painter.drawEllipse(QPointF(handleX, handleY), handleRadius, handleRadius);\n\n#     float angle = getAngle(handlePos);\n#     setValue(round(angle / 360 * (maximum()-minimum())) + minimum());\n#     delete[] handlePos;\n\n#     QFont font = QFont();\n#     font.setPixelSize(18);\n#     painter.setFont(font);\n#     QFontMetricsF fontMetrics = QFontMetrics(font);\n#     float textWidth = fontMetrics.size(Qt::TextSingleLine, QString(\"%1\").arg(value())).width();\n#     painter.drawText(int(width()/2-textWidth/2), int(height()/2), QString(\"%1\").arg(value()));\n# }\n\n# float* QtBoxStyleDial2::getHandlePos()\n# {\n#     int centerX = rect().center().x();\n#     int centerY = rect().center().y();\n\n#     int diffX;\n#     int diffY;\n#     if (mouseX-centerX == 0 && mouseY-centerY == 0) {\n#         diffX = centerX;\n#         diffY = centerY;\n#     }\n#     else {\n#         diffX = mouseX - centerX;\n#         diffY = mouseY - centerY;\n#     }\n\n#     float posAdjustValue = 1.5;\n#     float length = sqrt(pow(diffX, 2) + pow(diffY, 2));\n#     float ratio = length / (rect().width()/2) * posAdjustValue;\n#     float handleX = diffX / ratio + centerX;\n#     float handleY = diffY / ratio + centerY;\n\n#     float *result = new float[2];\n#     result[0] = handleX;\n#     result[1] = handleY;\n#     return result;\n# }\n\n# float QtBoxStyleDial2::getAngle(float *handlePos)\n# {\n#     int centerX = rect().center().x();\n#     int centerY = rect().center().y();\n#     int startPos[2] = {rect().center().x(), rect().bottom()};\n\n#     float vx1 = startPos[0] - centerX;\n#     float vy1 = startPos[1] - centerY;\n#     float vx2 = handlePos[0] - centerX;\n#     float vy2 = handlePos[1] - centerY;\n#     float angle1 = atan2(vy1, vx1);\n#     angle1 = angle1 * 180 / M_PI;\n#     float angle2 = atan2(vy2, vx2);\n#     angle2 = angle2 * 180 / M_PI;\n\n#     float diffAngle;\n#     if (angle2 >= 0) {\n#         diffAngle = angle2 - angle1;\n#         if (diffAngle < 0) {\n#             diffAngle = 360 - abs(diffAngle);\n#         }\n#     }\n#     else {\n#         diffAngle = 180 + angle2 + angle1;\n#     }\n#     return diffAngle;\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/label/__init__.py",
    "content": "from .func import demo1, demo2, demo3, demo4, demo5, demo6, demo7\nfrom .style import demo1, demo2, demo3, demo4"
  },
  {
    "path": "src/qtbox/demo/label/func/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/label/func/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QLabel\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLabel = createWidgetMenuBase(QLabel)\n\nclass QtBoxFuncLabel1(QLabel):\n    def __init__(self):\n        super(QtBoxFuncLabel1, self).__init__(str(Path(__file__)))\n        self.setText(\"<a href='https://github.com/la-vie-est-belle/qtbox' style='text-decoration:none'>Qt Box link</a>\")\n        self.setOpenExternalLinks(True)\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QLabel\n\n\n# class QtBoxFuncLabel1(QLabel):\n#     def __init__(self):\n#         super(QtBoxFuncLabel1, self).__init__()\n#         self.setText(\"<a href='https://github.com/la-vie-est-belle/qtbox' style='text-decoration:none'>Qt Box link</a>\")\n#         self.setOpenExternalLinks(True)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLABEL1_H\n# #define QTBOXFUNCLABEL1_H\n# #include <QLabel>\n\n# class QtBoxFuncLabel1 : public QLabel\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncLabel1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXFUNCLABEL1_H\n\n\n\n# #include \"qtboxfunclabel1.h\"\n\n# QtBoxFuncLabel1::QtBoxFuncLabel1(QWidget *parent)\n#     : QLabel(parent)\n# {\n#     setText(\"<a href='https://github.com/la-vie-est-belle/qtbox' style='text-decoration:none'>Qt Box link</a>\");\n#     setOpenExternalLinks(true);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/label/func/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QLabel\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLabel = createWidgetMenuBase(QLabel)\n\nclass QtBoxFuncLabel2(QLabel):\n    def __init__(self):\n        super(QtBoxFuncLabel2, self).__init__(str(Path(__file__)))\n        self.setText(\"I'm editable.\")\n        self.setTextInteractionFlags(Qt.TextEditorInteraction)\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QLabel\n\n\n# class QtBoxFuncLabel2(QLabel):\n#     def __init__(self):\n#         super(QtBoxFuncLabel2, self).__init__()\n#         self.setText(\"I'm editable.\")\n#         self.setTextInteractionFlags(Qt.TextEditorInteraction)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLABEL2_H\n# #define QTBOXFUNCLABEL2_H\n# #include <QLabel>\n\n# class QtBoxFuncLabel2 : public QLabel\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncLabel2(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXFUNCLABEL2_H\n\n\n\n# #include \"qtboxfunclabel2.h\"\n# #include <Qt>\n\n# QtBoxFuncLabel2::QtBoxFuncLabel2(QWidget *parent)\n#     : QLabel(parent)\n# {\n#     setText(\"I'm editable.\");\n#     setTextInteractionFlags(Qt::TextEditorInteraction);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/label/func/demo3.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import QTimer\nfrom PyQt5.QtWidgets import QLabel\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLabel = createWidgetMenuBase(QLabel)\n\nclass QtBoxFuncLabel3(QLabel):\n    def __init__(self):\n        super(QtBoxFuncLabel3, self).__init__(str(Path(__file__)))\n        self.text = \"\"\n        self.count = 0\n        self.timer = QTimer()\n        self.timer.timeout.connect(self.update_text)\n        self.type_text(\"Typewriter effect\")\n\n    def type_text(self, txt):\n        self.text = txt\n        self.count = 0\n        self.timer.stop()\n        self.timer.start(500)\n\n    def update_text(self):\n        self.count += 1\n        self.setText(self.text[0:self.count])\n\n        if self.count >= len(self.text):\n            self.count = 0\n            self.timer.stop()\n# PyQt\n\n# PySide\n# from PySide2.QtCore import QTimer\n# from PySide2.QtWidgets import QLabel\n\n\n# class QtBoxFuncLabel3(QLabel):\n#     def __init__(self):\n#         super(QtBoxFuncLabel3, self).__init__()\n#         self.text = \"\"\n#         self.count = 0\n#         self.timer = QTimer()\n#         self.timer.timeout.connect(self.update_text)\n#         self.type_text(\"Typewriter effect\")\n\n#     def type_text(self, txt):\n#         self.text = txt\n#         self.count = 0\n#         self.timer.stop()\n#         self.timer.start(500)\n\n#     def update_text(self):\n#         self.count += 1\n#         self.setText(self.text[0:self.count])\n#\n#         if self.count >= len(self.text):\n#             self.count = 0\n#             self.timer.stop()\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLABEL3_H\n# #define QTBOXFUNCLABEL3_H\n# #include <QLabel>\n# #include <QTimer>\n# #include <QString>\n\n# class QtBoxFuncLabel3 : public QLabel\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncLabel3(QWidget *parent = nullptr);\n\n# private:\n#     QString text = \"\";\n#     int count = 0;\n#     QTimer *timer = new QTimer();\n#     void typeText(const QString &txt);\n\n# private slots:\n#     void updateText();\n# };\n# #endif // QTBOXFUNCLABEL3_H\n\n\n\n# #include \"qtboxfunclabel3.h\"\n\n# QtBoxFuncLabel3::QtBoxFuncLabel3(QWidget *parent)\n#     : QLabel(parent)\n# {\n#     connect(timer, SIGNAL(timeout()), this, SLOT(updateText()));\n#     typeText(\"Typewriter effect\");\n# }\n\n# void QtBoxFuncLabel3::typeText(const QString &txt)\n# {\n#     text = txt;\n#     count = 0;\n#     timer->stop();\n#     timer->start(500);\n# }\n\n# void QtBoxFuncLabel3::updateText()\n# {\n#     count += 1;\n#     setText(text.left(count));\n\n#     if (count >= text.length()) {\n#         count = 0;\n#         timer->stop();\n#     }\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/label/func/demo4.py",
    "content": "# PyQt\nfrom PyQt5.QtGui import QMovie\nfrom PyQt5.QtWidgets import QLabel\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLabel = createWidgetMenuBase(QLabel)\nPATH_TO_GIF = str(Path(__file__).parent.parent.parent.parent / \"res/images/exercise.gif\").replace(\"\\\\\", \"/\")\n\nclass QtBoxFuncLabel4(QLabel):\n    def __init__(self):\n        super(QtBoxFuncLabel4, self).__init__(str(Path(__file__)))\n        movie = QMovie()\n        movie.setFileName(PATH_TO_GIF)\n        self.setMovie(movie)\n        movie.start()\n# PyQt\n\n# PySide\n# from PySide2.QtGui import QMovie\n# from PySide2.QtWidgets import QLabel\n\n\n# class QtBoxFuncLabel4(QLabel):\n#     def __init__(self):\n#         super(QtBoxFuncLabel4, self).__init__(str(Path(__file__)))\n#         movie = QMovie()\n#         movie.setFileName(PATH_TO_GIF)\n#         self.setMovie(movie)\n#         movie.start()\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLABEL4_H\n# #define QTBOXFUNCLABEL4_H\n# #include <QLabel>\n# #include <QMovie>\n\n# class QtBoxFuncLabel4 : public QLabel\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncLabel4(QWidget *parent = nullptr);\n\n# private:\n#     QMovie *movie = new QMovie();\n# };\n# #endif // QTBOXFUNCLABEL4_H\n\n\n\n# #include \"qtboxfunclabel4.h\"\n\n# QtBoxFuncLabel4::QtBoxFuncLabel4(QWidget *parent)\n#     : QLabel(parent)\n# {\n#     movie->setFileName(PATH_TO_GIF);\n#     setMovie(movie);\n#     movie->start();\n# }\n# C++/Qt\n"
  },
  {
    "path": "src/qtbox/demo/label/func/demo5.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QLabel\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLabel = createWidgetMenuBase(QLabel)\n\nclass QtBoxFuncLabel5(QLabel):\n    def __init__(self):\n        super(QtBoxFuncLabel5, self).__init__(str(Path(__file__)))\n        text = 'Lay words vertically'.replace(\" \", \"\\n\")\n        self.setText(text)\n        self.setAlignment(Qt.AlignCenter)\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QLabel\n\n\n# class QtBoxFuncLabel5(QLabel):\n#     def __init__(self):\n#         super(QtBoxFuncLabel5, self).__init__(str(Path(__file__)))\n#         text = 'Lay words vertically'.replace(\" \", \"\\n\")\n#         self.setText(text)\n#         self.setAlignment(Qt.AlignCenter)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLABEL5_H\n# #define QTBOXFUNCLABEL5_H\n# #include <QLabel>\n\n# class QtBoxFuncLabel5 : public QLabel\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncLabel5(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXFUNCLABEL5_H\n\n\n\n# #include \"qtboxfunclabel5.h\"\n# #include <QString>\n# #include <Qt>\n\n# QtBoxFuncLabel5::QtBoxFuncLabel5(QWidget *parent)\n#     : QLabel(parent)\n# {\n#     QString text = \"Lay words vertically\";\n#     text = text.replace(\" \", \"\\n\");\n#     setText(text);\n#     setAlignment(Qt::AlignCenter);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/label/func/demo6.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import QTimer, QTime\nfrom PyQt5.QtWidgets import QLabel\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLabel = createWidgetMenuBase(QLabel)\n\nclass QtBoxFuncLabel6(QLabel):\n    def __init__(self):\n        super(QtBoxFuncLabel6, self).__init__(str(Path(__file__)))\n        self.update_text()\n\n        self.timer = QTimer()\n        self.timer.timeout.connect(self.update_text)\n        self.timer.start(1000)\n\n    def update_text(self):\n        self.setText(QTime.currentTime().toString())\n# PyQt\n\n# PySide\n# from PySide2.QtCore import QTimer, QTime\n# from PySide2.QtWidgets import QLabel\n\n\n# class QtBoxFuncLabel6(QLabel):\n#     def __init__(self):\n#         super(QtBoxFuncLabel6, self).__init__(str(Path(__file__)))\n#         self.update_text()\n\n#         self.timer = QTimer()\n#         self.timer.timeout.connect(self.update_text)\n#         self.timer.start(1000)\n\n#     def update_text(self):\n#         self.setText(QTime.currentTime().toString())\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLABEL6_H\n# #define QTBOXFUNCLABEL6_H\n# #include <QLabel>\n# #include <QTimer>\n\n# class QtBoxFuncLabel6 : public QLabel\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncLabel6(QWidget *parent = nullptr);\n\n# private:\n#     QTimer *timer = new QTimer();\n#\n# private slots:\n#     void updateText();\n# };\n# #endif // QTBOXFUNCLABEL6_H\n\n\n\n# #include \"qtboxfunclabel6.h\"\n# #include <QTime>\n\n# QtBoxFuncLabel6::QtBoxFuncLabel6(QWidget *parent)\n#     : QLabel(parent)\n# {\n#     updateText();\n#     connect(timer, SIGNAL(timeout()), this, SLOT(updateText()));\n#     timer->start(1000);\n# }\n\n# void QtBoxFuncLabel6::updateText()\n# {\n#     setText(QTime::currentTime().toString());\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/label/func/demo7.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QLabel\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLabel = createWidgetMenuBase(QLabel)\n\nclass QtBoxFuncLabel7(QLabel):\n    def __init__(self):\n        super(QtBoxFuncLabel7, self).__init__(str(Path(__file__)))\n        self.setText(\"Drop a txt file on me.\\n\"\n                     \"I will show its content.\")\n        self.setAcceptDrops(True)\n\n    def dragEnterEvent(self, event):\n        super(QtBoxFuncLabel7, self).dragEnterEvent(event)\n        if event.mimeData().hasUrls():\n            event.acceptProposedAction()\n\n    def dropEvent(self, event):\n        super(QtBoxFuncLabel7, self).dropEvent(event)\n        url = event.mimeData().urls()[0].toLocalFile()\n        if not url.endswith(\".txt\"):\n            return\n\n        with open(url, \"r\", encoding=\"utf-8\") as f:\n            self.setText(f.read())\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QLabel\n\n\n# class QtBoxFuncLabel7(QLabel):\n#     def __init__(self):\n#         super(QtBoxFuncLabel7, self).__init__()\n#         self.setText(\"Drop a txt file on me.\\n\"\n#                      \"I will show its content.\")\n#         self.setAcceptDrops(True)\n\n#     def dragEnterEvent(self, event):\n#         super(QtBoxFuncLabel7, self).dragEnterEvent(event)\n#         if event.mimeData().hasUrls():\n#             event.acceptProposedAction()\n\n#     def dropEvent(self, event):\n#         super(QtBoxFuncLabel7, self).dropEvent(event)\n#         url = event.mimeData().urls()[0].toLocalFile()\n#         if not url.endswith(\".txt\"):\n#             return\n\n#         with open(url, \"r\", encoding=\"utf-8\") as f:\n#             self.setText(f.read())\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLABEL7_H\n# #define QTBOXFUNCLABEL7_H\n# #include <QLabel>\n# #include <QDragEnterEvent>\n# #include <QDropEvent>\n\n# class QtBoxFuncLabel7 : public QLabel\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncLabel7(QWidget *parent = nullptr);\n\n# protected:\n#     void dragEnterEvent(QDragEnterEvent *event);\n#     void dropEvent(QDropEvent *event);\n# };\n# #endif // QTBOXFUNCLABEL7_H\n\n\n\n# #include \"qtboxfunclabel7.h\"\n# #include <QMimeData>\n# #include <QString>\n# #include <QFile>\n# #include <QIODevice>\n\n# QtBoxFuncLabel7::QtBoxFuncLabel7(QWidget *parent)\n#     : QLabel(parent)\n# {\n#     setText(\"Drop a txt file on me.\\n\"\n#             \"I will show its content.\");\n#     setAcceptDrops(true);\n# }\n\n# void QtBoxFuncLabel7::dragEnterEvent(QDragEnterEvent *event)\n# {\n#     QLabel::dragEnterEvent(event);\n#     if (event->mimeData()->hasUrls()) {\n#         event->acceptProposedAction();\n#     }\n# }\n\n# void QtBoxFuncLabel7::dropEvent(QDropEvent *event)\n# {\n#     QLabel::dropEvent(event);\n#     QString url = event->mimeData()->urls()[0].toLocalFile();\n#     if (!url.endsWith(\".txt\")) {\n#         return;\n#     }\n\n#     QFile file(url);\n#     file.open(QIODevice::ReadOnly);\n#     setText(file.readAll());\n#     file.close();\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/label/style/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/label/style/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QLabel\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLabel = createWidgetMenuBase(QLabel)\nPATH_TO_IMG = str(Path(__file__).parent.parent.parent.parent / \"res/images/qt.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleLabel1(QLabel):\n    def __init__(self):\n        super(QtBoxStyleLabel1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(90, 90)\n        self.setStyleSheet(\"\"\"\n        QLabel {\n            border-radius: 45px;\n            border-image: url(%s)\n        }\n        \"\"\" % (PATH_TO_IMG))\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QLabel\n\n\n# class QtBoxStyleLabel1(QLabel):\n#     def __init__(self):\n#         super(QtBoxStyleLabel1, self).__init__()\n#         self.setFixedSize(90, 90)\n#         self.setStyleSheet(\"\"\"\n#         QLabel {\n#             border-radius: 45px;\n#             border-image: url(%s)\n#         }\n#         \"\"\" % (PATH_TO_IMG))\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELABEL1_H\n# #define QTBOXSTYLELABEL1_H\n# #include <QLabel>\n\n# class QtBoxStyleLabel1 : public QLabel\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLabel1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLELABEL1_H\n\n\n\n# #include \"qtboxstylelabel1.h\"\n\n# QtBoxStyleLabel1::QtBoxStyleLabel1(QWidget *parent)\n#     : QLabel(parent)\n# {\n#     setFixedSize(90, 90);\n#     setStyleSheet(R\"(\n#     QLabel {\n#         border-radius: 45px;\n#         border-image: url(:res/images/qt.png)\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/label/style/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QLabel\nfrom PyQt5.QtCore import Qt, QPointF\nfrom PyQt5.QtGui import QPixmap, QPainter, QBrush\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLabel = createWidgetMenuBase(QLabel)\nPATH_TO_IMG = str(Path(__file__).parent.parent.parent.parent / \"res/images/qt.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleLabel2(QLabel):\n    def __init__(self):\n        super(QtBoxStyleLabel2, self).__init__(str(Path(__file__)))\n        self.setFixedSize(90, 90)\n        self.pixmap = QPixmap(PATH_TO_IMG).scaled(self.width(), self.height())\n\n    def paintEvent(self, event):\n        painter = QPainter(self)\n        painter.setRenderHint(QPainter.Antialiasing)\n        painter.setPen(Qt.NoPen)\n        brush = QBrush(self.pixmap)\n        painter.setBrush(brush)\n\n        points = [\n            QPointF(10.0, 80.0),\n            QPointF(20.0, 10.0),\n            QPointF(80.0, 30.0),\n            QPointF(90.0, 70.0)\n        ]\n        painter.drawConvexPolygon(*points)\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QLabel\n# from PySide2.QtCore import Qt, QPointF\n# from PySide2.QtGui import QPixmap, QPainter, QBrush\n\n\n# class QtBoxStyleLabel2(QLabel):\n#     def __init__(self):\n#         super(QtBoxStyleLabel2, self).__init__()\n#         self.setFixedSize(90, 90)\n#         self.pixmap = QPixmap(PATH_TO_IMG).scaled(self.width(), self.height())\n\n#     def paintEvent(self, event):\n#         painter = QPainter(self)\n#         painter.setRenderHint(QPainter.Antialiasing)\n#         painter.setPen(Qt.NoPen)\n#         brush = QBrush(self.pixmap)\n#         painter.setBrush(brush)\n\n#         points = [\n#             QPointF(10.0, 80.0),\n#             QPointF(20.0, 10.0),\n#             QPointF(80.0, 30.0),\n#             QPointF(90.0, 70.0)\n#         ]\n#         painter.drawConvexPolygon(points)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELABEL2_H\n# #define QTBOXSTYLELABEL2_H\n# #include <QLabel>\n# #include <QPixmap>\n# #include <QPaintEvent>\n\n# class QtBoxStyleLabel2 : public QLabel\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLabel2(QWidget *parent = nullptr);\n\n# protected:\n#     void paintEvent(QPaintEvent *event);\n\n# private:\n#     QPixmap pixmap;\n# };\n# #endif // QTBOXSTYLELABEL2_H\n\n\n\n# #include \"qtboxstylelabel2.h\"\n# #include <QPainter>\n# #include <Qt>\n# #include <QBrush>\n# #include <QPointF>\n\n# QtBoxStyleLabel2::QtBoxStyleLabel2(QWidget *parent)\n#     : QLabel(parent)\n# {\n#     setFixedSize(90, 90);\n#     pixmap = QPixmap(\":res/images/qt.png\").scaled(width(), height());\n# }\n\n# void QtBoxStyleLabel2::paintEvent(QPaintEvent *event)\n# {\n#     QPainter painter(this);\n#     painter.setRenderHint(QPainter::Antialiasing);\n#     painter.setPen(Qt::NoPen);\n#     QBrush brush = QBrush(pixmap);\n#     painter.setBrush(brush);\n\n#     QPointF points[4] = {\n#         QPointF(10.0, 80.0),\n#         QPointF(20.0, 10.0),\n#         QPointF(80.0, 30.0),\n#         QPointF(90.0, 70.0)\n#     };\n#     painter.drawPolygon(points, 4);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/label/style/demo3.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QLabel, QGraphicsBlurEffect\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLabel = createWidgetMenuBase(QLabel)\n\nclass QtBoxStyleLabel3(QLabel):\n    def __init__(self):\n        super(QtBoxStyleLabel3, self).__init__(str(Path(__file__)))\n        self.setText(\"Blur\")\n        self.blur()\n\n    def blur(self):\n        blur = QGraphicsBlurEffect(self)\n        blur.setBlurRadius(6)\n        blur.setBlurHints(QGraphicsBlurEffect.QualityHint)\n        self.setGraphicsEffect(blur)\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QLabel, QGraphicsBlurEffect\n\n\n# class QtBoxStyleLabel3(QLabel):\n#     def __init__(self):\n#         super(QtBoxStyleLabel3, self).__init__()\n#         self.setText(\"Blur\")\n#         self.blur()\n\n#     def blur(self):\n#         blur = QGraphicsBlurEffect(self)\n#         blur.setBlurRadius(6)\n#         blur.setBlurHints(QGraphicsBlurEffect.QualityHint)\n#         self.setGraphicsEffect(blur)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELABEL3_H\n# #define QTBOXSTYLELABEL3_H\n# #include <QLabel>\n\n# class QtBoxStyleLabel3 : public QLabel\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLabel3(QWidget *parent = nullptr);\n\n# private:\n#     void blur();\n# };\n# #endif // QTBOXSTYLELABEL3_H\n\n\n\n# #include \"qtboxstylelabel3.h\"\n# #include <QGraphicsBlurEffect>\n\n# QtBoxStyleLabel3::QtBoxStyleLabel3(QWidget *parent)\n#     : QLabel(parent)\n# {\n#     setText(\"Blur\");\n#     blur();\n# }\n\n# void QtBoxStyleLabel3::blur() {\n#     QGraphicsBlurEffect *blur = new QGraphicsBlurEffect(this);\n#     blur->setBlurRadius(2);\n#     blur->setBlurHints(QGraphicsBlurEffect::QualityHint);\n#     setGraphicsEffect(blur);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/label/style/demo4.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import QTimer\nfrom PyQt5.QtWidgets import QLabel\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLabel = createWidgetMenuBase(QLabel)\n\nclass QtBoxStyleLabel4(QLabel):\n    def __init__(self):\n        super(QtBoxStyleLabel4, self).__init__(str(Path(__file__)))\n        self.setText(\"Change text color\")\n        self.color_list = [\"rgb(255, 0, 0)\", \"rgb(255, 165, 0)\", \"rgb(255, 255, 0)\",\n                           \"rgb(0, 255, 0)\", \"rgb(0, 127, 255)\", \"rgb(0, 0, 255)\",\n                           \"rgb(139, 0, 255)\"]\n\n        self.count = 0\n        self.timer = QTimer()\n        self.timer.timeout.connect(self.change_color)\n        self.timer.start(100)\n\n    def change_color(self):\n        color = self.color_list[self.count]\n        self.setStyleSheet(f\"\"\"\n        color: {color}\n        \"\"\")\n\n        self.count += 1\n        if self.count >= len(self.color_list):\n            self.count = 0\n# PyQt\n\n# PySide\n# from PySide2.QtCore import QTimer\n# from PySide2.QtWidgets import QLabel\n\n\n# class QtBoxStyleLabel4(QLabel):\n#     def __init__(self):\n#         super(QtBoxStyleLabel4, self).__init__()\n#         self.setText(\"Change text color\")\n#         self.color_list = [\"rgb(255, 0, 0)\", \"rgb(255, 165, 0)\", \"rgb(255, 255, 0)\",\n#                            \"rgb(0, 255, 0)\", \"rgb(0, 127, 255)\", \"rgb(0, 0, 255)\",\n#                            \"rgb(139, 0, 255)\"]\n\n#         self.count = 0\n#         self.timer = QTimer()\n#         self.timer.timeout.connect(self.change_color)\n#         self.timer.start(100)\n\n#     def change_color(self):\n#         color = self.color_list[self.count]\n#         self.setStyleSheet(f\"\"\"\n#         color: {color}\n#         \"\"\")\n\n#         self.count += 1\n#         if self.count >= len(self.color_list):\n#             self.count = 0\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELABEL4_H\n# #define QTBOXSTYLELABEL4_H\n# #include <QLabel>\n# #include <QString>\n# #include <QTimer>\n\n# class QtBoxStyleLabel4 : public QLabel\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLabel4(QWidget *parent = nullptr);\n\n# private:\n#     unsigned int count = 0;\n#     QTimer *timer = new QTimer();\n#     QString colorList[7] = {\"rgb(255, 0, 0)\", \"rgb(255, 165, 0)\", \"rgb(255, 255, 0)\",\n#                             \"rgb(0, 255, 0)\", \"rgb(0, 127, 255)\", \"rgb(0, 0, 255)\",\n#                             \"rgb(139, 0, 255)\"};\n\n# private slots:\n#     void changeColor();\n# };\n# #endif // QTBOXSTYLELABEL4_H\n\n\n\n# #include \"qtboxstylelabel4.h\"\n\n# QtBoxStyleLabel4::QtBoxStyleLabel4(QWidget *parent)\n#     : QLabel(parent)\n# {\n#     setText(\"Change text color\");\n#     connect(timer, SIGNAL(timeout()), this, SLOT(changeColor()));\n#     timer->start(100);\n# }\n\n# void QtBoxStyleLabel4::changeColor()\n# {\n#     QString color = colorList[count];\n#     setStyleSheet(QString(\"color: %1\").arg(color));\n\n#     count++;\n#     if (count >= (sizeof(colorList)/sizeof(colorList[0]))) {\n#         count = 0;\n#     }\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lcdnumber/__init__.py",
    "content": "from .func import demo1, demo2, demo3\nfrom .style import demo1, demo2, demo3, demo4, demo5"
  },
  {
    "path": "src/qtbox/demo/lcdnumber/func/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/lcdnumber/func/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import QTimer, QTime\nfrom PyQt5.QtWidgets import QLCDNumber\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLCDNumber = createWidgetMenuBase(QLCDNumber)\n\nclass QtBoxFuncLCDNumber1(QLCDNumber):\n    def __init__(self):\n        super(QtBoxFuncLCDNumber1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 50)\n        self.setDigitCount(8)\n        self.update_display()\n\n        self.timer = QTimer()\n        self.timer.timeout.connect(self.update_display)\n        self.timer.start(1000)\n\n    def update_display(self):\n        self.display(QTime.currentTime().toString())\n# PyQt\n\n# PySide\n# from PySide2.QtCore import QTimer, QTime\n# from PySide2.QtWidgets import QLCDNumber\n\n\n# class QtBoxFuncLCDNumber1(QLCDNumber):\n#     def __init__(self):\n#         super(QtBoxFuncLCDNumber1, self).__init__()\n#         self.setFixedSize(150, 50)\n#         self.setDigitCount(8)\n#         self.update_display()\n\n#         self.timer = QTimer()\n#         self.timer.timeout.connect(self.update_display)\n#         self.timer.start(1000)\n\n#     def update_display(self):\n#         self.display(QTime.currentTime().toString())\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLCDNUMBER1_H\n# #define QTBOXFUNCLCDNUMBER1_H\n# #include <QLCDNumber>\n# #include <QTimer>\n\n# class QtBoxFuncLCDNumber1 : public QLCDNumber\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncLCDNumber1(QWidget *parent = nullptr);\n\n# private:\n#     QTimer *timer = new QTimer();\n\n# private slots:\n#     void updateDisplay();\n# };\n# #endif // QTBOXFUNCLCDNUMBER1_H\n\n\n\n# #include \"qtboxfunclcdnumber1.h\"\n# #include <QTime>\n\n# QtBoxFuncLCDNumber1::QtBoxFuncLCDNumber1(QWidget *parent)\n#     : QLCDNumber(parent)\n# {\n#     setFixedSize(150, 50);\n#     setDigitCount(8);\n#     updateDisplay();\n\n#     connect(timer, SIGNAL(timeout()), this, SLOT(updateDisplay()));\n#     timer->start(1000);\n# }\n\n# void QtBoxFuncLCDNumber1::updateDisplay()\n# {\n#     display(QTime::currentTime().toString());\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lcdnumber/func/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import QTimer\nfrom PyQt5.QtWidgets import QLCDNumber\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLCDNumber = createWidgetMenuBase(QLCDNumber)\n\nclass QtBoxFuncLCDNumber2(QLCDNumber):\n    def __init__(self):\n        super(QtBoxFuncLCDNumber2, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 50)\n        self.text = \"HELLO\"\n        self.setDigitCount(len(self.text))\n        self.display(\"\")\n\n        self.count = 0\n        self.timer = QTimer()\n        self.timer.timeout.connect(self.update_display)\n        self.timer.start(1000)\n\n    def update_display(self):\n        self.count += 1\n        if self.count > len(self.text):\n            self.display(self.text+(self.count-len(self.text))*\" \")\n        else:\n            self.display(self.text[0:self.count])\n\n        if self.count == 2*len(self.text):\n            self.count = 0\n# PyQt\n\n# PySide\n# from PySide2.QtCore import QTimer\n# from PySide2.QtWidgets import QLCDNumber\n\n\n# class QtBoxFuncLCDNumber2(QLCDNumber):\n#     def __init__(self):\n#         super(QtBoxFuncLCDNumber2, self).__init__()\n#         self.setFixedSize(150, 50)\n#         self.text = \"HELLO\"\n#         self.setDigitCount(len(self.text))\n#         self.display(\"\")\n\n#         self.count = 0\n#         self.timer = QTimer()\n#         self.timer.timeout.connect(self.update_display)\n#         self.timer.start(1000)\n\n#     def update_display(self):\n#         self.count += 1\n#         if self.count > len(self.text):\n#             self.display(self.text+(self.count-len(self.text))*\" \")\n#         else:\n#             self.display(self.text[0:self.count])\n\n#         if self.count == 2*len(self.text):\n#             self.count = 0\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLCDNUMBER2_H\n# #define QTBOXFUNCLCDNUMBER2_H\n# #include <QLCDNumber>\n# #include <QString>\n# #include <QTimer>\n\n# class QtBoxFuncLCDNumber2 : public QLCDNumber\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncLCDNumber2(QWidget *parent = nullptr);\n\n# private:\n#     int count = 0;\n#     QString text = \"HELLO\";\n#     QTimer *timer = new QTimer();\n\n# private slots:\n#     void updateDisplay();\n# };\n# #endif // QTBOXFUNCLCDNUMBER2_H\n\n\n\n# #include \"qtboxfunclcdnumber2.h\"\n\n# QtBoxFuncLCDNumber2::QtBoxFuncLCDNumber2(QWidget *parent)\n#     : QLCDNumber(parent)\n# {\n#     setFixedSize(150, 50);\n#     setDigitCount(text.size());\n#     display(\"\");\n\n#     connect(timer, SIGNAL(timeout()), this, SLOT(updateDisplay()));\n#     timer->start(1000);\n# }\n\n# void QtBoxFuncLCDNumber2::updateDisplay()\n# {\n#     count++;\n#     if (count > text.size()) {\n#         QString emptyString = \"\";\n#         for (int i=0; i<count-text.size(); i++) {\n#             emptyString += \" \";\n#         };\n#         display(text+emptyString);\n#     }\n#     else {\n#         display(text.left(count));\n#     }\n\n#     if (count == 2*text.size()) {\n#         count = 0;\n#     }\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lcdnumber/func/demo3.py",
    "content": "# PyQt\nfrom time import strftime, gmtime\nfrom PyQt5.QtCore import QTimer, QTime\nfrom PyQt5.QtWidgets import QLCDNumber\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLCDNumber = createWidgetMenuBase(QLCDNumber)\n\nclass QtBoxFuncLCDNumber3(QLCDNumber):\n    def __init__(self):\n        super(QtBoxFuncLCDNumber3, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 50)\n        self.setDigitCount(8)\n\n        self.count_down = 3600\n        self.update_display()\n        self.timer = QTimer()\n        self.timer.timeout.connect(self.update_display)\n        self.timer.start(1000)\n\n    def update_display(self):\n        self.count_down -= 1\n        self.display(strftime(\"%H:%M:%S\", gmtime(self.count_down)))\n        if self.count_down <= 0:\n            self.count_down = 3600\n# PyQt\n\n# PySide\n# from time import strftime, gmtime\n# from PySide2.QtCore import QTimer\n# from PySide2.QtWidgets import QLCDNumber\n\n\n# class QtBoxFuncLCDNumber3(QLCDNumber):\n#     def __init__(self):\n#         super(QtBoxFuncLCDNumber3, self).__init__()\n#         self.setFixedSize(150, 50)\n#         self.setDigitCount(8)\n\n#         self.count_down = 3600\n#         self.update_display()\n#         self.timer = QTimer()\n#         self.timer.timeout.connect(self.update_display)\n#         self.timer.start(1000)\n\n#     def update_display(self):\n#         self.count_down -= 1\n#         self.display(strftime(\"%H:%M:%S\", gmtime(self.count_down)))\n#         if self.count_down <= 0:\n#             self.count_down = 3600\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLCDNUMBER3_H\n# #define QTBOXFUNCLCDNUMBER3_H\n# #include <QLCDNumber>\n# #include <QTimer>\n# #include <QTime>\n\n# class QtBoxFuncLCDNumber3 : public QLCDNumber\n# {\n#     Q_OBJECT\n#\n# public:\n#     QtBoxFuncLCDNumber3(QWidget *parent = nullptr);\n\n# private:\n#     int count = 0;\n#     QTimer *timer = new QTimer();\n#     QTime *time = new QTime(1, 0, 0, 0);\n\n# private slots:\n#     void updateDisplay();\n# };\n# #endif // QTBOXFUNCLCDNUMBER3_H\n\n\n\n# #include \"qtboxfunclcdnumber3.h\"\n\n# QtBoxFuncLCDNumber3::QtBoxFuncLCDNumber3(QWidget *parent)\n#     : QLCDNumber(parent)\n# {\n#     setFixedSize(150, 50);\n#     setDigitCount(8);\n#     updateDisplay();\n\n#     connect(timer, SIGNAL(timeout()), this, SLOT(updateDisplay()));\n#     timer->start(1000);\n# }\n\n# void QtBoxFuncLCDNumber3::updateDisplay()\n# {\n#     count++;\n#     int timeLeft = time->addSecs(-count).second();\n#     display(time->addSecs(-count).toString(\"hh:mm:ss\"));\n\n#     if (timeLeft <= 0) {\n#         time->setHMS(1, 0, 0, 0);\n#         count = 0;\n#     }\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lcdnumber/style/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/lcdnumber/style/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QLCDNumber\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLCDNumber = createWidgetMenuBase(QLCDNumber)\n\nclass QtBoxStyleLCDNumber1(QLCDNumber):\n    def __init__(self):\n        super(QtBoxStyleLCDNumber1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 50)\n        self.setDigitCount(6)\n        self.display(123456)\n        self.setSegmentStyle(QLCDNumber.Flat)\n        self.setStyleSheet(\"\"\"\n        QLCDNumber {\n            background-color: #98a780;\n            border: none;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QLCDNumber\n\n\n# class QtBoxStyleLCDNumber1(QLCDNumber):\n#     def __init__(self):\n#         super(QtBoxStyleLCDNumber1, self).__init__()\n#         self.setFixedSize(150, 50)\n#         self.setDigitCount(6)\n#         self.display(123456)\n#         self.setSegmentStyle(QLCDNumber.Flat)\n#         self.setStyleSheet(\"\"\"\n#         QLCDNumber {\n#             background-color: #98a780;\n#             border: none;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELCDNUMBER1_H\n# #define QTBOXSTYLELCDNUMBER1_H\n# #include <QLCDNumber>\n\n# class QtBoxStyleLCDNumber1 : public QLCDNumber\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLCDNumber1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLELCDNUMBER1_H\n\n\n\n# #include \"qtboxstylelcdnumber1.h\"\n\n# QtBoxStyleLCDNumber1::QtBoxStyleLCDNumber1(QWidget *parent)\n#     : QLCDNumber(parent)\n# {\n#     setFixedSize(150, 50);\n#     setDigitCount(6);\n#     display(123456);\n#     setSegmentStyle(QLCDNumber::Flat);\n#     setStyleSheet(R\"(\n#     QLCDNumber {\n#         background-color: #98a780;\n#         border: none;\n#     }\n#     )\");\n# }\n# C++/Qt\n"
  },
  {
    "path": "src/qtbox/demo/lcdnumber/style/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QLCDNumber\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLCDNumber = createWidgetMenuBase(QLCDNumber)\n\nclass QtBoxStyleLCDNumber2(QLCDNumber):\n    def __init__(self):\n        super(QtBoxStyleLCDNumber2, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 50)\n        self.setDigitCount(6)\n        self.display(123456)\n        self.setSegmentStyle(QLCDNumber.Flat)\n        self.setStyleSheet(\"\"\"\n        QLCDNumber {\n            background-color: #0130f2;\n            border: none;\n            color: white;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QLCDNumber\n\n\n# class QtBoxStyleLCDNumber2(QLCDNumber):\n#     def __init__(self):\n#         super(QtBoxStyleLCDNumber2, self).__init__()\n#         self.setFixedSize(150, 50)\n#         self.setDigitCount(6)\n#         self.display(123456)\n#         self.setSegmentStyle(QLCDNumber.Flat)\n#         self.setStyleSheet(\"\"\"\n#         QLCDNumber {\n#             background-color: #0130f2;\n#             border: none;\n#             color: white;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELCDNUMBER2_H\n# #define QTBOXSTYLELCDNUMBER2_H\n# #include <QLCDNumber>\n\n# class QtBoxStyleLCDNumber2 : public QLCDNumber\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLCDNumber2(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLELCDNUMBER2_H\n\n\n\n# #include \"qtboxstylelcdnumber2.h\"\n\n# QtBoxStyleLCDNumber2::QtBoxStyleLCDNumber2(QWidget *parent)\n#     : QLCDNumber(parent)\n# {\n#     setFixedSize(150, 50);\n#     setDigitCount(6);\n#     display(123456);\n#     setSegmentStyle(QLCDNumber::Flat);\n#     setStyleSheet(R\"(\n#     QLCDNumber {\n#         background-color: #0130f2;\n#         border: none;\n#         color: white;\n#     }\n#     )\");\n# }\n# C++/Qt\n\n"
  },
  {
    "path": "src/qtbox/demo/lcdnumber/style/demo3.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QLCDNumber\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLCDNumber = createWidgetMenuBase(QLCDNumber)\n\nclass QtBoxStyleLCDNumber3(QLCDNumber):\n    def __init__(self):\n        super(QtBoxStyleLCDNumber3, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 50)\n        self.setDigitCount(6)\n        self.display(123456)\n        self.setSegmentStyle(QLCDNumber.Flat)\n        self.setStyleSheet(\"\"\"\n        QLCDNumber {\n            background-color: #98a7a7;\n            border: none;\n            color: black;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QLCDNumber\n\n\n# class QtBoxStyleLCDNumber3(QLCDNumber):\n#     def __init__(self):\n#         super(QtBoxStyleLCDNumber3, self).__init__()\n#         self.setFixedSize(150, 50)\n#         self.setDigitCount(6)\n#         self.display(123456)\n#         self.setSegmentStyle(QLCDNumber.Flat)\n#         self.setStyleSheet(\"\"\"\n#         QLCDNumber {\n#             background-color: #98a7a7;\n#             border: none;\n#             color: black;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELCDNUMBER3_H\n# #define QTBOXSTYLELCDNUMBER3_H\n# #include <QLCDNumber>\n\n# class QtBoxStyleLCDNumber3 : public QLCDNumber\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLCDNumber3(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLELCDNUMBER3_H\n\n\n\n# #include \"qtboxstylelcdnumber3.h\"\n\n# QtBoxStyleLCDNumber3::QtBoxStyleLCDNumber3(QWidget *parent)\n#     : QLCDNumber(parent)\n# {\n#     setFixedSize(150, 50);\n#     setDigitCount(6);\n#     display(123456);\n#     setSegmentStyle(QLCDNumber::Flat);\n#     setStyleSheet(R\"(\n#     QLCDNumber {\n#         background-color: #98a7a7;\n#         border: none;\n#         color: black;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lcdnumber/style/demo4.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QLCDNumber\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLCDNumber = createWidgetMenuBase(QLCDNumber)\n\nclass QtBoxStyleLCDNumber4(QLCDNumber):\n    def __init__(self):\n        super(QtBoxStyleLCDNumber4, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 50)\n        self.setDigitCount(6)\n        self.display(123456)\n        self.setSegmentStyle(QLCDNumber.Flat)\n        self.setStyleSheet(\"\"\"\n        QLCDNumber {\n            background-color: transparent;\n            border: none;\n            color: black;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QLCDNumber\n\n\n# class QtBoxStyleLCDNumber3(QLCDNumber):\n#     def __init__(self):\n#         super(QtBoxStyleLCDNumber3, self).__init__()\n#         self.setFixedSize(150, 50)\n#         self.setDigitCount(6)\n#         self.display(123456)\n#         self.setSegmentStyle(QLCDNumber.Flat)\n#         self.setStyleSheet(\"\"\"\n#         QLCDNumber {\n#             background-color: transparent;\n#             border: none;\n#             color: black;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELCDNUMBER4_H\n# #define QTBOXSTYLELCDNUMBER4_H\n# #include <QLCDNumber>\n\n# class QtBoxStyleLCDNumber4 : public QLCDNumber\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLCDNumber4(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLELCDNUMBER4_H\n\n\n\n# #include \"qtboxstylelcdnumber4.h\"\n\n# QtBoxStyleLCDNumber4::QtBoxStyleLCDNumber4(QWidget *parent)\n#     : QLCDNumber(parent)\n# {\n#     setFixedSize(150, 50);\n#     setDigitCount(6);\n#     display(123456);\n#     setSegmentStyle(QLCDNumber::Flat);\n#     setStyleSheet(R\"(\n#     QLCDNumber {\n#         background-color: transparent;\n#         border: none;\n#         color: black;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lcdnumber/style/demo5.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QLCDNumber\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLCDNumber = createWidgetMenuBase(QLCDNumber)\n\nclass QtBoxStyleLCDNumber5(QLCDNumber):\n    def __init__(self):\n        super(QtBoxStyleLCDNumber5, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 50)\n        self.setDigitCount(6)\n        self.display(123456)\n        self.setSegmentStyle(QLCDNumber.Flat)\n        self.setStyleSheet(\"\"\"\n        QLCDNumber {\n            background-color: black;\n            border: none;\n            color: red;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QLCDNumber\n\n\n# class QtBoxStyleLCDNumber3(QLCDNumber):\n#     def __init__(self):\n#         super(QtBoxStyleLCDNumber3, self).__init__()\n#         self.setFixedSize(150, 50)\n#         self.setDigitCount(6)\n#         self.display(123456)\n#         self.setSegmentStyle(QLCDNumber.Flat)\n#         self.setStyleSheet(\"\"\"\n#         QLCDNumber {\n#             background-color: black;\n#             border: none;\n#             color: red;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELCDNUMBER5_H\n# #define QTBOXSTYLELCDNUMBER5_H\n# #include <QLCDNumber>\n\n# class QtBoxStyleLCDNumber5 : public QLCDNumber\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLCDNumber5(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLELCDNUMBER5_H\n\n\n\n# #include \"qtboxstylelcdnumber5.h\"\n\n# QtBoxStyleLCDNumber5::QtBoxStyleLCDNumber5(QWidget *parent)\n#     : QLCDNumber(parent)\n# {\n#     setFixedSize(150, 50);\n#     setDigitCount(6);\n#     display(123456);\n#     setSegmentStyle(QLCDNumber::Flat);\n#     setStyleSheet(R\"(\n#     QLCDNumber {\n#         background-color: black;\n#         border: none;\n#         color: red;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lineedit/__init__.py",
    "content": "from .func import demo1, demo2, demo3, demo4, demo5\nfrom .style import demo1, demo2, demo3, demo4, demo5, demo6, demo7"
  },
  {
    "path": "src/qtbox/demo/lineedit/func/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/lineedit/func/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QLineEdit, QMessageBox\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLineEdit = createWidgetMenuBase(QLineEdit)\n\nclass QtBoxFuncLineEdit1(QLineEdit):\n    def __init__(self):\n        super(QtBoxFuncLineEdit1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 30)\n        self.setPlaceholderText(\"press Enter or Return\")\n\n    def keyPressEvent(self, event):\n        super(QtBoxFuncLineEdit1, self).keyPressEvent(event)\n        if event.key() == Qt.Key_Enter or event.key() == Qt.Key_Return:\n            QMessageBox.information(self, \"Qt Box\", \"Key Enter or Return pressed\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QLineEdit, QMessageBox\n\n\n# class QtBoxFuncLineEdit1(QLineEdit):\n#     def __init__(self):\n#         super(QtBoxFuncLineEdit1, self).__init__()\n#         self.setFixedSize(150, 30)\n#         self.setPlaceholderText(\"press Enter or Return\")\n\n#     def keyPressEvent(self, event):\n#         super(QtBoxFuncLineEdit1, self).keyPressEvent(event)\n#         if event.key() == Qt.Key_Enter or event.key() == Qt.Key_Return:\n#             QMessageBox.information(self, \"Qt Box\", \"Key Enter or Return pressed\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLINEEDIT1_H\n# #define QTBOXFUNCLINEEDIT1_H\n# #include <QLineEdit>\n# #include <QKeyEvent>\n\n# class QtBoxFuncLineEdit1 : public QLineEdit\n# {\n#     Q_OBJECT\n\n# protected:\n#     void keyPressEvent(QKeyEvent *event);\n\n# public:\n#     QtBoxFuncLineEdit1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXFUNCLINEEDIT1_H\n\n\n\n# #include \"qtboxfunclineedit1.h\"\n# #include <QMessageBox>\n# #include <Qt>\n\n# QtBoxFuncLineEdit1::QtBoxFuncLineEdit1(QWidget *parent)\n#     : QLineEdit(parent)\n# {\n#     setFixedSize(150, 30);\n#     setPlaceholderText(\"press Enter or Return\");\n# }\n\n# void QtBoxFuncLineEdit1::keyPressEvent(QKeyEvent *event)\n# {\n#     QLineEdit::keyPressEvent(event);\n#     if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {\n#         QMessageBox::information(this, \"Qt Box\", \"Key Enter or Return pressed\");\n#     }\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lineedit/func/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtGui import QRegExpValidator\nfrom PyQt5.QtWidgets import QLineEdit\nfrom PyQt5.QtCore import QRegExp\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLineEdit = createWidgetMenuBase(QLineEdit)\n\nclass QtBoxFuncLineEdit2(QLineEdit):\n    def __init__(self):\n        super(QtBoxFuncLineEdit2, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 30)\n        self.setPlaceholderText(\"Numbers only\")\n\n        reg_exp = QRegExp(\"[0-9]+\")\n        self.setValidator(QRegExpValidator(reg_exp))\n# PyQt\n\n# PySide\n# from PySide2.QtGui import QRegExpValidator\n# from PySide2.QtWidgets import QLineEdit\n# from PySide2.QtCore import QRegExp\n\n\n# class QtBoxFuncLineEdit2(QLineEdit):\n#     def __init__(self):\n#         super(QtBoxFuncLineEdit2, self).__init__()\n#         self.setFixedSize(150, 30)\n#         self.setPlaceholderText(\"Numbers only\")\n\n#         reg_exp = QRegExp(\"[0-9]+\")\n#         self.setValidator(QRegExpValidator(reg_exp))\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLINEEDIT2_H\n# #define QTBOXFUNCLINEEDIT2_H\n# #include <QLineEdit>\n\n# class QtBoxFuncLineEdit2 : public QLineEdit\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncLineEdit2(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXFUNCLINEEDIT2_H\n\n\n\n# #include \"qtboxfunclineedit2.h\"\n# #include <QRegularExpressionValidator>\n# #include <QRegularExpression>\n\n# QtBoxFuncLineEdit2::QtBoxFuncLineEdit2(QWidget *parent)\n#     : QLineEdit(parent)\n# {\n#     setFixedSize(150, 30);\n#     setPlaceholderText(\"Numbers Only\");\n#\n#     QRegularExpression regExp = QRegularExpression(\"[0-9]+\");\n#     setValidator(new QRegularExpressionValidator(regExp));\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lineedit/func/demo3.py",
    "content": "# PyQt\nfrom PyQt5.QtGui import QRegExpValidator, QValidator\nfrom PyQt5.QtWidgets import QLineEdit, QMessageBox\nfrom PyQt5.QtCore import QRegExp, Qt\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLineEdit = createWidgetMenuBase(QLineEdit)\n\nclass QtBoxFuncLineEdit3(QLineEdit):\n    def __init__(self):\n        super(QtBoxFuncLineEdit3, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 30)\n        self.setPlaceholderText(\"example@email.com\")\n\n        reg_exp = QRegExp(\"[a-zA-Z0-9-_]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\\\.)+[a-z]{2,}$\")\n        self.setValidator(QRegExpValidator(reg_exp))\n\n    def validate_email(self):\n        if self.validator().validate(self.text(), 0)[0] == QValidator.Acceptable:\n            QMessageBox.information(self, \"Qt Box\", \"Correct email format\")\n        else:\n            QMessageBox.information(self, \"Qt Box\", \"Wrong email format\")\n\n    def keyPressEvent(self, event):\n        super(QtBoxFuncLineEdit3, self).keyPressEvent(event)\n        if event.key() == Qt.Key_Enter or event.key() == Qt.Key_Return:\n            self.validate_email()\n# PyQt\n\n# PySide\n# from PySide2.QtGui import QRegExpValidator, QValidator\n# from PySide2.QtWidgets import QLineEdit, QMessageBox\n# from PySide2.QtCore import QRegExp, Qt\n\n\n# class QtBoxFuncLineEdit3(QLineEdit):\n#     def __init__(self):\n#         super(QtBoxFuncLineEdit3, self).__init__()\n#         self.setFixedSize(150, 30)\n#         self.setPlaceholderText(\"example@email.com\")\n\n#         reg_exp = QRegExp(\"[a-zA-Z0-9-_]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\\\.)+[a-z]{2,}$\")\n#         self.setValidator(QRegExpValidator(reg_exp))\n\n#     def validate_email(self):\n#         if self.validator().validate(self.text(), 0)[0] == QValidator.Acceptable:\n#             QMessageBox.information(self, \"Qt Box\", \"Correct email format\")\n#         else:\n#             QMessageBox.information(self, \"Qt Box\", \"Wrong email format\")\n\n#     def keyPressEvent(self, event):\n#         super(QtBoxFuncLineEdit3, self).keyPressEvent(event)\n#         if event.key() == Qt.Key_Enter or event.key() == Qt.Key_Return:\n#             self.validate_email()\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLINEEDIT3_H\n# #define QTBOXFUNCLINEEDIT3_H\n# #include <QLineEdit>\n# #include <QKeyEvent>\n\n# class QtBoxFuncLineEdit3 : public QLineEdit\n# {\n#     Q_OBJECT\n\n# protected:\n#     void keyPressEvent(QKeyEvent *event);\n\n# public:\n#     QtBoxFuncLineEdit3(QWidget *parent = nullptr);\n\n# private:\n#     void validateEmail();\n# };\n# #endif // QTBOXFUNCLINEEDIT3_H\n\n\n\n# #include \"qtboxfunclineedit3.h\"\n# #include <QRegularExpressionValidator>\n# #include <QRegularExpression>\n# #include <QMessageBox>\n# #include <QValidator>\n# #include <Qt>\n\n# QtBoxFuncLineEdit3::QtBoxFuncLineEdit3(QWidget *parent)\n#     : QLineEdit(parent)\n# {\n#     setFixedSize(150, 30);\n#     setPlaceholderText(\"example@email.com\");\n\n#     QRegularExpression regExp = QRegularExpression(\"[a-zA-Z0-9-_]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\\\.)+[a-z]{2,}$\");\n#     setValidator(new QRegularExpressionValidator(regExp));\n# }\n\n# void QtBoxFuncLineEdit3::validateEmail() {\n#     QString textToValidate = text();\n#     int pos = 0;\n#     if (validator()->validate(textToValidate, pos) == QValidator::Acceptable) {\n#         QMessageBox::information(this, \"Qt Box\", \"Correct email format\");\n#     }\n#     else {\n#         QMessageBox::information(this, \"Qt Box\", \"Wrong email format\");\n#     }\n# }\n\n# void QtBoxFuncLineEdit3::keyPressEvent(QKeyEvent *event)\n# {\n#     QLineEdit::keyPressEvent(event);\n#     if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {\n#         validateEmail();\n#     }\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lineedit/func/demo4.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtGui import QIcon\nfrom PyQt5.QtWidgets import QLineEdit, QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLineEdit = createWidgetMenuBase(QLineEdit)\nPATH_TO_OPEN_EYE_IMG = str(Path(__file__).parent.parent.parent.parent / \"res/images/open_eye.png\").replace(\"\\\\\", \"/\")\nPATH_TO_CLOSED_EYE_IMG = str(Path(__file__).parent.parent.parent.parent / \"res/images/closed_eye.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxFuncLineEdit4(QLineEdit):\n    def __init__(self):\n        super(QtBoxFuncLineEdit4, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 30)\n        self.setEchoMode(QLineEdit.Password)\n        self.setPlaceholderText(\"Enter password\")\n        self.setStyleSheet(\"\"\"\n        QLineEdit {\n            padding-right: 25px;\n        }\n        \"\"\")\n\n        self.eye_btn = QPushButton(self)\n        self.eye_btn.setIcon(QIcon(PATH_TO_CLOSED_EYE_IMG))\n        self.eye_btn.setFixedSize(self.height(), self.height())\n        self.eye_btn.move(self.width()-self.eye_btn.width(), 0)\n        self.eye_btn.clicked.connect(self.change_echo_mode)\n        self.eye_btn.setCursor(Qt.PointingHandCursor)\n        self.eye_btn.setStyleSheet(\"\"\"\n        QPushButton {\n            border: none;\n        }\n        \"\"\")\n\n    def change_echo_mode(self):\n        if self.echoMode() == QLineEdit.Normal:\n            self.setEchoMode(QLineEdit.Password)\n            self.eye_btn.setIcon(QIcon(PATH_TO_CLOSED_EYE_IMG))\n        else:\n            self.setEchoMode(QLineEdit.Normal)\n            self.eye_btn.setIcon(QIcon(PATH_TO_OPEN_EYE_IMG))\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtGui import QIcon\n# from PySide2.QtWidgets import QLineEdit, QPushButton\n\n\n# class QtBoxFuncLineEdit4(QLineEdit):\n#     def __init__(self):\n#         super(QtBoxFuncLineEdit4, self).__init__(str(Path(__file__)))\n#         self.setFixedSize(150, 30)\n#         self.setEchoMode(QLineEdit.Password)\n#         self.setPlaceholderText(\"Enter password\")\n#         self.setStyleSheet(\"\"\"\n#         QLineEdit {\n#             padding-right: 25px;\n#         }\n#         \"\"\")\n\n#         self.eye_btn = QPushButton(self)\n#         self.eye_btn.setIcon(QIcon(PATH_TO_CLOSED_EYE_IMG))\n#         self.eye_btn.setFixedSize(self.height(), self.height())\n#         self.eye_btn.move(self.width()-self.eye_btn.width(), 0)\n#         self.eye_btn.clicked.connect(self.change_echo_mode)\n#         self.eye_btn.setCursor(Qt.PointingHandCursor)\n#         self.eye_btn.setStyleSheet(\"\"\"\n#         QPushButton {\n#             border: none;\n#         }\n#         \"\"\")\n\n#     def change_echo_mode(self):\n#         if self.echoMode() == QLineEdit.Normal:\n#             self.setEchoMode(QLineEdit.Password)\n#             self.eye_btn.setIcon(QIcon(PATH_TO_CLOSED_EYE_IMG))\n#         else:\n#             self.setEchoMode(QLineEdit.Normal)\n#             self.eye_btn.setIcon(QIcon(PATH_TO_OPEN_EYE_IMG))\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLINEEDIT4_H\n# #define QTBOXFUNCLINEEDIT4_H\n# #include <QLineEdit>\n# #include <QPushButton>\n\n# class QtBoxFuncLineEdit4 : public QLineEdit\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncLineEdit4(QWidget *parent = nullptr);\n\n# private:\n#     QPushButton *eyeBtn = new QPushButton(this);\n\n# private slots:\n#     void changeEchoMode();\n# };\n# #endif // QTBOXFUNCLINEEDIT4_H\n\n\n\n# #include \"qtboxfunclineedit4.h\"\n# #include <QIcon>\n# #include <Qt>\n\n# QtBoxFuncLineEdit4::QtBoxFuncLineEdit4(QWidget *parent)\n#     : QLineEdit(parent)\n# {\n#     setFixedSize(150, 30);\n#     setEchoMode(QLineEdit::Password);\n#     setPlaceholderText(\"Enter password\");\n#     setStyleSheet(\"QLineEdit {padding-right: 25px;}\");\n\n#     eyeBtn->setIcon(QIcon(PATH_TO_CLOSED_EYE_IMG));\n#     eyeBtn->setFixedSize(height(), height());\n#     eyeBtn->move(width()-eyeBtn->width(), 0);\n#     connect(eyeBtn, SIGNAL(clicked()), this, SLOT(changeEchoMode()));\n#     eyeBtn->setCursor(Qt::PointingHandCursor);\n#     eyeBtn->setStyleSheet(\"QPushButton {border: none;}\");\n# }\n\n# void QtBoxFuncLineEdit4::changeEchoMode()\n# {\n#     if (echoMode() == QLineEdit::Normal) {\n#         setEchoMode(QLineEdit::Password);\n#         eyeBtn->setIcon(QIcon(PATH_TO_CLOSED_EYE_IMG));\n#     }\n#     else {\n#         setEchoMode(QLineEdit::Normal);\n#         eyeBtn->setIcon(QIcon(PATH_TO_OPEN_EYE_IMG));\n#     }\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lineedit/func/demo5.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QLineEdit, QCompleter\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLineEdit = createWidgetMenuBase(QLineEdit)\n\nclass QtBoxFuncLineEdit5(QLineEdit):\n    def __init__(self):\n        super(QtBoxFuncLineEdit5, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 30)\n        self.setPlaceholderText(\"Type P or Q\")\n\n        comp = QCompleter([\"PyQt\", \"Qt\", \"Qt Box\", \"PySide\", \"Python\"])\n        comp.setFilterMode(Qt.MatchContains)\n        self.setCompleter(comp)\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QLineEdit, QCompleter\n\n\n# class QtBoxFuncLineEdit5(QLineEdit):\n#     def __init__(self):\n#         super(QtBoxFuncLineEdit5, self).__init__()\n#         self.setFixedSize(150, 30)\n#         self.setPlaceholderText(\"Type P or Q\")\n\n#         comp = QCompleter([\"PyQt\", \"Qt\", \"Qt Box\", \"PySide\", \"Python\"])\n#         comp.setFilterMode(Qt.MatchContains)\n#         self.setCompleter(comp)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLINEEDIT5_H\n# #define QTBOXFUNCLINEEDIT5_H\n# #include <QLineEdit>\n\n# class QtBoxFuncLineEdit5 : public QLineEdit\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncLineEdit5(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXFUNCLINEEDIT5_H\n\n\n\n# #include \"qtboxfunclineedit5.h\"\n# #include <QCompleter>\n# #include <Qt>\n\n# QtBoxFuncLineEdit5::QtBoxFuncLineEdit5(QWidget *parent)\n#     : QLineEdit(parent)\n# {\n#     setFixedSize(150, 30);\n#     setPlaceholderText(\"Type P or Q\");\n\n#     QCompleter *comp = new QCompleter({\"PyQt\", \"Qt\", \"Qt Box\", \"PySide\", \"Python\"});\n#     comp->setFilterMode(Qt::MatchContains);\n#     setCompleter(comp);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lineedit/style/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/lineedit/style/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtGui import QIcon\nfrom PyQt5.QtWidgets import QLineEdit, QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLineEdit = createWidgetMenuBase(QLineEdit)\nPATH_TO_IMG = str(Path(__file__).parent.parent.parent.parent / \"res/images/search.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleLineEdit1(QLineEdit):\n    def __init__(self):\n        super(QtBoxStyleLineEdit1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 30)\n        self.setPlaceholderText(\"search\")\n\n        self.search_btn = QPushButton(self)\n        self.search_btn.setIcon(QIcon(PATH_TO_IMG))\n        self.search_btn.setCursor(Qt.PointingHandCursor)\n        self.search_btn.setFixedSize(self.height(), self.height())\n        self.search_btn.move(self.width()-self.search_btn.width(), 0)\n\n        self.setStyleSheet(\"\"\"\n        QPushButton {\n            border: none;\n        }\n\n        QLineEdit {\n            background-color: #232324;\n            border: 1px solid gray;\n            border-radius: 3px;\n            padding-left: 2px;\n            padding-right: 25px;\n            color: #f0f0f0;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtGui import QIcon\n# from PySide2.QtWidgets import QLineEdit, QPushButton\n\n\n# class QtBoxStyleLineEdit1(QLineEdit):\n#     def __init__(self):\n#         super(QtBoxStyleLineEdit1, self).__init__()\n#         self.setFixedSize(150, 30)\n#         self.setPlaceholderText(\"search\")\n\n#         self.search_btn = QPushButton(self)\n#         self.search_btn.setIcon(QIcon(PATH_TO_IMG))\n#         self.search_btn.setCursor(Qt.PointingHandCursor)\n#         self.search_btn.setFixedSize(self.height(), self.height())\n#         self.search_btn.move(self.width()-self.search_btn.width(), 0)\n\n#         self.setStyleSheet(\"\"\"\n#         QPushButton {\n#             border: none;\n#         }\n\n#         QLineEdit {\n#             background-color: #232324;\n#             border: 1px solid gray;\n#             border-radius: 3px;\n#             padding-left: 2px;\n#             padding-right: 25px;\n#             color: #f0f0f0;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELINEEDIT1_H\n# #define QTBOXSTYLELINEEDIT1_H\n# #include <QLineEdit>\n# #include <QPushButton>\n\n# class QtBoxStyleLineEdit1 : public QLineEdit\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLineEdit1(QWidget *parent = nullptr);\n\n# private:\n#     QPushButton *searchBtn = new QPushButton(this);\n# };\n# #endif // QTBOXSTYLELINEEDIT1_H\n\n\n\n# #include \"qtboxstylelineedit1.h\"\n# #include <QIcon>\n\n# QtBoxStyleLineEdit1::QtBoxStyleLineEdit1(QWidget *parent)\n#     : QLineEdit(parent)\n# {\n#     setFixedSize(150, 30);\n#     setPlaceholderText(\"search\");\n\n#     searchBtn->setIcon(QIcon(\":res/images/search.png\"));\n#     searchBtn->setCursor(Qt::PointingHandCursor);\n#     searchBtn->setFixedSize(height(), height());\n#     searchBtn->move(width()-searchBtn->width(), 0);\n\n#     setStyleSheet(R\"(\n#     QPushButton {\n#         border: none;\n#     }\n\n#     QLineEdit {\n#         background-color: #232324;\n#         border: 1px solid gray;\n#         border-radius: 3px;\n#         padding-left: 2px;\n#         padding-right: 25px;\n#         color: #f0f0f0;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lineedit/style/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QLineEdit, QLabel\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLineEdit = createWidgetMenuBase(QLineEdit)\n\nclass QtBoxStyleLineEdit2(QLineEdit):\n    def __init__(self):\n        super(QtBoxStyleLineEdit2, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 50)\n        self.setStyleSheet(\"\"\"\n        QLineEdit {\n            border: 1px solid gray;\n            border-radius: 5px;\n            padding-top: 14px;\n            padding-left: 2px;\n            padding-right: 2px;\n        }\n        \"\"\")\n\n        self.label = QLabel(self)\n        self.label.setText(\"Name\")\n        self.label.move(5, 16)\n        self.label.setStyleSheet(\"\"\"\n        QLabel {\n            color: gray;\n            font-size: 16px;\n        }\n        \"\"\")\n\n    def focusInEvent(self, event):\n        super(QtBoxStyleLineEdit2, self).focusInEvent(event)\n        self.label.move(5, 5)\n        self.label.setStyleSheet(\"\"\"\n        QLabel {\n            color: black;\n            font-size: 12px;\n        }\n        \"\"\")\n\n    def focusOutEvent(self, event):\n        super(QtBoxStyleLineEdit2, self).focusOutEvent(event)\n        if self.text():\n            return\n\n        self.label.move(5, 16)\n        self.label.setStyleSheet(\"\"\"\n        QLabel {\n            color: gray;\n            font-size: 16px;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QLineEdit, QLabel\n\n\n# class QtBoxStyleLineEdit2(QLineEdit):\n#     def __init__(self):\n#         super(QtBoxStyleLineEdit2, self).__init__()\n#         self.setFixedSize(150, 50)\n#         self.setStyleSheet(\"\"\"\n#         QLineEdit {\n#             border: 1px solid gray;\n#             border-radius: 5px;\n#             padding-top: 14px;\n#             padding-left: 2px;\n#             padding-right: 2px;\n#         }\n#         \"\"\")\n\n#         self.label = QLabel(self)\n#         self.label.setText(\"Name\")\n#         self.label.move(5, 16)\n#         self.label.setStyleSheet(\"\"\"\n#         QLabel {\n#             color: gray;\n#             font-size: 16px;\n#         }\n#         \"\"\")\n\n#     def focusInEvent(self, event):\n#         super(QtBoxStyleLineEdit2, self).focusInEvent(event)\n#         self.label.move(5, 5)\n#         self.label.setStyleSheet(\"\"\"\n#         QLabel {\n#             color: black;\n#             font-size: 12px;\n#         }\n#         \"\"\")\n\n#     def focusOutEvent(self, event):\n#         super(QtBoxStyleLineEdit2, self).focusOutEvent(event)\n#         if self.text():\n#             return\n\n#         self.label.move(5, 16)\n#         self.label.setStyleSheet(\"\"\"\n#         QLabel {\n#             color: gray;\n#             font-size: 16px;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELINEEDIT2_H\n# #define QTBOXSTYLELINEEDIT2_H\n# #include <QLineEdit>\n# #include <QFocusEvent>\n# #include <QLabel>\n\n# class QtBoxStyleLineEdit2 : public QLineEdit\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLineEdit2(QWidget *parent = nullptr);\n\n# protected:\n#     void focusInEvent(QFocusEvent *event);\n#     void focusOutEvent(QFocusEvent *event);\n\n# private:\n#     QLabel *label = new QLabel(this);\n# };\n# #endif // QTBOXSTYLELINEEDIT2_H\n\n\n\n# #include \"qtboxstylelineedit2.h\"\n# #include <QIcon>\n\n# QtBoxStyleLineEdit2::QtBoxStyleLineEdit2(QWidget *parent)\n#     : QLineEdit(parent)\n# {\n#     setFixedSize(150, 50);\n#     setStyleSheet(R\"(\n#     QLineEdit {\n#         border: 1px solid gray;\n#         border-radius: 5px;\n#         padding-top: 14px;\n#         padding-left: 2px;\n#         padding-right: 2px;\n#     }\n#     )\");\n\n#     label->setText(\"Name\");\n#     label->move(5, 16);\n#     label->setStyleSheet(R\"(\n#     QLabel {\n#         color: gray;\n#         font-size: 16px;\n#     }\n#     )\");\n# }\n\n# void QtBoxStyleLineEdit2::focusInEvent(QFocusEvent *event)\n# {\n#     QLineEdit::focusInEvent(event);\n#     label->move(5, 5);\n#     label->setStyleSheet(R\"(\n#     QLabel {\n#         color: black;\n#         font-size: 12px;\n#     }\n#     )\");\n# }\n\n# void QtBoxStyleLineEdit2::focusOutEvent(QFocusEvent *event)\n# {\n#     QLineEdit::focusOutEvent(event);\n#     if (!text().isEmpty()) {\n#         return;\n#     }\n\n#     label->move(5, 16);\n#     label->setStyleSheet(R\"(\n#     QLabel {\n#         color: gray;\n#         font-size: 16px;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lineedit/style/demo3.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QLineEdit, QLabel\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLineEdit = createWidgetMenuBase(QLineEdit)\n\nclass QtBoxStyleLineEdit3(QLineEdit):\n    def __init__(self):\n        super(QtBoxStyleLineEdit3, self).__init__(str(Path(__file__)))\n        self.setAttribute(Qt.WA_MacShowFocusRect, False)\n        self.setPlaceholderText(\"Enter username\")\n        self.setFixedSize(180, 30)\n        self.setStyleSheet(\"\"\"\n        QLineEdit {\n            border: 1px solid lightgray;\n            border-radius: 5px;\n            border-top-left-radius: 10px;\n            border-bottom-left-radius: 10px;\n            padding-left: 62px;\n            padding-right: 5px;\n        }\n        \"\"\")\n\n        self.label = QLabel(self)\n        self.label.setText(\"Qt Box\")\n        self.label.setFixedSize(60, 30)\n        self.label.move(0, 0)\n        self.label.setStyleSheet(\"\"\"\n        QLabel {\n            background-color: #f8f9fb;\n            color: black; \n            font-size: 15px;\n            padding-left: 3px;\n            border: 1px solid lightgray;\n            border-top-left-radius: 10px;\n            border-bottom-left-radius: 10px;\n        }\n        \n        QLabel:hover {\n            background-color: #ebecf0;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QLineEdit, QLabel\n\n\n# class QtBoxStyleLineEdit3(QLineEdit):\n#     def __init__(self):\n#         super(QtBoxStyleLineEdit3, self).__init__()\n#         self.setAttribute(Qt.WA_MacShowFocusRect, False)\n#         self.setPlaceholderText(\"Enter username\")\n#         self.setFixedSize(180, 30)\n#         self.setStyleSheet(\"\"\"\n#         QLineEdit {\n#             border: 1px solid lightgray;\n#             border-radius: 5px;\n#             border-top-left-radius: 10px;\n#             border-bottom-left-radius: 10px;\n#             padding-left: 62px;\n#             padding-right: 5px;\n#         }\n#         \"\"\")\n\n#         self.label = QLabel(self)\n#         self.label.setText(\"Qt Box\")\n#         self.label.setFixedSize(60, 30)\n#         self.label.move(0, 0)\n#         self.label.setStyleSheet(\"\"\"\n#         QLabel {\n#             background-color: #f8f9fb;\n#             color: black;\n#             font-size: 15px;\n#             padding-left: 3px;\n#             border: 1px solid lightgray;\n#             border-top-left-radius: 10px;\n#             border-bottom-left-radius: 10px;\n#         }\n\n#         QLabel:hover {\n#             background-color: #ebecf0;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELINEEDIT3_H\n# #define QTBOXSTYLELINEEDIT3_H\n# #include <QLineEdit>\n# #include <QLabel>\n\n# class QtBoxStyleLineEdit3 : public QLineEdit\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLineEdit3(QWidget *parent = nullptr);\n\n# private:\n#     QLabel *label = new QLabel(this);\n# };\n# #endif // QTBOXSTYLELINEEDIT3_H\n\n\n\n# #include \"qtboxstylelineedit3.h\"\n\n# QtBoxStyleLineEdit3::QtBoxStyleLineEdit3(QWidget *parent)\n#     : QLineEdit(parent)\n# {\n#     setAttribute(Qt::WA_MacShowFocusRect, false);\n#     setPlaceholderText(\"Enter username\");\n#     setFixedSize(180, 30);\n#     setStyleSheet(R\"(\n#     QLineEdit {\n#         border: 1px solid lightgray;\n#         border-radius: 5px;\n#         border-top-left-radius: 10px;\n#         border-bottom-left-radius: 10px;\n#         padding-left: 62px;\n#         padding-right: 5px;\n#     }\n#     )\");\n\n#     label->setText(\"Qt Box\");\n#     label->setFixedSize(60, 30);\n#     label->move(0, 0);\n#     label->setStyleSheet(R\"(\n#     QLabel {\n#         background-color: #f8f9fb;\n#         color: black;\n#         font-size: 15px;\n#         padding-left: 3px;\n#         border: 1px solid lightgray;\n#         border-top-left-radius: 10px;\n#         border-bottom-left-radius: 10px;\n#     }\n\n#     QLabel:hover {\n#         background-color: #ebecf0;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lineedit/style/demo4.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QLineEdit, QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLineEdit = createWidgetMenuBase(QLineEdit)\n\nclass QtBoxStyleLineEdit4(QLineEdit):\n    def __init__(self):\n        super(QtBoxStyleLineEdit4, self).__init__(str(Path(__file__)))\n        self.setAttribute(Qt.WA_MacShowFocusRect, False)\n        self.setPlaceholderText(\"search\")\n        self.setFixedSize(180, 30)\n        self.setStyleSheet(\"\"\"\n        QLineEdit {\n            border: 1px solid lightgray;\n            border-radius: 5px;\n            padding-left: 5px;\n            padding-right: 60px;\n        }\n        \"\"\")\n\n        self.search_btn = QPushButton(self)\n        self.search_btn.setText(\"Search\")\n        self.search_btn.setFixedSize(60, self.height())\n        self.search_btn.setCursor(Qt.PointingHandCursor)\n        self.search_btn.move(self.width()-self.search_btn.width(), 0)\n        self.search_btn.setStyleSheet(\"\"\"\n        QPushButton {\n            background-color: #2a70f4;\n            color: white; \n            font-size: 13px;\n            border-top-right-radius: 5px;\n            border-bottom-right-radius: 5px;\n        }\n\n        QPushButton:hover {\n            background-color: #2361d0;\n        }\n        \n        QPushButton:pressed {\n            background-color: #2058bc;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QLineEdit, QPushButton\n\n\n# class QtBoxStyleLineEdit4(QLineEdit):\n#     def __init__(self):\n#         super(QtBoxStyleLineEdit4, self).__init__()\n#         self.setAttribute(Qt.WA_MacShowFocusRect, False)\n#         self.setPlaceholderText(\"search\")\n#         self.setFixedSize(180, 30)\n#         self.setStyleSheet(\"\"\"\n#         QLineEdit {\n#             border: 1px solid lightgray;\n#             border-radius: 5px;\n#             padding-left: 5px;\n#             padding-right: 60px;\n#         }\n#         \"\"\")\n\n#         self.search_btn = QPushButton(self)\n#         self.search_btn.setText(\"Search\")\n#         self.search_btn.setFixedSize(60, self.height())\n#         self.search_btn.setCursor(Qt.PointingHandCursor)\n#         self.search_btn.move(self.width()-self.search_btn.width(), 0)\n#         self.search_btn.setStyleSheet(\"\"\"\n#         QPushButton {\n#             background-color: #2a70f4;\n#             color: white;\n#             font-size: 13px;\n#             border-top-right-radius: 5px;\n#             border-bottom-right-radius: 5px;\n#         }\n\n#         QPushButton:hover {\n#             background-color: #2361d0;\n#         }\n\n#         QPushButton:pressed {\n#             background-color: #2058bc;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELINEEDIT4_H\n# #define QTBOXSTYLELINEEDIT4_H\n# #include <QLineEdit>\n# #include <QPushButton>\n\n# class QtBoxStyleLineEdit4 : public QLineEdit\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLineEdit4(QWidget *parent = nullptr);\n\n# private:\n#     QPushButton *searchBtn = new QPushButton(this);\n# };\n# #endif // QTBOXSTYLELINEEDIT4_H\n\n\n\n# #include \"qtboxstylelineedit4.h\"\n\n# QtBoxStyleLineEdit4::QtBoxStyleLineEdit4(QWidget *parent)\n#     : QLineEdit(parent)\n# {\n#     setAttribute(Qt::WA_MacShowFocusRect, false);\n#     setPlaceholderText(\"search\");\n#     setFixedSize(180, 30);\n#     setStyleSheet(R\"(\n#     QLineEdit {\n#         border: 1px solid lightgray;\n#         border-radius: 5px;\n#         padding-left: 5px;\n#         padding-right: 60px;\n#     }\n#     )\");\n\n#     searchBtn->setText(\"Search\");\n#     searchBtn->setFixedSize(60, height());\n#     searchBtn->setCursor(Qt::PointingHandCursor);\n#     searchBtn->move(width()-searchBtn->width(), 0);\n#     searchBtn->setStyleSheet(R\"(\n#     QPushButton {\n#         background-color: #2a70f4;\n#         color: white;\n#         font-size: 13px;\n#         border-top-right-radius: 5px;\n#         border-bottom-right-radius: 5px;\n#     }\n\n#     QPushButton:hover {\n#         background-color: #2361d0;\n#     }\n\n#     QPushButton:pressed {\n#         background-color: #2058bc;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lineedit/style/demo5.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QLineEdit, QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLineEdit = createWidgetMenuBase(QLineEdit)\n\nclass QtBoxStyleLineEdit5(QLineEdit):\n    def __init__(self):\n        super(QtBoxStyleLineEdit5, self).__init__(str(Path(__file__)))\n        self.setAttribute(Qt.WA_MacShowFocusRect, False)\n        self.setPlaceholderText(\"Enter username\")\n        self.setFixedSize(150, 30)\n        self.setStyleSheet(\"\"\"\n        QLineEdit {\n            border-top: none;\n            border-left: none;\n            border-right: none;\n            border-bottom: 1px solid black;\n            background-color: transparent;\n        }\n        \n        QLineEdit:focus {\n            border-bottom: 1px solid #2a70f4;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QLineEdit, QPushButton\n\n\n# class QtBoxStyleLineEdit5(QLineEdit):\n#     def __init__(self):\n#         super(QtBoxStyleLineEdit5, self).__init__()\n#         self.setAttribute(Qt.WA_MacShowFocusRect, False)\n#         self.setPlaceholderText(\"Enter username\")\n#         self.setFixedSize(150, 30)\n#         self.setStyleSheet(\"\"\"\n#         QLineEdit {\n#             border-top: none;\n#             border-left: none;\n#             border-right: none;\n#             border-bottom: 1px solid black;\n#             background-color: transparent;\n#         }\n\n#         QLineEdit:focus {\n#             border-bottom: 1px solid #2a70f4;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELINEEDIT5_H\n# #define QTBOXSTYLELINEEDIT5_H\n# #include <QLineEdit>\n\n# class QtBoxStyleLineEdit5 : public QLineEdit\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLineEdit5(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLELINEEDIT5_H\n\n\n\n# #include \"qtboxstylelineedit5.h\"\n\n# QtBoxStyleLineEdit5::QtBoxStyleLineEdit5(QWidget *parent)\n#     : QLineEdit(parent)\n# {\n#     setAttribute(Qt::WA_MacShowFocusRect, false);\n#     setPlaceholderText(\"Enter username\");\n#     setFixedSize(150, 30);\n#     setStyleSheet(R\"(\n#     QLineEdit {\n#         border-top: none;\n#         border-left: none;\n#         border-right: none;\n#         border-bottom: 1px solid black;\n#         background-color: transparent;\n#     }\n\n#     QLineEdit:focus {\n#         border-bottom: 1px solid #2a70f4;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lineedit/style/demo6.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QLineEdit\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLineEdit = createWidgetMenuBase(QLineEdit)\n\nclass QtBoxStyleLineEdit6(QLineEdit):\n    def __init__(self):\n        super(QtBoxStyleLineEdit6, self).__init__(str(Path(__file__)))\n        self.setMaxLength(1)\n        self.setFixedSize(50, 50)\n        self.setAlignment(Qt.AlignCenter)\n        self.setStyleSheet(\"\"\"\n        QLineEdit {\n            font-size: 25px;\n            border: 2px solid black;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QLineEdit\n\n\n# class QtBoxStyleLineEdit6(QLineEdit):\n#     def __init__(self):\n#         super(QtBoxStyleLineEdit6, self).__init__()\n#         self.setMaxLength(1)\n#         self.setFixedSize(50, 50)\n#         self.setAlignment(Qt.AlignCenter)\n#         self.setStyleSheet(\"\"\"\n#         QLineEdit {\n#             font-size: 25px;\n#             border: 2px solid black;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELINEEDIT6_H\n# #define QTBOXSTYLELINEEDIT6_H\n# #include <QLineEdit>\n\n# class QtBoxStyleLineEdit6 : public QLineEdit\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLineEdit6(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLELINEEDIT6_H\n\n\n\n# #include \"qtboxstylelineedit6.h\"\n\n# QtBoxStyleLineEdit6::QtBoxStyleLineEdit6(QWidget *parent)\n#     : QLineEdit(parent)\n# {\n#     setMaxLength(1);\n#     setFixedSize(50, 50);\n#     setAlignment(Qt::AlignCenter);\n#     setStyleSheet(R\"(\n#     QLineEdit {\n#         font-size: 25px;\n#         border: 2px solid black;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/lineedit/style/demo7.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtGui import QIcon\nfrom PyQt5.QtWidgets import QLineEdit, QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQLineEdit = createWidgetMenuBase(QLineEdit)\nPATH_TO_IMG = str(Path(__file__).parent.parent.parent.parent / \"res/images/camera.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleLineEdit7(QLineEdit):\n    def __init__(self):\n        super(QtBoxStyleLineEdit7, self).__init__(str(Path(__file__)))\n        self.setAttribute(Qt.WA_MacShowFocusRect, False)\n        self.setPlaceholderText(\"search\")\n        self.setFixedSize(185, 30)\n        self.setStyleSheet(\"\"\"\n        QLineEdit {\n            border: 2px solid red;\n            border-radius: 5px;\n            padding-left: 5px;\n            padding-right: 80px;\n        }\n        \"\"\")\n\n        self.search_btn = QPushButton(self)\n        self.search_btn.setText(\"Search\")\n        self.search_btn.setFixedSize(55, self.height())\n        self.search_btn.setCursor(Qt.PointingHandCursor)\n        self.search_btn.move(self.width() - self.search_btn.width(), 0)\n        self.search_btn.setStyleSheet(\"\"\"\n        QPushButton {\n            background-color: red;\n            color: white; \n            font-size: 13px;\n            border-top: 2px solid red;\n            border-right: 2px solid red;\n            border-bottom: 2px solid red;\n            border-top-right-radius: 5px;\n            border-bottom-right-radius: 5px;\n        }\n\n        QPushButton:hover {\n            background-color: #f31919;\n        }\n\n        QPushButton:pressed {\n            background-color: #e21818;\n        }\n        \"\"\")\n\n        self.camera_btn = QPushButton(self)\n        self.camera_btn.setIcon(QIcon(PATH_TO_IMG))\n        self.camera_btn.setCursor(Qt.PointingHandCursor)\n        self.camera_btn.setFixedSize(self.height(), self.height())\n        self.camera_btn.move(self.width()-self.search_btn.width()-self.camera_btn.width(), 0)\n        self.camera_btn.setStyleSheet(\"\"\"\n        QPushButton {\n            border: none;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtGui import QIcon\n# from PySide2.QtWidgets import QLineEdit, QPushButton\n\n\n# class QtBoxStyleLineEdit7(QLineEdit):\n#     def __init__(self):\n#         super(QtBoxStyleLineEdit7, self).__init__()\n#         self.setAttribute(Qt.WA_MacShowFocusRect, False)\n#         self.setPlaceholderText(\"search\")\n#         self.setFixedSize(185, 30)\n#         self.setStyleSheet(\"\"\"\n#         QLineEdit {\n#             border: 2px solid red;\n#             border-radius: 5px;\n#             padding-left: 5px;\n#             padding-right: 80px;\n#         }\n#         \"\"\")\n\n#         self.search_btn = QPushButton(self)\n#         self.search_btn.setText(\"Search\")\n#         self.search_btn.setFixedSize(55, self.height())\n#         self.search_btn.setCursor(Qt.PointingHandCursor)\n#         self.search_btn.move(self.width() - self.search_btn.width(), 0)\n#         self.search_btn.setStyleSheet(\"\"\"\n#         QPushButton {\n#             background-color: red;\n#             color: white;\n#             font-size: 13px;\n#             border-top: 2px solid red;\n#             border-right: 2px solid red;\n#             border-bottom: 2px solid red;\n#             border-top-right-radius: 5px;\n#             border-bottom-right-radius: 5px;\n#         }\n\n#         QPushButton:hover {\n#             background-color: #f31919;\n#         }\n#\n#         QPushButton:pressed {\n#             background-color: #e21818;\n#         }\n#         \"\"\")\n\n#         self.camera_btn = QPushButton(self)\n#         self.camera_btn.setIcon(QIcon(PATH_TO_IMG))\n#         self.camera_btn.setCursor(Qt.PointingHandCursor)\n#         self.camera_btn.setFixedSize(self.height(), self.height())\n#         self.camera_btn.move(self.width()-self.search_btn.width()-self.camera_btn.width(), 0)\n#         self.camera_btn.setStyleSheet(\"\"\"\n#         QPushButton {\n#             border: none;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELINEEDIT7_H\n# #define QTBOXSTYLELINEEDIT7_H\n# #include <QLineEdit>\n# #include <QPushButton>\n\n# class QtBoxStyleLineEdit7 : public QLineEdit\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleLineEdit7(QWidget *parent = nullptr);\n\n# private:\n#     QPushButton *searchBtn = new QPushButton(this);\n#     QPushButton *cameraBtn = new QPushButton(this);\n# };\n# #endif // QTBOXSTYLELINEEDIT7_H\n\n\n\n# #include \"qtboxstylelineedit7.h\"\n# #include <QIcon>\n# #include <Qt>\n\n# QtBoxStyleLineEdit7::QtBoxStyleLineEdit7(QWidget *parent)\n#     : QLineEdit(parent)\n# {\n#     setAttribute(Qt::WA_MacShowFocusRect, false);\n#     setPlaceholderText(\"search\");\n#     setFixedSize(185, 30);\n#     setStyleSheet(R\"(\n#     QLineEdit {\n#         border: 2px solid red;\n#         border-radius: 5px;\n#         padding-left: 5px;\n#         padding-right: 80px;\n#     }\n#     )\");\n\n#     searchBtn->setText(\"Search\");\n#     searchBtn->setFixedSize(55, height());\n#     searchBtn->setCursor(Qt::PointingHandCursor);\n#     searchBtn->move(width()-searchBtn->width(), 0);\n#     searchBtn->setStyleSheet(R\"(\n#     QPushButton {\n#         background-color: red;\n#         color: white;\n#         font-size: 13px;\n#         border-top: 2px solid red;\n#         border-right: 2px solid red;\n#         border-bottom: 2px solid red;\n#         border-top-right-radius: 5px;\n#         border-bottom-right-radius: 5px;\n#     }\n\n#     QPushButton:hover {\n#         background-color: #f31919;\n#     }\n\n#     QPushButton:pressed {\n#         background-color: #e21818;\n#     }\n#     )\");\n\n#     cameraBtn->setIcon(QIcon(PATH_TO_IMG));\n#     cameraBtn->setCursor(Qt::PointingHandCursor);\n#     cameraBtn->setFixedSize(height(), height());\n#     cameraBtn->move(width()-searchBtn->width()-cameraBtn->width(), 0);\n#     cameraBtn->setStyleSheet(\"QPushButton {border:none;}\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/listwidget/__init__.py",
    "content": "from .func import demo1\nfrom .style import demo1, demo2"
  },
  {
    "path": "src/qtbox/demo/listwidget/func/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/listwidget/func/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import QSize\nfrom PyQt5.QtWidgets import QListWidget, QListWidgetItem, QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQListWidget = createWidgetMenuBase(QListWidget)\n\nclass QtBoxFuncListWidget1(QListWidget):\n    def __init__(self):\n        super(QtBoxFuncListWidget1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(100, 200)\n        self.add_btns()\n\n    def add_btns(self):\n        for _ in range(5):\n            item = QListWidgetItem()\n            item.setSizeHint(QSize(80, 30))\n            self.addItem(item)\n\n            btn = QPushButton()\n            btn.setText(\"button\")\n            self.setItemWidget(item, btn)\n# PyQt\n\n# PySide\n# from PySide2.QtCore import QSize\n# from PySide2.QtWidgets import QListWidget, QListWidgetItem, QPushButton\n\n\n# class QtBoxFuncListWidget1(QListWidget):\n#     def __init__(self):\n#         super(QtBoxFuncListWidget1, self).__init__()\n#         self.setFixedSize(80, 200)\n#         self.add_btns()\n\n#     def add_btns(self):\n#         for _ in range(5):\n#             item = QListWidgetItem()\n#             item.setSizeHint(QSize(100, 30))\n#             self.addItem(item)\n\n#             btn = QPushButton()\n#             btn.setText(\"button\")\n#             self.setItemWidget(item, btn)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCLISTWIDGET1_H\n# #define QTBOXFUNCLISTWIDGET1_H\n# #include <QListWidget>\n\n# class QtBoxFuncListWidget1 : public QListWidget\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncListWidget1(QWidget *parent = nullptr);\n\n# private:\n#     void addBtns();\n# };\n# #endif // QTBOXFUNCLISTWIDGET1_H\n\n\n\n# #include \"qtboxfunclistwidget1.h\"\n# #include <QListWidgetItem>\n# #include <QPushButton>\n# #include <QSize>\n\n# QtBoxFuncListWidget1::QtBoxFuncListWidget1(QWidget *parent)\n#     : QListWidget(parent)\n# {\n#     setFixedSize(100, 200);\n#     addBtns();\n# }\n\n# void QtBoxFuncListWidget1::addBtns()\n# {\n#     for(int i=0; i<5; i++) {\n#         QListWidgetItem *item = new QListWidgetItem();\n#         item->setSizeHint(QSize(80, 30));\n#         addItem(item);\n\n#         QPushButton *btn = new QPushButton();\n#         btn->setText(\"button\");\n#         setItemWidget(item, btn);\n#     }\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/listwidget/style/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/listwidget/style/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QListWidget, QListWidgetItem\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQListWidget = createWidgetMenuBase(QListWidget)\n\nclass QtBoxStyleListWidget1(QListWidget):\n    def __init__(self):\n        super(QtBoxStyleListWidget1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(200, 200)\n        self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)\n        self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)\n\n        for i in range(10):\n            item = QListWidgetItem()\n            item.setText(str(i))\n            self.addItem(item)\n\n        self.setStyleSheet(\"\"\"\n        QListView {\n            border: none;\n            background-color: #edeef3;\n        }\n        \n        QListView::item {\n            height: 40px;\n            margin: 5px 5px 5px 5px;\n            background-color: white;\n            border-radius: 6px;\n        }\n        \n        QListView::item:hover{\n            background-color: whitesmoke;\n        }\n        \n        QListView::item:selected{\n            color: black;\n            border: 1px solid lightgray;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QListWidget, QListWidgetItem\n\n\n# class QtBoxStyleListWidget1(QListWidget):\n#     def __init__(self):\n#         super(QtBoxStyleListWidget1, self).__init__(str(Path(__file__)))\n#         self.setFixedSize(200, 200)\n#         self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)\n#         self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)\n\n#         for i in range(10):\n#             item = QListWidgetItem()\n#             item.setText(str(i))\n#             self.addItem(item)\n\n#         self.setStyleSheet(\"\"\"\n#         QListView {\n#             border: none;\n#             background-color: #edeef3;\n#         }\n\n#         QListView::item {\n#             height: 40px;\n#             margin: 5px 5px 5px 5px;\n#             background-color: white;\n#             border-radius: 6px;\n#         }\n\n#         QListView::item:hover{\n#             background-color: whitesmoke;\n#         }\n\n#         QListView::item:selected{\n#             color: black;\n#             border: 1px solid lightgray;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELISTWIDGET1_H\n# #define QTBOXSTYLELISTWIDGET1_H\n# #include <QListWidget>\n\n# class QtBoxStyleListWidget1 : public QListWidget\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleListWidget1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLELISTWIDGET1_H\n\n\n\n# #include \"qtboxstylelistwidget1.h\"\n# #include <QListWidgetItem>\n# #include <Qt>\n\n# QtBoxStyleListWidget1::QtBoxStyleListWidget1(QWidget *parent)\n#     : QListWidget(parent)\n# {\n#     setFixedSize(200, 200);\n#     setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);\n#     setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);\n\n#     for(int i=0; i<10; i++) {\n#         QListWidgetItem *item = new QListWidgetItem();\n#         item->setText(QString(\"%1\").arg(i));\n#         addItem(item);\n#     }\n\n#     setStyleSheet(R\"(\n#     QListView {\n#         border: none;\n#         background-color: #edeef3;\n#     }\n\n#     QListView::item {\n#         height: 40px;\n#         margin: 5px 5px 5px 5px;\n#         background-color: white;\n#         border-radius: 6px;\n#     }\n\n#     QListView::item:hover{\n#         background-color: whitesmoke;\n#     }\n\n#     QListView::item:selected{\n#         color: black;\n#         border: 1px solid lightgray;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/listwidget/style/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QListWidget, QListWidgetItem\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQListWidget = createWidgetMenuBase(QListWidget)\n\nclass QtBoxStyleListWidget2(QListWidget):\n    def __init__(self):\n        super(QtBoxStyleListWidget2, self).__init__(str(Path(__file__)))\n        self.setFixedSize(200, 200)\n        self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)\n        self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)\n\n        for i in range(10):\n            item = QListWidgetItem()\n            item.setText(str(i))\n            self.addItem(item)\n\n        self.setStyleSheet(\"\"\"\n        QListView {\n            border: none;\n            background-color: #65afdc;\n            font-weight: bold;\n        }\n\n        QListView::item {\n            height: 40px;\n            color: white;\n            border-bottom: 1px solid #8fcef4;\n        }\n\n        QListView::item:hover:!selected{\n            background-color: #8fcef4;\n            padding-left: 5px;\n            padding-bottom: 2px;\n        }\n\n        QListView::item:selected{\n            background-color: #5da0c7;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QListWidget, QListWidgetItem\n\n\n# class QtBoxStyleListWidget2(QListWidget):\n#     def __init__(self):\n#         super(QtBoxStyleListWidget2, self).__init__()\n#         self.setFixedSize(200, 200)\n#         self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)\n#         self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)\n\n#         for i in range(10):\n#             item = QListWidgetItem()\n#             item.setText(str(i))\n#             self.addItem(item)\n\n#         self.setStyleSheet(\"\"\"\n#         QListView {\n#             border: none;\n#             background-color: #65afdc;\n#             font-weight: bold;\n#         }\n\n#         QListView::item {\n#             height: 40px;\n#             color: white;\n#             border-bottom: 1px solid #8fcef4;\n#         }\n\n#         QListView::item:hover:!selected{\n#             background-color: #8fcef4;\n#             padding-left: 5px;\n#             padding-bottom: 2px;\n#         }\n\n#         QListView::item:selected{\n#             background-color: #5da0c7;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLELISTWIDGET2_H\n# #define QTBOXSTYLELISTWIDGET2_H\n# #include <QListWidget>\n\n# class QtBoxStyleListWidget2 : public QListWidget\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleListWidget2(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLELISTWIDGET2_H\n\n\n\n# #include \"qtboxstylelistwidget2.h\"\n# #include <QListWidgetItem>\n# #include <Qt>\n\n# QtBoxStyleListWidget2::QtBoxStyleListWidget2(QWidget *parent)\n#     : QListWidget(parent)\n# {\n#     setFixedSize(200, 200);\n#     setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);\n#     setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);\n\n#     for(int i=0; i<10; i++) {\n#         QListWidgetItem *item = new QListWidgetItem();\n#         item->setText(QString(\"%1\").arg(i));\n#         addItem(item);\n#     }\n\n#     setStyleSheet(R\"(\n#     QListView {\n#         border: none;\n#         background-color: #65afdc;\n#         font-weight: bold;\n#     }\n\n#     QListView::item {\n#         height: 40px;\n#         color: white;\n#         border-bottom: 1px solid #8fcef4;\n#     }\n\n#     QListView::item:hover:!selected{\n#         background-color: #8fcef4;\n#         padding-left: 5px;\n#         padding-bottom: 2px;\n#     }\n\n#     QListView::item:selected{\n#         background-color: #5da0c7;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/progressbar/__init__.py",
    "content": "from .func import demo1, demo2\nfrom .style import demo1, demo2, demo3, demo4, demo5, demo6, demo7, demo8, demo9"
  },
  {
    "path": "src/qtbox/demo/progressbar/func/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/progressbar/func/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QProgressBar\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQProgressBar = createWidgetMenuBase(QProgressBar)\n\nclass QtBoxFuncProgressBar1(QProgressBar):\n    def __init__(self):\n        super(QtBoxFuncProgressBar1, self).__init__(str(Path(__file__)))\n        self.setRange(0, 0)\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QProgressBar\n\n\n# class QtBoxFuncProgressBar1(QProgressBar):\n#     def __init__(self):\n#         super(QtBoxFuncProgressBar1, self).__init__()\n#         self.setRange(0, 0)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCPROGRESSBAR1_H\n# #define QTBOXFUNCPROGRESSBAR1_H\n# #include <QProgressBar>\n\n# class QtBoxFuncProgressBar1 : public QProgressBar\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncProgressBar1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXFUNCPROGRESSBAR1_H\n\n\n\n# #include \"qtboxfuncprogressbar1.h\"\n\n# QtBoxFuncProgressBar1::QtBoxFuncProgressBar1(QWidget *parent)\n#     : QProgressBar(parent)\n# {\n#     setRange(0, 0);\n# }\n# C++/Qt\n"
  },
  {
    "path": "src/qtbox/demo/progressbar/func/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QProgressBar\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQProgressBar = createWidgetMenuBase(QProgressBar)\n\nclass QtBoxFuncProgressBar2(QProgressBar):\n    def __init__(self):\n        super(QtBoxFuncProgressBar2, self).__init__(str(Path(__file__)))\n        self.setInvertedAppearance(True)\n        self.setRange(0, 100)\n        self.setValue(80)\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QProgressBar\n\n\n# class QtBoxFuncProgressBar2(QProgressBar):\n#     def __init__(self):\n#         super(QtBoxFuncProgressBar2, self).__init__()\n#         self.setInvertedAppearance(True)\n#         self.setRange(0, 100)\n#         self.setValue(80)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCPROGRESSBAR2_H\n# #define QTBOXFUNCPROGRESSBAR2_H\n# #include <QProgressBar>\n\n# class QtBoxFuncProgressBar2 : public QProgressBar\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncProgressBar2(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXFUNCPROGRESSBAR2_H\n\n\n\n# #include \"qtboxfuncprogressbar2.h\"\n\n# QtBoxFuncProgressBar2::QtBoxFuncProgressBar2(QWidget *parent)\n#     : QProgressBar(parent)\n# {\n#     setInvertedAppearance(true);\n#     setRange(0, 100);\n#     setValue(80);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/progressbar/style/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/progressbar/style/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QProgressBar\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQProgressBar = createWidgetMenuBase(QProgressBar)\n\nclass QtBoxStyleProgressBar1(QProgressBar):\n    def __init__(self):\n        super(QtBoxStyleProgressBar1, self).__init__(str(Path(__file__)))\n        self.setFormat(\"loading...\")\n        self.setRange(0, 100)\n        self.setValue(80)\n        self.setStyleSheet(\"\"\"\n        QProgressBar {\n            border: 2px solid lightgray;\n            border-radius: 5px;\n            text-align: center;\n            color: white;\n        }\n        \n        QProgressBar::chunk {\n            background-color: #cd96cd;\n            border-radius: 4px;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QProgressBar\n\n\n# class QtBoxStyleProgressBar1(QProgressBar):\n#     def __init__(self):\n#         super(QtBoxStyleProgressBar1, self).__init__()\n#         self.setFormat(\"loading...\")\n#         self.setRange(0, 100)\n#         self.setValue(80)\n#         self.setStyleSheet(\"\"\"\n#         QProgressBar {\n#             border: 2px solid lightgray;\n#             border-radius: 5px;\n#             text-align: center;\n#             color: white;\n#         }\n\n#         QProgressBar::chunk {\n#             background-color: #cd96cd;\n#             border-radius: 4px;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPROGRESSBAR1_H\n# #define QTBOXSTYLEPROGRESSBAR1_H\n# #include <QProgressBar>\n\n# class QtBoxStyleProgressBar1 : public QProgressBar\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleProgressBar1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEPROGRESSBAR1_H\n\n\n\n# #include \"qtboxstyleprogressbar1.h\"\n\n# QtBoxStyleProgressBar1::QtBoxStyleProgressBar1(QWidget *parent)\n#     : QProgressBar(parent)\n# {\n#     setFormat(\"loading...\");\n#     setRange(0, 100);\n#     setValue(80);\n#     setStyleSheet(R\"(\n#     QProgressBar {\n#         border: 2px solid lightgray;\n#         border-radius: 5px;\n#         text-align: center;\n#         color: white;\n#     }\n\n#     QProgressBar::chunk {\n#         background-color: #cd96cd;\n#         border-radius: 4px;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/progressbar/style/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QProgressBar\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQProgressBar = createWidgetMenuBase(QProgressBar)\n\nclass QtBoxStyleProgressBar2(QProgressBar):\n    def __init__(self):\n        super(QtBoxStyleProgressBar2, self).__init__(str(Path(__file__)))\n        self.setTextVisible(False)\n        self.setRange(0, 100)\n        self.setValue(80)\n        self.setStyleSheet(\"\"\"\n        QProgressBar {\n            border: 2px solid #888783;\n            border-radius: 5px;\n        }\n\n        QProgressBar::chunk {\n            background-color: #74d65f;\n            border-radius: 2px;\n            width: 9px;\n            margin: 0.5px;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QProgressBar\n\n\n# class QtBoxStyleProgressBar2(QProgressBar):\n#     def __init__(self):\n#         super(QtBoxStyleProgressBar2, self).__init__()\n#         self.setTextVisible(False)\n#         self.setRange(0, 100)\n#         self.setValue(80)\n#         self.setStyleSheet(\"\"\"\n#         QProgressBar {\n#             border: 2px solid #888783;\n#             border-radius: 5px;\n#         }\n\n#         QProgressBar::chunk {\n#             background-color: #74d65f;\n#             border-radius: 2px;\n#             width: 9px;\n#             margin: 0.5px;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPROGRESSBAR2_H\n# #define QTBOXSTYLEPROGRESSBAR2_H\n# #include <QProgressBar>\n\n# class QtBoxStyleProgressBar2 : public QProgressBar\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleProgressBar2(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEPROGRESSBAR2_H\n\n\n\n# #include \"qtboxstyleprogressbar2.h\"\n\n# QtBoxStyleProgressBar2::QtBoxStyleProgressBar2(QWidget *parent)\n#     : QProgressBar(parent)\n# {\n#     setTextVisible(false);\n#     setRange(0, 100);\n#     setValue(80);\n#     setStyleSheet(R\"(\n#     QProgressBar {\n#         border: 2px solid #888783;\n#         border-radius: 5px;\n#     }\n\n#     QProgressBar::chunk {\n#         background-color: #74d65f;\n#         border-radius: 2px;\n#         width: 9px;\n#         margin: 0.5px;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/progressbar/style/demo3.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QProgressBar\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQProgressBar = createWidgetMenuBase(QProgressBar)\n\nclass QtBoxStyleProgressBar3(QProgressBar):\n    def __init__(self):\n        super(QtBoxStyleProgressBar3, self).__init__(str(Path(__file__)))\n        self.setRange(0, 100)\n        self.setValue(80)\n        self.setStyleSheet(\"\"\"\n        QProgressBar {\n            border: 2px solid white;\n            background-color: black;\n            padding-left: 2px;\n            padding-right: 2px;\n            text-align: center;\n        }\n\n        QProgressBar::chunk {\n            background-color: white;\n            margin-top: 2px;\n            margin-bottom: 2px;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QProgressBar\n\n\n# class QtBoxStyleProgressBar3(QProgressBar):\n#     def __init__(self):\n#         super(QtBoxStyleProgressBar3, self).__init__()\n#         self.setRange(0, 100)\n#         self.setValue(80)\n#         self.setStyleSheet(\"\"\"\n#         QProgressBar {\n#             border: 2px solid white;\n#             background-color: black;\n#             padding-left: 2px;\n#             padding-right: 2px;\n#             text-align: center;\n#         }\n\n#         QProgressBar::chunk {\n#             background-color: white;\n#             margin-top: 2px;\n#             margin-bottom: 2px;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPROGRESSBAR3_H\n# #define QTBOXSTYLEPROGRESSBAR3_H\n# #include <QProgressBar>\n\n# class QtBoxStyleProgressBar3 : public QProgressBar\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleProgressBar3(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEPROGRESSBAR3_H\n\n\n\n# #include \"qtboxstyleprogressbar3.h\"\n\n# QtBoxStyleProgressBar3::QtBoxStyleProgressBar3(QWidget *parent)\n#     : QProgressBar(parent)\n# {\n#     setRange(0, 100);\n#     setValue(80);\n#     setStyleSheet(R\"(\n#     QProgressBar {\n#         border: 2px solid white;\n#         background-color: black;\n#         padding-left: 2px;\n#         padding-right: 2px;\n#         text-align: center;\n#     }\n\n#     QProgressBar::chunk {\n#         background-color: white;\n#         margin-top: 2px;\n#         margin-bottom: 2px;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/progressbar/style/demo4.py",
    "content": "# PyQt\nfrom PyQt5.QtGui import QColor\nfrom PyQt5.QtWidgets import QProgressBar, QGraphicsDropShadowEffect\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQProgressBar = createWidgetMenuBase(QProgressBar)\n\nclass QtBoxStyleProgressBar4(QProgressBar):\n    def __init__(self):\n        super(QtBoxStyleProgressBar4, self).__init__(str(Path(__file__)))\n        self.setTextVisible(False)\n        self.setMaximumHeight(10)\n        self.setRange(0, 100)\n        self.setValue(80)\n        self.setStyleSheet(\"\"\"\n        QProgressBar {\n            border: 1px solid lightgray;\n            background-color: #2b241c;\n            border-radius: 5px;\n        }\n\n        QProgressBar::chunk {\n            background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #f9dc98, stop:1 #f4b543);\n            border-radius: 4px;\n        }\n        \"\"\")\n\n        self.add_shadow()\n\n    def add_shadow(self):\n        shadow = QGraphicsDropShadowEffect(self)\n        shadow.setBlurRadius(40)\n        shadow.setOffset(0, 0)\n        shadow.setColor(QColor(241, 177, 66))\n        self.setGraphicsEffect(shadow)\n# PyQt\n\n# PySide\n# from PySide2.QtGui import QColor\n# from PySide2.QtWidgets import QProgressBar, QGraphicsDropShadowEffect\n\n\n# class QtBoxStyleProgressBar4(QProgressBar):\n#     def __init__(self):\n#         super(QtBoxStyleProgressBar4, self).__init__()\n#         self.setTextVisible(False)\n#         self.setMaximumHeight(10)\n#         self.setRange(0, 100)\n#         self.setValue(80)\n#         self.setStyleSheet(\"\"\"\n#         QProgressBar {\n#             border: 1px solid lightgray;\n#             background-color: #2b241c;\n#             border-radius: 5px;\n#         }\n\n#         QProgressBar::chunk {\n#             background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #f9dc98, stop:1 #f4b543);\n#             border-radius: 4px;\n#         }\n#         \"\"\")\n\n#         self.add_shadow()\n\n#     def add_shadow(self):\n#         shadow = QGraphicsDropShadowEffect(self)\n#         shadow.setBlurRadius(40)\n#         shadow.setOffset(0, 0)\n#         shadow.setColor(QColor(241, 177, 66))\n#         self.setGraphicsEffect(shadow)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPROGRESSBAR4_H\n# #define QTBOXSTYLEPROGRESSBAR4_H\n# #include <QProgressBar>\n\n# class QtBoxStyleProgressBar4 : public QProgressBar\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleProgressBar4(QWidget *parent = nullptr);\n\n# private:\n#     void addShadow();\n# };\n# #endif // QTBOXSTYLEPROGRESSBAR4_H\n\n\n\n# #include \"qtboxstyleprogressbar4.h\"\n# #include <QGraphicsDropShadowEffect>\n# #include <QColor>\n\n# QtBoxStyleProgressBar4::QtBoxStyleProgressBar4(QWidget *parent)\n#     : QProgressBar(parent)\n# {\n#     setTextVisible(false);\n#     setMaximumHeight(10);\n#     setRange(0, 100);\n#     setValue(80);\n#     setStyleSheet(R\"(\n#     QProgressBar {\n#         border: 1px solid lightgray;\n#         background-color: #2b241c;\n#         border-radius: 5px;\n#     }\n\n#     QProgressBar::chunk {\n#         background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #f9dc98, stop:1 #f4b543);\n#         border-radius: 4px;\n#     }\n#     )\");\n\n#     addShadow();\n# }\n\n# void QtBoxStyleProgressBar4::addShadow()\n# {\n#     QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);\n#     shadow->setBlurRadius(40);\n#     shadow->setOffset(0, 0);\n#     shadow->setColor(QColor(241, 177, 66));\n#     setGraphicsEffect(shadow);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/progressbar/style/demo5.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QProgressBar\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQProgressBar = createWidgetMenuBase(QProgressBar)\n\nclass QtBoxStyleProgressBar5(QProgressBar):\n    def __init__(self):\n        super(QtBoxStyleProgressBar5, self).__init__(str(Path(__file__)))\n        self.setTextVisible(False)\n        self.setRange(0, 100)\n        self.setValue(80)\n        self.setStyleSheet(\"\"\"\n        QProgressBar {\n            border: 1px solid lightgray;\n            border-radius: 3px;\n            background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.4, stop:0 white, stop:1 #dedede);\n        }\n\n        QProgressBar::chunk {\n            background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.4, stop:0 white, stop:1 #64d651);\n            border-radius： 2px;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QProgressBar\n\n\n# class QtBoxStyleProgressBar5(QProgressBar):\n#     def __init__(self):\n#         super(QtBoxStyleProgressBar5, self).__init__()\n#         self.setTextVisible(False)\n#         self.setRange(0, 100)\n#         self.setValue(80)\n#         self.setStyleSheet(\"\"\"\n#         QProgressBar {\n#             border: 1px solid lightgray;\n#             border-radius: 3px;\n#             background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.4, stop:0 white, stop:1 #dedede);\n#         }\n\n#         QProgressBar::chunk {\n#             background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.4, stop:0 white, stop:1 #64d651);\n#             border-radius： 2px;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPROGRESSBAR5_H\n# #define QTBOXSTYLEPROGRESSBAR5_H\n# #include <QProgressBar>\n\n# class QtBoxStyleProgressBar5 : public QProgressBar\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleProgressBar5(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEPROGRESSBAR5_H\n\n\n\n# #include \"qtboxstyleprogressbar5.h\"\n\n# QtBoxStyleProgressBar5::QtBoxStyleProgressBar5(QWidget *parent)\n#     : QProgressBar(parent)\n# {\n#     setTextVisible(false);\n#     setRange(0, 100);\n#     setValue(80);\n#     setStyleSheet(R\"(\n#     QProgressBar {\n#         border: 1px solid lightgray;\n#         border-radius: 3px;\n#         background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.4, stop:0 white, stop:1 #dedede);\n#     }\n\n#     QProgressBar::chunk {\n#         background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.4, stop:0 white, stop:1 #64d651);\n#         border-radius： 2px;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/progressbar/style/demo6.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QProgressBar\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQProgressBar = createWidgetMenuBase(QProgressBar)\n\nclass QtBoxStyleProgressBar6(QProgressBar):\n    def __init__(self):\n        super(QtBoxStyleProgressBar6, self).__init__(str(Path(__file__)))\n        self.setTextVisible(False)\n        self.setRange(0, 100)\n        self.setValue(80)\n        self.setStyleSheet(\"\"\"\n        QProgressBar {\n            background-color: #c2c6c9;\n            border: 2px solid #b0b4b7;\n            border-right: 2px solid #d5d8dd;\n            border-bottom: 2px solid #d5d8dd;\n            border-radius: 2px;\n        }\n\n        QProgressBar::chunk {\n            background-color: #0c107b;\n            border-radius: 1px;\n            width: 9px;\n            margin: 0.5px;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QProgressBar\n\n\n# class QtBoxStyleProgressBar6(QProgressBar):\n#     def __init__(self):\n#         super(QtBoxStyleProgressBar6, self).__init__()\n#         self.setTextVisible(False)\n#         self.setRange(0, 100)\n#         self.setValue(80)\n#         self.setStyleSheet(\"\"\"\n#         QProgressBar {\n#             background-color: #c2c6c9;\n#             border: 2px solid #b0b4b7;\n#             border-right: 2px solid #d5d8dd;\n#             border-bottom: 2px solid #d5d8dd;\n#             border-radius: 2px;\n#         }\n\n#         QProgressBar::chunk {\n#             background-color: #0c107b;\n#             border-radius: 1px;\n#             width: 9px;\n#             margin: 0.5px;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPROGRESSBAR6_H\n# #define QTBOXSTYLEPROGRESSBAR6_H\n# #include <QProgressBar>\n\n# class QtBoxStyleProgressBar6 : public QProgressBar\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleProgressBar6(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEPROGRESSBAR6_H\n\n\n\n# #include \"qtboxstyleprogressbar6.h\"\n\n# QtBoxStyleProgressBar6::QtBoxStyleProgressBar6(QWidget *parent)\n#     : QProgressBar(parent)\n# {\n#     setTextVisible(false);\n#     setRange(0, 100);\n#     setValue(80);\n#     setStyleSheet(R\"(\n#     QProgressBar {\n#         background-color: #c2c6c9;\n#         border: 2px solid #b0b4b7;\n#         border-right: 2px solid #d5d8dd;\n#         border-bottom: 2px solid #d5d8dd;\n#         border-radius: 2px;\n#     }\n\n#     QProgressBar::chunk {\n#         background-color: #0c107b;\n#         border-radius: 1px;\n#         width: 9px;\n#         margin: 0.5px;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/progressbar/style/demo7.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt, QRectF\nfrom PyQt5.QtWidgets import QProgressBar\nfrom PyQt5.QtGui import QPainter, QColor, QPen, QFont, QFontMetricsF\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQProgressBar = createWidgetMenuBase(QProgressBar)\n\nclass QtBoxStyleProgressBar7(QProgressBar):\n    def __init__(self):\n        super(QtBoxStyleProgressBar7, self).__init__(str(Path(__file__)))\n        self.setFixedSize(80, 80)\n        self.setRange(0, 100)\n        self.setValue(80)\n\n    def paintEvent(self, event):\n        painter = QPainter(self)\n        painter.setRenderHint(QPainter.Antialiasing)\n\n        offset = 20\n        arc_rect = QRectF(self.rect().left() + offset / 2, self.rect().top() + offset / 2, self.rect().width() - offset, self.rect().height() - offset)\n\n        arc_pen = QPen()\n        arc_pen.setColor(QColor(127, 106, 209))\n        arc_pen.setWidth(18)\n        painter.setPen(arc_pen)\n        percent = self.value() / self.maximum() if self.maximum() != 0 else 0\n        painter.drawArc(arc_rect, 90*16, int(percent*360*16))\n\n        font = QFont()\n        font.setPixelSize(15)\n        painter.setFont(font)\n        font_metrics = QFontMetricsF(font)\n        text_width = font_metrics.width(self.text())\n        painter.drawText(int(self.width()/2-text_width/2), 45, self.text())\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt, QRectF\n# from PySide2.QtWidgets import QProgressBar\n# from PySide2.QtGui import QPainter, QColor, QPen, QFont, QFontMetricsF\n\n\n# class QtBoxStyleProgressBar7(QProgressBar):\n#     def __init__(self):\n#         super(QtBoxStyleProgressBar7, self).__init__()\n#         self.setFixedSize(80, 80)\n#         self.setRange(0, 100)\n#         self.setValue(80)\n\n#     def paintEvent(self, event):\n#         painter = QPainter(self)\n#         painter.setRenderHint(QPainter.Antialiasing)\n\n#         offset = 20\n#         arc_rect = QRectF(self.rect().left() + offset / 2, self.rect().top() + offset / 2, self.rect().width() - offset, self.rect().height() - offset)\n\n#         arc_pen = QPen()\n#         arc_pen.setColor(QColor(127, 106, 209))\n#         arc_pen.setWidth(18)\n#         painter.setPen(arc_pen)\n#         percent = self.value() / self.maximum() if self.maximum() != 0 else 0\n#         painter.drawArc(arc_rect, 90*16, int(percent*360*16))\n\n#         font = QFont()\n#         font.setPixelSize(15)\n#         painter.setFont(font)\n#         font_metrics = QFontMetricsF(font)\n#         text_width = font_metrics.width(self.text())\n#         painter.drawText(int(self.width()/2-text_width/2), 45, self.text())\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPROGRESSBAR7_H\n# #define QTBOXSTYLEPROGRESSBAR7_H\n# #include <QProgressBar>\n# #include <QPaintEvent>\n\n# class QtBoxStyleProgressBar7 : public QProgressBar\n# {\n#     Q_OBJECT\n\n# protected:\n#     void paintEvent(QPaintEvent *event);\n\n# public:\n#     QtBoxStyleProgressBar7(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEPROGRESSBAR7_H\n\n\n\n#include \"qtboxstyleprogressbar7.h\"\n#include <QPainter>\n#include <QRectF>\n#include <QPen>\n#include <QColor>\n#include <QFont>\n#include <QFontMetricsF>\n\n# QtBoxStyleProgressBar7::QtBoxStyleProgressBar7(QWidget *parent)\n#     : QProgressBar(parent)\n# {\n#     setFixedSize(80, 80);\n#     setRange(0, 100);\n#     setValue(80);\n# }\n\n# void QtBoxStyleProgressBar7::paintEvent(QPaintEvent *event)\n# {\n#     QPainter painter(this);\n#     painter.setRenderHint(QPainter::Antialiasing);\n\n#     int offset = 20;\n#     QRectF arcRect = QRectF(rect().left()+offset/2, rect().top()+offset/2, rect().width()-offset, rect().height()-offset);\n\n#     QPen arcPen = QPen();\n#     arcPen.setColor(QColor(127, 106, 209));\n#     arcPen.setWidth(18);\n#     painter.setPen(arcPen);\n\n#     float percent = 0.0;\n#     if (maximum() != 0) {\n#         percent = float(value()) / float(maximum());\n#     }\n#     painter.drawArc(arcRect, 90*16, int(percent*360*16));\n\n#     QFont font = QFont();\n#     font.setPixelSize(15);\n#     painter.setFont(font);\n#     QFontMetricsF fontMetricsF = QFontMetricsF(font);\n#     float textWidth = fontMetricsF.size(Qt::TextSingleLine, text()).width();\n#     painter.drawText(int(width()/2-textWidth/2), 45, text());\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/progressbar/style/demo8.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt, QRectF\nfrom PyQt5.QtWidgets import QProgressBar\nfrom PyQt5.QtGui import QPainter, QColor, QPen, QFont, QFontMetricsF\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQProgressBar = createWidgetMenuBase(QProgressBar)\n\nclass QtBoxStyleProgressBar8(QProgressBar):\n    def __init__(self):\n        super(QtBoxStyleProgressBar8, self).__init__(str(Path(__file__)))\n        self.setFixedSize(80, 80)\n        self.setRange(0, 100)\n        self.setValue(80)\n\n    def paintEvent(self, event):\n        painter = QPainter(self)\n        painter.setRenderHint(QPainter.Antialiasing)\n        painter.setPen(Qt.NoPen)\n        painter.setBrush(QColor(33, 33, 33))\n        painter.drawEllipse(self.rect())\n\n        offset = 4\n        arc_rect = QRectF(self.rect().left() + offset / 2, self.rect().top() + offset / 2, self.rect().width() - offset, self.rect().height() - offset)\n\n        arc_pen = QPen()\n        arc_pen.setColor(QColor(57, 57, 57))\n        arc_pen.setWidth(4)\n        painter.setPen(arc_pen)\n        painter.drawArc(arc_rect, 90*16, 360*16)\n\n        arc_pen.setColor(QColor(241, 150, 76))\n        painter.setPen(arc_pen)\n        percent = self.value() / self.maximum() if self.maximum() != 0 else 0\n        painter.drawArc(arc_rect, 90*16, int(percent*360*16))\n\n        font = QFont()\n        font.setPixelSize(18)\n        painter.setFont(font)\n        font_metrics = QFontMetricsF(font)\n        text_width = font_metrics.width(self.text())\n        painter.drawText(int(self.width()/2-text_width/2), 45, self.text())\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt, QRectF\n# from PySide2.QtWidgets import QProgressBar\n# from PySide2.QtGui import QPainter, QColor, QPen, QFont, QFontMetricsF\n\n\n# class QtBoxStyleProgressBar8(QProgressBar):\n#     def __init__(self):\n#         super(QtBoxStyleProgressBar8, self).__init__()\n#         self.setFixedSize(80, 80)\n#         self.setRange(0, 100)\n#         self.setValue(80)\n\n#     def paintEvent(self, event):\n#         painter = QPainter(self)\n#         painter.setRenderHint(QPainter.Antialiasing)\n#         painter.setPen(Qt.NoPen)\n#         painter.setBrush(QColor(33, 33, 33))\n#         painter.drawEllipse(self.rect())\n\n#         offset = 4\n#         arc_rect = QRectF(self.rect().left() + offset / 2, self.rect().top() + offset / 2, self.rect().width() - offset, self.rect().height() - offset)\n\n#         arc_pen = QPen()\n#         arc_pen.setColor(QColor(57, 57, 57))\n#         arc_pen.setWidth(4)\n#         painter.setPen(arc_pen)\n#         painter.drawArc(arc_rect, 90*16, 360*16)\n\n#         arc_pen.setColor(QColor(241, 150, 76))\n#         painter.setPen(arc_pen)\n#         percent = self.value() / self.maximum() if self.maximum() != 0 else 0\n#         painter.drawArc(arc_rect, 90*16, int(percent*360*16))\n\n#         font = QFont()\n#         font.setPixelSize(18)\n#         painter.setFont(font)\n#         font_metrics = QFontMetricsF(font)\n#         text_width = font_metrics.width(self.text())\n#         painter.drawText(int(self.width()/2-text_width/2), 45, self.text())\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPROGRESSBAR8_H\n# #define QTBOXSTYLEPROGRESSBAR8_H\n# #include <QProgressBar>\n# #include <QPaintEvent>\n\n# class QtBoxStyleProgressBar8 : public QProgressBar\n# {\n#     Q_OBJECT\n\n# protected:\n#     void paintEvent(QPaintEvent *event);\n\n# public:\n#     QtBoxStyleProgressBar8(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEPROGRESSBAR8_H\n\n\n\n# #include \"qtboxstyleprogressbar8.h\"\n# #include <QPainter>\n# #include <QRectF>\n# #include <QPen>\n# #include <QColor>\n# #include <QFont>\n# #include <QFontMetricsF>\n# #include <Qt>\n\n# QtBoxStyleProgressBar8::QtBoxStyleProgressBar8(QWidget *parent)\n#     : QProgressBar(parent)\n# {\n#     setFixedSize(80, 80);\n#     setRange(0, 100);\n#     setValue(80);\n# }\n\n# void QtBoxStyleProgressBar8::paintEvent(QPaintEvent *event)\n# {\n#     QPainter painter(this);\n#     painter.setRenderHint(QPainter::Antialiasing);\n#     painter.setPen(Qt::NoPen);\n#     painter.setBrush(QColor(33, 33, 33));\n#     painter.drawEllipse(rect());\n\n#     int offset = 4;\n#     QRectF arcRect = QRectF(rect().left()+offset/2, rect().top()+offset/2, rect().width()-offset, rect().height()-offset);\n\n#     QPen arcPen = QPen();\n#     arcPen.setColor(QColor(57, 57, 57));\n#     arcPen.setWidth(4);\n#     painter.setPen(arcPen);\n#     painter.drawArc(arcRect, 90*16, 360*16);\n\n#     arcPen.setColor(QColor(241, 150, 76));\n#     painter.setPen(arcPen);\n#     float percent = 0.0;\n#     if (maximum() != 0) {\n#         percent = float(value()) / float(maximum());\n#     }\n#     painter.drawArc(arcRect, 90*16, int(percent*360*16));\n\n#     QFont font = QFont();\n#     font.setPixelSize(18);\n#     painter.setFont(font);\n#     QFontMetricsF fontMetricsF = QFontMetricsF(font);\n#     float textWidth = fontMetricsF.size(Qt::TextSingleLine, text()).width();\n#     painter.drawText(int(width()/2-textWidth/2), 45, text());\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/progressbar/style/demo9.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QProgressBar\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQProgressBar = createWidgetMenuBase(QProgressBar)\n\nclass QtBoxStyleProgressBar9(QProgressBar):\n    def __init__(self):\n        super(QtBoxStyleProgressBar9, self).__init__(str(Path(__file__)))\n        self.setOrientation(Qt.Vertical)\n        self.setTextVisible(False)\n        self.setMaximumWidth(10)\n        self.setRange(0, 100)\n        self.setValue(80)\n        self.setStyleSheet(\"\"\"\n        QProgressBar {\n            border: 2px solid black;\n            background-color: #f8f8f8;\n            border-radius: 5px;\n            padding-left: 2px;\n            padding-right: 2px;\n        }\n\n        QProgressBar::chunk {\n            background-color: #d33124;\n            border-radius: 4px;\n            margin-top: 2px;\n            margin-bottom: 2px;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QProgressBar\n\n\n# class QtBoxStyleProgressBar9(QProgressBar):\n#     def __init__(self):\n#         super(QtBoxStyleProgressBar9, self).__init__()\n#         self.setOrientation(Qt.Vertical)\n#         self.setTextVisible(False)\n#         self.setMaximumWidth(10)\n#         self.setRange(0, 100)\n#         self.setValue(80)\n#         self.setStyleSheet(\"\"\"\n#         QProgressBar {\n#             border: 2px solid black;\n#             background-color: #f8f8f8;\n#             border-radius: 5px;\n#             padding-left: 2px;\n#             padding-right: 2px;\n#         }\n\n#         QProgressBar::chunk {\n#             background-color: #d33124;\n#             border-radius: 4px;\n#             margin-top: 2px;\n#             margin-bottom: 2px;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPROGRESSBAR9_H\n# #define QTBOXSTYLEPROGRESSBAR9_H\n# #include <QProgressBar>\n\n# class QtBoxStyleProgressBar9 : public QProgressBar\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleProgressBar9(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEPROGRESSBAR9_H\n\n\n\n# #include \"qtboxstyleprogressbar9.h\"\n# #include <Qt>\n\n# QtBoxStyleProgressBar9::QtBoxStyleProgressBar9(QWidget *parent)\n#     : QProgressBar(parent)\n# {\n#     setOrientation(Qt::Vertical);\n#     setTextVisible(false);\n#     setMaximumWidth(10);\n#     setRange(0, 100);\n#     setValue(80);\n#     setStyleSheet(R\"(\n#     QProgressBar {\n#         border: 2px solid black;\n#         background-color: #f8f8f8;\n#         border-radius: 5px;\n#         padding-left: 2px;\n#         padding-right: 2px;\n#     }\n\n#     QProgressBar::chunk {\n#         background-color: #d33124;\n#         border-radius: 4px;\n#         margin-top: 2px;\n#         margin-bottom: 2px;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/__init__.py",
    "content": "from .func import demo1, demo2, demo3\nfrom .style import demo1, demo2, demo3, demo4, demo5, demo6, demo7, demo8, demo9, demo10, demo11, demo12\n"
  },
  {
    "path": "src/qtbox/demo/pushbutton/func/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/pushbutton/func/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import QThread, pyqtSignal\nfrom PyQt5.QtWidgets import QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\n\nclass QtBoxFuncButton1(QPushButton):\n    def __init__(self):\n        super(QtBoxFuncButton1, self).__init__(str(Path(__file__)))\n        self.setText(\"Send SMS\")\n        self.clicked.connect(self.start_SMS_thread)\n\n        self.SMS_thread = SMSThread()\n        self.SMS_thread.count_signal.connect(self.count_down)\n        self.SMS_thread.finished_signal.connect(self.restore)\n\n    def start_SMS_thread(self):\n        self.SMS_thread.start()\n\n    def count_down(self, count):\n        self.setEnabled(False)\n        self.setText(f\"Resend ({count})\")\n\n    def restore(self):\n        self.setEnabled(True)\n        self.setText(\"Send SMS\")\n\n\nclass SMSThread(QThread):\n    count_signal = pyqtSignal(int)\n    finished_signal = pyqtSignal()\n\n    def __init__(self):\n        super(SMSThread, self).__init__()\n\n    def run(self):\n        self.send_SMS()\n\n        count = 60\n        while count >= 1:\n            self.count_signal.emit(count)\n            count -= 1\n            self.sleep(1)\n\n        self.finished_signal.emit()\n\n    def send_SMS(self):\n        \"\"\"send verification code to the user here\"\"\"\n        ...\n# PyQt\n\n# PySide\n# from PySide2.QtCore import QThread, Signal\n# from PySide2.QtWidgets import QPushButton\n\n\n# class QtBoxFuncButton1(QPushButton):\n#     def __init__(self):\n#         super(QtBoxFuncButton1, self).__init__()\n#         self.setText(\"Send SMS\")\n#         self.clicked.connect(self.start_SMS_thread)\n\n#         self.SMS_thread = SMSThread()\n#         self.SMS_thread.count_signal.connect(self.count_down)\n#         self.SMS_thread.finished_signal.connect(self.restore)\n\n#     def start_SMS_thread(self):\n#         self.SMS_thread.start()\n\n#     def count_down(self, count):\n#         self.setEnabled(False)\n#         self.setText(f\"Resend ({count})\")\n\n#     def restore(self):\n#         self.setEnabled(True)\n#         self.setText(\"Send SMS\")\n\n\n# class SMSThread(QThread):\n#     count_signal = Signal(int)\n#     finished_signal = Signal()\n\n#     def __init__(self):\n#         super(SMSThread, self).__init__()\n\n#     def run(self):\n#         self.send_SMS()\n\n#         count = 60\n#         while count >= 1:\n#             self.count_signal.emit(count)\n#             count -= 1\n#             self.sleep(1)\n\n#         self.finished_signal.emit()\n\n#     def send_SMS(self):\n#         \"\"\"send verification code to the user here\"\"\"\n#         ...\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCPUSHBUTTON1_H\n# #define QTBOXFUNCPUSHBUTTON1_H\n# #include \"smsthread.h\"\n# #include <QPushButton>\n\n# class QtBoxFuncPushButton1 : public QPushButton\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncPushButton1(QWidget *parent = nullptr);\n\n# private:\n#     SMSThread *smsThread = new SMSThread();\n\n# private slots:\n#     void startSMSThread();\n#     void countDown(int count);\n#     void restore();\n# };\n# #endif // QTBOXFUNCPUSHBUTTON1_H\n\n# #ifndef SMSTHREAD_H\n# #define SMSTHREAD_H\n# #include <QThread>\n\n# class SMSThread : public QThread\n# {\n#     Q_OBJECT\n\n# public:\n#     SMSThread();\n\n# protected:\n#     void run();\n\n# private:\n#     int count;\n#     void sendSMS();\n\n# signals:\n#     void countSignal(int count);\n#     void finishedSignal();\n# };\n# #endif // SMSTHREAD_H\n\n\n\n# #include \"qtboxfuncpushbutton1.h\"\n# #include <QString>\n\n# QtBoxFuncPushButton1::QtBoxFuncPushButton1(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setText(\"Send SMS\");\n#     connect(this, SIGNAL(clicked()), this, SLOT(startSMSThread()));\n#     connect(smsThread, SIGNAL(countSignal(int)), this, SLOT(countDown(int)));\n#     connect(smsThread, SIGNAL(finishedSignal()), this, SLOT(restore()));\n# }\n\n# void QtBoxFuncPushButton1::startSMSThread()\n# {\n#     smsThread->start();\n# }\n\n# void QtBoxFuncPushButton1::countDown(int count)\n# {\n#     setEnabled(false);\n#     setText(QString(\"Resend %1\").arg(QString::number(count)));\n# }\n\n# void QtBoxFuncPushButton1::restore()\n# {\n#     setEnabled(true);\n#     setText(\"Send SMS\");\n# }\n\n# #include \"smsthread.h\"\n\n# SMSThread::SMSThread()\n# {\n\n# }\n\n# void SMSThread::run()\n# {\n#     sendSMS();\n#     count = 60;\n#     while (count >= 1){\n#         emit countSignal(count);\n#         count -= 1;\n#         sleep(1);\n#     }\n\n#     emit finishedSignal();\n# }\n\n# void SMSThread::sendSMS()\n# {\n#     // send verification code to the user here\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/func/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import QThread, pyqtSignal\nfrom PyQt5.QtWidgets import QPushButton, QMessageBox\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\n\nclass QtBoxFuncButton2(QPushButton):\n    def __init__(self):\n        super(QtBoxFuncButton2, self).__init__(str(Path(__file__)))\n        self.setText(\"Login\")\n        self.clicked.connect(self.start_verify_thread)\n\n        self.verify_thread = VerifyThread()\n        self.verify_thread.verify_signal.connect(self.do_after_verification)\n\n    def start_verify_thread(self):\n        self.verify_thread.start()\n\n    def do_after_verification(self, verify_result):\n        if not verify_result:\n            self.verify_not_ok()\n        else:\n            self.verify_ok()\n\n    def verify_not_ok(self):\n        QMessageBox.critical(self, \"Verify\", \"Wrong username or password\")\n\n    def verify_ok(self):\n        QMessageBox.information(self, \"Verify\", \"Login successfully\")\n\n\nclass VerifyThread(QThread):\n    verify_signal = pyqtSignal(bool)\n\n    def __init__(self):\n        super(VerifyThread, self).__init__()\n\n    def run(self):\n        self.verify_signal.emit(self.verify())\n\n    def verify(self):\n        \"\"\"\n        verify username and password here\n        :return: True or False\n        \"\"\"\n        ...\n        return False\n# PyQt\n\n\n# PySide\n# from PySide2.QtCore import QThread, Signal\n# from PySide2.QtWidgets import QPushButton, QMessageBox\n\n\n# class QtBoxFuncButton2(QPushButton):\n#     def __init__(self):\n#         super(QtBoxFuncButton2, self).__init__()\n#         self.setText(\"Login\")\n#         self.clicked.connect(self.start_verify_thread)\n\n#         self.verify_thread = VerifyThread()\n#         self.verify_thread.verify_signal.connect(self.do_after_verification)\n\n#     def start_verify_thread(self):\n#         self.verify_thread.start()\n\n#     def do_after_verification(self, verify_result):\n#         if not verify_result:\n#             self.verify_not_ok()\n#         else:\n#             self.verify_ok()\n\n#     def verify_not_ok(self):\n#         QMessageBox.critical(self, \"Verify\", \"Wrong username or password\")\n\n#     def verify_ok(self):\n#         QMessageBox.information(self, \"Verify\", \"Login successfully\")\n\n\n# class VerifyThread(QThread):\n#     verify_signal = Signal(bool)\n\n#     def __init__(self):\n#         super(VerifyThread, self).__init__()\n\n#     def run(self):\n#         self.verify_signal.emit(self.verify())\n\n#     def verify(self):\n#         \"\"\"\n#         verify username and password here\n#         :return: True or False\n#         \"\"\"\n#         ...\n#         return False\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCPUSHBUTTON2_H\n# #define QTBOXFUNCPUSHBUTTON2_H\n# #include \"verifythread.h\"\n# #include <QPushButton>\n\n# class QtBoxFuncPushButton2 : public QPushButton\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncPushButton2(QWidget *parent = nullptr);\n\n# private:\n#     VerifyThread *verifyThread = new VerifyThread();\n\n# private slots:\n#     void startVerifyThread();\n#     void doAfterVerification(bool verifyResult);\n#     void verifyNotOk();\n#     void verifyOk();\n# };\n# #endif // QTBOXFUNCPUSHBUTTON2_H\n\n# #ifndef VERIFYTHREAD_H\n# #define VERIFYTHREAD_H\n# #include <QThread>\n\n# class VerifyThread : public QThread\n# {\n#     Q_OBJECT\n\n# public:\n#     VerifyThread();\n\n# protected:\n#     void run();\n\n# private:\n#     bool verify();\n\n# signals:\n#     void verifySignal(bool verifyResult);\n# };\n# #endif // VERIFYTHREAD_H\n\n\n\n# #include \"qtboxfuncpushbutton2.h\"\n# #include <QMessageBox>\n\n# QtBoxFuncPushButton2::QtBoxFuncPushButton2(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setText(\"Login\");\n#     connect(this, SIGNAL(clicked()), this, SLOT(startVerifyThread()));\n#     connect(verifyThread, SIGNAL(verifySignal(bool)), this, SLOT(doAfterVerification(bool)));\n# }\n\n# void QtBoxFuncPushButton2::startVerifyThread()\n# {\n#     verifyThread->start();\n# }\n\n# void QtBoxFuncPushButton2::doAfterVerification(bool verifyResult)\n# {\n#     if (!verifyResult) {\n#         verifyNotOk();\n#     }\n#     else {\n#         verifyOk();\n#     }\n# }\n\n# void QtBoxFuncPushButton2::verifyNotOk()\n# {\n#     QMessageBox::critical(this, \"Verify\", \"Wrong username or password\");\n# }\n\n# void QtBoxFuncPushButton2::verifyOk()\n# {\n#     QMessageBox::information(this, \"Verify\", \"Login successfully\");\n#\n# }\n\n# #include \"verifythread.h\"\n\n# VerifyThread::VerifyThread()\n# {\n\n# }\n\n# void VerifyThread::run()\n# {\n#     emit verifySignal(verify());\n# }\n\n# bool VerifyThread::verify()\n# {\n#     // verify username and password here\n#     return false;\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/func/demo3.py",
    "content": "# PyQt\nimport webbrowser\nfrom PyQt5.QtWidgets import QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\n\nclass QtBoxFuncButton3(QPushButton):\n    def __init__(self):\n        super(QtBoxFuncButton3, self).__init__(str(Path(__file__)))\n        self.setText(\"Open a website\")\n        self.clicked.connect(self.open_a_website)\n\n    def open_a_website(self):\n        url = \"https://github.com/la-vie-est-belle/qtbox\"\n        webbrowser.open(url)\n# PyQt\n\n# PySide\n# import webbrowser\n# from PySide2.QtWidgets import QPushButton\n\n\n# class QtBoxFuncButton3(QPushButton):\n#     def __init__(self):\n#         super(QtBoxFuncButton3, self).__init__()\n#         self.setText(\"Open a website\")\n#         self.clicked.connect(self.open_a_website)\n\n#     def open_a_website(self):\n#         url = \"https://github.com/la-vie-est-belle/qtbox\"\n#         webbrowser.open(url)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCPUSHBUTTON3_H\n# #define QTBOXFUNCPUSHBUTTON3_H\n# #include <QPushButton>\n\n# class QtBoxFuncPushButton3 : public QPushButton\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncPushButton3(QWidget *parent = nullptr);\n\n# private slots:\n#     void openAWebsite();\n# };\n# #endif // QTBOXFUNCPUSHBUTTON3_H\n\n\n\n# #include \"qtboxfuncpushbutton3.h\"\n# #include <QDesktopServices>\n# #include <QUrl>\n\n# QtBoxFuncPushButton3::QtBoxFuncPushButton3(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setText(\"Open a website\");\n#     connect(this, SIGNAL(clicked()), this, SLOT(openAWebsite()));\n# }\n\n# void QtBoxFuncPushButton3::openAWebsite()\n# {\n#     QUrl url = QUrl(\"https://github.com/la-vie-est-belle/qtbox\");\n#     QDesktopServices::openUrl(url);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/style/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/pushbutton/style/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\n\nclass QtBoxStyleButton1(QPushButton):\n    def __init__(self):\n        super(QtBoxStyleButton1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 50)\n        self.setText(\"BUTTON\")\n        self.setStyleSheet(\"\"\"\n        QPushButton {\n            background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #8a9195, stop:1 black);\n            color: white;\n            font-size: 20px;\n            font-weight: bold;\n            border-radius: 25px;\n        }\n\n        QPushButton:hover {\n            background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #7d8488, stop:1 black);\n        }\n\n        QPushButton:pressed {\n            background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #6a7073, stop:1 black);\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QPushButton\n\n\n# class QtBoxStyleButton1(QPushButton):\n#     def __init__(self):\n#         super(QtBoxStyleButton1, self).__init__()\n#         self.setFixedSize(150, 50)\n#         self.setText(\"BUTTON\")\n#         self.setStyleSheet(\"\"\"\n#         QPushButton {\n#             background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #8a9195, stop:1 black);\n#             color: white;\n#             font-size: 20px;\n#             font-weight: bold;\n#             border-radius: 25px;\n#         }\n\n#         QPushButton:hover {\n#             background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #7d8488, stop:1 black);\n#         }\n\n#         QPushButton:pressed {\n#             background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #6a7073, stop:1 black);\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPUSHBUTTON1_H\n# #define QTBOXSTYLEPUSHBUTTON1_H\n# #include <QPushButton>\n\n# class QtBoxStylePushButton1 : public QPushButton\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStylePushButton1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEPUSHBUTTON1_H\n\n\n\n# #include \"qtboxstylepushbutton1.h\"\n\n# QtBoxStylePushButton1::QtBoxStylePushButton1(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setFixedSize(150, 50);\n#     setText(\"BUTTON\");\n#     setStyleSheet(R\"(\n#     QPushButton {\n#         background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #8a9195, stop:1 black);\n#         color: white;\n#         font-size: 20px;\n#         font-weight: bold;\n#         border-radius: 25px;\n#     }\n\n#     QPushButton:hover {\n#         background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #7d8488, stop:1 black);\n#     }\n\n#     QPushButton:pressed {\n#         background-color: qlineargradient(x1:1, y1:0, x2:1, y2:0.3, stop:0 #6a7073, stop:1 black);\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/style/demo10.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt, QRectF\nfrom PyQt5.QtWidgets import QPushButton\nfrom PyQt5.QtGui import QPainter, QPen, QColor, QLinearGradient, QFont, QFontMetricsF\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\n\nclass QtBoxStyleButton10(QPushButton):\n    def __init__(self):\n        super(QtBoxStyleButton10, self).__init__(str(Path(__file__)))\n        self.btn_rect = None\n        self.btn_state = \"off\"\n        self.setFixedSize(90, 90)\n\n    def paintEvent(self, event):\n        painter = QPainter(self)\n        painter.setRenderHint(QPainter.Antialiasing)\n\n        if self.btn_state == \"on\":\n            offset = 40\n            font_size = 15\n        else:\n            offset = 30\n            font_size = 20\n\n        painter.setPen(Qt.NoPen)\n        base_linear_gradient = QLinearGradient(self.rect().topLeft(), self.rect().bottomRight())\n        base_linear_gradient.setColorAt(0, QColor(117, 117, 117))\n        base_linear_gradient.setColorAt(1, QColor(97, 97, 97))\n        painter.setBrush(base_linear_gradient)\n        painter.drawEllipse(self.rect())\n\n        self.btn_rect = QRectF(self.rect().left()+offset/2, self.rect().top()+offset/2, self.rect().width()-offset, self.rect().height()-offset)\n        btn_linear_gradient = QLinearGradient(self.btn_rect.topLeft(), self.btn_rect.bottomRight())\n        btn_linear_gradient.setColorAt(0, QColor(241, 112, 117))\n        btn_linear_gradient.setColorAt(1, QColor(223, 84, 89))\n        painter.setBrush(btn_linear_gradient)\n        painter.drawEllipse(self.btn_rect)\n\n        pen = QPen()\n        pen.setColor(Qt.white)\n        painter.setPen(pen)\n\n        font = QFont()\n        font.setBold(True)\n        font.setPixelSize(font_size)\n        painter.setFont(font)\n        font_metrics = QFontMetricsF(font)\n        text_width = font_metrics.width(\"BTN\")\n        painter.drawText(int(self.rect().width()/2-text_width/2), int(self.rect().height()/2+5), \"BTN\")\n\n    def mousePressEvent(self, event):\n        if event.button() != Qt.LeftButton or not self.btn_rect.contains(event.pos()):\n            return\n\n        self.btn_state = \"on\"\n        self.update()\n\n    def mouseReleaseEvent(self, event):\n        self.btn_state = \"off\"\n        self.update()\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt, QRectF\n# from PySide2.QtWidgets import QPushButton\n# from PySide2.QtGui import QPainter, QPen, QColor, QLinearGradient, QFont, QFontMetricsF\n\n\n# class QtBoxStyleButton10(QPushButton):\n#     def __init__(self):\n#         super(QtBoxStyleButton10, self).__init__()\n#         self.btn_rect = None\n#         self.btn_state = \"off\"\n#         self.setFixedSize(90, 90)\n\n#     def paintEvent(self, event):\n#         painter = QPainter(self)\n#         painter.setRenderHint(QPainter.Antialiasing)\n\n#         if self.btn_state == \"on\":\n#             offset = 40\n#             font_size = 15\n#         else:\n#             offset = 30\n#             font_size = 20\n\n#         painter.setPen(Qt.NoPen)\n#         base_linear_gradient = QLinearGradient(self.rect().topLeft(), self.rect().bottomRight())\n#         base_linear_gradient.setColorAt(0, QColor(117, 117, 117))\n#         base_linear_gradient.setColorAt(1, QColor(97, 97, 97))\n#         painter.setBrush(base_linear_gradient)\n#         painter.drawEllipse(self.rect())\n\n#         self.btn_rect = QRectF(self.rect().left()+offset/2, self.rect().top()+offset/2, self.rect().width()-offset, self.rect().height()-offset)\n#         btn_linear_gradient = QLinearGradient(self.btn_rect.topLeft(), self.btn_rect.bottomRight())\n#         btn_linear_gradient.setColorAt(0, QColor(241, 112, 117))\n#         btn_linear_gradient.setColorAt(1, QColor(223, 84, 89))\n#         painter.setBrush(btn_linear_gradient)\n#         painter.drawEllipse(self.btn_rect)\n\n#         pen = QPen()\n#         pen.setColor(Qt.white)\n#         painter.setPen(pen)\n\n#         font = QFont()\n#         font.setBold(True)\n#         font.setPixelSize(font_size)\n#         painter.setFont(font)\n#         font_metrics = QFontMetricsF(font)\n#         text_width = font_metrics.width(\"BTN\")\n#         painter.drawText(int(self.rect().width()/2-text_width/2), int(self.rect().height()/2+5), \"BTN\")\n\n#     def mousePressEvent(self, event):\n#         if event.button() != Qt.LeftButton or not self.btn_rect.contains(event.pos()):\n#             return\n\n#         self.btn_state = \"on\"\n#         self.update()\n\n#     def mouseReleaseEvent(self, event):\n#         self.btn_state = \"off\"\n#         self.update()\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPUSHBUTTON10_H\n# #define QTBOXSTYLEPUSHBUTTON10_H\n# #include <QPushButton>\n# #include <QPaintEvent>\n# #include <QMouseEvent>\n# #include <QString>\n# #include <QRectF>\n\n# class QtBoxStylePushButton10 : public QPushButton\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStylePushButton10(QWidget *parent = nullptr);\n\n# protected:\n#     void paintEvent(QPaintEvent *event);\n#     void mousePressEvent(QMouseEvent *event);\n#     void mouseReleaseEvent(QMouseEvent *event);\n\n# private:\n#     QRectF btnRect;\n#     QString btnState;\n# };\n# #endif // QTBOXSTYLEPUSHBUTTON10_H\n\n\n\n# #include \"qtboxstylepushbutton10.h\"\n# #include <QLinearGradient>\n# #include <QFontMetricsF>\n# #include <QPainter>\n# #include <QFont>\n# #include <Qt>\n\n# QtBoxStylePushButton10::QtBoxStylePushButton10(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setFixedSize(90, 90);\n# }\n\n# void QtBoxStylePushButton10::paintEvent(QPaintEvent *event)\n# {\n#     QPainter painter = QPainter(this);\n#     painter.setRenderHint(QPainter::Antialiasing);\n\n#     int offset;\n#     int fontSize;\n#     if (btnState == \"on\") {\n#         offset = 40;\n#         fontSize = 15;\n#     }\n#     else {\n#         offset = 30;\n#         fontSize = 20;\n#     }\n\n#     painter.setPen(Qt::NoPen);\n#     QLinearGradient baseLinearGradient;\n#     baseLinearGradient = QLinearGradient(rect().topLeft(), rect().bottomRight());\n#     baseLinearGradient.setColorAt(0, QColor(117, 117, 117));\n#     baseLinearGradient.setColorAt(1, QColor(97, 97, 97));\n#     painter.setBrush(baseLinearGradient);\n#     painter.drawEllipse(rect());\n\n#     btnRect = QRectF(rect().left()+offset/2, rect().top()+offset/2, rect().width()-offset, rect().height()-offset);\n#     baseLinearGradient = QLinearGradient(rect().topLeft(), rect().bottomRight());\n#     baseLinearGradient.setColorAt(0, QColor(241, 112, 117));\n#     baseLinearGradient.setColorAt(1, QColor(223, 84, 89));\n#     painter.setBrush(baseLinearGradient);\n#     painter.drawEllipse(btnRect);\n\n#     QPen pen = QPen();\n#     pen.setColor(Qt::white);\n#     painter.setPen(pen);\n\n#     QFont font = QFont();\n#     font.setBold(true);\n#     font.setPixelSize(fontSize);\n#     painter.setFont(font);\n#     QFontMetricsF fontMetrics = QFontMetricsF(font);\n#     float textWidth = fontMetrics.size(Qt::TextSingleLine, \"BTN\").width();\n#     painter.drawText(int(rect().width()/2-textWidth/2), int(rect().height()/2+5), \"BTN\");\n# }\n\n# void QtBoxStylePushButton10::mousePressEvent(QMouseEvent *event)\n# {\n#     if (event->button() != Qt::LeftButton || !btnRect.contains(event->pos())) {\n#         return;\n#     }\n#     btnState = \"on\";\n#     update();\n# }\n\n# void QtBoxStylePushButton10::mouseReleaseEvent(QMouseEvent *event)\n# {\n#     btnState = \"off\";\n#     update();\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/style/demo11.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt, QRectF\nfrom PyQt5.QtWidgets import QPushButton\nfrom PyQt5.QtGui import QPainter, QPen, QColor, QFont\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\n\nclass QtBoxStyleButton11(QPushButton):\n    def __init__(self):\n        super(QtBoxStyleButton11, self).__init__(str(Path(__file__)))\n        self.btn_state = \"off\"\n        self.setFixedSize(90, 90)\n        self.setWindowFlags(Qt.WindowCloseButtonHint | Qt.MSWindowsFixedSizeDialogHint)\n\n    def paintEvent(self, event):\n        painter = QPainter(self)\n        painter.setRenderHint(QPainter.Antialiasing)\n\n        if self.btn_state == \"on\":\n            font_size = 15\n            shadow_color = QColor(176, 176, 176)\n            white_part_color = QColor(238, 238, 238)\n        else:\n            font_size = 16\n            shadow_color = QColor(208, 208, 208)\n            white_part_color = QColor(252, 252, 252)\n\n        painter.setPen(Qt.NoPen)\n        painter.setBrush(shadow_color)\n        btn_shadow_part_rect = self.rect()\n        painter.drawRoundedRect(btn_shadow_part_rect, 5, 5)\n\n        offset = 20\n        btn_white_part_rect = QRectF(self.rect().left()+offset/2, self.rect().top()+offset/4, self.rect().width()-offset, self.rect().height()-offset)\n        painter.setBrush(white_part_color)\n        painter.drawRoundedRect(btn_white_part_rect, 5, 5)\n\n        pen = QPen()\n        pen.setColor(Qt.black)\n        painter.setPen(pen)\n\n        font = QFont()\n        font.setBold(True)\n        font.setPixelSize(font_size)\n        painter.setFont(font)\n        painter.drawText(int(btn_white_part_rect.x()+2), int(btn_white_part_rect.y()+font_size), \"BTN\")\n\n    def mousePressEvent(self, event):\n        if event.button() == Qt.LeftButton:\n            self.setFixedSize(86, 86)\n            self.btn_state = \"on\"\n            self.update()\n\n    def mouseReleaseEvent(self, event):\n        if event.button() == Qt.LeftButton:\n            self.setFixedSize(90, 90)\n            self.btn_state = \"off\"\n            self.update()\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt, QRectF\n# from PySide2.QtWidgets import QPushButton\n# from PySide2.QtGui import QPainter, QPen, QColor, QFont\n\n\n# class QtBoxStyleButton11(QPushButton):\n#     def __init__(self):\n#         super(QtBoxStyleButton11, self).__init__()\n#         self.btn_state = \"off\"\n#         self.setFixedSize(90, 90)\n#         self.setWindowFlags(Qt.WindowCloseButtonHint | Qt.MSWindowsFixedSizeDialogHint)\n\n#     def paintEvent(self, event):\n#         painter = QPainter(self)\n#         painter.setRenderHint(QPainter.Antialiasing)\n\n#         if self.btn_state == \"on\":\n#             font_size = 15\n#             shadow_color = QColor(176, 176, 176)\n#             white_part_color = QColor(238, 238, 238)\n#         else:\n#             font_size = 16\n#             shadow_color = QColor(208, 208, 208)\n#             white_part_color = QColor(252, 252, 252)\n\n#         painter.setPen(Qt.NoPen)\n#         painter.setBrush(shadow_color)\n#         btn_shadow_part_rect = self.rect()\n#         painter.drawRoundedRect(btn_shadow_part_rect, 5, 5)\n\n#         offset = 20\n#         btn_white_part_rect = QRectF(self.rect().left() + offset / 2, self.rect().top() + offset / 4, self.rect().width() - offset, self.rect().height() - offset)\n#         painter.setBrush(white_part_color)\n#         painter.drawRoundedRect(btn_white_part_rect, 5, 5)\n\n#         pen = QPen()\n#         pen.setColor(Qt.black)\n#         painter.setPen(pen)\n\n#         font = QFont()\n#         font.setBold(True)\n#         font.setPixelSize(font_size)\n#         painter.setFont(font)\n#         painter.drawText(int(btn_white_part_rect.x() + 2), int(btn_white_part_rect.y() + font_size), \"BTN\")\n\n#     def mousePressEvent(self, event):\n#         if event.button() == Qt.LeftButton:\n#             self.setFixedSize(86, 86)\n#             self.btn_state = \"on\"\n#             self.update()\n\n#     def mouseReleaseEvent(self, event):\n#         if event.button() == Qt.LeftButton:\n#             self.setFixedSize(90, 90)\n#             self.btn_state = \"off\"\n#             self.update()\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPUSHBUTTON11_H\n# #define QTBOXSTYLEPUSHBUTTON11_H\n# #include <QPushButton>\n# #include <QPaintEvent>\n# #include <QMouseEvent>\n# #include <QString>\n\n# class QtBoxStylePushButton11 : public QPushButton\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStylePushButton11(QWidget *parent = nullptr);\n\n# protected:\n#     void paintEvent(QPaintEvent *event);\n#     void mousePressEvent(QMouseEvent *event);\n#     void mouseReleaseEvent(QMouseEvent *event);\n\n# private:\n#     QString btnState = \"off\";\n# };\n# #endif // QTBOXSTYLEPUSHBUTTON11_H\n\n\n\n# #include \"qtboxstylepushbutton11.h\"\n# #include <QFontMetricsF>\n# #include <QPainter>\n# #include <QColor>\n# #include <QRectF>\n# #include <QFont>\n# #include <QRect>\n# #include <Qt>\n\n# QtBoxStylePushButton11::QtBoxStylePushButton11(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setFixedSize(90, 90);\n#     setWindowFlags(Qt::WindowCloseButtonHint | Qt::MSWindowsFixedSizeDialogHint);\n# }\n\n# void QtBoxStylePushButton11::paintEvent(QPaintEvent *event)\n# {\n#     QPainter painter = QPainter(this);\n#     painter.setRenderHint(QPainter::Antialiasing);\n\n#     int fontSize;\n#     QColor shadowColor;\n#     QColor whitePartColor;\n#     if (btnState == \"on\") {\n#         fontSize = 15;\n#         shadowColor = QColor(176, 176, 176);\n#         whitePartColor = QColor(238, 238, 238);\n#     }\n#     else {\n#         fontSize = 16;\n#         shadowColor = QColor(208, 208, 208);\n#         whitePartColor = QColor(252, 252, 252);\n#     }\n\n#     painter.setPen(Qt::NoPen);\n#     painter.setBrush(shadowColor);\n#     QRectF btnShadowPartRect = rect();\n#     painter.drawRoundedRect(btnShadowPartRect, 5, 5);\n\n#     int offset = 20;\n#     QRectF btnWhitePartRect = QRectF(rect().left()+offset/2, rect().top()+offset/4, rect().width()-offset, rect().height()-offset);\n#     painter.setBrush(whitePartColor);\n#     painter.drawRoundedRect(btnWhitePartRect, 5, 5);\n\n#     QPen pen = QPen();\n#     pen.setColor(Qt::black);\n#     painter.setPen(pen);\n\n#     QFont font = QFont();\n#     font.setBold(true);\n#     font.setPixelSize(fontSize);\n#     painter.setFont(font);\n#     painter.drawText(int(btnWhitePartRect.x()+2), int(btnWhitePartRect.y()+fontSize), \"BTN\");\n# }\n\n# void QtBoxStylePushButton11::mousePressEvent(QMouseEvent *event)\n# {\n#     if (event->button() == Qt::LeftButton) {\n#         setFixedSize(86, 86);\n#         btnState = \"on\";\n#         update();\n#     }\n# }\n\n# void QtBoxStylePushButton11::mouseReleaseEvent(QMouseEvent *event)\n# {\n#     if (event->button() == Qt::LeftButton) {\n#         setFixedSize(90, 90);\n#         btnState = \"off\";\n#         update();\n#     }\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/style/demo12.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import pyqtProperty, QPropertyAnimation\nfrom PyQt5.QtWidgets import QPushButton\nfrom PyQt5.QtGui import QColor\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\n\nclass QtBoxStyleButton12(QPushButton):\n    def __init__(self):\n        super(QtBoxStyleButton12, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 40)\n        self.setText(\"BUTTON\")\n        self._color = QColor()\n\n        self.color_anim = QPropertyAnimation(self, b\"color\")\n        self.color_anim.setDuration(6000)\n        self.color_anim.setStartValue(QColor(0, 0, 0))\n        self.color_anim.setEndValue(QColor(255, 255, 255))\n        self.color_anim.start()\n\n    @pyqtProperty(QColor)\n    def color(self):\n        return self._color\n\n    @color.setter\n    def color(self, value):\n        self._color = value\n        red = value.red()\n        green = value.green()\n        blue = value.blue()\n        self.setStyleSheet(f\"background-color: rgb({red}, {green}, {blue})\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Property, QPropertyAnimation\n# from PySide2.QtWidgets import QPushButton\n# from PySide2.QtGui import QColor\n\n\n# class QtBoxStyleButton12(QPushButton):\n#     def __init__(self):\n#         super(QtBoxStyleButton12, self).__init__()\n#         self.setFixedSize(150, 40)\n#         self.setText(\"BUTTON\")\n#         self._color = QColor()\n\n#         self.color_anim = QPropertyAnimation(self, b\"color\")\n#         self.color_anim.setDuration(6000)\n#         self.color_anim.setStartValue(QColor(0, 0, 0))\n#         self.color_anim.setEndValue(QColor(255, 255, 255))\n#         self.color_anim.start()\n\n#     @Property(QColor)\n#     def color(self):\n#         return self._color\n\n#     @color.setter\n#     def color(self, value):\n#         self._color = value\n#         red = value.red()\n#         green = value.green()\n#         blue = value.blue()\n#         self.setStyleSheet(f\"background-color: rgb({red}, {green}, {blue})\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPUSHBUTTON12_H\n# #define QTBOXSTYLEPUSHBUTTON12_H\n# #include <QPushButton>\n# #include <QColor>\n\n# class QtBoxStylePushButton12 : public QPushButton\n# {\n#     Q_OBJECT\n#     Q_PROPERTY(QColor color READ color WRITE setColor);\n\n# public:\n#     QtBoxStylePushButton12(QWidget *parent = nullptr);\n#     QColor color() const;\n#     void setColor(const QColor &value);\n\n# private:\n#     QColor _color;\n# };\n# #endif // QTBOXSTYLEPUSHBUTTON12_H\n\n\n\n# #include \"qtboxstylepushbutton12.h\"\n# #include <QPropertyAnimation>\n\n# QtBoxStylePushButton12::QtBoxStylePushButton12(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setFixedSize(150, 40);\n#     setText(\"BUTTON\");\n\n#     QPropertyAnimation *colorAnim = new QPropertyAnimation(this, \"color\");\n#     colorAnim->setDuration(1000);\n#     colorAnim->setStartValue(QColor(0, 0, 0));\n#     colorAnim->setEndValue(QColor(255, 255, 255));\n#     colorAnim->start();\n# }\n\n# QColor QtBoxStylePushButton12::color() const\n# {\n#     return _color;\n# }\n\n# void QtBoxStylePushButton12::setColor(const QColor &value)\n# {\n#     _color = value;\n#     int red = value.red();\n#     int green = value.green();\n#     int blue = value.blue();\n#     setStyleSheet(QString(\"background-color: rgb(%1, %2, %3)\").arg(QString::number(red), QString::number(green), QString::number(blue)));\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/style/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\n\nclass QtBoxStyleButton2(QPushButton):\n    def __init__(self):\n        super(QtBoxStyleButton2, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 50)\n        self.setText(\"BUTTON\")\n        self.setStyleSheet(\"\"\"\n        QPushButton {\n            background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #47a7ed, stop: 1 #a967b2);\n            color: white;\n            font-size: 20px;\n            font-weight: bold;\n            border-radius: 25px;\n        }\n        \n        QPushButton:hover {\n            background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #459ee0, stop: 1 #995da1);\n        }\n        \n        QPushButton:pressed {\n               background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #4093d1, stop: 1 #87538e);\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QPushButton\n\n\n# class QtBoxStyleButton2(QPushButton):\n#     def __init__(self):\n#         super(QtBoxStyleButton2, self).__init__()\n#         self.setFixedSize(150, 50)\n#         self.setText(\"BUTTON\")\n#         self.setStyleSheet(\"\"\"\n#         QPushButton {\n#             background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #47a7ed, stop: 1 #a967b2);\n#             color: white;\n#             font-size: 20px;\n#             font-weight: bold;\n#             border-radius: 25px;\n#         }\n\n#         QPushButton:hover {\n#             background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #459ee0, stop: 1 #995da1);\n#         }\n\n#         QPushButton:pressed {\n#                background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #4093d1, stop: 1 #87538e);\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPUSHBUTTON2_H\n# #define QTBOXSTYLEPUSHBUTTON2_H\n# #include <QPushButton>\n\n# class QtBoxStylePushButton2 : public QPushButton\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStylePushButton2(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEPUSHBUTTON2_H\n\n\n\n# #include \"qtboxstylepushbutton2.h\"\n\n# QtBoxStylePushButton2::QtBoxStylePushButton2(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setFixedSize(150, 50);\n#     setText(\"BUTTON\");\n#     setStyleSheet(R\"(\n#     QPushButton {\n#         background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #47a7ed, stop: 1 #a967b2);\n#         color: white;\n#         font-size: 20px;\n#         font-weight: bold;\n#         border-radius: 25px;\n#     }\n\n#     QPushButton:hover {\n#         background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #459ee0, stop: 1 #995da1);\n#     }\n\n#     QPushButton:pressed {\n#            background-color: qlineargradient(x1:0, y1:0.5, x2:1, y2:0.5, stop:0 #4093d1, stop: 1 #87538e);\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/style/demo3.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\n\nclass QtBoxStyleButton3(QPushButton):\n    def __init__(self):\n        super(QtBoxStyleButton3, self).__init__(str(Path(__file__)))\n        self.setFixedSize(90, 90)\n        self.setText(\"BTN\")\n        self.setStyleSheet(\"\"\"\n        QPushButton {\n            background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #454b4f, stop: 1 #1d2225);\n            color: white;\n            border-radius: 45px;\n            font-size: 18px;\n            font-weight: bold;\n            border: 10px solid #f9f9f9;\n        }\n        \n        QPushButton:hover {\n            border: 10px solid white;\n            background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #35393c, stop: 1 #101214);\n        }\n        \n        QPushButton:pressed {\n            color: black;\n            border: 10px solid black;\n            background-color: white;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QPushButton\n\n\n# class QtBoxStyleButton3(QPushButton):\n#     def __init__(self):\n#         super(QtBoxStyleButton3, self).__init__()\n#         self.setFixedSize(90, 90)\n#         self.setText(\"BTN\")\n#         self.setStyleSheet(\"\"\"\n#         QPushButton {\n#             background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #454b4f, stop: 1 #1d2225);\n#             color: white;\n#             border-radius: 45px;\n#             font-size: 18px;\n#             font-weight: bold;\n#             border: 10px solid #f9f9f9;\n#         }\n\n#         QPushButton:hover {\n#             border: 10px solid white;\n#             background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #35393c, stop: 1 #101214);\n#         }\n\n#         QPushButton:pressed {\n#             color: black;\n#             border: 10px solid black;\n#             background-color: white;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPUSHBUTTON3_H\n# #define QTBOXSTYLEPUSHBUTTON3_H\n# #include <QPushButton>\n\n# class QtBoxStylePushButton3 : public QPushButton\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStylePushButton3(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEPUSHBUTTON3_H\n\n\n\n# #include \"qtboxstylepushbutton3.h\"\n\n# QtBoxStylePushButton3::QtBoxStylePushButton3(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setFixedSize(90, 90);\n#     setText(\"BTN\");\n#     setStyleSheet(R\"(\n#     QPushButton {\n#         background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #454b4f, stop: 1 #1d2225);\n#         color: white;\n#         border-radius: 45px;\n#         font-size: 18px;\n#         font-weight: bold;\n#         border: 10px solid #f9f9f9;\n#     }\n\n#     QPushButton:hover {\n#         border: 10px solid white;\n#         background-color: qlineargradient(x1:1, y1:0, x2:1, y2:1, stop:0 #35393c, stop: 1 #101214);\n#     }\n\n#     QPushButton:pressed {\n#         color: black;\n#         border: 10px solid black;\n#         background-color: white;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/style/demo4.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QPushButton\nfrom PyQt5.QtGui import QPainter, QPen, QColor, QPainterPath, QFont, QFontMetricsF\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\n\nclass QtBoxStyleButton4(QPushButton):\n    def __init__(self):\n        super(QtBoxStyleButton4, self).__init__(str(Path(__file__)))\n        self.btn_state = \"normal\"\n        self.setFixedSize(90, 90)\n        self.setAttribute(Qt.WA_TranslucentBackground)\n\n        self.setStyleSheet(\"\"\"\n        QPushButton {\n            font-size: 20px;\n            font-weight: bold;\n        }\n        \"\"\")\n\n    def paintEvent(self, event):\n        painter = QPainter(self)\n\n        if self.btn_state == \"normal\":\n            painter.setBrush(QColor(59, 63, 66))\n            pen = QPen()\n            pen.setColor(Qt.white)\n            pen .setWidth(3)\n            painter.setPen(pen)\n\n        elif self.btn_state == \"hover\":\n            painter.setBrush(Qt.black)\n            pen = QPen()\n            pen.setColor(Qt.white)\n            pen.setWidth(3)\n            painter.setPen(pen)\n\n        elif self.btn_state == \"press\":\n            painter.setBrush(Qt.white)\n            pen = QPen()\n            pen.setColor(Qt.black)\n            pen.setWidth(3)\n            painter.setPen(pen)\n\n        path = QPainterPath()\n        path.moveTo(self.rect().left()+self.rect().width()/2, self.rect().top())\n        path.lineTo(self.rect().bottomLeft())\n        path.lineTo(self.rect().bottomRight())\n        path.lineTo(self.rect().left()+self.rect().width()/2, self.rect().top())\n        painter.drawPath(path)\n\n        font = QFont()\n        font.setBold(True)\n        font.setPixelSize(20)\n        painter.setFont(font)\n        font_metrics = QFontMetricsF(font)\n        text_width = font_metrics.width(\"BTN\")\n        painter.drawText(int(self.rect().width()/2-text_width/2), int(self.rect().height()/2+20), \"BTN\")\n\n    def mousePressEvent(self, event):\n        self.btn_state = \"press\"\n        self.update()\n\n    def mouseReleaseEvent(self, event):\n        self.btn_state = \"hover\"\n        self.update()\n\n    def enterEvent(self, event):\n        self.btn_state = \"hover\"\n        self.update()\n\n    def leaveEvent(self, event):\n        self.btn_state = \"normal\"\n        self.update()\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QPushButton\n# from PySide2.QtGui import QPainter, QPen, QColor, QPainterPath, QFont, QFontMetricsF\n\n\n# class QtBoxStyleButton4(QPushButton):\n#     def __init__(self):\n#         super(QtBoxStyleButton4, self).__init__()\n#         self.btn_state = \"normal\"\n#         self.setFixedSize(90, 90)\n#         self.setAttribute(Qt.WA_TranslucentBackground)\n\n#         self.setStyleSheet(\"\"\"\n#         QPushButton {\n#             font-size: 20px;\n#             font-weight: bold;\n#         }\n#         \"\"\")\n\n#     def paintEvent(self, event):\n#         painter = QPainter(self)\n\n#         if self.btn_state == \"normal\":\n#             painter.setBrush(QColor(59, 63, 66))\n#             pen = QPen()\n#             pen.setColor(Qt.white)\n#             pen .setWidth(3)\n#             painter.setPen(pen)\n\n#         elif self.btn_state == \"hover\":\n#             painter.setBrush(Qt.black)\n#             pen = QPen()\n#             pen.setColor(Qt.white)\n#             pen.setWidth(3)\n#             painter.setPen(pen)\n\n#         elif self.btn_state == \"press\":\n#             painter.setBrush(Qt.white)\n#             pen = QPen()\n#             pen.setColor(Qt.black)\n#             pen.setWidth(3)\n#             painter.setPen(pen)\n\n#         path = QPainterPath()\n#         path.moveTo(self.rect().left()+self.rect().width()/2, self.rect().top())\n#         path.lineTo(self.rect().bottomLeft())\n#         path.lineTo(self.rect().bottomRight())\n#         path.lineTo(self.rect().left()+self.rect().width()/2, self.rect().top())\n#         painter.drawPath(path)\n\n#         font = QFont()\n#         font.setBold(True)\n#         font.setPixelSize(20)\n#         painter.setFont(font)\n#         font_metrics = QFontMetricsF(font)\n#         text_width = font_metrics.width(\"BTN\")\n#         painter.drawText(int(self.rect().width()/2-text_width/2), int(self.rect().height()/2+20), \"BTN\")\n\n#     def mousePressEvent(self, event):\n#         self.btn_state = \"press\"\n#         self.update()\n\n#     def mouseReleaseEvent(self, event):\n#         self.btn_state = \"hover\"\n#         self.update()\n\n#     def enterEvent(self, event):\n#         self.btn_state = \"hover\"\n#         self.update()\n\n#     def leaveEvent(self, event):\n#         self.btn_state = \"normal\"\n#         self.update()\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPUSHBUTTON4_H\n# #define QTBOXSTYLEPUSHBUTTON4_H\n# #include <QPushButton>\n# #include <QString>\n# #include <QPaintEvent>\n# #include <QMouseEvent>\n# #include <QEnterEvent>\n# #include <QEvent>\n\n# class QtBoxStylePushButton4 : public QPushButton\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStylePushButton4(QWidget *parent = nullptr);\n\n# protected:\n#     void paintEvent(QPaintEvent *evnet);\n#     void mousePressEvent(QMouseEvent *event);\n#     void mouseReleaseEvent(QMouseEvent *event);\n#     void enterEvent(QEnterEvent *event);\n#     void leaveEvent(QEvent *event);\n\n# private:\n#     QString btnState = \"normal\";\n# };\n# #endif // QTBOXSTYLEPUSHBUTTON4_H\n\n\n\n# #include \"qtboxstylepushbutton4.h\"\n# #include <QFontMetricsF>\n# #include <QPainterPath>\n# #include <QPainter>\n# #include <QColor>\n# #include <QFont>\n# #include <QPen>\n# #include <Qt>\n\n# QtBoxStylePushButton4::QtBoxStylePushButton4(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setFixedSize(90, 90);\n#     setAttribute(Qt::WA_TranslucentBackground);\n#     setStyleSheet(R\"(\n#     QPushButton {\n#         font-size: 20px;\n#         font-weight: bold;\n#     }\n#     )\");\n# }\n\n# void QtBoxStylePushButton4::paintEvent(QPaintEvent *event)\n# {\n#     QPainter painter = QPainter(this);\n\n#     if (btnState == \"normal\") {\n#         painter.setBrush(QColor(59, 63, 66));\n#         QPen pen = QPen();\n#         pen.setColor(Qt::white);\n#         pen.setWidth(3);\n#         painter.setPen(pen);\n#     }\n#     else if (btnState == \"hover\") {\n#         painter.setBrush(Qt::black);\n#         QPen pen = QPen();\n#         pen.setColor(Qt::white);\n#         pen.setWidth(3);\n#         painter.setPen(pen);\n#     }\n#     else if (btnState == \"press\") {\n#         painter.setBrush(Qt::white);\n#         QPen pen = QPen();\n#         pen.setColor(Qt::black);\n#         pen.setWidth(3);\n#         painter.setPen(pen);\n#     }\n\n#     QPainterPath path = QPainterPath();\n#     path.moveTo(rect().left()+rect().width()/2, rect().top());\n#     path.lineTo(rect().bottomLeft());\n#     path.lineTo(rect().bottomRight());\n#     path.lineTo(rect().left()+rect().width()/2, rect().top());\n#     painter.drawPath(path);\n\n#     QFont font = QFont();\n#     font.setBold(true);\n#     font.setPixelSize(20);\n#     painter.setFont(font);\n#     QFontMetricsF fontMetrics = QFontMetricsF(font);\n#     float textWidth = fontMetrics.size(Qt::TextSingleLine, \"BTN\").width();\n#     painter.drawText(int(rect().width()/2-textWidth/2), int(rect().height()/2+20), \"BTN\");\n# }\n\n# void QtBoxStylePushButton4::mousePressEvent(QMouseEvent *event)\n# {\n#     btnState = \"press\";\n#     update();\n# }\n\n# void QtBoxStylePushButton4::mouseReleaseEvent(QMouseEvent *event)\n# {\n#     btnState = \"hover\";\n#     update();\n# }\n\n# void QtBoxStylePushButton4::enterEvent(QEnterEvent *event)\n# {\n#     btnState = \"hover\";\n#     update();\n# }\n\n# void QtBoxStylePushButton4::leaveEvent(QEvent *event)\n# {\n#     btnState = \"normal\";\n#     update();\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/style/demo5.py",
    "content": "# PyQt\nfrom PyQt5.QtGui import QIcon\nfrom PyQt5.QtCore import QSize\nfrom PyQt5.QtWidgets import QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\nPATH_TO_IMG = str(Path(__file__).parent.parent.parent.parent / \"res/images/plus.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleButton5(QPushButton):\n    def __init__(self):\n        super(QtBoxStyleButton5, self).__init__(str(Path(__file__)))\n        self.setFixedSize(90, 90)\n        self.setIconSize(QSize(80, 80))\n        self.setIcon(QIcon(PATH_TO_IMG))\n        self.setStyleSheet(\"\"\"\n        QPushButton {\n            background-color: qlineargradient(x1:1, y1:0, x2:0, y2:1, stop:0 #f9ab6a, stop: 1 #f08833);\n            border-radius: 45px;\n            border: none\n        }\n\n        QPushButton:hover {\n            background-color: qlineargradient(x1:1, y1:0, x2:0, y2:1, stop:0 #f7a25b, stop: 1 #f19040);\n        }\n\n        QPushButton:pressed {\n            background-color: qlineargradient(x1:1, y1:0, x2:0, y2:1, stop:0 #e39b5f, stop: 1 #e58637);\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtGui import QIcon\n# from PySide2.QtCore import QSize\n# from PySide2.QtWidgets import QPushButton\n\n\n# class QtBoxStyleButton5(QPushButton):\n#     def __init__(self):\n#         super(QtBoxStyleButton5, self).__init__()\n#         self.setFixedSize(90, 90)\n#         self.setIconSize(QSize(80, 80))\n#         self.setIcon(QIcon(PATH_TO_IMG))\n#         self.setStyleSheet(\"\"\"\n#         QPushButton {\n#             background-color: qlineargradient(x1:1, y1:0, x2:0, y2:1, stop:0 #f9ab6a, stop: 1 #f08833);\n#             border-radius: 45px;\n#             border: none\n#         }\n\n#         QPushButton:hover {\n#             background-color: qlineargradient(x1:1, y1:0, x2:0, y2:1, stop:0 #f7a25b, stop: 1 #f19040);\n#         }\n\n#         QPushButton:pressed {\n#             background-color: qlineargradient(x1:1, y1:0, x2:0, y2:1, stop:0 #e39b5f, stop: 1 #e58637);\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPUSHBUTTON5_H\n# #define QTBOXSTYLEPUSHBUTTON5_H\n# #include <QPushButton>\n\n# class QtBoxStylePushButton5 : public QPushButton\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStylePushButton5(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEPUSHBUTTON5_H\n\n\n\n# #include \"qtboxstylepushbutton5.h\"\n# #include <QSize>\n# #include <QIcon>\n\n# QtBoxStylePushButton5::QtBoxStylePushButton5(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setFixedSize(90, 90);\n#     setIconSize(QSize(80, 80));\n#     setIcon(QIcon(PATH_TO_IMG));\n#     setStyleSheet(R\"(\n#     QPushButton {\n#         background-color: qlineargradient(x1:1, y1:0, x2:0, y2:1, stop:0 #f9ab6a, stop: 1 #f08833);\n#         border-radius: 45px;\n#         border: none\n#     }\n\n#     QPushButton:hover {\n#         background-color: qlineargradient(x1:1, y1:0, x2:0, y2:1, stop:0 #f7a25b, stop: 1 #f19040);\n#     }\n\n#     QPushButton:pressed {\n#         background-color: qlineargradient(x1:1, y1:0, x2:0, y2:1, stop:0 #e39b5f, stop: 1 #e58637);\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/style/demo6.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\n\nclass QtBoxStyleButton6(QPushButton):\n    def __init__(self):\n        super(QtBoxStyleButton6, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 40)\n        self.setText(\"BUTTON\")\n        self.setStyleSheet(\"\"\"\n        QPushButton {\n            background-color: #57bd6a;\n            color: #f9ffff;\n            font-size: 20px;\n            font-weight: bold;\n            border-radius: 5px;\n        }\n\n        QPushButton:pressed {\n            background-color: #4eaa5f;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QPushButton\n\n\n# class QtBoxStyleButton6(QPushButton):\n#     def __init__(self):\n#         super(QtBoxStyleButton6, self).__init__()\n#         self.setFixedSize(150, 40)\n#         self.setText(\"BUTTON\")\n#         self.setStyleSheet(\"\"\"\n#         QPushButton {\n#             background-color: #57bd6a;\n#             color: #f9ffff;\n#             font-size: 20px;\n#             font-weight: bold;\n#             border-radius: 5px;\n#         }\n\n#         QPushButton:pressed {\n#             background-color: #4eaa5f;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPUSHBUTTON6_H\n# #define QTBOXSTYLEPUSHBUTTON6_H\n# #include <QPushButton>\n\n# class QtBoxStylePushButton6 : public QPushButton\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStylePushButton6(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEPUSHBUTTON6_H\n\n\n\n# #include \"qtboxstylepushbutton6.h\"\n\n# QtBoxStylePushButton6::QtBoxStylePushButton6(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setFixedSize(150, 40);\n#     setText(\"BUTTON\");\n#     setStyleSheet(R\"(\n#     QPushButton {\n#         background-color: #57bd6a;\n#         color: #f9ffff;\n#         font-size: 20px;\n#         font-weight: bold;\n#         border-radius: 5px;\n#     }\n\n#     QPushButton:pressed {\n#         background-color: #4eaa5f;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/style/demo7.py",
    "content": "# PyQt\nfrom PyQt5.QtGui import QIcon\nfrom PyQt5.QtCore import QSize, Qt\nfrom PyQt5.QtWidgets import QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\nPATH_TO_IMG = str(Path(__file__).parent.parent.parent.parent / \"res/images/search.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleButton7(QPushButton):\n    def __init__(self):\n        super(QtBoxStyleButton7, self).__init__(str(Path(__file__)))\n        self.setText(\"BUTTON \")\n        self.setFixedSize(150, 40)\n        self.setIconSize(QSize(25, 25))\n        self.setIcon(QIcon(PATH_TO_IMG))\n        self.setLayoutDirection(Qt.RightToLeft)\n        self.setStyleSheet(\"\"\"\n        QPushButton {\n            background-color: #292929;\n            border-radius: 5px;\n            font-size: 20px;\n            font-weight: bold;\n            color: white;\n            border: 1px solid white;\n        }\n\n        QPushButton:pressed {\n            background-color: black;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtGui import QIcon\n# from PySide2.QtCore import QSize, Qt\n# from PySide2.QtWidgets import QPushButton\n\n\n# class QtBoxStyleButton7(QPushButton):\n#     def __init__(self):\n#         super(QtBoxStyleButton7, self).__init__()\n#         self.setText(\"BUTTON \")\n#         self.setFixedSize(150, 40)\n#         self.setIconSize(QSize(25, 25))\n#         self.setIcon(QIcon(PATH_TO_IMG))\n#         self.setLayoutDirection(Qt.RightToLeft)\n#         self.setStyleSheet(\"\"\"\n#         QPushButton {\n#             background-color: #292929;\n#             border-radius: 5px;\n#             font-size: 20px;\n#             font-weight: bold;\n#             color: white;\n#             border: 1px solid white;\n#         }\n\n#         QPushButton:pressed {\n#             background-color: black;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPUSHBUTTON7_H\n# #define QTBOXSTYLEPUSHBUTTON7_H\n# #include <QPushButton>\n\n# class QtBoxStylePushButton7 : public QPushButton\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStylePushButton7(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLEPUSHBUTTON7_H\n\n\n\n# #include \"qtboxstylepushbutton7.h\"\n# #include <QSize>\n# #include <QIcon>\n\n# QtBoxStylePushButton7::QtBoxStylePushButton7(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setText(\"BUTTON \");\n#     setFixedSize(150, 40);\n#     setIconSize(QSize(25, 25));\n#     setIcon(QIcon(\":res/images/search.png\"));\n#     setLayoutDirection(Qt::RightToLeft);\n#     setStyleSheet(R\"(\n#     QPushButton {\n#         background-color: #292929;\n#         border-radius: 5px;\n#         font-size: 20px;\n#         font-weight: bold;\n#         color: white;\n#         border: 1px solid white;\n#     }\n\n#     QPushButton:pressed {\n#         background-color: black;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/style/demo8.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt, QRectF\nfrom PyQt5.QtWidgets import QPushButton\nfrom PyQt5.QtGui import QPainter, QPen, QColor\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\n\nclass QtBoxStyleButton8(QPushButton):\n    def __init__(self):\n        super(QtBoxStyleButton8, self).__init__(str(Path(__file__)))\n        self.btn_state = \"on\"\n        self.setFixedSize(80, 40)\n\n    def paintEvent(self, event):\n        painter = QPainter(self)\n        painter.setRenderHint(QPainter.Antialiasing)\n        pen = QPen(Qt.NoPen)\n        painter.setPen(pen)\n\n        if self.btn_state == \"on\":\n            painter.setBrush(QColor(96, 202, 91))\n            rect = QRectF(0, 0, self.width(), self.height())\n            painter.drawRoundedRect(rect, self.height()/2, self.height()/2)\n\n            painter.setBrush(Qt.white)\n            rect = QRectF(self.width()/2-5, 5, self.width()/2, self.height()-5*2)\n            painter.drawRoundedRect(rect, (self.height()-5*2)/2, (self.height()-5*2)/2)\n\n        else:\n            painter.setBrush(QColor(220, 220, 220))\n            rect = QRectF(0, 0, self.width(), self.height())\n            painter.drawRoundedRect(rect, self.height()/2, self.height()/2)\n\n            painter.setBrush(Qt.white)\n            rect = QRectF(5, 5, self.width()/2, self.height()-5*2)\n            painter.drawRoundedRect(rect, (self.height()-5*2)/2, (self.height()-5*2)/2)\n\n    def mousePressEvent(self, event):\n        if event.button() == Qt.LeftButton:\n            if self.btn_state == \"on\":\n                self.btn_state = \"off\"\n            else:\n                self.btn_state = \"on\"\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt, QRectF\n# from PySide2.QtWidgets import QPushButton\n# from PySide2.QtGui import QPainter, QPen, QColor\n\n\n# class QtBoxStyleButton8(QPushButton):\n#     def __init__(self):\n#         super(QtBoxStyleButton8, self).__init__()\n#         self.btn_state = \"on\"\n#         self.setFixedSize(80, 40)\n\n#     def paintEvent(self, event):\n#         painter = QPainter(self)\n#         painter.setRenderHint(QPainter.Antialiasing)\n#         pen = QPen(Qt.NoPen)\n#         painter.setPen(pen)\n\n#         if self.btn_state == \"on\":\n#             painter.setBrush(QColor(96, 202, 91))\n#             rect = QRectF(0, 0, self.width(), self.height())\n#             painter.drawRoundedRect(rect, self.height()/2, self.height()/2)\n\n#             painter.setBrush(Qt.white)\n#             rect = QRectF(self.width()/2-5, 5, self.width()/2, self.height()-5*2)\n#             painter.drawRoundedRect(rect, (self.height()-5*2)/2, (self.height()-5*2)/2)\n\n#         else:\n#             painter.setBrush(QColor(220, 220, 220))\n#             rect = QRectF(0, 0, self.width(), self.height())\n#             painter.drawRoundedRect(rect, self.height()/2, self.height()/2)\n\n#             painter.setBrush(Qt.white)\n#             rect = QRectF(5, 5, self.width()/2, self.height()-5*2)\n#             painter.drawRoundedRect(rect, (self.height()-5*2)/2, (self.height()-5*2)/2)\n\n#     def mousePressEvent(self, event):\n#         if event.button() == Qt.LeftButton:\n#             if self.btn_state == \"on\":\n#                 self.btn_state = \"off\"\n#             else:\n#                 self.btn_state = \"on\"\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPUSHBUTTON8_H\n# #define QTBOXSTYLEPUSHBUTTON8_H\n# #include <QPushButton>\n# #include <QPaintEvent>\n# #include <QMouseEvent>\n\n# class QtBoxStylePushButton8 : public QPushButton\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStylePushButton8(QWidget *parent = nullptr);\n\n# protected:\n#     void paintEvent(QPaintEvent *event);\n#     void mousePressEvent(QMouseEvent *event);\n#\n# private:\n#     QString btnState = \"on\";\n# };\n# #endif // QTBOXSTYLEPUSHBUTTON8_H\n\n\n\n# #include \"qtboxstylepushbutton8.h\"\n# #include <QPainter>\n# #include <QRectF>\n# #include <QPen>\n\n# QtBoxStylePushButton8::QtBoxStylePushButton8(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setFixedSize(80, 40);\n# }\n\n# void QtBoxStylePushButton8::paintEvent(QPaintEvent *event)\n# {\n#     QPainter painter = QPainter(this);\n#     painter.setRenderHint(QPainter::Antialiasing);\n#     QPen pen = QPen(Qt::NoPen);\n#     painter.setPen(pen);\n\n#     if (btnState == \"on\") {\n#         painter.setBrush(QColor(96, 202, 91));\n#         QRectF rect = QRectF(0, 0, width(), height());\n#         painter.drawRoundedRect(rect, height()/2, height()/2);\n\n#         painter.setBrush(Qt::white);\n#         rect = QRectF(width()/2-5, 5, width()/2, height()-5*2);\n#         painter.drawRoundedRect(rect, (height()-5*2)/2, (height()-5*2)/2);\n#     }\n#     else {\n#         painter.setBrush(QColor(220, 220, 220));\n#         QRectF rect = QRectF(0, 0, width(), height());\n#         painter.drawRoundedRect(rect, height()/2, height()/2);\n\n#         painter.setBrush(Qt::white);\n#         rect = QRectF(5, 5, width()/2, height()-5*2);\n#         painter.drawRoundedRect(rect, (height()-5*2)/2, (height()-5*2)/2);\n#     }\n# }\n\n# void QtBoxStylePushButton8::mousePressEvent(QMouseEvent *event)\n# {\n#     if (event->button() == Qt::LeftButton) {\n#         if (btnState == \"on\") {\n#             btnState = \"off\";\n#         }\n#         else {\n#             btnState = \"on\";\n#         }\n#     }\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/pushbutton/style/demo9.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QPushButton, QGraphicsDropShadowEffect\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQPushButton = createWidgetMenuBase(QPushButton)\n\nclass QtBoxStyleButton9(QPushButton):\n    def __init__(self):\n        super(QtBoxStyleButton9, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 40)\n        self.setText(\"BUTTON\")\n        self.add_shadow()\n\n    def add_shadow(self):\n        shadow = QGraphicsDropShadowEffect(self)\n        shadow.setBlurRadius(15)\n        shadow.setOffset(3, 3)\n        shadow.setColor(Qt.gray)\n        self.setGraphicsEffect(shadow)\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QPushButton, QGraphicsDropShadowEffect\n\n\n# class QtBoxStyleButton9(QPushButton):\n#     def __init__(self):\n#         super(QtBoxStyleButton9, self).__init__()\n#         self.setFixedSize(150, 40)\n#         self.setText(\"BUTTON\")\n#         self.add_shadow()\n\n#     def add_shadow(self):\n#         shadow = QGraphicsDropShadowEffect(self)\n#         shadow.setBlurRadius(15)\n#         shadow.setOffset(3, 3)\n#         shadow.setColor(Qt.gray)\n#         self.setGraphicsEffect(shadow)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEPUSHBUTTON9_H\n# #define QTBOXSTYLEPUSHBUTTON9_H\n# #include <QPushButton>\n\n# class QtBoxStylePushButton9 : public QPushButton\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStylePushButton9(QWidget *parent = nullptr);\n\n# private:\n#     void addShadow();\n# };\n# #endif // QTBOXSTYLEPUSHBUTTON9_H\n\n\n\n# #include \"qtboxstylepushbutton9.h\"\n# #include <QGraphicsDropShadowEffect>\n\n# QtBoxStylePushButton9::QtBoxStylePushButton9(QWidget *parent)\n#     : QPushButton(parent)\n# {\n#     setFixedSize(150, 40);\n#     setText(\"BUTTON\");\n#     addShadow();\n# }\n\n# void QtBoxStylePushButton9::addShadow()\n# {\n#     QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);\n#     shadow->setBlurRadius(15);\n#     shadow->setOffset(3, 3);\n#     shadow->setColor(Qt::gray);\n#     setGraphicsEffect(shadow);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/slider/__init__.py",
    "content": "from .func import demo1\nfrom .style import demo1, demo2, demo3, demo4, demo5"
  },
  {
    "path": "src/qtbox/demo/slider/func/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/slider/func/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt, QRectF\nfrom PyQt5.QtGui import QPainter, QColor, QFont, QFontMetricsF\nfrom PyQt5.QtWidgets import QSlider\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQSlider = createWidgetMenuBase(QSlider)\n\nclass QtBoxFuncSlider1(QSlider):\n    def __init__(self):\n        super(QtBoxFuncSlider1, self).__init__(str(Path(__file__)))\n        self.setMinimum(0)\n        self.setMaximum(100)\n        self.setOrientation(Qt.Horizontal)\n        self.is_number_shown = False\n\n    def mousePressEvent(self, event):\n        super(QtBoxFuncSlider1, self).mousePressEvent(event)\n        if event.button() == Qt.LeftButton:\n            self.is_number_shown = True\n            self.update()\n\n    def mouseReleaseEvent(self, event):\n        super(QtBoxFuncSlider1, self).mouseReleaseEvent(event)\n        if event.button() == Qt.LeftButton:\n            self.is_number_shown = False\n            self.update()\n\n    def paintEvent(self, event):\n        super(QtBoxFuncSlider1, self).paintEvent(event)\n\n        if not self.is_number_shown:\n            return\n\n        painter = QPainter(self)\n        painter.setBrush(QColor(220, 220, 220, 120))\n\n        font = QFont()\n        font.setPixelSize(13)\n        painter.setFont(font)\n        font_metrics = QFontMetricsF(font)\n        text_width = font_metrics.width(str(self.value()))\n        text_height = font_metrics.height()\n        x = (self.value() - self.minimum()) / (self.maximum() - self.minimum()) * (self.width() - text_width)\n        rect = QRectF(x, 0, text_width, text_height)\n\n        painter.setPen(Qt.NoPen)\n        painter.drawRoundedRect(rect, 3, 3)\n        painter.setPen(Qt.SolidLine)\n        painter.drawText(int(x), int(text_height), str(self.value()))\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt, QRectF\n# from PySide2.QtGui import QPainter, QColor, QFont, QFontMetricsF\n# from PySide2.QtWidgets import QSlider\n\n\n# class QtBoxFuncSlider1(QSlider):\n#     def __init__(self):\n#         super(QtBoxFuncSlider1, self).__init__(str(Path(__file__)))\n#         self.setMinimum(0)\n#         self.setMaximum(100)\n#         self.setOrientation(Qt.Horizontal)\n#         self.is_number_shown = False\n\n#     def mousePressEvent(self, event):\n#         super(QtBoxFuncSlider1, self).mousePressEvent(event)\n#         if event.button() == Qt.LeftButton:\n#             self.is_number_shown = True\n#             self.update()\n\n#     def mouseReleaseEvent(self, event):\n#         super(QtBoxFuncSlider1, self).mouseReleaseEvent(event)\n#         if event.button() == Qt.LeftButton:\n#             self.is_number_shown = False\n#             self.update()\n\n#     def paintEvent(self, event):\n#         super(QtBoxFuncSlider1, self).paintEvent(event)\n\n#         if not self.is_number_shown:\n#             return\n\n#         painter = QPainter(self)\n#         painter.setBrush(QColor(200, 200, 200, 120))\n\n#         font = QFont()\n#         font.setPixelSize(15)\n#         painter.setFont(font)\n#         font_metrics = QFontMetricsF(font)\n#         text_width = font_metrics.width(str(self.value()))\n#         text_height = font_metrics.height()\n#         x = (self.value() - self.minimum()) / (self.maximum() - self.minimum()) * (self.width() - text_width)\n#         rect = QRectF(x, 0, text_width, text_height)\n\n#         painter.setPen(Qt.NoPen)\n#         painter.drawRoundedRect(rect, 3, 3)\n#         painter.setPen(Qt.SolidLine)\n#         painter.drawText(int(x), int(text_height), str(self.value()))\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCSLIDER1_H\n# #define QTBOXFUNCSLIDER1_H\n# #include <QMouseEvent>\n# #include <QPaintEvent>\n# #include <QSlider>\n\n# class QtBoxFuncSlider1 : public QSlider\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncSlider1(QWidget *parent = nullptr);\n\n# protected:\n#     void mousePressEvent(QMouseEvent *event);\n#     void mouseReleaseEvent(QMouseEvent *event);\n#     void paintEvent(QPaintEvent *event);\n\n# private:\n#     bool isNumberShown = false;\n# };\n# #endif // QTBOXFUNCSLIDER1_H\n\n\n\n# #include \"qtboxfuncslider1.h\"\n# #include <QFontMetricsF>\n# #include <QPainter>\n# #include <QRectF>\n# #include <QColor>\n# #include <QFont>\n# #include <Qt>\n\n# QtBoxFuncSlider1::QtBoxFuncSlider1(QWidget *parent)\n#     : QSlider(parent)\n# {\n#     setMinimum(0);\n#     setMaximum(100);\n#     setOrientation(Qt::Horizontal);\n# }\n\n# void QtBoxFuncSlider1::mousePressEvent(QMouseEvent *event)\n# {\n#     QSlider::mousePressEvent(event);\n#     if (event->button() == Qt::LeftButton) {\n#         isNumberShown = true;\n#         update();\n#     }\n# }\n\n# void QtBoxFuncSlider1::mouseReleaseEvent(QMouseEvent *event)\n# {\n#\n#     QSlider::mouseReleaseEvent(event);\n#     if (event->button() == Qt::LeftButton) {\n#         isNumberShown = false;\n#         update();\n#     }\n# }\n\n# void QtBoxFuncSlider1::paintEvent(QPaintEvent *event)\n# {\n#     QSlider::paintEvent(event);\n#     if (!isNumberShown) {\n#         return;\n#     }\n\n#     QPainter painter = QPainter(this);\n#     painter.setBrush(QColor(220, 220, 220, 120));\n\n#     QFont font = QFont();\n#     font.setPixelSize(13);\n#     painter.setFont(font);\n#     QFontMetricsF fontMetrics = QFontMetricsF(font);\n#     float textWidth = fontMetrics.size(Qt::TextSingleLine, QString(\"%1\").arg(value())).width();\n#     float textHeight = fontMetrics.height();\n#     float x = float(value() - minimum()) / float(maximum() - minimum()) * float(width() - textWidth);\n#     QRectF rect = QRectF(x, 0, textWidth, textHeight*1.3);\n\n#     painter.setPen(Qt::NoPen);\n#     painter.drawRoundedRect(rect, 3, 3);\n#     painter.setPen(Qt::SolidLine);\n#     painter.drawText(int(x), int(textHeight), QString(\"%1\").arg(value()));\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/slider/style/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/slider/style/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QSlider\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQSlider = createWidgetMenuBase(QSlider)\n\nclass QtBoxStyleSlider1(QSlider):\n    def __init__(self):\n        super(QtBoxStyleSlider1, self).__init__(str(Path(__file__)))\n        self.setOrientation(Qt.Horizontal)\n        self.setStyleSheet(\"\"\"\n        QSlider::groove:horizontal {\n            border: none;\n            height: 2px;\n            background-color: lightgray;\n        }\n\n        QSlider::handle:horizontal {\n            background-color: #2f77cb;\n            width: 8px;\n            margin: -9px 0px -9px 0px;\n            border-radius: 4px;\n        }\n\n        QSlider::sub-page:horizontal {\n            background-color: #4898ec;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QSlider\n\n\n# class QtBoxStyleSlider1(QSlider):\n#     def __init__(self):\n#         super(QtBoxStyleSlider1, self).__init__()\n#         self.setOrientation(Qt.Horizontal)\n#         self.setStyleSheet(\"\"\"\n#         QSlider::groove:horizontal {\n#             border: none;\n#             height: 2px;\n#             background-color: lightgray;\n#         }\n\n#         QSlider::handle:horizontal {\n#             background-color: #2f77cb;\n#             width: 8px;\n#             margin: -9px 0px -9px 0px;\n#             border-radius: 4px;\n#         }\n\n#         QSlider::sub-page:horizontal {\n#             background-color: #4898ec;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLESLIDER1_H\n# #define QTBOXSTYLESLIDER1_H\n# #include <QSlider>\n\n# class QtBoxStyleSlider1 : public QSlider\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleSlider1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLESLIDER1_H\n\n\n\n# #include \"qtboxstyleslider1.h\"\n\n# QtBoxStyleSlider1::QtBoxStyleSlider1(QWidget *parent)\n#     : QSlider(parent)\n# {\n#     setOrientation(Qt::Horizontal);\n#     setStyleSheet(R\"(\n#     QSlider::groove:horizontal {\n#         border: none;\n#         height: 2px;\n#         background-color: lightgray;\n#     }\n\n#     QSlider::handle:horizontal {\n#         background-color: #2f77cb;\n#         width: 8px;\n#         margin: -9px 0px -9px 0px;\n#         border-radius: 4px;\n#     }\n#\n#     QSlider::sub-page:horizontal {\n#         background-color: #4898ec;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/slider/style/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QSlider\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQSlider = createWidgetMenuBase(QSlider)\n\nclass QtBoxStyleSlider2(QSlider):\n    def __init__(self):\n        super(QtBoxStyleSlider2, self).__init__(str(Path(__file__)))\n        self.setStyleSheet(\"\"\"\n        QSlider::groove:vertical {\n            background-color: #eaebed;\n            border: none;\n            width: 6px;\n            border-radius: 3px;\n        }\n\n        QSlider::handle:vertical {\n            background-color: #d33124;\n            height:6px;\n            margin: 0px -1px 0px -1px;\n            border-radius: 3px;\n        }\n        \n        QSlider::add-page:vertical {\n            background-color: #d33124;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QSlider\n\n\n# class QtBoxStyleSlider2(QSlider):\n#     def __init__(self):\n#         super(QtBoxStyleSlider2, self).__init__()\n#         self.setStyleSheet(\"\"\"\n#         QSlider::groove:vertical {\n#             background-color: #eaebed;\n#             border: none;\n#             width: 6px;\n#             border-radius: 3px;\n#         }\n\n#         QSlider::handle:vertical {\n#             background-color: #d33124;\n#             height:6px;\n#             margin: 0px -1px 0px -1px;\n#             border-radius: 3px;\n#         }\n\n#         QSlider::add-page:vertical {\n#             background-color: #d33124;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLESLIDER2_H\n# #define QTBOXSTYLESLIDER2_H\n# #include <QSlider>\n\n# class QtBoxStyleSlider2 : public QSlider\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleSlider2(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLESLIDER2_H\n\n\n\n# #include \"qtboxstyleslider2.h\"\n\n# QtBoxStyleSlider2::QtBoxStyleSlider2(QWidget *parent)\n#     : QSlider(parent)\n# {\n#     setStyleSheet(R\"(\n#     QSlider::groove:vertical {\n#         background-color: #eaebed;\n#         border: none;\n#         width: 6px;\n#         border-radius: 3px;\n#     }\n\n#     QSlider::handle:vertical {\n#         background-color: #d33124;\n#         height:6px;\n#         margin: 0px -1px 0px -1px;\n#         border-radius: 3px;\n#     }\n\n#     QSlider::add-page:vertical {\n#         background-color: #d33124;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/slider/style/demo3.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QSlider\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQSlider = createWidgetMenuBase(QSlider)\n\nclass QtBoxStyleSlider3(QSlider):\n    def __init__(self):\n        super(QtBoxStyleSlider3, self).__init__(str(Path(__file__)))\n        self.setOrientation(Qt.Horizontal)\n        self.setStyleSheet(\"\"\"\n        QSlider::groove:horizontal {\n            border: none;\n            height: 2px;\n            background-color: lightgray;\n        }\n\n        QSlider::handle:horizontal {\n            background-color: #f1964c;\n            width: 16px;\n            margin: -8px 0px -8px 0px;\n            border-radius: 8px;\n        }\n\n        QSlider::sub-page:horizontal {\n            background-color: #f1964c;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QSlider\n\n\n# class QtBoxStyleSlider3(QSlider):\n#     def __init__(self):\n#         super(QtBoxStyleSlider3, self).__init__()\n#         self.setOrientation(Qt.Horizontal)\n#         self.setStyleSheet(\"\"\"\n#         QSlider::groove:horizontal {\n#             border: none;\n#             height: 2px;\n#             background-color: lightgray;\n#         }\n\n#         QSlider::handle:horizontal {\n#             background-color: #f1964c;\n#             width: 16px;\n#             margin-top: -8px 0px -8px 0px;\n#             border-radius: 8px;\n#         }\n\n#         QSlider::sub-page:horizontal {\n#             background-color: #f1964c;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLESLIDER3_H\n# #define QTBOXSTYLESLIDER3_H\n# #include <QSlider>\n\n# class QtBoxStyleSlider3 : public QSlider\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleSlider3(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLESLIDER3_H\n\n\n\n# #include \"qtboxstyleslider3.h\"\n\n# QtBoxStyleSlider3::QtBoxStyleSlider3(QWidget *parent)\n#     : QSlider(parent)\n# {\n#     setOrientation(Qt::Horizontal);\n#     setStyleSheet(R\"(\n#     QSlider::groove:horizontal {\n#         border: none;\n#         height: 2px;\n#         background-color: lightgray;\n#     }\n\n#     QSlider::handle:horizontal {\n#         background-color: #f1964c;\n#         width: 16px;\n#         margin: -8px 0px -8px 0px;\n#         border-radius: 8px;\n#     }\n\n#     QSlider::sub-page:horizontal {\n#         background-color: #f1964c;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/slider/style/demo4.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QSlider\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQSlider = createWidgetMenuBase(QSlider)\nPATH_TO_IMG = str(Path(__file__).parent.parent.parent.parent / \"res/images/basketball.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleSlider4(QSlider):\n    def __init__(self):\n        super(QtBoxStyleSlider4, self).__init__(str(Path(__file__)))\n        self.setOrientation(Qt.Horizontal)\n        self.setStyleSheet(\"\"\"\n        QSlider::groove:horizontal {\n            border: none;\n            height: 2px;\n            background-color: lightgray;\n        }\n\n        QSlider::handle:horizontal {\n            border-image: url(%s);\n            width: 20px;\n            margin: -10px -2px -10px -2px;\n        }\n\n        QSlider::sub-page:horizontal {\n            background-color: #ef7067;\n        }\n        \"\"\" % (PATH_TO_IMG))\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QSlider\n\n\n# class QtBoxStyleSlider4(QSlider):\n#     def __init__(self):\n#         super(QtBoxStyleSlider4, self).__init__()\n#         self.setOrientation(Qt.Horizontal)\n#         self.setStyleSheet(\"\"\"\n#         QSlider::groove:horizontal {\n#             border: none;\n#             height: 2px;\n#             background-color: lightgray;\n#         }\n\n#         QSlider::handle:horizontal {\n#             border-image: url(%s);\n#             width: 20px;\n#             margin: -10px -2px -10px -2px;\n#         }\n\n#         QSlider::sub-page:horizontal {\n#             background-color: #ef7067;\n#         }\n#         \"\"\" % (PATH_TO_IMG))\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLESLIDER4_H\n# #define QTBOXSTYLESLIDER4_H\n# #include <QSlider>\n\n# class QtBoxStyleSlider4 : public QSlider\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleSlider4(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLESLIDER4_H\n\n\n\n# #include \"qtboxstyleslider4.h\"\n\n# QtBoxStyleSlider4::QtBoxStyleSlider4(QWidget *parent)\n#     : QSlider(parent)\n# {\n#     setOrientation(Qt::Horizontal);\n#     setStyleSheet(R\"(\n#     QSlider::groove:horizontal {\n#         border: none;\n#         height: 2px;\n#         background-color: lightgray;\n#     }\n\n#     QSlider::handle:horizontal {\n#         border-image: url(PATH_TO_IMG);\n#         width: 20px;\n#         margin: -10px -2px -10px -2px;\n#     }\n\n#     QSlider::sub-page:horizontal {\n#         background-color: #ef7067;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/slider/style/demo5.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QSlider\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQSlider = createWidgetMenuBase(QSlider)\n\nclass QtBoxStyleSlider5(QSlider):\n    def __init__(self):\n        super(QtBoxStyleSlider5, self).__init__(str(Path(__file__)))\n        self.setOrientation(Qt.Horizontal)\n        self.setStyleSheet(\"\"\"\n        QSlider::groove:horizontal {\n            border: none;\n            height: 10px;\n            background-color: lightgray;\n            border-radius: 5px;\n        }\n\n        QSlider::handle:horizontal {\n            width: 4px;\n            margin: -1px 0px -1px -5px;\n            border-radius: 1px;\n            background-color: white;\n        }\n\n        QSlider::sub-page:horizontal {\n            background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #59969b, stop:1 #04e7fa);\n            border-radius: 5px;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QSlider\n\n\n# class QtBoxStyleSlider5(QSlider):\n#     def __init__(self):\n#         super(QtBoxStyleSlider5, self).__init__()\n#         self.setOrientation(Qt.Horizontal)\n#         self.setStyleSheet(\"\"\"\n#         QSlider::groove:horizontal {\n#             border: none;\n#             height: 10px;\n#             background-color: lightgray;\n#             border-radius: 5px;\n#         }\n\n#         QSlider::handle:horizontal {\n#             width: 4px;\n#             margin: -1px 0px -1px -5px;\n#             border-radius: 1px;\n#             background-color: white;\n#         }\n\n#         QSlider::sub-page:horizontal {\n#             background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #59969b, stop:1 #04e7fa);\n#             border-radius: 5px;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLESLIDER5_H\n# #define QTBOXSTYLESLIDER5_H\n# #include <QSlider>\n\n# class QtBoxStyleSlider5 : public QSlider\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleSlider5(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLESLIDER5_H\n\n\n\n# #include \"qtboxstyleslider5.h\"\n\n# QtBoxStyleSlider5::QtBoxStyleSlider5(QWidget *parent)\n#     : QSlider(parent)\n# {\n#     setOrientation(Qt::Horizontal);\n#     setStyleSheet(R\"(\n#     QSlider::groove:horizontal {\n#         border: none;\n#         height: 10px;\n#         background-color: lightgray;\n#         border-radius: 5px;\n#     }\n\n#     QSlider::handle:horizontal {\n#         width: 4px;\n#         margin: -1px 0px -1px -5px;\n#         border-radius: 1px;\n#         background-color: white;\n#     }\n\n#     QSlider::sub-page:horizontal {\n#         background-color: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #59969b, stop:1 #04e7fa);\n#         border-radius: 5px;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/spinbox/__init__.py",
    "content": "from .func import demo1\nfrom .style import demo1"
  },
  {
    "path": "src/qtbox/demo/spinbox/func/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/spinbox/func/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QSpinBox\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQSpinBox = createWidgetMenuBase(QSpinBox)\n\nclass QtBoxFuncSpinBox1(QSpinBox):\n    def __init__(self):\n        super(QtBoxFuncSpinBox1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 30)\n        self.setPrefix(\"Sth: \")\n        self.setSuffix(\" PCS\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QSpinBox\n\n\n# class QtBoxFuncSpinBox1(QSpinBox):\n#     def __init__(self):\n#         super(QtBoxFuncSpinBox1, self).__init__(str(Path(__file__)))\n#         self.setFixedSize(150, 30)\n#         self.setPrefix(\"Sth: \")\n#         self.setSuffix(\" PCS\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCSPINBOX1_H\n# #define QTBOXFUNCSPINBOX1_H\n# #include <QSpinBox>\n\n# class QtBoxFuncSpinBox1 : public QSpinBox\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncSpinBox1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXFUNCSPINBOX1_H\n\n\n\n# #include \"qtboxfuncspinbox1.h\"\n\n# QtBoxFuncSpinBox1::QtBoxFuncSpinBox1(QWidget *parent)\n#     : QSpinBox(parent)\n# {\n#     setFixedSize(150, 30);\n#     setPrefix(\"Sth: \");\n#     setSuffix(\" PCS\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/spinbox/style/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/spinbox/style/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QSpinBox\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQSpinBox = createWidgetMenuBase(QSpinBox)\nPATH_TO_IMG1 = str(Path(__file__).parent.parent.parent.parent / \"res/images/up.png\").replace(\"\\\\\", \"/\")\nPATH_TO_IMG2 = str(Path(__file__).parent.parent.parent.parent / \"res/images/down.png\").replace(\"\\\\\", \"/\")\n\nclass QtBoxStyleSpinBox1(QSpinBox):\n    def __init__(self):\n        super(QtBoxStyleSpinBox1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 30)\n        self.setCursor(Qt.PointingHandCursor)\n        self.setAttribute(Qt.WA_MacShowFocusRect, False)\n        self.setStyleSheet(\"\"\"\n        QSpinBox {\n            border: 1px solid lightgray;\n            border-radius: 3px;\n        }\n        \n        QSpinBox::up-button {\n            width: 14px;\n            height: 14px;\n            margin: 0px 3px 0px -3px;\n            border-image: url(%s);\n        }\n        \n        QSpinBox::up-button:pressed {\n            margin-top: 1px;\n        }\n            \n        QSpinBox::down-button {\n            width: 14px;\n            height: 14px;\n            margin: 0px 3px 0px -3px;\n            border-image: url(%s);\n        }\n        \n        QSpinBox::down-button:pressed {\n            margin-bottom: 1px;\n        }\n        \"\"\" % (PATH_TO_IMG1, PATH_TO_IMG2))\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QSpinBox\n\n\n# class QtBoxStyleSpinBox1(QSpinBox):\n#     def __init__(self):\n#         super(QtBoxStyleSpinBox1, self).__init__()\n#         self.setFixedSize(150, 30)\n#         self.setCursor(Qt.PointingHandCursor)\n#         self.setAttribute(Qt.WA_MacShowFocusRect, False)\n#         self.setStyleSheet(\"\"\"\n#         QSpinBox {\n#             border: 1px solid lightgray;\n#             border-radius: 3px;\n#         }\n\n#         QSpinBox::up-button {\n#             margin: 0px 3px 0px -3px;\n#             border-image: url(%s);\n#         }\n\n#         QSpinBox::up-button:pressed {\n#             margin-top: 1px;\n#         }\n\n#         QSpinBox::down-button {\n#             margin: 0px 3px 0px -3px;\n#             border-image: url(%s);\n#         }\n\n#         QSpinBox::down-button:pressed {\n#             margin-bottom: 1px;\n#         }\n#         \"\"\" % (PATH_TO_IMG1, PATH_TO_IMG2))\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLESPINBOX1_H\n# #define QTBOXSTYLESPINBOX1_H\n# #include <QSpinBox>\n\n# class QtBoxStyleSpinBox1 : public QSpinBox\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleSpinBox1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLESPINBOX1_H\n\n\n\n# #include \"qtboxstylespinbox1.h\"\n# #include <Qt>\n\n# QtBoxStyleSpinBox1::QtBoxStyleSpinBox1(QWidget *parent)\n#     : QSpinBox(parent)\n# {\n#     setFixedSize(150, 30);\n#     setCursor(Qt::PointingHandCursor);\n#     setAttribute(Qt::WA_MacShowFocusRect, false);\n#     setStyleSheet(R\"(\n#     QSpinBox {\n#         border: 1px solid lightgray;\n#         border-radius: 3px;\n#     }\n\n#     QSpinBox::up-button {\n#         width: 14px;\n#         height: 14px;\n#         margin: 0px 3px 0px -3px;\n#         border-image: url(PATH_TO_IMG1);\n#     }\n\n#     QSpinBox::up-button:pressed {\n#         margin-top: 1px;\n#     }\n\n#     QSpinBox::down-button {\n#         width: 14px;\n#         height: 14px;\n#         margin: 0px 3px 0px -3px;\n#         border-image: url(PATH_TO_IMG2);\n#     }\n\n#     QSpinBox::down-button:pressed {\n#         margin-bottom: 1px;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/tablewidget/__init__.py",
    "content": "from .func import demo1, demo2\nfrom .style import demo1"
  },
  {
    "path": "src/qtbox/demo/tablewidget/func/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/tablewidget/func/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QTableWidget, QPushButton\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQTableWidget = createWidgetMenuBase(QTableWidget)\n\nclass QtBoxFuncTableWidget1(QTableWidget):\n    def __init__(self):\n        super(QtBoxFuncTableWidget1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(200, 150)\n        self.setColumnCount(3)\n        self.setRowCount(5)\n        self.add_btns()\n\n    def add_btns(self):\n        for row in range(self.rowCount()):\n            for col in range(self.columnCount()):\n                btn = QPushButton()\n                btn.setText(\"button\")\n                self.setCellWidget(row, col, btn)\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QTableWidget, QPushButton\n\n\n# class QtBoxFuncTableWidget1(QTableWidget):\n#     def __init__(self):\n#         super(QtBoxFuncTableWidget1, self).__init__()\n#         self.setFixedSize(200, 150)\n#         self.setColumnCount(3)\n#         self.setRowCount(5)\n#         self.add_btns()\n\n#     def add_btns(self):\n#         for row in range(self.rowCount()):\n#             for col in range(self.columnCount()):\n#                 btn = QPushButton()\n#                 btn.setText(\"button\")\n#                 self.setCellWidget(row, col, btn)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCTABLEWIDGET1_H\n# #define QTBOXFUNCTABLEWIDGET1_H\n# #include <QTableWidget>\n\n# class QtBoxFuncTableWidget1 : public QTableWidget\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncTableWidget1(QWidget *parent = nullptr);\n\n# private:\n#     void addBtns();\n# };\n# #endif // QTBOXFUNCTABLEWIDGET1_H\n\n\n\n# #include \"qtboxfunctablewidget1.h\"\n# #include <QPushButton>\n\n# QtBoxFuncTableWidget1::QtBoxFuncTableWidget1(QWidget *parent)\n#     : QTableWidget(parent)\n# {\n#     setFixedSize(200, 150);\n#     setColumnCount(3);\n#     setRowCount(5);\n#     addBtns();\n# }\n\n# void QtBoxFuncTableWidget1::addBtns()\n# {\n#     for (int row=0; row<rowCount(); row++) {\n#         for (int col=0; col<columnCount(); col++) {\n#             QPushButton *btn = new QPushButton();\n#             btn->setText(\"button\");\n#             setCellWidget(row, col, btn);\n#         }\n#     }\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/tablewidget/func/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtWidgets import QTableWidget, QTableWidgetItem\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQTableWidget = createWidgetMenuBase(QTableWidget)\n\nclass QtBoxFuncTableWidget2(QTableWidget):\n    def __init__(self):\n        super(QtBoxFuncTableWidget2, self).__init__(str(Path(__file__)))\n        self.setFixedSize(200, 150)\n        self.setColumnCount(3)\n        self.setRowCount(5)\n        self.set_text_and_align_center()\n\n    def set_text_and_align_center(self):\n        for row in range(self.rowCount()):\n            for col in range(self.columnCount()):\n                item = QTableWidgetItem()\n                item.setText(f\"{row+1}, {col+1}\")\n                item.setTextAlignment(Qt.AlignCenter)\n                self.setItem(row, col, item)\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtWidgets import QTableWidget, QTableWidgetItem\n\n\n# class QtBoxFuncTableWidget2(QTableWidget):\n#     def __init__(self):\n#         super(QtBoxFuncTableWidget2, self).__init__(str(Path(__file__)))\n#         self.setFixedSize(200, 150)\n#         self.setColumnCount(3)\n#         self.setRowCount(5)\n#         self.set_text_and_align_center()\n\n#     def set_text_and_align_center(self):\n#         for row in range(self.rowCount()):\n#             for col in range(self.columnCount()):\n#                 item = QTableWidgetItem()\n#                 item.setText(f\"{row+1}, {col+1}\")\n#                 item.setTextAlignment(Qt.AlignCenter)\n#                 self.setItem(row, col, item)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCTABLEWIDGET2_H\n# #define QTBOXFUNCTABLEWIDGET2_H\n# #include <QTableWidget>\n\n# class QtBoxFuncTableWidget2 : public QTableWidget\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncTableWidget2(QWidget *parent = nullptr);\n\n# private:\n#     void setTextAndAlignCenter();\n# };\n# #endif // QTBOXFUNCTABLEWIDGET2_H\n\n\n\n# #include \"qtboxfunctablewidget2.h\"\n# #include <QTableWidgetItem>\n# #include <Qt>\n\n# QtBoxFuncTableWidget2::QtBoxFuncTableWidget2(QWidget *parent)\n#     : QTableWidget(parent)\n# {\n#     setFixedSize(200, 150);\n#     setColumnCount(3);\n#     setRowCount(5);\n#     setTextAndAlignCenter();\n# }\n\n# void QtBoxFuncTableWidget2::setTextAndAlignCenter()\n# {\n#     for (int row=0; row<rowCount(); row++) {\n#         for (int col=0; col<columnCount(); col++) {\n#             QTableWidgetItem *item = new QTableWidgetItem();\n#             item->setText(QString(\"%1, %2\").arg(row+1).arg(col+1));\n#             item->setTextAlignment(Qt::AlignCenter);\n#             setItem(row, col, item);\n#         }\n#     }\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/tablewidget/style/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/tablewidget/style/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtWidgets import QTableWidget\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQTableWidget = createWidgetMenuBase(QTableWidget)\n\nclass QtBoxStyleTableWidget1(QTableWidget):\n    def __init__(self):\n        super(QtBoxStyleTableWidget1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(200, 150)\n        self.setColumnCount(3)\n        self.setRowCount(5)\n        self.setHorizontalHeaderLabels([\"A\", \"B\", \"C\"])\n\n        self.setStyleSheet(\"\"\"\n        QHeaderView::section {\n            color: #5e5e5e;\n        }\n        \n        QHeaderView::section:hover\n        {   \n            border: none;\n            background-color: #a2c7ae;\n        }\n        \n        QHeaderView::section::horizontal:checked\n        {   \n            border: none;\n            border-bottom: 1px solid #3a714a;\n            background-color: #c0daca;\n            color: #2f5b53;\n        }\n        \n        QHeaderView::section::vertical:checked\n        {   \n            border: none;\n            border-right: 1px solid #3a714a;\n            background-color: #c0daca;\n            color: #2f5b53;\n        }\n        \n        QTableView {\n            selection-background-color: transparent;\n            selection-color: black;\n        }\n        \n        QTableView::item:selected {\n            border: 1px solid #3a714a;\n        }\n        \"\"\")\n# PyQt\n\n# PySide\n# from PySide2.QtWidgets import QTableWidget\n\n\n# class QtBoxStyleTableWidget1(QTableWidget):\n#     def __init__(self):\n#         super(QtBoxStyleTableWidget1, self).__init__()\n#         self.setFixedSize(200, 150)\n#         self.setColumnCount(3)\n#         self.setRowCount(5)\n#         self.setHorizontalHeaderLabels([\"A\", \"B\", \"C\"])\n\n#         self.setStyleSheet(\"\"\"\n#         QHeaderView::section {\n#             color: #5e5e5e;\n#         }\n\n#         QHeaderView::section:hover\n#         {\n#             border: none;\n#             background-color: #a2c7ae;\n#         }\n\n#         QHeaderView::section::horizontal:checked\n#         {\n#             border: none;\n#             border-bottom: 1px solid #3a714a;\n#             background-color: #c0daca;\n#             color: #2f5b53;\n#         }\n\n#         QHeaderView::section::vertical:checked\n#         {\n#             border: none;\n#             border-right: 1px solid #3a714a;\n#             background-color: #c0daca;\n#             color: #2f5b53;\n#         }\n\n#         QTableView {\n#             selection-background-color: transparent;\n#             selection-color: black;\n#         }\n\n#         QTableView::item:selected {\n#             border: 1px solid #3a714a;\n#         }\n#         \"\"\")\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLETABLEWIDGET1_H\n# #define QTBOXSTYLETABLEWIDGET1_H\n# #include <QTableWidget>\n\n# class QtBoxStyleTableWidget1 : public QTableWidget\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleTableWidget1(QWidget *parent = nullptr);\n# };\n# #endif // QTBOXSTYLETABLEWIDGET1_H\n\n\n\n# #include \"qtboxstyletablewidget1.h\"\n\n# QtBoxStyleTableWidget1::QtBoxStyleTableWidget1(QWidget *parent)\n#     : QTableWidget(parent)\n# {\n#     setFixedSize(200, 150);\n#     setColumnCount(3);\n#     setRowCount(5);\n#     setHorizontalHeaderLabels({\"A\", \"B\", \"C\"});\n\n#     setStyleSheet(R\"(\n#     QHeaderView::section {\n#         color: #5e5e5e;\n#     }\n\n#     QHeaderView::section:hover\n#     {\n#         border: none;\n#         background-color: #a2c7ae;\n#     }\n\n#     QHeaderView::section::horizontal:checked\n#     {\n#         border: none;\n#         border-bottom: 1px solid #3a714a;\n#         background-color: #c0daca;\n#         color: #2f5b53;\n#     }\n\n#     QHeaderView::section::vertical:checked\n#     {\n#         border: none;\n#         border-right: 1px solid #3a714a;\n#         background-color: #c0daca;\n#         color: #2f5b53;\n#     }\n\n#     QTableView {\n#         selection-background-color: transparent;\n#         selection-color: black;\n#     }\n\n#     QTableView::item:selected {\n#         border: 1px solid #3a714a;\n#     }\n#     )\");\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/widget/__init__.py",
    "content": "from .func import demo1, demo2\nfrom .style import demo1, demo2"
  },
  {
    "path": "src/qtbox/demo/widget/func/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/widget/func/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt, QRect\nfrom PyQt5.QtGui import QPainter, QPen, QPalette, QColor\nfrom PyQt5.QtWidgets import QWidget\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQWidget = createWidgetMenuBase(QWidget)\n\nclass QtBoxFuncWidget1(QWidget):\n    def __init__(self):\n        super(QtBoxFuncWidget1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 150)\n        self.rect_list = []\n        self.rect_start_point = None\n        self.rect_end_point = None\n        self.set_background_color()\n\n    def set_background_color(self):\n        palette = QPalette()\n        palette.setColor(QPalette.Window, QColor(100, 100, 100, 255))\n        self.setPalette(palette)\n        self.setAutoFillBackground(True)\n\n    def mousePressEvent(self, event):\n        if event.button() == Qt.LeftButton:\n            self.rect_start_point = event.pos()\n            self.rect_end_point = event.pos()\n            self.update()\n\n    def mouseMoveEvent(self, event):\n        if event.buttons() == Qt.LeftButton:\n            self.rect_end_point = event.pos()\n            self.update()\n\n    def mouseReleaseEvent(self, event):\n        if self.rect_start_point and self.rect_end_point:\n            self.rect_list.append((self.rect_start_point, self.rect_end_point))\n            self.update()\n\n        self.rect_start_point = None\n        self.rect_end_point = None\n\n    def paintEvent(self, event):\n        super(QtBoxFuncWidget1, self).paintEvent(event)\n        painter = QPainter(self)\n        pen = QPen()\n        pen.setColor(Qt.green)\n        painter.setPen(pen)\n\n        if self.rect_start_point and self.rect_end_point:\n            painter.drawText(self.rect_start_point, f\"Rect {len(self.rect_list) + 1}\")\n            rect = QRect(self.rect_start_point, self.rect_end_point)\n            painter.drawRect(rect)\n\n        for i, point_tuple in enumerate(self.rect_list):\n            painter.drawText(point_tuple[0], f\"Rect {i + 1}\")\n            rect = QRect(point_tuple[0], point_tuple[1])\n            painter.drawRect(rect)\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt, QRect\n# from PySide2.QtGui import QPainter, QPen, QPalette, QColor\n# from PySide2.QtWidgets import QWidget\n\n\n# class QtBoxFuncWidget1(QWidget):\n#     def __init__(self):\n#         super(QtBoxFuncWidget1, self).__init__()\n#         self.setFixedSize(150, 150)\n#         self.rect_list = []\n#         self.rect_start_point = None\n#         self.rect_end_point = None\n#         self.set_background_color()\n\n#     def set_background_color(self):\n#         palette = QPalette()\n#         palette.setColor(QPalette.Window, QColor(100, 100, 100, 255))\n#         self.setPalette(palette)\n#         self.setAutoFillBackground(True)\n\n#     def mousePressEvent(self, event):\n#         if event.button() == Qt.LeftButton:\n#             self.rect_start_point = event.pos()\n#             self.rect_end_point = event.pos()\n#             self.update()\n\n#     def mouseMoveEvent(self, event):\n#         if event.buttons() == Qt.LeftButton:\n#             self.rect_end_point = event.pos()\n#             self.update()\n\n#     def mouseReleaseEvent(self, event):\n#         if self.rect_start_point and self.rect_end_point:\n#             self.rect_list.append((self.rect_start_point, self.rect_end_point))\n#             self.update()\n\n#         self.rect_start_point = None\n#         self.rect_end_point = None\n\n#     def paintEvent(self, event):\n#         super(QtBoxFuncWidget1, self).paintEvent(event)\n#         painter = QPainter(self)\n#         pen = QPen()\n#         pen.setColor(Qt.green)\n#         painter.setPen(pen)\n\n#         if self.rect_start_point and self.rect_end_point:\n#             painter.drawText(self.rect_start_point, f\"Rect {len(self.rect_list) + 1}\")\n#             rect = QRect(self.rect_start_point, self.rect_end_point)\n#             painter.drawRect(rect)\n\n#         for i, point_tuple in enumerate(self.rect_list):\n#             painter.drawText(point_tuple[0], f\"Rect {i + 1}\")\n#             rect = QRect(point_tuple[0], point_tuple[1])\n#             painter.drawRect(rect)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCWIDGET1_H\n# #define QTBOXFUNCWIDGET1_H\n# #include <QMouseEvent>\n# #include <QPaintEvent>\n# #include <QWidget>\n# #include <QPoint>\n# #include <QList>\n\n# class QtBoxFuncWidget1 : public QWidget\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncWidget1(QWidget *parent = nullptr);\n\n# protected:\n#     void mousePressEvent(QMouseEvent *event);\n#     void mouseMoveEvent(QMouseEvent *event);\n#     void mouseReleaseEvent(QMouseEvent *event);\n#     void paintEvent(QPaintEvent *event);\n\n# private:\n#     QList<QPoint*> rectList;\n#     QPoint rectStartPoint;\n#     QPoint rectEndPoint;\n#     void setBackgroundColor();\n# };\n# #endif // QTBOXFUNCWIDGET1_H\n\n\n\n# #include \"qtboxfuncwidget1.h\"\n# #include <QPalette>\n# #include <QPainter>\n# #include <QRect>\n# #include <QPen>\n# #include <Qt>\n\n# QtBoxFuncWidget1::QtBoxFuncWidget1(QWidget *parent)\n#     : QWidget(parent)\n# {\n#     setFixedSize(150, 150);\n#     setBackgroundColor();\n# }\n\n# void QtBoxFuncWidget1::setBackgroundColor()\n# {\n#     QPalette palette = QPalette();\n#     palette.setColor(QPalette::Window, QColor(100, 100, 100, 255));\n#     setPalette(palette);\n#     setAutoFillBackground(true);\n# }\n\n# void QtBoxFuncWidget1::mousePressEvent(QMouseEvent *event)\n# {\n#     if (event->button() == Qt::LeftButton) {\n#         rectStartPoint = event->pos();\n#         rectEndPoint = event->pos();\n#         update();\n#     }\n# }\n\n# void QtBoxFuncWidget1::mouseMoveEvent(QMouseEvent *event)\n# {\n#     if (event->buttons() == Qt::LeftButton) {\n#         rectEndPoint = event->pos();\n#         update();\n#     }\n# }\n\n# void QtBoxFuncWidget1::mouseReleaseEvent(QMouseEvent *event)\n# {\n#     if (!rectStartPoint.isNull() && !rectEndPoint.isNull()) {\n#         QPoint *pointArray = new QPoint[2];\n#         pointArray[0] = rectStartPoint;\n#         pointArray[1] = rectEndPoint;\n#         rectList.append(pointArray);\n#         update();\n#     }\n#     rectStartPoint = QPoint();\n#     rectEndPoint = QPoint();\n# }\n\n# void QtBoxFuncWidget1::paintEvent(QPaintEvent *event)\n# {\n#     QWidget::paintEvent(event);\n#     QPainter painter = QPainter(this);\n#     QPen pen = QPen();\n#     pen.setColor(Qt::green);\n#     painter.setPen(pen);\n\n#     if (!rectStartPoint.isNull() && !rectEndPoint.isNull()) {\n#         painter.drawText(rectStartPoint, QString(\"Rect %1\").arg(rectList.length()+1));\n#         QRect rect = QRect(rectStartPoint, rectEndPoint);\n#         painter.drawRect(rect);\n#     }\n\n#     for (int i=0; i<rectList.length(); i++){\n#         painter.drawText(rectList[i][0], QString(\"Rect %1\").arg(i+1));\n#         QRect rect = QRect(rectList[i][0], rectList[i][1]);\n#         painter.drawRect(rect);\n#     }\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/widget/func/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import QPointF\nfrom PyQt5.QtWidgets import QWidget\nfrom PyQt5.QtGui import QPainter, QPen, QColor\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQWidget = createWidgetMenuBase(QWidget)\n\nclass QtBoxFuncWidget2(QWidget):\n    def __init__(self):\n        super(QtBoxFuncWidget2, self).__init__(str(Path(__file__)))\n        self.setFixedSize(150, 150)\n\n        self.line_gap = 5\n        self.start_x = self.width() / 2\n        self.start_y = self.height() / 2\n\n        self.light_pen = QPen(QColor(222, 222, 222))\n        self.dark_pen = QPen(QColor(222, 222, 222))\n        self.dark_pen.setWidth(2)\n\n    def draw_lines(self, painter):\n        painter.setPen(self.dark_pen)\n\n        line_count = 0\n        is_row_drawing_stopped = False\n        is_col_drawing_stopped = False\n        x1, x2 = self.start_x, self.start_x\n        y1, y2 = self.start_y, self.start_y\n        while True:\n            if not is_col_drawing_stopped:\n                painter.drawLine(QPointF(x1, 0.0), QPointF(x1, self.height()))\n                painter.drawLine(QPointF(x2, 0.0), QPointF(x2, self.height()))\n\n            if not is_row_drawing_stopped:\n                painter.drawLine(QPointF(0.0, y1), QPointF(self.width(), y1))\n                painter.drawLine(QPointF(0.0, y2), QPointF(self.width(), y2))\n\n            x1 -= self.line_gap\n            x2 += self.line_gap\n            y1 -= self.line_gap\n            y2 += self.line_gap\n            if x1 <= 0 or x2 >= self.width():\n                is_col_drawing_stopped = True\n            if y1 <= 0 or y2 >= self.height():\n                is_row_drawing_stopped = True\n            if is_row_drawing_stopped and is_col_drawing_stopped:\n                break\n\n            line_count += 1\n            if line_count % 10 == 0:\n                painter.setPen(self.dark_pen)\n            else:\n                painter.setPen(self.light_pen)\n\n    def paintEvent(self, event):\n        super(QtBoxFuncWidget2, self).paintEvent(event)\n        painter = QPainter(self)\n        self.draw_lines(painter)\n\n    def resizeEvent(self, event):\n        super(QtBoxFuncWidget2, self).resizeEvent(event)\n        self.start_x = self.width() / 2\n        self.start_y = self.height() / 2\n        self.update()\n# PyQt\n\n# PySide\n# from PySide2.QtCore import QPointF\n# from PySide2.QtWidgets import QWidget\n# from PySide2.QtGui import QPainter, QPen, QColor\n\n\n# class QtBoxFuncWidget2(QWidget):\n#     def __init__(self):\n#         super(QtBoxFuncWidget2, self).__init__()\n#         self.setFixedSize(150, 150)\n\n#         self.line_gap = 5\n#         self.start_x = self.width() / 2\n#         self.start_y = self.height() / 2\n\n#         self.light_pen = QPen(QColor(222, 222, 222))\n#         self.dark_pen = QPen(QColor(222, 222, 222))\n#         self.dark_pen.setWidth(2)\n\n#     def draw_lines(self, painter):\n#         painter.setPen(self.dark_pen)\n\n#         line_count = 0\n#         is_row_drawing_stopped = False\n#         is_col_drawing_stopped = False\n#         x1, x2 = self.start_x, self.start_x\n#         y1, y2 = self.start_y, self.start_y\n#         while True:\n#             if not is_col_drawing_stopped:\n#                 painter.drawLine(QPointF(x1, 0.0), QPointF(x1, self.height()))\n#                 painter.drawLine(QPointF(x2, 0.0), QPointF(x2, self.height()))\n\n#             if not is_row_drawing_stopped:\n#                 painter.drawLine(QPointF(0.0, y1), QPointF(self.width(), y1))\n#                 painter.drawLine(QPointF(0.0, y2), QPointF(self.width(), y2))\n\n#             x1 -= self.line_gap\n#             x2 += self.line_gap\n#             y1 -= self.line_gap\n#             y2 += self.line_gap\n#             if x1 <= 0 or x2 >= self.width():\n#                 is_col_drawing_stopped = True\n#             if y1 <= 0 or y2 >= self.height():\n#                 is_row_drawing_stopped = True\n#             if is_row_drawing_stopped and is_col_drawing_stopped:\n#                 break\n\n#             line_count += 1\n#             if line_count % 10 == 0:\n#                 painter.setPen(self.dark_pen)\n#             else:\n#                 painter.setPen(self.light_pen)\n\n#     def paintEvent(self, event):\n#         super(QtBoxFuncWidget2, self).paintEvent(event)\n#         painter = QPainter(self)\n#         self.draw_lines(painter)\n\n#     def resizeEvent(self, event):\n#         super(QtBoxFuncWidget2, self).resizeEvent(event)\n#         self.start_x = self.width() / 2\n#         self.start_y = self.height() / 2\n#         self.update()\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXFUNCWIDGET2_H\n# #define QTBOXFUNCWIDGET2_H\n# #include <QResizeEvent>\n# #include <QPaintEvent>\n# #include <QPainter>\n# #include <QWidget>\n# #include <QColor>\n# #include <QPen>\n\n# class QtBoxFuncWidget2 : public QWidget\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxFuncWidget2(QWidget *parent = nullptr);\n\n# protected:\n#     void paintEvent(QPaintEvent *event);\n#     void resizeEvent(QResizeEvent *evnet);\n\n# private:\n#     int lineGap = 5;\n#     float startX;\n#     float startY;\n#     QPen lightPen = QPen(QColor(222, 222, 222));\n#     QPen darkPen = QPen(QColor(222, 222, 222));\n#     void drawLines(QPainter &painter);\n# };\n# #endif // QTBOXFUNCWIDGET2_H\n\n\n\n# #include \"qtboxfuncwidget2.h\"\n# #include <QPainter>\n# #include <QPointF>\n\n# QtBoxFuncWidget2::QtBoxFuncWidget2(QWidget *parent)\n#     : QWidget(parent)\n# {\n#     setFixedSize(150, 150);\n#     startX = width() / 2.0;\n#     startY = height() / 2.0;\n#     darkPen.setWidth(2);\n# }\n\n# void QtBoxFuncWidget2::drawLines(QPainter &painter)\n# {\n#     painter.setPen(darkPen);\n\n#     int lineCount = 0;\n#     bool isRowDrawingStopped = false;\n#     bool isColDrawingStopped = false;\n#     float x1 = startX;\n#     float x2 = startX;\n#     float y1 = startY;\n#     float y2 = startY;\n\n#     while (true){\n#         if (!isColDrawingStopped) {\n#             painter.drawLine(QPointF(x1, 0.0), QPointF(x1, height()));\n#             painter.drawLine(QPointF(x2, 0.0), QPointF(x2, height()));\n#         }\n\n#         if (!isRowDrawingStopped) {\n#             painter.drawLine(QPointF(0.0, y1), QPointF(width(), y1));\n#             painter.drawLine(QPointF(0.0, y2), QPointF(width(), y2));\n#         }\n\n#         x1 -= lineGap;\n#         x2 += lineGap;\n#         y1 -= lineGap;\n#         y2 += lineGap;\n#         if (x1 <= 0 || x2 >= width()){\n#             isColDrawingStopped = true;\n#         }\n#         if (y1 <= 0 || y2 >= height()){\n#             isRowDrawingStopped = true;\n#         }\n#         if (isRowDrawingStopped && isColDrawingStopped) {\n#             break;\n#         }\n\n#         lineCount += 1;\n#         if (lineCount % 10 == 0){\n#             painter.setPen(darkPen);\n#         }\n#         else {\n#             painter.setPen(lightPen);\n#         }\n#     }\n# }\n\n# void QtBoxFuncWidget2::paintEvent(QPaintEvent *event)\n# {\n#     QWidget::paintEvent(event);\n#     QPainter painter = QPainter(this);\n#     drawLines(painter);\n# }\n\n# void QtBoxFuncWidget2::resizeEvent(QResizeEvent *event)\n# {\n#     QWidget::resizeEvent(event);\n#     startX = width() / 2.0;\n#     startY = height() / 2.0;\n#     update();\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/widget/style/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/demo/widget/style/demo1.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtGui import QPainter\nfrom PyQt5.QtWidgets import QWidget\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQWidget = createWidgetMenuBase(QWidget)\n\nclass QtBoxStyleWidget1(QWidget):\n    def __init__(self):\n        super(QtBoxStyleWidget1, self).__init__(str(Path(__file__)))\n        self.setFixedSize(100, 100)\n        self.setWindowFlag(Qt.FramelessWindowHint)\n        self.setAttribute(Qt.WA_TranslucentBackground)\n\n    def paintEvent(self, event):\n        painter = QPainter(self)\n        painter.setPen(Qt.NoPen)\n        painter.setBrush(Qt.lightGray)\n        painter.drawRoundedRect(self.rect(), 10, 10)\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtGui import QPainter\n# from PySide2.QtWidgets import QWidget\n\n\n# class QtBoxStyleWidget1(QWidget):\n#     def __init__(self):\n#         super(QtBoxStyleWidget1, self).__init__()\n#         self.setFixedSize(100, 100)\n#         self.setWindowFlag(Qt.FramelessWindowHint)\n#         self.setAttribute(Qt.WA_TranslucentBackground)\n\n#     def paintEvent(self, event):\n#         painter = QPainter(self)\n#         painter.setPen(Qt.NoPen)\n#         painter.setBrush(Qt.lightGray)\n#         painter.drawRoundedRect(self.rect(), 10, 10)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEWIDGET1_H\n# #define QTBOXSTYLEWIDGET1_H\n# #include <QPaintEvent>\n# #include <QWidget>\n\n# class QtBoxStyleWidget1 : public QWidget\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleWidget1(QWidget *parent = nullptr);\n\n# protected:\n#     void paintEvent(QPaintEvent *event);\n# };\n# #endif // QTBOXSTYLEWIDGET1_H\n\n\n\n# #include \"qtboxstylewidget1.h\"\n# #include <QPainter>\n# #include <Qt>\n\n# QtBoxStyleWidget1::QtBoxStyleWidget1(QWidget *parent)\n#     : QWidget(parent)\n# {\n#     setFixedSize(100, 100);\n#     setWindowFlag(Qt::FramelessWindowHint);\n#     setAttribute(Qt::WA_TranslucentBackground);\n# }\n\n# void QtBoxStyleWidget1::paintEvent(QPaintEvent *event)\n# {\n#     QPainter painter = QPainter(this);\n#     painter.setPen(Qt::NoPen);\n#     painter.setBrush(Qt::lightGray);\n#     painter.drawRoundedRect(rect(), 10, 10);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/demo/widget/style/demo2.py",
    "content": "# PyQt\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtGui import QPalette, QColor\nfrom PyQt5.QtWidgets import QWidget, QGraphicsBlurEffect\nfrom qtbox.gui.menu import createWidgetMenuBase\nfrom pathlib import Path\n\nQWidget = createWidgetMenuBase(QWidget)\n\nclass QtBoxStyleWidget2(QWidget):\n    def __init__(self):\n        super(QtBoxStyleWidget2, self).__init__(str(Path(__file__)))\n        self.setWindowFlag(Qt.FramelessWindowHint)\n        self.setFixedSize(100, 100)\n        self.set_background_color()\n        self.blur()\n\n    def set_background_color(self):\n        palette = QPalette()\n        palette.setColor(QPalette.Window, QColor(245, 245, 245, 220))\n        self.setPalette(palette)\n        self.setAutoFillBackground(True)\n\n    def blur(self):\n        blur = QGraphicsBlurEffect()\n        blur.setBlurRadius(10)\n        blur.setBlurHints(QGraphicsBlurEffect.QualityHint)\n        self.setGraphicsEffect(blur)\n# PyQt\n\n# PySide\n# from PySide2.QtCore import Qt\n# from PySide2.QtGui import QPalette, QColor\n# from PySide2.QtWidgets import QWidget, QGraphicsBlurEffect\n\n\n# class QtBoxStyleWidget2(QWidget):\n#     def __init__(self):\n#         super(QtBoxStyleWidget2, self).__init__()\n#         self.setWindowFlag(Qt.FramelessWindowHint)\n#         self.setFixedSize(100, 100)\n#         self.set_background_color()\n#         self.blur()\n\n#     def set_background_color(self):\n#         palette = QPalette()\n#         palette.setColor(QPalette.Window, QColor(245, 245, 245, 220))\n#         self.setPalette(palette)\n#         self.setAutoFillBackground(True)\n\n#     def blur(self):\n#         blur = QGraphicsBlurEffect()\n#         blur.setBlurRadius(10)\n#         blur.setBlurHints(QGraphicsBlurEffect.QualityHint)\n#         self.setGraphicsEffect(blur)\n# PySide\n\n# C++/Qt\n# #ifndef QTBOXSTYLEWIDGET2_H\n# #define QTBOXSTYLEWIDGET2_H\n# #include <QWidget>\n\n# class QtBoxStyleWidget2 : public QWidget\n# {\n#     Q_OBJECT\n\n# public:\n#     QtBoxStyleWidget2(QWidget *parent = nullptr);\n\n# private:\n#     void setBackgroundColor();\n#     void blur();\n# };\n# #endif // QTBOXSTYLEWIDGET2_H\n\n\n\n# #include \"qtboxstylewidget2.h\"\n# #include <QGraphicsBlurEffect>\n# #include <QPalette>\n\n# QtBoxStyleWidget2::QtBoxStyleWidget2(QWidget *parent)\n#     : QWidget(parent)\n# {\n#     setWindowFlag(Qt::FramelessWindowHint);\n#     setFixedSize(100, 100);\n#     setBackgroundColor();\n#     blur();\n# }\n\n# void QtBoxStyleWidget2::setBackgroundColor()\n# {\n#     QPalette palette = QPalette();\n#     palette.setColor(QPalette::Window, QColor(245, 245, 245, 220));\n#     setPalette(palette);\n#     setAutoFillBackground(true);\n# }\n\n# void QtBoxStyleWidget2::blur()\n# {\n#     QGraphicsBlurEffect *blur = new QGraphicsBlurEffect();\n#     blur->setBlurRadius(10);\n#     blur->setBlurHints(QGraphicsBlurEffect::QualityHint);\n#     setGraphicsEffect(blur);\n# }\n# C++/Qt"
  },
  {
    "path": "src/qtbox/gui/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/gui/editor.py",
    "content": "import sys\nimport json\nfrom pathlib import Path\nfrom qtbox.utils.check import check_update\nfrom qtbox.utils.output import suppress_stdout_stderr\nfrom qtbox.gui.title import TitleWidget as QSSEditorTitle\n\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\n\nfrom pygments import highlight\nfrom pygments.lexers import CssLexer\nfrom pygments.formatters import HtmlFormatter\n\n\nRES_PATH = Path(__file__).parent.parent / \"res\"\nwith open(RES_PATH / \"completion.txt\", \"r\", encoding=\"utf-8\") as f:\n    COMPLETER_LIST = [keyword.strip() for keyword in f.readlines()]\n\n\nclass LineNumberArea(QWidget):\n    def __init__(self, parent):\n        super(LineNumberArea, self).__init__(parent)\n        self.parent = parent\n\n    def sizeHint(self):\n        return QSize(self.parent.get_line_number_area_width(), 0)\n\n    def paintEvent(self, event):\n        self.parent.lineNumberAreaPaintEvent(event)\n\n\nclass CustomTextEdit(QPlainTextEdit):\n    qss_signal = pyqtSignal(str)\n\n    def __init__(self):\n        super(CustomTextEdit, self).__init__()\n        self.copy_btn = QPushButton()\n        self.clipboard = QApplication.clipboard()\n        self.line_number_area = LineNumberArea(self)\n        self.completer = QCompleter(COMPLETER_LIST, self)\n\n        self.redo_stack_list = []\n        self.undo_stack_list = []\n        self.redo_max_count = 50\n        self.undo_max_count = 100\n        self.theme = None\n\n        self.set_up()\n\n    def set_up(self):\n        self.set_window_attr()\n        self.set_object_name()\n        self.set_style_sheet()\n        self.set_widget()\n        self.set_signal()\n        self.set_layout()\n\n        self.highlight_line()\n        self.update_line_number_area_width()\n\n    def set_window_attr(self):\n        self.setMinimumWidth(200)\n\n    def set_object_name(self):\n        self.setObjectName(\"customEdit\")\n        self.verticalScrollBar().setObjectName(\"customEditVScrollBar\")\n        self.horizontalScrollBar().setObjectName(\"customEditHScrollBar\")\n        self.copy_btn.setObjectName(\"copyBtn\")\n        self.completer.popup().setObjectName(\"completer\")\n\n    def set_style_sheet(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            self.theme = json.loads(f.read())[\"theme\"]\n\n        with open(RES_PATH / f\"qss/{self.theme}/editor.qss\", encoding=\"utf-8\") as f:\n            qss_content = f.read()\n            self.setStyleSheet(qss_content)\n            self.completer.popup().setStyleSheet(qss_content)\n\n    def set_widget(self):\n        self.completer.setWidget(self)\n        self.setUndoRedoEnabled(False)\n        self.setTabStopWidth(self.fontMetrics().width(\"a\")*4)\n        self.copy_btn.setToolTip(\"Click to copy\")\n        self.copy_btn.setCursor(Qt.PointingHandCursor)\n        self.copy_btn.setIcon(QIcon(str(RES_PATH / \"images/copy.png\")))\n        self.copy_btn.setIconSize(QSize(16, 16))\n\n    def set_signal(self):\n        self.textChanged.connect(self.on_text_changed)\n        self.copy_btn.clicked.connect(self.copy)\n        self.clipboard.dataChanged.connect(self.on_clipboard_changed)\n        self.cursorPositionChanged.connect(self.highlight_line)\n        self.updateRequest.connect(self.update_line_number_area)\n        self.blockCountChanged.connect(self.update_line_number_area_width)\n        self.completer.activated.connect(self.activate_completer)\n\n    def set_layout(self):\n        h_layout = QHBoxLayout()\n        v_layout = QVBoxLayout(self)\n        h_layout.addStretch()\n        h_layout.addWidget(self.copy_btn)\n        v_layout.addLayout(h_layout)\n        v_layout.addStretch()\n\n    def on_text_changed(self):\n        self.qss_signal.emit(self.toPlainText())\n        self.copy_btn.setToolTip(\"Click to copy\")\n        self.copy_btn.setIcon(QIcon(str(RES_PATH / \"images/copy.png\")))\n\n    def copy(self):\n        self.clipboard.setText(self.toPlainText())\n\n    def on_clipboard_changed(self):\n        data = self.clipboard.mimeData()\n        if data.text() == self.toPlainText():\n            self.copy_btn.setIcon(QIcon(str(RES_PATH / \"images/check.png\")))\n            self.copy_btn.setToolTip(\"Copied\")\n        else:\n            self.copy_btn.setIcon(QIcon(str(RES_PATH / \"images/copy.png\")))\n            self.copy_btn.setToolTip(\"Click to copy\")\n\n    def highlight_line(self):\n        extra_selection_list = []\n        selection = QTextEdit.ExtraSelection()\n        if self.theme == \"black\":\n            selection.format.setBackground(QColor(59, 63, 66, 150))\n        else:\n            selection.format.setBackground(QColor(242, 242, 242, 150))\n        selection.format.setProperty(QTextFormat.FullWidthSelection, True)\n        selection.cursor = self.textCursor()\n        selection.cursor.clearSelection()\n        extra_selection_list.append(selection)\n        self.setExtraSelections(extra_selection_list)\n\n    def get_line_number_area_width(self):\n        offset = 10\n        digit_num = 3\n        max_value = max(1, self.blockCount())\n        while max_value >= 1000:\n            max_value /= 10\n            digit_num += 1\n        width = offset + self.fontMetrics().width('9') * digit_num\n        return width\n\n    def update_line_number_area_width(self):\n        self.setViewportMargins(self.get_line_number_area_width()-3, -4, -2, 0)\n\n    def update_line_number_area(self, rect, dy):\n        if dy:\n            self.line_number_area.scroll(0, dy)\n        else:\n            self.line_number_area.update(0, rect.y(), self.line_number_area.width(), rect.height())\n\n        if rect.contains(self.viewport().rect()):\n            self.update_line_number_area_width()\n\n    def get_current_line_number(self):\n        text_cursor = self.textCursor()\n        return text_cursor.blockNumber() + 1\n\n    def activate_completer(self, text):\n        completer_prefix = self.get_word_under_cursor()\n        inserted_text = text.replace(completer_prefix, \"\")\n\n        text_cursor = self.textCursor()\n        text_cursor.insertText(inserted_text)\n        current_cursor_position = text_cursor.position()\n\n        self.highlight_text()\n        new_cursor_position = text_cursor.position()\n\n        self.move_back_cursor_after_highlight(current_cursor_position, new_cursor_position)\n\n    def get_word_under_cursor(self):\n        text_cursor = self.textCursor()\n        for _ in range(text_cursor.positionInBlock()):\n            text_cursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor)\n            if \" \" in text_cursor.selectedText() or \":\" in text_cursor.selectedText():\n                break\n        return text_cursor.selectedText().replace(\" \", \"\").strip()\n\n    def highlight_text(self):\n        current_plain_text = self.toPlainText().strip()\n\n        if self.theme == \"black\":\n            formatter = HtmlFormatter(linenos=False, style=\"paraiso-dark\")\n            css = \"<style>\" + formatter.get_style_defs('.highlight').replace(\"#2f1e2e\", \"#2b2b2b\").replace(\"#4f424c\", \"#2b2b2b\") + \"</style>\"\n        else:\n            formatter = HtmlFormatter(linenos=False, style=\"tango\")\n            css = \"<style>\" + formatter.get_style_defs('.highlight').replace(\"#ffffcc\", \"#ffffff\").replace(\"#f8f8f8\", \"#ffffff\") + \"</style>\"\n        html = highlight(current_plain_text, lexer=CssLexer(), formatter=formatter)\n\n        self.document().setHtml(css+html)\n        self.moveCursor(QTextCursor.End)\n        self.add_undo_command()\n\n    def move_back_cursor_after_highlight(self, pos1, pos2):\n        # pos2-1: leave a space\n        if pos1 < pos2-1:\n            for _ in range(pos2-pos1):\n                self.moveCursor(QTextCursor.Left, QTextCursor.MoveAnchor)\n        elif pos1 > pos2:\n            for _ in range(pos1-pos2):\n                self.moveCursor(QTextCursor.Right, QTextCursor.MoveAnchor)\n\n    def redo(self):\n        if not self.redo_stack_list:\n            return\n\n        if self.document().toHtml() == self.redo_stack_list[-1][0]:\n            self.redo_stack_list.pop()\n            if not self.redo_stack_list:\n                return\n\n        redo_command = self.redo_stack_list.pop()\n        self.document().setHtml(redo_command[0])\n        original_cursor_position = redo_command[1]\n        current_cursor_position = self.textCursor().position()\n        self.move_back_cursor_after_highlight(original_cursor_position, current_cursor_position)\n\n    def add_redo_command(self, command):\n        if len(self.redo_stack_list) > self.redo_max_count:\n            self.redo_stack_list.pop(0)\n\n        self.redo_stack_list.append(command)\n\n    def undo(self):\n        if not self.undo_stack_list:\n            return\n\n        if self.document().toHtml() == self.undo_stack_list[-1][0]:\n            self.redo_stack_list.append(self.undo_stack_list.pop())\n            if not self.undo_stack_list:\n                return\n\n        undo_command = self.undo_stack_list.pop()\n        self.add_redo_command(undo_command)\n        self.document().setHtml(undo_command[0])\n        original_cursor_position = undo_command[1]\n        current_cursor_position = self.textCursor().position()\n        self.move_back_cursor_after_highlight(original_cursor_position, current_cursor_position)\n\n    def add_undo_command(self):\n        if len(self.undo_stack_list) > self.undo_max_count:\n            self.undo_stack_list.pop(0)\n\n        if self.undo_stack_list:\n            if self.document().toHtml() != self.undo_stack_list[-1][0]:\n                self.undo_stack_list.append((self.document().toHtml(), self.textCursor().position()))\n        else:\n            self.undo_stack_list.append((self.document().toHtml(), self.textCursor().position()))\n\n    def is_text_cursor_in_brace_block(self):\n        \"\"\"Check if the text cursor is between { and }\"\"\"\n        left_brace_pos = None\n        right_brace_pos = None\n\n        text_cursor = self.textCursor()\n        for i in range(text_cursor.position()):\n            text_cursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor)\n            if \"{\" in text_cursor.selectedText():\n                left_brace_pos = i\n            elif \"}\" in text_cursor.selectedText():\n                right_brace_pos = i\n\n            if left_brace_pos is not None and right_brace_pos is not None:\n                break\n\n        if left_brace_pos is None and right_brace_pos is None:\n            return False\n        elif left_brace_pos is not None and right_brace_pos is None:\n            return True\n        elif left_brace_pos is None and right_brace_pos is not None:\n            return False\n\n        if left_brace_pos < right_brace_pos:\n            return True\n        else:\n            return False\n\n    def contextMenuEvent(self, event):\n        return\n\n    def resizeEvent(self, event):\n        cr = self.contentsRect()\n        self.line_number_area.setGeometry(QRect(cr.left(), cr.top(), self.get_line_number_area_width(), cr.height()))\n\n    def keyPressEvent(self, event):\n        if self.completer.popup().isVisible():\n            if event.key() == Qt.Key_Escape or event.key() == Qt.Key_Enter or event.key() == Qt.Key_Return or event.key() == Qt.Key_Tab:\n                event.ignore()\n                return\n\n        super(CustomTextEdit, self).keyPressEvent(event)\n        if event.modifiers() == Qt.ControlModifier:\n            if event.key() == Qt.Key_Z:\n                self.undo()\n            elif event.key() == Qt.Key_V:\n                self.highlight_text()\n        elif event.modifiers() == Qt.ControlModifier | Qt.ShiftModifier:\n            if event.key() == Qt.Key_Z:\n                self.redo()\n        else:\n            if event.key() == Qt.Key_Enter or event.key() == Qt.Key_Return and self.is_text_cursor_in_brace_block():\n                self.textCursor().insertText(\"\\t\")\n            self.add_undo_command()\n\n        word_under_cursor = self.get_word_under_cursor()\n        if not word_under_cursor or event.key() == Qt.Key_Left or event.key() == Qt.Key_Right or event.key() == Qt.Key_Up or event.key() == Qt.Key_Down:\n            self.completer.popup().setVisible(False)\n            return\n\n        if word_under_cursor == \"{\" and event.key() != Qt.Key_Backspace:\n            self.highlight_text()\n            return\n\n        if word_under_cursor == \"}\" and event.key() != Qt.Key_Backspace:\n            text_cursor = self.textCursor()\n            for _ in range(text_cursor.positionInBlock()):\n                text_cursor.movePosition(QTextCursor.Left, QTextCursor.KeepAnchor)\n            if text_cursor.selectedText().strip() == \"}\":\n                text_cursor.removeSelectedText()\n                text_cursor.insertText(\"}\")\n            self.highlight_text()\n            return\n\n        self.complete_completer(word_under_cursor)\n\n    def complete_completer(self, word_under_cursor):\n        completer_prefix = word_under_cursor\n        self.completer.setCompletionPrefix(completer_prefix)\n\n        height = 100\n        width = int(self.rect().width() / 2)\n\n        if not self.textCursor().block().text():\n            x = 0\n        else:\n            x = int(self.blockBoundingRect(self.textCursor().block()).width() / len(self.textCursor().block().text()) * self.textCursor().positionInBlock())\n            if x >= self.rect().width() - width:\n                x = self.rect().width() - width\n\n        y = self.blockBoundingGeometry(self.textCursor().block()).y() - 80\n\n        self.completer.complete(QRect(x, y, width, height))\n\n        # Select the first row by default.\n        e = QKeyEvent(QEvent.KeyPress, Qt.Key_Down, Qt.NoModifier)\n        QCoreApplication.postEvent(self.completer.popup(), e)\n\n    def lineNumberAreaPaintEvent(self, event):\n        painter = QPainter(self.line_number_area)\n        if self.theme == \"black\":\n            painter.fillRect(event.rect(), QColor(59, 63, 66, 150))\n        else:\n            painter.fillRect(event.rect(), QColor(242, 242, 242, 150))\n\n        block = self.firstVisibleBlock()\n        block_number = block.blockNumber()\n        top = self.blockBoundingGeometry(block).translated(self.contentOffset()).top()\n        bottom = top + self.blockBoundingRect(block).height()\n\n        while block.isValid() and top <= event.rect().bottom():\n            if block.isVisible() and bottom >= event.rect().top():\n                number = block_number + 1\n                if number == self.get_current_line_number():\n                    painter.setPen(QColor(178, 189, 175, 250))\n                else:\n                    painter.setPen(QColor(178, 189, 175, 160))\n\n                text_rect = QRectF(0, top-4, self.line_number_area.width(), self.fontMetrics().height())\n                painter.drawText(text_rect, Qt.AlignCenter, str(number))\n\n            block = block.next()\n            top = bottom\n            bottom = top + self.blockBoundingRect(block).height()\n            block_number += 1\n\n    def reload_style_sheet(self):\n        self.set_style_sheet()\n        self.highlight_text()\n\n\nclass DisplayWidget(QWidget):\n    def __init__(self):\n        super(DisplayWidget, self).__init__()\n        self.widget_list = [\"QCheckBox\", \"QComboBox\", \"QDial\", \"QLabel\", \"QLCDNumber\", \"QLineEdit\", \"QListWidget\",\n                            \"QProgressBar\", \"QPushButton\", \"QRadioButton\", \"QSlider\", \"QSpinBox\", \"QTableWidget\",\n                            \"QWidget\"]\n        self.widget_combo_box = QComboBox()\n        self.current_widget = None\n        self.qss = None\n\n        self.set_up()\n\n    def set_up(self):\n        self.set_window_attr()\n        self.set_object_name()\n        self.set_style_sheet()\n        self.set_widget()\n        self.set_signal()\n        self.set_layout()\n        self.change_widget(\"QCheckBox\")\n\n    def set_window_attr(self):\n        self.setMinimumWidth(200)\n        self.setMinimumHeight(200)\n\n    def set_object_name(self):\n        self.setObjectName(\"displayWidget\")\n        self.widget_combo_box.setObjectName(\"widgetComboBox\")\n\n    def set_style_sheet(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            theme = json.loads(f.read())[\"theme\"]\n\n        with open(RES_PATH / f\"qss/{theme}/editor.qss\", encoding=\"utf-8\") as f:\n            self.setStyleSheet(f.read())\n\n        icon_path = str(RES_PATH / \"images/up_down.png\").replace(\"\\\\\", \"/\")\n        self.setStyleSheet(\"\"\"\n        QComboBox#widgetComboBox::down-arrow {\n            width: 13px;\n            height: 13px;\n            image: url(%s);\n        }\n        \"\"\" % icon_path)\n\n    def set_widget(self):\n        self.widget_combo_box.addItems(self.widget_list)\n\n    def set_signal(self):\n        self.widget_combo_box.currentTextChanged.connect(self.change_widget)\n\n    def set_layout(self):\n        h_layout = QHBoxLayout()\n        v_layout = QVBoxLayout(self)\n        h_layout.addStretch()\n        h_layout.addWidget(self.widget_combo_box)\n        v_layout.addLayout(h_layout)\n        v_layout.addStretch()\n\n    def change_widget(self, text):\n        if self.current_widget:\n            self.current_widget.deleteLater()\n\n        if text == \"QCheckBox\":\n            self.current_widget = QCheckBox(self)\n            self.current_widget.setText(\"Qt Box\")\n            self.current_widget.setTristate(True)\n\n        elif text == \"QComboBox\":\n            self.current_widget = QComboBox(self)\n            self.current_widget.addItems([\"1\", \"2\", \"3\", \"4\", \"5\", \"6\"])\n\n        elif text == \"QDial\":\n            self.current_widget = QDial(self)\n            self.current_widget.setMinimum(0)\n            self.current_widget.setMaximum(100)\n            self.current_widget.setFixedSize(100, 100)\n\n        elif text == \"QLabel\":\n            self.current_widget = QLabel(self)\n            self.current_widget.setText(\"Qt Box\")\n\n        elif text == \"QLCDNumber\":\n            self.current_widget = QLCDNumber(self)\n            self.current_widget.setDigitCount(6)\n            self.current_widget.display(123456)\n\n        elif text == \"QLineEdit\":\n            self.current_widget = QLineEdit(self)\n            self.current_widget.setPlaceholderText(\"Qt Box\")\n\n        elif text == \"QListWidget\":\n            self.current_widget = QListWidget(self)\n            self.current_widget.setFixedSize(150, 200)\n            for i in range(5):\n                item = QListWidgetItem()\n                item.setText(str(i+1))\n                self.current_widget.addItem(item)\n\n        elif text == \"QProgressBar\":\n            self.current_widget = QProgressBar(self)\n            self.current_widget.setMinimum(0)\n            self.current_widget.setMaximum(100)\n            self.current_widget.setValue(20)\n\n        elif text == \"QPushButton\":\n            self.current_widget = QPushButton(self)\n            self.current_widget.setText(\"BUTTON\")\n\n        elif text == \"QRadioButton\":\n            self.current_widget = QRadioButton(self)\n            self.current_widget.setText(\"Qt Box\")\n\n        elif text == \"QSlider\":\n            self.current_widget = QSlider(self)\n            self.current_widget.setOrientation(Qt.Horizontal)\n            self.current_widget.setMinimum(0)\n            self.current_widget.setMaximum(100)\n\n        elif text == \"QSpinBox\":\n            self.current_widget = QSpinBox(self)\n\n        elif text == \"QTableWidget\":\n            self.current_widget = QTableWidget(self)\n            self.current_widget.setFixedSize(200, 150)\n            self.current_widget.setColumnCount(3)\n            self.current_widget.setRowCount(5)\n\n        elif text == \"QWidget\":\n            self.current_widget = QWidget(self)\n            self.current_widget.setFixedSize(150, 150)\n            self.current_widget.setAutoFillBackground(True)\n\n        if self.current_widget:\n            self.current_widget.show()\n            self.set_current_widget_style_sheet(self.qss)\n            self.current_widget.move(int(self.width() / 2 - self.current_widget.width() / 2),\n                                     int(self.height() / 2 - self.current_widget.height() / 2))\n\n    def set_current_widget_style_sheet(self, qss):\n        with suppress_stdout_stderr():\n            self.current_widget.setStyleSheet(qss)\n            self.qss = qss\n\n    def resizeEvent(self, event):\n        super(DisplayWidget, self).resizeEvent(event)\n        if self.current_widget:\n            self.current_widget.move(int(self.width()/2-self.current_widget.width()/2), int(self.height()/2-self.current_widget.height()/2))\n\n    def reload_style_sheet(self):\n        self.set_style_sheet()\n\n\nclass QSSEditorBody(QSplitter):\n    def __init__(self):\n        super(QSSEditorBody, self).__init__()\n        self.edit = CustomTextEdit()\n        self.display_widget = DisplayWidget()\n\n        self.set_up()\n\n    def set_up(self):\n        self.set_window_attr()\n        self.set_object_name()\n        self.set_style_sheet()\n        self.set_widget()\n        self.set_signal()\n\n    def set_window_attr(self):\n        self.setMouseTracking(True)\n\n    def set_object_name(self):\n        self.setObjectName(\"qssEditorBody\")\n\n    def set_style_sheet(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            theme = json.loads(f.read())[\"theme\"]\n\n        with open(RES_PATH / f\"qss/{theme}/editor.qss\", encoding=\"utf-8\") as f:\n            self.setStyleSheet(f.read())\n\n    def set_widget(self):\n        self.addWidget(self.edit)\n        self.addWidget(self.display_widget)\n        self.setSizes([400, 400])\n\n    def set_signal(self):\n        self.edit.qss_signal.connect(self.display_widget.set_current_widget_style_sheet)\n\n    def contextMenuEvent(self, event):\n        pass\n\n    def reload_style_sheet(self):\n        self.set_style_sheet()\n        self.edit.reload_style_sheet()\n        self.display_widget.reload_style_sheet()\n\n\nclass QSSEditor(QWidget):\n    def __init__(self):\n        super(QSSEditor, self).__init__()\n        self.qss_editor_title = QSSEditorTitle()\n        self.qss_editor_body = QSSEditorBody()\n\n        self.start_x = None\n        self.start_y = None\n        self.stretch_area_offset = 10\n        self.is_stretching = False\n        self.stretch_type = None\n        self.can_stretch = False\n\n        self.bg_color = None\n\n        self.set_up()\n\n    def set_up(self):\n        self.set_window_attr()\n        self.set_style_sheet()\n        self.set_signal()\n        self.set_layout()\n\n    def set_window_attr(self):\n        with open(RES_PATH/\"config.json\") as f:\n            config = json.loads(f.read())\n            self.resize(config[\"qssEditorWidth\"], config[\"qssEditorHeight\"])\n\n        self.setMouseTracking(True)\n        self.qss_editor_title.setMaximumHeight(40)\n        self.setWindowFlag(Qt.FramelessWindowHint)\n        self.setAttribute(Qt.WA_TranslucentBackground)\n\n    def set_style_sheet(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            theme = json.loads(f.read())[\"theme\"]\n\n        if theme == \"black\":\n            self.bg_color = \"#3b3f42\"\n        else:\n            self.bg_color = \"#f2f2f2\"\n\n    def set_signal(self):\n        self.qss_editor_title.close_signal.connect(self.close)\n        self.qss_editor_title.minimize_signal.connect(self.showMinimized)\n        self.qss_editor_title.maximize_signal.connect(self.showMaximized)\n        self.qss_editor_title.show_normal_signal.connect(self.showNormal)\n\n    def set_layout(self):\n        v_layout = QVBoxLayout(self)\n        v_layout.setSpacing(0)\n        v_layout.addWidget(self.qss_editor_title)\n        v_layout.addWidget(self.qss_editor_body)\n        v_layout.setSpacing(5)\n        v_layout.setContentsMargins(0, 0, 0, 0)\n\n    def mousePressEvent(self, event):\n        if event.button() == Qt.LeftButton:\n            if self.can_stretch:\n                self.is_stretching = True\n            else:\n                self.start_x = event.x()\n                self.start_y = event.y()\n\n    def mouseMoveEvent(self, event):\n        if not self.is_stretching:\n            self.check_if_can_stretch(event.x(), event.y())\n\n            if self.start_x is not None and self.start_y is not None:\n                dis_x = event.x() - self.start_x\n                dis_y = event.y() - self.start_y\n                self.move(self.x() + dis_x, self.y() + dis_y)\n        else:\n            if self.stretch_type == \"H\":\n                self.resize(event.x(), self.height())\n            elif self.stretch_type == \"V\":\n                self.resize(self.width(), event.y())\n            elif self.stretch_type == \"VH\":\n                self.resize(event.x(), event.y())\n\n    def mouseReleaseEvent(self, event):\n        self.start_x = None\n        self.start_y = None\n\n        if self.is_stretching:\n            self.is_stretching = False\n            self.stretch_type = None\n            self.can_stretch = False\n            self.setCursor(Qt.ArrowCursor)\n            self.record_size_after_stretch()\n\n    def paintEvent(self, event):\n        super(QSSEditor, self).paintEvent(event)\n        painter = QPainter(self)\n        painter.setPen(Qt.NoPen)\n        painter.setBrush(QColor(self.bg_color))\n        painter.setRenderHint(QPainter.Antialiasing)\n        painter.drawRoundedRect(self.rect(), 9, 9)\n\n    def check_if_can_stretch(self, x, y):\n        if x >= self.width() - self.stretch_area_offset and self.stretch_area_offset <= y <= self.height() - self.stretch_area_offset:\n            # right border\n            self.setCursor(Qt.SizeHorCursor)\n            self.stretch_type = \"H\"\n            self.can_stretch = True\n\n        elif self.stretch_area_offset <= x <= self.width() - self.stretch_area_offset and y >= self.height() - self.stretch_area_offset:\n            # bottom border\n            self.setCursor(Qt.SizeVerCursor)\n            self.stretch_type = \"V\"\n            self.can_stretch = True\n\n        elif x > self.width() - self.stretch_area_offset and y > self.height() - self.stretch_area_offset:\n            # bottom right corner\n            self.setCursor(Qt.SizeFDiagCursor)\n            self.stretch_type = \"VH\"\n            self.can_stretch = True\n\n        else:\n            self.setCursor(Qt.ArrowCursor)\n            self.is_stretching = False\n            self.stretch_type = None\n            self.can_stretch = False\n\n    def record_size_after_stretch(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            config = json.loads(f.read())\n            config[\"qssEditorWidth\"] = self.width()\n            config[\"qssEditorHeight\"] = self.height()\n\n        with open(RES_PATH / \"config.json\", \"w\", encoding=\"utf-8\") as f:\n            f.write(json.dumps(config, indent=4))\n\n    def showMaximized(self):\n        self.move(0, 0)\n        desktop = QApplication.desktop()\n        self.resize(desktop.width(), desktop.height())\n\n    def showNormal(self):\n        super(QSSEditor, self).showNormal()\n\n        with open(RES_PATH/\"config.json\") as f:\n            config = json.loads(f.read())\n            self.resize(config[\"qssEditorWidth\"], config[\"qssEditorHeight\"])\n\n        desktop = QApplication.desktop()\n        self.move(desktop.width() // 2 - self.width() // 2, desktop.height() // 2 - self.height() // 2)\n\n    def reload_style_sheet(self):\n        self.set_style_sheet()\n        self.qss_editor_title.reload_style_sheet()\n        self.qss_editor_body.reload_style_sheet()\n\n\ndef main():\n    check_update()\n\n    QApplication.setHighDpiScaleFactorRoundingPolicy(Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)\n    QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)\n    QApplication.setAttribute(Qt.AA_UseHighDpiPixmaps)\n\n    app = QApplication([])\n    qss_editor = QSSEditor()\n    qss_editor.show()\n    sys.exit(app.exec())\n\n\nif __name__ == \"__main__\":\n    main()"
  },
  {
    "path": "src/qtbox/gui/menu.py",
    "content": "import json\nfrom pathlib import Path\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\n\nRES_PATH = Path(__file__).parent.parent / \"res\"\n\n\nclass ContextMenu(QMenu):\n    view_code_signal = pyqtSignal()\n    download_code_signal = pyqtSignal()\n\n    def __init__(self):\n        super(ContextMenu, self).__init__()\n        self.view_code_action = QAction(QIcon(str(RES_PATH / \"images/open_eye.png\")), \"View Code\", self)\n        self.download_code_action = QAction(QIcon(str(RES_PATH / \"images/download.png\")), \"Download Code\", self)\n\n        self.set_up()\n\n    def set_up(self):\n        self.set_action()\n        self.set_signal()\n        self.set_style_sheet()\n\n    def set_action(self):\n        self.addAction(self.view_code_action)\n        self.addAction(self.download_code_action)\n\n    def set_signal(self):\n        self.view_code_action.triggered.connect(self.view_code_signal.emit)\n        self.download_code_action.triggered.connect(self.download_code_signal.emit)\n\n    def set_style_sheet(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            theme = json.loads(f.read())[\"theme\"]\n\n        with open(RES_PATH / f\"qss/{theme}/menu.qss\", encoding=\"utf-8\") as f:\n            self.setStyleSheet(f.read())\n\n    def reload_style_sheet(self):\n        self.set_style_sheet()\n\n\ndef createWidgetMenuBase(cls):\n    class WidgetMenuBase(cls):\n        view_code_signal = pyqtSignal(str)\n        download_code_signal = pyqtSignal(str)\n\n        def __init__(self, code_file_path):\n            super(WidgetMenuBase, self).__init__()\n            self.code_file_path = code_file_path\n            self.context_menu = ContextMenu()\n\n        def contextMenuEvent(self, event):\n            self.context_menu.view_code_signal.connect(lambda: self.view_code_signal.emit(self.code_file_path))\n            self.context_menu.download_code_signal.connect(lambda: self.download_code_signal.emit(self.code_file_path))\n            self.context_menu.exec(event.globalPos())\n\n    return WidgetMenuBase\n"
  },
  {
    "path": "src/qtbox/gui/message.py",
    "content": "import json\nfrom pathlib import Path\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\n\nRES_PATH = Path(__file__).parent.parent / \"res\"\n\n\nclass MessageBox(QWidget):\n    def __init__(self):\n        super(MessageBox, self).__init__()\n        self.title_label = QLabel()\n        self.content_browser = QTextBrowser()\n        self.confirm_btn = QPushButton()\n        self.close_btn = QPushButton(self)\n\n        self.start_x = None\n        self.start_y = None\n\n        self.bg_color = None\n\n        self.set_up()\n\n    def set_up(self):\n        self.set_widget()\n        self.set_signal()\n        self.set_layout()\n        self.set_window_attr()\n        self.set_object_name()\n        self.set_style_sheet()\n\n    def set_widget(self):\n        self.title_label.setAlignment(Qt.AlignCenter)\n        self.title_label.setFixedWidth(220)\n        self.content_browser.setMinimumHeight(300)\n        self.confirm_btn.setText(\"OK\")\n        self.confirm_btn.setFixedSize(100, 30)\n        self.close_btn.move(288, 2)\n        self.close_btn.setFixedSize(30, 30)\n        self.close_btn.setIcon(QIcon(str(RES_PATH / \"images/close.png\")))\n\n    def set_signal(self):\n        self.close_btn.clicked.connect(self.close)\n        self.confirm_btn.clicked.connect(self.close)\n\n    def set_layout(self):\n        all_v_layout = QVBoxLayout(self)\n        title_h_layout = QHBoxLayout()\n        btn_h_layout = QHBoxLayout()\n        title_h_layout.addWidget(self.title_label)\n        title_h_layout.setAlignment(Qt.AlignCenter)\n        all_v_layout.addLayout(title_h_layout)\n        all_v_layout.addSpacing(5)\n        all_v_layout.addWidget(self.content_browser)\n        all_v_layout.addSpacing(5)\n        btn_h_layout.addWidget(self.confirm_btn)\n        btn_h_layout.setAlignment(Qt.AlignCenter)\n        all_v_layout.addLayout(btn_h_layout)\n\n    def set_window_attr(self):\n        self.setFixedSize(320, 450)\n        self.setWindowFlag(Qt.FramelessWindowHint)\n        self.setAttribute(Qt.WA_TranslucentBackground)\n\n    def set_object_name(self):\n        self.setObjectName(\"messageBox\")\n        self.title_label.setObjectName(\"titleLabel\")\n        self.content_browser.setObjectName(\"contentBrowser\")\n        self.confirm_btn.setObjectName(\"confirmBtn\")\n        self.close_btn.setObjectName(\"closeBtn\")\n\n    def set_style_sheet(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            theme = json.loads(f.read())[\"theme\"]\n\n        with open(RES_PATH / f\"qss/{theme}/message_box.qss\", encoding=\"utf-8\") as f:\n            self.setStyleSheet(f.read())\n\n        if theme == \"black\":\n            self.bg_color = \"#3b3f42\"\n        else:\n            self.bg_color = \"#f2f2f2\"\n\n    def mousePressEvent(self, event):\n        pass\n\n    def paintEvent(self, event):\n        super(MessageBox, self).paintEvent(event)\n        painter = QPainter(self)\n        painter.setPen(Qt.NoPen)\n        painter.setBrush(QColor(self.bg_color))\n        painter.setRenderHint(QPainter.Antialiasing)\n        painter.drawRoundedRect(self.rect(), 5, 5)\n\n    def mousePressEvent(self, event):\n        if event.button() == Qt.LeftButton:\n            self.start_x = event.x()\n            self.start_y = event.y()\n\n    def mouseMoveEvent(self, event):\n        if self.start_x is None or self.start_y is None:\n            return\n\n        dis_x = event.x() - self.start_x\n        dis_y = event.y() - self.start_y\n        self.move(self.x() + dis_x, self.y() + dis_y)\n\n    def mouseReleaseEvent(self, event):\n        self.start_x = None\n        self.start_y = None\n\n    def set_title(self, s):\n        self.title_label.setText(s)\n\n    def set_plain_text(self, s):\n        self.content_browser.setPlainText(s)\n\n    def set_html(self, s):\n        self.content_browser.setHtml(s)\n\n    def reload_style_sheet(self):\n        self.set_style_sheet()"
  },
  {
    "path": "src/qtbox/gui/title.py",
    "content": "import json\nfrom pathlib import Path\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\n\n\nRES_PATH = Path(__file__).parent.parent / \"res\"\n\n\nclass TitleWidget(QWidget):\n    close_signal = pyqtSignal()\n    minimize_signal = pyqtSignal()\n    maximize_signal = pyqtSignal()\n    show_normal_signal = pyqtSignal()\n\n    def __init__(self):\n        super(TitleWidget, self).__init__()\n        self.maximized_or_normal = \"normal\"\n\n        self.minimize_btn = QPushButton()\n        self.maximize_or_normal_btn = QPushButton()\n        self.close_window_btn = QPushButton()\n\n        self.set_up()\n\n    def set_up(self):\n        self.set_window_attr()\n        self.set_object_name()\n        self.set_style_sheet()\n        self.set_widget()\n        self.set_signal()\n        self.set_layout()\n\n    def set_window_attr(self):\n        self.setMouseTracking(True)\n\n    def set_object_name(self):\n        self.setObjectName(\"windowTitle\")\n        self.minimize_btn.setObjectName(\"minimizeBtn\")\n        self.maximize_or_normal_btn.setObjectName(\"maximizeNormalBtn\")\n        self.close_window_btn.setObjectName(\"closeBtn\")\n\n    def set_style_sheet(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            theme = json.loads(f.read())[\"theme\"]\n\n        with open(RES_PATH / f\"qss/{theme}/title.qss\", encoding=\"utf-8\") as f:\n            self.setStyleSheet(f.read())\n\n    def set_widget(self):\n        self.minimize_btn.setFixedSize(30, 30)\n        self.maximize_or_normal_btn.setFixedSize(30, 30)\n        self.close_window_btn.setFixedSize(30, 30)\n        self.minimize_btn.setIcon(QIcon(str(RES_PATH / \"images/minimize.png\")))\n        self.maximize_or_normal_btn.setIcon(QIcon(str(RES_PATH / \"images/maximize.png\")))\n        self.close_window_btn.setIcon(QIcon(str(RES_PATH / \"images/close.png\")))\n        self.minimize_btn.setIconSize(QSize(16, 16))\n        self.maximize_or_normal_btn.setIconSize(QSize(16, 16))\n        self.close_window_btn.setIconSize(QSize(16, 16))\n\n    def set_signal(self):\n        self.minimize_btn.clicked.connect(self.minimize)\n        self.maximize_or_normal_btn.clicked.connect(self.maximize_or_show_normal)\n        self.close_window_btn.clicked.connect(self.close_window)\n\n    def set_layout(self):\n        all_h_layout = QHBoxLayout(self)\n        right_h_layout = QHBoxLayout()\n\n        right_h_layout.setSpacing(0)\n        right_h_layout.addWidget(self.minimize_btn)\n        right_h_layout.addWidget(self.maximize_or_normal_btn)\n        right_h_layout.addWidget(self.close_window_btn)\n\n        all_h_layout.addStretch()\n        all_h_layout.addLayout(right_h_layout)\n        all_h_layout.setContentsMargins(5, 8, 5, 2)\n\n    def minimize(self):\n        self.minimize_signal.emit()\n\n    def maximize_or_show_normal(self):\n        if self.maximized_or_normal != \"maximized\":\n            self.maximize_or_normal_btn.setIcon(QIcon(str(RES_PATH/\"images/orisize.png\")))\n            self.maximized_or_normal = \"maximized\"\n            self.maximize_signal.emit()\n        else:\n            self.maximize_or_normal_btn.setIcon(QIcon(str(RES_PATH/\"images/maximize.png\")))\n            self.maximized_or_normal = \"normal\"\n            self.show_normal_signal.emit()\n\n    def close_window(self):\n        self.close_signal.emit()\n\n    def reload_style_sheet(self):\n        self.set_style_sheet()\n\n    def mouseDoubleClickEvent(self, event):\n        super(TitleWidget, self).mouseDoubleClickEvent(event)\n        self.maximize_or_show_normal()"
  },
  {
    "path": "src/qtbox/gui/viewer.py",
    "content": "import json\nfrom pathlib import Path\nfrom qtbox.gui.title import TitleWidget as CodeViewerTitle\n\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\n\nfrom pygments import highlight\nfrom pygments.lexers import PythonLexer, CppLexer\nfrom pygments.formatters import HtmlFormatter\n\n\nRES_PATH = Path(__file__).parent.parent / \"res\"\n\n\nclass CodeViewerBody(QTextBrowser):\n    def __init__(self):\n        super(CodeViewerBody, self).__init__()\n        self.clipboard = QApplication.clipboard()\n        self.switch_btn = QPushButton()\n        self.copy_btn = QPushButton()\n        self.pyside_code = \"\"\n        self.pyqt_code = \"\"\n        self.qt_code = \"\"\n        self.code = \"\"\n        self.theme = None\n\n        self.set_up()\n\n    def set_up(self):\n        self.set_object_name()\n        self.set_style_sheet()\n        self.set_widget()\n        self.set_signal()\n        self.set_layout()\n\n    def set_window_attr(self):\n        self.setMouseTracking(True)\n\n    def set_object_name(self):\n        self.setObjectName(\"codeViewerBody\")\n        self.switch_btn.setObjectName(\"switchBtn\")\n        self.copy_btn.setObjectName(\"copyBtn\")\n\n    def set_style_sheet(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            self.theme = json.loads(f.read())[\"theme\"]\n\n        with open(RES_PATH / f\"qss/{self.theme}/viewer.qss\", encoding=\"utf-8\") as f:\n            self.setStyleSheet(f.read())\n\n    def set_widget(self):\n        self.switch_btn.setToolTip(\"Switch to PySide\")\n        self.switch_btn.setCursor(Qt.PointingHandCursor)\n        self.switch_btn.setIcon(QIcon(str(RES_PATH / \"images/switch.png\")))\n        self.switch_btn.setIconSize(QSize(16, 16))\n        self.copy_btn.setToolTip(\"Click to copy\")\n        self.copy_btn.setCursor(Qt.PointingHandCursor)\n        self.copy_btn.setIcon(QIcon(str(RES_PATH / \"images/copy.png\")))\n        self.copy_btn.setIconSize(QSize(16, 16))\n        self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn)\n\n    def set_signal(self):\n        self.copy_btn.clicked.connect(self.copy)\n        self.switch_btn.clicked.connect(self.switch_code)\n        self.clipboard.dataChanged.connect(self.on_clipboard_changed)\n\n    def set_layout(self):\n        h_layout = QHBoxLayout()\n        v_layout = QVBoxLayout(self)\n        h_layout.addStretch()\n        h_layout.addWidget(self.switch_btn)\n        h_layout.addWidget(self.copy_btn)\n        v_layout.addLayout(h_layout)\n        v_layout.addStretch()\n\n    def set_code(self, code):\n        self.code = code\n        if self.theme == \"black\":\n            formatter = HtmlFormatter(linenos=True, style=\"paraiso-dark\")\n            css = \"<style>\" + formatter.get_style_defs('.highlight').replace(\"#2f1e2e\", \"#2b2b2b\").replace(\"#4f424c\", \"#2b2b2b\") + \"</style>\"\n        else:\n            formatter = HtmlFormatter(linenos=True, style=\"tango\")\n            css = \"<style>\" + formatter.get_style_defs('.highlight').replace(\"#ffffcc\", \"#ffffff\").replace(\"#f8f8f8\", \"#ffffff\") + \"</style>\"\n\n        lexer = CppLexer() if self.switch_btn.toolTip() == \"Switch to PyQt\" else PythonLexer()\n        html = highlight(self.code, lexer=lexer, formatter=formatter)\n        self.setHtml(css+html)\n        self.horizontalScrollBar().move(0, 0)\n\n        self.copy_btn.setIcon(QIcon(str(RES_PATH / \"images/copy.png\")))\n        self.copy_btn.setToolTip(\"Click to copy\")\n\n    def copy(self):\n        self.clipboard.setText(self.code)\n\n    def on_clipboard_changed(self):\n        data = self.clipboard.mimeData()\n        if data.text() == self.code:\n            self.copy_btn.setIcon(QIcon(str(RES_PATH / \"images/check.png\")))\n            self.copy_btn.setToolTip(\"Copied\")\n        else:\n            self.copy_btn.setIcon(QIcon(str(RES_PATH / \"images/copy.png\")))\n            self.copy_btn.setToolTip(\"Click to copy\")\n\n    def contextMenuEvent(self, event):\n        pass\n\n    def switch_code(self):\n        if self.switch_btn.toolTip() == \"Switch to PySide\":\n            self.switch_btn.setToolTip(\"Switch to Qt\")\n            self.set_code(self.pyside_code)\n        elif self.switch_btn.toolTip() == \"Switch to Qt\":\n            self.switch_btn.setToolTip(\"Switch to PyQt\")\n            self.set_code(self.qt_code)\n        else:\n            self.switch_btn.setToolTip(\"Switch to PySide\")\n            self.set_code(self.pyqt_code)\n\n    def reload_style_sheet(self):\n        self.set_style_sheet()\n\n\nclass CodeViewer(QWidget):\n    def __init__(self):\n        super(CodeViewer, self).__init__()\n        self.code_viewer_title = CodeViewerTitle()\n        self.code_viewer_body = CodeViewerBody()\n\n        self.start_x = None\n        self.start_y = None\n        self.stretch_area_offset = 10\n        self.is_stretching = False\n        self.stretch_type = None\n        self.can_stretch = False\n\n        self.bg_color = None\n\n        self.set_up()\n\n    def set_up(self):\n        self.set_window_attr()\n        self.set_style_sheet()\n        self.set_signal()\n        self.set_layout()\n\n    def set_window_attr(self):\n        with open(RES_PATH/\"config.json\") as f:\n            config = json.loads(f.read())\n            self.resize(config[\"codeViewerWidth\"], config[\"codeViewerHeight\"])\n\n        self.setMouseTracking(True)\n        self.setWindowFlag(Qt.FramelessWindowHint)\n        self.setAttribute(Qt.WA_TranslucentBackground)\n\n    def set_style_sheet(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            theme = json.loads(f.read())[\"theme\"]\n\n        if theme == \"black\":\n            self.bg_color = \"#3b3f42\"\n        else:\n            self.bg_color = \"#f2f2f2\"\n\n    def set_signal(self):\n        self.code_viewer_title.close_signal.connect(self.close)\n        self.code_viewer_title.minimize_signal.connect(self.showMinimized)\n        self.code_viewer_title.maximize_signal.connect(self.showMaximized)\n        self.code_viewer_title.show_normal_signal.connect(self.showNormal)\n\n    def set_layout(self):\n        v_layout = QVBoxLayout(self)\n        v_layout.setSpacing(0)\n        v_layout.addWidget(self.code_viewer_title)\n        v_layout.addWidget(self.code_viewer_body)\n        v_layout.setSpacing(5)\n        v_layout.setContentsMargins(0, 0, 0, 0)\n\n    def mousePressEvent(self, event):\n        if event.button() == Qt.LeftButton:\n            if self.can_stretch:\n                self.is_stretching = True\n            else:\n                self.start_x = event.x()\n                self.start_y = event.y()\n\n    def mouseMoveEvent(self, event):\n        if not self.is_stretching:\n            self.check_if_can_stretch(event.x(), event.y())\n\n            if self.start_x is not None and self.start_y is not None:\n                dis_x = event.x() - self.start_x\n                dis_y = event.y() - self.start_y\n                self.move(self.x() + dis_x, self.y() + dis_y)\n        else:\n            if self.stretch_type == \"H\":\n                self.resize(event.x(), self.height())\n            elif self.stretch_type == \"V\":\n                self.resize(self.width(), event.y())\n            elif self.stretch_type == \"VH\":\n                self.resize(event.x(), event.y())\n\n    def mouseReleaseEvent(self, event):\n        self.start_x = None\n        self.start_y = None\n\n        if self.is_stretching:\n            self.is_stretching = False\n            self.stretch_type = None\n            self.can_stretch = False\n            self.setCursor(Qt.ArrowCursor)\n            self.record_size_after_stretch()\n\n    def paintEvent(self, event):\n        super(CodeViewer, self).paintEvent(event)\n        painter = QPainter(self)\n        painter.setPen(Qt.NoPen)\n        painter.setBrush(QColor(self.bg_color))\n        painter.setRenderHint(QPainter.Antialiasing)\n        painter.drawRoundedRect(self.rect(), 9, 9)\n\n    def check_if_can_stretch(self, x, y):\n        if x >= self.width() - self.stretch_area_offset and self.stretch_area_offset <= y <= self.height() - self.stretch_area_offset:\n            # right border\n            self.setCursor(Qt.SizeHorCursor)\n            self.stretch_type = \"H\"\n            self.can_stretch = True\n\n        elif self.stretch_area_offset <= x <= self.width() - self.stretch_area_offset and y >= self.height() - self.stretch_area_offset:\n            # bottom border\n            self.setCursor(Qt.SizeVerCursor)\n            self.stretch_type = \"V\"\n            self.can_stretch = True\n\n        elif x > self.width() - self.stretch_area_offset and y > self.height() - self.stretch_area_offset:\n            # bottom right corner\n            self.setCursor(Qt.SizeFDiagCursor)\n            self.stretch_type = \"VH\"\n            self.can_stretch = True\n\n        else:\n            self.setCursor(Qt.ArrowCursor)\n            self.is_stretching = False\n            self.stretch_type = None\n            self.can_stretch = False\n\n    def record_size_after_stretch(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            config = json.loads(f.read())\n            config[\"codeViewerWidth\"] = self.width()\n            config[\"codeViewerHeight\"] = self.height()\n\n        with open(RES_PATH / \"config.json\", \"w\", encoding=\"utf-8\") as f:\n            f.write(json.dumps(config, indent=4))\n\n    def showMaximized(self):\n        self.move(0, 0)\n        desktop = QApplication.desktop()\n        self.resize(desktop.width(), desktop.height())\n\n    def showNormal(self):\n        super(CodeViewer, self).showNormal()\n\n        with open(RES_PATH/\"config.json\") as f:\n            config = json.loads(f.read())\n            self.resize(config[\"codeViewerWidth\"], config[\"codeViewerHeight\"])\n\n        desktop = QApplication.desktop()\n        self.move(desktop.width() // 2 - self.width() // 2, desktop.height() // 2 - self.height() // 2)\n\n    def assign_code(self, pyqt_code, pyside_code, qt_code):\n        self.code_viewer_body.pyqt_code = pyqt_code\n        self.code_viewer_body.pyside_code = pyside_code\n        self.code_viewer_body.qt_code = qt_code\n\n    def set_code(self, code):\n        self.code_viewer_body.set_code(code)\n\n    def reload_style_sheet(self):\n        self.set_style_sheet()\n        self.code_viewer_title.reload_style_sheet()\n        self.code_viewer_body.reload_style_sheet()\n        self.code_viewer_body.set_code(self.code_viewer_body.code)\n"
  },
  {
    "path": "src/qtbox/gui/window.py",
    "content": "import re\nimport json\nimport webbrowser\nfrom pathlib import Path\n\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\n\nfrom qtbox.gui.editor import QSSEditor\nfrom qtbox.gui.viewer import CodeViewer\nfrom qtbox.gui.message import MessageBox\nfrom qtbox.gui.title import TitleWidget as WindowTitle\n\nfrom qtbox.demo.checkbox import func as func_checkbox\nfrom qtbox.demo.checkbox import style as style_checkbox\nfrom qtbox.demo.combobox import func as func_combobox\nfrom qtbox.demo.combobox import style as style_combobox\nfrom qtbox.demo.dial import func as func_dial\nfrom qtbox.demo.dial import style as style_dial\nfrom qtbox.demo.label import func as func_label\nfrom qtbox.demo.label import style as style_label\nfrom qtbox.demo.lcdnumber import func as func_lcdnumber\nfrom qtbox.demo.lcdnumber import style as style_lcdnumber\nfrom qtbox.demo.lineedit import func as func_lineedit\nfrom qtbox.demo.lineedit import style as style_lineedit\nfrom qtbox.demo.listwidget import func as func_listwidget\nfrom qtbox.demo.listwidget import style as style_listwidget\nfrom qtbox.demo.progressbar import func as func_progressbar\nfrom qtbox.demo.progressbar import style as style_progressbar\nfrom qtbox.demo.pushbutton import func as func_pushbutton\nfrom qtbox.demo.pushbutton import style as style_pushbutton\nfrom qtbox.demo.slider import func as func_slider\nfrom qtbox.demo.slider import style as style_slider\nfrom qtbox.demo.spinbox import func as func_spinbox\nfrom qtbox.demo.spinbox import style as style_spinbox\nfrom qtbox.demo.tablewidget import func as func_tablewidget\nfrom qtbox.demo.tablewidget import style as style_tablewidget\nfrom qtbox.demo.widget import func as func_widget\nfrom qtbox.demo.widget import style as style_widget\n\n\nVERSION = \"1.2.0\"\n\nUPDATES = \"\"\"\n1. Fixed known bugs.\\n\n2. Updated the project structure. \\n\n3. Added C++/Qt code for each demo. \\n\n4. Adapted to high resolution screen. Thank @panhaovue for the tip. \\n\n\"\"\"\n\nRES_PATH = Path(__file__).parent.parent / \"res\"\n\n\nclass WindowBody(QWidget):\n    switch_theme_signal = pyqtSignal()\n\n    def __init__(self):\n        super(WindowBody, self).__init__()\n        self.btn_list_widget = QListWidget()\n        self.btn_list = [QPushButton(txt) for txt in [\"QCheckBox\", \"QComboBox\", \"QDial\", \"QLabel\", \"QLCDNumber\",\n                                                      \"QLineEdit\", \"QListWidget\", \"QProgressBar\", \"QPushButton\",\n                                                      \"QSlider\", \"QSpinBox\", \"QTableWidget\", \"QWidget\"]]\n        self.func_widget = QWidget()\n        self.style_widget = QWidget()\n        self.func_tab = QScrollArea()\n        self.style_tab = QScrollArea()\n        self.tab_widget = QTabWidget()\n\n        self.editor_btn = QPushButton()\n        self.sponsor_btn = QPushButton()\n        self.doc_btn = QPushButton()\n        self.about_btn = QPushButton()\n        self.switch_btn = QPushButton()\n\n        self.qss_editor = QSSEditor()\n        self.code_viewer = CodeViewer()\n        self.updates_message_box = MessageBox()\n        self.sponsor_message_box = MessageBox()\n\n        self.grid_layout_children = []\n        self.grid_layout = QGridLayout()\n\n        self.checkbox_dict = {\n            \"func\": [func_checkbox.demo1.QtBoxFuncCheckBox1, func_checkbox.demo2.QtBoxFuncCheckBox2],\n            \"style\": [style_checkbox.demo1.QtBoxStyleCheckBox1, style_checkbox.demo2.QtBoxStyleCheckBox2, style_checkbox.demo3.QtBoxStyleCheckBox3,\n                      style_checkbox.demo4.QtBoxStyleCheckBox4]\n        }\n\n        self.combobox_dict = {\n            \"func\": [func_combobox.demo1.QtBoxFuncComboBox1, func_combobox.demo2.QtBoxFuncComboBox2],\n            \"style\": [style_combobox.demo1.QtBoxStyleComboBox1, style_combobox.demo2.QtBoxStyleComboBox2, style_combobox.demo3.QtBoxStyleComboBox3]\n        }\n\n        self.dial_dict = {\n            \"func\": [func_dial.demo1.QtBoxFuncDial1],\n            \"style\": [style_dial.demo1.QtBoxStyleDial1, style_dial.demo2.QtBoxStyleDial2]\n        }\n\n        self.label_dict = {\n            \"func\": [func_label.demo1.QtBoxFuncLabel1, func_label.demo2.QtBoxFuncLabel2, func_label.demo3.QtBoxFuncLabel3,\n                     func_label.demo4.QtBoxFuncLabel4, func_label.demo5.QtBoxFuncLabel5, func_label.demo6.QtBoxFuncLabel6,\n                     func_label.demo7.QtBoxFuncLabel7],\n            \"style\": [style_label.demo1.QtBoxStyleLabel1, style_label.demo2.QtBoxStyleLabel2, style_label.demo3.QtBoxStyleLabel3,\n                      style_label.demo4.QtBoxStyleLabel4]\n        }\n\n        self.lcdnumber_dict = {\n            \"func\": [func_lcdnumber.demo1.QtBoxFuncLCDNumber1, func_lcdnumber.demo2.QtBoxFuncLCDNumber2, func_lcdnumber.demo3.QtBoxFuncLCDNumber3],\n            \"style\": [style_lcdnumber.demo1.QtBoxStyleLCDNumber1, style_lcdnumber.demo2.QtBoxStyleLCDNumber2, style_lcdnumber.demo3.QtBoxStyleLCDNumber3,\n                      style_lcdnumber.demo4.QtBoxStyleLCDNumber4, style_lcdnumber.demo5.QtBoxStyleLCDNumber5]\n        }\n\n        self.lineedit_dict = {\n            \"func\": [func_lineedit.demo1.QtBoxFuncLineEdit1, func_lineedit.demo2.QtBoxFuncLineEdit2, func_lineedit.demo3.QtBoxFuncLineEdit3,\n                     func_lineedit.demo4.QtBoxFuncLineEdit4, func_lineedit.demo5.QtBoxFuncLineEdit5],\n            \"style\": [style_lineedit.demo1.QtBoxStyleLineEdit1, style_lineedit.demo2.QtBoxStyleLineEdit2, style_lineedit.demo3.QtBoxStyleLineEdit3,\n                      style_lineedit.demo4.QtBoxStyleLineEdit4, style_lineedit.demo5.QtBoxStyleLineEdit5, style_lineedit.demo6.QtBoxStyleLineEdit6,\n                      style_lineedit.demo7.QtBoxStyleLineEdit7]\n        }\n\n        self.listwidget_dict = {\n            \"func\": [func_listwidget.demo1.QtBoxFuncListWidget1],\n            \"style\": [style_listwidget.demo1.QtBoxStyleListWidget1, style_listwidget.demo2.QtBoxStyleListWidget2]\n        }\n\n        self.progressbar_dict = {\n            \"func\": [func_progressbar.demo1.QtBoxFuncProgressBar1, func_progressbar.demo2.QtBoxFuncProgressBar2],\n            \"style\": [style_progressbar.demo1.QtBoxStyleProgressBar1, style_progressbar.demo2.QtBoxStyleProgressBar2, style_progressbar.demo3.QtBoxStyleProgressBar3,\n                      style_progressbar.demo4.QtBoxStyleProgressBar4, style_progressbar.demo5.QtBoxStyleProgressBar5, style_progressbar.demo6.QtBoxStyleProgressBar6,\n                      style_progressbar.demo7.QtBoxStyleProgressBar7, style_progressbar.demo8.QtBoxStyleProgressBar8, style_progressbar.demo9.QtBoxStyleProgressBar9]\n        }\n\n        self.pushbutton_dict = {\n            \"func\": [func_pushbutton.demo1.QtBoxFuncButton1, func_pushbutton.demo2.QtBoxFuncButton2, func_pushbutton.demo3.QtBoxFuncButton3],\n            \"style\": [style_pushbutton.demo1.QtBoxStyleButton1, style_pushbutton.demo2.QtBoxStyleButton2, style_pushbutton.demo3.QtBoxStyleButton3,\n                      style_pushbutton.demo4.QtBoxStyleButton4, style_pushbutton.demo5.QtBoxStyleButton5, style_pushbutton.demo6.QtBoxStyleButton6,\n                      style_pushbutton.demo7.QtBoxStyleButton7, style_pushbutton.demo8.QtBoxStyleButton8, style_pushbutton.demo9.QtBoxStyleButton9,\n                      style_pushbutton.demo10.QtBoxStyleButton10, style_pushbutton.demo11.QtBoxStyleButton11, style_pushbutton.demo12.QtBoxStyleButton12]\n        }\n\n        self.slider_dict = {\n            \"func\": [func_slider.demo1.QtBoxFuncSlider1],\n            \"style\": [style_slider.demo1.QtBoxStyleSlider1, style_slider.demo2.QtBoxStyleSlider2, style_slider.demo3.QtBoxStyleSlider3,\n                      style_slider.demo4.QtBoxStyleSlider4, style_slider.demo5.QtBoxStyleSlider5]\n        }\n\n        self.spinbox_dict = {\n            \"func\": [func_spinbox.demo1.QtBoxFuncSpinBox1],\n            \"style\": [style_spinbox.demo1.QtBoxStyleSpinBox1]\n        }\n\n        self.tablewidget_dict = {\n            \"func\": [func_tablewidget.demo1.QtBoxFuncTableWidget1, func_tablewidget.demo2.QtBoxFuncTableWidget2],\n            \"style\": [style_tablewidget.demo1.QtBoxStyleTableWidget1]\n        }\n\n        self.widget_dict = {\n            \"func\": [func_widget.demo1.QtBoxFuncWidget1, func_widget.demo2.QtBoxFuncWidget2],\n            \"style\": [style_widget.demo1.QtBoxStyleWidget1, style_widget.demo2.QtBoxStyleWidget2]\n        }\n\n        self.set_up()\n\n    def set_up(self):\n        self.set_window_attr()\n        self.set_object_name()\n        self.set_style_sheet()\n        self.set_widget()\n        self.set_signal()\n        self.set_layout()\n\n        self.btn_list[0].setCheckable(True)\n        self.btn_list[0].setChecked(True)\n        self.set_tab_content(\"QCheckBox\")\n\n    def set_window_attr(self):\n        self.setMouseTracking(True)\n\n    def set_object_name(self):\n        self.setObjectName(\"windowBody\")\n        self.btn_list_widget.setObjectName(\"btnList\")\n        self.btn_list_widget.verticalScrollBar().setObjectName(\"btnList\")\n\n        for btn in self.btn_list:\n            btn.setObjectName(\"listBtn\")\n\n        self.editor_btn.setObjectName(\"editorBtn\")\n        self.sponsor_btn.setObjectName(\"sponsorBtn\")\n        self.doc_btn.setObjectName(\"docBtn\")\n        self.about_btn.setObjectName(\"aboutBtn\")\n        self.switch_btn.setObjectName(\"switchBtn\")\n\n        self.tab_widget.setObjectName(\"tabWidget\")\n        self.func_tab.setObjectName(\"funcScrollArea\")\n        self.style_tab.setObjectName(\"styleScrollArea\")\n        self.func_tab.verticalScrollBar().setObjectName(\"funcScrollVBar\")\n        self.func_tab.horizontalScrollBar().setObjectName(\"funcScrollHBar\")\n        self.style_tab.verticalScrollBar().setObjectName(\"styleScrollVBar\")\n        self.style_tab.horizontalScrollBar().setObjectName(\"styleScrollHBar\")\n        self.func_widget.setObjectName(\"funcWidget\")\n        self.style_widget.setObjectName(\"styleWidget\")\n\n    def set_style_sheet(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            theme = json.loads(f.read())[\"theme\"]\n\n        with open(RES_PATH / f\"qss/{theme}/window_body.qss\", encoding=\"utf-8\") as f:\n            self.setStyleSheet(f.read())\n\n    def set_widget(self):\n        self.btn_list_widget.setMaximumWidth(300)\n        self.btn_list_widget.setMinimumWidth(150)\n\n        self.func_tab.setWidgetResizable(True)\n        self.style_tab.setWidgetResizable(True)\n        self.func_tab.setWidget(self.func_widget)\n        self.style_tab.setWidget(self.style_widget)\n        self.func_tab.setAlignment(Qt.AlignCenter)\n        self.style_tab.setAlignment(Qt.AlignCenter)\n        self.tab_widget.addTab(self.style_tab, \"Style\")\n        self.tab_widget.addTab(self.func_tab, \"Function\")\n\n        self.editor_btn.setFixedWidth(30)\n        self.sponsor_btn.setFixedWidth(30)\n        self.doc_btn.setFixedWidth(30)\n        self.about_btn.setFixedWidth(30)\n        self.switch_btn.setFixedWidth(30)\n        self.editor_btn.setIconSize(QSize(16, 16))\n        self.sponsor_btn.setIconSize(QSize(16, 16))\n        self.doc_btn.setIconSize(QSize(16, 16))\n        self.about_btn.setIconSize(QSize(16, 16))\n        self.switch_btn.setIconSize(QSize(16, 16))\n        self.editor_btn.setToolTip(\"Open QSS editor\")\n        self.sponsor_btn.setToolTip(\"Sponsor\")\n        self.doc_btn.setToolTip(\"Open documentation\")\n        self.about_btn.setToolTip(\"Show updates\")\n        self.switch_btn.setToolTip(\"Switch theme\")\n        self.editor_btn.setCursor(Qt.PointingHandCursor)\n        self.sponsor_btn.setCursor(Qt.PointingHandCursor)\n        self.doc_btn.setCursor(Qt.PointingHandCursor)\n        self.about_btn.setCursor(Qt.PointingHandCursor)\n        self.switch_btn.setCursor(Qt.PointingHandCursor)\n        self.editor_btn.setIcon(QIcon(str(RES_PATH / \"images/editor.png\")))\n        self.sponsor_btn.setIcon(QIcon(str(RES_PATH / \"images/sponsor.png\")))\n        self.doc_btn.setIcon(QIcon(str(RES_PATH / \"images/doc.png\")))\n        self.about_btn.setIcon(QIcon(str(RES_PATH / \"images/about.png\")))\n        self.switch_btn.setIcon(QIcon(str(RES_PATH / \"images/switch.png\")))\n\n        self.code_viewer.hide()\n\n        desktop = QApplication.desktop()\n        self.updates_message_box.move(desktop.width()//2-self.updates_message_box.width()//2, desktop.height()//2-self.updates_message_box.height()//2)\n        self.updates_message_box.set_title(f\"Qt Box Updates v{VERSION}\")\n        self.updates_message_box.set_plain_text(UPDATES)\n        self.updates_message_box.content_browser.setLineWrapMode(QTextEdit.NoWrap)\n        self.updates_message_box.hide()\n\n        self.sponsor_message_box.setFixedSize(320, 205)\n        self.sponsor_message_box.content_browser.setMinimumHeight(95)\n        self.sponsor_message_box.move(desktop.width()//2-self.sponsor_message_box.width()//2, desktop.height()//2-self.sponsor_message_box.height()//2)\n        self.sponsor_message_box.set_title(\"Customize\")\n        self.sponsor_message_box.set_html(\"Contact <a href='mailto:louasure@126.com' style='text-decoration:none'>louasure@126.com</a> to customize a widget. If you have any problems with PyQt or PySide, you may contact me, too. I will be very happy to provide solutions. <a href='https://github.com/la-vie-est-belle/qtbox' style='text-decoration:none'>Sponsors'</a> needs will be treated with top priority. (๑•̀ㅂ•́)و✧\")\n        self.sponsor_message_box.content_browser.setOpenExternalLinks(True)\n        self.sponsor_message_box.content_browser.setAlignment(Qt.AlignJustify)\n        self.sponsor_message_box.hide()\n\n    def set_signal(self):\n        for btn in self.btn_list:\n            btn.clicked.connect(self.change_widget)\n\n        self.editor_btn.clicked.connect(self.open_editor)\n        self.sponsor_btn.clicked.connect(self.show_sponsor_message)\n        self.doc_btn.clicked.connect(self.open_doc)\n        self.about_btn.clicked.connect(self.show_updates)\n        self.switch_btn.clicked.connect(self.switch_theme)\n        self.tab_widget.currentChanged.connect(self.change_tab)\n\n    def set_layout(self):\n        v_layout1 = QVBoxLayout()\n        h_layout1 = QHBoxLayout()\n        h_layout2 = QHBoxLayout()\n        v_layout1.setContentsMargins(0, 0, 0, 0)\n        h_layout1.setContentsMargins(0, 0, 0, 0)\n\n        for btn in self.btn_list:\n            item = QListWidgetItem()\n            item.setSizeHint(QSize(150, 50))\n            self.btn_list_widget.addItem(item)\n            self.btn_list_widget.setItemWidget(item, btn)\n\n        h_layout1.addWidget(self.editor_btn)\n        h_layout1.addWidget(self.sponsor_btn)\n        h_layout1.addWidget(self.doc_btn)\n        h_layout1.addWidget(self.about_btn)\n        h_layout1.addWidget(self.switch_btn)\n        h_layout1.setSpacing(30)\n\n        v_layout1.addLayout(h_layout1)\n        v_layout1.addWidget(self.btn_list_widget)\n        v_layout1.setSpacing(6)\n        h_layout2.addLayout(v_layout1)\n        h_layout2.addWidget(self.tab_widget)\n        self.setLayout(h_layout2)\n\n        self.grid_layout.setVerticalSpacing(70)\n        self.grid_layout.setHorizontalSpacing(60)\n\n    def change_widget(self):\n        self.update_btn_style()\n        self.clear_grid_layout()\n        self.set_tab_content(self.sender().text())\n\n    def change_tab(self):\n        \"\"\"change between Style and Function tab\"\"\"\n        self.clear_grid_layout()\n\n        for btn in self.btn_list:\n            if btn.isChecked():\n                self.set_tab_content(btn.text())\n                break\n\n    def update_btn_style(self):\n        for btn in self.btn_list:\n            btn.setCheckable(False)\n            btn.setChecked(False)\n\n        self.sender().setCheckable(True)\n        self.sender().setChecked(True)\n        self.btn_list_widget.update()\n\n    def clear_grid_layout(self):\n        for widget in self.grid_layout_children:\n            widget.deleteLater()\n        self.grid_layout_children = []\n        self.tab_widget.update()\n\n    def set_tab_content(self, btn_txt):\n        widget_list = []\n        tab_index = self.tab_widget.currentIndex()\n\n        key = \"style\" if tab_index == 0 else \"func\"\n        if btn_txt == \"QComboBox\":\n            widget_list = self.combobox_dict[key]\n\n        elif btn_txt == \"QCheckBox\":\n            widget_list = self.checkbox_dict[key]\n\n        elif btn_txt == \"QDial\":\n            widget_list = self.dial_dict[key]\n\n        elif btn_txt == \"QLabel\":\n            widget_list = self.label_dict[key]\n\n        elif btn_txt == \"QLCDNumber\":\n            widget_list = self.lcdnumber_dict[key]\n\n        elif btn_txt == \"QLineEdit\":\n            widget_list = self.lineedit_dict[key]\n\n        elif btn_txt == \"QListWidget\":\n            widget_list = self.listwidget_dict[key]\n\n        elif btn_txt == \"QProgressBar\":\n            widget_list = self.progressbar_dict[key]\n\n        elif btn_txt == \"QPushButton\":\n            widget_list = self.pushbutton_dict[key]\n\n        elif btn_txt == \"QSlider\":\n            widget_list = self.slider_dict[key]\n\n        elif btn_txt == \"QSpinBox\":\n            widget_list = self.spinbox_dict[key]\n\n        elif btn_txt == \"QTableWidget\":\n            widget_list = self.tablewidget_dict[key]\n\n        elif btn_txt == \"QWidget\":\n            widget_list = self.widget_dict[key]\n\n        if tab_index == 0:\n            self.set_style_tab_content(widget_list)\n        else:\n            self.set_func_tab_content(widget_list)\n\n    def set_style_tab_content(self, widget_list):\n        self.add_widget_list_to_grid_layout(widget_list)\n        self.style_widget.setLayout(self.grid_layout)\n\n    def set_func_tab_content(self, widget_list):\n        self.add_widget_list_to_grid_layout(widget_list)\n        self.func_widget.setLayout(self.grid_layout)\n\n    def add_widget_list_to_grid_layout(self, widget_list):\n        row, column = 0, 0\n        for widget in widget_list:\n            if column != 0 and column % 3 == 0:\n                row += 1\n                column = 0\n\n            widget = widget()\n            widget.view_code_signal.connect(self.view_code)\n            widget.download_code_signal.connect(self.download_code)\n            self.grid_layout.addWidget(widget, row, column, 1, 1, Qt.AlignCenter)\n            self.grid_layout_children.append(widget)\n            column += 1\n\n    def view_code(self, code_file_path):\n        pyqt_code, pyside_code, qt_code = self.get_code_content(code_file_path)\n        self.code_viewer.assign_code(pyqt_code, pyside_code, qt_code)\n        self.code_viewer.set_code(pyqt_code)\n        self.code_viewer.show()\n        self.code_viewer.raise_()\n\n    def download_code(self, code_file_path):\n        path = QFileDialog.getExistingDirectory(self, \"Open Directory\", \"./\", QFileDialog.ShowDirsOnly | QFileDialog.DontResolveSymlinks)\n        if not path:\n            return\n\n        pyqt_code, pyside_code, qt_code = self.get_code_content(code_file_path)\n        with open(path+\"/pyqt_code.py\", \"w\", encoding=\"utf-8\") as f:\n            f.write(pyqt_code)\n        with open(path+\"/pyside_code.py\", \"w\", encoding=\"utf-8\") as f:\n            f.write(pyside_code)\n        with open(path + \"/qt_code.h\", \"w\", encoding=\"utf-8\") as f:\n            f.write(qt_code.split(\"\\n\\n\\n\")[0].strip())\n        with open(path+\"/qt_code.cpp\", \"w\", encoding=\"utf-8\") as f:\n            f.write(qt_code.split(\"\\n\\n\\n\")[1].strip())\n\n    @staticmethod\n    def get_code_content(code_file_path):\n        content = \"\"\n        with open(code_file_path, \"r\", encoding=\"utf-8\") as f:\n            for line in f.readlines():\n                if \"pathlib\" not in line and \"Base\" not in line and '\"res/images' not in line:\n                    content += line\n            content = content.replace(\"str(Path(__file__))\", \"\").replace(\"%s\", \"PATH_TO_IMG\")\n            content = re.sub(r\" % \\(.+\\)\", \")\", content)\n\n        try:\n            pyqt_code = re.search(r\"# PyQt.+# PyQt\", content, re.DOTALL).group().replace(\"# PyQt\\n\", \"\").replace(\"# PyQt\", \"\")\n        except AttributeError:\n            pyqt_code = \"\"\n\n        try:\n            pyside_code = re.search(r\"# PySide.+# PySide\", content, re.DOTALL).group().replace(\"# PySide\\n\", \"\").replace(\"# PySide\", \"\").replace(\"# \", \"\")\n        except AttributeError:\n            pyside_code = \"\"\n\n        try:\n            qt_code = re.search(r\"# C\\+\\+/Qt.+# C\\+\\+/Qt\", content, re.DOTALL).group().replace(\"# C++/Qt\\n\", \"\").replace(\"# C++/Qt\", \"\").replace(\"# \", \"\")\n        except AttributeError:\n            qt_code = \"\"\n\n        return pyqt_code, pyside_code, qt_code\n\n    def open_editor(self):\n        self.qss_editor.show()\n\n    def show_sponsor_message(self):\n        self.sponsor_message_box.show()\n        self.sponsor_message_box.raise_()\n\n    @staticmethod\n    def open_doc():\n        webbrowser.open(\"https://github.com/la-vie-est-belle/qtbox\")\n\n    def show_updates(self):\n        self.updates_message_box.show()\n        self.updates_message_box.raise_()\n\n    def switch_theme(self):\n        self.switch_theme_signal.emit()\n\n    def reload_style_sheet(self):\n        self.set_style_sheet()\n        self.qss_editor.reload_style_sheet()\n        self.code_viewer.reload_style_sheet()\n        self.updates_message_box.reload_style_sheet()\n        self.sponsor_message_box.reload_style_sheet()\n\n        for widget in self.grid_layout_children:\n            widget.context_menu.reload_style_sheet()\n\n\nclass Window(QWidget):\n    def __init__(self):\n        super(Window, self).__init__()\n        self.window_title = WindowTitle()\n        self.window_body = WindowBody()\n\n        self.start_x = None\n        self.start_y = None\n        self.stretch_area_offset = 10\n        self.is_stretching = False\n        self.stretch_type = None\n        self.can_stretch = False\n\n        self.bg_color = None\n\n        self.set_up()\n\n    def set_up(self):\n        self.set_window_attr()\n        self.set_object_name()\n        self.set_style_sheet()\n        self.set_signal()\n        self.set_layout()\n\n    def set_window_attr(self):\n        with open(RES_PATH/\"config.json\") as f:\n            config = json.loads(f.read())\n            self.resize(config[\"mainWindowWidth\"], config[\"mainWindowHeight\"])\n\n        self.setMouseTracking(True)\n        self.setWindowTitle(\"Qt Box\")\n        self.setWindowFlag(Qt.FramelessWindowHint)\n        self.setAttribute(Qt.WA_TranslucentBackground)\n        self.setWindowIcon(QIcon(str(RES_PATH / \"images/icon.png\")))\n\n    def set_object_name(self):\n        self.setObjectName(\"window\")\n\n    def set_style_sheet(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            theme = json.loads(f.read())[\"theme\"]\n\n        if theme == \"black\":\n            self.bg_color = \"#3b3f42\"\n        else:\n            self.bg_color = \"#f2f2f2\"\n\n    def set_signal(self):\n        self.window_title.close_signal.connect(self.close)\n        self.window_title.minimize_signal.connect(self.showMinimized)\n        self.window_title.maximize_signal.connect(self.showMaximized)\n        self.window_title.show_normal_signal.connect(self.showNormal)\n        self.window_body.switch_theme_signal.connect(self.reload_style_sheet)\n\n    def set_layout(self):\n        v_layout = QVBoxLayout(self)\n        v_layout.setSpacing(0)\n        v_layout.addWidget(self.window_title)\n        v_layout.addWidget(self.window_body)\n        v_layout.setContentsMargins(0, 0, 0, 0)\n\n    def mousePressEvent(self, event):\n        if event.button() == Qt.LeftButton:\n            if self.can_stretch:\n                self.is_stretching = True\n            else:\n                self.start_x = event.x()\n                self.start_y = event.y()\n\n    def mouseMoveEvent(self, event):\n        if not self.is_stretching:\n            self.check_if_can_stretch(event.x(), event.y())\n\n            if self.start_x is not None and self.start_y is not None:\n                dis_x = event.x() - self.start_x\n                dis_y = event.y() - self.start_y\n                self.move(self.x() + dis_x, self.y() + dis_y)\n        else:\n            if self.stretch_type == \"H\":\n                self.resize(event.x(), self.height())\n            elif self.stretch_type == \"V\":\n                self.resize(self.width(), event.y())\n            elif self.stretch_type == \"VH\":\n                self.resize(event.x(), event.y())\n\n    def mouseReleaseEvent(self, event):\n        self.start_x = None\n        self.start_y = None\n\n        if self.is_stretching:\n            self.is_stretching = False\n            self.stretch_type = None\n            self.can_stretch = False\n            self.setCursor(Qt.ArrowCursor)\n            self.record_size_after_stretch()\n\n    def paintEvent(self, event):\n        super(Window, self).paintEvent(event)\n        painter = QPainter(self)\n        painter.setPen(Qt.NoPen)\n        painter.setBrush(QColor(self.bg_color))\n        painter.setRenderHint(QPainter.Antialiasing)\n        painter.drawRoundedRect(self.rect(), 9, 9)\n\n    def check_if_can_stretch(self, x, y):\n        if x >= self.width() - self.stretch_area_offset and self.stretch_area_offset <= y <= self.height() - self.stretch_area_offset:\n            # right border\n            self.setCursor(Qt.SizeHorCursor)\n            self.stretch_type = \"H\"\n            self.can_stretch = True\n\n        elif self.stretch_area_offset <= x <= self.width() - self.stretch_area_offset and y >= self.height() - self.stretch_area_offset:\n            # bottom border\n            self.setCursor(Qt.SizeVerCursor)\n            self.stretch_type = \"V\"\n            self.can_stretch = True\n\n        elif x > self.width() - self.stretch_area_offset and y > self.height() - self.stretch_area_offset:\n            # bottom right corner\n            self.setCursor(Qt.SizeFDiagCursor)\n            self.stretch_type = \"VH\"\n            self.can_stretch = True\n\n        else:\n            self.setCursor(Qt.ArrowCursor)\n            self.is_stretching = False\n            self.stretch_type = None\n            self.can_stretch = False\n\n    def record_size_after_stretch(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            config = json.loads(f.read())\n            config[\"mainWindowWidth\"] = self.width()\n            config[\"mainWindowHeight\"] = self.height()\n\n        with open(RES_PATH / \"config.json\", \"w\", encoding=\"utf-8\") as f:\n            f.write(json.dumps(config, indent=4))\n\n    def showMaximized(self):\n        self.move(0, 0)\n        desktop = QApplication.desktop()\n        self.resize(desktop.width(), desktop.height())\n\n    def showNormal(self):\n        super(Window, self).showNormal()\n\n        with open(RES_PATH/\"config.json\") as f:\n            config = json.loads(f.read())\n            self.resize(config[\"mainWindowWidth\"], config[\"mainWindowHeight\"])\n\n        desktop = QApplication.desktop()\n        self.move(desktop.width() // 2 - self.width() // 2, desktop.height() // 2 - self.height() // 2)\n\n    def reload_style_sheet(self):\n        with open(RES_PATH / \"config.json\", \"r\", encoding=\"utf-8\") as f:\n            config = json.loads(f.read())\n\n        if config[\"theme\"] == \"black\":\n            config[\"theme\"] = \"white\"\n        else:\n            config[\"theme\"] = \"black\"\n\n        with open(RES_PATH / \"config.json\", \"w\", encoding=\"utf-8\") as f:\n            f.write(json.dumps(config, indent=4))\n\n        self.set_style_sheet()\n        self.window_title.reload_style_sheet()\n        self.window_body.reload_style_sheet()"
  },
  {
    "path": "src/qtbox/main.py",
    "content": "import sys\r\nfrom PyQt5.QtGui import *\r\nfrom PyQt5.QtCore import *\r\nfrom PyQt5.QtWidgets import *\r\nfrom qtbox.gui.window import Window\r\nfrom qtbox.utils.check import check_update\r\n\r\n\r\ndef main():\r\n    check_update()\r\n\r\n    QApplication.setHighDpiScaleFactorRoundingPolicy(Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)\r\n    QApplication.setAttribute(Qt.AA_EnableHighDpiScaling)\r\n    QApplication.setAttribute(Qt.AA_UseHighDpiPixmaps)\r\n\r\n    app = QApplication([])\r\n    window = Window()\r\n    window.show()\r\n    sys.exit(app.exec())\r\n\r\n\r\nif __name__ == \"__main__\":\r\n    main()\r\n"
  },
  {
    "path": "src/qtbox/res/completion.txt",
    "content": "-qt-background-role\n-qt-style-features\n::add-line\n::add-page\n::branch\n::chunk\n::close-button\n::corner\n::down-arrow\n::down-button\n::drop-down\n::float-button\n::groove\n::handle\n::icon\n::indicator\n::item\n::left-arrow\n::left-corner\n::menu-arrow\n::menu-button\n::menu-indicator\n::pane\n::right-arrow\n::right-corner\n::scroller\n::section\n::separator\n::sub-line\n::sub-page\n::tab\n::tab-bar\n::tear\n::tearoff\n::text\n::title\n::up-arrow\n::up-button\n:active\n:adjoins-item\n:alternate\n:bottom\n:checked\n:closable\n:closed\n:default\n:disabled\n:edit-focus\n:editable\n:enabled\n:exclusive\n:first\n:flat\n:floatable\n:focus\n:has-children\n:has-siblings\n:horizontal\n:hover\n:indeterminate\n:last\n:left\n:maximized\n:middle\n:minimized\n:movable\n:next-selected\n:no-frame\n:non-exclusive\n:off\n:on\n:only-one\n:open\n:pressed\n:previous-selected\n:read-only\n:right\n:selected\n:top\n:unchecked\n:vertical\n:window\nQAbstractScrollArea\nQCheckBox\nQColumnView\nQComboBox\nQDateEdit\nQDateTimeEdit\nQDial\nQDialog\nQDialogButtonBox\nQDockWidget\nQDoubleSpinBox\nQFrame\nQGroupBox\nQHeaderView\nQLabel\nQLineEdit\nQListView\nQListWidget\nQMainWindow\nQMenu\nQMenuBar\nQMessageBox\nQProgressBar\nQPushButton\nQRadioButton\nQScrollBar\nQSizeGrip\nQSlider\nQSpinBox\nQSplitter\nQStatusBar\nQTabBar\nQTabWidget\nQTableView\nQTableWidget\nQTextEdit\nQTimeEdit\nQToolBar\nQToolBox\nQToolButton\nQToolTip\nQTreeView\nQTreeWidget\nQWidget\nactive\naliceblue\nalternate-background-color\nalternate-base\nantiquewhite\naqua\naquamarine\nazure\nbackground\nbackground-attachment\nbackground-clip\nbackground-color\nbackground-image\nbackground-origin\nbackground-position\nbackground-repeat\nbackward-icon\nbase\nbeige\nbisque\nblack\nblanchedalmond\nblue\nblueviolet\nbold\nborder\nborder-bottom\nborder-bottom-color\nborder-bottom-left-radius\nborder-bottom-right-radius\nborder-bottom-style\nborder-bottom-width\nborder-color\nborder-image\nborder-left\nborder-left-color\nborder-left-style\nborder-left-width\nborder-radius\nborder-right\nborder-right-color\nborder-right-style\nborder-right-width\nborder-style\nborder-top\nborder-top-color\nborder-top-left-radius\nborder-top-right-radius\nborder-top-style\nborder-top-width\nborder-width\nbottom\nbright-text\nbrown\nburlywood\nbutton\nbutton-layout\nbutton-text\ncadetblue\ncd-icon\ncenter\nchartreuse\nchocolate\ncolor\ncomputer-icon\ncontent\ncoral\ncornflowerblue\ncornsilk\ncrimson\ncyan\ndark\ndarkblue\ndarkcyan\ndarkgoldenrod\ndarkgray\ndarkgreen\ndarkgrey\ndarkkhaki\ndarkmagenta\ndarkolivegreen\ndarkorange\ndarkorchid\ndarkred\ndarksalmon\ndarkseagreen\ndarkslateblue\ndarkslategray\ndarkslategrey\ndarkturquoise\ndarkviolet\ndashed\ndeeppink\ndeepskyblue\ndesktop-icon\ndialog-apply-icon\ndialog-cancel-icon\ndialog-close-icon\ndialog-discard-icon\ndialog-help-icon\ndialog-no-icon\ndialog-ok-icon\ndialog-open-icon\ndialog-reset-icon\ndialog-save-icon\ndialog-yes-icon\ndialogbuttonbox-buttons-have-icons\ndimgray\ndimgrey\ndirectory-closed-icon\ndirectory-icon\ndirectory-link-icon\ndirectory-open-icon\ndisabled\ndockwidget-close-icon\ndodgerblue\ndot-dash\ndot-dot-dash\ndotted\ndouble\ndownarrow-icon\ndvd-icon\nem\nex\nfile-icon\nfile-link-icon\nfiledialog-contentsview-icon\nfiledialog-detailedview-icon\nfiledialog-end-icon\nfiledialog-infoview-icon\nfiledialog-listview-icon\nfiledialog-new-directory-icon\nfiledialog-parent-directory-icon\nfiledialog-start-icon\nfirebrick\nfixed\nfloppy-icon\nfloralwhite\nfont\nfont-family\nfont-size\nfont-style\nfont-weight\nforestgreen\nforward-icon\nfuchsia\ngainsboro\nghostwhite\ngold\ngoldenrod\ngray\ngreen\ngreenyellow\ngrey\ngridline-color\ngroove\nharddisk-icon\nheight\nhighlight\nhighlighted-text\nhome-icon\nhoneydew\nhotpink\nhsl\nhsla\nhsv\nhsva\nicon\nicon-size\nimage\nimage-position\nindianred\nindigo\ninset\nitalic\nivory\nkhaki\nlavender\nlavenderblush\nlawngreen\nleft\nleftarrow-icon\nlemonchiffon\nlight\nlightblue\nlightcoral\nlightcyan\nlightgoldenrodyellow\nlightgray\nlightgreen\nlightgrey\nlightpink\nlightsalmon\nlightseagreen\nlightskyblue\nlightslategray\nlightslategrey\nlightsteelblue\nlightyellow\nlime\nlimegreen\nlineedit-password-character\nlineedit-password-mask-delay\nlinen\nlink\nlink-visited\nmagenta\nmargin\nmargin-bottom\nmargin-left\nmargin-right\nmargin-top\nmaroon\nmax-height\nmax-width\nmediumaquamarine\nmediumblue\nmediumorchid\nmediumpurple\nmediumseagreen\nmediumslateblue\nmediumspringgreen\nmediumturquoise\nmediumvioletred\nmessagebox-critical-icon\nmessagebox-information-icon\nmessagebox-question-icon\nmessagebox-text-interaction-flags\nmessagebox-warning-icon\nmid\nmidlight\nmidnightblue\nmin-height\nmin-width\nmintcream\nmistyrose\nmoccasin\nnavajowhite\nnavy\nnetwork-icon\nno-repeat\nnone\nnormal\noblique\noff\noldlace\nolive\nolivedrab\non\nopacity\norange\norangered\norchid\noutline\noutline-bottom-left-radius\noutline-bottom-right-radius\noutline-color\noutline-offset\noutline-radius\noutline-style\noutline-top-left-radius\noutline-top-right-radius\noutset\npadding\npadding-bottom\npadding-left\npadding-right\npadding-top\npaint-alternating-row-colors-for-empty-area\npalegoldenrod\npalegreen\npaleturquoise\npalevioletred\npapayawhip\npeachpuff\nperu\npink\nplum\nposition\npowderblue\npt\npurple\npx\nqconicalgradient\nqlineargradient\nqradialgradient\nred\nrepeat\nrepeat-x\nrepeat-y\nrgb\nrgba\nridge\nright\nrightarrow-icon\nrosybrown\nroyalblue\nsaddlebrown\nsalmon\nsandybrown\nscroll\nseagreen\nseashell\nselected\nselection-background-color\nselection-color\nshadow\nshow-decoration-selected\nsienna\nsilver\nskyblue\nslateblue\nslategray\nslategrey\nsnow\nsolid\nspacing\nspringgreen\nsteelblue\nstretch\nsubcontrol-origin\nsubcontrol-position\ntan\nteal\ntext\ntext-align\ntext-decoration\nthistle\ntitlebar-contexthelp-icon\ntitlebar-maximize-icon\ntitlebar-menu-icon\ntitlebar-minimize-icon\ntitlebar-normal-icon\ntitlebar-shade-icon\ntitlebar-show-tooltips-on-buttons\ntitlebar-unshade-icon\ntomato\ntop\ntrash-icon\nturquoise\nuparrow-icon\nurl\nviolet\nwheat\nwhite\nwhitesmoke\nwidget-animation-duration\nwidth\nwindow\nwindow-text\nyellow\nyellowgreen"
  },
  {
    "path": "src/qtbox/res/config.json",
    "content": "{\n    \"theme\": \"white\",\n    \"mainWindowWidth\": 1000,\n    \"mainWindowHeight\": 600,\n    \"codeViewerWidth\": 700,\n    \"codeViewerHeight\": 500,\n    \"qssEditorWidth\": 850,\n    \"qssEditorHeight\": 650\n}"
  },
  {
    "path": "src/qtbox/res/qss/black/editor.qss",
    "content": "QPlainTextEdit#customEdit {\n    background-color: #2b2b2b;\n    border-top: none;\n    color: white;\n    font-family: \"Arial\";\n}\n\nQPushButton#copyBtn {\n    border: none;\n}\n\nQAbstractItemView#completer {\n    background-color: #3b3f42;\n    color: #b2bdaf;\n    font-weight: bold;\n    padding-top: 2px;\n}\n\nQScrollBar#customEditVScrollBar:vertical {\n    width: 2px;\n    background-color: #2b2b2b;\n}\n\nQScrollBar#customEditVScrollBar::handle:vertical {\n    background-color: #b2bdaf;\n}\n\nQScrollBar#customEditHScrollBar:horizontal {\n    height: 2px;\n    background-color: #2b2b2b;\n}\n\nQScrollBar#customEditHScrollBar::handle:horizontal {\n    background-color: #b2bdaf;\n}\n\nQWidget#displayWidget {\n    background-color: #2b2b2b;\n}\n\nQComboBox#widgetComboBox {\n    background-color: #3b3f42;\n    border: 1px solid darkgray;\n    border-radius: 5px;\n    font-weight: bold;\n    color: white;\n    padding-left: 15px;\n    padding-right: 12px;\n    height: 20px;\n    font-family: \"Arial\";\n}\n\nQComboBox#widgetComboBox::drop-down {\n    width: 13px;\n    border: none;\n}\n\nQComboBox#widgetComboBox QAbstractItemView {\n    color: white;\n    border: none;\n    outline: none;\n    font-size: 12px;\n    background-color: #2b2b2b;\n}\n\nQComboBox#widgetComboBox QScrollBar:vertical {\n    width: 2px;\n    background-color: white;\n}\n\nQComboBox#widgetComboBox QScrollBar::handle:vertical {\n    background-color: #b2bdaf;\n}\n\nQSplitter#qssEditorBody {\n    border-top: 1px solid #2b2b2b;\n    background-color: #3b3f42;\n    border-right-width: 2px;\n    border-bottom-width: 2px;\n}\n\nQSplitter#qssEditorBody::handle {\n    background-color: #2b2b2b;\n    width: 1px;\n}"
  },
  {
    "path": "src/qtbox/res/qss/black/menu.qss",
    "content": "QMenu {\n    background-color: #3b3f42;\n    border: 1px solid gray;\n    color: #b2bdaf;\n    border-radius: 3px;\n}\n\nQMenu::icon {\n    padding: 5px 5px 5px 5px;\n}\n\nQMenu::item {\n    padding: 3px 5px 3px 5px;\n}\n\nQMenu::item:selected {\n    background-color: #f1964c;\n    color: black;\n}"
  },
  {
    "path": "src/qtbox/res/qss/black/message_box.qss",
    "content": "QLabel#titleLabel {\n    color: #d99d3a;\n    font-size: 15px;\n    font-weight: bold;\n    font-family: \"Arial\";\n}\n\nQTextBrowser#contentBrowser {\n    background-color: #2b2b2b;\n    color: #b2bdaf;\n    border: none;\n    font-family: \"Arial\";\n}\n\nQPushButton#confirmBtn {\n    border: none;\n    background-color: #f1964c;\n    font-size: 13px;\n    color: #f0f0f0;\n    border-radius: 2px;\n}\n\nQPushButton#confirmBtn:hover {\n    background-color: #f0bc5c;\n}\n\nQPushButton#confirmBtn:pressed {\n    background-color: #f1964c;\n}\n\nQPushButton#closeBtn {\n    background-color: #3b3f42;\n    border: none;\n    border-radius: 2px;\n}\n\nQPushButton#closeBtn:hover {\n    background-color: rgba(255, 255, 255, 80);\n}\n\nQPushButton#closeBtn:pressed {\n    background-color: rgba(255, 255, 255, 50);\n}\n\nQScrollBar:vertical {\n    width: 2px;\n    background-color: #2b2b2b;\n}\n\nQScrollBar::handle:vertical {\n    background-color: #b2bdaf;\n}\n\nQScrollBar:horizontal {\n    height: 2px;\n    background-color: #2b2b2b;\n}\n\nQScrollBar::handle:horizontal {\n    background-color: #b2bdaf;\n}"
  },
  {
    "path": "src/qtbox/res/qss/black/title.qss",
    "content": "QWidget#windowTitle {\n    background-color: #3b3f42;\n}\n\n\nQPushButton#minimizeBtn, QPushButton#maximizeNormalBtn, QPushButton#closeBtn {\n    background-color: #3b3f42;\n    border-radius: 3px;\n    border: none;\n}\n\nQPushButton#minimizeBtn:hover, QPushButton#maximizeNormalBtn:hover, QPushButton#closeBtn:hover {\n    background-color: rgba(255, 255, 255, 80);\n}\n\nQPushButton#minimizeBtn:pressed, QPushButton#maximizeNormalBtn:pressed, QPushButton#closeBtn:pressed {\n    background-color: rgba(255, 255, 255, 50);\n}\n"
  },
  {
    "path": "src/qtbox/res/qss/black/viewer.qss",
    "content": "QTextBrowser#codeViewerBody {\n    background-color: #2b2b2b;\n    border-top: none;\n    border-left: none;\n    border-right-width: 2px;\n    border-bottom-width: 2px;\n}\n\nQPushButton#copyBtn, QPushButton#switchBtn {\n    border: none;\n}\n\nQScrollBar:vertical {\n    width: 2px;\n    background-color: #2b2b2b;\n}\n\nQScrollBar::handle:vertical {\n    background-color: #b2bdaf;\n}\n\nQScrollBar:horizontal {\n    height: 2px;\n    background-color: #2b2b2b;\n}\n\nQScrollBar::handle:horizontal {\n    background-color: #b2bdaf;\n}"
  },
  {
    "path": "src/qtbox/res/qss/black/window_body.qss",
    "content": "QWidget#windowBody {\n    background-color: #3b3f42;\n    border: none;\n}\n\nQPushButton#listBtn {\n    background-color: #2b2b2b;\n    border: 1px solid gray;\n    font-weight: bold;\n    font-family: \"Arial\";\n    font-size: 14px;\n    color: #b2bdaf;\n}\n\nQPushButton#listBtn:hover {\n    background-color: #f1964c;\n    color: black;\n}\n\nQPushButton#listBtn:checked {\n    background-color: #f1964c;\n    color: black;\n}\n\nQPushButton#editorBtn, QPushButton#sponsorBtn, QPushButton#docBtn, QPushButton#aboutBtn, QPushButton#switchBtn {\n    border: none;\n}\n\nQListView#btnList {\n    border: none;\n    background-color: #2b2b2b;\n}\n\nQListView#btnList::item:selected {\n    border: none;\n}\n\nQScrollArea#funcScrollArea, QScrollArea#styleScrollArea {\n    background-color: #2b2b2b;\n    border: 1px solid gray;\n}\n\nQWidget#funcWidget, QWidget#styleWidget {\n    background-color: #2b2b2b;\n}\n\nQTabWidget#tabWidget::tab-bar{\n    alignment: left;\n}\n\nQTabWidget#tabWidget::pane {\n    border: none;\n}\n\nQTabBar::tab {\n    background-color: #2b2b2b;\n    border: 1px solid gray;\n    border-bottom: none;\n    border-top-left-radius: 4px;\n    border-top-right-radius: 4px;\n    color: #b2bdaf;\n    font-size: 13px;\n    font-weight: bold;\n    font-family: \"Arial\";\n    width: 80px;\n    height: 25px;\n    margin-right: 2px;\n}\n\nQTabBar::tab:hover {\n    background-color: #f1964c;\n    color: black;\n}\n\nQTabBar::tab:selected {\n    background-color: #f1964c;\n    color: black;\n}\n\nQScrollBar#btnList:vertical, QScrollBar#funcScrollVBar:vertical, QScrollBar#styleScrollVBar:vertical {\n    width: 2px;\n    background-color: #2b2b2b;\n}\n\nQScrollBar#btnList::handle:vertical, QScrollBar#funcScrollVBar::handle:vertical, QScrollBar#styleScrollVBar::handle:vertical {\n    background-color: #b2bdaf;\n}\n\nQScrollBar#btnList:horizontal, QScrollBar#funcScrollHBar:horizontal, QScrollBar#styleScrollHBar:horizontal {\n    height: 2px;\n    background-color: #2b2b2b;\n}\n\nQScrollBar#btnList::handle:horizontal, QScrollBar#funcScrollHBar::handle:horizontal, QScrollBar#styleScrollHBar::handle:horizontal {\n    background-color: #b2bdaf;\n}\n"
  },
  {
    "path": "src/qtbox/res/qss/white/editor.qss",
    "content": "QPlainTextEdit#customEdit {\n    background-color: white;\n    border-top: none;\n    color: black;\n    font-family: \"Arial\";\n}\n\nQPushButton#copyBtn {\n    border: none;\n}\n\nQAbstractItemView#completer {\n    background-color: #f2f2f2;\n    color: black;\n    font-weight: bold;\n    padding-top: 2px;\n}\n\nQScrollBar#customEditVScrollBar:vertical {\n    width: 2px;\n    background-color: white;\n}\n\nQScrollBar#customEditVScrollBar::handle:vertical {\n    background-color: #b2bdaf;\n}\n\nQScrollBar#customEditHScrollBar:horizontal {\n    height: 2px;\n    background-color: white;\n}\n\nQScrollBar#customEditHScrollBar::handle:horizontal {\n    background-color: #b2bdaf;\n}\n\nQWidget#displayWidget {\n    background-color: white;\n}\n\nQComboBox#widgetComboBox {\n    background-color: white;\n    border: 1px solid lightgray;\n    border-radius: 5px;\n    font-weight: bold;\n    color: black;\n    height: 20px;\n    padding-left: 15px;\n    padding-right: 12px;\n    font-family: \"Arial\";\n}\n\nQComboBox#widgetComboBox::drop-down {\n    width: 13px;\n    border: none;\n}\n\nQComboBox#widgetComboBox QAbstractItemView {\n    color: black;\n    border: none;\n    outline: none;\n    font-size: 12px;\n    background-color: #f2f2f2;\n}\n\nQComboBox#widgetComboBox QScrollBar:vertical {\n    width: 2px;\n    background-color: white;\n}\n\nQComboBox#widgetComboBox QScrollBar::handle:vertical {\n    background-color: #b2bdaf;\n}\n\nQSplitter#qssEditorBody {\n    border-top: 1px solid lightgray;\n    background-color: #f2f2f2;\n    border-right-width: 2px;\n    border-bottom-width: 2px;\n}\n\nQSplitter#qssEditorBody::handle {\n    background-color: #f2f2f2;\n    width: 1px;\n}"
  },
  {
    "path": "src/qtbox/res/qss/white/menu.qss",
    "content": "QMenu {\n    background-color: #f2f2f2;\n    border: 1px solid whitesmoke;\n    color: black;\n    border-radius: 3px;\n}\n\nQMenu::icon {\n    padding: 5px 5px 5px 5px;\n}\n\nQMenu::item {\n    padding: 3px 5px 3px 5px;\n}\n\nQMenu::item:selected {\n    background-color: #2676bf;\n    color: white;\n}"
  },
  {
    "path": "src/qtbox/res/qss/white/message_box.qss",
    "content": "QLabel#titleLabel {\n    color: #2676bf;\n    font-size: 15px;\n    font-weight: bold;\n    font-family: \"Arial\";\n}\n\nQTextBrowser#contentBrowser {\n    background-color: white;\n    color: black;\n    border: none;\n    font-family: \"Arial\";\n}\n\nQPushButton#confirmBtn {\n    border: none;\n    background-color: #2676bf;\n    font-size: 13px;\n    color: #f0f0f0;\n    border-radius: 2px;\n}\n\nQPushButton#confirmBtn:hover {\n    background-color: #3d88cd;\n}\n\nQPushButton#confirmBtn:pressed {\n    background-color: #2676bf;\n}\n\nQPushButton#closeBtn {\n    background-color: #f2f2f2;\n    border: none;\n    border-radius: 2px;\n}\n\nQPushButton#closeBtn:hover {\n    background-color: rgba(255, 255, 255, 150);\n}\n\nQPushButton#closeBtn:pressed {\n    background-color: rgba(255, 255, 255, 120);\n}\n\nQScrollBar:vertical {\n    width: 2px;\n    background-color: white;\n}\n\nQScrollBar::handle:vertical {\n    background-color: #b2bdaf;\n}\n\nQScrollBar:horizontal {\n    height: 2px;\n    background-color: white;\n}\n\nQScrollBar::handle:horizontal {\n    background-color: #b2bdaf;\n}"
  },
  {
    "path": "src/qtbox/res/qss/white/title.qss",
    "content": "QWidget#windowTitle {\n    background-color: #f2f2f2;\n}\n\nQPushButton#minimizeBtn, QPushButton#maximizeNormalBtn, QPushButton#closeBtn {\n    background-color: #f2f2f2;\n    border-radius: 3px;\n    border: none;\n}\n\nQPushButton#minimizeBtn:hover, QPushButton#maximizeNormalBtn:hover, QPushButton#closeBtn:hover {\n    background-color: rgba(255, 255, 255, 150);\n}\n\nQPushButton#minimizeBtn:pressed, QPushButton#maximizeNormalBtn:pressed, QPushButton#closeBtn:pressed {\n    background-color: rgba(255, 255, 255, 120);\n}\n"
  },
  {
    "path": "src/qtbox/res/qss/white/viewer.qss",
    "content": "QTextBrowser#codeViewerBody {\n    background-color: white;\n    border-top: none;\n    border-left: none;\n    border-right-width: 2px;\n    border-bottom-width: 2px;\n}\n\nQPushButton#copyBtn, QPushButton#switchBtn {\n    border: none;\n}\n\nQScrollBar:vertical {\n    width: 2px;\n    background-color: white;\n}\n\nQScrollBar::handle:vertical {\n    background-color: #b2bdaf;\n}\n\nQScrollBar:horizontal {\n    height: 2px;\n    background-color: white;\n}\n\nQScrollBar::handle:horizontal {\n    background-color: #b2bdaf;\n}"
  },
  {
    "path": "src/qtbox/res/qss/white/window_body.qss",
    "content": "QWidget#windowBody {\n    background-color: #f2f2f2;\n    border: none;\n}\n\nQPushButton#listBtn {\n    background-color: white;\n    border: 1px solid whitesmoke;\n    font-weight: bold;\n    font-family: \"Arial\";\n    font-size: 14px;\n    color: black;\n}\n\nQPushButton#listBtn:hover {\n    background-color: #2676bf;\n    color: white;\n}\n\nQPushButton#listBtn:checked {\n    background-color: #2676bf;\n    color: white;\n}\n\nQPushButton#editorBtn, QPushButton#sponsorBtn, QPushButton#docBtn, QPushButton#aboutBtn, QPushButton#switchBtn {\n    border: none;\n}\n\nQListView#btnList {\n    border: none;\n    background-color: white;\n}\n\nQListView#btnList::item:selected {\n    border: none;\n}\n\nQScrollArea#funcScrollArea, QScrollArea#styleScrollArea {\n    background-color: white;\n    border: 1px solid whitesmoke;\n}\n\nQWidget#funcWidget, QWidget#styleWidget {\n    background-color: white;\n}\n\nQTabWidget#tabWidget::tab-bar {\n    alignment: left;\n}\n\nQTabWidget#tabWidget::pane {\n    border: none;\n}\n\nQTabBar::tab {\n    background-color: white;\n    border: 1px solid whitesmoke;\n    border-bottom: none;\n    border-top-left-radius: 4px;\n    border-top-right-radius: 4px;\n    color: black;\n    font-size: 13px;\n    font-weight: bold;\n    font-family: \"Arial\";\n    width: 80px;\n    height: 25px;\n    margin-right: 2px;\n}\n\nQTabBar::tab:hover {\n    background-color: #2676bf;\n    color: white;\n}\n\nQTabBar::tab:selected {\n    background-color: #2676bf;\n    color: white;\n}\n\nQScrollBar#btnList:vertical, QScrollBar#funcScrollVBar:vertical, QScrollBar#styleScrollVBar:vertical {\n    width: 2px;\n    background-color: white;\n}\n\nQScrollBar#btnList::handle:vertical, QScrollBar#funcScrollVBar::handle:vertical, QScrollBar#styleScrollVBar::handle:vertical {\n    background-color: #b2bdaf;\n}\n\nQScrollBar#btnList:horizontal, QScrollBar#funcScrollHBar:horizontal, QScrollBar#styleScrollHBar:horizontal {\n    height: 2px;\n    background-color: white;\n}\n\nQScrollBar#btnList::handle:horizontal, QScrollBar#funcScrollHBar::handle:horizontal, QScrollBar#styleScrollHBar::handle:horizontal {\n    background-color: #b2bdaf;\n}\n"
  },
  {
    "path": "src/qtbox/utils/__init__.py",
    "content": ""
  },
  {
    "path": "src/qtbox/utils/check.py",
    "content": "from urllib.request import urlopen\nfrom threading import Thread\nimport ssl\n\n\ndef compare_version():\n    try:\n        context = ssl._create_unverified_context()\n        r = urlopen(\"https://la-vie-est-belle.github.io/qtbox/CHANGELOG\", context=context, timeout=1)\n        remote_version = r.readline().decode().strip()\n    except Exception as e:\n        return\n\n    current_version = \"v1.2.0\"\n    if remote_version != current_version:\n        print(f\"Qt Box {remote_version} is available. Upgrade it with command `pip install --upgrade qtbox`\")\n\n\ndef check_update():\n    Thread(target=compare_version).start()"
  },
  {
    "path": "src/qtbox/utils/output.py",
    "content": "import os\nimport sys\n\n\nclass suppress_stdout_stderr(object):\n    def __enter__(self):\n        self.outnull_file = open(os.devnull, 'w')\n        self.errnull_file = open(os.devnull, 'w')\n\n        self.old_stdout_fileno_undup = sys.stdout.fileno()\n        self.old_stderr_fileno_undup = sys.stderr.fileno()\n\n        self.old_stdout_fileno = os.dup(sys.stdout.fileno())\n        self.old_stderr_fileno = os.dup(sys.stderr.fileno())\n\n        self.old_stdout = sys.stdout\n        self.old_stderr = sys.stderr\n\n        os.dup2(self.outnull_file.fileno(), self.old_stdout_fileno_undup)\n        os.dup2(self.errnull_file.fileno(), self.old_stderr_fileno_undup)\n\n        sys.stdout = self.outnull_file\n        sys.stderr = self.errnull_file\n        return self\n\n    def __exit__(self, *_):\n        sys.stdout = self.old_stdout\n        sys.stderr = self.old_stderr\n\n        os.dup2(self.old_stdout_fileno, self.old_stdout_fileno_undup)\n        os.dup2(self.old_stderr_fileno, self.old_stderr_fileno_undup)\n\n        os.close(self.old_stdout_fileno)\n        os.close(self.old_stderr_fileno)\n\n        self.outnull_file.close()\n        self.errnull_file.close()"
  }
]