Skip to content

Instantly share code, notes, and snippets.

@nick4rivers
Last active April 20, 2022 20:58
Show Gist options
  • Save nick4rivers/f08bc7c8049061841e7fc164a49a6c9f to your computer and use it in GitHub Desktop.
Save nick4rivers/f08bc7c8049061841e7fc164a49a6c9f to your computer and use it in GitHub Desktop.

Revisions

  1. nick4rivers revised this gist Apr 20, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -70,7 +70,8 @@ Can be entered in the interpreter if it is being fickle. Note, that new version

    ## Compiling images
    Use pyrcc to compile resources like images. This should be installed with Qt5.
    pyrcc5 -o resources.py resources.qrc

    `pyrcc5 -o resources.py resources.qrc`

    ---

  2. nick4rivers revised this gist Apr 20, 2022. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -63,10 +63,16 @@ My notes for Mac OS Qt and QGIS python plugin development tools on VSCode
    ---

    ## Manual path to the QGIS python install
    Can be entered in the interpreter if it is being fickle
    Can be entered in the interpreter if it is being fickle. Note, that new version of QGIS use python 3.9

    /Applications/QGIS.app/Contents/MacOS/bin/python3.8
    ---

    ## Compiling images
    Use pyrcc to compile resources like images. This should be installed with Qt5.
    pyrcc5 -o resources.py resources.qrc

    ---



  3. nick4rivers revised this gist Jul 16, 2021. 1 changed file with 5 additions and 7 deletions.
    12 changes: 5 additions & 7 deletions Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -60,15 +60,13 @@ My notes for Mac OS Qt and QGIS python plugin development tools on VSCode
    "python.pythonPath": "${env:QGIS_PATH}/Contents/MacOS/bin/python3.8"
    }
    ```
    ---

    ## Manual path to the QGIS python install
    Can be entered in the interpreter if it is being fickle

    ##############################################################################

    MANUAL PATH TO QGIS PYTHON INTERPRETER
    ------------------------------------------------------------------------------
    /Applications/QGIS.app/Contents/MacOS/bin/python3.8
    ##############################################################################

    /Applications/QGIS.app/Contents/MacOS/bin/python3.8
    ---



  4. nick4rivers revised this gist Jul 16, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -43,9 +43,9 @@ My notes for Mac OS Qt and QGIS python plugin development tools on VSCode
    /Applications/QGIS.app/Contents/MacOS/bin/designer
    ---

    ##VSCODE PATH SETTINGS
    ## VSCODE PATH SETTINGS
    *These should be in the .vscode directory, in settings.json*
    ```json
    ```js
    {
    // FROM: https://gist.github.com/NicolaiMogensen/acfd8723720c4761aefef3cdfc2aa55a
    // I like changing colors for my projects. QGIS projects are usually green.
  5. nick4rivers revised this gist Jul 16, 2021. 1 changed file with 5 additions and 6 deletions.
    11 changes: 5 additions & 6 deletions Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -34,6 +34,7 @@ My notes for Mac OS Qt and QGIS python plugin development tools on VSCode

    ## LAUNCH QT DESIGNER THAT SHIPS WITH QGIS:
    *Launch from the terminal*

    **FOR LTR**

    /Applications/QGIS-LTR.app/Contents/MacOS/bin/designer
    @@ -42,12 +43,9 @@ My notes for Mac OS Qt and QGIS python plugin development tools on VSCode
    /Applications/QGIS.app/Contents/MacOS/bin/designer
    ---




    VSCODE PATH SETTINGS
    ------------------------------------------------------------------------------
    - these should be in the .vscode directory, in settings.json
    ##VSCODE PATH SETTINGS
    *These should be in the .vscode directory, in settings.json*
    ```json
    {
    // FROM: https://gist.github.com/NicolaiMogensen/acfd8723720c4761aefef3cdfc2aa55a
    // I like changing colors for my projects. QGIS projects are usually green.
    @@ -61,6 +59,7 @@ VSCODE PATH SETTINGS
    },
    "python.pythonPath": "${env:QGIS_PATH}/Contents/MacOS/bin/python3.8"
    }
    ```


    ##############################################################################
  6. nick4rivers revised this gist Jul 16, 2021. 1 changed file with 13 additions and 19 deletions.
    32 changes: 13 additions & 19 deletions Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,5 @@
    # PYTHON AND QT NOTES FOR QGIS PLUGIN DEVELOPMENT


    My notes for Mac OS Qt and QGIS python plugin development tools on VSCode

    ## Qt DEVELOPMENT VIRTUAL ENV:
    **NEW**
    @@ -12,7 +11,6 @@
    source my_venv/bin/activate
    ---


    ## PIP INSTALL PACKAGES FOR Qt DEVELOPMENT:

    *PyQt framework
    @@ -28,25 +26,21 @@
    pip install PyQtWebEngine
    ---

    ## PB_TOOL
    *Need to add the path to the plugin folder to pb_tool.cfg*

    plugin_path: /Users/nick/Library/Application Support/QGIS/QGIS3/profiles/test/python/plugins
    ---

    PB_TOOL
    ------------------------------------------------------------------------------
    - need to add the path to the plugin folder to pb_tool.cfg
    plugin_path: /Users/nick/Library/Application Support/QGIS/QGIS3/profiles/test/python/plugins
    ##############################################################################




    ## LAUNCH QT DESIGNER THAT SHIPS WITH QGIS:
    *Launch from the terminal*
    **FOR LTR**

    LAUNCH QT DESIGNER THAT SHIPS WITH QGIS:
    --------------------------------------------------
    - FOR LTR
    /Applications/QGIS-LTR.app/Contents/MacOS/bin/designer
    - FOR NEWEST RELEASE
    /Applications/QGIS.app/Contents/MacOS/bin/designer
    ##############################################################################
    /Applications/QGIS-LTR.app/Contents/MacOS/bin/designer
    **FOR NEWEST RELEASE**

    /Applications/QGIS.app/Contents/MacOS/bin/designer
    ---



  7. nick4rivers revised this gist Jul 16, 2021. 1 changed file with 12 additions and 9 deletions.
    21 changes: 12 additions & 9 deletions Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@



    ## VIRTUAL ENV:
    ## Qt DEVELOPMENT VIRTUAL ENV:
    **NEW**

    python3 -m venv [my_directory]
    @@ -13,17 +13,20 @@
    ---


    PIP INSTALL PACKAGES FOR Qt DEVELOPMENT:
    ------------------------------------------------------------------------------
    pip install PyQt5
    ## PIP INSTALL PACKAGES FOR Qt DEVELOPMENT:

    - maybe this one
    pip install PyQtWebEngine
    *PyQt framework

    - for Q Plugin development
    pip install pb_tool
    ##############################################################################
    pip install PyQt5

    *For packaging QGIS plugins*

    pip install pb_tool

    *maybe this one*

    pip install PyQtWebEngine
    ---


    PB_TOOL
  8. nick4rivers revised this gist Jul 16, 2021. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -10,9 +10,7 @@
    **ACTIVATE**

    source my_venv/bin/activate

    ##############################################################################

    ---


    PIP INSTALL PACKAGES FOR Qt DEVELOPMENT:
  9. nick4rivers revised this gist Jul 16, 2021. 1 changed file with 4 additions and 6 deletions.
    10 changes: 4 additions & 6 deletions Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -4,14 +4,12 @@

    ## VIRTUAL ENV:
    **NEW**
    python3 -m venv [my_directory]

    4 space indention
    makes full-width
    standard code blocks
    python3 -m venv [my_directory]

    - ACTIVATE
    source my_venv/bin/activate
    **ACTIVATE**

    source my_venv/bin/activate

    ##############################################################################

  10. nick4rivers revised this gist Jul 16, 2021. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,11 @@

    ## VIRTUAL ENV:
    **NEW**
    ```python3 -m venv [my_directory]```
    python3 -m venv [my_directory]

    4 space indention
    makes full-width
    standard code blocks

    - ACTIVATE
    source my_venv/bin/activate
  11. nick4rivers revised this gist Jul 16, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,8 @@


    ## VIRTUAL ENV:
    *NEW
    `python3 -m venv [my_directory]`
    **NEW**
    ```python3 -m venv [my_directory]```

    - ACTIVATE
    source my_venv/bin/activate
  12. nick4rivers revised this gist Jul 16, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@


    ## VIRTUAL ENV:
    *NEW*
    *NEW
    `python3 -m venv [my_directory]`

    - ACTIVATE
  13. nick4rivers revised this gist Jul 16, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@

    ## VIRTUAL ENV:
    *NEW*
    python3 -m venv [my_directory]
    `python3 -m venv [my_directory]`

    - ACTIVATE
    source my_venv/bin/activate
  14. nick4rivers revised this gist Jul 16, 2021. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,8 @@


    ## VIRTUAL ENV:
    - NEW
    `python3 -m venv [my_directory]`
    *NEW*
    python3 -m venv [my_directory]

    - ACTIVATE
    source my_venv/bin/activate
  15. nick4rivers created this gist Jul 16, 2021.
    78 changes: 78 additions & 0 deletions Qt-Plugin-Notes.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,78 @@
    # PYTHON AND QT NOTES FOR QGIS PLUGIN DEVELOPMENT



    ## VIRTUAL ENV:
    - NEW
    `python3 -m venv [my_directory]`

    - ACTIVATE
    source my_venv/bin/activate

    ##############################################################################



    PIP INSTALL PACKAGES FOR Qt DEVELOPMENT:
    ------------------------------------------------------------------------------
    pip install PyQt5

    - maybe this one
    pip install PyQtWebEngine

    - for Q Plugin development
    pip install pb_tool
    ##############################################################################



    PB_TOOL
    ------------------------------------------------------------------------------
    - need to add the path to the plugin folder to pb_tool.cfg
    plugin_path: /Users/nick/Library/Application Support/QGIS/QGIS3/profiles/test/python/plugins
    ##############################################################################





    LAUNCH QT DESIGNER THAT SHIPS WITH QGIS:
    --------------------------------------------------
    - FOR LTR
    /Applications/QGIS-LTR.app/Contents/MacOS/bin/designer
    - FOR NEWEST RELEASE
    /Applications/QGIS.app/Contents/MacOS/bin/designer
    ##############################################################################





    VSCODE PATH SETTINGS
    ------------------------------------------------------------------------------
    - these should be in the .vscode directory, in settings.json
    {
    // FROM: https://gist.github.com/NicolaiMogensen/acfd8723720c4761aefef3cdfc2aa55a
    // I like changing colors for my projects. QGIS projects are usually green.
    "workbench.colorCustomizations": {
    "titleBar.activeForeground": "#000000",
    "titleBar.activeBackground": "#0ff381",
    },
    "terminal.integrated.env.osx": {
    "PYTHONPATH": "${env:QGIS_PATH}/Contents/Resources/python:${env:QGIS_PATH}/Contents/Resources/python/site-packages:${env:QGIS_PATH}/Contents/Resources/python/site-packages/PyQt5",
    "PATH": "${env:PATH}:${env:QGIS_PATH}/Contents/MacOS/bin"
    },
    "python.pythonPath": "${env:QGIS_PATH}/Contents/MacOS/bin/python3.8"
    }


    ##############################################################################

    MANUAL PATH TO QGIS PYTHON INTERPRETER
    ------------------------------------------------------------------------------
    /Applications/QGIS.app/Contents/MacOS/bin/python3.8
    ##############################################################################