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



我在为Harmattan部署用Qt 4.7.4/QtQuick 1.0编写的应用程序时遇到问题。虽然模拟器中一切正常,但当应用程序部署在诺基亚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:qtsdkmaddebinmake.exe" -w
make: Entering directory `/d/qtproject/pacca'
make: Nothing to be done for `first'.
make: Leaving directory `/d/qtproject/pacca'
The process "C:qtsdkmaddebinmake.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.

尽管编译输出可能会给出一些关于错误的提示,但我不知道出了什么问题。可笑的是,在早期的一些开发阶段,该应用程序在设备上运行。但不幸的是,我不知道从那以后我改变了什么。

非常感谢您的帮助。提前谢谢。

最后,我解决了这个问题。这是一件非常琐碎的事情——然而,它花了我很多小时。

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

anchors.fill: parent

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

width: 480
height: 854

看起来,尽管模拟器可以使用填充锚点进行管理,但N9在根元素中无法识别它,因此在屏幕上什么也没画。

谢谢你的帮助,你把我带向了正确的方向。

相关内容

  • 没有找到相关文章

最新更新