说明:
也许有不少朋友会问到,网上有不少构建meego touch环境的文章了,你又何必多此一举呢?细心的朋友可能会发现,我这里不用编译QT4.7 而是用QT4.7的SDK来搭建环境的。编译QT4.7一般都需要大概一下午的时间,而是用SDK则最多不超过20分钟就搞定了。这也是希望能有更快的方法让大家来玩meego。
下载 qt-sdk-linux-x86-opensource-2010.05-rc1.bin:
chmod 777 qt-sdk-linux-x86-opensource-2010.05-rc1.bin
./qt-sdk-linux-x86-opensource-2010.05-rc1.bin
sudo apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxcursor-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxrandr-dev libxrender-dev
sudo apt-get install libgconf2-dev libdbus-qt-1-dev
git clone git://gitorious.org/meegotouch/meegotouch-theme.git
cd meegotouch-theme/
qmake
sudo make install
git clone git://gitorious.org/meegotouch/libmeegotouch.git
sudo apt-get install libicu-dev graphviz
cd libmeegotouch
qmake
make
sudo make install
在/usr/local/lib下的目录,发现已经生成的meego 库文件
实践:
#include <MApplication>HelloWorld.pro
#include <MApplicationWindow>
#include <MApplicationPage>
#include <MLabel>
int main(int argc, char **argv)
{
MApplication app(argc, argv);
MApplicationWindow window;
MApplicationPage page;
page.setTitle("My First Page");
page.setCentralWidget(new MLabel("Hello World!"));
page.appear(&window);
window.show();
return app.exec();
}
######################################################################
# Automatically generated by qmake (2.01a) 9 12 21:36:22 2010
######################################################################
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += meegotouch
# Input
SOURCES += main.cpp
qmake
执行makemake
运行程序记得要加sudosudo ./helloWorld程序结果如下:
unix {
INCLUDEPATH += /usr/local/include/meegotouch
LIBS += -L/usr/local/lib -lmeegotouchcore -lmeegotouchextensions -lmeegotouchsettings -lmeegotouchviews
QMAKE_LFLAGS += -Wl,-rpath,/usr/local/lib
}
PATH=/usr/local/bin/:$PATH make
sudo ./tutorial_music_catalogue如果有花屏可以执行下面命令:
sudo ./tutorial_music_catalogue -software程序执行后的结果图:
MComponentData: Usage: ./tutorial_music_catalogue
[-software] Enable software rendering
[-fullscreen] Make the application fullscreen
[-show-br] Show the bounding rectangle for all scene items
[-show-fps] Show the FPS for the view (only with OpenGL rendering)
[-log-fps] Log the FPS for the application
[-show-size] Show widget sizes in the scene
[-show-object-names] Show the names of the objects in the scene
[-show-position] Show widget positions in the scene
[-show-cursor] Force the cursor to be visible
[-reverse] Change the layout direction to right-to-left direction
[-dev] Enable development visualization mode
[-genimglist filename] Generate list of requested images to filename
[-remote-theme] Wait until remote theme daemon is available
[-local-theme] Force usage of local theme processing instead of remote theme daemon
[-output-level debug|warning|critical] Only show messages of given output level or above
[-output-prefix <prefix>] Only show debug messages that start with the given prefix
[-no-output-prefix <prefix>] Only show debug messages that do not start with the given prefix
[-target <name>] Use the target device profile
[-prestart] Prestart the application (if supported)
[-fixed-orientation 0|90|180|270] Start application in fixed orientation.
This overrides keyboard state, as well as a device profile
补充一些描述。
最后非常感谢小辉,阿虎,给予的帮助,也希望更多的朋友来关注meego 关注meegoq。
附:qmake与qt4的连接问题解决方案
可以敲下面命令测试
qmake -v
出现下面情况:
$Qmake version: 1.07a (Qt 3.3.8b)
$Qmake is free software from Trolltech ASA.
怎么qmake的版本变成了qt3了,进入/usr/bin目录下
root@ubuntu:/home/yyy# cd /usr/bin
root@ubuntu:/usr/bin# ls -l qmake
lrwxrwxrwx 1 root root 23 2009-10-09 09:35 qmake -> /etc/alternatives/qmake
查看qmake的信息,它是一个链接指向的是/etc/alternatives/qmake
root@ubuntu:/usr/bin# ls -l /etc/alternatives/qmake
lrwxrwxrwx 1 root root 18 2009-12-08 12:46 /etc/alternatives/qmake -> /usr/bin/qmake-qt3
终于找到的根源,原来qmake被设置成了qmake-qt3
强行修改
root@ubuntu:/usr/bin# rm /etc/alternatives/qmake
root@ubuntu:/usr/bin# ln -s /usr/bin/qmake /etc/alternatives/qmake
root@ubuntu:/usr/bin# qmake -v
QMake version 2.01a
Using Qt version 4.5.0 in /usr/lib
附件: dbus.rar
0 0 标签: Meego教程QTmeego touch
热门源码