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)

marmistrz 2013-09-03 16:23

Re: Sailfish SDK Alpha Qt5 released
 
What's the difference between RowLayout from QtQuick.Layouts and Row from QtQuick 2.0? And what about QtQuick.Controls 1.0? Sailfish SDK indicates its presence but the emulator doesn't find the module installed.

rainisto 2013-09-04 07:44

Re: Sailfish SDK Alpha Qt5 released
 
Quote:

Originally Posted by marmistrz (Post 1371686)
Yep, I didn't copy main.cpp. If I didn't register the type, I couldn't use it at all :)

This is a workaround which might work at this case, but what if it wasn't a signleton object? Is there some special magic about non-singleton objects and destructors?

/edit: I tried to use the context property approach, but it says that settings is not defined:

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"));
    Settings settings_object;
    view->rootContext()->setContextProperty("settings", &settings_object);
   
    Sailfish::showView(view.data());

    return app->exec();
}

Guess it's because of too late setting the context property, but I have no idea how to fix it.

Yes, setContextProperty must be called before main.qml is loaded. Like this:

Code:

Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QGuiApplication> app(Sailfish::createApplication(argc, argv));

    QScopedPointer<QQuickView> view(Sailfish::createView());
    Settings settings_object;
    view->rootContext()->setContextProperty("settings", &settings_object);
    Sailfish::setView(view.data(), "main.qml");
   
    Sailfish::showView(view.data());

    return app->exec();
}

That way you have global settings-property that you can access from qml without need to import anything etc.

marmistrz 2013-09-13 16:46

Re: Sailfish SDK Alpha Qt5 released
 
Hi,

I'm trying to create a nice font picker, but I'm having problems with highlighting:

Code:

import QtQuick 2.0
import Sailfish.Silica 1.0
import Sailfish.Silica.theme 1.0

Dialog
{
    property string selectedFont
    DialogHeader
    {
        id: header
        acceptText: "Select font"
    }
    SilicaListView
    {
        anchors.top: header.bottom
        anchors.bottom: parent.bottom
        spacing: Theme.paddingSmall
        model: Qt.fontFamilies()
        delegate: ListItem
        {
            id: listItem
            contentHeight: 60
            width: parent.width
            Label
            {
                id: label
                text: modelData
                anchors.left: parent.left
                anchors.leftMargin: Theme.paddingLarge
                color: listItem.highlighted ? Theme.highlightColor : Theme.primaryColor
              //  color: Theme.primaryColor
                //height: 60
            }
            onHighlightedChanged: console.log(highlighted)
        }
        VerticalScrollDecorator {}
    }
}

I used the MenuPage.qml from component gallery as a reference. But the listItem is never highlighted. tried copying the delegate and still never highlighted. What am I doing wrong?

marmistrz 2013-09-16 08:54

Re: Sailfish SDK Alpha Qt5 released
 
The solution was to define header like that
Code:

Dialog
{
    id: root
    SilicaListView
    {
        header: DialogHeader
        {
            id: header
            acceptText: "Select font"
        }
        /**/
    }
}


minimos 2013-09-18 16:10

Re: Sailfish SDK Alpha Qt5 released
 
From a tweet @JollaHQ:
Quote:

Some minor updates to #SailfishOS SDK available, paving the way for future updates. Details and instructions here: https://lists.sailfishos.org/piperma...er/000738.html
and from the above mentioned details:
Quote:

We have now uploaded a minor update of Sailfish SDK, which will update
your SailfishOS SDK IDE (based on QtCreator), fix some issues in
examples, update documentation and bring updates to your SDK Build Engine.

We didn't change much and in fact this is paving way to a bigger update
coming soonish and making sure everything on the update flow works ok.

<continue with update instructions>

xerxes2 2013-10-07 18:40

Re: Sailfish SDK Alpha Qt5 released
 
So I was sniffing around in the emulator a bit looking for /etc/os-release but only found some older files detecting Mer, ie system-release. It seems as there is no way of properly detecting Sailfish atm.

MartinK 2013-10-07 18:59

Re: Sailfish SDK Alpha Qt5 released
 
Quote:

Originally Posted by xerxes2 (Post 1379203)
So I was sniffing around in the emulator a bit looking for /etc/os-release but only found some older files detecting Mer, ie system-release. It seems as there is no way of properly detecting Sailfish atm.

Is there lsb_release ? And if it is, what does:
Code:

lsb_release -a
say ?

xerxes2 2013-10-07 19:04

Re: Sailfish SDK Alpha Qt5 released
 
It also detects Mer.

Edit: And no /etc/vconsole.conf either. Adding it yourself works though, thankfully, as using a us layout with a eu/swedish keyboard is a real pita.

Code:

# /etc/vconsole.conf
KEYMAP="sv-latin1"


xerxes2 2013-10-08 12:25

Re: Sailfish SDK Alpha Qt5 released
 
Is there a way to upgrade to qt-5.1.x in the SDK? I've got pyqt-5.0.1 to build now but I got an error when import:
Code:

>>> from PyQt5 import QtQuick
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/lib/python2.7/site-packages/PyQt5/QtQml.so: undefined symbol: _ZN11QQmlPrivate10createIntoI13QPyQmlObject5EEvPv

More people got this error but I haven't seen a solution yet so thought I should try pyqt-5.1 too if possible.

Edit: I got a response on the pyqt mailing list that this should be fixed in pyqt-5.1 but that version doesn't build with qt-5.0.x.

Edit2: I'm not sure the response makes sense for Sailfish x86 though.
http://www.riverbankcomputing.com/pi...er/033293.html

rcolistete 2013-10-08 13:54

Re: Sailfish SDK Alpha Qt5 released
 
Quote:

Originally Posted by xerxes2 (Post 1379308)
Is there a way to upgrade to qt-5.1.x in the SDK?

Jolla said by Twitter that a new SDK release is coming shortly, possibly with Qt 5.1.

Quote:

Originally Posted by xerxes2 (Post 1379308)
I've got pyqt-5.0.1 to build now

Nice. You could share how you have built it and (after SDK update with Qt 5.1) publish to Mer-Project OBS.


All times are GMT. The time now is 02:53.

vBulletin® Version 3.8.8