maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   Sailfish SDK version 1608 (2.0.2) Qt5 released (https://talk.maemo.org/showthread.php?t=89294)

MartinK 2013-08-18 14:18

Re: Sailfish SDK Alpha Qt5 released
 
Quote:

Originally Posted by mikecomputing (Post 1367912)
just a notice but it seems like qt5.2 will be releases in november. Since nokia wiped qt it seems like qtdevs has gone nuts with releases :p

Also checkout the newly supported mobile platforms:
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.

shmerl 2013-08-18 17:22

Re: Sailfish SDK Alpha Qt5 released
 
Picking up pace is good. It was really unusual that Nokia let Qt go so easily. Knowing their latest trollish attitude (with attacking VP8 codec with patents for example), they could easily create a lot of problems for Qt.

marmistrz 2013-08-21 08:41

Re: Sailfish SDK Alpha Qt5 released
 
How can I access all the icons that can be used in Sailfish apps? e.g. icon-cover-pause

================

In my Sailfish app, my main.cpp looks like that

Code:

#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();
}

And in main.qml I import the module like that:

Code:

import QtQuick 2.0
import Sailfish.Silica 1.0
import BigText 1.0
import "pages"

ApplicationWindow
{
    initialPage: MainPage { }
    Settings {id: settings}
}

The error is:
Code:

file:///opt/sdk/BigText/usr/share/BigText/main.qml:3:1: module "BigText" is not installed
    import BigText 1.0
    ^

QtCreator doesn't show up an error while editing. Such calls were 100% valid in com.nokia.meego.

What am I doing wrong?

thanks

rainisto 2013-08-21 11:52

Re: Sailfish SDK Alpha Qt5 released
 
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.

marmistrz 2013-08-21 12:33

Re: Sailfish SDK Alpha Qt5 released
 
Quote:

Originally Posted by rainisto (Post 1368521)
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.

Adding <QQmlEngine> fixes nothing. Or should the 5-arg qmlRegisterType be used for QtQuick2. Or do I have to do something else than qmlRegisterType to register a QObject-inheriting class in QML.

Code:

#include <QGuiApplication>
#include <QQuickView>
#include <QQmlEngine>
#include <QtQml>

Where exactly are the icons? (They aren't in /usr/share/themes)

/edit: when going to sb2, it's indeed there. How can I copy it onto local hard disk?

rainisto 2013-08-22 07:37

Re: Sailfish SDK Alpha Qt5 released
 
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? :)

marmistrz 2013-08-22 08:24

Re: Sailfish SDK Alpha Qt5 released
 
Quote:

Originally Posted by rainisto (Post 1368656)
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? :)

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();
}

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)

youngcalihottie 2013-08-22 10:52

Re: Sailfish SDK Alpha Qt5 released
 
Quote:

Originally Posted by rcolistete (Post 1325075)
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".

I can only get files from my PC to show in the emulator. How do I move something from the emulator to the PC? I'm being told the folder is read only.

Thanks to anyone who can help.

rainisto 2013-08-22 11:14

Re: Sailfish SDK Alpha Qt5 released
 
Quote:

Originally Posted by marmistrz (Post 1368660)
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();
}

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));
    qmlRegisterType<Settings>("BigText", 1, 0, "Settings");
    QScopedPointer<QQuickView> view(Sailfish::createView("main.qml"));
   
    Sailfish::showView(view.data());

    return app->exec();
}

Just double checking that you already tried to register before createView?

You can use setContextProperty just fine when properties change on the fly and make UI respond to changes. Nothing prevents that.

marmistrz 2013-08-22 12:41

Re: Sailfish SDK Alpha Qt5 released
 
Well, indeed... create != show ;P Bad habits from Qt 4.7 ;)
Sorry for polling the thread ;P and thanks!

Btw. if a textfield is on the bottom, the vkb covers it whole. Will it be fixed in the final release?


All times are GMT. The time now is 05:32.

vBulletin® Version 3.8.8