Difference between revisions of "Importing EMAC OE SDK QT Projects with Eclipse"
(Added intro) |
|||
Line 1: | Line 1: | ||
− | {{todo|Review;(12.31.13-18:15->MG+);(1.2.14-17:25->MG+)|Michael Gloff|project=oe 4,mg,ky,md,Review}} | + | {{todo|Review;(12.31.13-18:15->MG+);(1.2.14-17:25->MG+);(1.3.14-16:30->MG+)|Michael Gloff|project=oe 4,mg,ky,md,Review}} |
Qt C++ projects can be built and run with Eclipse through the pre-installed Qt plugin provided with [ftp://ftp.emacinc.com/Controllers/Development_Kits/EMAC_Open_Tools/Linux/eclipse-3.6-Linux-EMAC_Qt.tar.bz2 Eclipse] from EMAC. Note that the project will only run on EMAC products that contain the appropriate Qt libraries. | Qt C++ projects can be built and run with Eclipse through the pre-installed Qt plugin provided with [ftp://ftp.emacinc.com/Controllers/Development_Kits/EMAC_Open_Tools/Linux/eclipse-3.6-Linux-EMAC_Qt.tar.bz2 Eclipse] from EMAC. Note that the project will only run on EMAC products that contain the appropriate Qt libraries. | ||
Line 48: | Line 48: | ||
<br clear=all> | <br clear=all> | ||
+ | </cl> | ||
+ | If there are any build errors they will be shown in the ''Console'' and/or ''Problems'' tabs on the bottom. | ||
+ | |||
+ | ===Upload the Project=== | ||
+ | <cl> | ||
+ | 1. Navigate to the textedit project directory from the command prompt. | ||
− | + | developer@ldc:~$ cd /path/to/sdk/projects/qt_demos/textedit | |
+ | |||
+ | * Use scp to copy the file to the target machine's <code>tmp</code> directory | ||
+ | |||
+ | developer@ldc:~$ scp textedit root@TARGET_IP:/tmp | ||
</cl> | </cl> | ||
+ | |||
+ | ===Run the Project=== | ||
+ | |||
+ | Connect remotely to the target machine using SSH and run the program as shown below. | ||
+ | |||
+ | developer@ldc:~$ ssh root@TARGET_IP | ||
+ | ... | ||
+ | root@emac-oe:~# chmod u+x /tmp/textedit | ||
+ | root@emac-oe:~# /tmp/textedit -qws | ||
+ | |||
+ | * chmod u+x sets the root user's permissions to allow execution of the binary. | ||
+ | * /tmp/hello runs the program. Not the -qws argument is required to run qt based applications. |
Revision as of 16:32, 3 January 2014
Qt C++ projects can be built and run with Eclipse through the pre-installed Qt plugin provided with Eclipse from EMAC. Note that the project will only run on EMAC products that contain the appropriate Qt libraries.
Contents
EMAC SDK with Qt Example: Compile and Run the textedit
Project
Importing the Project
This procedure provides an overview of how to compile and run Qt C++ applications in Eclipse.
-
Start Eclipse and select a workspace such as /home/developer/workspace.
-
Click Window → Open Perspective → Other... To bring up a dialog window with a list of Perspectives to choose from.
-
Choose Qt C++ and click Ok.
-
Select File → Import...
-
Expand Qt and select Qt Project
-
Click Next >, then click Browse...
-
Navigate to the
projects/qt_demos/textedit
directory underneath the install location of the EMAC OE SDK. -
Highlight textedit.pro then click OK.
-
Click Finish.
Building the Project
The Project Explorer should now show the textedit project.
The arrowhead to the left of textedit indicates that the textedit project is open.
-
Click on the arrowhead to see the files in the project.
-
Double click on the
textedit.cpp
file to open it. The arrow next to textedit.cpp can be expanded to see a list of classes and functions available within this source file. -
To build the project, ensure the project is highlighted in the Project Explorer treeview in the left pane.
-
Select Project→Run qmake
-
Now, select Project→Build Project. The project will now build, and your window should appear similar to the screenshot below:
If there are any build errors they will be shown in the Console and/or Problems tabs on the bottom.
Upload the Project
-
Navigate to the textedit project directory from the command prompt.
developer@ldc:~$ cd /path/to/sdk/projects/qt_demos/textedit
-
Use scp to copy the file to the target machine's
tmp
directorydeveloper@ldc:~$ scp textedit root@TARGET_IP:/tmp
Run the Project
Connect remotely to the target machine using SSH and run the program as shown below.
developer@ldc:~$ ssh root@TARGET_IP ... root@emac-oe:~# chmod u+x /tmp/textedit root@emac-oe:~# /tmp/textedit -qws
- chmod u+x sets the root user's permissions to allow execution of the binary.
- /tmp/hello runs the program. Not the -qws argument is required to run qt based applications.