Qt World Summit: Submit your Presentation

Install/develop on MacBook, run on Raspberry Pi?

  • I've watched a variety of the available videos and read many of the tutorials. On Monday, I'm getting a trial license for the commercial version of Qt and I'm trying to set things up to do things right. What I'm missing is how one sets this up for what might normally be called cross-compilation but I'm not sure if that's required in my case.

    The target platform for this project is a Raspberry Pi 3B with a 10" touchscreen display. I would like to do the development on my MacBook Air with macOS Mojave. I anticipate that I would like to code in Python when I can.

    What's the strategy here that might work out for a rapid/efficient development cycle? I could guess at the way this might work but testing the touchscreen behavior suggests that some of the time I need this to run on the Raspberry Pi test rig.

    Thoughts/suggestions? (I understand what virtual env does within the Python space.)

    Is it necessary to install something on both the Mac and the Raspi? Is there some sort of emulator in the IDE for the Raspi?

  • Lifetime Qt Champion


    Are you planing to use PySide2 or PyQt5 ?

    If so, then you can develop the application on your MacBook and then use something like git to sync your source tree on the Pi and use the packages provided by the distribution you are using on the Pi.

    Otherwise, if the native packages are too old, then yes, you are going to need to setup a cross-compiling environment and cross-compile Qt as well as your application.

    You will likely have to also compile the cross-toolchain first from Linaro.

  • @SGaist Not knowing a lot about this, I'm guessing I would like to take the PySide2 route. I'm not sure why there's a compilation phase with this step (unless we're talking about the standard pyc output.

  • Lifetime Qt Champion

    I see I wasn't as clear as I wanted. I meant that if you wanted to go with C++ then you'd have to cross-compile stuff.

  • @SGaist

    Let's see... the PySide2 route fails at the step to install pyside2 with either version tried:

    pip install --index-url=http://download.qt.io/snapshots/ci/pyside/5.12/latest pyside2 --trusted-host download.qt.io

    It simply can't be found. Visiting the link above in a browser shows a variety of files which may be downloaded by pip install. Presumably the Raspberry Pi 3B's reported architecture with Python 2.7 doesn't match up to any of those wheels. :checking that theory:

    So it's not win_amd64, none-win32, manylinux1_x86_64, macosx_10_12_intel, manylinux1_x86_64, macosx_10_12_intel. The Raspberry Pi 3B would be something more like manylinux1_armv6 or manylinux1_armv7 perhaps but it's not available in the list as seen in Qt's stash.


    And the EGLFS route fails at Step 10 on the configure command. (See error from linked post.)

    I can't use the Embedded Linux route since I need to install this on a particular Raspbian Stretch Lite image that's already somewhat configured.

  • Lifetime Qt Champion

    Why not use the first version: pip install PySide2 ?

  • @SGaist I tried that of course (same error message and result). I also tried to reply earlier but since I'm a noob on this forum it won't let me post frequently.

  • Lifetime Qt Champion

    Are you using a virtual environment ?

    Or something like macports or brew ?

  • I'm using a virtual environment by which I mean:

    source venv/bin/activate

  • Lifetime Qt Champion

    What version of python are you using ?

  • Python 2.7

  • Lifetime Qt Champion

    May I suggest to change for Python 3 ?
    Python 2.7 will reached end of life next year so it's not a good idea to start a new project with it.