Home Raspberry PI: A Case Study in Deploying Qt Apps to Generic Linux Devices

Raspberry PI: A Case Study in Deploying Qt Apps to Generic Linux Devices

 

 
Overview
This is an awfully dry post; dry due to the sheer logistic nature of it. This functionality exists and is quite straight forwards to stumble upon. This blog exists in order to draw your attention to it and hopefully minimize the stumble time.
You have a device:
1) Running an ssh server
2) With gdbserver
You also have:
1) A functional tool chain for the target (Code Sourcery is the traditional goto)
2) A Qt build for your target
3) A Linux box you are deploying from (My convenience, instructions should be readily repurposeable for Mac based developers)
4) Qt Creator (Qt Creator 2.4.0 (as shipped with the QtSDK) was used at the time of filming/documenting this process)
Qt Creator has various merits which basically speak for themselves.
Integrated documentation
Convenient remote visual debugging/profiling
Convenient (single click) deployment
You grow accustomed to this functionality if you target any of the officially/unofficially supported targets tightly integrated into Creator in its various distributions. (Official SDK, Necessitas, Meego SDK). It would be lovely if it were more commonly perceived as a generic end to end solution for deployment to generic Linux targets, and it is readily achievable if you avoid a couple of snags.
Initial configuration
Launch Creator
Menu -> Tools -> Options
Build & Run -> Qt Versions
Add your Raspberry PI Qt build: /opt/dev/qt-qpa-5-rasp-pi/bin/qmake
Creator indicates “Qt version 5.0.0 for Desktop”, this can be safely ignored.
Build & Run -> Tool Chains
Add your cross compiler: /opt/toolchains/arm-2010q1/bin/arm-none-linux-gnueabi-gcc
in my case. Adjust the ABI in the unlikely event it is incorrect.
Linux Devices -> Device Configurations
Add configuration with correct ssh details, deploy a public key and establish this works.
Per project configuration
1) Open an existing Qt application (example suffices)
2) Select a desktop build
Once this is done:
Projects -> Targets -> Build
Specify your target’s Qt version
Specify the toolchain from the drop down below
Projects -> Targets -> Run
Deployment
Method: Deploy to Remote Linux Host
Device Configuration: Select your “Linux Device” added in the Device Configurations step above
Run
Run Configuration: foo (on Remote Device)
Arguments: -platform eglfs
This should suffice, you should now be able to deploy, run and debug applications on the Raspberry PI (or any other similarly capable Linux based target)
A screen grab demonstrating the logistics is available here
A video where I talk through the steps is also available for those willing to weather my accent
Caveats
1) If you select a QtQuick UI project from the project wizard you will not be able to deploy to the target (will be grayed out). If you select a Qt Quick application you will get a QDeclarativeView based viewer/launch pad. If you want to dabble with Qt 5 (who doesn’t) at present, one has to ride to war with one’s own QQuickView based runtime/viewer (read: pony)
2) Qt must already be deployed on the target. We clearly handle this for our own devices, but when you are winging it as documented here, Qt has to have been (manually) installed to the configured prefix. (Needless to say, it is best to sanity check the Qt install prior to attempting IDE based deployment).
 
Source QtExperts

About ReadWrite’s Editorial Process

The ReadWrite Editorial policy involves closely monitoring the tech industry for major developments, new product launches, AI breakthroughs, video game releases and other newsworthy events. Editors assign relevant stories to staff writers or freelance contributors with expertise in each particular topic area. Before publication, articles go through a rigorous round of editing for accuracy, clarity, and to ensure adherence to ReadWrite's style guidelines.

Get the biggest tech headlines of the day delivered to your inbox

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.

    Tech News

    Explore the latest in tech with our Tech News. We cut through the noise for concise, relevant updates, keeping you informed about the rapidly evolving tech landscape with curated content that separates signal from noise.

    In-Depth Tech Stories

    Explore tech impact in In-Depth Stories. Narrative data journalism offers comprehensive analyses, revealing stories behind data. Understand industry trends for a deeper perspective on tech's intricate relationships with society.

    Expert Reviews

    Empower decisions with Expert Reviews, merging industry expertise and insightful analysis. Delve into tech intricacies, get the best deals, and stay ahead with our trustworthy guide to navigating the ever-changing tech market.