This shows you the differences between two versions of the page.
tutorials:common:development:qt_set_up_on_cubieboard [2014/07/12 16:36] allen |
tutorials:common:development:qt_set_up_on_cubieboard [2014/07/12 17:08] (current) allen |
||
---|---|---|---|
Line 48: | Line 48: | ||
After compiled ,enter ''examples/widgets/wiggly/'',there is some sample code you can use .Like below | After compiled ,enter ''examples/widgets/wiggly/'',there is some sample code you can use .Like below | ||
- | HELLO WORLD | ||
- | |||
- | {{:tutorials:common:2.png?300|}} | ||
CALCULATOR | CALCULATOR | ||
Line 56: | Line 53: | ||
{{:tutorials:common:3.png?300|}} | {{:tutorials:common:3.png?300|}} | ||
+ | TETRIS | ||
+ | |||
+ | {{:tutorials:common:6.png?300|}} | ||
+ | |||
+ | 6.set up the environment variables | ||
+ | |||
+ | add two line in the end of file ''/etc/profile'' | ||
+ | <code> | ||
+ | PATH="$PATH:/usr/local/qt/bin" | ||
+ | export PATH | ||
+ | </code> | ||
+ | ===== programme hello world ===== | ||
+ | 1.build a directory named hello ,create a new file named hello.cpp in it . | ||
- | ==== Headline ==== | + | <code> |
+ | #include <QApplication> | ||
+ | #include <QLabel> | ||
+ | int main (int argc, char *argv []) | ||
+ | { | ||
+ | QApplication app (argc, argv); | ||
+ | QLabel *label = new QLabel ("Hello Qt!"); | ||
+ | label->show (); | ||
+ | return app. exec (); | ||
+ | } | ||
+ | </code> | ||
+ | 2. compile the hello.cpp | ||
- | ===== Headline ===== | + | <code> |
+ | qmake -project | ||
+ | qmake | ||
+ | make | ||
+ | </code> | ||
+ | In current directory create a executable file,run it as like below | ||
- | === See Also === | + | |
+ | {{:tutorials:common:7.png?200|}} | ||
<WRAP noprint> | <WRAP noprint> | ||
{{tag>Cubieboard Cubietruck}} | {{tag>Cubieboard Cubietruck}} | ||
</WRAP> | </WRAP> |