Re: [SailfishDevel] A welcome dialog and pageStack's operation in progress.

2014-07-16 Thread J-P Nurmi
On Wed, Jul 16, 2014 at 11:25 PM, Matthew Vogt matthew.v...@jolla.com wrote:

 Hi, 'Page.status' is the correct property to watch for avoiding this problem.

 Here is an example of what you could do:

 import QtQuick 2.0
 import Sailfish.Silica 1.0

 ApplicationWindow {

 initialPage: Component {
 Page {
 anchors.fill: parent

 Label {
 anchors.centerIn: parent
 text: 'Main page'
 }

 property bool showSplash: true
 onStatusChanged: {
 if (status == PageStatus.Active  
 showSplash) {
 showSplash = false
 pageStack.push(splashPage)
 }
 }
 }
 }

 Component {
 id: splashPage

 Page {
 Label {
 anchors.centerIn: parent
 text: 'Splash page'
 }
 }
 }
 }

 Thanks,
 Matt


Hi Matt,

Notice that essentially the same problem occurs when a dialog/page is
triggered by an external event. User navigates the UI meanwhile eg. a
network event triggers a dialog = PageStack is busy so it just bails
out and user misses the dialog. As a workaround, waiting until
PageStack is no longer busy gets pretty ugly.

--
J-P Nurmi
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org


Re: [SailfishDevel] System clipboard and QApplication

2014-04-25 Thread J-P Nurmi
Hi,

See https://sailfishos.org/sailfish-silica/qml-sailfishsilica-clipboard.html

--
J-P Nurmi

On 25 Apr 2014, at 19:57, Samuli Silvius samuli.silv...@gmail.com wrote:

 Thanks a lot, the QML trick works great!
 
 -Samuli
 
 
 2014-04-24 9:16 GMT+03:00 Andrey Kozhevnikov coderusin...@gmail.com:
 use QGuiApplication or QCoreApplication. QApplication itself is deprecated.
 
 There is also dark side hack for using QML clipboard:
 
 TextEdit {
 id: clipboard
 visible: false
 function setClipboard(value) {
 text = value
 selectAll()
 copy()
 }
 function getClipboard() {
 text = 
 paste()
 return text
 }
 }
 
 24.04.2014 12:03, Samuli Silvius пишет:
 Hi,
 
 I use system clipboard in QML app with small C++ adapter
 
 #ifndef QMLCLIPBOARDADAPTER_H
 #define QMLCLIPBOARDADAPTER_H
 #include QApplication
 #include QClipboard
 #include QObject
 class QmlClipboardAdapter : public QObject
 {
 Q_OBJECT
 public:
 explicit QmlClipboardAdapter(QObject *parent = 0) : QObject(parent) {
 clipboard = QApplication::clipboard();
 }
 Q_INVOKABLE void setText(QString text){
 clipboard-setText(text, QClipboard::Clipboard);
 clipboard-setText(text, QClipboard::Selection);
 }
 private:
 QClipboard *clipboard;
 };
 #endif // QMLCLIPBOARDADAPTER_H
 
 And it's working fine. But this requires that I have to add 
 
 QT += widgets
 
 to .pro file and seems it's not supported by Jolla Harbour as also Jolla SDK 
 RPM validation gives me an errors. I have updated the SDK to the latest.
 
 ERROR [/usr/share/harbour-jolla2gether/qml/harbour-jolla2gether.qml] Import 
 'QmlClipboardAdapter 1.0' is not allowed
 ERROR [/usr/bin/harbour-jolla2gether] Cannot link to shared library: 
 libQt5Widgets.so.5
 
 
 Is there are way around this?
 
 Br
 -Samuli
 
 
 ___
 SailfishOS.org Devel mailing list
 
 
 
 ___
 SailfishOS.org Devel mailing list
 
 ___
 SailfishOS.org Devel mailing list

___
SailfishOS.org Devel mailing list

Re: [SailfishDevel] Why do I get binding loop error?

2014-03-24 Thread J-P Nurmi

On 24 Mar 2014, at 22:24, Ragnar Kurm rag...@waalaskala.com wrote:

 flickable.contentHeight: column.height
 
 Thank you Andrei,
 but it does not help :(
 
 I assumed that your code was meant like this:
 SilicaFlickable { contentHeight: column.height; Column { id: column ...} }
 
 Even when set explicitly
 SilicaFlickable { contentY: 0 ... }
 still get the loop.
 
 I wonder how/where to debug this?
 
 This did not help me either:
 SailfishOS/mersdk/targets/SailfishOS-i486-x86/usr/lib/qt5/qml/Sailfish/Silica/SilicaFlickable.qml
 No mention of contentY, which loops.
 
 Thank you,
 Ragnar
 
 
 I'm experiencing the same in a slightly different context (a SilicaListView 
 with a ContextMenu dynamically created and on shown after a long press on 
 each ListItem delegate). To me it seems related to the ContextMenu item, 
 when it becomes visible and it pushes down the content below.
 
 
 Hello,
 
 I have problems with an error:
 Test.qml:7: QML SilicaFlickable: Binding loop detected for property 
 contentY
 
 What do I miss?
 
 Ragnar
 
 
 
 import QtQuick 2.0
 import Sailfish.Silica 1.0
 
 Dialog {
 id: dialog
 SilicaFlickable {
 Column {
 ComboBox {
 label: Label
 width: dialog.width
 menu: ContextMenu {
 width: dialog.width
 MenuItem { text: Item 1 }
 }
 }
 }
 }
 }
 

a) give the flickable a valid geometry, and
b) specify the content size.

--
J-P Nurmi

___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] QML C++ Integration not working in Sailfish

2014-02-25 Thread J-P Nurmi
On Tue, 2014-02-25 at 06:06 -0800, antonio.cano.go...@ovi.com wrote:
 Hi,
 
 
 I am trying to do a simple Sailfish aplication that uses a c++
 library.  I try to connect my qml code with the C++ code.
 
 
 First I create QObject extended library:
 
 
 
 #ifndef BLOOMFILTERS_H
 #define BLOOMFILTERS_H
 
 
 #include QObject
 #include svn/bloom-read-only/bloom_filter.hpp
 
 class Bloomfilters : public QObject
 {
 Q_OBJECT
 
 
 public:
 Q_INVOKABLE  void generateFilterInvokable2() const ;
 Q_INVOKABLE  void generateFilterInvokable(const QString cadenaK,
 const QString cadenaM) const ;
 
 
 explicit Bloomfilters(QObject *parent = 0);
 
 void generateFilter() ;
 
 Q_INVOKABLE void insertElement(const QString cadena) ;
 
 Q_INVOKABLE bool checkElement(const QString cadena) ;
 
 
 
 
 signals:
 
 
 public slots:
 
 private:
 bloom_parameters _parameters ;
 bloom_filter _filter;
 bool _filter_charged;
 QString _k;
 };
 
 #endif // BLOOMFILTERS_H
 
 
 
 
 
 
 An I try to connect this with my sailfish application with the code:
 
 
 QGuiApplication *app = SailfishApp::application(argc, argv);
 QQuickView *view = SailfishApp::createView();
 Bloomfilters  * bloomfilters = new Bloomfilters();
 view-rootContext()-setContextProperty(Bloomfilters,
 bloomfilters);
 view-setSource(SailfishApp::pathTo(qml/bloomfilter.qml));
 view-showFullScreen();
 return app-exec();
 
 
 
 But this is not working.
 
 
 Someone have any idea about what am I doing wrong?
 

Hi,

What does this is not working mean? In what way is it not working?

-- 
J-P Nurmi


___
SailfishOS.org Devel mailing list


Re: [SailfishDevel] How can I deploy application without qml file

2014-02-17 Thread J-P Nurmi
On Mon, Feb 17, 2014 at 2:24 PM, itviewer itvie...@jolladev.net wrote:

  Hi all,

 In my application I don't want the qml file to be deployed.
 I know I should use the Qt resource system.

 After added all qml files to the .qrc file and rebuild the application,

 It seems that all qml files are still build in to the rpm file.

 Is it a sdk's bug?
 How can I deploy rpm application without qml file?

 Hi,

Not a bug but an (annoying) feature. :) You probably have CONFIG +=
sailfishapp in your .pro. That will automatically add the qml subfolder to
install rules (
https://github.com/sailfish-sdk/libsailfishapp/blob/master/data/sailfishapp.prf#L40).
A trivial solution is to rename the qml folder to something else.

--
J-P Nurmi
___
SailfishOS.org Devel mailing list