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)

rainisto 2013-08-23 07:24

Re: Sailfish SDK Alpha Qt5 released
 
Quote:

Originally Posted by marmistrz (Post 1368696)
Btw. if a textfield is on the bottom, the vkb covers it whole. Will it be fixed in the final release?

When using right silica components, its autoscrolled to visible area when focused, yes.

marmistrz 2013-08-23 08:06

Re: Sailfish SDK Alpha Qt5 released
 
Quote:

Originally Posted by rainisto (Post 1368864)
When using right silica components, its autoscrolled to visible area when focused, yes.

So, is it my mistake that it doesn't scroll, or do I have to wait for a more mature release of Silica? :)

rcolistete 2013-08-26 05:16

Re: Sailfish SDK Alpha Qt5 released
 
Quote:

Originally Posted by youngcalihottie (Post 1368671)
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.

You are rigth. The solution is to use "scp". I've updated the 1st post, see 3rd tip.

marmistrz 2013-08-27 13:45

Re: Sailfish SDK Alpha Qt5 released
 
Please add to the OP:

Where are the emulator filesystem files?

(when ssh-ed to the emulator) /srv/mer/targets/<target name>

marmistrz 2013-08-29 18:00

Re: Sailfish SDK Alpha Qt5 released
 
I'm trying to see how the separator works. I included it into the Column, and defined it like that

Code:

        Separator { color: "red" }
but no changes visible. What am I doing wrong?

marmistrz 2013-08-31 15:32

Re: Sailfish SDK Alpha Qt5 released
 
Hi,

I have a problem with exposing a C++ object to QML. It inherits QSettings,

Code:

class Settings : public QSettings
{
    Q_OBJECT
    /**/
public:
    explicit Settings() : QSettings("Marcin Mielniczuk", "BigText") {}
    ~Settings() { qDebug() << "Dying"; }

    /**/
};

I noticed that the destructor isn't called at all. (there's not destructor output)

I create the object like that:
Code:

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

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

What am I doing wrong?

rainisto 2013-09-02 07:19

Re: Sailfish SDK Alpha Qt5 released
 
Quote:

Originally Posted by marmistrz (Post 1370867)
What am I doing wrong?

http://qt-project.org/doc/qt-5.0/qtq...finetypes.html

marmistrz 2013-09-02 18:24

Re: Sailfish SDK Alpha Qt5 released
 
Quote:

Originally Posted by rainisto (Post 1371238)

I'm doing everything like in the doc page... (or do I just think I'm doing like that?)

rainisto 2013-09-03 11:05

Re: Sailfish SDK Alpha Qt5 released
 
At least your example copypaste was lacking qmlRegisterType and import statements in qml for the Settings type. Or you just didn't copypaste all your code.

And if your settings class is a singleton, like settings usually are, you most likely want to use setContextProperty instead.

marmistrz 2013-09-03 15:23

Re: Sailfish SDK Alpha Qt5 released
 
Quote:

Originally Posted by rainisto (Post 1371594)
At least your example copypaste was lacking qmlRegisterType and import statements in qml for the Settings type. Or you just didn't copypaste all your code.

And if your settings class is a singleton, like settings usually are, you most likely want to use setContextProperty instead.

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.


All times are GMT. The time now is 15:50.

vBulletin® Version 3.8.8