![]() |
2013-08-18
, 17:22
|
Posts: 1,298 |
Thanked: 2,277 times |
Joined on May 2011
|
#142
|
![]() |
2013-08-21
, 08:41
|
Posts: 3,328 |
Thanked: 4,476 times |
Joined on May 2011
@ Poland
|
#143
|
#include <QGuiApplication> #include <QQuickView> #include <QtQml> #include "sailfishapplication.h" #include "settings.h" Q_DECL_EXPORT int main(int argc, char *argv[]) { QScopedPointer<QGuiApplication> app(Sailfish::createApplication(argc, argv)); QScopedPointer<QQuickView> view(Sailfish::createView("main.qml")); qmlRegisterType<Settings>("BigText", 1, 0, "Settings"); Sailfish::showView(view.data()); return app->exec(); }
import QtQuick 2.0 import Sailfish.Silica 1.0 import BigText 1.0 import "pages" ApplicationWindow { initialPage: MainPage { } Settings {id: settings} }
file:///opt/sdk/BigText/usr/share/BigText/main.qml:3:1: module "BigText" is not installed import BigText 1.0 ^
![]() |
2013-08-21
, 11:52
|
Posts: 1,067 |
Thanked: 2,383 times |
Joined on Jan 2012
@ Finland
|
#144
|
The Following User Says Thank You to rainisto For This Useful Post: | ||
![]() |
2013-08-21
, 12:33
|
Posts: 3,328 |
Thanked: 4,476 times |
Joined on May 2011
@ Poland
|
#145
|
marmistrz are you trying to use qmlRegisterType from QtQuick1 vs QtQuick2. Atleast I dont see you including #include <QQmlEngine>
http://qt-project.org/forums/viewthread/28488
And icons you can easily find in filesystem if you login.
#include <QGuiApplication> #include <QQuickView> #include <QQmlEngine> #include <QtQml>
![]() |
2013-08-22
, 07:37
|
Posts: 1,067 |
Thanked: 2,383 times |
Joined on Jan 2012
@ Finland
|
#146
|
The Following User Says Thank You to rainisto For This Useful Post: | ||
![]() |
2013-08-22
, 08:24
|
Posts: 3,328 |
Thanked: 4,476 times |
Joined on May 2011
@ Poland
|
#147
|
If your not able to get qmlRegisterType working, then you can always use setContextProperty().
And ofcourse you have tested to move qmlRegisterType line before creating the view? Since otherwise it tries to import things that dont exist yet?
Q_DECL_EXPORT int main(int argc, char *argv[]) { QScopedPointer<QGuiApplication> app(Sailfish::createApplication(argc, argv)); QScopedPointer<QQuickView> view(Sailfish::createView("main.qml")); qmlRegisterType<Settings>("BigText", 1, 0, "Settings"); Sailfish::showView(view.data()); return app->exec(); }
![]() |
2013-08-22
, 10:52
|
Posts: 58 |
Thanked: 13 times |
Joined on Jan 2010
@ Los Angeles
|
#148
|
3) How do I copy files between host PC and Sailfish SDK Emulator ?
The host PC folder "~/SailfishOS/vmshare/" is shared to "/etc/mersdk/share/" in Sailfish Emulator. So you can copy files and folders there. Be careful to not delete the folder "ssh" and file "devices.xml".
![]() |
2013-08-22
, 11:14
|
Posts: 1,067 |
Thanked: 2,383 times |
Joined on Jan 2012
@ Finland
|
#149
|
There are situations where setContextProperty won't be an option (when the properties change on the fly and the UI has to respond to the changes)Code:Q_DECL_EXPORT int main(int argc, char *argv[]) { QScopedPointer<QGuiApplication> app(Sailfish::createApplication(argc, argv)); QScopedPointer<QQuickView> view(Sailfish::createView("main.qml")); qmlRegisterType<Settings>("BigText", 1, 0, "Settings"); Sailfish::showView(view.data()); return app->exec(); }
Q_DECL_EXPORT int main(int argc, char *argv[]) { QScopedPointer<QGuiApplication> app(Sailfish::createApplication(argc, argv)); qmlRegisterType<Settings>("BigText", 1, 0, "Settings"); QScopedPointer<QQuickView> view(Sailfish::createView("main.qml")); Sailfish::showView(view.data()); return app->exec(); }
The Following User Says Thank You to rainisto For This Useful Post: | ||
![]() |
2013-08-22
, 12:41
|
Posts: 3,328 |
Thanked: 4,476 times |
Joined on May 2011
@ Poland
|
#150
|
Sailfish, Android, BB10, Tizen, Ubuntu-Touch, WinRT, iOS,...
Not really possible until the conflict of interest caused by Nokia owning Qt & having their own mobile platform/s at the same time.
modRana: a flexible GPS navigation system
Mieru: a flexible manga and comic book reader
Universal Components - a solution for native looking yet component set independent QML appliactions (QtQuick Controls 2 & Silica supported as backends)