aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Include Qt Creator typesystem instead of duplicating API4.8Eike Ziller2018-10-046-36/+6
| | | | | | | This seems to work now after beautifying the import hierarchy. Change-Id: I24daf09ff63ef91023366c12308d2f9fcd2676aa Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Clean up import hierarchyEike Ziller2018-09-2820-69/+72
| | | | | | | | | | | | | PythonExtension.QtCreator.* -> QtCreator.* PythonExtension.PluginInstance -> QtCreator.PythonExtensions Also enables imports of the form "from QtCreator import Core" it is no longer necessary to write QtCreator.Core.... Change-Id: Ib9b433868dcc3fc7d1d534c6023bae7bf6d05fec Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Allow single file extensionsEike Ziller2018-09-254-11/+20
| | | | | Change-Id: I0b9e04e9ba2d73f43fbf08515366bfa303f2557b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix compilation of ProjectExplorer bindings on WindowsEike Ziller2018-09-241-1/+3
| | | | | | | | Enum classes that are returned from protected functions seem to create issues, so remove that for now. Change-Id: If7d62c0349ba24d93de8f82bf66d5f0c0681e021 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Avoid scanning extension directory over and over againEike Ziller2018-09-219-39/+69
| | | | | | | | | | | And get rid of separate management of a list of loaded extensions. Instead save the name and state of an extension in a separate class. It will probably get more information about the extension, like its location. The extension manager UI now can also iterate over that list once. Change-Id: I4872e55d621837a7d476e69b919f06aeb491ff03 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Remove unused functionEike Ziller2018-09-213-11/+0
| | | | | Change-Id: Iac2afb005a8c76080862da4c5d75778b48511e60 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Ignore __pycache__ when looking for extensionsEike Ziller2018-09-211-1/+2
| | | | | Change-Id: I8cc0289e047ced546491639ea5a7b37b5cce0ac1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix example extensions for Python 3Eike Ziller2018-09-206-7/+10
| | | | | | | | Implicit relative imports are no longer allowed and need to be made explicit. Change-Id: Ic4de2d98229149b4d2920057974f895d9600368b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix compile issue with min/max macros on WindowsEike Ziller2018-09-201-0/+1
| | | | | | | | | When compiling the ProjectExplorer bindings. port.h(44): warning C4003: not enough arguments for function-like macro invocation 'max' Change-Id: If0850b928dbf72676e4ceb1bf5c189bbc5e3feef Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix installation of requirements at first runEike Ziller2018-09-191-3/+6
| | | | | | | | | | | If our custom site-packages path does not exist, the Python interpreter drops it from its list of directories to look for imports at some point. This results in packages not being found in the custom site-packages directory on the first run. Create the directory explicitly at first startup. Change-Id: Iaff4376890fb68828bbef4c1b05e2d4e7911406a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Remove obfuscation of variables and modules in the initialization codeEike Ziller2018-09-173-43/+5
| | | | | | | | | | Since the extensions are now loaded as modules/packages, separation of initialization code in Qt Creator and the code in the extensions is automatically handled. (Python modules/packages cannot access variables/modules/functions from code that imports them.) Change-Id: I7c1db034d76993d42c5d594fa5872aa1001d884e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* The product name is "Qt Creator" with a spaceEike Ziller2018-09-1737-64/+64
| | | | | Change-Id: I6716ab0b26f8881e07580df19bc29dd3c3146ae7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Clean up python extension examplesEike Ziller2018-09-177-25/+123
| | | | | | | | | - create a single Tools submenu for the examples - share the code that creates the menu if necessary between all examples - make all the actions nice Qt Creator commands Change-Id: Ia5ed41a1bb440a1a8087821cc9d9daaa4c8f585a Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Fix 'projects' exampleEike Ziller2018-09-171-1/+3
| | | | | | | Missed the QtCreator import Change-Id: I6e8a9180e7f2f018a018f9ebc587bf6ca015b247 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Remove unnecessary "setup.py" mechanism for initializing extensionsEike Ziller2018-09-177-164/+7
| | | | | | | | | | | | | | There already is the requirements.txt mechanism that takes care of pip installing in the right way. Setup for which this is not sufficient should be possible to do in the initialization code of the extension directly. Additionally the provided example was broken (e.g. didn't work with spaces in paths), and the whole mechanism had the encapsulation problem that the extensions themselves had before they were made modules/packages. Change-Id: I8692e26e65ec667267c7918e6edbd32f55534bc8 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Add "copyexamples" make target for copying all the examples to the buildEike Ziller2018-09-175-75/+34
| | | | | | | | And remove examples/package.py, which is basically just a zip call anyhow. Change-Id: I70ae585f9919dc3e9a6fb8bfe8feee26c4b72ab1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add optional bindings to regular buildEike Ziller2018-09-1413-412/+43
| | | | | Change-Id: I47e02299707e59dc5417e965a2bbcf2a6b5d0428 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Move shiboken setup to reusable fileEike Ziller2018-09-142-59/+68
| | | | | Change-Id: I4f832fdeedb07105806dce4f673afb5cf679ed9f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix encapsulation of pluginsEike Ziller2018-09-1411-37/+23
| | | | | | | | | | | | | | | | | | | | | | | Fixes that triggering "About Python Extensions" action resulted in python runtime error "TypeError: must be type, not None" when referencing PySide2.QtWidgets. To improve encapsulation of plugins, all modules that they loaded were deleted after their main.py finished running. This breaks if these modules were accessed later e.g. triggered by actions. Instead of this hack, ensure encapsulation of plugins by making them actual Python packages. Qt Creator's python extension path is added to python's module search path, and extensions are simply imported as packages. The python extension's main.py simply becomes a standard python module __init__.py. This also means that python extensions can depend on, and use other python extensions' functionality by importing them with "import". Change-Id: Ibe74c24e337b321007f5fa19c97bd35a5c1f0375 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Make About Python Extensions a nice Qt Creator actionEike Ziller2018-09-131-1/+9
| | | | | | | | And fix its position on macOS where it should be in the application menu. Change-Id: I7d9bcfc8f5a7faa5cd9f5aa0927f43769be5ce51 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix installation of requirementsEike Ziller2018-09-121-3/+3
| | | | | | | | | | | Do not split command lines on whitespace, which destroys arguments with spaces (e.g. the package path inside the Qt Creator app bundle on macOS). Also directly run pip through the module without going through an external python command. Change-Id: I85c8c5d64d21ee0178c43053cb5913f6f3c3b882 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Pull out running string as script as local functionEike Ziller2018-09-121-16/+14
| | | | | Change-Id: Iae9e5723cb95ad96e03bdfdbb1b9c1367050c203 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove unused functionEike Ziller2018-09-102-16/+0
| | | | | Change-Id: I22b4273a4f6e085a49b8e0a06c4cc8250c160e18 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Get Qt compile flags for shiboken more genericallyEike Ziller2018-09-101-7/+12
| | | | | | | | | Get the include and framework paths from the Qt modules directly. This automatically takes care of differences between macOS and Win/Lin then. Change-Id: I5e43641e01c43485828939547ac33b9acadbbae9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Further Windows fixesFriedemann Kleint2018-08-232-5/+7
| | | | | | | | - Disambiguate coreplugin, utils/fileutils.h - Link dl only on Unix Change-Id: Iace80e49a9ee878dab762f167d016e78ba0c76f1 Reviewed-by: hjk <hjk@qt.io>
* First fixes for WindowsFriedemann Kleint2018-08-214-6/+15
| | | | | | | | | | - Clean the paths - Make g++ specific options depending on compiler - ifdef out dlopen of the Python libraries - Do not use protected hack Change-Id: I979ed9362e55481a1452c0d7a6e8eba2355c6df4 Reviewed-by: hjk <hjk@qt.io>
* Wrap README.md and remove reference to merged patchFriedemann Kleint2018-08-211-70/+90
| | | | | Change-Id: Ieffafe9efd9a9ad4d09a97ed1a8fc37d0db5a3e9 Reviewed-by: hjk <hjk@qt.io>
* Remove unneeded include of _dependencies.priEike Ziller2018-08-201-3/+0
| | | | | | | That is done automatically by qtcreatorplugin.pri Change-Id: Id8ffff5733b2bb821ba6e8596721a5174bd1bfa4 Reviewed-by: hjk <hjk@qt.io>
* Use qtcreatordata.pri for static extensionmanager dataEike Ziller2018-08-203-8/+18
| | | | | | | That updates them on modification etc Change-Id: I2ad1c1d80df64e9e83980a31ad29e1fb3a655596 Reviewed-by: hjk <hjk@qt.io>
* Fix include pathEike Ziller2018-08-201-1/+2
| | | | | | | | PythonExtension/QtCreator/pythonextension_qtcreator_python.h tries to include pythonextensionsplugin.h which is in the .pro file PWD Change-Id: Iaf45ff76618ca06268c3c1063adfbc7e91daae2a Reviewed-by: hjk <hjk@qt.io>
* Fix typo in test case nameTilman Roeder2018-08-161-2/+2
| | | | | | | | | This corrects a test case name, which was previously not run due to a typo in the test cases function name. Change-Id: I154ea51bda9c274413822dd516a412656ac31b2f Reviewed-by: Tilman Roeder <tilman.roder@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Initial commitTilman Roeder2018-08-1594-0/+4472
| | | | | | | | | | | | | | | | | | | | | This is a quite large commit containing: * The main extension that runs and initializes Python * Some (example) bindings * An initial build script for the main extension * Optional binding and examples of how to create them * An initial build script for the optional bindings * A simple extension manager written in Python * A few example Python extensions * Some documentation (both in the code and as markdown files) * A collection of helpful python scripts * A small collection of unit tests * A TODO list For any additional details the code / docs should be consulted. Change-Id: I3937886cfefa2f64d5a78013889a8e097eec8261 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* Initial empty repositoryOswald Buddenhagen2018-08-020-0/+0