Qt应用程序不会在诺基亚N9上使用MeeGo绘制任何用户界面

时间:2012-01-12 06:44:47

标签: qt qt-creator meego meego-harmattan

在部署用Qt 4.7.4 / QtQuick 1.0编写的用于Harmattan的应用程序时遇到问题。 虽然在模拟器中一切正常,但在诺基亚N9(MeeGo 1.2 Harmattan,版本PR1.1)上部署时,应用程序不会绘制任何用户界面。部署成功,应用程序可以在设备的应用程序列表中找到,甚至可以在QtCreator中看到控制台日志输出,但没有迹象表明应用程序实际在设备上运行 - 我可以自由地浏览系统并在QtCreator说我的应用程序正在运行时打开其他应用程序。

QtCreator中的应用程序输出视图说:

Killing remote process(es)...
Starting remote process ...
Remote process started.
Using the meego graphics system
Found SGX/MBX driver, enabling FullClearOnEveryFrame 
Found v1.4 driver, enabling brokenTexSubImage 

继续编译输出:

Running build steps for project pacca...
Configuration unchanged, skipping qmake step.
Starting: "C:\qtsdk\madde\bin\make.exe" -w
make: Entering directory `/d/qtproject/pacca'
make: Nothing to be done for `first'.
make: Leaving directory `/d/qtproject/pacca'
The process "C:\qtsdk\madde\bin\make.exe" exited normally.
Creating package file ...
Package Creation: Running command 'c:/qtsdk/madde/bin/mad dpkg-buildpackage -nc -uc -us'.
dpkg-buildpackage: set CFLAGS to default value: -g -O2
dpkg-buildpackage: set CPPFLAGS to default value: 
dpkg-buildpackage: set LDFLAGS to default value: 
dpkg-buildpackage: set FFLAGS to default value: -g -O2
dpkg-buildpackage: set CXXFLAGS to default value: -g -O2
which: pgp: unknown command
dpkg-buildpackage: source package pacca
dpkg-buildpackage: source version 0.0.1
dpkg-buildpackage: source changed by unknown <>
dpkg-buildpackage: host architecture armel
 debian/rules build
make: Nothing to be done for `build'.
 debian/rules binary
dh_testdir
dh_testroot
dh_clean -k 
dh_installdirs
# Add here commands to install the package into debian/pacca.
/usr/bin/make INSTALL_ROOT="/d/qtproject/pacca"/debian/pacca install
make[1]: Entering directory `/d/qtproject/pacca'
cp -f -r d:/qtproject/pacca/qml/pacca /d/qtproject/pacca/debian/pacca/opt/pacca/qml/
install -m 644 -p d:/qtproject/pacca/pacca80.png /d/qtproject/pacca/debian/pacca/usr/share/icons/hicolor/80x80/apps/
install -m 644 -p d:/qtproject/pacca/pacca_harmattan.desktop /d/qtproject/pacca/debian/pacca/usr/share/applications/
install -m 755 -p "pacca" "/d/qtproject/pacca/debian/pacca/opt/pacca/bin/pacca"
make[1]: Leaving directory `/d/qtproject/pacca'
dh_testdir
dh_testroot
dh_installchangelogs 
dh_installdocs
dh_installexamples
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
# dh_shlibdeps # Uncomment this line for use without Qt Creator
dh_gencontrol
dh_md5sums
dpkg-gencontrol: warning: unknown substitution variable ${shlibs:Depends}
dpkg-gencontrol: warning: unknown substitution variable ${misc:Depends}
dh_builddeb
aegis-manifest: No findings in 'pacca'.
 dpkg-genchanges -b -u.. >../pacca_0.0.1_armel.changes
dpkg-buildpackage: binary only upload (no source included)
dpkg-genchanges: binary-only upload - not including any source code
Can't locate Debian/Debhelper/Dh_Lib.pm in @INC (@INC contains: /usr/lib/perl5/5.8/msys /usr/lib/perl5/5.8 /usr/lib/perl5/site_perl/5.8/msys /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/site_perl/5.8 /usr/lib/perl5/vendor_perl/5.8/msys /usr/lib/perl5/vendor_perl/5.8 /usr/lib/perl5/vendor_perl/5.8 .) at c:/qtsdk/madde/madbin/dh_clean line 10.
BEGIN failed--compilation aborted at c:/qtsdk/madde/madbin/dh_clean line 10.
Package created.
Installing package to sysroot ...
Package 'pacca' removed.

Package 'pacca' installed.

Connecting to device...
Preparing SFTP connection...
Starting upload...
Successfully uploaded package file.
Installing package to device...
(Reading database ... 41700 files and directories currently installed.)
Preparing to replace pacca 0.0.1 (using .../pacca_0.0.1_armel.deb) ...
Unpacking replacement pacca ...
aegis-installing pacca (from '')
Setting up pacca (0.0.1) ...
Processing triggers for desktop-file-utils ...
Processing triggers for hicolor-icon-theme ...
Package installed.
Deployment finished.

虽然编译输出可能会给出一些关于错误的提示,但我不知道出了什么问题。可笑的是,在某些早期开发阶段,该应用程序在该设备上工作。但不幸的是,我不知道自那以后我发生了什么变化。

非常感谢任何帮助。提前谢谢。

1 个答案:

答案 0 :(得分:0)

最后,我解决了这个问题。这是一个非常微不足道的事情 - 然而,它花了我很多时间。

为了使代码通用(我想),我不想为我的根QML元素声明确切的宽度和高度。相反,我指定了

anchors.fill: parent

嗯,那就是问题所在。只需添加2行代码即可解决我的问题(至少,在诺基亚N9上执行应用程序)。

width: 480
height: 854

虽然模拟器可以使用填充锚进行管理,但N9在根元素中无法识别它,因此在屏幕上没有任何内容。

谢谢你的帮助,这使我走向正确的方向。