Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Sailfish SDK version 1608 (2.0.2) Qt5 released

    Reply
    Page 17 of 29 | Prev | 7   15     16   17   18     19   27 | Next | Last
    marmistrz | # 161 | 2013-09-03, 16:23 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by marmistrz; 2013-09-03 at 16:25.

     
    rainisto | # 162 | 2013-09-04, 07:44 | Report

    Originally Posted by marmistrz View Post
    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.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to rainisto For This Useful Post:
    marmistrz, mikecomputing

     
    marmistrz | # 163 | 2013-09-13, 16:46 | Report

    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?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    marmistrz | # 164 | 2013-09-16, 08:54 | Report

    The solution was to define header like that
    Code:
    Dialog
    {
        id: root
        SilicaListView
        {
            header: DialogHeader
            {
                id: header
                acceptText: "Select font"
            }
            /**/
        }
    }

    Edit | Forward | Quote | Quick Reply | Thanks

     
    minimos | # 165 | 2013-09-18, 16:10 | Report

    From a tweet @JollaHQ:
    Originally Posted by
    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:
    Originally Posted by
    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>

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to minimos For This Useful Post:
    jalyst

     
    xerxes2 | # 166 | 2013-10-07, 18:40 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    MartinK | # 167 | 2013-10-07, 18:59 | Report

    Originally Posted by xerxes2 View Post
    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 ?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    xerxes2 | # 168 | 2013-10-07, 19:04 | Report

    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"

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by xerxes2; 2013-10-07 at 19:16.

     
    xerxes2 | # 169 | 2013-10-08, 12:25 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by xerxes2; 2013-10-08 at 12:38.
    The Following User Says Thank You to xerxes2 For This Useful Post:
    rcolistete

     
    rcolistete | # 170 | 2013-10-08, 13:54 | Report

    Originally Posted by xerxes2 View Post
    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.

    Originally Posted by xerxes2 View Post
    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.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by rcolistete; 2013-10-08 at 16:10.
    The Following 2 Users Say Thank You to rcolistete For This Useful Post:
    jalyst, xerxes2

     
    Page 17 of 29 | Prev | 7   15     16   17   18     19   27 | Next | Last
vBulletin® Version 3.8.8
Normal Logout