10 Jan 2011 13:24
Re: QML support in Meego touch Framework
With such approach you can do very little with meegotouch.
It's better to do it like this:
MApplication a(argc, argv);
QDeclarativeEngine engine;
MApplicationWindow window;
window.show();
MApplicationPage *page = new MApplicationPage();
page->setPannable(false);
page->appear();
QGraphicsObject *content = loadQmlComponent<QGraphicsObject>(engine, "myqmlfile.qml");
MWidget * centralWidget = new MWidget;
content->setParentItem(centralWidget);
centralWidget->setMinimumSize(864, 400);
page->setCentralWidget(centralWidget);
return a.exec();
To use meegotouch components from qml you would need to register them like this:
QML_DECLARE_TYPE(MButton)
..
qmlRegisterType<MButton>("com.nokia.meegotouch.native", 0, 20, "MButton");
Then in qml you could write like this:
import com.nokia.meegotouch.native 0.20
Item {
id: rootItem
MButton {
}
}
...
:sergiy
On Jan 10, 2011, at 1:27 PM, ext Apte Abhijit (Nokia-MS/Bangalore) wrote:
> Hi,
>
> Yes, you can verify the UI using qmlviewer, but inorder to integrate your QML into Qt C++ try something like,
>
> mView = new QDeclarativeView();
> mContext = mView->rootContext();
> mContext->setContextProperty( "controller", this );
> mView->setSource( QUrl( "qrc:/qml/myfirstqmlapp.qml" ) );
> mView->setGeometry( QRect( 0, 0, 800, 480 ) );
>
> Also you've got to write a qrc file (resource file).
>
> Rgds
> -Abhi
>
> On 01/10/2011 04:40 PM, ext Karoliina.T.Salminen@... wrote:
>> Hello,
>>
>> Just a little comments: Applications are not run with qmlviewer!
>> Qmlviewer is a debugging app and not actual application framework!
>>
>> Br,
>> Karoliina
>>
>> ---
>> Karoliina Salminen
>> Technical Product Owner, MeeGo Computers
>> Startup Wizard, Cherry, Settings, Settings Applets, User Guide
>> Ruoholahti B5 open space Tel. +358 50 5686514
>> ----
>> Twitter: <at> karoliinasalmin
>> Blog: http://karoliinasalminen.wordpress.com
>>
>>
>> From: ext yfengying<fengying765@...<mailto:fengying765@...>>
>> Date: Mon, 10 Jan 2011 18:30:14 +0800
>> To:<johnpratss@...<mailto:johnpratss@...>>
>> Cc:<meego-touch-dev@...<mailto:meego-touch-dev@...>>
>> Subject: Re: [MeeGo-touch-dev] QML support in Meego touch Framework
>>
>> Hi John:
>>
>> It was supported by Meegotouch framework,
>>
>> after #zypper install qt-qmlviewer , you can launch the qml project as following:
>>
>> #qmlviewer *.qml
>>
>> BRs
>>
>> sophia
>>
>> From: john pratss<mailto:johnpratss@...>
>> Sent: Monday, January 10, 2011 6:15 PM
>> To: meego-touch-dev@...<mailto:meego-touch-dev@...>
>> Subject: [MeeGo-touch-dev] QML support in Meego touch Framework
>>
>> Hi,
>>
>> Is there a support of QML in Meegotouch framework.
>>
>> Thanks,
>> John.
>>
>> ________________________________
>>
>> _______________________________________________
>> MeeGo-touch-dev mailing list
>> MeeGo-touch-dev@...<mailto:MeeGo-touch-dev@...>
>> http://lists.meego.com/listinfo/meego-touch-dev
>> _______________________________________________ MeeGo-touch-dev mailing list
MeeGo-touch-dev@...<mailto:MeeGo-touch-dev@...>
http://lists.meego.com/listinfo/meego-touch-dev
>>
>>
>>
>> _______________________________________________
>> MeeGo-touch-dev mailing list
>> MeeGo-touch-dev@...
>> http://lists.meego.com/listinfo/meego-touch-dev
> _______________________________________________
> MeeGo-touch-dev mailing list
> MeeGo-touch-dev@...
> http://lists.meego.com/listinfo/meego-touch-dev
RSS Feed