![]() |
2013-09-04
, 07:44
|
Posts: 1,067 |
Thanked: 2,383 times |
Joined on Jan 2012
@ Finland
|
#162
|
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:
Guess it's because of too late setting the context property, but I have no idea how to fix it.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(); }
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(); }
The Following 2 Users Say Thank You to rainisto For This Useful Post: | ||
![]() |
2013-09-13
, 16:46
|
Posts: 3,328 |
Thanked: 4,476 times |
Joined on May 2011
@ Poland
|
#163
|
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 {} } }
![]() |
2013-09-16
, 08:54
|
Posts: 3,328 |
Thanked: 4,476 times |
Joined on May 2011
@ Poland
|
#164
|
Dialog { id: root SilicaListView { header: DialogHeader { id: header acceptText: "Select font" } /**/ } }
![]() |
2013-09-18
, 16:10
|
Posts: 646 |
Thanked: 1,124 times |
Joined on Jul 2010
@ Espoo, Finland
|
#165
|
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
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: | ||
![]() |
2013-10-07
, 18:40
|
|
Posts: 513 |
Thanked: 651 times |
Joined on Feb 2011
@ Sweden
|
#166
|
![]() |
2013-10-07
, 18:59
|
Posts: 1,548 |
Thanked: 7,510 times |
Joined on Apr 2010
@ Czech Republic
|
#167
|
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.
lsb_release -a
![]() |
2013-10-07
, 19:04
|
|
Posts: 513 |
Thanked: 651 times |
Joined on Feb 2011
@ Sweden
|
#168
|
# /etc/vconsole.conf KEYMAP="sv-latin1"
![]() |
2013-10-08
, 12:25
|
|
Posts: 513 |
Thanked: 651 times |
Joined on Feb 2011
@ Sweden
|
#169
|
>>> 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
The Following User Says Thank You to xerxes2 For This Useful Post: | ||
![]() |
2013-10-08
, 13:54
|
Posts: 1,269 |
Thanked: 3,961 times |
Joined on May 2011
@ Brazil
|
#170
|
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.