Re: [Interest] Qt installer from console

2018-09-16 Thread Ben Lau
Hi Roman,

You may try my extract-qt-installer script at https://github.com/benlau/qtci

Usage:

 #Fetch all avaialble packages
extract-qt-installer --list-packages online_installer.run

#Installation
QT_CI_PACKAGES="qt.qt5.5110.gcc_64,qt.qt5.5110.android_armv7"
extract-qt-installer
online_installer.run absolute_installation_path




On Sat, 15 Sep 2018 at 17:27, Roman Wüger  wrote:

> Hi,
>
> I have Ubuntu server 18.04 Installed and wanted to install Qt with the
> online installer. Is this somehow possible. I thought it was possible in
> the past if I remember correctly.
>
> Thanks in advance
> Regards Roman
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to get instance of qml singleton on C++ side

2018-01-14 Thread Ben Lau
You may take this piece of code as an example:

https://github.com/benlau/quickflux/blob/master/qfappdispatcher.cpp#L51

On 14 January 2018 at 17:09, Лагнер, Сергей  wrote:

> Hello all.
> I have two classes registered as qml singletons.
>
>
> QObject * First::create(QQmlEngine*, QJSEngine*) {
> return new First();
> }
>
> QObject * Second::create(QQmlEngine*, QJSEngine*) {
> return new Second();
> }
>
> qmlRegisterSingletonType("com.example", 1, 0, "First",
> ::create);
> qmlRegisterSingletonType("com.example", 1, 0, "Second",
> ::create);
>
>
>
> Now I'd like to have an access to one of them from another.
> For example
>
> void Second::method() {
> // I need First * instance here
> }
>
> Is there any way to get qml singleton instance on C++ side, from
> QQmlEngine or something?
>
> ---
> Have a nice day.
> Sergey
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Milo Code Database - kickstart your projects easily

2017-09-16 Thread Ben Lau
Hi Tomasz,

It is cool. It is very surprising to find that it has a template for a
barcode scanner.

Do you have the plan to make it works with Qt Creator directly? Such that
it could create a project by File -> New File or Project -> Milo Code
Database -> x


On 8 September 2017 at 15:14, Tomasz Siekierda  wrote:

> Hi Qt!
>
> We've just released Milo Code Database: a set of small, useful helper
> classes
> for Qt, easy to include and use - plus a scaffolding for new projects we
> call
> the New Project Template. At Milo, we use them in many of our projects
> to speed up development, and we figured they may be useful to the community
> as well.
>
> MCDB comes in 2 forms:
>
> 1. Installer - which helps to set up a new project in just a few seconds
> (with
> scaffolding for Qt app, documentation, CI integration, versioning, config,
> logger, and more). It can even set up a git repo and do the initial commit
> for
> you :-)
> 2. Set of independent git repos, easy to clone / download / use as
> submodule.
>
> So, what are the goodies?
>
> * New project template - template for all new Qt projects (QML and
> Widgets).
> Contains a scaffolding for Qt app with documentation, tests, resources etc.
> * MScripts - scripts for integration with GitLab CI, Mattermost, versioning
> scripts for all platforms (including git SHA), and more
> * MConfig - a small class which helps storing user app settings and
> configuration
> * MLog - small but powerful log class, with full categorized logging
> support
> * MRestAPI - handy set of base classes for talking with REST web servers
> * MBarcodeScanner - small helper class that allows to scan barcodes and QR
> codes
> using QZXing library
> * MCharts - implements some simple yet meaningful and eye friendly charts
> to
> display data
> * MSentry - remote logger support (Sentry/ Raven). Easy to turn on and
> off, just
> with a config switch
> * MCrypto - AES module, containing simple and convenient API, based on
> OpenSSL
> and it has a fallback if OSSL is not available
>
> License?
>
> MIT. We are actually open to other licenses, too, if somebody thinks that
> MIT
> is not proper in this case.
>
> Where can I get it?
>
> MCDB installers (Linux and Windows):
> https://seafile.milosolutions.com/d/2c50614e1e/
> MCDB docs are available online:
> https://docs.milosolutions.com/milo-code-db/main/
> And all submodules are listed and documented here:
> https://docs.milosolutions.com/milo-code-db/main/subprojects.html
> Each module's source code is on GitHub: https://github.com/milosolutions
>
> Contributing
>
> We're open to any comments, critique, pull requests etc. We can also help
> if
> any piece of the documentation is unclear. It's all being constantly
> updated and
> we're happy to get some external input.
>
> Feel free to reach me at sierd...@gmail.com or more officially at
> ppm...@milosolutions.com
>
> Cheerio,
> sierdzio
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Transparent titlebar in macOS (QTBUG-61332)

2017-07-22 Thread Ben Lau
When I develop Lanto ( http://e-fever.net/lanto ), I got the same issue. I
don't have a solution to fix it. Instead, I use a "fake window controls" -
implement the max/min buttons by QML.

On 17 July 2017 at 17:36, Benjamin B  wrote:

> Hello,
>
> I reported a bug recently about not being able to create a window with a
> transparent titlebar in Qt Quick under macOS 10.10+ (
> https://bugreports.qt.io/browse/QTBUG-61332).
>
> It didn't attracted many interests, so I may take a look at it myself, if
> I could know approximately where to start. Has anyone any idea how to fix
> it, or a starting point?
>
> Thanks,
>
> Best regards,
> Benjamin
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Headless Install of Qt using a JavaScript File

2017-07-06 Thread Ben Lau
I check the package list from the directory of download.qt.io

Example:
https://download.qt.io/online/qtsdkrepository/mac_x64/desktop/qt5_55/




On 6 July 2017 at 22:32, Michael Jackson 
wrote:

> I am updating our script file for installing Qt 5.9.1 in an automated
> fashion. We do this by calling the installer with the --script argument.
> Generally works great for the default install. I would like to customize
> the install to remove some of the components. At one point I had code like
> this in my .js file:
>
> widget.deselectComponent("qt.55.qtquick1");
> widget.deselectComponent("qt.55.qtscript");
> widget.selectComponent("qt.56.qtwebengine");
>
> What values do I use for Qt 5.9.x?
>
> Is there a way to find out what the possible values are? I tried guessing
> at them but what I think are obvious ideas did not work. I want to only
> install qtwebengine and the macOS component. I don't need the iOS or
> Android or any of the "TP" components.
>
> I tried looking through the download.qt.io website by hand looking for a
> meta.xml file or something like that.
>
> Any help is much appreciated.
>
>
> --
> Michael A. Jackson
> BlueQuartz Software, LLC
> [e]: mike.jack...@bluequartz.net
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QFuture, QAsync? Coroutines, Generators, Promises, Futures...

2017-03-24 Thread Ben Lau
On 22 March 2017 at 16:25, Elvis Stansvik <elvst...@gmail.com> wrote:

> 2017-03-22 8:54 GMT+01:00 Ben Lau <xben...@gmail.com>:
> >
> >
> > On 31 December 2016 at 21:10, Ben Lau <xben...@gmail.com> wrote:
> >>
> >>
> >>
> >> On 28 December 2016 at 16:36, Petar Koretić <petar.kore...@gmail.com>
> >> wrote:
> >>>
> >>>
> >>>
> >>> On Wed, Dec 28, 2016 at 4:51 AM, Ben Lau <xben...@gmail.com> wrote:
> >>>>
> >>>>
> >>>>
> >>>> On 28 December 2016 at 05:50, Petar Koretić <petar.kore...@gmail.com>
> >>>> wrote:
> >>>>>
> >>>>> Hi all!
> >>>>>
> >>>>> In the wild people are doing all kinds of different things with Qt on
> >>>>> the network side. And there are some obvious issues with that given
> the
> >>>>> "callback" nature of Qt networking code.
> >>>>>
> >>>>> One can see different examples of people over the years dealing with
> >>>>> that:
> >>>>>
> >>>>> http://cukic.co/2016/01/17/asynqt-framework-making-qfuture-useful
> >>>>> https://github.com/KDE/kasync
> >>>>> http://qasync.henrikhedberg.com
> >>>>> https://github.com/mhogomchungu/tasks
> >>>>> https://gist.github.com/legnaleurc/1038309
> >>>>>
> >>>>> Since we are also using Qt a lot on the server side I'm curious what
> is
> >>>>> the progress from the Qt side on that given that coroutines will
> come to C++
> >>>>> (http://en.cppreference.com/w/cpp/experimental)
> >>>>>
> >>>>> We were using Boost and as we were using Qt for clients decided we
> >>>>> could also do server parts in Qt as well. This is all fine and I
> enjoyed it,
> >>>>> but boost has futures, promises and coroutines as well, which is
> nice, since
> >>>>> we also have backends in Node.js where we employ identical patterns.
> >>>>>
> >>>>> So I've been waiting for 2 years now to see what will come up from Qt
> >>>>> and I don't see much about that changing. Heck, QAsync tackled this
> in 2011.
> >>>>> Will Qt "embrace" coroutines from standard? Will they come up with
> >>>>> something of their own? Should we abandon Qt for networking? Should
> we use
> >>>>> something of our own?
> >>>>>
> >>>>> One possible way currently is to use QtConcurrent (badly I guess) and
> >>>>> wrap everything into QtConcurrent::run, which, for example, for
> >>>>> QNetworkRequest means first converting it to sync code using local
> event
> >>>>> loop which is again not recommended.
> >>>>>
> >>>>
> >>>> Why you think it is not recommended?
> >>>>
> >>>
> >>> This was once on
> >>> http://developer.nokia.com/community/wiki/How_to_wait_
> synchronously_for_a_Signal_in_Qt
> >>> Local QEventloop may cause out of control recursion or deadlocks in
> some
> >>> cases. Whenever I had idea to use it, nobody recommended it. Quick
> google
> >>> search now will tell you the same.
> >>>
> >>> Nevertheless, for example, QNetworkRequest is explicitly asynchronous
> >>> while QSqlDatabase is explicitly synchronous. I'm just expecting that
> >>> somebody is doing the same these days with Qt and want to improve on
> that
> >>> given that C++ itself will get "async" support so I want to avoid any
> >>> duplication from my side. I'm not talking about something new, just
> asking
> >>> if there are any plans in that direction.
> >>>
> >>>>>
> >>>>>
> >>
> >>
> >> I think a topic is not well discussed do not mean it is not
> recommended. I
> >> am using QtConcurrent for handling asynchronous task. So far I have
> >> encountered deadlock issue only once. It happen when the application
> quit
> >> but the task is not finished yet.
> >>
> >> Coroutine should be a good solution for many problems. I may switch to
> >> coroutine if the task is not CPU intensive.  But unfortunately that it
> is
> >> not available in Qt yet. So user need an alternative solu

Re: [Interest] QFuture, QAsync? Coroutines, Generators, Promises, Futures...

2017-03-22 Thread Ben Lau
On 31 December 2016 at 21:10, Ben Lau <xben...@gmail.com> wrote:

>
>
> On 28 December 2016 at 16:36, Petar Koretić <petar.kore...@gmail.com>
> wrote:
>
>>
>>
>> On Wed, Dec 28, 2016 at 4:51 AM, Ben Lau <xben...@gmail.com> wrote:
>>
>>>
>>>
>>> On 28 December 2016 at 05:50, Petar Koretić <petar.kore...@gmail.com>
>>> wrote:
>>>
>>>> Hi all!
>>>>
>>>> In the wild people are doing all kinds of different things with Qt on
>>>> the network side. And there are some obvious issues with that given the
>>>> "callback" nature of Qt networking code.
>>>>
>>>> One can see different examples of people over the years dealing with
>>>> that:
>>>>
>>>> http://cukic.co/2016/01/17/asynqt-framework-making-qfuture-useful
>>>> https://github.com/KDE/kasync
>>>> http://qasync.henrikhedberg.com
>>>> https://github.com/mhogomchungu/tasks
>>>> https://gist.github.com/legnaleurc/1038309
>>>>
>>>> Since we are also using Qt a lot on the server side I'm curious what is
>>>> the progress from the Qt side on that given that coroutines will come to
>>>> C++ (http://en.cppreference.com/w/cpp/experimental)
>>>>
>>>> We were using Boost and as we were using Qt for clients decided we
>>>> could also do server parts in Qt as well. This is all fine and I enjoyed
>>>> it, but boost has futures, promises and coroutines as well, which is nice,
>>>> since we also have backends in Node.js where we employ identical patterns.
>>>>
>>>> So I've been waiting for 2 years now to see what will come up from Qt
>>>> and I don't see much about that changing. Heck, QAsync tackled this in 
>>>> 2011.
>>>> Will Qt "embrace" coroutines from standard? Will they come up with
>>>> something of their own? Should we abandon Qt for networking? Should we use
>>>> something of our own?
>>>>
>>>> One possible way currently is to use QtConcurrent (badly I guess) and
>>>> wrap everything into QtConcurrent::run, which, for example, for
>>>> QNetworkRequest means first converting it to sync code using local event
>>>> loop which is again not recommended.
>>>>
>>>>
>>> Why you think it is not recommended?
>>>
>>>
>> This was once on http://developer.nokia.com/com
>> munity/wiki/How_to_wait_synchronously_for_a_Signal_in_Qt
>> Local QEventloop may cause out of control recursion or deadlocks in some
>> cases. Whenever I had idea to use it, nobody recommended it. Quick google
>> search now will tell you the same.
>>
>> Nevertheless, for example, QNetworkRequest is explicitly asynchronous
>> while QSqlDatabase is explicitly synchronous. I'm just expecting that
>> somebody is doing the same these days with Qt and want to improve on that
>> given that C++ itself will get "async" support so I want to avoid any
>> duplication from my side. I'm not talking about something new, just asking
>> if there are any plans in that direction.
>>
>>
>>>
>>>>
>
> I think a topic is not well discussed do not mean it is not recommended. I
> am using QtConcurrent for handling asynchronous task. So far I have
> encountered deadlock issue only once. It happen when the application quit
> but the task is not finished yet.
>
> Coroutine should be a good solution for many problems. I may switch to
> coroutine if the task is not CPU intensive.  But unfortunately that it is
> not available in Qt yet. So user need an alternative solution. It can't
> just wait for new version of Qt. QtConcurrent may not be a bad choice. It
> should be worth to discuss.
>
> I am not sure is any Qt developer working on coroutine yet. I think it is
> better to ask in developer mailing list.
>
>
I have created a library called AsyncFuture that could convert a signal
into a QFuture and use it like a Promise object in Javascript. (It is not
obtained from QtConcurrent::run) That show how QFuture can be used in
asynchronous programming.

https://github.com/benlau/asyncfuture

For example:

===
QFuture future = observe(timer, ::timeout).future();

/* Listen from the future without using QFutureWatcher*/
observe(future).subscribe([]() {
// onCompleted. It is invoked when the observed future is finished
successfully
qDebug() << "onCompleted";
},[]() {
// onCanceled
qDebug() << "onCancel";
});
===

Make a deferred future, finish a future without using signal

===

auto d = deferred();

observe(d.future()).subscribe([]() {
qDebug() << "onCompleted";
}, []() {
qDebug() << "onCancel";
});

QVERIFY(d.future().isFinished, false);
d.complete(true); // or d.cancel();
QVERIFY(d.future().isFinished, true);

===

Ofcoz, I won't say it is a better solution than async. What it provides is
just a Promise-level asynchronous programming interface. But that could
handle QNetworkRequest (signal -> QFuture) and QSqlDatabase
(QtConcurrent::run)  using the same mechanism of QFuture.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QML async/await support?

2017-02-03 Thread Ben Lau
On 4 February 2017 at 00:42, Jason H  wrote:

>
>
> > Sent: Thursday, February 02, 2017 at 3:40 PM
> > From: "Samuel Gaist" 
> > To: "Jason H" 
> > Cc: "interestqt-project.org" 
> > Subject: Re: [Interest] QML async/await support?
> >
> >
> > > On 2 Feb 2017, at 18:02, Jason H  wrote:
> > >
> > > When will QML get proper async/await support? I'm not using Promises,
> since my callback hell is manageable, but I do look forward to async/await.
> > > ___
> > > Interest mailing list
> > > Interest@qt-project.org
> > > http://lists.qt-project.org/mailman/listinfo/interest
> >
> > Hi,
> >
> > Looking for something like https://github.com/benlau/quickpromise ?
>
>
> Thanks but promises are a fad, created because of a lack of async/await.
> Their replacement is async/await. As of July '16, they were committed to
> ECMAscript 2017. At the January '17 meeting the final ECMAscript 2017
> featureset was announced whose major features are async/await and shared
> mem & atomics.
>
> The JS community has been using async/await via babel for some time.
> Python is also moving to async/await, with 3.5 introducing and 3.6
> completing support for async/await.
>
> Given that the future is here, that's why I was asking. I think (I'm very
> not sure) that V4 would have to be modified for async/await. Given the
> relative enthusiasm for async/await I was wondering if it was scheduled for
> V4.
>
>
>
Upgrade the Javascript engine would take a lot of time. Instead, I think it
should just use babel to compile JavaScript code that compatible with v4.
That will be much easier.

There has a project called , quickly , is aimed for this purpose. But
unfortunately the development is suspended for long time.

https://github.com/quickly/quickly
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QFuture, QAsync? Coroutines, Generators, Promises, Futures...

2016-12-31 Thread Ben Lau
On 28 December 2016 at 16:36, Petar Koretić <petar.kore...@gmail.com> wrote:

>
>
> On Wed, Dec 28, 2016 at 4:51 AM, Ben Lau <xben...@gmail.com> wrote:
>
>>
>>
>> On 28 December 2016 at 05:50, Petar Koretić <petar.kore...@gmail.com>
>> wrote:
>>
>>> Hi all!
>>>
>>> In the wild people are doing all kinds of different things with Qt on
>>> the network side. And there are some obvious issues with that given the
>>> "callback" nature of Qt networking code.
>>>
>>> One can see different examples of people over the years dealing with
>>> that:
>>>
>>> http://cukic.co/2016/01/17/asynqt-framework-making-qfuture-useful
>>> https://github.com/KDE/kasync
>>> http://qasync.henrikhedberg.com
>>> https://github.com/mhogomchungu/tasks
>>> https://gist.github.com/legnaleurc/1038309
>>>
>>> Since we are also using Qt a lot on the server side I'm curious what is
>>> the progress from the Qt side on that given that coroutines will come to
>>> C++ (http://en.cppreference.com/w/cpp/experimental)
>>>
>>> We were using Boost and as we were using Qt for clients decided we could
>>> also do server parts in Qt as well. This is all fine and I enjoyed it, but
>>> boost has futures, promises and coroutines as well, which is nice, since we
>>> also have backends in Node.js where we employ identical patterns.
>>>
>>> So I've been waiting for 2 years now to see what will come up from Qt
>>> and I don't see much about that changing. Heck, QAsync tackled this in 2011.
>>> Will Qt "embrace" coroutines from standard? Will they come up with
>>> something of their own? Should we abandon Qt for networking? Should we use
>>> something of our own?
>>>
>>> One possible way currently is to use QtConcurrent (badly I guess) and
>>> wrap everything into QtConcurrent::run, which, for example, for
>>> QNetworkRequest means first converting it to sync code using local event
>>> loop which is again not recommended.
>>>
>>>
>> Why you think it is not recommended?
>>
>>
> This was once on http://developer.nokia.com/community/wiki/How_to_wait_
> synchronously_for_a_Signal_in_Qt
> Local QEventloop may cause out of control recursion or deadlocks in some
> cases. Whenever I had idea to use it, nobody recommended it. Quick google
> search now will tell you the same.
>
> Nevertheless, for example, QNetworkRequest is explicitly asynchronous
> while QSqlDatabase is explicitly synchronous. I'm just expecting that
> somebody is doing the same these days with Qt and want to improve on that
> given that C++ itself will get "async" support so I want to avoid any
> duplication from my side. I'm not talking about something new, just asking
> if there are any plans in that direction.
>
>
>>
>>>

I think a topic is not well discussed do not mean it is not recommended. I
am using QtConcurrent for handling asynchronous task. So far I have
encountered deadlock issue only once. It happen when the application quit
but the task is not finished yet.

Coroutine should be a good solution for many problems. I may switch to
coroutine if the task is not CPU intensive.  But unfortunately that it is
not available in Qt yet. So user need an alternative solution. It can't
just wait for new version of Qt. QtConcurrent may not be a bad choice. It
should be worth to discuss.

I am not sure is any Qt developer working on coroutine yet. I think it is
better to ask in developer mailing list.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QFuture, QAsync? Coroutines, Generators, Promises, Futures...

2016-12-27 Thread Ben Lau
On 28 December 2016 at 05:50, Petar Koretić  wrote:

> Hi all!
>
> In the wild people are doing all kinds of different things with Qt on the
> network side. And there are some obvious issues with that given the
> "callback" nature of Qt networking code.
>
> One can see different examples of people over the years dealing with that:
>
> http://cukic.co/2016/01/17/asynqt-framework-making-qfuture-useful
> https://github.com/KDE/kasync
> http://qasync.henrikhedberg.com
> https://github.com/mhogomchungu/tasks
> https://gist.github.com/legnaleurc/1038309
>
> Since we are also using Qt a lot on the server side I'm curious what is
> the progress from the Qt side on that given that coroutines will come to
> C++ (http://en.cppreference.com/w/cpp/experimental)
>
> We were using Boost and as we were using Qt for clients decided we could
> also do server parts in Qt as well. This is all fine and I enjoyed it, but
> boost has futures, promises and coroutines as well, which is nice, since we
> also have backends in Node.js where we employ identical patterns.
>
> So I've been waiting for 2 years now to see what will come up from Qt and
> I don't see much about that changing. Heck, QAsync tackled this in 2011.
> Will Qt "embrace" coroutines from standard? Will they come up with
> something of their own? Should we abandon Qt for networking? Should we use
> something of our own?
>
> One possible way currently is to use QtConcurrent (badly I guess) and wrap
> everything into QtConcurrent::run, which, for example, for QNetworkRequest
> means first converting it to sync code using local event loop which is
> again not recommended.
>
>
Why you think it is not recommended?


> I expect that everybody is up to date and know about
> callbacks/coroutines/futures/promises/generators these days but for
> others here are some examples that explain it better than I can:
>
> http://www.boost.org/doc/libs/1_63_0/libs/coroutine2/doc/
> html/coroutine2/motivation.html
> https://msdn.microsoft.com/en-us/magazine/mt573711.aspx
> https://blogs.msdn.microsoft.com/vcblog/2016/04/04/using-c-
> coroutines-to-simplify-async-uwp-code
>
> Thanks,
> Petar
>
>
For coroutines, any recommended implementation that is easy to be installed
on all supported platforms by Qt?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] New QML component

2016-10-17 Thread Ben Lau
$ qpm list | wc -l

40
Now it has 40 packages available in qpm.

https://www.qpm.io/packages.html

Another choice is : https://inqlude.org

On 18 October 2016 at 00:35, Ian Geiser  wrote:

> Hey all, I just wanted to see where people post new Qt components so
> others can find them and know about them.   I have read about qpm, but I am
> not sure how popular that is yet.  There used to be freshmeat.net, but
> that is now dead it seems.  Any suggestions?  Thanks!
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] What don't you like about Qt?

2016-09-18 Thread Ben Lau
On 18 September 2016 at 21:56, Bob Hood  wrote:

> On 9/18/2016 2:43 AM, Jean-Michaël Celerier wrote:
>
>> Some things that bother me :
>>
>> * Features being QML-only instead of being usable from C++. I like coding
>> in C++ (but I agree it's hard).
>>
>
> This is certainly arguable.  For some, I guess coding in C++ is hard.  For
> others, it's as natural as breathing.
>
> In fact, it leads to my particular issue: QML.  I waited a long time for
> Qt to reach a point where it was usable for mobile development, and I
> personally was disappointed with the declarative approach taken with QML.
> Aside from being somewhat out of character for the framework, it seems to
> have been a divisive approach, creating a separation not only between
> interface and code, but between languages!  Jean-Michaël's point
> abovehighlights that.
>
> I want to code mobile in a language I use on a daily basis for things
> other than just mobile.  I realize it is a great fit for some people, but
> unfortunately for me, QML isn't.  I've therefore had to turn my attention
> to Xamarin (especially now that it is integrated into Visual Studio).  I've
> never been much of a fan of C#, but it is certainly closer to C++ than QML.
>
> (No QML flame wars, please.  I'm just expressing my personal situation,
> not saying that QML isn't useful for some people.)
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>


Personally I don't mind to code in two languages. I would treat QML as an
interface builder language. (e.g the old .ui file or those xml files in
Android) But the hard problem is on the data sharing model between C++ and
QML/JS. QAbstractItemModel is an overkill solution. Many people may instead
chose QObjectListModel for sharing data. But I have too many bad experience
with it. It is too easy to crash and difficult to trace the problem.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt 5.7 - iOS - module "QtGraphicalEffects" plugin "qtgraphicaleffectsplugin" not found

2016-08-11 Thread Ben Lau
On 11 August 2016 at 20:54, J-P Nurmi <jpnu...@qt.io> wrote:

> On 11 Aug 2016, at 14:43, Ben Lau <xben...@gmail.com> wrote:
>
>
> I think so. I would suggest to add a new variable called "QML_SCAN_PATH"
> for qmake. And let's qmlimportscanner scan those directory too. Moreover,
> due to QTBUG-48480, it may also need a variable QML_EXCLUDE_SCAN_PATH too.
>
> [QTBUG-48480] Qt5QuickTest should not be linked in iOS target for non-unit
> test program - Qt Bug Tracker
> <https://bugreports.qt.io/browse/QTBUG-48480>
>
>
> There’s already QML_IMPORT_PATH that is only (?) used by Qt Creator for
> resolving imports. Perhaps the same variable could be used for
> qmlimportscanner...
>
> --
> J-P Nurmi
>
>
I just thought QML_IMPORT_PATH will also include system QML path. But it
don't. So it should be a good idea to use QML_IMPORT_PATH.

p.s I still need a variable like QML_EXCLUDE_PATH to fix QTBUG-48480.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt 5.7 - iOS - module "QtGraphicalEffects" plugin "qtgraphicaleffectsplugin" not found

2016-08-11 Thread Ben Lau
I think so. I would suggest to add a new variable called "QML_SCAN_PATH"
for qmake. And let's qmlimportscanner scan those directory too. Moreover,
due to QTBUG-48480, it may also need a variable QML_EXCLUDE_SCAN_PATH too.

[QTBUG-48480] Qt5QuickTest should not be linked in iOS target for non-unit
test program - Qt Bug Tracker <https://bugreports.qt.io/browse/QTBUG-48480>





On 11 August 2016 at 19:31, Nuno Santos <nunosan...@imaginando.pt> wrote:

> Thanks Ben for sharing your experience.
>
> Don’t you think this behaviour should be improved? I think I will submit
> this a feature suggestion.
>
> On 11 Aug 2016, at 11:58, Ben Lau <xben...@gmail.com> wrote:
>
>
> I think qmlimportscanner only scan QML file within the project directory
> regardless of is it used / referred by .pro or resource file. All QML files
> in sibling directory will be ignored.
>
> I have got similar problem. So far I fix it by adding extra import
> statement in the main.qml . And leave a comment "Don't remove it" to warn
> other developer not to remove those import statements even they are not
> needed by main.qml.
>
> On 11 August 2016 at 00:37, Nuno Santos <nunosan...@imaginando.pt> wrote:
>
>> I think I have just found a bug in qmlimportscanner.
>>
>> In order to qmlimportscanner correctly include the necessary plugins, it
>> need to have a Qt resources file added to the .pro resources.
>>
>> However, in my case, I have shared resources across apps. To do it so, I
>> need to have a .pri which has resources.
>>
>> It seems that qmlimportscanner ignores .pri resources and it is not able
>> to correctly link with the necessary plugin.
>>
>> To test this theory I have added a dummy qml file with an empty item and
>> the QtGraphicalEffects import line and it launched correctly.
>>
>> Before submitting a bug I would love to have community feedback.
>>
>> Best regards,
>>
>> Nuno
>>
>> On 10 Aug 2016, at 17:15, Nuno Santos <nunosan...@imaginando.pt> wrote:
>>
>> Hi,
>>
>> I’m trying to use QtGraphicalEffects on iOS but i’m having:
>>
>> module "QtGraphicalEffects" plugin "qtgraphicaleffectsplugin" not found
>>
>> In fact it is not linking with the plugin. Is this a know problem with Qt
>> 5.7 and iOS??
>>
>> Thanks,
>>
>> Regards,
>>
>> Nuno
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>>
>>
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>>
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt 5.7 - iOS - module "QtGraphicalEffects" plugin "qtgraphicaleffectsplugin" not found

2016-08-11 Thread Ben Lau
I think qmlimportscanner only scan QML file within the project directory
regardless of is it used / referred by .pro or resource file. All QML files
in sibling directory will be ignored.

I have got similar problem. So far I fix it by adding extra import
statement in the main.qml . And leave a comment "Don't remove it" to warn
other developer not to remove those import statements even they are not
needed by main.qml.

On 11 August 2016 at 00:37, Nuno Santos  wrote:

> I think I have just found a bug in qmlimportscanner.
>
> In order to qmlimportscanner correctly include the necessary plugins, it
> need to have a Qt resources file added to the .pro resources.
>
> However, in my case, I have shared resources across apps. To do it so, I
> need to have a .pri which has resources.
>
> It seems that qmlimportscanner ignores .pri resources and it is not able
> to correctly link with the necessary plugin.
>
> To test this theory I have added a dummy qml file with an empty item and
> the QtGraphicalEffects import line and it launched correctly.
>
> Before submitting a bug I would love to have community feedback.
>
> Best regards,
>
> Nuno
>
> On 10 Aug 2016, at 17:15, Nuno Santos  wrote:
>
> Hi,
>
> I’m trying to use QtGraphicalEffects on iOS but i’m having:
>
> module "QtGraphicalEffects" plugin "qtgraphicaleffectsplugin" not found
>
> In fact it is not linking with the plugin. Is this a know problem with Qt
> 5.7 and iOS??
>
> Thanks,
>
> Regards,
>
> Nuno
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] shader compilation failed & shader program is not linked

2016-08-10 Thread Ben Lau
Hi,

I have a QML library that use Travis as build server. It works well until
yesterday. All test cases involving GUI complains "shader compilation
failed" and "shader program is not linked". Then the test program crash
finally.

QWARN  : QuickAndroidTests::runExample() QOpenGLShader::compile(Vertex):
failed
QWARN  : QuickAndroidTests::runExample() QOpenGLShader::compile(Fragment):
failed
QWARN  : QuickAndroidTests::runExample() shader compilation failed:
""
QWARN  : QuickAndroidTests::runExample() QOpenGLShaderProgram::uniformLocation(
matrix ): shader program is not linked
QWARN  : QuickAndroidTests::runExample() QOpenGLShaderProgram::uniformLocation(
opacity ): shader program is not linked
QWARN  : QuickAndroidTests::runExample() QOpenGLShader::compile(Vertex):
failed
QWARN  : QuickAndroidTests::runExample() QOpenGLShader::compile(Fragment):
failed
QWARN  : QuickAndroidTests::runExample() shader compilation failed:

Full Log:
https://travis-ci.org/benlau/quickandroid/builds/151202298

Since I didn't modify the logic / configuration environment. I think there
has something changed in travis build server. I have checked xvfb and mesa
are installed. Then I have tried to change the options of xvfb to enable
OpenGL but the result is same.

I have no idea what may cause this problem. Any advise for finding out the
problem?

Log with glxinfo
https://travis-ci.org/benlau/quickandroid/builds/151401382

Thx.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Managing memory with QObject*-models exposed to QML

2016-07-17 Thread Ben Lau
On 17 July 2016 at 19:22, Ola Røer Thorsen <o...@silentwings.no> wrote:

> Thank you for the feedback, Ben.
>
> 2016-07-15 19:32 GMT+02:00 Ben Lau <xben...@gmail.com>:
>
>> Hi,
>>
>> In my humble opinion, QObjectListModel is a bad idea. Because it is
>> difficult to manage the life cycle of QObject with QML. Just like your
>> problem. I have met the similar issue in my first QML project. The
>> application always crashes. The pattern is purely random. I wasted a lot of
>> time to discover the root cause.
>>
>>
> Right. Well it's disappointing if this cannot be solved properly at all. A
> QObjectList is mentioned as a proper model usable in QML so I am tempted to
> say this is a rather big flaw in the QML engine itself.
> http://doc.qt.io/qt-5/qtquick-modelviewsdata-cppmodels.html
> It would be nice to get som kind of confirmation from someone knowing the
> insides of the QML engine, if this is supposed to work or not, and if it
> can be fixed.
>

I want to know the answer too.


>
> Moreover, I am doubt to use a list of QObject as a data storage class.
>> Since QObject is not copyable, it must use a pointer to share QObject to
>> multiple classes. Extra care is needed to manage its life cycle. And they
>> are not able to be passed to another thread for processing directly.
>> Therefore, I always prefer an implicitly shared class over a list of
>> QObject as data storage. It is copyable and thread safe (using a worker
>> model).
>>
>>
> Yes I agree it's not always optimal to use the QObjects. But in the
> application I am working on now it actually makes sense (convenient, few
> lines of code) to use QObjects with properties and especially qml-invokable
> functions.
>
>
>> Instead, I use another approach for sharing data between C++ and QML. I
>> just hold a QList (T is an implicitly shared class) as the central data
>> storage in memory. Whatever it is changed, it will update a
>> QVariabtListModel to inform QML to render the content. However, QML/JS do
>> not write to the model directly. Instead, it will ask another C++ object to
>> update the central data. (e.g by context object / messaging system)
>>
>> In order to simplify the process to update the QVariantListModel, I have
>> written a library called QSyncable. It have document and example code to
>> demonstrate how this approach works.
>>
>> https://github.com/benlau/qsyncable
>>
>>
> This is interesting, I'll try it out. Seems like there is some additional
> overhead of creating the maps and such, but I might not notice.
>
>
yes. There has overhead in converting to QVariantList and finding the diff
(average O(N) algorithm). However, if you just have few hundred of items .
That should be fast enough.


> Is it easy to use additional proxy-models in combination with your library
> to filter and/or sort the lists live, based on updated data in the lists?
>


yes.

As QSyncable also implements the QAbstractItemModel class, it could be used
with other proxy model like QSortFilterProxyModel.

Example:
https://github.com/benlau/qsyncable/blob/master/tests/qsyncableunittests/integrationtests.cpp#L37

However, you may not need a proxy model for QSyncable. Sort & filter could
be done within the convertor function directly.


>
> Ola
>
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Managing memory with QObject*-models exposed to QML

2016-07-15 Thread Ben Lau
Hi,

In my humble opinion, QObjectListModel is a bad idea. Because it is
difficult to manage the life cycle of QObject with QML. Just like your
problem. I have met the similar issue in my first QML project. The
application always crashes. The pattern is purely random. I wasted a lot of
time to discover the root cause.

Moreover, I am doubt to use a list of QObject as a data storage class.
Since QObject is not copyable, it must use a pointer to share QObject to
multiple classes. Extra care is needed to manage its life cycle. And they
are not able to be passed to another thread for processing directly.
Therefore, I always prefer an implicitly shared class over a list of
QObject as data storage. It is copyable and thread safe (using a worker
model).

Instead, I use another approach for sharing data between C++ and QML. I
just hold a QList (T is an implicitly shared class) as the central data
storage in memory. Whatever it is changed, it will update a
QVariabtListModel to inform QML to render the content. However, QML/JS do
not write to the model directly. Instead, it will ask another C++ object to
update the central data. (e.g by context object / messaging system)

In order to simplify the process to update the QVariantListModel, I have
written a library called QSyncable. It have document and example code to
demonstrate how this approach works.

https://github.com/benlau/qsyncable



On 14 July 2016 at 17:02, Ola Røer Thorsen  wrote:

> I've found that creating C++ models containing a list of QObject* based on
> QAbstractListModels and using them in Quick views such as ListView is very
> useful. I'm not the only one, there are several implementations of
> "QObjectListModel" around, and I've got my own as well.
>
> On quite rare ocations I have had crashes deep inside the QML engine
> itself, that are very hard to reproduce, when rapidly adding and removing +
> deleting objects in the model from C++. I think this probably has to do
> with the Quick view's delegate that might still be using an Object that was
> just deleted.
>
> I've made sure that all objects put into the list model are created in C++
> and they do have a parent to avoid qml taking ownership of them. When
> removing from a model, they are first removed  (beginRemoveRows, remove
> from array, endRemoveRows), then finally deleted using
> object->deleteLater().
>
> My worry here is that deleteLater() is sometimes still too soon for the
> QML engine to keep up, especially when there is a lot of things going on in
> the Quick scene.
>
> Could this be the case? If so, what is the rock-solid way to do this?
>
> One ugly "fix" that I would like to avoid is to put the objects in some
> queue and delete them after a given "safe time duration", like
> "deleteMuchLater()".
>
> Another way idea that I have not tried is to use QSharedPointer, and
> expose some wrapper Q_GADGET-based type to QML that contains this pointer
> with some raw pointer property, but this introduces shared pointers to my
> C++ application and changes a lot of other things.
>
> I'd appreciate any input on if this is a real problem to begin with, and
> if so, how to work around it.
>
> Thanks,
> Ola
>
>
>
>
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] how to install qt enterprise using command line only?

2016-07-07 Thread Ben Lau
On 7 July 2016 at 12:42, Thiago Macieira  wrote:

> On quinta-feira, 7 de julho de 2016 10:29:43 PDT Лагнер, Сергей wrote:
> > Does not work as well
> >
> > ~/Downloads$ ./qt-enterprise-linux-x64-android-5.6.1-1.run -platform
> minimal
> > Unknown option: p, l, a, t, f, o, r, m
>
> Looks like the installer eats the options that QGuiApplication needs. Try
> this
> instead:
>
> export QT_QPA_PLATFORM=minimal
>
>
I have tested this method on a VM without X. It works.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] how to install qt enterprise using command line only?

2016-07-03 Thread Ben Lau
Hi,

I have written a script for installing Qt OpenSource edition via command
line environment (xvfb is still needed). Although it do not fit with
enterprise edition (probably you need to login), it can be an example to
show how to manipulate Qt installer framework.

https://github.com/benlau/qtci/


On 3 July 2016 at 22:28, Лагнер, Сергей  wrote:

> Hello all.
>
> I'm trying to use qt enterprise and I want to install it on my build
> server. There is no any GUI on the server, so I need some way to install qt
> without it. I downloaded qt-enterprise-linux-x64-android-5.6.1-1.run, but
> it seems does not have such option.
> I'd like to note, I do not want to build qt from sources, just install is
> enough for me.
> Is it possible to install it using command line only?
>
> Thanks,
> Sergey
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [QtQuick] Interaction with user from C++

2016-04-28 Thread Ben Lau
On 28 April 2016 at 05:02, Jérôme Godbout  wrote:

> >>I wrote a simple code where a timer increment an int and a text showing
> that int in QML. And from that QML called a C++ function which blocks it.
>
> Take care, animation and rendering seem to be different thread. The Qml
> main thread should block. Maybe I don't get it what you tried here.
>
> >> How about using a promise object(Javascript concept)?
>
> It would surely help if you go with the functions inline. But those
> message box are normally part of sequence or can even be deep into an
> object function that know nothing about the caller or it's sequence status.
> Maybe promise can help here but doesn't change the real problem which is
> you need an answer before you can continue this action (like a mutex on
> that sequence, until answer is receive you want to hold in place).
>
> The current Qml async way to make this is more like signal/slot, but to
> write something that branch a lot based on the answer, make coverage hard
> to follow.
>
>
What if a promise object can be resolved by signal?

promise.resolve(dialog.accepted); // Call the "then" callback once the
signal is emitted
promise.then(function() {
   // create new promise object for next async object. (save to disk?)
}).then(function() {

});;




>
> On Wed, Apr 27, 2016 at 1:12 PM, Sina Dogru  wrote:
>
>> Seems like it is undefined behaviour to have QFileDialog without a
>> parent. Sometimes it becomes "ApplicationModal" but sometimes "NonModal" (I
>> experienced it with a simple code on Linux.)..
>>
>> Also Shawn warned that would block QML thread. So to try what is the
>> behaviour of engine when the thread is block, I wrote a simple code where a
>> timer increment an int and a text showing that int in QML. And from that
>> QML called a C++ function which blocks it. But seems like engine keep
>> working while it suppose to block (tried on 5.6).
>>
>> Now I need to choose between "bouncing between QML and C++" or "breaking
>> in multiple functions". Thanks for helping and acquired a vision.
>>
>> Sina
>>
>> 2016-04-26 22:32 GMT+03:00 Jérôme Godbout :
>>
>>> We have QWidgets as base window (QMainWindow) that have the QQuickView
>>> into it. For the parent, we use the QMainWindow. Maybe this explain why it
>>> work well in our case. We have some tools that are still into QWidgets
>>> (TreeView mostly with dock window, the Qml TreeView, is somewhat... painful
>>> in the current state).
>>>
>>> In the case of a Qml ApplicationWindow, I don't known if this would
>>> work, it's a QObject and not a QWidgets, the QDialog call require a
>>> QWidgets pointer as first argument. hummm, I did not realized that until
>>> now. Good point Sina Dogru.
>>>
>>> Not sure what is the behavior if the first argument is null if only have
>>> a Qml ApplicationWindow. If this work let me know, I'm curious to see if
>>> this work or not.
>>>
>>>
>>> On Tue, Apr 26, 2016 at 3:17 PM, Sina Dogru  wrote:
>>>
 Yes I got your points. At least there is no any bouncing between QML
 and C++.

 2016-04-26 20:11 GMT+03:00 Jérôme Godbout :

> We are mostly using QFileDialog and QMessageBox. Note the Qml type but
> the one from QtWidgets/QFileDialog
>
> *Q_INVOKABLE QString getSaveFileName(...); // .h*
>
>
> *QString MySingletonDialog::getSaveFileName(...) // .cpp*
> *{*
> *  return QFileDialog::getSaveFileName(...);*
> *}*
>

 What is the parent argument for QFileDialog? I guess this is needed to
 modal window work properly?

 The only way I see it is a follow (not tested just the way I see it
> into Qml Dialog):
>
> *Dialog*
> *{*
> *  id: myDialog_*
> *  contentItem: null*
>   // Dummy content can be from anywhere or you could have a static
> object with options as property here
> *  property Item myDialog1: Item { ... }*
>
> *  property Item myDialog2: Item { ... }*
>   // dynamic functor
> *  property var acceptedCallback: null*
> *  property var rejectedCallback: null*
> *  onAccepted: { if(acceptedCallback) acceptedCallback(clickedButton);
> }*
> *  onRejected: { if(rejectedCallback) rejectedCallback(clickedButton);
> }*
>   // ... add other wanted handler for all the possible signal here
> *}*
>
> // inline callback (you can create function per sub function but that
> make the code look like a big goto mess). It's only 2 calls to interact
> with user and not branching does nothing else and it's already messy.
>
> *function myAction()*
> *{*
> *myDialog_.contentItem = myDialog_.myDialog1;*
> *myDialog_.rejectedCallback = function(button) *
> *{*
> *   console.log('error');*
> *};*
> *myDialog_.acceptedCallback = *
> *function(button)*
> *{*
> // Do 

Re: [Interest] [QtQuick] Interaction with user from C++

2016-04-27 Thread Ben Lau
Hi Jérôme,


On 26 April 2016 at 21:00, Jérôme Godbout  wrote:

> Hi Dmitry,
> not much problems, except this is a modal way for interacting with the
> user. I'm not a fan of modal (as matter of fact I hate it, you prevent your
> user for copy/paste, check something from the real work window), but the
> Qml Dialog callback make it even worst. It seem ok for a single question
> for a dual action path, but when thing get a little more complex, this is a
> code nightmare (not as hard to code, but hard to follow what is going on
> when not written by you, it's a succession of callback and setting the Qml
> Dialog callback function and call it over and over, you have to understand
> the function that can be called in which order, because creating 5 of them
> for a single sequence seem to be dumb and not helping the function workflow
> anyway).
>
>
How about using a promise object(Javascript concept)? Do you think it could
simplify the workflow?



> As for the C++ invoke, not much was required, your Qml will not react or
> respond to the mouse event until you come back from the call as expected.
> Unless you have timer base actions or your main loop feed something
> external (which I think you should never do), this work well.
>
> We had some issue with Qt 5.5, with mixing QWidgets/Qml for menu/window
> position, but that seem to be fixed into 5.6.
> Jerome
>
> On Tue, Apr 26, 2016 at 8:45 AM, Dmitry Volosnykh <
> dmitry.volosn...@gmail.com> wrote:
>
>> Jérôme, thank you for your input. Just for self education... Did you
>> face some problems with such approach which you may want to share with us?
>> Any UI performance issues since you may have blocked scene renderer?
>>
>>
>> On Tue, Apr 26, 2016 at 3:39 PM Jérôme Godbout 
>> wrote:
>>
>>> We also have expose those blocking C++ QMessageBox and QDialog for
>>> linear workflow via Q_INVOKABLE from C++ singleton. This avoid the callback
>>> spaghetti mess of Qml Dialog and made the code more readable. If you have
>>> many options to offer to user in particular sequences of may or may not be
>>> requested, the declarative way is a nightmare. In fact I think we have 0
>>> Qml Dialog into our 5 CAD applications, but many call to those C++ blocking
>>> dialog invoke.
>>>
>>> On Tue, Apr 26, 2016 at 8:34 AM, Jérôme Godbout 
>>> wrote:
>>>
 I can tell what we did, we made a FileSystem C++ singleton that expose
 most file system file/url check, we made those check inside Qml javascript
 now. This way you can make callback and GUI logic into Qml. We expect C++
 function to be call with valid argument all the time. Else we always return
 error (unexpected error, since the Qml code should have validate before
 making the call, this is a developer issue).

 Side Note: We also have experiment with throw from C++ that get
 evaluate into Qml, it work, but it would be nice to have a proper keyword
 with throw type to indicate this and the exception get transfer to into
 Q_INVOKABLE.  Would allow for better error handling.

 On Tue, Apr 26, 2016 at 5:58 AM, Sina Dogru 
 wrote:

>
>
> 2016-04-26 12:11 GMT+03:00 Shawn Rutledge :
>
>>
>> You shouldn’t need to do this.  Just write onAccepted/onRejected
>> handlers which call back to QML and/or C++ code as necessary.  Is there
>> some reason why that is difficult?
>>
>> Well the problem is (like I tried to explain on the email to Dmitry)
> while using QFileDialog's and QMessageBox's static functions, program can
> continue to flow from where those functions called.
>
> Let me please explain myself with a piece of code;
>
> void App::saveAs(const QString )
> {
> bool cont = true;
>
> while (cont) {
> if (path.isEmpty())
> cont = false;
> else {
> QFileInfo fi = path;
>
> if (fi->exists()) {
> int wantSave = QMessageBox::warning(nullptr,
> tr("Warning"), tr("File %1 exists.\n"
> "Do you wish to
> overwrite it?").arg(fi->fileName()),
> QMessageBox::Yes,
> QMessageBox::No);
> if (wantSave == QMessageBox::Yes)
> cont = false;
> else
> path = QFileDialog::getSaveFileName(nullptr,
> tr("Save As"));
> }
> else
> cont = false;
> }
> }
> if (!path.isEmpty())
> doc->save(url);
> }
>
> For example, when the user press the save as tool button of the QML
> ApplicationWindow, this slot is called onAccepted handler of the
> FileDialog. But depending on the user input, application might 

Re: [Interest] Qt signal overhead (same thread, direct connection)

2016-04-22 Thread Ben Lau
On 23 April 2016 at 00:34, Alejandro Exojo  wrote:

> El Friday 22 April 2016, Nuno Santos escribió:
> > Then I made an experiment. Arpeggiator was using a signal to send the
> > noteOn to the audio render engine. I decided to call the function
> directly
> > on the synth render engine. Guess what, the problem disappears.
> >
> > Is the signal/slot mechanism tied to the event loop? How much does it
> take
> > for a signal/slot to be called? It might not be significant on a desktop
> > computer but it certainly is on a ARM device specially in this kind of
> > performance sensitive contexts.
>
> This paragraph in the documentation (same link Benjamin sent) is also
> pretty
> enlightening:
>
> > Compared to callbacks, signals and slots are slightly slower because of
> the
> > increased flexibility they provide, although the difference for real
> > applications is insignificant. In general, emitting a signal that is
> > connected to some slots, is approximately ten times slower than calling
> > the receivers directly, with non-virtual function calls. This is the
> > overhead required to locate the connection object, to safely iterate over
> > all connections (i.e. checking that subsequent receivers have not been
> > destroyed during the emission), and to marshall any parameters in a
> > generic fashion. While ten non-virtual function calls may sound like a
> > lot, it's much less overhead than any new or delete operation, for
> > example. As soon as you perform a string, vector or list operation that
> > behind the scene requires new or delete, the signals and slots overhead
> is
> > only responsible for a very small proportion of the complete function
> call
> > costs. The same is true whenever you do a system call in a slot; or
> > indirectly call more than ten functions. The simplicity and flexibility
> of
> > the signals and slots mechanism is well worth the overhead, which your
> > users won't even notice.
>
> That was probably written long ago. I've read people mentioning that it
> might
> be that signal emission would be slower nowadays.
>
> Also, what type are you passing in the signal? The value is copied, so if
> it's
> expensive to copy, that might be a factor as well. I believe that is one of
> the reasons why APIs like QIODevice don't send the received data through
> the
> signal, but just the notification of the presence of new data. Later on you
> have to retrieve it.
>
> --
> Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
> http://barnacity.net/ | http://disperso.net
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>


As long as the passed data is an implicit sharing class like QByteArray,
then it will be fine. Because only a pointer to the contained data is
passed. Data copying only happen when a function write to an implicit
sharing class.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Replacement for Qt Script

2016-04-21 Thread Ben Lau
On 18 April 2016 at 23:38, Ian Geiser  wrote:

>   On Mon, 18 Apr 2016 11:06:59 -0400 Jason H  wrote
> 
>  > ttps://
> forum.qt.io/topic/52306/qt-5-5-qt-script-deprecated-what-is-replacement/12
>  > >
>  > > I saw this thread, but it did not seem to offer a clear detail other
> than to use QJSEngine and QJSValue directly.  Specifically I use
> qScriptRegisterMetaType very heavy to add custom types.  I know if I am
> using QML I can use qmlRegisterType(uri, 1, 0, "T") but it only makes
> the type available via the declarative components.  It also requires the
> object be a QObject which means sharing pointers.  There is also a problem
> inside of the Javascript.  It is very cumbersome to dynamically create
> these types.  I understand I am fighting QML, but my design is not as
> declarative as it is creating objects that can be passed back into C++.   I
> may be missing something though.
>  > >
>  > > As an example below with a type called MyStruct:
>  > >
>  > > ... Qt Script...
>  > >
>  > > var myStruct = new MyStruct();
>  > > myStruct.x = 10;
>  > >
>  > >  QML...
>  > >
>  > > var myStruct;
>  > > var component = Qt.createComponent(???);
>  > >  if (component.status == Component.Ready) {
>  > > myStruct = component.createObject(parent, {"x": 100, "y":
> 100});
>  > > }
>  > >
>  > > What would ??? be?
>  >
>  > If MyStruct is just a JS object, then just use JS. function MyStruct(){
> return {"x": 100, "y": 100}; }; var myStruct = new MyStruct();
>  > You only need createObject when you are creating an object defined in
> C++ or dynamic object from QML.
>
> That is my rub here.  These are custom QML components that are being
> created in JS and then passed back into the C++ end of things.  The goal
> being I want to be able to write "plugins" for my app using JS instead of
> C++. So I am creating and manipulating custom types that are then used to
> manipulate and extend the C++.  I may be making this harder than it needs
> to be though.  I will give it a try with the non-gui QML components and see
> how far I get.
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>


Suggestion

1. Register a singleton QML component by C++.

2. The C++ component provides hook function  (callback in Javascript)
registration.

void MyAPI::registerHook(QJSValue callback) {
}

3. Whatever an event occur, call the hook function.

QJSValueList args;
QJSValue ret = callback.call(args);
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QML properties

2016-04-11 Thread Ben Lau
Property binding / Data binding

On 12 April 2016 at 12:47, Igor Mironchik  wrote:

> Hi,
>
> How to correctly name that that when in QML  I write "width: parent.width
> / 2", for example, then when parent.width changed then changed and width
> too? I.e. automatic propagation?
>
> Thank you.
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QML id

2016-04-11 Thread Ben Lau
How about to scale the whole chess board to fit the window?


On 11 April 2016 at 20:55, Igor Mironchik  wrote:

>
>
> On 11.04.2016 15:10, Gian Maxera wrote:
>
>
> On 11 Apr 2016, at 11:44, Igor Mironchik < 
> igor.mironc...@gmail.com> wrote:
>
> Hello,
>
> On 11.04.2016 13:19, Gian Maxera wrote:
>
>
> On 11 Apr 2016, at 11:14, Igor Mironchik  wrote:
>
>
>
> On 11.04.2016 12:57, Gian Maxera wrote:
>
> If the Text is inside the generated rectangle into the repeater you don’t
> need to generate different Ids, you can do that:
>
> Repeater {
>   model: 10
>   delegate: Rectangle {
>  id: cellRect
>  Text {
> anchor.horizontalCenter: cellRect.horizontalCenter
>  }
>   }
> }
>
> Even if the delegate has a fixed id and generated 10 times, QML will
> resolve correctly it.
>
>
> I want to rewrite my QML with chess board with Repeater. And I want to see
> the next:
>
> 
>
>
> I don’t know your current code, but If I would in your shoes, I will use a
> model representing where to put the chess items and a Grid to lay out the
> items. With Grid Item you can setup a global alignment of the items.
> I think it should work in your case.
> If you want more help, please share with us some snippet of code so I can
> understand what you need to achieve.
>
>
> Model and Grid is fine. I can place chess and rects, fine. But how to put
> letters and numbers?
>
>
>
> One solution using Column and Row instead of Grid to split Repeaters:
>
> Column {
> spacing: 0
> Row {
> // top letters
> EmptyItem { // use fixed width here so you can align the text }
> Repeater {
> model: [“A”, “B”, … “H”]
> delegate: DisplayTheLetter { … }
> }
> EmpyItem { }
> }
> // Rows with cells
> Repeater {
>model: 8
>delegate: Row {
>// number
>Text {
> // use fixed width and align left the text
> // vertical alignment with anchors
> anchors.verticalCenter: parent.verticalCenter
> text: index+1
>}
>// first row of chess board
>Repeater {
> model: chessBoardModel[index]
> delegate: ASingleCellOfChessBoard { … }
>}
>}
> }
> Row {
> // bottom letters
> EmptyItem { }
> Repeater {
> model: [“A”, “B”, … “H”]
> delegate: DisplayTheLetter { … }
> }
> EmpyItem { }
> }
> }
>
>
> Looks like a solution. Only one question is still opened... How to align
> letters and numbers in center if chess board should be resizable? I.e. I
> can't use x and y properties for that. I need anchor.horizontalCenter which
> use AnchorLine, not pixels...
>
>
>
> Thank you.
>
>
>
> Ciao,
> Gianluca.
>
>  }
>
> On 11 Apr 2016, at 10:49, Igor Mironchik < 
> igor.mironc...@gmail.com> wrote:
>
> Look. I want to generate chess board - rectangles (8x8). And I want to
> place numbers an letters on the sides. This numbers and letters should be
> anchored to centers of rectangles. I.e. I want to have something like:
>
> Text {
>anchor.horizontalCenter: cell00.horizontalCenter
> }
>
> ...
>
> On 11.04.2016 12:40, Gian Maxera wrote:
>
> Hello,
> I don’t think so.
> Why do you need it ? Maybe we can suggest to you an alternative solution.
>
> Ciao,
> Gianluca.
>
>
> On 11 Apr 2016, at 10:38, Igor Mironchik  wrote:
>
> Hello,
>
> Is it possible to generate id of item in Repeater, for example?
>
> Thank you.
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
>
>
>
>
>
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Problem with unintentional circular dependencies between QML singletons

2016-03-30 Thread Ben Lau
Hi Elvis,

It is not allowed in QML. However, you may pass the instance of State to
MyItem as var type during construction.

On 30 March 2016 at 17:33, Elvis Stansvik <elvst...@gmail.com> wrote:

> Hi Ben,
>
> 2016-03-30 11:19 GMT+02:00 Ben Lau <xben...@gmail.com>:
> >
> > I usually have many singleton components in my app. I would break them
> down
> > into different packages to avoid circular dependence.
>
> Yes, I realized that this is a possible workaround: If I would move
> the Style.qml in my example into a package "styles" and do import
> "styles" instead of import "." in MyItem.qml, it would work without
> problems.
>
> But what about my latest message, what if MyItem needs to access some
> state in the State singleton, but the State singleton also needs to
> have a MyItem property (as part of the state). Would that be in any
> way possible, or is it simply not allowed? The more I think about it
> the more I realize that's probably the case.
>
> Elvis
>
> >
> > On 30 March 2016 at 17:06, Elvis Stansvik <elvst...@gmail.com> wrote:
> >>
> >> 2016-03-30 11:00 GMT+02:00 Elvis Stansvik <elvst...@gmail.com>:
> >> > Hi all,
> >> >
> >> > I have a problem that I think is due to QTBUG-39703 [1] and
> >> > QTBUG-34418 [2], but perhaps there's a smart workaround.
> >> >
> >> > Imagine the following setup:
> >> >
> >> > dir/
> >> > main.qml   The main file
> >> > MyItem.qml   Some item, uses Style
> >> > Style.qml   Some colors et.c.
> >> > State.qml   Some application-wide state (uses MyItem, see
> >> > below!)
> >> > qmldir
> >> >
> >> > with contents as follows:
> >> >
> >> >
> >> >  main.qml
> >> > import QtQuick 2.4
> >> >
> >> > MyItem {
> >> > }
> >> >
> >> >
> >> >  MyItem.qml
> >> > import QtQuick 2.4
> >> > import "." // required due to QTBUG-34418
> >> >
> >> > Rectangle {
> >> > color: Style.backgroundColor
> >> > }
> >> >
> >> >
> >> >  Style.qml  --  Some colors et.c.
> >> > pragma Singleton
> >> >
> >> > import QtQuick 2.4
> >> >
> >> > QtObject {
> >> > readonly property color backgroundColor: "#abc"
> >> > }
> >> >
> >> >
> >> >  State.qml  --  Some application-wide state.
> >> > pragma Singleton
> >> >
> >> > import QtQuick 2.4
> >> >
> >> > QtObject {
> >> > property int someState: 1  // This is fine.
> >> >
> >> > // But what if we need to keep a MyItem as state
> >> > // like below? It would lead to a process exit with
> >> > // status 255 because this singleton will implicitly
> >> > // import MyItem.qml, which in turn must import "."
> >> > // to access the Style.qml singleton (due to
> >> > // QTBUG-34418), and this will bring in State.qml
> >> > // again -> circular dependency :/
> >> >
> >> > //property MyItem someItem: MyItem {}
> >> >
> >> > // Uncomment the above -> Process exits with 255 due to
> QTBUG-39703
> >> > }
> >> >
> >> > This last file shows the problem, if the application state in the
> >> > State.qml singleton includes a MyItem, I get a circular dependency
> >> > leading to a process exit with status 255.
> >> >
> >> > Is there some way around this conundrum? It's the requirement to make
> >> > an explicit import "." to get the Style singleton (due to QTBUG-39703)
> >> > that really spoils it I think :/
> >> >
> >> > The qmldir file is:
> >> >
> >> > singleton Style 1.0 Style.qml
> >> > singleton State 1.0 State.qml
> >> > MyItem 1.0 MyItem.qml
> >> >
> >> > Surely someone has used multiple singletons like this?
> >>
> >> And I realized that, eventhough my example did not show it, it's
> >> likely that MyItem would have a dependency on State.qml (the
> >> application-wide state singleton), so there would indeed be a circular
> >> dependency as far as imports go, but not a real circular dependency of
> >> course. That is, I would not make use of the MyItem property of the
> >> singleton from MyItem itself. Can QML not cope with such a situation
> >> currently?
> >>
> >> Elvis
> >>
> >> >
> >> > Cheers,
> >> > Elvis
> >> >
> >> > [1] https://bugreports.qt.io/browse/QTBUG-39703
> >> > [2] https://bugreports.qt.io/browse/QTBUG-34418
> >> ___
> >> Interest mailing list
> >> Interest@qt-project.org
> >> http://lists.qt-project.org/mailman/listinfo/interest
> >
> >
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Problem with unintentional circular dependencies between QML singletons

2016-03-30 Thread Ben Lau
I usually have many singleton components in my app. I would break them down
into different packages to avoid circular dependence.

On 30 March 2016 at 17:06, Elvis Stansvik  wrote:

> 2016-03-30 11:00 GMT+02:00 Elvis Stansvik :
> > Hi all,
> >
> > I have a problem that I think is due to QTBUG-39703 [1] and
> > QTBUG-34418 [2], but perhaps there's a smart workaround.
> >
> > Imagine the following setup:
> >
> > dir/
> > main.qml   The main file
> > MyItem.qml   Some item, uses Style
> > Style.qml   Some colors et.c.
> > State.qml   Some application-wide state (uses MyItem, see
> below!)
> > qmldir
> >
> > with contents as follows:
> >
> >
> >  main.qml
> > import QtQuick 2.4
> >
> > MyItem {
> > }
> >
> >
> >  MyItem.qml
> > import QtQuick 2.4
> > import "." // required due to QTBUG-34418
> >
> > Rectangle {
> > color: Style.backgroundColor
> > }
> >
> >
> >  Style.qml  --  Some colors et.c.
> > pragma Singleton
> >
> > import QtQuick 2.4
> >
> > QtObject {
> > readonly property color backgroundColor: "#abc"
> > }
> >
> >
> >  State.qml  --  Some application-wide state.
> > pragma Singleton
> >
> > import QtQuick 2.4
> >
> > QtObject {
> > property int someState: 1  // This is fine.
> >
> > // But what if we need to keep a MyItem as state
> > // like below? It would lead to a process exit with
> > // status 255 because this singleton will implicitly
> > // import MyItem.qml, which in turn must import "."
> > // to access the Style.qml singleton (due to
> > // QTBUG-34418), and this will bring in State.qml
> > // again -> circular dependency :/
> >
> > //property MyItem someItem: MyItem {}
> >
> > // Uncomment the above -> Process exits with 255 due to QTBUG-39703
> > }
> >
> > This last file shows the problem, if the application state in the
> > State.qml singleton includes a MyItem, I get a circular dependency
> > leading to a process exit with status 255.
> >
> > Is there some way around this conundrum? It's the requirement to make
> > an explicit import "." to get the Style singleton (due to QTBUG-39703)
> > that really spoils it I think :/
> >
> > The qmldir file is:
> >
> > singleton Style 1.0 Style.qml
> > singleton State 1.0 State.qml
> > MyItem 1.0 MyItem.qml
> >
> > Surely someone has used multiple singletons like this?
>
> And I realized that, eventhough my example did not show it, it's
> likely that MyItem would have a dependency on State.qml (the
> application-wide state singleton), so there would indeed be a circular
> dependency as far as imports go, but not a real circular dependency of
> course. That is, I would not make use of the MyItem property of the
> singleton from MyItem itself. Can QML not cope with such a situation
> currently?
>
> Elvis
>
> >
> > Cheers,
> > Elvis
> >
> > [1] https://bugreports.qt.io/browse/QTBUG-39703
> > [2] https://bugreports.qt.io/browse/QTBUG-34418
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Moving from Parse

2016-03-28 Thread Ben Lau
Amazon (Mobile Hub , DynamoDB, Lambda, API Gateway, Cognito) can be an
alternative solution to Parse. And Amazon have C++ SDK available now.

Introducing the AWS SDK for C++ | AWS Blog



On 29 March 2016 at 02:12, Nuno Santos  wrote:

> Hi,
>
> Since Parse announced it’s shutdown I have been looking for a pain free
> and scaling solution.
>
> The most difficult problem is to find a baas/daas that has a C++ client
> lib. All platforms out there only provide REST API as an alternative to iOS
> and Android libs.
>
> Question: what are you people using for baas/daas of your Qt based
> applications?
>
> Thanks,
>
> Regards
>
> Nuno
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Structuring of QML app as set of interlinked screens for maximum code reuse

2016-03-22 Thread Ben Lau
If I understand your question correctly, you may use alias property to
point to children of main / navigation bar. In Angular JS, they call this
feature as "transclude".

For example,

Screen.qml:

Item {
 property alias main : mainContainer.children
}

CustomScreen.qml:

Screen {
  main: Item {
  }
}

A working example:
https://github.com/benlau/quickandroid/blob/master/QuickAndroid/Page.qml#L23



On 23 March 2016 at 03:19, Elvis Stansvik  wrote:

> 2016-03-22 20:13 GMT+01:00 Elvis Stansvik :
> > Hi all,
> >
> > I'm working on a fullscreen Qt Quick/QML app (for machine control)
> > which will consist of a set of interlinked screens, with key presses
> > as the only interaction method.
> >
> > Each screen will have roughly the following QML structure:
> >
> > Rectangle {
> >
> > NavBar {
> > id: topBar
> > ...
> > controls for navigation and information stuff,
> > different depending on which screen
> > ...
> > }
> >
> > Rectangle {
> > id: topSeparator
> > ...
> > aesthetic divider rectangle between top nav bar and content.
> > ...
> > }
> >
> > Rectangle {
> > id: content
> > ...
> > main content here, different depending on which screen.
> > ...
> > }
> >
> > Rectangle {
> > id: bottomSeparator
> > ...
> > aesthetic divider rectangle between top nav bar and content.
> > ...
> > }
> >
> > NavBar {
> > id: bottomBar
> > ...
> > controls for navigation and information stuff,
> > different depending on which screen
> > ...
> > }
> > }
>
> To clarify, think of NavBar as just another Rectangle in the example
> above. It's just a custom item with some common visual properties.
>
> Elvis
>
> >
> > And I'm now trying to find a good structure that will minimize
> > repetition of QML code.
> >
> > I understand that QMLs main model for code reuse is composition, but
> > that it also has a form of "inheritance": by defining a new Item in a
> > separate file using another Item as the top level item and redefining
> > some of its properties, I'm sort of inheriting that item.
> >
> > I could save the above general structure in a Screen.qml, and in
> > FooScreen.qml, BarScreen et.c. do:
> >
> > Screen {
> > ...
> > override some properties
> > ...
> > }
> >
> > But this will only allow me to redefine properties, and add new child
> > items. How would I then be able to define both which content goes in
> > the main area (the content Rectangle in the "base" item) and in the
> > two navigation bars (topBar and bottomBar Rectangles)?
> >
> > It seems QML is not really meant to be used this way, and I'd have to
> > essentially redefine these things in each of my screens, even if
> > they'll all have the same general structure? There's no "template"
> > mechanism so to speak?
> >
> > I'm very thankful for any tips from people more experienced with Quick /
> QML.
> >
> > And if you know of a well designed full screen QML app modeled as a
> > set of interlinked screens with keyboard navigation, I'm idle ears.
> >
> > Cheers,
> > Elvis
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Development] Setup CI service

2016-02-06 Thread Ben Lau
On 6 February 2016 at 18:15, Ben Lau <xben...@gmail.com> wrote:

>
>
> On 5 February 2016 at 18:50, Ben Lau <xben...@gmail.com> wrote:
>
>>
>>
>> On 5 February 2016 at 17:25, Ben Lau <xben...@gmail.com> wrote:
>>
>>>
>>>
>>> On 28 January 2016 at 18:31, Koehne Kai <kai.koe...@theqtcompany.com>
>>> wrote:
>>>
>>>>
>>>> You can pass a control script also to an existing installer, via
>>>> command line.
>>>>
>>>> ./installer.exe --script myscript.js
>>>>
>>>> Regards
>>>>
>>>> Kai
>>>>
>>>>
>>> Awesome!
>>>
>>> But I still don't know how to control the installer. Any tips or sample
>>> program?
>>>
>>>
>> I mean I don't know how to write the script.
>>
>>
> Finally I have figured out a way to write the script. But that works with
> qt installer framework only, not the official Qt installer.
>
> https://github.com/benlau/qtci/blob/master/bin/extract-ifw
>

A bit tricky, but now it works for official Qt installer too.

https://github.com/benlau/qtci/blob/master/bin/extract-qt-installer

thx
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Development] Setup CI service

2016-02-06 Thread Ben Lau
On 5 February 2016 at 18:50, Ben Lau <xben...@gmail.com> wrote:

>
>
> On 5 February 2016 at 17:25, Ben Lau <xben...@gmail.com> wrote:
>
>>
>>
>> On 28 January 2016 at 18:31, Koehne Kai <kai.koe...@theqtcompany.com>
>> wrote:
>>
>>>
>>> You can pass a control script also to an existing installer, via command
>>> line.
>>>
>>> ./installer.exe --script myscript.js
>>>
>>> Regards
>>>
>>> Kai
>>>
>>>
>> Awesome!
>>
>> But I still don't know how to control the installer. Any tips or sample
>> program?
>>
>>
> I mean I don't know how to write the script.
>
>
Finally I have figured out a way to write the script. But that works with
qt installer framework only, not the official Qt installer.

https://github.com/benlau/qtci/blob/master/bin/extract-ifw
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Development] Setup CI service

2016-02-05 Thread Ben Lau
On 28 January 2016 at 18:31, Koehne Kai  wrote:

>
> You can pass a control script also to an existing installer, via command
> line.
>
> ./installer.exe --script myscript.js
>
> Regards
>
> Kai
>
>
Awesome!

But I still don't know how to control the installer. Any tips or sample
program?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Development] Setup CI service

2016-02-05 Thread Ben Lau
On 5 February 2016 at 17:25, Ben Lau <xben...@gmail.com> wrote:

>
>
> On 28 January 2016 at 18:31, Koehne Kai <kai.koe...@theqtcompany.com>
> wrote:
>
>>
>> You can pass a control script also to an existing installer, via command
>> line.
>>
>> ./installer.exe --script myscript.js
>>
>> Regards
>>
>> Kai
>>
>>
> Awesome!
>
> But I still don't know how to control the installer. Any tips or sample
> program?
>
>
I mean I don't know how to write the script.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Development] Setup CI service

2016-01-28 Thread Ben Lau
On 27 January 2016 at 18:18, Koehne Kai <kai.koe...@theqtcompany.com> wrote:

> (moving this from development@ to interest@)
>
> -Original Message-----
> > From: Ben Lau [mailto:xben...@gmail.com]
> > Sent: Wednesday, January 27, 2016 11:14 AM
> > To: Koehne Kai <kai.koe...@theqtcompany.com>
> > Cc: developm...@qt-project.org
> > Subject: Re: [Development] Setup CI service
> >
> >
> >
> > On 27 January 2016 at 18:09, Koehne Kai <kai.koe...@theqtcompany.com
> > <mailto:kai.koe...@theqtcompany.com> > wrote:
> >
> >
> >
> >
> >   > -Original Message-
> >   > From: Ben Lau [mailto:xben...@gmail.com
> > <mailto:xben...@gmail.com> ]
> >   > Sent: Wednesday, January 27, 2016 10:57 AM
> >   > To: Koehne Kai <kai.koe...@theqtcompany.com
> > <mailto:kai.koe...@theqtcompany.com> >
> >   > Cc: developm...@qt-project.org <mailto:development@qt-
> > project.org>
> >   > Subject: Re: [Development] Setup CI service
> >   >
> >   >
> >   >
> >   > On 27 January 2016 at 16:12, Koehne Kai
> > <kai.koe...@theqtcompany.com
> > <mailto:kai.koe...@theqtcompany.com>
> >   > <mailto:kai.koe...@theqtcompany.com
> > <mailto:kai.koe...@theqtcompany.com> > > wrote:
> >   >
> >   >
> >   >
> >   >
> >   >   > -Original Message-
> >   >   > From: Ben Lau [mailto:xben...@gmail.com
> > <mailto:xben...@gmail.com>
> >   > <mailto:xben...@gmail.com <mailto:xben...@gmail.com> > ]
> >   >   >[...]
> >   >   > Hi Kai,
> >   >   >
> >   >   > I mean the official Qt offline installer (Linux)
> downloaded
> > from
> >   >   > https://download.qt.io/archive/qt/5.5/
> >   >   >
> >   >   > Before Qt 5.5, it could be run in command line
> environment
> > and
> >   > extract its
> >   >   > content by " --dump-binary-data". But this options has
> been
> >   > dropped.
> >   >
> >   >   It got moved to an extra executable called 'devtool'.  You
> can
> > still
> >   > use it
> >   >   by getting the IFW itself, e.g. from
> >   >   http://download.qt.io/official_releases/qt-installer-
> >   > framework/2.0.1/ ,
> >   >   and launching devtool with the installer as an argument.
> >   >
> >   > But how can I install devtool in command line environment?
> >
> >   This is a bit of a chicken-and-egg problem indeed (that is, if you
> > really want to start with a completely clean slate. The devtools version
> > doesn't have to necessarily match exactly the installer version).
> >
> >
> >
> >
> > That is the exact problem. I think it need to have a command line
> installable
> > ifw to get started . (e.g a PPA in Ubuntu)
> >
> >
> >
> >   >   Anyhow, also the installer itself can be scripted & execute
> >   > automatically.
> >   >
> >   > Any example?
> >
> >   http://doc.qt.io/qtinstallerframework/qt-installer-framework-
> > quitinstaller-example.html
> >
> >   (Note though that the Qt Account page isn't part of this example,
> > since it's not part of the general IFW. But I guess you can just add
> another
> > "Next" for this page ...)
> >
> >
> >
> > A bit confused. That is the instruction to build a installer or
> manipulate an
> > existing installer?
>
> Sorry, my fault. The example I meant was at
>
> https://codereview.qt-project.org/#/c/113141/
>
> But it never got integrated :( Still, it should work.
>
> Regards
>
> Kai
>

In fact, I think it should be on development mailing list becoz of the
"chicken and egg" problem.

Anyway, I think your example just show how to pack custom installer , but
not asking an existing installer (e.g official offline installer from qt.io)
to run. Am I correct?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QtArg version 2.0.0

2016-01-26 Thread Ben Lau
On 26 January 2016 at 19:52, Igor Mironchik 
wrote:

> Hi,
>
> On 26.01.2016 14:11, Nikos Chantziaras wrote:
>
>> On 25/01/16 13:48, Igor Mironchik wrote:
>>
>>> Hello guys,
>>>
>>> I'm glad to present QtArg version 2.0.0
>>>
>>> In new version were
>>>
>>>   * implemented commands in command line,
>>>   * improved hierarchy of argument classes,
>>>   * improved help system,
>>>   * improved syntax,
>>>   * fixed different issues.
>>>
>>
>> Maybe it would be a good idea to tell people what the heck this is first
>> :-P
>>
>
> Sorry, I thought that many people know about QtArg. It's very simple.
> QtArg - this is classes to parse command line arguments. Like
> QCommandLineOption and QCommandLineParser, but with support of commands,
> i.e., for example, "git add file.txt" - "add" - this is command... :)
>
>
Hi Igor,

Interesting. I would suggest to add a license file or stay the license of
your library in README.md.

Moreover, will you consider to publish your library on qpm.io ?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt component repositories

2016-01-26 Thread Ben Lau
I have tried to use inqlude command line client but I could only use the
"download" function. I don't know which library is "installable". If I
understand correctly, inqlude is a tool to download and install library to
system.

Then its concept is different than qpm. qpm manages the library dependence
of your application. It don't install anything to system. Instead, it read
from application's qpm.json and install all the source code of depended
libraries with specific version in source directory.

It will extract all the source code and create a vendor.pri that include
all the installed libraries. So that user just need to add vendor.pri to
their .pro file to use those libraries.

It is very convenience. Just type a single command and you could get all
the libraries. And it could ensure all the developers use same version of
library.

Moreover, last time I push a package to inqlude and takes 3 weeks to get
merged, but I could publish a new package in qpm.io without any delay.


On 26 January 2016 at 21:33, Dmitry Volosnykh <dmitry.volosn...@gmail.com>
wrote:

> Igor, inqlude should provide mentioned functionality, too. See
> http://inqlude.org/get.html
>
> On Tue, Jan 26, 2016 at 4:01 PM Igor Mironchik <igor.mironc...@gmail.com>
> wrote:
>
>>
>>
>> On 26.01.2016 15:24, André Somers wrote:
>>
>>
>>
>> Op 26/01/2016 om 13:00 schreef Ben Lau:
>>
>>
>>
>> Moreover, will you consider to publish your library on qpm.io ?
>>
>>
>> What's the difference between qpm.io and inqlude.org?
>>
>>
>> As I understood on inqlude.org you can look at the web page and click
>> links...
>>
>> On qpm.io you can use tool qpm to search package by the given key-words
>> and install from the same tool, named qpm... :)
>>
>>
>> André
>>
>>
>>
>> ___
>> Interest mailing 
>> listInterest@qt-project.orghttp://lists.qt-project.org/mailman/listinfo/interest
>>
>>
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Standardized StackView navigation

2016-01-18 Thread Ben Lau
Beside those signals, transition effect should be able to set per view.

In fact, I have already did similar thing in QuickAndroid project. I call
it PageStack.

https://github.com/benlau/quickandroid/blob/master/QuickAndroid/Page.qml
https://github.com/benlau/quickandroid/blob/master/QuickAndroid/PageStack.qml

However, entered/exited signals are not enough. I further break down into
appear / disappear / present / dismiss signals. And it is emitted by Page
component instead of PageStack. Becoz Page component usually need this
those signals to refresh / save content.





On 19 January 2016 at 01:23, Jason H  wrote:

> What are your thoughts with extending StackView (maybe a derived class
> called 'ScreenStack' or 'ActivityStack')
>
> I've done a number of mobile-paradigm based apps, and seem to be
> convergently evolving the same pattern.
>
> main.qml {
> ScreenStack {}
> Screen1 {}
> Screen2 {}
> Screen3 {}
> Screen4 {}
> }
>
> Screen.qml {
> visible: false
> // lifecycle
> signal created();
> signal entered();
> signal exited();
> signal destroyed();
> // navigation
> signal next();
> signal back();
> }
>
> ScreenX.qml {
>  Screen {
>  }
> }
>
> Which is similar to android, minus the pause/resume. (
> http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle
> )
>
> I figure it would be cool to have a 'ScreenView' that would properly
> instrument the lifecycle, and potentially the navigation.
> Currently, I implement entered/exited with onVisibleChanged, destroyed is
> not implemented, and created is Component.onCompleted.
>
> I also have used this to implement dynamic workflows. To avoid Apple app
> store restrictions, a JSON object was retrieved from the server which
> contained the names of QML files, which existed locally in the application,
> with a trivial decision tree to decide the next screen. In this case, each
> screen was dynamically created.
>
> Thoughts?
>
>
>
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt 5.5.1+ Android Activity Theme & OpenGL

2016-01-05 Thread Ben Lau
Hi Mark,

Please check the step 3 in this article:.

https://medium.com/@benlaud/complete-guide-to-make-a-splash-screen-for-your-qml-android-application-567ca3bc70af#.yatvhxgqp



On 5 January 2016 at 21:57, mark diener  wrote:

> Bogdan:
>
> Thanks for your answers on the previous gradle issues.
>
> During your work on QtActivity, did you ever try to create use a custom
> theme?
>
> The native Splash screen for Qt is rooted in a java function, but that
> function executes way AFTER java inflation.
>
> So attaching the custom theme to the QtActivity should in theory cause
> it to appear immediately, then Android will proceed to
> deflate the classes.dex and all the other stuff while the use has
> something nice to look at.
>
> I was able to create a custom theme and attach it to the android
> QtActivity in Manifest.xml.
>
> 
>
> But it seems the initial color of the surface for OpenGL is black, so
> there is no getting around the initial shader color
> when you initialize the OpenGL surface.
>
> What are your thoughts?
>
> Where does one look to find the script files used by QtCreator when a
> kit is added?
>
> I would like to change the default Manifest.xml to add a theme
> whenever a new project is created.  yes, I can currently edit the
> manifest.xml file directly.
>
> Also, I would like to select which is the initial color of the OpenGL
> surface during initialization.  Looks like I would have to rebuild QT
> to get access to that.
>
> Cheers,
>
> md
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [QML] Need advice on frontend architecture

2015-12-02 Thread Ben Lau
On 2 December 2015 at 06:14, Ronan Jouchet <ronan.jouc...@cadensimaging.com>
wrote:

> On 11/18/2015 12:35 PM, Ben Lau wrote:
>
>> I think there is no popular recommended frontend architecture for
>> QML application yet. And I would like to make one.
>>
>> Since I also code in React/Flux, and it should be a good choice for QML
>> application too. Therefore, I have started a project called QuickFlux to
>> allow people to write their application in a Flux way:
>>
>> https://github.com/benlau/quickflux
>>
>> It provides AppDispatcher plus utility components for QML and C++.
>>
>
> Thanks Ben! (and sorry for the late answer), I'm giving it a try.
>
> At first glance it fulfills its promise, but I'm not sure I'd use it: it's
> indeed close to the Flux API, but would be a heavy change to introduce that
> feels like a lot of fight-against-the-framework trouble.
>
> (I'm not criticizing your solution -which does look awesome!- and I have
> no doubt you know how to work its quirks when they happen. I'm just
> pointing out I'm a Qt newcomer still learning the ropes, and am wary of
> introducing opinionated dependencies I don't control.)
>

Never mind. I understand that there has something will make people
confusing and documentation is not clear yet. It will be great to hear what
people actually think about it.

In fact, the core design of QML, React and even Angular JS are totally
different. Therefore, Flux architecture framework may not be applied in Qt
completely

AngularJS: Two way data binding
QML: One way data binding
React: Store -> Emit Change event -> Re-render

React only apply the "diff" from previous render and current render. That
is why it could achieve a very fast performance.

However, QML did similar things too.The Qt Scene Graph only render the
changed part of screen. Therefore, data binding will not really cause any
performance issue to QML application unless it is poorly designed.

And in fact, it is not possible to write QML application in a way like
React's render loop. If you code in React mind set, there must be a trouble.

Ofcoz you could still declare store component and emit change event for
other view component to fetch data. That will be closer to React style.

Anyway, Qt and React are totally different. You can't avoid
fight-against-the-framework troubles. ;)


>
> I was more hoping for some documentation or blog post helping me
> re-structure our QML in a way that, with 20% of effort:
>   A. Delivers an 80% of the simplicity/maintainability of Flux (or
>  any MVC/MVVM approach helping client state isolation)...
>   B. ... in a way that stays QML-ish and only relies on vanilla QML
>  building blocks.
>
> Examples/talk of such a QML architecture still very welcome :)
>
>
I don't think you could make a Flux like application with using vanilla QML
building blocks.


> On 11/18/2015 12:35 PM, Ben Lau wrote:
>
>> I think it should be fine to code regular GUI application in Qt's
>> javascript engine. In my case, I did made a program to solve a graph
>> problem. Finally I have switched back to C++ code.
>>
>
> Out of curiosity, what made you switch back?


> Finally, for anyone interested in these topics, check out this excellent
> presentation from Thomas McGuire at Qt World Summit 2015, it has some great
> tips (and some controversial ones, one of them being "Avoid JS in QML, just
> do C++").
> [Effective QML] https://www.youtube.com/watch?v=vzs5VPTf4QQ
>
> Thanks.
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [QML] Need advice on frontend architecture

2015-11-18 Thread Ben Lau
Hi Ronan,


On 19 November 2015 at 00:14, Ronan Jouchet  wrote:

> Hi.
>
> I recently joined a nascent QML project with the objective to bring it
> from the "working prototype" stage to something maintainable and efficient.
>
> Previously, my last GUI work was on a web application using React [1] +
> Flux [2], which I *loved* for the mental simplicity and testability their
> functional model brings (i.e: update the state, be confident that {1. the
> view is updated, 2. with good performance regardless of the state mutation
> complexity / number of bindings}).
>
> Now, back to QML, looking at the documentation, examples, and a few blog
> posts,
>
> - I find a good overview of QML language constructs
>
> - ... as well as tons of simple, mostly stateless widget examples
>
> , but:
>
> - I have yet to encounter frontend architecture recommendations (like Flux)
>
>
I think there has no any popular recommended frontend architecture for QML
application yet. And I would like to make one.

Since I also code in React/Flux, and it should be a good choice for QML
application too. Therefore, I have started a project called QuickFlux to
allow people to write their application in a Flux way:

https://github.com/benlau/quickflux

It provides AppDispatcher plus utility components for QML and C++.

I am still finding a best way to adopt Flux in QML application. If you have
any suggestion / question, please feel free to ask.

- I often stumble on QML constructs that push me into
> one-component-directly-mutating-another corners. Drinking the React
> kool-aid made me very wary of those, and I'd now actively avoiding them
> because they can quickly lead to spaghetti. For example, QML states [3],
> and direct mutations using `parent`, `root`, or accessing by id.
>
> So, as you can expect, I'm trying to bring a Flux-ish approach to our QML
> app, by creating central data stores encapsulating {a. my application state
> as pure data, b. functions to manipulate the state}, and making my QML
> components depend on this pure data.
>
> But so far it feels like I'm swimming against the tide, plus:
>
> - I have little idea how performance will evolve down the road.
>
> - Contrarily to the web application mentioned in the introduction, I also
> have to mix my JS state with C++ classes instantiated in my QML, also
> bringing their own state, which I use too in QML.
>
> - My store-observing logic implies regularly using `onXyzChanged` signal
> handlers (e.g. to re-generate a ListModel when the source Array changes),
> which means bring Data Store attribute `xyz` to the local QML component
> scope, which isn't feasible with a current-scope-limited aliases [4], so
> I'm using ordinary property references (property var cheeses:
> dataStoreInventory.cheeses;), which "allocates a new, unique storage space
> for the property", effectively doubling the memory usage of my state, with
> unknown memory leaking behavior.
>
>
If you write in strict Flux way, you may add a "updated" signal to your
store. And update your UI whatever you have captured the signal.

It is not really a common practise for QML, but it is just a matter of do
you feel comfortable with it.


> - I'm reading lots of very affirmative, but sometimes old, and often
> poorly researched articles encouraging QML developers to avoid JS and do
> all the logic in C++, save for basic widget arithmetic. As a web developer,
> the productivity benefits of JS are obvious to me (plus the library
> availability, *when* libraries are content with the exotic JS environment
> provided by QML, but that's another question), but these claims are
> starting to make me wary of too much JS in my QML app. Or maybe these
> cautionary tales are just instances of good tools badly used yielding bad
> results? Anyway I'm wondering how much JS is reasonable in a long-running
> QML app with serious performance expectations (calculations and heavy 2d/3d
> in C++, QML gui)
>
>
I think it should be fine to code regular GUI application in Qt's
javascript engine. In my case, I did made a program to solve a graph
problem. Finally I have switched back to C++ code.


> As you can guess, I'm lost in all this. Do you have battlefield-tested
> advice/links to structure QML apps? Thanks for your help.
>
> [1] https://facebook.github.io/react/
> [2] https://facebook.github.io/flux/
> [3] http://doc.qt.io/qt-5/qtquick-statesanimations-states.html
> [4]
> http://doc.qt.io/qt-5/qtqml-syntax-objectattributes.html#property-aliases
>
> --
> Ronan
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QuickModel - ORM for QML

2015-11-17 Thread Ben Lau
Hi Daniel,

Your project is interesting. Good Job. By the way, will you be interested
to publish it on qpm.io ?


On 16 November 2015 at 06:35, Daniel França  wrote:

> Hi guys,
> I've developed an ORM library for QML.
>
> The main intention was to use it for some of my projects, but as I've seen
> a lack of this kind of library for QML I'm making open-source on my github:
> https://github.com/danielfranca/quickmodel
>
> It's very simple and easy to use, basically it's only a single file that
> you can import in your project.
> The interface is inspired on Django ORM, so you can expect very similar
> method signatures:
> var artists_johnny = Artist.filter({name__like: ‘Johnny’}).limit(3).all();
>
> The documentation is available (but it's under construction) here:
> http://quickmodel.readthedocs.org/en/latest/
>
> Please let me know what you think about it, any feedback is welcome ;)
>
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt interfacing to Android native UI ?

2015-11-04 Thread Ben Lau
Not really a solution for wrapping Android UI in Qt app. But I have already
developed an image picker with native UI and communication library between
Qt and Java/Android. May be it could used as example / core framework.

Image Picker
https://github.com/benlau/quickandroid/blob/DEV/QuickAndroid/ImagePicker.qml

System Dispatcher - Invoke Java/Android function and vice visa without
using JNI. Data type conversion is handled automatically.

https://github.com/benlau/quickandroid/blob/DEV/qasystemdispatcher.h



On 5 November 2015 at 15:36, Robert Iakobashvili 
wrote:

> Dear Ed,
> It seems that I have something native for iOS, but not for Android.
>
> I was thinking now about another path to take:
>
> 1. Common layer - with business app logic;
>
> 2. Presentation layer with the below options:
>
> 2.1 Qt Desktop layer to cover Win, Mac and Linux;
> 2.2 iOS-Native;
> 2.3 Android-Native.
>
> Please, update us on your success of co-existence between
> Qt-Widgets and QML and whether after adding QML it is still
> sustains tough memory environment on iOS and low-memory
> Android devices.
>
> Thank you in advance.
>
> Regards,
> Robert
>
>
> On Tue, Nov 3, 2015 at 5:12 PM, Edward Sutton 
> wrote:
> > I know I can use native iOS UI by mixing Objective-C++ and C++ in the
> same *.mm file.
> >
> > I have done a little Android JNI.  Are there any examples for
> interfacing to Android native UI elements?
> >
> > I need to create a UI picker for manually entering GPS latitude and
> longitude in degrees,  or degrees, minutes, seconds for a widgets app.  I
> expect it will be hard to make a touch usable widget UI picker.  Developing
> a native interface may take similar amount of time but result will be much
> superior.
> >
> > Thank you for your advice,
> >
> > -Ed
> > This email and any files transmitted with it from The Charles Machine
> Works, Inc. are confidential and intended solely for the use of the
> individual or entity to which they are addressed. If you have received this
> email in error please notify the sender. Our company accepts no liability
> for the contents of this email, or for the consequences of any actions
> taken on the basis of the information provided, unless that information is
> subsequently confirmed in writing. Please note that any views or opinions
> presented in this email are solely those of the author and do not
> necessarily represent those of the company. Finally, the recipient should
> check this email and any attachments for the presence of viruses. The
> company accepts no liability for any damage caused by any virus transmitted
> by this email.
> > ___
> > Interest mailing list
> > Interest@qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/interest
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to create a library with Android java source

2015-10-24 Thread Ben Lau
What is your Qt and Qt Creator version?

On 24 October 2015 at 17:04, Gianluca <gmax...@gmail.com> wrote:

> Hello Ben,
> I’ve no problem on running the app on Android. My app as a custom Activity
> and java LiveWallpapers, no problem at all on compiling these java files.
> The android-build directory is there and contains all files I specified
> into my .pro with ANDROID_PACKAGE_SOURCE_DIR.
> Then, I have a QFacebookBinding.java that I want to move outside the .pro
> and make as its own library.
> So, I created a qtfacebook.pri, I added the code as you suggested and I
> included .pri into my .pro.
> The only missing JAVA files are the ones listed into QA_JAVASRC … and I
> don’t know why they are missing.
>
> If I open the Terminal and I manually run “make install” … it successfully
> copy also the QA_JAVASRC files. But If I run the build from Qt Creator,
> those files are not copied :-(
>
> Ciao,
> Gianluca.
>
>
> Il giorno 24/ott/2015, alle ore 02:50, Ben Lau <xben...@gmail.com> ha
> scritto:
>
>
> Those line will copy Java source files to android build directory before
> making apk file. In Qt Creator,  selected Android target , then build.
> Check your build folder. Did it contains following files?
>
> android-build/src/org/qtproject/qt5/android/bindings/QtActivity.java
> android-build/src/org/qtproject/qt5/android/bindings/QtApplication.java
> android-build/src/org/qmaxera/qtfacebook/QFacebookBinding.java
>
> p.s If QtActivity / QtApplicaiton.java is not present, it won't able to
> run on Android.
>
> If not, could you post the file list within the build folder? (Run by
> `find` command if you are running Mac/Linux) And what is your Qt and Qt
> Creator version?
>
>
>
> On 24 October 2015 at 04:39, Gianluca <gmax...@gmail.com> wrote:
>
>> Hello Ben,
>> I replicate exactly what you did in your .pri … but does not work for me.
>> It’s almost 4 hours that I’m trying to understand why … but I have no
>> clue :-(
>>
>> This is my code into .pri
>>
>>  QA_JAVASRC.path = /src/org/gmaxera/qtfacebook/
>>
>>  QA_JAVASRC.files += 
>> $$PWD/Android/src/org/gmaxera/qtfacebook/QFacebookBinding.java
>>
>>  INSTALLS += QA_JAVASRC
>>
>>
>> Why does not work for me ?
>>
>> Thanks,
>> Gianluca.
>>
>>
>> Il giorno 22/ott/2015, alle ore 11:32, Ben Lau <xben...@gmail.com> ha
>> scritto:
>>
>> Hi Gian,
>>
>> You may check my project on github. It is a Qt library for Android with
>> Java source code. In the DEV branch, it has a native image picker written
>> with Java. You could find out how to include Java source file as a library
>> from the example code.
>>
>> https://github.com/benlau/quickandroid
>>
>>
>> On 21 October 2015 at 22:43, Gian Maxera <gmax...@gmail.com> wrote:
>>
>>> Hello,
>>> I’m moving all my common source files into a library and share the code
>>> between my Qt projects.
>>> The qmake .pri file works fine … but I have problem on how to include
>>> also Java source files when the target is Android.
>>>
>>> I found this blog:
>>>
>>> http://imaginativethinking.ca/what-the-heck-how-do-i-share-java-code-between-qt-android-projects/
>>>
>>> Is there no other alternative ??
>>>
>>> To qmake developers: can we make this process easier ?
>>>
>>> Thanks,
>>> Gianluca.
>>>
>>>
>>> ___
>>> Interest mailing list
>>> Interest@qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>
>>>
>>
>>
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to create a library with Android java source

2015-10-24 Thread Ben Lau
I am using Qt 5.5.0 on Mac and it is fine. May test Qt 5.5.1 later. By the
way, could try this example project and see could it install those Java
files?

quickandroid/examples/quickandroidexample at master · benlau/quickandroid
<https://github.com/benlau/quickandroid/tree/master/examples/quickandroidexample>

On 24 October 2015 at 17:12, Gianluca <gmax...@gmail.com> wrote:

> The latest version. Qt 5.5.1 and 3.5.1
> But doesn’t work also on my PC at work that has Qt 5.5.0 and an older Qt
> Creator.
> I’m working on Mac.
>
> Ciao,
> Gianluca.
>
>
> Il giorno 24/ott/2015, alle ore 10:10, Ben Lau <xben...@gmail.com> ha
> scritto:
>
> What is your Qt and Qt Creator version?
>
> On 24 October 2015 at 17:04, Gianluca <gmax...@gmail.com> wrote:
>
>> Hello Ben,
>> I’ve no problem on running the app on Android. My app as a custom
>> Activity and java LiveWallpapers, no problem at all on compiling these java
>> files.
>> The android-build directory is there and contains all files I specified
>> into my .pro with ANDROID_PACKAGE_SOURCE_DIR.
>> Then, I have a QFacebookBinding.java that I want to move outside the .pro
>> and make as its own library.
>> So, I created a qtfacebook.pri, I added the code as you suggested and I
>> included .pri into my .pro.
>> The only missing JAVA files are the ones listed into QA_JAVASRC … and I
>> don’t know why they are missing.
>>
>> If I open the Terminal and I manually run “make install” … it
>> successfully copy also the QA_JAVASRC files. But If I run the build from Qt
>> Creator, those files are not copied :-(
>>
>> Ciao,
>> Gianluca.
>>
>>
>> Il giorno 24/ott/2015, alle ore 02:50, Ben Lau <xben...@gmail.com> ha
>> scritto:
>>
>>
>> Those line will copy Java source files to android build directory before
>> making apk file. In Qt Creator,  selected Android target , then build.
>> Check your build folder. Did it contains following files?
>>
>> android-build/src/org/qtproject/qt5/android/bindings/QtActivity.java
>> android-build/src/org/qtproject/qt5/android/bindings/QtApplication.java
>> android-build/src/org/qmaxera/qtfacebook/QFacebookBinding.java
>>
>> p.s If QtActivity / QtApplicaiton.java is not present, it won't able to
>> run on Android.
>>
>> If not, could you post the file list within the build folder? (Run by
>> `find` command if you are running Mac/Linux) And what is your Qt and Qt
>> Creator version?
>>
>>
>>
>> On 24 October 2015 at 04:39, Gianluca <gmax...@gmail.com> wrote:
>>
>>> Hello Ben,
>>> I replicate exactly what you did in your .pri … but does not work for me.
>>> It’s almost 4 hours that I’m trying to understand why … but I have no
>>> clue :-(
>>>
>>> This is my code into .pri
>>>
>>> QA_JAVASRC.path = /src/org/gmaxera/qtfacebook/
>>>
>>> QA_JAVASRC.files += 
>>> $$PWD/Android/src/org/gmaxera/qtfacebook/QFacebookBinding.java
>>>
>>> INSTALLS += QA_JAVASRC
>>>
>>>
>>> Why does not work for me ?
>>>
>>> Thanks,
>>> Gianluca.
>>>
>>>
>>> Il giorno 22/ott/2015, alle ore 11:32, Ben Lau <xben...@gmail.com> ha
>>> scritto:
>>>
>>> Hi Gian,
>>>
>>> You may check my project on github. It is a Qt library for Android with
>>> Java source code. In the DEV branch, it has a native image picker written
>>> with Java. You could find out how to include Java source file as a library
>>> from the example code.
>>>
>>> https://github.com/benlau/quickandroid
>>>
>>>
>>> On 21 October 2015 at 22:43, Gian Maxera <gmax...@gmail.com> wrote:
>>>
>>>> Hello,
>>>> I’m moving all my common source files into a library and share the code
>>>> between my Qt projects.
>>>> The qmake .pri file works fine … but I have problem on how to include
>>>> also Java source files when the target is Android.
>>>>
>>>> I found this blog:
>>>>
>>>> http://imaginativethinking.ca/what-the-heck-how-do-i-share-java-code-between-qt-android-projects/
>>>>
>>>> Is there no other alternative ??
>>>>
>>>> To qmake developers: can we make this process easier ?
>>>>
>>>> Thanks,
>>>> Gianluca.
>>>>
>>>>
>>>> ___
>>>> Interest mailing list
>>>> Interest@qt-project.org
>>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>>
>>>>
>>>
>>>
>>
>>
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to create a library with Android java source

2015-10-23 Thread Ben Lau
Those line will copy Java source files to android build directory before
making apk file. In Qt Creator,  selected Android target , then build.
Check your build folder. Did it contains following files?

android-build/src/org/qtproject/qt5/android/bindings/QtActivity.java
android-build/src/org/qtproject/qt5/android/bindings/QtApplication.java
android-build/src/org/qmaxera/qtfacebook/QFacebookBinding.java

p.s If QtActivity / QtApplicaiton.java is not present, it won't able to run
on Android.

If not, could you post the file list within the build folder? (Run by
`find` command if you are running Mac/Linux) And what is your Qt and Qt
Creator version?



On 24 October 2015 at 04:39, Gianluca <gmax...@gmail.com> wrote:

> Hello Ben,
> I replicate exactly what you did in your .pri … but does not work for me.
> It’s almost 4 hours that I’m trying to understand why … but I have no clue
> :-(
>
> This is my code into .pri
>
>   QA_JAVASRC.path = /src/org/gmaxera/qtfacebook/
>
>   QA_JAVASRC.files += 
> $$PWD/Android/src/org/gmaxera/qtfacebook/QFacebookBinding.java
>
>   INSTALLS += QA_JAVASRC
>
>
> Why does not work for me ?
>
> Thanks,
> Gianluca.
>
>
> Il giorno 22/ott/2015, alle ore 11:32, Ben Lau <xben...@gmail.com> ha
> scritto:
>
> Hi Gian,
>
> You may check my project on github. It is a Qt library for Android with
> Java source code. In the DEV branch, it has a native image picker written
> with Java. You could find out how to include Java source file as a library
> from the example code.
>
> https://github.com/benlau/quickandroid
>
>
> On 21 October 2015 at 22:43, Gian Maxera <gmax...@gmail.com> wrote:
>
>> Hello,
>> I’m moving all my common source files into a library and share the code
>> between my Qt projects.
>> The qmake .pri file works fine … but I have problem on how to include
>> also Java source files when the target is Android.
>>
>> I found this blog:
>>
>> http://imaginativethinking.ca/what-the-heck-how-do-i-share-java-code-between-qt-android-projects/
>>
>> Is there no other alternative ??
>>
>> To qmake developers: can we make this process easier ?
>>
>> Thanks,
>> Gianluca.
>>
>>
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>>
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to create a library with Android java source

2015-10-22 Thread Ben Lau
Hi Gian,

You may check my project on github. It is a Qt library for Android with
Java source code. In the DEV branch, it has a native image picker written
with Java. You could find out how to include Java source file as a library
from the example code.

https://github.com/benlau/quickandroid


On 21 October 2015 at 22:43, Gian Maxera  wrote:

> Hello,
> I’m moving all my common source files into a library and share the code
> between my Qt projects.
> The qmake .pri file works fine … but I have problem on how to include also
> Java source files when the target is Android.
>
> I found this blog:
>
> http://imaginativethinking.ca/what-the-heck-how-do-i-share-java-code-between-qt-android-projects/
>
> Is there no other alternative ??
>
> To qmake developers: can we make this process easier ?
>
> Thanks,
> Gianluca.
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Implementing tag cloud with QML

2015-09-28 Thread Ben Lau
How do you use the toggleTag? And what is the data type of element in
itemList.model?



On 28 September 2015 at 17:19, Nuno Santos  wrote:

> Hi,
>
> I was trying to implement a tag cloud with a ListView but I'm facing some
> unexpected problems. My idea was the following:
>
> A ListView would have a model of tags, based on a QStringList. Other list
> view would have items (custom model), each item would have associated tags.
> I want to concentrate the tags in a single list in the UI. So, when you
> select an item, it will display all the tags, and the ones which are
> present in that item would get highlighted.
>
> Every time I click a tag, it will toggle that tag for the respective item.
> The problem is that for some reason, ListView seems to cache the data model
> and thus it doesn’t get redrawn. Because the tags are the exactly the same.
> What changed was item tags list.
>
> Is there anyway to bypass the model cache or force the ListView to redraw?
> I can’t find any suitable method on ListView documentation.
>
> I’m not finding an obvious solution for this problem and I believe that is
> a simple solution for it. Any ideas?
>
> ListView {
> id: tagsList
> model: tags
> delegate: Rectangle {
>color: "transparent"
>border.color: "white"
>border.width: 1
>
>Text {
>id: tagLabel
>color: "gray"
>text: "#"+modelData
>Component.onCompleted: {
>var tags = itemList.model[itemList.currentIndex].tags;
>
>for (var i=0;i{
>if (tags[i]==modelData)
>color = "white"
>}
>}
>}
>
>MouseArea {
>anchors.fill: parent
>onClicked:
> itemList.model[itemList.currentIndex].toggleTag(modelData)
>}
> }
> }
>
> Thanks in advance,
>
> Regards,
>
> Nuno
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt 5.5 for ios: frameworks support seems to be broken

2015-09-28 Thread Ben Lau
Reported:

[QTBUG-48480] Qt5QuickTest should not be linked in iOS target for non-unit
test program - Qt Bug Tracker <https://bugreports.qt.io/browse/QTBUG-48480>

On 26 September 2015 at 11:54, Nuno Santos <nunosan...@imaginando.pt> wrote:

> That's awesome! :)
>
> I think this should be considered a big and must be reported.
>
> It made me waste a good hand of hours.
>
> It seems I was not the only one! ;)
>
> --
> Nuno Santos
>
> No dia 26/09/2015, às 04:14, Ben Lau <xben...@gmail.com> escreveu:
>
> HI Nuno,
>
> Thanks for you reply~
>
> I just found out what is wrong with it. In my source tree, it has a
> directory with 3rd party QML library. The library contains test code using
> QtTest which is not included in my application, but qmlimportscanner still
> treat it as a part of my program. So it add Qt5QuickTest and Qt5Test
> automatically. Remove those files can solve the problem.
>
> I wonder should it be considered as a bug? Since it will add library not
> even used in a build.
>
> On 26 September 2015 at 03:58, Nuno Santos <nunosan...@imaginando.pt>
> wrote:
>
>> In my case the problem was that I was linking to a framework called parse
>> and inside the project dir there was a parse dir. For some reason that
>> directory with the name of the framework I was linking was making the
>> linker line to become "-framework “ invalidating all the frameworks in the
>> line from that point onward. This didn’t happened on 5.4.1. I think
>> something changed on qmake. I can’t tell you exactly what it was.
>>
>> Try to link frameworks one by one and see which was is failing. You can
>> also share your linker command execution line. Maybe I can spot something.
>>
>> Regards,
>>
>> Nuno
>>
>> On 25 Sep 2015, at 20:24, Ben Lau <xben...@gmail.com> wrote:
>>
>>
>> I got similar problem after upgraded to Qt 5.5, but all frameworks are
>> linked successfully. It only complains about the linkage with XCTestCase.
>>
>> Ofcoz I didn't include any test lib in my application. And tried to clear
>> .qmake.config and .qmake.cache , but it do not help.
>>
>> I have also tried to run `qmake -d` to generate log to trace for it.
>> However, I can't find anything to tell why Qt5QuickTest / Qt5Test are
>> included.
>>
>> Any tips to trace such kind of problem?
>>
>> Undefined symbols for architecture arm64:
>>
>>   "_OBJC_METACLASS_$_XCTestCase", referenced from:
>>
>>   _OBJC_METACLASS_$_QtTestLibWrapper in libQt5Test.a(qxctestlogger.o)
>>
>>   _OBJC_METACLASS_$_QtTestLibTest in libQt5Test.a(qxctestlogger.o)
>>
>>   "_OBJC_CLASS_$_XCTestDriver", referenced from:
>>
>>   objc-class-ref in libQt5Test.a(qxctestlogger.o)
>>
>>   "_OBJC_CLASS_$_XCTestCase", referenced from:
>>
>>   _OBJC_CLASS_$_QtTestLibWrapper in libQt5Test.a(qxctestlogger.o)
>>
>>   _OBJC_CLASS_$_QtTestLibTest in libQt5Test.a(qxctestlogger.o)
>>
>>   "_OBJC_CLASS_$_XCTestSuite", referenced from:
>>
>>   objc-class-ref in libQt5Test.a(qxctestlogger.o)
>>
>>   _OBJC_CLASS_$_QtTestLibTests in libQt5Test.a(qxctestlogger.o)
>>
>>   "_OBJC_METACLASS_$_XCTestSuite", referenced from:
>>
>>   _OBJC_METACLASS_$_QtTestLibTests in libQt5Test.a(qxctestlogger.o)
>>
>>   "_OBJC_CLASS_$_XCTestProbe", referenced from:
>>
>> On 10 July 2015 at 14:55, Nuno Santos <nunosan...@imaginando.pt> wrote:
>>
>>> Curiously, it seems that qmake whipes the reference to Parse framework.
>>> Whenever -framework Parse is referenced, it removes Parse.
>>>
>>> Before -framework Bolts there was -framework Parse, if I move the
>>> -framework Parse after the Bolts, then the next one will have problems.
>>>
>>> If I remove the -frameworks Parse I will obviously have undefined
>>> references to some Parse functions and i’m having a couple others that I
>>> still don’t know where they come from:
>>>
>>> Undefined symbols for architecture armv7:
>>>   "_OBJC_CLASS_$_XCTestCase", referenced from:
>>>   _OBJC_CLASS_$_QtTestLibWrapper in
>>> libQt5Test_debug.a(qxctestlogger.o)
>>>   _OBJC_CLASS_$_QtTestLibTest in libQt5Test_debug.a(qxctestlogger.o)
>>>   "_OBJC_CLASS_$_XCTestSuite", referenced from:
>>>   objc-class-ref in libQt5Test_debug.a(qxctestlogger.o)
>>>   _OBJC_CLASS_$_QtTestLibTests in libQt5Test_debug.a(qxctestlogger.o)
>

Re: [Interest] Implementing tag cloud with QML

2015-09-28 Thread Ben Lau
May be it is not a perfect solution, I usually fix this kind of problem by
adding a timestamp of last update  ( (new Date()).getTime() ) . Then force
those items to refresh on value changes.

On 28 September 2015 at 18:36, Nuno Santos <nunosan...@imaginando.pt> wrote:

> Ben,
>
> Item is of class Item
> itemList model is of class QList<Item*>
>
> Item has the property tags which is of type QStringList
> Each item has ItemManager, the holder of itemList model, as parent
>
> On toggleTag I’m doing this:
>
> void DRCPatch::toggleTag(QString tag)
> {
> if (_tags.contains(tag))
> _tags.removeOne(tag);
> else
> _tags.append(tag);
>
> emit _manager->tagsChanged();
> }
>
> And in fact, the model is returned. I have confirmed that the model
> property has been called. However, ListView doesn’t update or re-layout if
> the items are exactly the same.
>
> If here I do _tags.append(“something”) it will update and behave as
> expected.
>
> QStringList ItemManager::tags()
> {
> return _tags;
> }
>
> Any ideas on how to work around this?
>
> Regards,
>
> Nuno
>
> On 28 Sep 2015, at 10:54, Ben Lau <xben...@gmail.com> wrote:
>
> How do you use the toggleTag? And what is the data type of element in
> itemList.model?
>
>
>
> On 28 September 2015 at 17:19, Nuno Santos <nunosan...@imaginando.pt>
> wrote:
>
>> Hi,
>>
>> I was trying to implement a tag cloud with a ListView but I'm facing some
>> unexpected problems. My idea was the following:
>>
>> A ListView would have a model of tags, based on a QStringList. Other list
>> view would have items (custom model), each item would have associated tags.
>> I want to concentrate the tags in a single list in the UI. So, when you
>> select an item, it will display all the tags, and the ones which are
>> present in that item would get highlighted.
>>
>> Every time I click a tag, it will toggle that tag for the respective
>> item. The problem is that for some reason, ListView seems to cache the data
>> model and thus it doesn’t get redrawn. Because the tags are the exactly the
>> same. What changed was item tags list.
>>
>> Is there anyway to bypass the model cache or force the ListView to
>> redraw? I can’t find any suitable method on ListView documentation.
>>
>> I’m not finding an obvious solution for this problem and I believe that
>> is a simple solution for it. Any ideas?
>>
>> ListView {
>> id: tagsList
>> model: tags
>> delegate: Rectangle {
>>color: "transparent"
>>border.color: "white"
>>border.width: 1
>>
>>Text {
>>id: tagLabel
>>color: "gray"
>>text: "#"+modelData
>>Component.onCompleted: {
>>var tags = itemList.model[itemList.currentIndex].tags;
>>
>>for (var i=0;i<tags.length;i++)
>>{
>>if (tags[i]==modelData)
>>color = "white"
>>}
>>}
>>}
>>
>>MouseArea {
>>anchors.fill: parent
>>onClicked:
>> itemList.model[itemList.currentIndex].toggleTag(modelData)
>>}
>> }
>> }
>>
>> Thanks in advance,
>>
>> Regards,
>>
>> Nuno
>>
>> ___
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>>
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt 5.5 for ios: frameworks support seems to be broken

2015-09-25 Thread Ben Lau
I got similar problem after upgraded to Qt 5.5, but all frameworks are
linked successfully. It only complains about the linkage with XCTestCase.

Ofcoz I didn't include any test lib in my application. And tried to clear
.qmake.config and .qmake.cache , but it do not help.

I have also tried to run `qmake -d` to generate log to trace for it.
However, I can't find anything to tell why Qt5QuickTest / Qt5Test are
included.

Any tips to trace such kind of problem?

Undefined symbols for architecture arm64:

  "_OBJC_METACLASS_$_XCTestCase", referenced from:

  _OBJC_METACLASS_$_QtTestLibWrapper in libQt5Test.a(qxctestlogger.o)

  _OBJC_METACLASS_$_QtTestLibTest in libQt5Test.a(qxctestlogger.o)

  "_OBJC_CLASS_$_XCTestDriver", referenced from:

  objc-class-ref in libQt5Test.a(qxctestlogger.o)

  "_OBJC_CLASS_$_XCTestCase", referenced from:

  _OBJC_CLASS_$_QtTestLibWrapper in libQt5Test.a(qxctestlogger.o)

  _OBJC_CLASS_$_QtTestLibTest in libQt5Test.a(qxctestlogger.o)

  "_OBJC_CLASS_$_XCTestSuite", referenced from:

  objc-class-ref in libQt5Test.a(qxctestlogger.o)

  _OBJC_CLASS_$_QtTestLibTests in libQt5Test.a(qxctestlogger.o)

  "_OBJC_METACLASS_$_XCTestSuite", referenced from:

  _OBJC_METACLASS_$_QtTestLibTests in libQt5Test.a(qxctestlogger.o)

  "_OBJC_CLASS_$_XCTestProbe", referenced from:

On 10 July 2015 at 14:55, Nuno Santos  wrote:

> Curiously, it seems that qmake whipes the reference to Parse framework.
> Whenever -framework Parse is referenced, it removes Parse.
>
> Before -framework Bolts there was -framework Parse, if I move the
> -framework Parse after the Bolts, then the next one will have problems.
>
> If I remove the -frameworks Parse I will obviously have undefined
> references to some Parse functions and i’m having a couple others that I
> still don’t know where they come from:
>
> Undefined symbols for architecture armv7:
>   "_OBJC_CLASS_$_XCTestCase", referenced from:
>   _OBJC_CLASS_$_QtTestLibWrapper in libQt5Test_debug.a(qxctestlogger.o)
>   _OBJC_CLASS_$_QtTestLibTest in libQt5Test_debug.a(qxctestlogger.o)
>   "_OBJC_CLASS_$_XCTestSuite", referenced from:
>   objc-class-ref in libQt5Test_debug.a(qxctestlogger.o)
>   _OBJC_CLASS_$_QtTestLibTests in libQt5Test_debug.a(qxctestlogger.o)
>   "_OBJC_CLASS_$_XCTestDriver", referenced from:
>   objc-class-ref in libQt5Test_debug.a(qxctestlogger.o)
>   "_OBJC_METACLASS_$_XCTestSuite", referenced from:
>   _OBJC_METACLASS_$_QtTestLibTests in
> libQt5Test_debug.a(qxctestlogger.o)
>   "_OBJC_CLASS_$_XCTestProbe", referenced from:
>   objc-class-ref in libQt5Test_debug.a(qxctestlogger.o)
>   "_OBJC_CLASS_$_Parse", referenced from:
>   objc-class-ref in LKAppDelegate.o
>   "_OBJC_CLASS_$_PFPush", referenced from:
>   objc-class-ref in LKAppDelegate.o
>   "_OBJC_METACLASS_$_XCTestCase", referenced from:
>   _OBJC_METACLASS_$_QtTestLibWrapper in
> libQt5Test_debug.a(qxctestlogger.o)
>   _OBJC_METACLASS_$_QtTestLibTest in
> libQt5Test_debug.a(qxctestlogger.o)
>   "_OBJC_CLASS_$_PFInstallation", referenced from:
>   objc-class-ref in LKAppDelegate.o
>
> ** BUILD FAILED **
>
> Any ideas?
>
> Thanks,
>
> Nuno
>
> > On 10/07/2015, at 01:05, Thiago Macieira 
> wrote:
> >
> > On Friday 10 July 2015 00:43:48 Nuno Santos wrote:
> >> -u _qt_registerPlatformPlugin -framework -framework Bolts
> >
> > There's one extra -framework there, so this is telling the linker to
> link to
> > framework "-framework" and then use a local file called "Bolts" as input
> > object.
> >
> > If you run qmake with the -d -d options, you'll see how it processes.
> Search
> > for what came before that double -framework and you'll find out what was
> the
> > framework that got dropped.
> >
> > If you look for the first occurrence of "-framework -framework", you'll
> find the
> > place where the framework got dropped or failed to be added.
> > --
> > Thiago Macieira - thiago.macieira (AT) intel.com
> >  Software Architect - Intel Open Source Technology Center
> >
> > ___
> > Interest mailing list
> > Interest@qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/interest
>
> ___
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt 5.5 for ios: frameworks support seems to be broken

2015-09-25 Thread Ben Lau
HI Nuno,

Thanks for you reply~

I just found out what is wrong with it. In my source tree, it has a
directory with 3rd party QML library. The library contains test code using
QtTest which is not included in my application, but qmlimportscanner still
treat it as a part of my program. So it add Qt5QuickTest and Qt5Test
automatically. Remove those files can solve the problem.

I wonder should it be considered as a bug? Since it will add library not
even used in a build.

On 26 September 2015 at 03:58, Nuno Santos <nunosan...@imaginando.pt> wrote:

> In my case the problem was that I was linking to a framework called parse
> and inside the project dir there was a parse dir. For some reason that
> directory with the name of the framework I was linking was making the
> linker line to become "-framework “ invalidating all the frameworks in the
> line from that point onward. This didn’t happened on 5.4.1. I think
> something changed on qmake. I can’t tell you exactly what it was.
>
> Try to link frameworks one by one and see which was is failing. You can
> also share your linker command execution line. Maybe I can spot something.
>
> Regards,
>
> Nuno
>
> On 25 Sep 2015, at 20:24, Ben Lau <xben...@gmail.com> wrote:
>
>
> I got similar problem after upgraded to Qt 5.5, but all frameworks are
> linked successfully. It only complains about the linkage with XCTestCase.
>
> Ofcoz I didn't include any test lib in my application. And tried to clear
> .qmake.config and .qmake.cache , but it do not help.
>
> I have also tried to run `qmake -d` to generate log to trace for it.
> However, I can't find anything to tell why Qt5QuickTest / Qt5Test are
> included.
>
> Any tips to trace such kind of problem?
>
> Undefined symbols for architecture arm64:
>
>   "_OBJC_METACLASS_$_XCTestCase", referenced from:
>
>   _OBJC_METACLASS_$_QtTestLibWrapper in libQt5Test.a(qxctestlogger.o)
>
>   _OBJC_METACLASS_$_QtTestLibTest in libQt5Test.a(qxctestlogger.o)
>
>   "_OBJC_CLASS_$_XCTestDriver", referenced from:
>
>   objc-class-ref in libQt5Test.a(qxctestlogger.o)
>
>   "_OBJC_CLASS_$_XCTestCase", referenced from:
>
>   _OBJC_CLASS_$_QtTestLibWrapper in libQt5Test.a(qxctestlogger.o)
>
>   _OBJC_CLASS_$_QtTestLibTest in libQt5Test.a(qxctestlogger.o)
>
>   "_OBJC_CLASS_$_XCTestSuite", referenced from:
>
>   objc-class-ref in libQt5Test.a(qxctestlogger.o)
>
>   _OBJC_CLASS_$_QtTestLibTests in libQt5Test.a(qxctestlogger.o)
>
>   "_OBJC_METACLASS_$_XCTestSuite", referenced from:
>
>   _OBJC_METACLASS_$_QtTestLibTests in libQt5Test.a(qxctestlogger.o)
>
>   "_OBJC_CLASS_$_XCTestProbe", referenced from:
>
> On 10 July 2015 at 14:55, Nuno Santos <nunosan...@imaginando.pt> wrote:
>
>> Curiously, it seems that qmake whipes the reference to Parse framework.
>> Whenever -framework Parse is referenced, it removes Parse.
>>
>> Before -framework Bolts there was -framework Parse, if I move the
>> -framework Parse after the Bolts, then the next one will have problems.
>>
>> If I remove the -frameworks Parse I will obviously have undefined
>> references to some Parse functions and i’m having a couple others that I
>> still don’t know where they come from:
>>
>> Undefined symbols for architecture armv7:
>>   "_OBJC_CLASS_$_XCTestCase", referenced from:
>>   _OBJC_CLASS_$_QtTestLibWrapper in
>> libQt5Test_debug.a(qxctestlogger.o)
>>   _OBJC_CLASS_$_QtTestLibTest in libQt5Test_debug.a(qxctestlogger.o)
>>   "_OBJC_CLASS_$_XCTestSuite", referenced from:
>>   objc-class-ref in libQt5Test_debug.a(qxctestlogger.o)
>>   _OBJC_CLASS_$_QtTestLibTests in libQt5Test_debug.a(qxctestlogger.o)
>>   "_OBJC_CLASS_$_XCTestDriver", referenced from:
>>   objc-class-ref in libQt5Test_debug.a(qxctestlogger.o)
>>   "_OBJC_METACLASS_$_XCTestSuite", referenced from:
>>   _OBJC_METACLASS_$_QtTestLibTests in
>> libQt5Test_debug.a(qxctestlogger.o)
>>   "_OBJC_CLASS_$_XCTestProbe", referenced from:
>>   objc-class-ref in libQt5Test_debug.a(qxctestlogger.o)
>>   "_OBJC_CLASS_$_Parse", referenced from:
>>   objc-class-ref in LKAppDelegate.o
>>   "_OBJC_CLASS_$_PFPush", referenced from:
>>   objc-class-ref in LKAppDelegate.o
>>   "_OBJC_METACLASS_$_XCTestCase", referenced from:
>>   _OBJC_METACLASS_$_QtTestLibWrapper in
>> libQt5Test_debug.a(qxctestlogger.o)
>>   _OBJC_METACLASS_$_QtTestLibTest in
>> libQt5Test_debug.a(qxctestlogger.o)
>>   "_OBJC_CLASS_$_PF

Re: [Interest] Strange font issue on iOS 9

2015-07-23 Thread Ben Lau
I have got the same problem. Upvoted for your issue.


On 23 July 2015 at 19:28, Juhani Matilainen juh...@theocbase.net wrote:

 Ok, thanks for info. I filled the bug report:
 https://bugreports.qt.io/browse/QTBUG-47399

 Juhani

 Mike Krus mike.k...@kdab.com kirjoitti 23.7.2015 kello 13.48:



 On 23/07/2015 11:26, Juhani Matilainen wrote:

 Hmmm... Interesting, it seems that random texts are displayed in wrong

 characters. If I kill app and restart some text are now ok but still

 some others are mess. And the problem is even editable texts in TextEdit

 field (also when to type new texts).

 there was a similar issue when iOS 7 came out, again with the Quick
 Controls. They do something different with textures for fonts.
 Have you filed a bug report?


 Mike

 --
 Mike Krus | mike.k...@kdab.com | Senior Software Engineer
 KDAB (UK) Ltd., a KDAB Group company
 Tel: UK +44-1625-809908
 KDAB - The Qt Experts
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [ Android ] QtActivity connect startActivityForResult to onActivityResult to callback C++ code?

2015-07-21 Thread Ben Lau
For passing data from Java to C++,  you may declare a native method in Java
and register via JNI in C++ side.

Example :

Declare native method
qtandroidexamplecode/QtRunner.java at master · benlau/qtandroidexamplecode
https://github.com/benlau/qtandroidexamplecode/blob/master/qtandroidrunner/android/src/com/github/qt/QtRunner.java#L36

Registration:
qtandroidexamplecode/qtandroidrunner.cpp at master ·
benlau/qtandroidexamplecode
https://github.com/benlau/qtandroidexamplecode/blob/master/qtandroidrunner/qtandroidrunner.cpp#L23

That is the standard way. However, in case you have problem in coding with
JNI, you may also consider an alternative method with using 3rd party
library:

Communication between C++ and Java without using JNI | Qt Forum
http://forum.qt.io/topic/56510/communication-between-c-and-java-without-using-jni



On 22 July 2015 at 00:35, Edward Sutton edward.sut...@subsite.com wrote:

  I have an activity working that I use to send a firmware update file
 from Android to a Bluetooth device using Android’s support for Object Push
 File “com.android.bluetooth.opp.BluetoothOppLauncherActivity

  Can QtActivity receive a onActivityResult and connect it back to the C++
 code somehow?  It does not allow me to override it.

  http://developer.android.com/training/basics/intents/result.html

  @Override
 protected void onActivityResult(int requestCode, int resultCode, Intent data) 
 {
 // Check which request we're responding to
 if (requestCode == PICK_CONTACT_REQUEST) {
 // Make sure the request was successful
 if (resultCode == RESULT_OK) {
 // The user picked a contact.
 // The Intent's data Uri identifies which contact was selected.

 // Do something with the contact here (bigger example below)
 }
 }
 }




  public class TsrActivity extends QtActivity

 {

 private static TsrActivity m_instance;


 public TsrActivity()

 {

 m_instance = this;

 }


  /// Sends firmware file via OBEX OPP

 ///

 /// \remarks user must select matching TK_0003 from intent screen

 ///

 /// \param[in] absolutePathToFile path to firmware files TK_11.tsu

 /// \param[in] address email body

 public static void sendFile(String absolutePathToFile, String address) {

 try {

 System.out.println(dbg: sendFile);

 System.out.println(dbg: absolutePathToFile: + 
 absolutePathToFile);

 System.out.println(dbg: address: + address);


 String intentAction = android.content.Intent.ACTION_SEND;

 final Intent intent = new Intent(intentAction);

 intent.setType(application/x-tar);

 intent.setClassName(com.android.bluetooth,

 
 com.android.bluetooth.opp.BluetoothOppLauncherActivity);


 Uri uriFile = Uri.fromFile(new File(absolutePathToFile));

 intent.putExtra(Intent.EXTRA_STREAM, uriFile);


 // title does not display on intent?

 String title = Update software;

 m_instance.startActivity(Intent.createChooser(intent, 
 title));


 } catch (Throwable t) {

 System.out.println(dbg: sendFile.exception);


 Toast.makeText(m_instance, Request failed clickbutton:  
 + t.toString(),

 Toast.LENGTH_LONG).show();

 }

 }



 -Ed




 This email and any files transmitted with it from The Charles Machine
 Works, Inc. are confidential and intended solely for the use of the
 individual or entity to which they are addressed. If you have received this
 email in error please notify the sender. Our company accepts no liability
 for the contents of this email, or for the consequences of any actions
 taken on the basis of the information provided, unless that information is
 subsequently confirmed in writing. Please note that any views or opinions
 presented in this email are solely those of the author and do not
 necessarily represent those of the company. Finally, the recipient should
 check this email and any attachments for the presence of viruses. The
 company accepts no liability for any damage caused by any virus transmitted
 by this email.

 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt mobile apps v native

2015-07-10 Thread Ben Lau
On 11 July 2015 at 10:21, John C. Turnbull ozem...@ozemail.com.au wrote:

 Amongst all the debate around the Indie license, some mention was made of
 Qt Mobile not quite being ready yet.

 So, for someone considering Qt for lots of things including mobile, could
 someone please answer these questions for me:

 1. Which Qt features do not currently work on iOS or Android?


iOS

   1. Magnifying glass for text navigation
   2. iOS9's two finger swipe of text navigation

p.s I can not get Launch image using storyboard works. The resolution of Qt
application will be incorrect. I am not sure can be it solved.

Android

   1. Using native component like Google Map
   2. Haptic feedback



 2. Which Qt features are likely never to work on those platforms and why?

 3. How does the performance of a Qt mobile app differ from a native one
 (if at all)?

 4. Are there APIs or features of either iOS or Android that Qt cannot
 access?

 5. How does the look and feel of a Qt mobile app compare to a native one?


Qt for Android version provides native components ,  but iOS do not.

But you could find simulated native components of iOS from my project:
benlau/quickios https://github.com/benlau/quickios

Moreover, an app using quickios is already available in the app store:
Team Proto - Design Better with Faster Feedback from Sketches
http://teamproto.net/

btw, Anyone know did Qt's Android native component provide page
transaction?

6. How does Qt integrate with standard mobile controls and features like
 tumblers for date selection, word auto complete and auto correct, custom
 keyboards for each scenario like entering an email address, URL, phone
 number etc.?


Not good.



 7. How does Qt integrate the native mobile browser in such a way that the
 standard effects and transformations that can be applied to other Qt
 objects be applied?

 8. Are there any legal restrictions on what a Qt app can do on mobile
 platforms or in relation to suitability for App Store distribution?


LGPL app may got trouble in App Store.


 9. What are some good examples of existing Qt apps running on iOS and/or
 Android?


Team Proto - Design Better with Faster Feedback from Sketches
http://teamproto.net/



 Answers to these questions will greatly assist in my decision making
 process so I would be very appreciative if one or more people could respond
 to them.

 Thanks,

 -jct

 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Indie Mobil Program terminated?

2015-07-07 Thread Ben Lau
Hi Tuukka,

Thanks for listening from us!

 we are rather surprised that a product that almost no-one has bought is
crucially important to so many.

I have already purchased an indie license few month ago. I think I could
try to explain why we are very concerned with this issue.

I think most of the guy replied in this thread not only an user. But also
an evangelist (or just wanna-be) of Qt. We would like to recommend /
convince people/company to use Qt. Even we know it is not yet a very good
solution for mobile yet. But we wish it will be the best solution, so we
are willing to be a pioneer.

But if the lowest cost to get Qt run on mobile is USD $350/month, it is
really difficult to convince others to get started on a not-yet popular
solution.

We complain becoz we like Qt. And wish it success.

On 7 July 2015 at 02:23, Turunen Tuukka tuukka.turu...@theqtcompany.com
wrote:


 Hi Mark,

 The reason why Indie Mobile product is to be discontinued is simple: there
 has been so few licenses sold that it does not even cover for the cost of
 online sales, let alone any cost of packaging, testing, distributing etc.
 We do care about indie developers and the community, but based on the sold
 Indie Mobile subscriptions it is very clear that there was no demand to
 this product.

 As also stated in the blog post of today, we are rather surprised that a
 product that almost no-one has bought is crucially important to so many.
 For this reason, we decided to have extension until end of August rather
 that promise that the product is available indefinitely. It will be
 interesting to see how many decide to purchase it now that it is again
 available.

 We are continuously thinking of ways to improve our offering and naturally
 hope to find products that provide new business. We are also very happy
 that we have an active community and customer base. And we are extremely
 proud that Qt is a great product, used by a huge number of developers
 worldwide.

 Yours,

 Tuukka



 
 Lähettäjä: m...@rpzdesign.com m...@rpzdesign.com
 Lähetetty: 6. heinäkuuta 2015 16:39
 Vastaanottaja: interest@qt-project.org
 Kopio: Knoll Lars; Turunen Tuukka
 Aihe: Re: [Interest] Indie Mobil Program terminated?

 Dear Lars  Turunen:

 Qt has been reading their email, but still appear tone deaf:

  
 http://blog.qt.io/blog/2015/07/06/indie-mobile-available-until-aug-31st/

 There are statements in that blog which strain QT credibility.

 Transparency is only ONE of several significant problems.

 Your feedback loops are apparently broken.

 Community Crisis Response and Pricing Policy VIA BLOG is a
 communications disaster.

 You have manufactured haters which will not evangelize QT, further
 weakening QT now and in the future.

 Failing to have Qt staff directly and completely address many valid
 questions/issues raised in the interest list and blog replies has
 consequences, whether obvious or not.

 Stop saying Open Source successfully replaces Indie, until you can
 provide an articulate and concise page why instead of sending
 all potential Indies to their lawyers to figure it out.  They will not.

 The web site is a confusing MESS. You are LOSING sales because nobody
 can clearly see price VS benefits.

 Like Nunos Santos says: QT Rocks.

 Just not enough people have the time (and now the money) to bet on QT to
 figure it out.

 They need to see other users succeeding, not users bitching.

 This has been a terrible week for QT.

 Mark
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Indie Mobil Program terminated?

2015-07-02 Thread Ben Lau
On 2 July 2015 at 21:45, Turunen Tuukka tuukka.turu...@theqtcompany.com
wrote:


  -Original Message-
  From: m...@rpzdesign.com [mailto:m...@rpzdesign.com]
  Sent: 2. heinäkuuta 2015 16:26
  To: Turunen Tuukka
  Cc: interest@qt-project.org
  Subject: Re: [Interest] Indie Mobil Program terminated?
 
  Tuukka:
 
  I did not see that announced anywhere.
 
  Qt should have announced the ending of a program publicly and visibly and
  IN ADVANCE to allow people to decide whether they liked the old or the
 new.
 

 All the current Indie Mobile customers can continue with it under the same
 terms, we are not offering new any more.

 This is due to having overall too little interest (i.e. paying customers)
 for that product.

 Yours,

 Tuukka


I think that is the problem of chicken and egg. Qt is not yet a famous /
popular solution for iOS/Android development and therefore people don't
interest for the indie license. But without the indie Qt, it is even more
difficult to get people's attention to use Qt for cross-platform solution
for mobile.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Camera cature ios roated 90 ccw (5.4.1)

2015-06-16 Thread Ben Lau
Example code to change UIImage to QImage with orientation fixed.

https://github.com/benlau/quickios/blob/master/qisystemutils.mm#L13

On 16 June 2015 at 23:28, Gian Maxera gmax...@gmail.com wrote:

 I got the same problem on iOS when I capture an image.
 The problem arise on iOS because iOS do not rotate the image but it store
 into EXIF metadata how it should be rotated and orientated the image for
 visualising it.
 But the Image item of QML (in my case) ignore the EXIF metadata for
 orientation and hence you see the image rotated.
 My trick was to rotate the image using iOS api.
 I’m sorry, I don’t have the code here. Later during the code I’ll send you
 my function for doing that.

 Ciao,
 Gianluca.


 On 16 Jun 2015, at 16:22, Daniel França daniel.fra...@gmail.com wrote:

 Not sure if it's related, but the autoOrientation for VideoOutput didn't
 work well for me either.
 I'm waiting for the 5.5 release as I'd other problems with video capture
 on IOS to test it again.


 Em ter, 16 de jun de 2015 às 17:22, Daniel França daniel.fra...@gmail.com
 escreveu:

 Not sure if it's related, but the autoOrientation for VideoOutput didn't
 work well for me either.

 Em ter, 16 de jun de 2015 às 16:29, Jason H jh...@gmx.com escreveu:

 I have a mobile app on iOS and Android. We're new to iOS. Out android
 app is flawless (provided we don't use 5.4.2 :(

 When capturing a image, we capture the preview image, we then display
 this image in an image element. In android with autoOrientation: true it
 works fine. In iOS the image is rotated 90 CCW.

 Has anyone else seen this?
 Is there a resolution?  (I did google.)

 This reminds me of the bug that 5.4.1 fixed in android (and allegedly
 all others), but was reverted for 5.4.2.

 I'm wondering if it is related to:
 http://stackoverflow.com/questions/29724537/realtime-capture-using-avfoundation-rotated-90%C2%BA-in-avcapturevideopreviewlayer

 Help?
 Thanks.



 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest



 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [ iOS ] How implement didFinishLaunchingWithOptions to open file associated with MyWidgetApp from another app?

2015-06-01 Thread Ben Lau
Objective-C provides a feature called category which could override any
class even you don't have the header file. So you just need to override the
openUrl of QIOSApplicationDelegate.

Example code to override didFinishLaunchingWithOptions
quickios/appdelegate.mm at master · benlau/quickios
https://github.com/benlau/quickios/blob/master/examples/quickiosexample/appdelegate.mm

On 2 June 2015 at 05:12, Edward Sutton edward.sut...@subsite.com wrote:

  Thank you for the links Robert.


  How would you hook into the application openURL from a Qt widget app?


  - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url 
 sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
 {
 // handle the URL here
 }


  “Open in MyApp” now shows when email attachment.  My app launches.  I
 think I just need to figure out how to implement  application openURL for a
 Qt widget app.

  Thank you very much for your time,

  -Ed

   File: Info.plist



 keyUTExportedTypeDeclarations/key

 array

 dict

 keyUTTypeConformsTo/key

 array

 stringpublic.text/string

 stringpublic.xml/string

 /array

 keyUTTypeDescription/key

 stringMy App Report File/string

 keyUTTypeIdentifier/key

 stringcom.acme.myrf/string

 keyUTTypeTagSpecification/key

 dict

 keypublic.filename-extension/key

 stringmyrf/string

 keypublic.mime-type/key

 stringpublic.text/string

 /dict

 /dict

 /array

 keyCFBundleDocumentTypes/key

 array

 dict

 keyCFBundleTypeIconFiles/key

 array

 stringIcon.png/string

 /array

 keyCFBundleTypeName/key

 stringMy App Report File/string

 keyCFBundleTypeRole/key

 stringEditor/string

 keyLSHandlerRank/key

 stringOwner/string

 keyLSItemContentTypes/key

 array

 stringcom.acme.myrf/string

 stringpublic.text/string

 /array

 /dict

 /array





  On Jun 1, 2015, at 11:05 AM, Robert Iakobashvili corobe...@gmail.com
 wrote:

 On Mon, Jun 1, 2015 at 6:29 PM, Edward Sutton edward.sut...@subsite.com
 wrote:

 For example, the user receives a report.myapp file in Apple Mail app as a
 file attachment.

 When user opens the file attachment, how do you offer Open in MyWIdgetApp”
 as one of the choices?  Has anyone figured out how to do this or found an
 example?


 Hi Ed,

 Not sure if I fully understand your question but as an attempt:


 http://www.infragistics.com/community/blogs/stevez/archive/2013/03/05/ios-tips-and-tricks-associate-a-file-type-with-your-app-part-2.aspx

 Take care

 Regards,
 Robert
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


  This email and any files transmitted with it from The Charles Machine
 Works, Inc. are confidential and intended solely for the use of the
 individual or entity to which they are addressed. If you have received this
 email in error please notify the sender. Our company accepts no liability
 for the contents of this email, or for the consequences of any actions
 taken on the basis of the information provided, unless that information is
 subsequently confirmed in writing. Please note that any views or opinions
 presented in this email are solely those of the author and do not
 necessarily represent those of the company. Finally, the recipient should
 check this email and any attachments for the presence of viruses. The
 company accepts no liability for any damage caused by any virus transmitted
 by this email.

 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt/iOS subclassing and/or delegating

2015-05-29 Thread Ben Lau
You may override existing method just like what I did to openUrl and
didFinishLaunchingWithOptions
on QIOSApplicationDelegate even you don't have the header file.




On 29 May 2015 at 21:25, maitai mai...@virtual-winds.org wrote:

  I tried but didn't succeed. If I understand well (which is far from
 being certain), I can only add new methods or properties that way, not
 override existing ones unless a protocol is defined that would allow me to
 create a delegate on QIOViewController, but there is no as far as I can see.

 I might be wrong, though. I even hope so.




 Le 29-05-2015 15:18, Ben Lau a écrit :


 Why don't use categories that suggested by people here?


 On 29 May 2015 at 21:11, maitai mai...@virtual-winds.org wrote:

 Finally got it working... with a bad hack

 I cloned QIOSViewController.h and .mm from qt sources (and added qt's
 iOS headers in my include path, I already had core-private and
 gui-private in my pro files) and modified it to do what I want. I also
 had to add a lockedOrientation property to it for some mysterious
 reason...

 At least it's doing what I need (i.e. ignore device rotation when I
 decide to). Of course it's a really bad hack and I'm still hoping
 someone can point me to a better solution.

 Thanks
 Philippe.


 Le 29-05-2015 11:24, maitai a écrit :
  I had a look at QT sources... Basically what I want to do is override
  QIOSViewController:shouldAutorotate.
 
  I tried
  @interface MyIOSViewController : QIOSViewController
  @end
  @implementation MyIOSViewController
  - (BOOL) shouldAutorotate {
   NSLog(@Inside shouldAutorotate);
   return NO;
  }
 
  It compiles and does not crash (I import QIOSViewController.h), but
  that
  all it does...
 
 
  Le 29-05-2015 10:23, Harri Pasanen a écrit :
  Compared to C++, Objective-C is very dynamic language and you can do
  many things at runtime.
 
  So you can add methods to existing classes using categories:
 
 https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/CustomizingExistingClasses/CustomizingExistingClasses.html
 
  Or resort to something quite funky to replace existing methods:
  https://github.com/rentzsch/jrswizzle
 
  As to your original question, rotation handling is surprisingly tricky
  even in pure Objective-C if you want to conditionally rotate.   For
  instance iOS 8.3 broke some of my code handling that which had worked
  fine since iOS 6, pure Objective-C.
 
  I don't know how Qt hooks into it.
 
  Harri
 
  On 29/05/2015 09:41, Robert Iakobashvili wrote:
  On Fri, May 29, 2015 at 8:38 AM, maitai mai...@virtual-winds.org
  wrote:
  Thanks Ben for your reply
 
  After much digging I made some progress but I am still looking for a
  way to
  temporary lock screen auto rotation.
 
  I have created my own app delegate to catch openUrl(), and
  surprisingly it
  works. I register my app delegate from main.cpp by calling something
  like
  this:
 
  void QtAppDelegateInitialize ()
 
  {
 
   QtAppDelegate *appDelegate = (QtAppDelegate *)[[UIApplication
  sharedApplication] delegate];
 
   [[UIApplication sharedApplication] setDelegate:[QtAppDelegate
  sharedQtAppDelegate]];
 
   NSLog(@Created a new appdelegate);
 
  }
 
 
 
  I then found this very interesting post:
 
 https://forum.qt.io/topic/48745/how-to-get-didfinishlaunchingwithoptions-called-in-ios-delegate/7
  which links to this bug report: QTBUG-38184.
 
  First question: I am now wondering how my delegate can possibly work
  since
  it seems I can have only one delegate... so what happened to
  QIOSApplicationDelegate?
 
  I then tried various things to add yet another delegate this time
  based on
  UINavigationControllerDelegate, but although after much sweat it
  seems to
  load, the various methods I am trying to override are never called
  when I
  rotate the device.
 
  Could it be that I should instead modify/interface
  QIOSApplicationDelegate
  itself and not try to create my own delegates?
 
  A bit confused at this point, I admit ;)
 
  Thanks for any tip
 
  Philippe Lelong
 
 
 
  Le 27-05-2015 20:24, Ben Lau a écrit :
 
 
 
  On 28 May 2015 at 02:07, maitai mai...@virtual-winds.org wrote:
  Hello all,
 
  I've started to port on iOS and need to override some methods, like
  we
  do easily through Java on Qt/Android. I succeeded to implement an
  appDelegate in objective-C that works for some events like openURL
  and
  such, but for instance I also need to lock automatic screen
  rotation
  in
  some circumstances (but not always).
 
  Objective-C has a feature to replace the original method of a class.
  So you
  may just override the method you needed (In case it don't break Qt)
  Customizing Existing Classes
 
  Example Code:
  quickios/appdelegate.mm at 0b067e17dc13b8533ca3f7dd574d7e81ea17a015
  ·
  benlau/quickios
 
  I have tested to override openURL and didFinishLaunchingWithOptions
  of
  AppDelegate with Qt 5.4.1. This method works.
 
  I read that I should

Re: [Interest] Qt/iOS subclassing and/or delegating

2015-05-29 Thread Ben Lau
Depend on what kind of function you should to override. Just checked the
source code of QIOSViewController , shouldAutorotate is seem to be OK.
Moreover, Harri Pasanen has suggested  swizzling, which could replace a
method and call the original one by the wrapper.

On 29 May 2015 at 21:43, maitai mai...@virtual-winds.org wrote:

  I think you can do that because openUrl is the only method implemented
 in the original QIOApplicationDelegate. So in fact you added
 didFinishLaunchingWithOptions and replaced openUrl. But if there were other
 methods (and QIOViewController has many), you would have been obliged to
 duplicate them all, at least that's what I understand.  Am I wrong?




 Le 29-05-2015 15:33, Ben Lau a écrit :


 You may override existing method just like what I did to openUrl and 
 didFinishLaunchingWithOptions
 on QIOSApplicationDelegate even you don't have the header file.




 On 29 May 2015 at 21:25, maitai mai...@virtual-winds.org wrote:

  I tried but didn't succeed. If I understand well (which is far from
 being certain), I can only add new methods or properties that way, not
 override existing ones unless a protocol is defined that would allow me to
 create a delegate on QIOViewController, but there is no as far as I can see.

 I might be wrong, though. I even hope so.




 Le 29-05-2015 15:18, Ben Lau a écrit :


 Why don't use categories that suggested by people here?


 On 29 May 2015 at 21:11, maitai mai...@virtual-winds.org wrote:

 Finally got it working... with a bad hack

 I cloned QIOSViewController.h and .mm from qt sources (and added qt's
 iOS headers in my include path, I already had core-private and
 gui-private in my pro files) and modified it to do what I want. I also
 had to add a lockedOrientation property to it for some mysterious
 reason...

 At least it's doing what I need (i.e. ignore device rotation when I
 decide to). Of course it's a really bad hack and I'm still hoping
 someone can point me to a better solution.

 Thanks
 Philippe.


 Le 29-05-2015 11:24, maitai a écrit :
  I had a look at QT sources... Basically what I want to do is override
  QIOSViewController:shouldAutorotate.
 
  I tried
  @interface MyIOSViewController : QIOSViewController
  @end
  @implementation MyIOSViewController
  - (BOOL) shouldAutorotate {
   NSLog(@Inside shouldAutorotate);
   return NO;
  }
 
  It compiles and does not crash (I import QIOSViewController.h), but
  that
  all it does...
 
 
  Le 29-05-2015 10:23, Harri Pasanen a écrit :
  Compared to C++, Objective-C is very dynamic language and you can do
  many things at runtime.
 
  So you can add methods to existing classes using categories:
 
 https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/CustomizingExistingClasses/CustomizingExistingClasses.html
 
  Or resort to something quite funky to replace existing methods:
  https://github.com/rentzsch/jrswizzle
 
  As to your original question, rotation handling is surprisingly tricky
  even in pure Objective-C if you want to conditionally rotate.   For
  instance iOS 8.3 broke some of my code handling that which had worked
  fine since iOS 6, pure Objective-C.
 
  I don't know how Qt hooks into it.
 
  Harri
 
  On 29/05/2015 09:41, Robert Iakobashvili wrote:
  On Fri, May 29, 2015 at 8:38 AM, maitai mai...@virtual-winds.org
  wrote:
  Thanks Ben for your reply
 
  After much digging I made some progress but I am still looking for a
  way to
  temporary lock screen auto rotation.
 
  I have created my own app delegate to catch openUrl(), and
  surprisingly it
  works. I register my app delegate from main.cpp by calling something
  like
  this:
 
  void QtAppDelegateInitialize ()
 
  {
 
   QtAppDelegate *appDelegate = (QtAppDelegate *)[[UIApplication
  sharedApplication] delegate];
 
   [[UIApplication sharedApplication] setDelegate:[QtAppDelegate
  sharedQtAppDelegate]];
 
   NSLog(@Created a new appdelegate);
 
  }
 
 
 
  I then found this very interesting post:
 
 https://forum.qt.io/topic/48745/how-to-get-didfinishlaunchingwithoptions-called-in-ios-delegate/7
  which links to this bug report: QTBUG-38184.
 
  First question: I am now wondering how my delegate can possibly work
  since
  it seems I can have only one delegate... so what happened to
  QIOSApplicationDelegate?
 
  I then tried various things to add yet another delegate this time
  based on
  UINavigationControllerDelegate, but although after much sweat it
  seems to
  load, the various methods I am trying to override are never called
  when I
  rotate the device.
 
  Could it be that I should instead modify/interface
  QIOSApplicationDelegate
  itself and not try to create my own delegates?
 
  A bit confused at this point, I admit ;)
 
  Thanks for any tip
 
  Philippe Lelong
 
 
 
  Le 27-05-2015 20:24, Ben Lau a écrit :
 
 
 
  On 28 May 2015 at 02:07, maitai mai...@virtual-winds.org wrote:
  Hello all,
 
  I've started to port on iOS and need

Re: [Interest] Qt/iOS subclassing and/or delegating

2015-05-27 Thread Ben Lau
On 28 May 2015 at 02:07, maitai mai...@virtual-winds.org wrote:

 Hello all,

 I've started to port on iOS and need to override some methods, like we
 do easily through Java on Qt/Android. I succeeded to implement an
 appDelegate in objective-C that works for some events like openURL and
 such, but for instance I also need to lock automatic screen rotation in
 some circumstances (but not always).


Objective-C has a feature to replace the original method of a class. So you
may just override the method you needed (In case it don't break Qt)
Customizing Existing Classes
https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/CustomizingExistingClasses/CustomizingExistingClasses.html

Example Code:
quickios/appdelegate.mm at 0b067e17dc13b8533ca3f7dd574d7e81ea17a015 ·
benlau/quickios
https://github.com/benlau/quickios/blob/0b067e17dc13b8533ca3f7dd574d7e81ea17a015/examples/quickiosexample/appdelegate.mm

I have tested to override openURL and didFinishLaunchingWithOptions of
AppDelegate with Qt 5.4.1. This method works.


 I read that I should somehow override bool
 UINavigationController::shouldRotate()


Never tried. But should be worth to try? I am also be interested with your
result.


 Should I reimp (subclass?) UINavigationController and how? Or is there a
 way to create a new delegate or even better to extend my current
 appDelegate?


 I'm new to Objective-C as you can guess... Any clue would be really
 appreciated :)

 Thanks
 Philippe Lelong
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Let's talk about the upcoming Camera breakage in 5.4.2

2015-05-26 Thread Ben Lau
When a project is going too big, changing will become difficult. It is
impossible to accept every suggestion/patch, it will just break the
ecosystem. I think all of us should understand the problem.

So should we think in another way, can it move some library, which is
non-core, out of qt.io? Those library won't bundle with Qt installer. User
grab them from somewhere. And ofcoz user could choose the version they
need. It will be more flexible then centralize everything.

p.s I use Qt for mobile application development, and that is an image
application too. However, I found that the Camera API is not really enough
to use. So finally I have decided to use native API.

On 27 May 2015 at 01:42, Jason H jh...@gmx.com wrote:

 Have between this and earlier replies, have we made a case for keeping
 camera capture as it is in 5.4.1? How do we get this pushed through? How do
 we do this with the Qt Governance Model which states: as a goal, Put
 decision power in the hands of the community, i.e. the people who
 contribute to the Project’s success?

 Thanks.



  Sent: Friday, May 22, 2015 at 10:35 AM
  From: Michael R Nelson mnel...@sutron.com
  To: Jason H jh...@gmx.com
  Cc: Interests Qt interest@qt-project.org
  Subject: RE: [Interest] Let's talk about the upcoming Camera breakage in
 5.4.2
 
  Jason makes some good points:
 
  1. Developers trying to use Qt for mobile are indeed tracking the latest
 patch builds
  2. If we're on mobile, good chance we're doing image captures
 
  Mike
 
  -Original Message-
  From: interest-bounces+mnelson=sutron@qt-project.org [mailto:
 interest-bounces+mnelson=sutron@qt-project.org] On Behalf Of Jason H
  Sent: Friday, May 22, 2015 9:49 AM
  To: Jason H
  Cc: Interests Qt
  Subject: Re: [Interest] Let's talk about the upcoming Camera breakage in
 5.4.2
 
  I've just confirmed via Commercial support that the changes cannot be
 handled app-side, which means anyone doing camera capture properly in 5.4.1
 will not be able to do camera capture on Qt 5.4.2
 
  Since 5.4.2 will break what is agreed as proper capture, I BEG THE
 TROLLS TO LEAVE IT AS IT IS IN 5.4.1.
 
  You're going to have a lot of pissed off customers that are working,
 then cease to work, then will work fine again with 5.5.
 
 
 
   Sent: Wednesday, May 13, 2015 at 10:54 AM
   From: Jason H jh...@gmx.com
   To: Gunnar Sletta gun...@sletta.org
   Cc: Interests Qt interest@qt-project.org
   Subject: Re: [Interest] Let's talk about the upcoming Camera breakage
 in 5.4.2
  
   I can appreciate that. I do. However, I think most of the people
 tracking the x.x.Y releases are likely to be mobile people, where there are
 a lot of mobile-specific fixes going on, including lot of image capturing
 on those mobile platforms. The Desktop is of course capable of capturing
 images as well (I use As the 5.4.1 code fixed the camera capture issue,
 desktop to build the app). But those of us doing mobile stuff very often
 need the latest. I'd expect everyone who now has that code base to be
 dependent on it. But we also need other fixes in 5.4.2.
  
   I suspect that the impact of reverting correct capture in 5.4.1 is
 greater than those waiting for it to be broken again 5.4.2. Which is why I
 raised the issue on this list. How many people are skipping/have
 workarounds for 5.4.1, whereas everyone doing capture properly on 5.4.1
 will now be broken?
  
   I think we need to determine and proceed the path of least impact. If
 I'm wrong, I'll back off. But since there are so many mobile fixes in the
 x.x.Y releases, I have a hard time believing that is the case.
  
Sent: Wednesday, May 13, 2015 at 8:55 AM
From: Gunnar Sletta gun...@sletta.org
To: Jason H jh...@gmx.com
Cc: Interests Qt interest@qt-project.org
Subject: Re: [Interest] Let's talk about the upcoming Camera
 breakage in 5.4.2
   
I’m sorry you are hit by this, but the idea was that people coming
 from 5.3 to 5.4 would not suffer regressions and neither people moving from
 4.8, 5.0, 5.1, 5.2 and 5.3 - 5.5 or from 5.4 LTS to 5.5 or 5.6 or any
 other 5.6+ which already had workarounds in place which would have now been
 broken. It is all about not breaking existing code. Yes, there will be a
 few people who are affected by the fact that there was an well-intended
 incompatibility introduced to 5.4.1 in the first place, but this only
 affects those that are tracking the latest patch releases, and those are
 not in majority.
   
cheers,
Gunnar
   
 On 12 May 2015, at 17:42, Jason H jh...@gmx.com wrote:

 I wanted to open this discussion up to anyone who is using a
 Camera, who has working code in 5.4.1.

 Brief backstory:
 At 5.4.1 introduced a fix that is is being removed in 5.4.2,
 because it is considered a behavior change and not a bug fix. I think
 this categorization is wrong, and I'm going to explain why.
 The change pertains to the EXIF rotation header. So if you capture
 in portraid mode, or 

Re: [Interest] SingletonType functions not visible in QML

2015-05-22 Thread Ben Lau
On 22 May 2015 at 21:56, mark diener rpzrpz...@gmail.com wrote:

 Hello:

 I have a test qmlRegisterSingletonType project as listed below.

 The singleton Q_INVOKABLE functions are somehow not visible or in
 scope.

 Anybody have ideas about this?

 # sing.h

 #include QObject

 #include QtQml

 #include QString

 #include QDebug


 class Sing : public QObject

 {

 Q_OBJECT

 public:

 explicit Sing(QObject *gparent = 0) { Q_UNUSED(gparent) }

 ~Sing() { }


 Q_INVOKABLE int Buttonpress(QObject* gparm)

 {

 qDebug()  ButtonPress:  gparm ;

 return 22 ;

 }


 Q_INVOKABLE QString Getcolor(QObject* gparm)

 {

 qDebug()  GetColor:  gparm ;

 return red ;

 }


 public slots:

 signals:


 };


 ## main.cpp

 #include QApplication#include QQmlApplicationEngine#include QQmlEngine
 #include sing.h
 static QObject *singprovider(QQmlEngine *gengine, QJSEngine *gscriptEngine){  
   Q_UNUSED(gengine)Q_UNUSED(gscriptEngine)Sing* gsing = new Sing();   
  return gsing;}
 int main(int argc, char *argv[]){QApplication app(argc, argv);
 QQmlApplicationEngine engine;
 int gres = qmlRegisterSingletonTypeSing(Singapi, 1, 0, Sing, 
 singprovider);
 qDebug()  Register Singleton:  gres ;
 engine.load(QUrl(QStringLiteral(qrc:/main.qml)));
 return app.exec();}

 ## main.qml
 import QtQuick 2.4import QtQuick.Controls 1.3import QtQuick.Window 2.2import 
 QtQuick.Layouts 1.1import Singapi 1.0 as Sing


In this case, you should use Sing.Sing to access your singleton object , or
take out as Sing from the import statement.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] iOS Objective-C callback block example connecting back to iOS Qt app?

2015-05-16 Thread Ben Lau
 (^NDHTMLtoPDFCompletionBlock)(NDHTMLtoPDF* htmlToPDF);

  @protocol NDHTMLtoPDFDelegate NSObject

  @optional
 - (void)HTMLtoPDFDidSucceed:(NDHTMLtoPDF*)htmlToPDF;
 - (void)HTMLtoPDFDidFail:(NDHTMLtoPDF*)htmlToPDF;
  @end

  @interface NDHTMLtoPDF : UIViewController UIWebViewDelegate

  @property (nonatomic, copy) NDHTMLtoPDFCompletionBlock successBlock;
  @property (nonatomic, copy) NDHTMLtoPDFCompletionBlock errorBlock;

  @property (nonatomic, weak) id NDHTMLtoPDFDelegate delegate;

  @property (nonatomic, strong, readonly) NSString *PDFpath;
  @property (nonatomic, strong, readonly) NSData *PDFdata;

  + (id)createPDFWithURL:(NSURL*)URL pathForPDF:(NSString*)PDFpath
 delegate:(id NDHTMLtoPDFDelegate)delegate pageSize:(CGSize)pageSize
 margins:(UIEdgeInsets)pageMargins;
 + (id)createPDFWithHTML:(NSString*)HTML pathForPDF:(NSString*)PDFpath
 delegate:(id NDHTMLtoPDFDelegate)delegate pageSize:(CGSize)pageSize
 margins:(UIEdgeInsets)pageMargins;
 + (id)createPDFWithHTML:(NSString*)HTML baseURL:(NSURL*)baseURL
 pathForPDF:(NSString*)PDFpath delegate:(id NDHTMLtoPDFDelegate)delegate
 pageSize:(CGSize)pageSize margins:(UIEdgeInsets)pageMargins;

  + (id)createPDFWithURL:(NSURL*)URL pathForPDF:(NSString*)PDFpath
 pageSize:(CGSize)pageSize margins:(UIEdgeInsets)pageMargins successBlock:(
 NDHTMLtoPDFCompletionBlock)successBlock errorBlock:(
 NDHTMLtoPDFCompletionBlock)errorBlock;
 + (id)createPDFWithHTML:(NSString*)HTML pathForPDF:(NSString*)PDFpath
 pageSize:(CGSize)pageSize margins:(UIEdgeInsets)pageMargins successBlock:(
 NDHTMLtoPDFCompletionBlock)successBlock errorBlock:(
 NDHTMLtoPDFCompletionBlock)errorBlock;
 + (id)createPDFWithHTML:(NSString*)HTML baseURL:(NSURL*)baseURL
 pathForPDF:(NSString*)PDFpath pageSize:(CGSize)pageSize margins:(
 UIEdgeInsets)pageMargins successBlock:(NDHTMLtoPDFCompletionBlock)successBlock
 errorBlock:(NDHTMLtoPDFCompletionBlock)errorBlock;
  @end

  Sorry for my Objective-Confusion.  I appreciate the help I have received
 from Robert and Ben.

  Thanks in advance for any suggestions,

  -Ed





  On May 15, 2015, at 7:29 AM, Robert Iakobashvili corobe...@gmail.com
 wrote:

 Dear Ed,
  There is an example attached to this
  bug report:

 https://bugreports.qt.io/browse/QTBUG-42705

  The attached to the bug example code is about
  mixing Qt C++ and Obj-C code and sharing text.

  May be it could be helpful.

  Take care.

  Regards,
 Robert

 On Fri, May 15, 2015 at 3:26 PM, Edward Sutton edward.sut...@subsite.com
 wrote:

 Hi Ben,

  Thank you very much for sharing your example.

  https://github.com/benlau/quickios/blob/master/qisystemutils.mm

  Understanding the Objective-C language has been much more difficult
 than I expected coming from C, C++, and C#.

  QMessageBox looks horrible on iOS.  I am very glad you have a solution
 for using UIAlertView in your alertViewCreate method.

  UiActionSheet and UIImagePickerController

 This has given me much to study and understand.

  Thank you again for sharing your iOS code!

  -Ed



  On May 15, 2015, at 2:33 AM, Ben Lau xben...@gmail.com wrote:

  Hi Edward,

  You may find example code from my project.

  quickios/qisystemutils.mm at master · benlau/quickios
 https://github.com/benlau/quickios/blob/master/qisystemutils.mm

  It has implemented an interface to create and communicate to
 UIAlertView , UIActionSheet , UIImagePickerController etc. It uses a
 singleton object called SystemMessenger as the bridge between C++ and
 Objective-C++ code. So that the developed code can be run on non-iOS
 platform too  (for development use)


 On 15 May 2015 at 05:53, Edward Sutton edward.sut...@subsite.com wrote:

 Can anyone share an example on how to implement the asynchronous return
 of a result from an Objective-C callback block to Qt?

 For example, see the “successBlock:” below which gets called back
 asynchronously.

 self.PDFCreator = [NDHTMLtoPDF createPDFWithHTML:(NSString*)html
  baseURL:(NSURL*)baseUrl

 pathForPDF:[@~/Documents/hello-world.pdf stringByExpandingTildeInPath]
 pageSize:kPaperSizeA4
 margins:UIEdgeInsetsMake(10, 5, 10, 5)
 successBlock:^(NDHTMLtoPDF *htmlToPDF) {

 NSString *result = [NSString stringWithFormat:@HTMLtoPDF did
 succeed (%@ / %@), htmlToPDF, htmlToPDF.PDFpath];
 NSLog(@%@,result);
 self.resultLabel.text = result;

 }
 errorBlock:^(NDHTMLtoPDF *htmlToPDF) {
 NSString *result = [NSString stringWithFormat:@HTMLtoPDF did
 fail (%@), htmlToPDF];
 NSLog(@%@,result);
 self.resultLabel.text = result;
 }];


 Background:
 

 I need to implement native iOS code to replace the missing QPrinter
 functionality I used to convert HTML to a PDF report on Android, OS X,
 Linux, and Windows.

 Unfortunately the Qt html-to-pdf functionality is implemented in
 QPrinter.  This functionality is gone from Qt iOS since iOS has no printer
 device support,  even though I am

Re: [Interest] iOS Objective-C callback block example connecting back to iOS Qt app?

2015-05-15 Thread Ben Lau
Hi Edward,

You may find example code from my project.

quickios/qisystemutils.mm at master · benlau/quickios
https://github.com/benlau/quickios/blob/master/qisystemutils.mm

It has implemented an interface to create and communicate to UIAlertView ,
UIActionSheet , UIImagePickerController etc. It uses a singleton object
called SystemMessenger as the bridge between C++ and Objective-C++ code. So
that the developed code can be run on non-iOS platform too  (for
development use)


On 15 May 2015 at 05:53, Edward Sutton edward.sut...@subsite.com wrote:

 Can anyone share an example on how to implement the asynchronous return of
 a result from an Objective-C callback block to Qt?

 For example, see the “successBlock:” below which gets called back
 asynchronously.

 self.PDFCreator = [NDHTMLtoPDF createPDFWithHTML:(NSString*)html
  baseURL:(NSURL*)baseUrl

 pathForPDF:[@~/Documents/hello-world.pdf stringByExpandingTildeInPath]
 pageSize:kPaperSizeA4
 margins:UIEdgeInsetsMake(10, 5, 10, 5)
 successBlock:^(NDHTMLtoPDF *htmlToPDF) {

 NSString *result = [NSString stringWithFormat:@HTMLtoPDF did
 succeed (%@ / %@), htmlToPDF, htmlToPDF.PDFpath];
 NSLog(@%@,result);
 self.resultLabel.text = result;

 }
 errorBlock:^(NDHTMLtoPDF *htmlToPDF) {
 NSString *result = [NSString stringWithFormat:@HTMLtoPDF did
 fail (%@), htmlToPDF];
 NSLog(@%@,result);
 self.resultLabel.text = result;
 }];


 Background:
 

 I need to implement native iOS code to replace the missing QPrinter
 functionality I used to convert HTML to a PDF report on Android, OS X,
 Linux, and Windows.

 Unfortunately the Qt html-to-pdf functionality is implemented in
 QPrinter.  This functionality is gone from Qt iOS since iOS has no printer
 device support,  even though I am not accessing a printer device from iOS.

 I found this project which seems to work:

 https://github.com/iclems/iOS-htmltopdf

 Objective-C interfacing to C++ is challenging.

 Thanks in advance for any tips,

 -Ed
 This email and any files transmitted with it from The Charles Machine
 Works, Inc. are confidential and intended solely for the use of the
 individual or entity to which they are addressed. If you have received this
 email in error please notify the sender. Our company accepts no liability
 for the contents of this email, or for the consequences of any actions
 taken on the basis of the information provided, unless that information is
 subsequently confirmed in writing. Please note that any views or opinions
 presented in this email are solely those of the author and do not
 necessarily represent those of the company. Finally, the recipient should
 check this email and any attachments for the presence of viruses. The
 company accepts no liability for any damage caused by any virus transmitted
 by this email.
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Finding the root QQuickItem in a QQml(Application)Engine

2015-05-11 Thread Ben Lau
On 11 May 2015 at 21:06, Sze Howe Koh szehowe@gmail.com wrote:

 Hello,

 Is there an analogue of QQuickView::rootItem() for QQml(Application)Engine?

 The shortest way I could think of involves jumping through a few hoops,
 e.g.:

 QQmlApplicationEngine engine;
 // ...
 auto window = engine.rootObjects().first();
 auto aQuickItem =
 qobject_castQQuickItem*(window-children().first());
 auto rootItem = aQuickItem-parentItem();


 Regards,
 Sze-Howe

 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


Hi,

I use this piece of code to find the root QQuickItem (part of my test
suite):

engine.load(url);

QObject *rootObject = engine.rootObjects().first();


QQuickWindow *window = qobject_castQQuickWindow*(rootObject);

if (window) {

setTestableRootObject(window-children().first());

} else {

setTestableRootObject(rootObject);

}
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QQuickGrabItemResult on iOS

2015-03-11 Thread Ben Lau
Hi Michael,

Voted.

Thank for suggestion! Change the code to use canvas is a reasonable method
. Just the work load is huge.. I have an arrow component in QML and linked
with a lots of images in different size with text arranged in grid.

So before go into the canvas approach,  I would like to try few more thing
first.

Before Qt 5.4 is out , I have written my own version of grabToImage(). And
I just found that the code works in iPhone with Qt 5.3.2 . However, it use
QQuickShaderEffectTexture and the class is no longer available in Qt 5.4. I
would like to take a look and see can it be fixed by using private API.

On Wed, 11 Mar 2015 at 21:48 Michael R Nelson mnel...@sutron.com wrote:

 QQuickItem::grabToImage() not working on iOS for me either in 5.4.0 and
 5.4.1. Here’s a bug report, please up-vote if it’s important to you:
 https://bugreports.qt.io/browse/QTBUG-44450. Regarding work-around:
 perhaps get a 2D context in a Canvas object and paint the object in
 onPaint()? This is something I’ve been meaning to try.



 Regards,

 Mike



 *From:* interest-bounces+mnelson=sutron@qt-project.org [mailto:
 interest-bounces+mnelson=sutron@qt-project.org] *On Behalf Of *Ben Lau
 *Sent:* Wednesday, March 11, 2015 6:54 AM
 *To:* Brian Dentino
 *Cc:* interest@qt-project.org Interest
 *Subject:* Re: [Interest] QQuickGrabItemResult on iOS





 On 17 October 2014 at 10:11, Brian Dentino brian.dent...@gmail.com
 wrote:

 Has anyone had any success using QQuickItem::grabToImage on iOS? I'm using
 it successfully on OSX and android, and it works perfectly fine in the iOS
 simulator (iOS 7 and 8), but when I run on an iOS device, the images come
 up empty. I've tried on both an iPad 2 and an iPhone 5s (both running iOS
 8), but I don't have access to any devices with iOS 7.

 Any advice on how to root-cause this?

 Thanks,
 Brian
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest



 Hi Brain,



 I have got the same problem. The grabToImage() do not works with iOS 8. It
 works only in simulator. Did you found any solution to fix it?





___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QQuickGrabItemResult on iOS

2015-03-11 Thread Ben Lau
On 17 October 2014 at 10:11, Brian Dentino brian.dent...@gmail.com wrote:

 Has anyone had any success using QQuickItem::grabToImage on iOS? I'm using
 it successfully on OSX and android, and it works perfectly fine in the iOS
 simulator (iOS 7 and 8), but when I run on an iOS device, the images come
 up empty. I've tried on both an iPad 2 and an iPhone 5s (both running iOS
 8), but I don't have access to any devices with iOS 7.

 Any advice on how to root-cause this?

 Thanks,
 Brian
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


Hi Brain,

I have got the same problem. The grabToImage() do not works with iOS 8. It
works only in simulator. Did you found any solution to fix it?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Alternative way to make photo viewer application for mobile platform

2015-03-06 Thread Ben Lau
On 3 March 2015 at 18:45, Rutledge Shawn shawn.rutle...@theqtcompany.com
wrote:


 On 2 Mar 2015, at 18:38, Ben Lau xben...@gmail.com wrote:

 
  On 2 March 2015 at 19:38, Rutledge Shawn 
 shawn.rutle...@theqtcompany.com wrote:
 
 
  Did you try the photosurface example?
 
  It’s getting some new features in 5.5, because pinch zooming and
 flicking will both work better on OS X than they have in the past, with a
 trackpad.  Of course it’s not a typical gallery app for mobile devices, but
 it does involve using pinching and flicking together.
 
 
  Hi Rutledge,
 
  Thank you for your reply. I have tried the photosurface example on
 desktop only (It don't work on iOS).

 It should be able to run on iOS I think, but being able to read photos
 from the gallery will be a new feature in 5.5 (because there is no
 permission to do that by default on iOS).  Is that what you mean doesn’t
 work?


The application will be frozen in the splash screen. The only message
printed is

QMetaObject::indexOfSignal: signal visibleChanged(bool) from QQuickWindow
redefined in QQuickWindowQmlImpl

Verified with Qt 5.4.1

And just tested with Android , it is working.



  According to the code , it use PinchArea + MouseArea instead of
 PinchArea + Flickable.

 There is a Flickable to flick the whole surface in 5.5.


oh , you mean the example code in 5.5 dev branch? I just tested with the
code bundled with Qt 5.4.1. It don't contains Flickable.



  The combination could support pinching and flicking on mobile. However,
 it lack of support for physic simulation and function like returnToBound()
 that provided by Flickable.
 
  For example , after user has swiped on screen and released the finger,
 the object should still keep moving in a short time. The time should depend
 on how fast of the swipe gesture.
 
  Will it have any existing component that can help to build similar thing
 without Flickable?
 
  I think the returnToBound() function could be made by SpringAnimation
 but no idea how to implement the physic simulation.

 You want to “fling” the photos individually?  That’s an interesting idea,
 but I don’t think we provide an easy way to do it, since it’s not something
 most UIs would need.


But in fact Flickable has provided the fling gesture already. And
commonly used in ListView for scrolling.



 You might try the Box2D QML bindings.
 https://github.com/qml-box2d/qml-box2d

 Or you can try using MultiPointTouchArea, which will give you velocity at
 each touch point, and start an animation when the finger is released.  It
 might be nice if MouseArea provided drag velocity, but it doesn’t.


I see. Thank you!
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Alternative way to make photo viewer application for mobile platform

2015-03-02 Thread Ben Lau
On 2 March 2015 at 19:38, Rutledge Shawn shawn.rutle...@theqtcompany.com
wrote:



 Did you try the photosurface example?

 It’s getting some new features in 5.5, because pinch zooming and flicking
 will both work better on OS X than they have in the past, with a trackpad.
 Of course it’s not a typical gallery app for mobile devices, but it does
 involve using pinching and flicking together.


Hi Rutledge,

Thank you for your reply. I have tried the photosurface example on desktop
only (It don't work on iOS). According to the code , it use PinchArea +
MouseArea instead of PinchArea + Flickable. The combination could support
pinching and flicking on mobile. However, it lack of support for physic
simulation and function like returnToBound() that provided by Flickable.

For example , after user has swiped on screen and released the finger, the
object should still keep moving in a short time. The time should depend on
how fast of the swipe gesture.

Will it have any existing component that can help to build similar thing
without Flickable?

I think the returnToBound() function could be made by SpringAnimation but
no idea how to implement the physic simulation.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Alternative way to make photo viewer application for mobile platform

2015-02-26 Thread Ben Lau
Hi all,

I am making a mobile application for iOS and Android that will provide a
photo viewer. Just like other photo viewer did, it need to support flicking
(with physical simulation) and pinching for zoom-in and out. I use
Flickable + PInchArea to implement the features. However, it is not quite
working in Qt 5.4. Flicking is ok , but pinching area do not work as
expected. It is not sensitive for two fingers touch. The most
successful way to get it works is to put the fingers on the screen at the
SAME time. User will not accept the behaviour.

I have already report the bug with example project provided:
[QTBUG-44645] Flickable and PinchArea are not working well together - Qt
Bug Tracker https://bugreports.qt.io/browse/QTBUG-44645

Anyway , I am not reporting for the bug here. Instead I would like to seek
for alternative method to implement the feature (e.g not using pinch area?
). Downgrade to 5.3.2 may not work for me , I have few components that need
5.4 feature (e.g the native control for Android)..

Any suggestions are highly welcome.

Thanks.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] How to do a correct drop shadow on a QML Rect?

2015-02-05 Thread Ben Lau
Hi Jason,

Here is an example to attach shadow in material design style to rectangle
object:

https://github.com/benlau/quickandroid/blob/master/QuickAndroid/Shadow.qml



On 6 February 2015 at 12:01, Jason H jh...@gmx.com wrote:

 These flat interfaces are all the rage these days. So I want to make a
 drop shadow. However the two approaches I can think of don't work.

 First is the QML DropShadow element. This creates a shadow of a constant
 color when the source is a rect. It is pixel-equivalent to just another
 Rect, so that is out.

 The next is doing my own drop shadow by using 2 Rect with a gradient.
 (horizontal + vertical) This will render a continuous gradient (good) but
 won't do the bottom right corner. You can either double blend it, or skip
 it. Either way, it doesn't look right.


 So is there a way to shadow a rect?
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QExifImageHeader source

2015-02-02 Thread Ben Lau
Hi Rainer,

Thanks. It is great to know that Qt will support this feature finally. But
... It probably will break the application I am developing. The data saved
in previous version with 5.4.0 will go wrong for version with 5.4.1.

Seem that I have to wait for 5.4.1 before release the application.

On Mon Feb 02 2015 at 5:34:05 PM Rainer Keller 
rainer.kel...@theqtcompany.com wrote:

 Hi Ben,

  Will the Image component in QML support this feature too?
 I guess QML uses the same image loader, so it will support this feature
 too.

  Can it be turned off?
 Right now there is no API to disable rotation.


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QExifImageHeader source

2015-02-02 Thread Ben Lau
Hi Rainer,

Will the Image component in QML support this feature too? Can it be turned
off?



On Mon Feb 02 2015 at 5:04:42 PM Rainer Keller 
rainer.kel...@theqtcompany.com wrote:

 Hi,

 if your usecase is rotating the images, Qt 5.4.1 will do that
 automatically.

 Rainer
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Fwd: [qt-android] How can I customize onResume()/onPause() method of main activity

2014-11-22 Thread Ben Lau
On 23 November 2014 at 12:16, Liang Jian jianlian...@gmail.com wrote:

 In fact, I didn't realized that I have used private reply, it is my
 fault.
 Thank you for the reply and now I know that there is at least one way
 to achieve my goal: just make a copy of
 $QT/src/android/java/src/org/qtproject/qt5/android/binding/QtActivity.java
 to my project's own android source folder, modify this file and use
 ANDROID_PACKAGE_SOURCE_DIR in *.pro to point to my own android source
 folder, then upon deployment Qt will use the modified version of
 QtActivity.java. But his method has a drawback: once I have upgraded Qt
 version, I have to re-generate my own QtActivity.java based on the current
 version shipped by Qt. But right now this is the only way I found to solve
 my problem.



Hi Liang Jian,

You may write your own activity class and inherit the QtActivity , then
override the methods needed.

e.g

public class YourAppActivity extends
org.qtproject.qt5.android.bindings.QtActivity { ... }
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Best model type for shared data between C++ and QML, as well as insertion and removal on both sides.

2014-11-20 Thread Ben Lau
I have tried QQmlListProperty , QObjectListModel (code from git) . Finally
, I found that implement a QAbstractListModel to store QListQVariantMap
is the most simple , flexible and reusable solution. You don't need to care
about QObject ownership and works just like a ListModel , except you can't
pass it to worker.  Addition cost in C++ , a converter from your data
structure to QVariantMap is needed.

A good example can be found in this repo:

qml-object-model
https://qt.gitorious.org/qt-labs/qml-object-model/source/057666b294f8d0ac50fc97134a6591bd2f33b83c:



On 20 November 2014 23:38, Nuno Santos nunosan...@imaginando.pt wrote:

 Jerome,

 Thanks for your feedback. In time between your reply I have achieved
 precisely what you have said in your reply.

 Which options would you consider for this problem?

 What about QVariantMap? Is it a model? Can’t find 5.3 documentation for it.

 Regards,

 Nuno


 On 20 Nov 2014, at 15:24, Jérôme Godbout jer...@bodycad.com wrote:

 Hi,
 My observation with the QQmlListProperty so far. You can assign to it but
 only with javascript array, list, etc. It does not allow diect array object
 instanciate. The following should work:


 *presets: [patchSet1]*
 *PatchSet *
 *{*


 *id: patchSet1name: Preset 1patches:
 [patch1, patch2] *

 * }Patch { id: patch1; name: Patch 1}*
 *Patch { id: patch2; name: Patch 2}*

 You cannot assign one QQmlListProperty to another one

 *presets: myOtherQQmlListProperty   // Won't work*

 But you can make yourself a javascript function that take every element of
 a QQmlListProperty and put them into a JS Array and assign that array to
 the list

 *function convertQQmlListPropertyToJSArray(myQQmlList)*
 *{*
 *   var rv = [];*
 *for(var i = 0; i  myQQmlList.length; ++i)*
 *{*
 *  rv.push(myQQmlList[i];*
 *}*
 *return rv;*
 *}*

 *presets: convertQQmlListPropertyToJSArray(myOtherQQmlListProperty)  //
 will work*

 Another point, the QQmlListProperty will clear and append every element
 into it, it does not emitChanged when doing so, you have to create another
 signal.
 Personnaly, for those exchange, I prefer to go QVariantMap, you still have
 to emit the change and reassign the whole map every time, but it's easy to
 manipulate into Javascript. QQmlListProperty are only fun if populated
 from C++ and only read from Qml.


 On Thu, Nov 20, 2014 at 9:38 AM, Nuno Santos nunosan...@imaginando.pt
 wrote:

 Hi,

 I need to implement a model class that allows me to have the data in C++
 but exposed to QML.

 The data will need to be exposed to QML and it will be necessary to write
 from QML to that model as well.

 The C++ side will be in charge of the data persistence.

 I started with QQmlListProperty and it works for having data exposed from
 C++ to QML. The problem is that I also need to dynamically instantiate data
 on the QML side and write to the list. That doesn’t seem to be possible,
 or, if it is, I don’t know how to get there. So far I have only been able
 to write to the list, writing the items on the property it self. See
 example below.

 What I am trying to do with QQmlListProperty is possible or should I
 adopt another model type such as QAbstractListModel?

 Thanks

 Nuno

 Example:

 // works
 PatchSetManager {
 id: patchManager

 presets: [
 PatchSet {
 name: Preset 1
 patches: [
 Patch {
 name: Patch 1
 },
 Patch {
 name: Patch 2
 }
 ]
 }
 ]
 }

 // doesn’t work

 var patchSet = Qt.createQmlObject('import Imaginando 1.0; PatchSet {}',
 patchManager);

 if (patchSet)
 {
 console.log(object created successfully);
 }

 patchSet.name = test

 var patch = Qt.createQmlObject('import Imaginando 1.0; Patch {}',
 patchSet);

 if (patch)
 {
 patchSet.patches.append(patch)
 console.log(patchSet.patches +  length:  + patchSet.patches.length)
 }


 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest




 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Best model type for shared data between C++ and QML, as well as insertion and removal on both sides.

2014-11-20 Thread Ben Lau
On 21 November 2014 06:40, Nuno Santos nunosan...@imaginando.pt wrote:

 I have subclassed QAbstractListModel and i’m already able to have the
 model listed in a list view.

 What I can’t find is how I programmatically add items to the model from
 the QML side and which methods I need to reimplement in my model class.

 The qml-object-model you have sent me is probably old because there aren’t
 the same methods on the documentation for Qt 5.3

 Suggestions?



ah , I have forgotten that I have modified the code to get it work on Qt 5.
However, you may still refer to the append() / insert() / move() functions
. Those beginXXX and endXXX should be valid for Qt 5. The help to setup the
signal and make it behave like a ListModel. Therefore , you may add data to
the model via append() / insert() calls by QML just like a ListModel.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Android activities navigation.

2014-10-31 Thread Ben Lau
Let's clarify.

You can tell Android to start another activity in a Qt Android application.
No matter that is an activity for share , asking photo or other local
activities within the same application written by Java.

I am writing an application which need to ask for taking photo , share the
photo and sync with Dropbox by using Dropbox's own activity. It is fine ,
just need to write the interface code by Java.

What I don't know is , can there has multiple activities within the same
application render their UI via Qt. However, I don't suggest to try since
the initialization of Qt is not fast enough for page transition.

On 31 October 2014 20:01, rap r...@dlc.fi wrote:

 This sounds weird. Could someone please clarify as even using Java each UI
 Window (= Activity) within your  - or any other
 rogram  - is always a single item, there is no MDI .  Does this mean
 that Qt can not create Intents and/or tell Android to start
 another Actvity?

 thanks,
 Risto


 -Alkuperäinen viesti-
 From: Ben Lau
 Sent: Thursday, October 30, 2014 4:17 PM
 To: Reynier Pupo Gómez
 Cc: interest@qt-project.org
 Subject: Re: [Interest] Android activities navigation.


 Hi ,

 Currently , Qt is designed as a single activity in Android. Having another
 activity written by Java is possible , but I don't know
 can those other activities use Qt for drawing.  Moreover, the
 initialization of Qt instance is not fast enough for page transition
 yet. So I think break down into multiple activity may not be a good idea.

 However, if you accept activity transition simulation through Qt's
 drawing. You may take a look of my library:

 https://github.com/benlau/quickandroid

 It has supported page transition between different QML and back through up
 button or hardware button.



 On 29 October 2014 21:39, Reynier Pupo Gómez rgo...@uci.cu wrote:
 Hi, I just starting to develop android apps with Qt and I face a problem.
 In the android way an application could containt several
 activities representing content allowing us to give the correct structure
 to an application. Each activity can switch to another
 using a stack and the back button( hardware/software) of the device pop
 from the activities stack. When we make a Qt application and
 prepare it for run in android it creates only one activity and no matters
 how much overlaped widgets have my application if I press
 the back button hides the entire application.
 I thinking on decompose the application on several activities but I don't
 know how to do that.
 Sory for my english, Im' spanish speaking.
 Thanks.
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest







 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QML Plugin with Java (Android)

2014-09-16 Thread Ben Lau
On 17 September 2014 00:30, Brian Dentino brian.dent...@gmail.com wrote:

 I am trying to write a QML plugin that will work on both iOS and Android.
 The iOS implementation requires a mix of C++  Objective C on the backend,
 while the Android implementation requires some C++  Java. I struggled
 yesterday with figuring out the best way to deploy this Java alongside an
 application/project that wants to use this plugin on Android.

 For now, I've settled on the following method, but I don't believe it's
 ideal because I had to modify the androiddeployqt tool to get what I want
 and it requires a developer to follow some implicit naming conventions when
 creating jars:

 1. Compiling the plugin java to a .jar (bundled and non-bundled versions,
 as with QtAndroidBearer) when building the plugin.

 2. Installing the plugin (.so and .jar) post-build to the
 [QT_INSTALL_PREFIX]/qml directory (alongside the built-in qml plugins).

 3. Modifying a few lines of code in the androiddeployqt tool to detect
 .jar files when scanning qml imports and package these .jars in the /lib
 folder of the dependent application. Checks for a '-bundled.jar' suffix if
 the deployment method is 'bundled'.

 Is anyone aware of a better/easier way to do this? It seems that the only
 built-in way to specify jar dependencies for deployment is by creating a
 new Qt module, which seems overkill for this plugin I'm working on. And
 from what I can tell, ANDROID_PACKAGE_SOURCE_DIR is intended more for use
 with individual standalone applications, not qml plugins.

 Brian
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


Hi Brian,

I think qmake could handle the task for you. Example script (never tested
for jar file, just copy from my project) :

ANDROID_BUILD_DIR = $$OUT_PWD/android-build

xxx-jars.target = $$ANDROID_BUILD_DIR/libs/xxx.jar

xxx-jars.commands = $(COPY_DIR) somehwre/xxx.jar
$$ANDROID_BUILD_DIR/libs/xxx.jar

target.depends += xxx-jars
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QThreadPool writing to the DB

2014-08-28 Thread Ben Lau
On 18 August 2014 19:51, Igor Mironchik igor.mironc...@gmail.com wrote:

 Hi.

 Well, but with SQLite this approach works...

 -Original Message-
 From: Sze Howe Koh
 Sent: Monday, August 18, 2014 12:57 PM
 To: Igor Mironchik
 Subject: Re: [Interest] QThreadPool  writing to the DB

 Hi Igor,

 On 18 August 2014 14:26, Igor Mironchik igor.mironc...@gmail.com wrote:
  Hi.
 
  I want to move write to DB operation to another thread (from the GUI
  thread). And I implemented the following QRunnable:

 snip
  Is it OK to launch this runnable every time when I need to write to the
  log?

 snip
  And what if previous operation is still not finished and I will launch
  another?

 According to http://qt-project.org/doc/qt-5/threads-modules.html, your
 queries must be made from the same thread which opened the database
 connection. You cannot use QRunnable, because it doesn't let you
 choose which thread to use.

 If you want to make queries in another thread, you must create a
 QSqlDatabase in that thread, and associate every QSqlQuery with that
 QSqlDatabase. Then, run every query from that same thread.

 See the QThread documentation for examples on how to set up your
 thread: http://qt-project.org/doc/qt-5/QThread.html


 Regards,
 Sze-Howe

 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


btw , I have made an implementation that hold a thread and accept QRunnable
on main thread then run it on the created thread. You may take it as a
reference.

https://github.com/benlau/dquest/blob/DEV_0_3/src/dqthread.cpp
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Custom path for android build dir?

2014-08-26 Thread Ben Lau
On 26 August 2014 18:11, Tomasz Siekierda sierd...@gmail.com wrote:

 Hi,

 Is there any way to change the path or name of the android build dir
 (android-build)? I have a project where I need to create several
 different .apk files from a single SUBDIRS project, but all those
 subprojects try to use the same android-build directory, which leads to
 clashes.

 Does anybody know any way around it? Some hidden qmake variable, perhaps?

 Have a good day,
 sierdzio


If you build via command line , you could change the build path by passing
an argument to androiddeployqt

Example:

$(QT_ANDROID_BIN)/androiddeployqt --output $(ANDROID_BUILD_DIR)
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Qt Android] Any recommended way to modify the package name for different build configuration?

2014-07-05 Thread Ben Lau
On 30 June 2014 01:07, Tomasz Siekierda sierd...@gmail.com wrote:

 On 29 June 2014 08:14, Ben Lau xben...@gmail.com wrote:
  Hi,
 
  I am using TestFairy to deliver beta/testing version of our application
 to
  others. It is great if we don't have development version and those
 released
  via TestFairy on a same device. Since TestFairy will re-sign the package
 ,
  if the APK's package name is same, it will need to remove the previous
  development version then install the TestFairy version , or vice-versa.
 That
  will lose saved data.
 
  It is better to keep both of the version on a phone. Therefore , I am
  looking for a method which can change the package name /
 AndroidManifest.xml
  by passing an option to qmake so that it could be handled by build
 server.
 
  Any recommended method?

 In your .pro file:

 contains(DEFINES, other) {
   OTHER_FILES += android/AndroidManifestOther.xml
   TARGET = myAppNameOther
 } else {
   OTHER_FILES += android/AndroidManifestFairy.xml
   TARGET = myAppNameFairy
 }

 And then run qmake like this:
 qmake DEFINES+=other


Hi Tomasz,

Thank for your reply. However, it is not really working. The
'androiddeployqt' still copy the original android/AndroidManifest.xml to
build directory. If I remove the android/AndroidManifest.xml , it will
generate a new manifest file automatically.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] A bug in Qt 5.3.1 for Android?

2014-07-02 Thread Ben Lau
On 1 July 2014 15:33, Alexander Zakharov alexander.v.zakha...@gmail.com
wrote:

  My testing result:
 
  Qt 5.3.0 + Nexus 5 (4.4.2)
  primaryScreen()-physicalDotsPerInch() 443.934
  Qt 5.3.0 + Samsung Galaxy Note 2
  primaryScreen()-physicalDotsPerInch() 264.903
 
  Qt 5.3.1 + Nexus 5 (4.4.2)
  primaryScreen()-physicalDotsPerInch() 453.754
  Qt 5.3.1 + Samsung Galaxy Note 2
  primaryScreen()-physicalDotsPerInch() 270.284
 
  Although it don't return infinity , Qt 5.3.1 produces value different
  than 5.3.0

 Thanks, your results pushed my thoughts in a right direction. In my
 program physicalDotsPerInch() is called from the main window's
 constructor and it is this call that stopped working. Calling
 physicalDotsPerInch() later, when the main window is shown, produces a
 value of 151.588, which is (almost) correct (I do not remember the exact
 DPI produced by 5.3.0, but it was close).


btw , There has another report to say it return infinity
https://bugreports.qt-project.org/browse/QTBUG-35701

(last comment)


  btw , I got another issue after upgraded to Qt 5.3.1 on Android.. Seem
  that there has some large changes from 5.3.0 to 5.3.1
  [#QTBUG-39977] Full screen mode do not work correctly on Nexus 5 v4.4.2
  - Qt Bug Tracker
  
 https://bugreports.qt-project.org/browse/QTBUG-39977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-249119
 

 I do not use full screen mode in my application (the main window is
 always maximized), so I did not test it in 5.3.0 and earlier versions.
 However, now, when I change showMaximized() call to showFullScreen() in
 the main window's constructor, the bottom bar does not disappear, but
 stays on screen, partially hiding the window, as shown in Step 3
 screenshot of the described bug.


Thank you~
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] A bug in Qt 5.3.1 for Android?

2014-07-01 Thread Ben Lau
My testing result:

Qt 5.3.0 + Nexus 5 (4.4.2)
primaryScreen()-physicalDotsPerInch() 443.934
Qt 5.3.0 + Samsung Galaxy Note 2
primaryScreen()-physicalDotsPerInch() 264.903

Qt 5.3.1 + Nexus 5 (4.4.2)
primaryScreen()-physicalDotsPerInch() 453.754
Qt 5.3.1 + Samsung Galaxy Note 2
primaryScreen()-physicalDotsPerInch() 270.284

Although it don't return infinity , Qt 5.3.1 produces value different than
5.3.0

btw , I got another issue after upgraded to Qt 5.3.1 on Android.. Seem that
there has some large changes from 5.3.0 to 5.3.1
[#QTBUG-39977] Full screen mode do not work correctly on Nexus 5 v4.4.2 -
Qt Bug Tracker
https://bugreports.qt-project.org/browse/QTBUG-39977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-249119




On 1 July 2014 14:19, Alexander Zakharov alexander.v.zakha...@gmail.com
wrote:

 After upgrading from Qt 5.3.0 to Qt 5.3.1 I have found that the
 QScreen::physicalDotsPerInch function called for the primary screen (as
 qApp-primaryScreen()-physicalDotsPerInch()) in an Android application
 always yields infinity (tested in emulator (x86) and on Samsung Galaxy
 Tab 2 tablet). It worked properly, producing reasonable values, in Qt
 5.2.0, 5.2.1 and 5.3.0, at least on these devices. Is anybody else
 experiencing the same problem?
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] [Qt Android] Any recommended way to modify the package name for different build configuration?

2014-06-29 Thread Ben Lau
Hi,

I am using TestFairy to deliver beta/testing version of our application to
others. It is great if we don't have development version and those released
via TestFairy on a same device. Since TestFairy will re-sign the package ,
if the APK's package name is same, it will need to remove the previous
development version then install the TestFairy version , or vice-versa.
That will lose saved data.

It is better to keep both of the version on a phone. Therefore , I am
looking for a method which can change the package name /
AndroidManifest.xml by passing an option to qmake so that it could be
handled by build server.

Any recommended method?

Thank for any advise.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QML Mobile controls

2014-06-11 Thread Ben Lau
Hi Nurmi,

It is great to know that! That will be part of Qt Widget or Qt Quick
framework?


On 11 June 2014 18:44, Nurmi J-P jpnu...@digia.com wrote:

 On Wed, 2014-06-11 at 13:13 +0800, Ben Lau wrote:
  Hi,
 
 
  I am also interested to know is anybody working on this? I am writing
  an Android application using Qt. It needs native look and feel and
  therefore I have developed some components like ActionBar,NavBar,
  Navigation Drawer ,  ViewPager in QML. I would like to share those
  components but it take time to extract from the source tree.
 
 
 
 
 
 
 
 
 
 
 
 
 
  On 9 June 2014 22:21, Jason H jh...@gmx.com wrote:
  Are there any official or unofficial (community) plans to
  deliver QML controls for mobile platforms. I'm talking native
  look sand feel.
 
  I don't think it would be hard thought slightly complicated.
  If there aren't any maybe we can get a github collaboration
  going?
 
  The complicated part is that there are several approaches to
  how people approach mobile development:
  1. Native look and feel (platform specific) iOS -or- Android
  2. Common look and feel (platform agnostic) iOS -and- Android
  3. Meta-programming look and feel (platform specific) I have
  these intentions, map it to the platform concepts for me.
 
  So it can get pretty complicated. Especially since there isn't
  feature parity or even shared vocabulary between platforms.
  IOS/ANDROID:
  Navbar / Action Bar
  (  ) / Navbar
  Sheets / context popup menus
 
  Still, I think it would be a worthwhile effort to collect all
  the efforts to one place.
 
  We can manage which approach with a simple import:
  import mobile.cupertino
  import mobile.mountainview
  import mobile.common
 
  And when/if we get a meta paradigm:
  import mobile.helsinki
 
  *Note I'm using cities because the platform names are likely
  trademarked/copyrighted.
 

 Hi,

 We are working on Android style for the Qt Quick Controls. The target is
 to provide native styling for the controls in Qt 5.4. You can track
 https://bugreports.qt-project.org/browse/QTBUG-35081 to get status
 updates.

 --
 J-P Nurmi

 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QML Mobile controls

2014-06-11 Thread Ben Lau
On 11 June 2014 21:38, Thiago Macieira thiago.macie...@intel.com wrote:

 Em qua 11 jun 2014, às 19:56:53, Ben Lau escreveu:
  Hi Nurmi,
 
  It is great to know that! That will be part of Qt Widget or Qt Quick
  framework?

   We are working on Android style for the Qt Quick Controls. The target
 is
   to provide native styling for the controls in Qt 5.4. You can track
   https://bugreports.qt-project.org/browse/QTBUG-35081 to get status
   updates.

 As the name implies, Qt Quick Controls will work with Qt Quick. Qt Quick
 Controls is technically its own module.

 PS: please reply with text at the bottom, not at the top.
 --
 Thiago Macieira - thiago.macieira (AT) intel.com
   Software Architect - Intel Open Source Technology Center


Sorry for the silly question. I didn't read it carefully.

btw , I have another question for the solution. How will it handle the DP
unit?

Since the scaling using devicePixelRatio is still not implemented in
Android yet (QTBUG-38252) , I wonder what should user do to make their
application fit with DP after Qt 5.3.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QML Mobile controls

2014-06-11 Thread Ben Lau
On 11 June 2014 23:18, Nurmi J-P jpnu...@digia.com wrote:

 On 11 Jun 2014, at 16:44, Ben Lau xben...@gmail.com wrote:
 
  btw , I have another question for the solution. How will it handle the
 DP unit?
 
  Since the scaling using devicePixelRatio is still not implemented in
 Android yet (QTBUG-38252) , I wonder what should user do to make their
 application fit with DP after Qt 5.3.
 

 Qt will extract appropriate style attributes from the platform using
 native APIs. Controls will use image assets extracted from the device, and
 any dimensional attributes are queried as pixel sizes. This means that
 controls should take care of scaling themselves as appropriate.

 --
 J-P Nurmi


That means user still need to take care of the DP unit for their own custom
component? I think it is ok but will it have any object to provide the
density value (android.util.DisplayMetrics.density)? Although it could
query the value by user's custom code , it is a bit of trouble to make a
component that fit in DP and display perfectly in Quick Designer.

Thanks.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Convert QQuickItem into image

2014-06-10 Thread Ben Lau
Thank you for all of your help. I have implemented a solution very similar
to the QQuickItemGrabItem using private API. It is lucky that all of the
required components are available in Qt 5.3.



On 10 June 2014 02:11, Ben Lau xben...@gmail.com wrote:


 too bad... I need this feature for my application. It can't wait for Qt
 5.4 . Any alternative method?

 I have tried to create a new QQuickView and hold the item to render. It is
 not working if I don't call show on the view. It will not render and
 setup the QML component.



 On 5 June 2014 17:16, Gunnar Sletta gunnar.sle...@jolla.com wrote:

 It is new API so it goes to the next minor version of Qt, 5.4 in this
 case.

 cheers,
 Gunnar

 On 05 Jun 2014, at 11:14, Ben Lau xben...@gmail.com wrote:

  wow!! It is great!
 
  Will it be available in Qt 5.3.1? Or it need to wait unless Qt 5.4?
 
 
  On 5 June 2014 16:48, Liang Qi cavendish...@gmail.com wrote:
  That was done,
 https://github.com/qtproject/qtdeclarative/commit/0cb12e9e01b8309320706fab219945f0ff159413
 
  http://doc-snapshot.qt-project.org/qt5-dev/qquickitem.html#grabToImage
 
  Regards,
  Liang
 
 
  On 5 June 2014 10:15, Ben Lau xben...@gmail.com wrote:
  hi,
 
  I am writing an application that needs to convert a QML component
 within a Flickable into image. As the size can be larger than the
 Flickable. Therefore ,QQuickView::grabWindow() do not work in this case.
 
  Any alternative method to paint a QQuickItem into image? Any tips will
 be welcome. I may try to make an implementation.
 
  Thank.
 
  --
  http://www.qiliang.net
 
  ___
  Interest mailing list
  Interest@qt-project.org
  http://lists.qt-project.org/mailman/listinfo/interest



___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QML Mobile controls

2014-06-10 Thread Ben Lau
Hi,

I am also interested to know is anybody working on this? I am writing an
Android application using Qt. It needs native look and feel and therefore I
have developed some components like ActionBar,NavBar, Navigation Drawer ,
 ViewPager in QML. I would like to share those components but it take time
to extract from the source tree.








On 9 June 2014 22:21, Jason H jh...@gmx.com wrote:

 Are there any official or unofficial (community) plans to deliver QML
 controls for mobile platforms. I'm talking native look sand feel.

 I don't think it would be hard thought slightly complicated. If there
 aren't any maybe we can get a github collaboration going?

 The complicated part is that there are several approaches to how people
 approach mobile development:
 1. Native look and feel (platform specific) iOS -or- Android
 2. Common look and feel (platform agnostic) iOS -and- Android
 3. Meta-programming look and feel (platform specific) I have these
 intentions, map it to the platform concepts for me.

 So it can get pretty complicated. Especially since there isn't feature
 parity or even shared vocabulary between platforms.
 IOS/ANDROID:
 Navbar / Action Bar
 (  ) / Navbar
 Sheets / context popup menus

 Still, I think it would be a worthwhile effort to collect all the efforts
 to one place.

 We can manage which approach with a simple import:
 import mobile.cupertino
 import mobile.mountainview
 import mobile.common

 And when/if we get a meta paradigm:
 import mobile.helsinki

 *Note I'm using cities because the platform names are likely
 trademarked/copyrighted.





 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Convert QQuickItem into image

2014-06-09 Thread Ben Lau
too bad... I need this feature for my application. It can't wait for Qt 5.4
. Any alternative method?

I have tried to create a new QQuickView and hold the item to render. It is
not working if I don't call show on the view. It will not render and
setup the QML component.



On 5 June 2014 17:16, Gunnar Sletta gunnar.sle...@jolla.com wrote:

 It is new API so it goes to the next minor version of Qt, 5.4 in this case.

 cheers,
 Gunnar

 On 05 Jun 2014, at 11:14, Ben Lau xben...@gmail.com wrote:

  wow!! It is great!
 
  Will it be available in Qt 5.3.1? Or it need to wait unless Qt 5.4?
 
 
  On 5 June 2014 16:48, Liang Qi cavendish...@gmail.com wrote:
  That was done,
 https://github.com/qtproject/qtdeclarative/commit/0cb12e9e01b8309320706fab219945f0ff159413
 
  http://doc-snapshot.qt-project.org/qt5-dev/qquickitem.html#grabToImage
 
  Regards,
  Liang
 
 
  On 5 June 2014 10:15, Ben Lau xben...@gmail.com wrote:
  hi,
 
  I am writing an application that needs to convert a QML component within
 a Flickable into image. As the size can be larger than the Flickable.
 Therefore ,QQuickView::grabWindow() do not work in this case.
 
  Any alternative method to paint a QQuickItem into image? Any tips will
 be welcome. I may try to make an implementation.
 
  Thank.
 
  --
  http://www.qiliang.net
 
  ___
  Interest mailing list
  Interest@qt-project.org
  http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Convert QQuickItem into image

2014-06-05 Thread Ben Lau
hi,

I am writing an application that needs to convert a QML component within a
Flickable into image. As the size can be larger than the Flickable.
Therefore ,QQuickView::grabWindow() do not work in this case.

Any alternative method to paint a QQuickItem into image? Any tips will be
welcome. I may try to make an implementation.

Thank.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Listen to MySQL database change

2014-06-05 Thread Ben Lau
Hi Olivier,

First of all , it should check about did MySQL support to watch for
changes. According to the discussion result I found on Google , it don't
support any solution other than polling.

http://stackoverflow.com/questions/167254/watching-a-table-for-change-in-mysql

Please check the discussion above. Solution like audit table mentioned
should be able to be made by Qt's SQL module.


On 3 June 2014 17:56, Olivier Austina olivier.aust...@gmail.com wrote:

 Hi,

 Is there a way to listen for MySQL database updating. I have a program
 and I want to know when the database change (for insert and update
 event). Any suggestion is welcome. Thank you.
 Regards

 Regards
 Olivier


 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest


___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Convert QQuickItem into image

2014-06-05 Thread Ben Lau
wow!! It is great!

Will it be available in Qt 5.3.1? Or it need to wait unless Qt 5.4?


On 5 June 2014 16:48, Liang Qi cavendish...@gmail.com wrote:

 That was done,
 https://github.com/qtproject/qtdeclarative/commit/0cb12e9e01b8309320706fab219945f0ff159413

 http://doc-snapshot.qt-project.org/qt5-dev/qquickitem.html#grabToImage

 Regards,
 Liang


 On 5 June 2014 10:15, Ben Lau xben...@gmail.com wrote:

 hi,

 I am writing an application that needs to convert a QML component within
 a Flickable into image. As the size can be larger than the Flickable.
 Therefore ,QQuickView::grabWindow() do not work in this case.

 Any alternative method to paint a QQuickItem into image? Any tips will be
 welcome. I may try to make an implementation.

 Thank.


 --
 http://www.qiliang.net

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] [QtQuickTest] grabImage crash

2014-05-07 Thread Ben Lau
Hi,

I am using Qt Quick Test to test QML component.  I found that the
QQuickView associated with the test component is not visible . No window
widget is launched in Linux and Mac. So I would like to try the grabImage
function to save as a screenshot for verification. However, it will make
the application crashes.

Example code:

import QtQuick 2.0

import QtTest 1.0


Rectangle {

id : win

width: 480

height: 640

color : black;


TestCase {

function test_basic(){

wait(1000);

var image = grabImage(win);

}

}

}


It has been tested on Mac with Qt 5.2.1 and Linux with Qt 5.3.1 RC
version. The results are same.


Did I missed any step in initialization? I have already tried to
declare a QApplication before calling quick_test_main.



Thank for any advice.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] FW: TDD in QML

2014-05-05 Thread Ben Lau
In fact, it is quite troublesome to do TDD over QML. Although Qt has
provided the Qt Quick Test module, it don't support dummydata  like Qt
Quick Designer. I have tried to run tst_xxx.qml via the C++ test framework
but it can not use the TestCase object. It depends on QTestRootObject which
is a private class.

So now I could only use Qt Quick Test to test module which don't relay on
context object . For other module , I would let the C++ test framework to
setup an environment with dummydata loaded , then execute the QML module.
However, it just used as a gallery of widget . It show how the component
looks and the interaction with user. It will report if there any error
raised during execution . No any detailed tests are carried.

On 5 May 2014 14:50, Luca Bonifacio luca.bonifa...@bbv.ch wrote:

 Hi guys

 Is there somebody which has some experiences by doing TDD with QML? How do
 you mock QML components?


 -Original Message-
 From: Alan Alpert [mailto:4163654...@gmail.com]
 Sent: Samstag, 3. Mai 2014 01:30
 To: Luca Bonifacio
 Subject: Re: [Interest] Project structure for multi-platform mobile devices

 On Fri, May 2, 2014 at 5:47 AM, Luca Bonifacio luca.bonifa...@bbv.ch
 wrote:
  Hi Alan
 
  Thank you for your answer. Yes, that's correct. I could write a new
 component with the same name as the object in C++, but then I have the
 disadvantage that all those files are stored together my application source
 files, which isn't so nice. I would prefer to mock the C++ objects from my
 unit test project. Do you have already used TDD on complex projects? If
 yes, how do you do that?

 The dummydata files can be anywhere, as long as they're in one directory.
 Obviously, if you mock the C++ objects in C++ instead of QML then they
 exist near your custom test launcher.

 There was another guy who was doing TDD with QML on complex projects.
 But since you replied to me, and not the interest list, it will be hard
 for him to provide his feedback.

 --
 Alan Alpert
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] [Android] Preserve data files after deployment

2014-02-02 Thread Ben Lau
Hi all,

I found that every time deploying an application through Qt creator to
Android device will erase the previous created data file.

For example , my application stores the user preference using SQLite. It is
saved in the HomeLocation ( /data/data/${package}/files ) . When a new
version is deployed via Qt creator , the path and all the data will be
erased and therefore the user preference will be lost.

It is very annoying. Is there any method which can preserve the data file
after deployment?

Thanks.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Android] Profiling QML application

2014-01-19 Thread Ben Lau
On 15 January 2014 00:07, Ben Lau xben...@gmail.com wrote:



 On 13 January 2014 20:08, Koehne Kai kai.koe...@digia.com wrote:


  -Original Message-
  From: interest-bounces+kai.koehne=digia@qt-project.org
  [mailto:interest-bounces+kai.koehne=digia@qt-project.org] On
 Behalf Of
  Ben Lau
  Sent: Sunday, January 12, 2014 5:53 PM
  To: interest@qt-project.org
  Subject: [Interest] [Android] Profiling QML application
 
  Hi ,
 
  I got a performance problem in loading QML in Android . Therefore I
 would
  like to run profiler on QML itself. However, when I launch the QML
 profiler
  within QT creator. The process hang on :
 
  D/Qt  (14973): qtcpserverconnection.cpp:173
  (voidQTcpServerConnection::listen()): QML Debugger: Waiting for
  connection on port 61428...

 That's with Qt Creator 3.0? Please file a bug ...

 Anyhow, as a 'workaround' you should be able to profile by launching the
 app yourself with e.g. -qmljsdebugger=port:61428,block argument, and then
 connect from Qt Creator with Analyze-Qml Profiler(external) ...

 Regards

 Kai


 Hi Kai,

 Thanks for your reply. Then I have another question.. how can I assign the
 argument to an Android application?

 I have tried to use `adb shell` and launch the application by :

 $ am start -n mypackage/org.qtproject.qt5.android.bindings.QtActivity -e
 applicationArguments '-qmljsdebugger=port:61428'

 But it is still not working. The result of  QApplication::arguments()
 don't even contains the `-qmljsdebugger=port:61428` parameter.

 (p.s I will file a bug for Qt Creator)


I have found the solution. The command line to start Android application is
correct. I just need to run adb to setup the port forward then the QML
profiler (external) will works.

I guess Qt Creator didn't handled the port forward.

The command:
adb forward tcp:61428 tcp:61428
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] [Android] Profiling QML application

2014-01-14 Thread Ben Lau
On 13 January 2014 20:08, Koehne Kai kai.koe...@digia.com wrote:


  -Original Message-
  From: interest-bounces+kai.koehne=digia@qt-project.org
  [mailto:interest-bounces+kai.koehne=digia@qt-project.org] On Behalf
 Of
  Ben Lau
  Sent: Sunday, January 12, 2014 5:53 PM
  To: interest@qt-project.org
  Subject: [Interest] [Android] Profiling QML application
 
  Hi ,
 
  I got a performance problem in loading QML in Android . Therefore I would
  like to run profiler on QML itself. However, when I launch the QML
 profiler
  within QT creator. The process hang on :
 
  D/Qt  (14973): qtcpserverconnection.cpp:173
  (voidQTcpServerConnection::listen()): QML Debugger: Waiting for
  connection on port 61428...

 That's with Qt Creator 3.0? Please file a bug ...

 Anyhow, as a 'workaround' you should be able to profile by launching the
 app yourself with e.g. -qmljsdebugger=port:61428,block argument, and then
 connect from Qt Creator with Analyze-Qml Profiler(external) ...

 Regards

 Kai


Hi Kai,

Thanks for your reply. Then I have another question.. how can I assign the
argument to an Android application?

I have tried to use `adb shell` and launch the application by :

$ am start -n mypackage/org.qtproject.qt5.android.bindings.QtActivity -e
applicationArguments '-qmljsdebugger=port:61428'

But it is still not working. The result of  QApplication::arguments() don't
even contains the `-qmljsdebugger=port:61428` parameter.

(p.s I will file a bug for Qt Creator)
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


  1   2   >