3 Replies Latest reply on Nov 7, 2014 11:51 AM by mikemoy

    Qt4 Embedded & QtCreator IDE

    doumdi

      Hello everybody,

       

      I have managed to use Qt4 on the Edison board. I am even able to use QtCreator as the IDE instead of Eclipse.

       

      Follow the procedure for building the image here :

       

      Build Intel Edison Yocto Image From Scratch

       

      1) Download image files (currently edison-image-ww36-14.zip) and extract it

       

      Intel® Download Center

       

      You need to change few things though :

       

      2) Resize rootfs to 1Gb (read the thread)

       

      Can I increase the size of the Root '/' partition?

       

      3) Add Qt packages to edison-src/device-software/meta-edison-distro/recipes-core/images/edison-image.bb

       

      Add those lines :

       

      #CMAKE
      IMAGE_INSTALL += "cmake"

      #QT
      IMAGE_INSTALL += "qt4-embedded"

       

      #ADD OTHER THINGS IF YOU WANT

       

      4) Follow the procedure to build the image "2 Building a Standard Edison Image"


      5) Flash the new image with recovery (will resize partitions)


      6) Follow the procedure to build the Edison Native SDK & Install it (use default directory)

       

      7) On the Linux host (Ubuntu 14.04)

      * $source /opt/poky-edison/1.6/environment-setup-core2-32-poky-linux

      * $sudo apt-get install libqt4-dev cmake qtcreator

      * start qtcreator and add a new "Edison" kit with the installed compilers at step #5

      ** Add new Compiler & Debugger entries from Tools/Options/Build & Run menu

      ** Use GCC : /opt/poky-edison/1.6/sysroots/x86_64-pokysdk-linux/usr/bin/i586-poky-linux/i586-poky-linux-g++

      ** Use GDB : /opt/poky-edison/1.6/sysroots/x86_64-pokysdk-linux/usr/bin/i586-poky-linux/i586-poky-linux-gdb

      ** Create a new Kit with the new Compiler & Debugger

      ** Add and configure your device with IP user/password

       

      8) Create a CMake project, use Qt4 native tools (uic,moc) but link with embedded libraries.

       

      project(MyProject)

       

      cmake_minimum_required(VERSION 2.8)

       

      set(CMAKE_BUILD_TYPE Debug)

       

      #Will use native moc

      find_package(Qt4 REQUIRED)

       

      INCLUDE_DIRECTORIES(

      /opt/poky-edison/1.6/sysroots/core2-32-poky-linux/usr/include/qtopia/

      /opt/poky-edison/1.6/sysroots/core2-32-poky-linux/usr/include/qtopia/QtCore

      /opt/poky-edison/1.6/sysroots/core2-32-poky-linux/usr/include/qtopia/QtNetwork

      /opt/poky-edison/1.6/sysroots/core2-32-poky-linux/usr/include/qtopia/QtMultimedia

      /opt/poky-edison/1.6/sysroots/core2-32-poky-linux/usr/include/qtopia/QtXml

      )

       

      SET(QT_EDISON_LIBS -L/opt/poky-edison/1.6/sysroots/core2-32-poky-linux/usr/lib -lQtCoreE -lQtNetworkE -lQtMultimediaE -lQtXmlE -lQtXmlPatternsE)

       

      #Where to put files...

      file(WRITE "${CMAKE_SOURCE_DIR}/QtCreatorDeployment.txt" "YOURDEPLOYMENTPATH\n")

       

       

      macro(add_deployment_file SRC DEST)

      file(RELATIVE_PATH path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})

      file(APPEND "${CMAKE_SOURCE_DIR}/QtCreatorDeployment.txt" "${path}/${SRC}:${DEST}\n")

      endmacro()

       

       

      macro(add_deployment_directory SRC DEST)

      file(GLOB_RECURSE files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${SRC}/*")

      foreach(filename ${files})

      get_filename_component(path ${filename} PATH)

      add_deployment_file("${filename}" "${DEST}/${path}")

      endforeach(filename)

      endmacro()

       

       

      Use QT4_WRAP_CPP macros if needed

      Use TARGET_LINK_LIBRARIES(target ${QT_EDISON_LIBS})

       

      You can now run & deploy and debug from QtCreator.

       

      Good luck!

       

      Dominic