Reply
Thread Tools
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#161
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.
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here

Last edited by marmistrz; 2013-09-03 at 16:25.
 
Posts: 1,067 | Thanked: 2,383 times | Joined on Jan 2012 @ Finland
#162
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.
__________________
IRC: jonni@freenode
Sailfish: ¤ Qt5 SailfishTouchExample ¤ Qt5 MultiPointTouchArea Example ¤ ipaddress ¤ stoken ¤ Sailbox (Dropbox client) ¤
Harmattan: ¤ Presence VNC for Harmattan ¤ Live-F1 ¤ BTinput-terminal ¤ BabyLock ¤ BabyLock Trial ¤ QML TextTV ¤
Disclaimer: all my posts in this forum are personal trolling and I never post in any official capacity on behalf of any company.
 

The Following 2 Users Say Thank You to rainisto For This Useful Post:
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#163
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?
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 
Posts: 3,328 | Thanked: 4,476 times | Joined on May 2011 @ Poland
#164
The solution was to define header like that
Code:
Dialog
{
    id: root
    SilicaListView
    {
        header: DialogHeader
        {
            id: header
            acceptText: "Select font"
        }
        /**/
    }
}
__________________
If you want to support my work, you can donate by PayPal or Flattr

Projects no longer actively developed: here
 
Posts: 646 | Thanked: 1,124 times | Joined on Jul 2010 @ Espoo, Finland
#165
From a tweet @JollaHQ:
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:
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>
 

The Following User Says Thank You to minimos For This Useful Post:
xerxes2's Avatar
Posts: 513 | Thanked: 651 times | Joined on Feb 2011 @ Sweden
#166
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.
__________________
But the WM7 "horse" has a blood lineage tracing back to donkeys such as WM6.5, 6.1, 6.0, 5.1 that was fully neglected for too many years and Microsoft did sweet F all to maintain it (still running on Pocket IE4/6!!).
 
Posts: 1,548 | Thanked: 7,510 times | Joined on Apr 2010 @ Czech Republic
#167
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 ?
__________________
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)
 
xerxes2's Avatar
Posts: 513 | Thanked: 651 times | Joined on Feb 2011 @ Sweden
#168
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"
__________________
But the WM7 "horse" has a blood lineage tracing back to donkeys such as WM6.5, 6.1, 6.0, 5.1 that was fully neglected for too many years and Microsoft did sweet F all to maintain it (still running on Pocket IE4/6!!).

Last edited by xerxes2; 2013-10-07 at 19:16.
 
xerxes2's Avatar
Posts: 513 | Thanked: 651 times | Joined on Feb 2011 @ Sweden
#169
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
__________________
But the WM7 "horse" has a blood lineage tracing back to donkeys such as WM6.5, 6.1, 6.0, 5.1 that was fully neglected for too many years and Microsoft did sweet F all to maintain it (still running on Pocket IE4/6!!).

Last edited by xerxes2; 2013-10-08 at 12:38.
 

The Following User Says Thank You to xerxes2 For This Useful Post:
Posts: 1,269 | Thanked: 3,961 times | Joined on May 2011 @ Brazil
#170
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.
__________________
Python, C/C++, Qt and CAS developer. For Maemo/MeeGo/Sailfish :
Integral, Derivative, Limit - calculating mathematical integrals, derivatives and limits. SymPy - Computer Algebra System.
MatPlotLib - 2D & 3D plots in Python. IPython - Python interactive shell.
-- My blog about mobile & scientific computing ---
Sailfish : Sony Xperia X, Gemini, Jolla, Jolla C, Jolla Tablet, Nexus 4. Nokia N9, N900, N810.

Last edited by rcolistete; 2013-10-08 at 16:10.
 

The Following 2 Users Say Thank You to rcolistete For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 12:13.