Reply
Thread Tools
Posts: 838 | Thanked: 3,384 times | Joined on Mar 2009
#1
I'm asking help how to correctly use qml on Fremantle:
a) on stock fremantle (+extras)
b) +extras-devel
c) on CSSU (stable/testing)
d) on something else (meecolay perhaps?)

I have done some experiments with only stock+extras (not even extras-devel), and I have got some nice results, but there are some hacky bits I want to discuss.

Step1
Code:
apt-get install qt4-declarative-qmlviewer
You will get qmlviewer. And simple sample will work:
Code:
qmlviewer simple1.qml
Code:
//simple1.qml
import Qt 4.7
Rectangle {
    width: 200
    height: 200
    color: "white"
    Text {
        text: "Hello World"
        anchors.centerIn: parent
    }
}
Step2
Code:
apt-get install qtquickcompat
Code:
//simple2.qml
import Qt 4.7
import QtQuick 1.1    // simple2.qml: comes from qtquickcompat
Rectangle {
    width: 200
    height: 200
    color: "white"
    Text {
        text: "Hello World"
        anchors.centerIn: parent
    }
}
Code:
qmlviewer simple2.qml
(it does the same than previous)

Step3
Code:
apt-get install libqtm-12  #installs also libtelepathy-qt4-1
You need to run manually (Why this doesn't happen automatically? How to tune it otherwise?)
Code:
ln -s /opt/qtm12/imports/QtMobility/ /usr/lib/qt4/imports
Code:
//simple3.qml
import Qt 4.7
import QtQuick 1.1    // simple2.qml: comes from qtquickcompat
import QtMobility.location 1.0  // simple3.qml: comes from libqtm-12 (needs symlink)
import QtMobility.sensors 1.0   // simple3.qml: comes from libqtm-12  (needs symlink)
Rectangle {
    width: 200
    height: 200
    color: "white"
    Text {
        text: "Hello World"
        anchors.centerIn: parent
    }
}
Code:
qmlviewer simple3.qml
Step4
There are two different versions of "libQtSystemInfo.so":
Code:
519900 Nov 14  2011 /opt/qtm12/lib/libQtSystemInfo.so.1.2.1    
359616 Sep  9  2010 /opt/lib/libQtSystemInfo.so.1.0.2
Old one comes from package libqtm-systeminfo, and new one from libqtm-12.

Code:
rm /opt/lib/libQtSystemInfo.so.1.0.2
ln -s /opt/qtm12/lib/libQtSystemInfo.so /opt/lib/libQtSystemInfo.so.1.0.2
(Or you can remove libqtm-systeminfo, and use LD_LIBRARY_PATH or something)

Old libQtSystemInfo is causing this error.
Code:
file:///home/user/hello/simple4.qml:4:1: plugin cannot be loaded for module "QtMobility.systeminfo": Cannot load library /opt/qtm12/imports/QtMobility/systeminfo/libdeclarative_systeminfo.so: (/opt/qtm12/imports/QtMobility/systeminfo/libdeclarative_systeminfo.so: undefined symbol: _ZN10QtMobility18QSystemStorageInfo13connectNotifyEPKc) 
     import QtMobility.systeminfo 1.2

Code:
//simple4.qml
import Qt 4.7
import QtQuick 1.1    // simple2.qml: comes from qtquickcompat
import QtMobility.location 1.0  // simple3.qml: comes from libqtm-12  (needs symlink)
import QtMobility.sensors 1.0   // simple3.qml: comes from libqtm-12  (needs symlink)
import QtMobility.systeminfo 1.2  // simple4.qml: comes from libqtm-12 (needs using of new libQtSystemInfo)
Rectangle {
    width: 200
    height: 200
    color: "white"
    Text {
        text: "Hello World"
        anchors.centerIn: parent
    }
}
Code:
qmlviewer simple4.qml
Step5
It just works:
Code:
qmlviewer simple5.qml
Code:
//simple5.qml
import Qt 4.7
import QtQuick 1.1    // simple2.qml: comes from qtquickcompat
import QtMobility.location 1.0  // simple3.qml: comes from libqtm-12  (needs symlink)
import QtMobility.sensors 1.0   // simple3.qml: comes from libqtm-12  (needs symlink)
import QtMobility.systeminfo 1.2  // simple4.qml: comes from libqtm-12 (needs using of new libQtSystemInfo)
import QtWebKit 1.0               // simple5.qml: comes from libqt4-declarative
Rectangle {
    width: 200
    height: 200
    color: "white"
    Text {
        text: "Hello World"
        anchors.centerIn: parent
    }
}
Step6
Code:
ln -s /opt/qtm12/imports/QtMultimediaKit /usr/lib/qt4/imports
Why this needs to be done manually?

Code:
//simple6.qml
import Qt 4.7
import QtQuick 1.1    // simple2.qml: comes from qtquickcompat
import QtMobility.location 1.0  // simple3.qml: comes from libqtm-12  (needs symlink)
import QtMobility.sensors 1.0   // simple3.qml: comes from libqtm-12  (needs symlink)
import QtMobility.systeminfo 1.2  // simple4.qml: comes from libqtm-12 (needs using of new libQtSystemInfo)
import QtWebKit 1.0               // simple5.qml: comes from libqt4-declarative
import QtMultimediaKit 1.1        // simple6.qml: comes from libqtm-12  (needs symlink)
Rectangle {
    width: 200
    height: 200
    color: "white"
    Text {
        text: "Hello World"
        anchors.centerIn: parent
    }
}
Code:
qmlviewer simple6.qml
Step7
Code:
apt-get install qt-components-10  #installs also libmaliit1 qt-components-base-theme
Code:
//simple7.qml
import Qt 4.7
import QtQuick 1.1    // simple2.qml: comes from qtquickcompat
import QtMobility.location 1.0  // simple3.qml: comes from libqtm-12  (needs symlink)
import QtMobility.sensors 1.0   // simple3.qml: comes from libqtm-12  (needs symlink)
import QtMobility.systeminfo 1.2  // simple4.qml: comes from libqtm-12 (needs using of new libQtSystemInfo)
import QtWebKit 1.0               // simple5.qml: comes from libqt4-declarative
import QtMultimediaKit 1.1        // simple6.qml: comes from libqtm-12  (needs symlink)
import com.nokia.meego 1.0        //simple7.qml: comes from qt-components-10
Rectangle {
    width: 200
    height: 200
    color: "white"
    Text {
        text: "Hello World"
        anchors.centerIn: parent
    }
}
Code:
qmlviewer simple7.qml
====================
Test with CSSU-stable and CSSU-testing
Qt is now 4.7.4 which means qtquickcompat is not needed (if I understood correctly)

Step1 and Step2
Code:
apt-get install qt4-declarative-qmlviewer
Code:
qmlviewer simple1.qml
Code:
qmlviewer simple2.qml
Both works.

Step3
Code:
apt-get install libqtm-12  #installs also libtelepathy-qt4-1
ln -s /opt/qtm12/imports/QtMobility/ /usr/lib/qt4/imports
Code:
qmlviewer simple3.qml
Is not working.
Code:
Qml debugging is enabled. Only use this in a safe environment!
file:///home/user/hello/simple3.qml:3:1: module "QtMobility.location" version 1.0 is not installed 
     import QtMobility.location 1.0
Any thoughts? Is it possible to use qml with CSSU?

Last edited by AapoRantalainen; 2013-11-14 at 07:48. Reason: cssu stable is also broken
 

The Following 10 Users Say Thank You to AapoRantalainen For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#2
I think you should use a main.cpp with QmlApplicationViewer. You can create the required files with QtCreator. Look at useragenttool source for reference

Btw., when we're talking about qml and qt quick: Aapo, are you interested in upgrading QtComponents to 1.4.8 (latest version in Nemo Mobile?) I have a semi-working build (only known bug: no status bar). qt-components-10 seem to have a bugged StatusBar: http://talk.maemo.org/showpost.php?p...postcount=1490
For more info, pm me.
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 

The Following User Says Thank You to marmistrz For This Useful Post:
Posts: 863 | Thanked: 213 times | Joined on Feb 2012 @ Goa
#3
are you guys trying to turn this qt os watever in to QML??? i mean ui etc? ohhh my godddddd, i swear this is the only thing'd make a big difference in fremantle, thank yo veryyyy muchhhhh in advance.. good luck AapoRantalainen
 

The Following User Says Thank You to seanmcken For This Useful Post:
Posts: 838 | Thanked: 3,384 times | Joined on Mar 2009
#4
Originally Posted by marmistrz View Post
Btw., when we're talking about qml and qt quick: Aapo, are you interested in upgrading QtComponents to 1.4.8
Originally Posted by seanmcken View Post
are you guys trying to turn this qt os watever in to QML???
Unfortunately, this time I'm not trying to upgrade any part of Fremantle. I'm planning to develop application which is using qml and importing these:
Code:
import Qt 4.7
import QtQuick 1.1
import QtMobility.location 1.0
import QtMobility.sensors 1.0
import QtMobility.systeminfo 1.2
import QtWebKit 1.0
import QtMultimediaKit 1.1
import com.nokia.meego 1.0
(And hopefully they works almost as I'm excepting)
As I wrote on Opening Post I can do this using stock PR1.3 with little manual tweaking. But if using CSSU everything breaks and nothing works.


Originally Posted by marmistrz View Post
I think you should use a main.cpp with QmlApplicationViewer.
You mean tools/qml/qml.pro and main.cpp on package qt4-x11?

Originally Posted by marmistrz View Post
You can create the required files with QtCreator. Look at useragenttool source for reference
I'm not using QtCreator.
 

The Following User Says Thank You to AapoRantalainen For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#5
Originally Posted by AapoRantalainen View Post
Unfortunately, this time I'm not trying to upgrade any part of Fremantle. I'm planning to develop application which is using qml and importing these:
Code:
import Qt 4.7
import QtQuick 1.1
import QtMobility.location 1.0
import QtMobility.sensors 1.0
import QtMobility.systeminfo 1.2
import QtWebKit 1.0
import QtMultimediaKit 1.1
import com.nokia.meego 1.0
(And hopefully they works almost as I'm excepting)
As I wrote on Opening Post I can do this using stock PR1.3 with little manual tweaking. But if using CSSU everything breaks and nothing works.
com.nokia.meego is Qt Components. And these are, as previously said, buggy.
And using my approach you can easily use libqtm-12

Originally Posted by AapoRantalainen View Post
You mean tools/qml/qml.pro and main.cpp on package qt4-x11?
Nope. Something like that: http://meegoharmattandev.blogspot.co...iewer-and.html
(this bug is fixed now)
It's created by QtCreator, I have the latest version locally.
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 

The Following User Says Thank You to marmistrz For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 19:47.