Re: [Interest] Qt Creator is so buggy and so slow...

2021-03-19 Thread Dmitry Volosnykh
I observe somewhat similar symptoms on macOS. Yet, I have no concrete info
I can share to help debugging.

On Fri, Mar 19, 2021 at 2:19 PM Roland Hughes 
wrote:

>
> On 3/19/21 6:00 AM, Alexander Dyagilev wrote:
> > Often it just stops to suggest code, syntax highlighted stops working
> > (at least for a part of the code) for no apparent reason.
> >
> > It takes apporx. 10 seconds to parse c++ file for c++ tools to start
> > working. If you open/close/open same c++ it can stop parsing it until
> > app restart.
> >
> > App restart often helps to fix these bugs, but they do return in a small
> > amount of time...
> >
> > Any suggestions?
>
> What platform?
>
> I've noticed this on Ubuntu and Fedora. Bad enough that I stopped using
> QtCreator for anything other than the build. It's become extremely
> annoying with claims things are undefined that are obviously defined as
> well.
>
> --
> Roland Hughes, President
> Logikal Solutions
> (630)-205-1593
>
> http://www.theminimumyouneedtoknow.com
> http://www.infiniteexposure.net
> http://www.johnsmith-book.com
> http://www.logikalblog.com
> http://www.interestingauthors.com/blog
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Development] [Releasing] download.qt.io is down

2021-01-22 Thread Dmitry Volosnykh
Tuukka, thank you and the team for bringing the service up and running as
quickly as was possible.

On Fri, Jan 22, 2021 at 5:31 PM Tuukka Turunen  wrote:

> Hi,
>
>
>
> Servers have been restored and open-source downloads are working again.
>
>
>
> Archive of old and historic releases is missing, but will be made
> available next week.
>
>
>
> Blog post: https://www.qt.io/blog/open-source-downloads-working-again
>
>
>
> Yours,
>
>
>
> Tuukka
>
>
>
> *From: *coroberti 
> *Date: *Friday, 22. January 2021 at 11.32
> *To: *Nils Jeisecke , Tuukka Turunen <
> tuukka.turu...@qt.io>, Qt Project Development 
> *Subject: *Re: [Development] [Releasing] [Interest] download.qt.io is down
>
> On Fri, Jan 22, 2021 at 10:38 AM Nils Jeisecke via Development
>  wrote:
> >
> > Hi there,
> >
> > On Fri, Jan 22, 2021 at 7:59 AM Tuukka Turunen 
> wrote:
> >>
> >> Hi,
> >>
> >>
> >>
> >> Status update of the problem with open-source downloads: Last night we
> finally got a disk big enough for the packages from the service provider.
> Most of the data has been transferred throughout the night with a few last
> things still being uploaded to the new virtual server. After the data
> transfer is complete we start testing and validation of the data and the
> system. Target is to enable first the online installer, then the offline
> packages and finally the achieve of old releases.
> >
> >
> > just a little "Thank You" from my side.
> >
> > I try to imagine being of those spending hour after hour to get things
> running again and then reading all those nasty comments on the blog post.
> >
> > Nils
>
> Joining the thanks of Nils.
> We are really appreciating your support of open-source distribution.
>
> Kind regards,
> Robert Iakobashvili
> 
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] [Development] download.qt.io is down

2021-01-22 Thread Dmitry Volosnykh
Thanks for highlighting this, Giuseppe!

The qt-downloader  has caught up
with the approach by introducing the --server option for this purpose. So
that users of this tool can mitigate the risks of the outage.

On Fri, Jan 22, 2021 at 2:36 PM Giuseppe D'Angelo via Development <
developm...@qt-project.org> wrote:

> Il 19/01/21 21:08, Tuukka Turunen ha scritto:
> > https://qt-mirror.dannhauer.de/
> >
> > https://www.funet.fi/pub/mirrors/download.qt-project.org/
> >
> > https://ftp.fau.de/qtproject/
> >
> > ...or just use the online installer, which picks mirrors automatically.
>
> The online installer doesn't actually work because it will try and
> download the mirror list from the master, which is offline.
>
> One can use https://github.com/miurahr/aqtinstall instead, which allows
> to manually specify the mirror, e.g.
>
> > python -m aqt --base https://ftp.fau.de/qtproject/ --outputdir /opt/qt/
> 5.15.2 linux desktop
>
>
> HTH,
> --
> Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
> KDAB (France) S.A.S., a KDAB Group company
> Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
> KDAB - The Qt, C++ and OpenGL Experts
>
> ___
> Development mailing list
> developm...@qt-project.org
> https://lists.qt-project.org/listinfo/development
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] download.qt.io is down

2021-01-18 Thread Dmitry Volosnykh
Hi all,

The https://download.qt.io web site is unresponsive.

Dmitry.
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Screenshot QML Applications

2019-12-14 Thread Dmitry Volosnykh
Hi Matt, https://github.com/qmlbook/shorty might be of your interest.

On Thu, Dec 12, 2019 at 5:19 AM Matt Wright 
wrote:

> Hi,
>
> I'm running a QML app on an embedded Linux device running Debian.  I have
> seen some hits online about how to screenshot a Widgets app, but nothing
> obvious on how to do the same with a QML app.  My goal here is to have a
> key combination so that we can easily take a screenshot and store the file
> on the device, extracting the screenshot later.
>
> Any info any of you would be willing to share would be helpful.
>
> Thanks,
> Matt
>
> -Original Message-
> From: Interest  On Behalf Of
> interest-requ...@qt-project.org
> Sent: Friday, December 6, 2019 3:00 AM
> To: interest@qt-project.org
> Subject: Interest Digest, Vol 99, Issue 7
>
> Send Interest mailing list submissions to
> interest@qt-project.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.qt-project.org/listinfo/interest
> or, via email, send a message with subject or body 'help' to
> interest-requ...@qt-project.org
>
> You can reach the person managing the list at
> interest-ow...@qt-project.org
>
> When replying, please edit your Subject line so it is more specific than
> "Re: Contents of Interest digest..."
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] How to build qt3d editor?

2017-01-17 Thread Dmitry Volosnykh
Hello, Larry.

Would you be so kind to elaborate more on what you have tried so far and
what result were achieved?

Regards.

On Tue, Jan 17, 2017 at 11:36 AM Larry <754833...@qq.com> wrote:

> Is there anyone knows, please!
> os: ubuntu 16.04
>
> 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] How to change nested JSON object directly

2017-01-11 Thread Dmitry Volosnykh
This issue has been addressed here: QTBUG-25723

On Thu, Jan 12, 2017 at 2:14 AM jack ma  wrote:

> Hi,
> I mean if we can don't copy a QJsonObject with toObject(), but like
> something pointer, to change the nested value directly.
> because my nested object may be to big, that may waste memory and time.
>
> 2017-01-12 6:56 GMT+08:00 Thiago Macieira :
>
> On quinta-feira, 12 de janeiro de 2017 06:09:23 PST jack ma wrote:
> > *jsonObject["key1"].toObject().value("key2") = "somteting2"*
> >
> >
> > but now , *toObect()* just return a copy of key1, so you can't change
> > key2 directly
>
> QJsonObject jso2 = jsonObject["key1"].toObject();
> jso2["key2"] = "something2";
> jsonObject["key1"] = jso2;
>
> --
> 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] Creating Q_GADGET from qml

2016-11-25 Thread Dmitry Volosnykh
Hello, Immanuel!

I think you have missed this documentation page:
http://doc.qt.io/qt-5/positioning-cpp-qml.html

Quote:
Using QGeoCoordinate as an example, the C++ types are directly exposed to
the QML environment via its meta type:
qRegisterMetaType();
QMetaType::registerEqualsComparator();

Regards,
Dmitry.

On Fri, Nov 25, 2016 at 11:38 AM Immanuel Weber 
wrote:

Hi all,
I'm trying to expose a class DoubleVector2D which is a Q_GADGET to qml.
That class looks like this:
class DoubleVector2D
{
Q_GADGET
Q_PROPERTY(double x READ x WRITE setX)
Q_PROPERTY(double y READ y WRITE setY)
public:
DoubleVector2D() {}
DoubleVector2D(double x, double y) : m_x(x), m_y(y) {}
double x() const{ return m_x; }
double y() const { return m_y; }
void setX(double x) { m_x = x; }
void setY(double y) { m_y = y; }
private:
double m_x = 0.0;
double m_y = 0.0;
};
In my main.cpp I register it using
qRegisterMetaType("DoubleVector2D");
In a seperate class which is QObject derived I have a function which
returns such a DoubleVector2D.
Calling that function in my qml file returns the DoubleVector2D, so the
class works with qml in principal.
However I also need/want to create objects of that class in my qml/js code.
I saw that QtPositioning is using Q_GADGET in the same way for example to
expose QGeoCoordinate to qml.
There I can write QtPositioning.coordinate() and create an object of that
class. I examined the source of QtPositioning, however I could not find out
how this is done. qmlRegisterType() obiously does not work, as it is used
to register QObject derived classes.
What am I missing here?

Cheers
Immanuel



___
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-06 Thread Dmitry Volosnykh
Have you considered specifying option with a single leading dash?

On Wed, Jul 6, 2016 at 2:45 PM Лагнер, Сергей  wrote:

> ~/Downloads$ ./qt-enterprise-linux-x64-android-5.6.1-1.run --platform
> minimal
> Unknown option: platform
>
> There is no such option in executable help.
>
> 2016-07-06 16:54 GMT+06:00 Sumedha Widyadharma <
> sumedha.widyadha...@basyskom.com>:
>
>> Hi
>>
>> On 07/03/2016 04:34 PM, Ben Lau wrote:
>> > 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.
>>
>> Have you tried passing --platform minimal to the installer? I think this
>> would then work without any X Server.
>>
>> >
>> > https://github.com/benlau/qtci/
>> >
>> >
>> > On 3 July 2016 at 22:28, Лагнер, Сергей  develo...@lagner.ru>> 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
>> >
>>
>>
>> Regards,
>> Sumedha Widyadharma
>>
>> --
>> Sumedha Widyadharma
>> System Integrator
>>
>> basysKom GmbH
>> Robert-Bosch-Str. 7 | 64293 Darmstadt | Germany
>> Tel   : +49 6151 870 589 128  | Fax: +49 6151 870 589 199
>> sumedha.widyadha...@basyskom.com | www.basyskom.com
>>
>> Handelsregister: Darmstadt HRB 9352
>> Geschäftsführung: Dr. Eva Brucherseifer, Heike Ziegler
>>
>> ___
>> 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] Utilizing the GPU, how to start?

2016-07-06 Thread Dmitry Volosnykh
John, here you are: https://blog.qt.io/?s=vulkan=en

On Wed, Jul 6, 2016 at 11:31 AM John C. Turnbull 
wrote:

> Just out of interest, has anyone within the Qt community or company
> considered Vulkan?
>
> It looks to me as though the future of low level graphics APIs is not
> OpenGL or Direct3D or Metal.
>
> It's Vulkan.
>
> > On 6 Jul 2016, at 17:53, Kai Koehne  wrote:
> >
> >
> >
> >> -Original Message-
> >> From: Interest [mailto:interest-bounces+kai.koehne=qt...@qt-project.org
> ]
> >> [...]
> >> Multimedia and web rendering are a different story.  Others are better
> >> qualified to comment on the details of how WebEngine, QtMultimedia, and
> >> the older alternatives are implemented - but they are all wrappers
> around
> >> other libraries.  Just because widgets don’t render their own pixels on
> the
> >> GPU doesn’t mean those libraries can’t render the framed content on the
> >> GPU, AFAIK.  At least theoretically, but I’m not up-to-date on whether
> the
> >> widget implementations are currently doing that efficiently.
> >
> > QWeb_Engine_View indeed uses Qt Quick (and therefore potentially
> > the GPU) underneath , even for the widgets integration. So it might be
> worth
> > a try porting your app from Qt WebKit to Qt WebEngine (if only because
> > Qt WebKit is deprecated).
> >
> > For the video, it looks like QVideoWidget might benefit from OpenGL if
> > it's parent is a QOpenGL widget. Maybe you can experiment with this.
> > (I don't have first hand experience with QVideoWidget though).
> >
> >
> >
> > Regards
> >
> > Kai
> > ___
> > 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] Row, Column, Repeater, and ListView spacer delegate?

2016-06-29 Thread Dmitry Volosnykh
Unfortunately, spacer is not configurable in a straightforward manner at
the moment. You have to implement some workaround. You may want to file a
suggestion to add such functionality at bugreports.qt.io.

On Wed, Jun 29, 2016 at 7:39 PM Jason H  wrote:

> It would be really cool if Row, Column, Repeater, ListView supported a
> spacer delegate. So I could do:
> A | B | C
> And not just:
> A  B  C
>
> Is there a way I'm not thinking of? I don't want to include the bar in the
> delegate because then I always get an extra: either at the start or end of
> the list.
>
>
>
>
> ___
> 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 Loader loaded items showing

2016-06-29 Thread Dmitry Volosnykh
Hi, Jason,
you'd better provide complete example of your issue. Anyway, Loader is an
Item itself. Have you positioned it accordingly?

On Wed, Jun 29, 2016 at 6:44 PM Jason H  wrote:

> I had a working app with a menu that slides in.
> I converted it to use a Loader to load the area that contains the menu and
> the start page. Now the menu shows up when the app first starts.
>
> Despite my Menu.qml being:
> Item {
> id: menu
> x: -width //I should be off-screen!
> visible: false // you're not visible!!!
> Behavior on x {
> NumberAnimation {
> duration: 250
> }
> }
> ...
> }
>
> qml: loaderState 1
> qml: menu.width 480
> qml: menu.x -480
> qml: root.onCompeleted
>
> It shows and slides to the left. If I comment out the behavior, it works
> fine. I'm not sure why it's starting at X position 0, when it didn't
> before. It doesn't look like it is being assigned to zero anywhere in
> initialization.
> ___
> 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] Routing all QML file requests through a custom resource provider

2016-06-17 Thread Dmitry Volosnykh
Usually, you don't need to do anything to "register" you resources file.
Basically, you add .qrc filename to RESOURCES variable inside qmake's
project file. After that you are able to refer to its contents via "qrc"
protocol (in terms of URI) for either QFile or QUrl, etc.

By the way, have you looked into examples provided with QtCreator. I am
pretty sure that there are a plenty of examples exploting this
functionality.

On Fri, Jun 17, 2016 at 1:45 PM Max Savenkov <max.saven...@gmail.com> wrote:

> Hi Dmitry,
>
> As a understand it, qrc is just an index file. I still need to provide
> binary data it refers to somehow. Basically, what I don't understand is
> this passage in documentation: "a binary resource can be created and at a
> later point in application code registered with the resource system.".
> Looking at header file, I can see two ways to register a rcc file. This
> first is by specifying filename to QResource::registerResource. That one
> won't work, since Qt will try to load this file from conventional
> filesystem, while it is really located in my resource provider (basically,
> in memory).
>
> There is a second overload of registerResource, which takes a pointer to
> rccData. Which LOOKS like that I need, but it suspiciously missing "size"
> argument, so I'm not really sure what this call does. Unless, of course, it
> just registers a pointer to memory as a resource and just assumes it's a
> correctly formatted output of rcc that at least contains some header with
> size? In which case I certainly can use it, and it will solve my problems,
> but then it seems unsafe to me.
>
>
> 2016-06-17 12:45 GMT+03:00 Dmitry Volosnykh <dmitry.volosn...@gmail.com>:
>
>> Hi, Max!
>>
>> To be honest, I did not understand in all the details what you are trying
>> to achieve. Anyway that looks way complex indeed.
>>
>> Since you are inclined to pack all you resources into auxiliary file like
>> zip package, you are surely okay with static content. Having this said, you
>> should be fine using conventional .qrc files (this is what you named Qt
>> resource system). These files are easily accessed (i.e. viewed, edited,
>> etc.) from Qt Creator. Qt Designer tools understand them perfectly fine, as
>> well. Also, there should be no issues when importing QML components from
>> your .qml files once you feed QML engine with root .qml file stored inside
>> .qrc file.
>>
>> Regards,
>> Dmitry.
>>
>> On Fri, Jun 17, 2016 at 12:09 PM Max Savenkov <max.saven...@gmail.com>
>> wrote:
>>
>>> Hello,
>>>
>>> Once again, I'm trying to use Qt (in this case, QtQuick/QML) for game
>>> development. The game is going to store all its resources in a package
>>> (it might be zip, or a custom format) when deployed, but during
>>> development, resources are available in the usual filesystem. This
>>> difference is hidden by game's resource provider, which maps resource
>>> name to a file or an entry in package.
>>>
>>> This works for the game itself, but how can I make QML load images,
>>> imports and other resources from game's resource provider? (also, I'd
>>> like to view my QML files in Designer, which means I can't use custom
>>> image providers in QML code itself)
>>>
>>> I see two possibilities, but I'm not sure of either one.
>>>
>>> 1) Use dynamic resources produced by rcc. When loading a QML file from
>>> C++, also load relevant rcc data (from game's resources) and register it
>>> with Qt resource system to make it accessible. This sounds workable, but
>>> I'm not sure how exactly to make it happen. Suppose I got a binary
>>> buffer from game's resources. How do I register it in Qt?
>>>
>>> 2) Use a system of crutches.
>>> * Register Url Interceptor with my QMLEngine, such that:
>>>  - any URL that contains an image is changed into
>>> "image:/my_resource_provider/imagename.png"
>>>  - any URL that contains qml or qmldir is change into... What? There
>>> is no way to register a special loader for QML imports. But I guess I
>>> can change it into a network request, by substituting shcema to, for
>>> example, "my_provider"
>>> * Register image provider with name "my_resource_provider" that loads
>>> images from my resource system.
>>> * Register a custom network access manager factory/manager/network reply
>>> that load QML files from my system instead of network. This doesn't
>>> quite work, however, because QML at some point for w

Re: [Interest] QtCreator 3.6.1 on Linux

2016-06-08 Thread Dmitry Volosnykh
That's true for me as well running QtCreator 4.0.0 on Ubuntu 14.04.

On Wed, Jun 8, 2016 at 9:54 AM Igor Mironchik 
wrote:

> Hi,
>
> Do you guys have the same problem with QtCreator 3.6.1 on Linux as me:
>
> guess that you have opened in QtCreator some source files. When mouse
> cursor is on text you see text's cursor shape (some kind of vertical
> line). Then switch to the next source file with Ctrl+Tab. And now
> cursor's shape becomes arrow, and will become text's cursor shape if
> move cursor to the navigation hierarchy view and again to the text.
>
> So my question is it known bug? Or it's just problem with my environment?
>
> 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] Clean way to define and categorize constants in QML

2016-04-29 Thread Dmitry Volosnykh
Using such approach you have to write something like readonly property
QtObject backgroundColor: QtObject { ...

On Fri, Apr 29, 2016 at 2:04 PM Viktória Nemkin 
wrote:

> Hello!
>
> What is a clean way to define and categorize constants in QML?
>
> I have came up with this so far:
>
> I have a QML singleton element, named Theme. There I keep a few constant
> things, like different background and font colors.
>
> Theme.qml:
>
> pragma Singleton
>
> import QtQuick 2.0
>
> QtObject {
>
> readonly property color backgroundRed: "#FF2510"
>
> readonly property color backgroundWhite: "#F0F0F0"
>
> readonly property color backgroundPurple: "#930083"
>
> readonly property color fontRed: "#FF1010"
>
> readonly property color fontWhite: "#F6F6F6"
>
> }
>
>
> When I want to use one of the colors I write:
>
>
> color: Theme.backgroundRed
>
>
> I don't like this approach. What I would like to be able to write is this:
>
>
> color: Theme.background.red
>
>
> I have tried adding nested QtObjects inside Theme but I could not get it
> working.
>
>
> QtObject {
>
> QtObject {
>
> id: background
>
> readonly property color red: "#FF2510"
>
> readonly property color white: "#F0F0F0"
>
> readonly property color purple: "#930083"
>
> }
>
>
> QtObject {
>
> id: font
>
> readonly property color red: "#FF1010"
>
> readonly property color white: "#F6F6F6"
>
> }
>
> }
>
>
> When I run it like this, I get an error: Theme.qml: Cannot assign to
> non-existent default property.
>
> Is there a way to accomplish this? Is there any clean way to define and
> categorize constants in QML?
>
> Thank you,
> Viki
> ___
> 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-26 Thread Dmitry Volosnykh
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 need to do
>>> something else.
>>>
>>> But I am not sure if I am violating the "UI and business logic
>>> seperation" with this approach?
>>>
>>> ___
>>> 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] [QtQuick] Interaction with user from C++

2016-04-26 Thread Dmitry Volosnykh
While I cannot recommend you some 'the best book on declarative
programming', I still suggest you to read http://qmlbook.github.io

On Tue, Apr 26, 2016 at 1:27 PM Sina Dogru <sinado...@gmail.com> wrote:

> Yes I guess I am still thinking procedural way. Do you have any
> recommendation book/documents to understand  declarative programming?
>
> Thank you for your helps.
> Sina
>
> 2016-04-26 13:07 GMT+03:00 Dmitry Volosnykh <dmitry.volosn...@gmail.com>:
>
>> > Well the problem is ... while using QFileDialog's and QMessageBox's
>> static functions, program can continue to flow from where those functions
>> called.
>>
>> This is declarative language. Spaghetti code is unavoidable %) You'll
>> have to do a mind-shift to use QML as it was designed.
>>
>> On Tue, Apr 26, 2016 at 1:03 PM Dmitry Volosnykh <
>> dmitry.volosn...@gmail.com> wrote:
>>
>>> > FileDialog's open function would not return the file URL while
>>> QFileDialog::getSaveFileName would return it
>>> While FileDialog.open() does not return anythying, you still able to get
>>> file's URL via fileUrl property of FileDialog instance like follows:
>>>
>>> FileDialog {
>>>   id: fileDialog
>>>   onAccepted: console.log("User selected file:", fileUrl)
>>> }
>>>
>>> Situation with MessageBox is mostly the same. This QML type provides,
>>> basically, the same functionality as its C++ counterpart. So you may
>>> perform different actions upon receiving different signals which correspond
>>> to buttons that user may press (Not suprisingly that these signals are
>>> named exactly the same as button enum's that are returned as an int result
>>> of QMessageBox::exec() method). So, here you are:
>>>
>>> MessageBox {
>>>   id: messageBox
>>>   onYes: console.log("User pressed Yes button")
>>>   onNo: console.log("User pressed No button")
>>>   onApply: console.log("User pressed Apply button")
>>>   // etc ...
>>> }
>>>
>>> On Tue, Apr 26, 2016 at 12:36 PM Sina Dogru <sinado...@gmail.com> wrote:
>>>
>>>> Hi, Sina. You may try to wrap those C++-side static methods with
>>>>> intermediary class that is exposed to QML in a usual way. As far as I
>>>>> remember there should be some API for opening files as well as for message
>>>>> notifications. But that will require you to import QtQuick.Controls 
>>>>> module.
>>>>> Please, refer to official documentation for more precise name of the 
>>>>> module.
>>>>>
>>>> Hello Dmitry, thank you for respond. I think you are talking about the
>>>> FileDialog QML type and MessageBox. But my problem is, when I call a static
>>>> method of the intermediary class which calls FileDialog's open function
>>>> would not return the file URL while QFileDialog::getSaveFileName would
>>>> return it. So to do it, QML would need to call another function onAccepted
>>>> handler and it would need to know which function it needs to call.
>>>>
>>>> I mean, for example consider a situation where a C++ class process a
>>>> user input carried from QML to C++. If the user input is incorrect, I would
>>>> need to ask the user some options. So I pop up a message box which presents
>>>> the options to the user with this intermediary class. But when I do this, I
>>>> would lose the flow of the program. So when the user responds to the
>>>> message box, I would need to call another C++ function to process. But
>>>> since QMessageBox's and QFileDialog's static functions create their own
>>>> event loop and returns the data, I would be able to process new data
>>>> without loosing the current stack and flow of the program.
>>>>
>>>> So QMessageBox and QFileDialog's static functions are not need to know
>>>> on their event handlers, because they just returns the information that is
>>>> needed so program can continue from the same stack.
>>>>
>>>> Like I said, I am not so exprienced with programming. I might be
>>>> misjudging your advice or QML and C++ seperation.
>>>>
>>>>
>>>
>
___
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-26 Thread Dmitry Volosnykh
> FileDialog's open function would not return the file URL while
QFileDialog::getSaveFileName would return it
While FileDialog.open() does not return anythying, you still able to get
file's URL via fileUrl property of FileDialog instance like follows:

FileDialog {
  id: fileDialog
  onAccepted: console.log("User selected file:", fileUrl)
}

Situation with MessageBox is mostly the same. This QML type provides,
basically, the same functionality as its C++ counterpart. So you may
perform different actions upon receiving different signals which correspond
to buttons that user may press (Not suprisingly that these signals are
named exactly the same as button enum's that are returned as an int result
of QMessageBox::exec() method). So, here you are:

MessageBox {
  id: messageBox
  onYes: console.log("User pressed Yes button")
  onNo: console.log("User pressed No button")
  onApply: console.log("User pressed Apply button")
  // etc ...
}

On Tue, Apr 26, 2016 at 12:36 PM Sina Dogru  wrote:

> Hi, Sina. You may try to wrap those C++-side static methods with
>> intermediary class that is exposed to QML in a usual way. As far as I
>> remember there should be some API for opening files as well as for message
>> notifications. But that will require you to import QtQuick.Controls module.
>> Please, refer to official documentation for more precise name of the module.
>>
> Hello Dmitry, thank you for respond. I think you are talking about the
> FileDialog QML type and MessageBox. But my problem is, when I call a static
> method of the intermediary class which calls FileDialog's open function
> would not return the file URL while QFileDialog::getSaveFileName would
> return it. So to do it, QML would need to call another function onAccepted
> handler and it would need to know which function it needs to call.
>
> I mean, for example consider a situation where a C++ class process a user
> input carried from QML to C++. If the user input is incorrect, I would need
> to ask the user some options. So I pop up a message box which presents the
> options to the user with this intermediary class. But when I do this, I
> would lose the flow of the program. So when the user responds to the
> message box, I would need to call another C++ function to process. But
> since QMessageBox's and QFileDialog's static functions create their own
> event loop and returns the data, I would be able to process new data
> without loosing the current stack and flow of the program.
>
> So QMessageBox and QFileDialog's static functions are not need to know on
> their event handlers, because they just returns the information that is
> needed so program can continue from the same stack.
>
> Like I said, I am not so exprienced with programming. I might be
> misjudging your advice or QML and C++ seperation.
>
>
___
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-26 Thread Dmitry Volosnykh
Hi, Sina. You may try to wrap those C++-side static methods with
intermediary class that is exposed to QML in a usual way. As far as I
remember there should be some API for opening files as well as for message
notifications. But that will require you to import QtQuick.Controls module.
Please, refer to official documentation for more precise name of the module.

On Tue, Apr 26, 2016, 11:03 AM Sina Dogru  wrote:

> Hello list,
>
> Before watching this video
> ,
> I was thinking the Qt-Declarative module is aiming to touch-screen and
> mobile devices. And also after experiencing some QtQuick applications on
> desktop my thought have totally changed. So I started a small desktop
> application with QtQuick.
>
> I had some problems with QML but also enthused :). If I come to the point,
> my main problem is with C++ backend. I use some C++ classes with QML. I am
> aware of that QML is natively seperates UI and business logic but sometimes
> I need to interact with the user from my C++ classes. I am not sure if this
> is about general architect problem of my design, I am not well exprienced
> programmer. For example, on some points, qml sends some user interaction to
> C++ classes, eg URL of a file. Class checks the url and responds to user
> with QML(emitting a signal).
>
> On the Widgets world, some of the static functions of QMessageBox and
> QFileDialog (eg getSaveFileName
>  and warning
> ) are so handy and
> necessary, IMHO. I do mimic this behaviour with a QML function, which opens
> a file dialog or a message box with the function arguments, connected to a
> signal of a C++ class. So whenever I need to interact with the user from
> C++ I just emit this signal with the proper arguments. For example when I
> need to say to user that his/her input was incorrect, I just emit warning
> signal. But the problem is when I need to get the user respond to this
> warning box. Beauty of the QMessageBox and QFileDialog's static functions
> are they creates their own event loop and they just returns the data that
> needed.
>
> My question is, I am not sure if this is originated from my design flaws,
> is it possible to create an internal event loop in QML so the event loop
> would return the necessary data?
>
> Thank you,
> Sina
>
>
>
> ___
> 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] Diffusion of beta versions

2016-04-22 Thread Dmitry Volosnykh
+1 from me

On Fri, Apr 22, 2016 at 3:51 PM Xavier Bigand 
wrote:

> Is there a particular raison to not see beta version in the Qt Maintenance
> Tool?
>
> I would prefer to be able to use the maintenance tool to download preview
> versions. The last time I tried to download a beta version of Qt I got
> conflicts with my main installation.
>
> --
> Xavier
> ___
> 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] QAbstractItemModel::layoutAboutToBeChanged

2016-03-23 Thread Dmitry Volosnykh
Bill, for example, you may have sorted rows. In this case all items are
still up to date, but they are rearranged visually. So, the view may do
some optimisations upon rendering this case, since the only thing it needs
is to reposition old items without the need to re-read theirs data.

On Thu, Mar 24, 2016 at 2:44 AM Bill Crocker 
wrote:

> Gang:
>
> The doc for QAbstractItemModel::layoutAboutToBeChanged() says...
>
>  This signal is emitted just before the layout of a model is changed.
>  Components connected to this signal use it to adapt to changes in the
> model's layout.
>
> What is the "layout of a model" and how does that differ from
> adding and removing rows and columns.
>
> Thanks.
>
> Bill
> ___
> 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 property to string?

2016-03-10 Thread Dmitry Volosnykh
I feel the same need frequently, too. Without such feature I have to set
objectName by copy-pasting and qouting id. This is quite annoying.

On Thu, Mar 10, 2016 at 8:08 PM Jason H  wrote:

> A few times now, I've wanted to display the id as a string. Usually when
> something goes wrong on the console, but sometimes in a hash/map.  I've got
> a function that takes an object (QML item) and does some processing on it.
> Is there a way to get it? I know I can just set a property, but then that
> has to be maintained separately.
> ___
> 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] Dynamic translations for mobile apps at runtime?

2016-03-03 Thread Dmitry Volosnykh
You will have the same overhead whenever the text to translate changes. If
it is static during the application life cycle then this should not be an
issue either.

On Thu, Mar 3, 2016 at 11:41 PM Jérôme Godbout  wrote:

> Nice, I didn't knew about "-tr-function-alias", indeed this seem like the
> right thing to do. Will try this out. About speed, for the number of time
> you use the change language during runtime, it doesn't really matter, if it
> take a few ms more.
>
> Thanks for the tips!
>
> On Thu, Mar 3, 2016 at 2:37 PM, Julien Cugnière  > wrote:
>
>> 2016-03-03 18:50 GMT+01:00 Jérôme Godbout :
>> > We did the same thing into Qml, we have a C++ singleton equivalent to
>> your
>> > backend, that select the current language files and emit the QString
>> > property changed.
>> > qsTr("String to convert") + I18n.revaluate
>> >
>> > I wish they made underlying hook to revaluate the qsTr() with a signal
>> > connected like if the qsTr() have changed. This pollute the code all
>> over,
>> > only to be able to swap language on the fly.
>>
>> Just an idea : you might be able to hide that I18n.revaluate with
>> something along the lines of :
>>
>> function myTr(s) {
>> return qsTr(s) + I18n.revaluate;
>> }
>>
>> Text {
>> text: myTr("String to convert")
>> }
>>
>> Then you need to get lupdate to understand "myTr", which can be done
>> with the command line option "-tr-function-alias qsTr=myTr".
>>
>> Although this incurs the overhead of a function call, which might
>> prevent QML from using its fast path for bindings evaluation. Not sure
>> if it matters.
>>
>> Julien Cugnière
>>
>
> ___
> 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] C++ / QML headaches

2016-02-11 Thread Dmitry Volosnykh
Willem,
try removing Q_INVOKABLE before VendorModel() method. Withouth this
moc-related "keyword" VendorModel() method will remain "visible" to moc
since it is declared as a READ-accessor inside corresponding Q_PROPERTY
macro.

On Fri, Feb 12, 2016 at 9:29 AM Willem Ferguson <
willemfergu...@zoology.up.ac.za> wrote:

> I include an image explaining much of the context of the problem I
> encounter.
>
> I have a QML combobox that needs to respond to a C++ QStringListModel. I
> do this as follows:
>
> At the start where the QML machine is initialised (at the top of the
> attached image)
> 1) Define and instantiate the underlying C++ class (DownloadManager) as a
> global object (downloadhelper),
> visible to the C++ code far away.
> 2) Define a context pointer to downloadhelper. The handle for this pointer
> is "downloadhelper".
>
> Within the downloadmanager class (the C++ code):
> 1) Define a property set (Q_PROPERTY) that allows QML to see several
> structures inside the C++ code.
> 2) Define the model vendorModel to be used by the QML combobox. The
> vendorModel is accessible both
> as a QStringListModel (vendorModel) and as a function that returns a
> pointer to a QStrinListModel
> (VendorModel()).
>
> In the QML:
> 1) The downloadhelper object is seen with the QML code, visible by the
> italic font of "downloadhelper" as well
> some of the visible parts within downloadhelper, offered in the
> dropdown list (right-hand side of attached image)
> In fact, the function downloadhelper.fill_computer_list() works as
> expected and fills venderModel (the QStringListModel)
> with an appropriate QStringList.
>
> The result: If, within the model specification in the QML:
> 1) If I choose "vendorModel" from the dropdown list and execute, there is
> a segfault at the model definition in the QML
>  Commenting out the model definition eliminates the segfault.
> 2) If I choose "VendorModel()", the QML processor does not recognise the
> identifier
> 3) If I choose the source QStringList (not the model based in that
> stringlist) I get an error message:
> ERROR: Unknown method return type: QStringListModel*
> 4) If I choose VendorModel (as defined in the Q_PROPERTY), then I get the
> output in the black box at the bottom of the image.
> If I take the Q_PROPERTY definition as a yard stick, the READ handle
> VendorModel should be the appropriate one.
> But VendorModel is not even listed in the dropdown list in the QML
> code in the image.
>
> Any comments or suggestion will be very valuable.
> Kind regards,
> willem
>
> ___
> 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] QtArg version 2.0.0

2016-01-26 Thread Dmitry Volosnykh
Igor, as far as I can see form documentation QCommandLineParser is able to
support commands too. For example, see
http://doc.qt.io/qt-5/qcommandlineparser.html#clearPositionalArguments. How
does you library compare to just mentioned functionality? If it does
something more and/or better, have you considered hacking on
QCommandLineParser?

On Tue, Jan 26, 2016 at 3:00 PM Ben Lau  wrote:

> 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
>
___
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 Dmitry Volosnykh
>From what I see by the moment, QtArg usage help message displays list of
supported commands with all the details on using them, while
QCommandLineParses provides context dependant usage messages. For example,
at the top level it may list supported commands (not sure if it can provide
commands' arguments at this point), and once user has provided command
usage message displays corresponding list of arguments. This process may be
repeated for the arbitrary list of commands (positional arguments).

On Tue, Jan 26, 2016 at 3:49 PM Igor Mironchik <igor.mironc...@gmail.com>
wrote:

> Hi,
>
>
> On 26.01.2016 15:21, Dmitry Volosnykh wrote:
>
> Igor, as far as I can see form documentation QCommandLineParser is able to
> support commands too. For example, see
> http://doc.qt.io/qt-5/qcommandlineparser.html#clearPositionalArguments.
> How does you library compare to just mentioned functionality? If it does
> something more and/or better, have you considered hacking on
> QCommandLineParser?
>
>
> I have to play with QCommandLine* to answer your questions better.
>
> For true, I've never used QCommandLine* and for my projects I already use
> QtArg...
>
> I will play with QCommandLine* and answer in this mailing list later.
>
> But what I understood from this example, that positional argument can be
> any word, may be it's a plus, may be minus... With QtArg you can specify
> set of commands and only this set of commands can be present in command
> line otherwise will be an error of parsing...
>
>
>
> On Tue, Jan 26, 2016 at 3:00 PM Ben Lau <xben...@gmail.com> wrote:
>
>> On 26 January 2016 at 19:52, Igor Mironchik <igor.mironc...@gmail.com>
>> 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
>>
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Qt component repositories

2016-01-26 Thread Dmitry Volosnykh
Igor, inqlude should provide mentioned functionality, too. See
http://inqlude.org/get.html
On Tue, Jan 26, 2016 at 4:01 PM Igor Mironchik 
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] Online installer issue

2016-01-14 Thread Dmitry Volosnykh
After skipping login page installer fails with network error (see
screenshot in attach[image: Screenshot from 2016-01-14 10:57:55.png]ments).
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QQuickTextNode not reachable from QQuickItem

2016-01-14 Thread Dmitry Volosnykh
Hi, Mark.

I guess you should implement it without using QQuickTextNode directly.
Instead, you could try to put text in a usual way on top of your custom
item. Is there anything that prevents you from achieving your goal this way?

Regards,
Dmitry.

On Thu, Jan 14, 2016 at 11:32 PM mark diener  wrote:

> Hello List:
>
> Well after pouring thru 5.5.1 source code, I find that QQuickTextNode
> is really not intended to be used in QQuickItem derived classes.
>
> There is not visible header file from projects.
>
> Lots of various google references to similar challenge of text in
> QQuickItem.
>
> At this point, my only C++ way for custom components with text is
> QQuickPaintedItem.
>
> Anyone have thoughts on how to output text into QuickItem stuff?
>
> Thanks,
>
> 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] Calling C++ from QML (without objects)

2015-11-05 Thread Dmitry Volosnykh
I think, you have only option to wrap it with QObject that you expose to
QML.

On Thu, Nov 5, 2015 at 9:17 PM, Jason H  wrote:

> I want to provide a wrapper around QMessageAuthenticationCode::hash()
>
> But I think I need an object for it. Can I just expose it as a function
> some how?
>
> I am more interested in having it callable, than an object in my QML
> element hierarchy.
>
> 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] Can QML model specify a range including negative numbers? For example -180 to +180 ?

2015-11-04 Thread Dmitry Volosnykh
You'd better provide your implementation of TumblerColumn component.

Despite that fact, and assuming you somehow manage to know what value was
chosen, I'd suggest (as a quick attempt) to set model: 361, and the shift
values by -181.

On Wed, Nov 4, 2015 at 5:53 PM, Edward Sutton 
wrote:

> Is there a way to declare a QML model range from -180 to +180?
>
> A method that does not require typing 361 numbers model: [-180, -179, … 0,
> … 179, 180 ] ?
>
>
>
> I added a Tumbler to Combining Qt Widgets and QML with
> QWidget::createWindowContainer()
> 
> to experiment with making QML readable and writable from C++.
>
>
> Tumbler {
>
> // latitude degrees -180 to +180
>
> TumblerColumn {
>
> model: 181  // <- Is there a way to declare model range -180 to +180 ?
>
> }
>
> // latitude minutes 0 - 59
>
> TumblerColumn {
>
> model: 60
>
> }
>
> // latitude seconds 0 - 59
>
> TumblerColumn {
>
> model: 60
>
> }
>
> }
>
>
> Thanks in advance,
>
>
> -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] Linguist does not show several input field for strings with plural numbers

2015-10-26 Thread Dmitry Volosnykh
I face the same problem with Internationalization QML-example (
http://doc.qt.io/qt-5/qtqml-qml-i18n-example.html). I've just replaces
qsTr("Hello") with qsTr("%n second(s)"). But still cannot see Linguist
providing multiple input fields for a number of translations.

Also tried Linguist 5.6.0 built with Qt from the repo. Most probably, not
the latest revision.

On Mon, Oct 26, 2015 at 12:14 PM, Dmitry Volosnykh <
dmitry.volosn...@gmail.com> wrote:

> I have several strings defined in .qml file and marked with QT_TR_NOOP.
> The placeholder I use is %n like the docs suggest. After running lupdate
> tool on the project file I open generated .ts files in Linguist which does
> not recognize them as ones which should be translated according to
> translation rules for plurals.
>
> Never the less context sources for the strings in question are displayed
> correctly and target language is evaluated fine if I open 'Translation file
> settings...' menu item. However, I tried to add plural translations
> manually to .ts files (added numerus="yes" attribute to message tag and put
> several  items as children of )/ when I ran
> lupdate tool once again it provided the following output:
>
> Removed plural forms as the target language has less forms.
>
> If this sounds wrong, possibly the target language is not set or
> recognized.
>
>
> However, the language attribute of tag  is set as expected.
>
> I am using prebuilt Qt 5.4.2. Linguis version is just the same.
>
> May you suggest what to do to diagnose this problem further?
>
> Regads,
> Dmitry.
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Linguist does not show several input field for strings with plural numbers

2015-10-26 Thread Dmitry Volosnykh
Well, as far as I can see the problem is on the lupdate side. It just does
not add numerus="yes" attribute. Thus, Linguist does not interpret this
message as the one with plural form.

On Mon, Oct 26, 2015 at 1:32 PM, Dmitry Volosnykh <
dmitry.volosn...@gmail.com> wrote:

> I face the same problem with Internationalization QML-example (
> http://doc.qt.io/qt-5/qtqml-qml-i18n-example.html). I've just replaces
> qsTr("Hello") with qsTr("%n second(s)"). But still cannot see Linguist
> providing multiple input fields for a number of translations.
>
> Also tried Linguist 5.6.0 built with Qt from the repo. Most probably, not
> the latest revision.
>
>
> On Mon, Oct 26, 2015 at 12:14 PM, Dmitry Volosnykh <
> dmitry.volosn...@gmail.com> wrote:
>
>> I have several strings defined in .qml file and marked with QT_TR_NOOP.
>> The placeholder I use is %n like the docs suggest. After running lupdate
>> tool on the project file I open generated .ts files in Linguist which does
>> not recognize them as ones which should be translated according to
>> translation rules for plurals.
>>
>> Never the less context sources for the strings in question are displayed
>> correctly and target language is evaluated fine if I open 'Translation file
>> settings...' menu item. However, I tried to add plural translations
>> manually to .ts files (added numerus="yes" attribute to message tag and put
>> several  items as children of )/ when I ran
>> lupdate tool once again it provided the following output:
>>
>> Removed plural forms as the target language has less forms.
>>
>> If this sounds wrong, possibly the target language is not set or
>> recognized.
>>
>>
>> However, the language attribute of tag  is set as expected.
>>
>> I am using prebuilt Qt 5.4.2. Linguis version is just the same.
>>
>> May you suggest what to do to diagnose this problem further?
>>
>> Regads,
>> Dmitry.
>>
>
>
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Linguist does not show several input field for strings with plural numbers

2015-10-26 Thread Dmitry Volosnykh
I have several strings defined in .qml file and marked with QT_TR_NOOP. The
placeholder I use is %n like the docs suggest. After running lupdate tool
on the project file I open generated .ts files in Linguist which does not
recognize them as ones which should be translated according to translation
rules for plurals.

Never the less context sources for the strings in question are displayed
correctly and target language is evaluated fine if I open 'Translation file
settings...' menu item. However, I tried to add plural translations
manually to .ts files (added numerus="yes" attribute to message tag and put
several  items as children of )/ when I ran
lupdate tool once again it provided the following output:

Removed plural forms as the target language has less forms.

If this sounds wrong, possibly the target language is not set or recognized.


However, the language attribute of tag  is set as expected.

I am using prebuilt Qt 5.4.2. Linguis version is just the same.

May you suggest what to do to diagnose this problem further?

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


[Interest] How to use PathView's itemAt() function?

2015-08-31 Thread Dmitry Volosnykh
Docs say that I should pass x and y in content coordinates, but unlike
ListView, the PathView does not inherit from Flickable, so it does not have
any contentItem property. Using x and y in PathView's coordinate system I
get null.

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


Re: [Interest] QML ListView: automatically change width

2015-08-16 Thread Dmitry Volosnykh
Another way might be using childrenRect.width property.

On Sun, Aug 16, 2015 at 6:22 PM, Igor Mironchik igor.mironc...@gmail.com
wrote:

 Hi,

 On 16.08.2015 17:27, Dmitry Volosnykh wrote:

 Did you try to bind height to contentHeight?


 Nice idea. It works but I receive next warning:

 QML ListView: Binding loop detected for property width

 It from here:

 ListView {
 anchors.centerIn: parent
 orientation: ListView.Horizontal
 model: sampleModel
 delegate: delegateItem
 width: contentWidth
 }


 On Sun, Aug 16, 2015 at 5:23 PM, Igor Mironchik igor.mironc...@gmail.com
 wrote:

 Hi guys,

 How can I automatically change width of the QML ListView to fit all
 content?

 --
 Best Regards,
 Igor Mironchik.

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



 --
 Best Regards,
 Igor Mironchik.


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


Re: [Interest] QML ListView: automatically change width

2015-08-16 Thread Dmitry Volosnykh
Did you try to bind height to contentHeight?

On Sun, Aug 16, 2015 at 5:23 PM, Igor Mironchik igor.mironc...@gmail.com
wrote:

 Hi guys,

 How can I automatically change width of the QML ListView to fit all
 content?

 --
 Best Regards,
 Igor Mironchik.

 ___
 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: How to set verticalCenterOffset...

2015-08-16 Thread Dmitry Volosnykh
You'd better provide your example so that we could run it with qmlscene.

On Sun, Aug 16, 2015 at 9:08 PM, Igor Mironchik igor.mironc...@gmail.com
wrote:

 Hi,

 I'm trying to center ListView in a Rectangle.

 I do:

 anchors.centerIn: parent

 But it moves ListView under the real center, so I need to add negative
 verticalCenterOffset.

 I've tried in ListView:

 anchors.verticalCenterOffset: - height / 2.0

 But it doesn't work. If I set verticalCenterOffset without calculations,
 i.e. real number then all is ok...

 How can I solve the problem?

 --
 Best Regards,
 Igor Mironchik.

 ___
 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: How to set verticalCenterOffset...

2015-08-16 Thread Dmitry Volosnykh
Since you want all list's items to be visible, I'd suggest you to use Row +
Repeater combination, unless you want to exploit ListView's animation
facilities.

On Sun, Aug 16, 2015 at 10:06 PM, Dmitry Volosnykh 
dmitry.volosn...@gmail.com wrote:

 Your issue is the result of the fact that ListView has zero height (just
 print height of your list in Component.onCompleted and onHeightChanged
 handlers). While it gets correctly positioned in the middle of the window,
 its children go right below the middle line. You need a way to set
 ListView's height to the height of the images. Using childrenRect.height
 did not work for me. In your case, assuming all images are of the same
 size, you may want to set list's height manually.

 On Sun, Aug 16, 2015 at 9:47 PM, Igor Mironchik igor.mironc...@gmail.com
 wrote:

 In the attachment...

 On 16.08.2015 21:40, Dmitry Volosnykh wrote:

 You'd better provide your example so that we could run it with qmlscene.

 On Sun, Aug 16, 2015 at 9:08 PM, Igor Mironchik igor.mironc...@gmail.com
  wrote:

 Hi,

 I'm trying to center ListView in a Rectangle.

 I do:

 anchors.centerIn: parent

 But it moves ListView under the real center, so I need to add negative
 verticalCenterOffset.

 I've tried in ListView:

 anchors.verticalCenterOffset: - height / 2.0

 But it doesn't work. If I set verticalCenterOffset without calculations,
 i.e. real number then all is ok...

 How can I solve the problem?

 --
 Best Regards,
 Igor Mironchik.

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



 --
 Best Regards,
 Igor Mironchik.



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


Re: [Interest] QML: How to set verticalCenterOffset...

2015-08-16 Thread Dmitry Volosnykh
Your issue is the result of the fact that ListView has zero height (just
print height of your list in Component.onCompleted and onHeightChanged
handlers). While it gets correctly positioned in the middle of the window,
its children go right below the middle line. You need a way to set
ListView's height to the height of the images. Using childrenRect.height
did not work for me. In your case, assuming all images are of the same
size, you may want to set list's height manually.

On Sun, Aug 16, 2015 at 9:47 PM, Igor Mironchik igor.mironc...@gmail.com
wrote:

 In the attachment...

 On 16.08.2015 21:40, Dmitry Volosnykh wrote:

 You'd better provide your example so that we could run it with qmlscene.

 On Sun, Aug 16, 2015 at 9:08 PM, Igor Mironchik igor.mironc...@gmail.com
 wrote:

 Hi,

 I'm trying to center ListView in a Rectangle.

 I do:

 anchors.centerIn: parent

 But it moves ListView under the real center, so I need to add negative
 verticalCenterOffset.

 I've tried in ListView:

 anchors.verticalCenterOffset: - height / 2.0

 But it doesn't work. If I set verticalCenterOffset without calculations,
 i.e. real number then all is ok...

 How can I solve the problem?

 --
 Best Regards,
 Igor Mironchik.

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



 --
 Best Regards,
 Igor Mironchik.


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


Re: [Interest] PropertyAction doesn't work with anchors

2015-08-05 Thread Dmitry Volosnykh
What if you specify a single property: anchors and set it to object
value: { bottom: 100; top: 100 }

PS. Just a suggestion. Have not done something similar by myself.

On Wed, Aug 5, 2015 at 2:33 AM, Ruslan Moukhlynin rus...@khvmntk.ru wrote:

 Suppose we have following code:

 Rectangle {

 id:  rect

 width: 100

 height: 100



 MouseArea {

 anchors.fill: parent

 onClicked: {

 rect.state = state1

 }

 }



 states: [

 State {

 name: state1

 AnchorChanges {

 target: rect

 anchors.bottom: parent.bottom

 anchors.top: undefined

 }

 PropertyChanges {

 target: rect

 color: red

 }

 }

 ]

 transitions: [

 Transition {

 SequentialAnimation {

 PropertyAction {

 target: rect

 properties: anchors.bottom,anchors.top

 value: 100

 }

 PropertyAnimation {

 target: rect

 property: color

 duration: 1000

 }

 }

 }

 ]

 }


 anchors should be changed immediately but that not happens. PropertyAction
 works fine with some another properties but not with anchors.
 --
 With best regards,
 Ruslan Moukhlynin

 ___
 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 Dmitry Volosnykh
John, if there are good examples of mobile applications, I believe they
should be listed here: http://showroom.qt.io

On Sat, Jul 11, 2015 at 5:21 AM, 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?

 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?

 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.?

 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?

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

 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] Is moc obsolete?

2015-07-08 Thread Dmitry Volosnykh
Igor, there was quite a hot discussion of this project in development
mailing list. Follow here:
http://lists.qt-project.org/pipermail/development/2015-June/022164.html

On Wed, Jul 8, 2015 at 9:57 AM, Igor Mironchik igor.mironc...@gmail.com
wrote:

  Hi,

 Does anybody know if Qt plans to remove moc in the future releases, let's
 say in Qt 6?

 I found CopperSpice http://www.copperspice.com/ it's C++ library derived
 from the existing Qt 4.8 framework.

 And here some thoughts from Woboq about this topic
 http://woboq.com/blog/reflection-in-cpp-and-qt-moc.html

 ___
 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 ListView/Model currentIndexChanges not firing for synamic models

2015-06-29 Thread Dmitry Volosnykh
Jason, the only commented out line I see there is misspelled name of the
component file.
Also, I am able to interect each of three list views, and I see running
numbers corresponding to current indices.
What should be done to reproduce your issue, and how to know that the flaw
was found?

On Mon, Jun 29, 2015 at 8:40 PM, Jason H jh...@gmx.com wrote:

 Wouldn't you know it? In constructing the minimal example, the bug was
 found.

 It seems that the currentIndex was being initialized. For the monthModel,
 it existed. For the dynamically created model it didn't. It seems a bug
 though to never be able to  update the currentIndex though. We even tried
 to set currentItem after creating the model and it did not work. The intent
 was to initialize the list to June, in the vertical middle .

 You'll see the commented line in StyledPicker.qml.

 Sample attached.

  *Sent:* Monday, June 29, 2015 at 1:16 PM
 *From:* Dmitry Volosnykh dmitry.volosn...@gmail.com
 *To:* Jason H jh...@gmx.com
 *Cc:* interest@qt-project.org interest@qt-project.org
 *Subject:* Re: [Interest] QML ListView/Model currentIndexChanges not
 firing for synamic models
  Could you provide complete example?

 On Mon, Jun 29, 2015 at 8:10 PM, Jason H jh...@gmx.com wrote:

 We have two scrolling pickers which are based on ListView. They are the
 same QML Component. When one is assigned a static model
 (ListModel/ListElement) it works. When it is created programmatically, it
 does not.

 What is going wrong? We've looked into dynamicRoles and tried using sync()

 Thanks in advance,

 ListModel {
 id: dayModel
 component.onCompleted {
  for (var i=1; i 32; i++)
   append( { value: i.toString() } )
 }
 }

 ListModel {
   id: monthModel
   ListElement {...}
   ...
 }

 Meanwhile in ListView...
 ListView {
 model: dayModel
 onCurrentIndexChanged: console.log(index) // never works
 }

 ListView {
 model: monthModel
 onCurrentIndexChanged: console.log(index) // works
 }


 ___
 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 Inspector?

2015-06-25 Thread Dmitry Volosnykh
There is also QSG_VISUALIZE={batches,clip,overdraw}
More on that here:
http://doc.qt.io/qt-5/qtquick-visualcanvas-scenegraph-renderer.html

On Thu, Jun 25, 2015 at 10:58 PM, Jason H jh...@gmx.com wrote:

 This.is.awesome!

 Thanks Giuseppe!

  Sent: Thursday, June 25, 2015 at 3:36 PM
  From: Giuseppe D'Angelo giuseppe.dang...@kdab.com
  To: interest@qt-project.org
  Subject: Re: [Interest] QML Inspector?
 
  Il 25/06/2015 21:30, Jason H ha scritto:
   Is there anything that allows us to see a tree view of items at
 runtime and inspect (and modify?) their properties?
  
   I just helped someone who was dealing with an opacity issue and it was
 because of a component a few levels up. If they could visualize the element
 hierarchy as a tree, it would have been solved in seconds.
 
  You're looking for GammaRay:
 
   https://github.com/KDAB/GammaRay/
 
  See for instance this blog post:
 
   http://www.kdab.com/analysing-qtquick-apps-gammaray-button-gone/
 
  Hope this helps,
  --
  Giuseppe D'Angelo | giuseppe.dang...@kdab.com | 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


[Interest] QML engine. Is CppOwnership allowed for singletons?

2015-06-17 Thread Dmitry Volosnykh
Documentation states that A QObject singleton type instance returned from
a singleton type provider is owned by the QML engine. For this reason, the
singleton type provider function should not be implemented as a singleton
factory.

I need to use that same singleton object on the C++ side beside its usage
from QML UI.
Can I override this by setting ownership to CppOwnership via
setObjectOwnership()?

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


Re: [Interest] Memory leak

2015-06-12 Thread Dmitry Volosnykh
In your case the 'temp' object will be deleted upon quitting function
foo(), so the signalTriggered() is never emitted. In previous version, it
would have been living longer because of memory leak you mentioned.

On Fri, Jun 12, 2015 at 4:52 PM, Berkay Elbir berkayel...@gmail.com wrote:


 Hello all;

 We recently joined a new project, which is full with idiom like: ,

 void foo(){
 Widget* temp = new Widget;
 connect(temp, Widget::signalTriggerred,[this, temp ]()
 {
  do cool staff...
 }}

 As you can see no delete nothing, I am afraid even user class Widget is
 inherited QObject, this is still a leak. Does QT do something fancy to
 prevent leek in case above?

 What I am planning to do:

 void foo {
  std::shared_ptrWidget  temp( new Widget () );
  connect(temp.get(), Widget::signalTriggerred,[this, temp] ()
  {
   do even cooler things...
  }}

 Is there a problem with my apporach? (For example I didn't want to use
 .get() but compiler errors forced me to use it).

 Thanks in advance,

 BE




 ___
 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] Any good (e)books yet on QML?

2015-06-04 Thread Dmitry Volosnykh
http://qmlbook.github.io/

On Thu, Jun 4, 2015 at 8:48 PM, Bob Hood bho...@comcast.net wrote:

 I've been checking occasionally, and I've yet to see anything being
 published
 on learning QML.  Does anybody know of one, or if one is in the works?
 ___
 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] SingletonType functions not visible in QML

2015-05-22 Thread Dmitry Volosnykh
Also try naming your functions with first letter lowercased.

On Fri, May 22, 2015 at 5:06 PM, Ben Lau xben...@gmail.com wrote:



 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


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


Re: [Interest] SingletonType functions not visible in QML

2015-05-22 Thread Dmitry Volosnykh
Samuel, what you ask is explained here:
http://doc.qt.io/qt-5/qqmlengine.html#qmlRegisterSingletonType-2

citation:

NOTE: A QObject singleton type instance returned from a singleton type
provider is owned by the QML engine. For this reason, the singleton type
provider function should not be implemented as a singleton factory.

On Fri, May 22, 2015 at 5:27 PM, Samuel Stirtzel s.stirt...@googlemail.com
wrote:

 2015-05-22 15:56 GMT+02:00 mark diener rpzrpz...@gmail.com:

  static QObject *singprovider(QQmlEngine *gengine, QJSEngine
 *gscriptEngine)
  {
  Q_UNUSED(gengine)
  Q_UNUSED(gscriptEngine)
  Sing* gsing = new Sing();
  return gsing;
  }

 Is the return value of the function cached in qt internally?
 Or will this just create a new singleton with every call?

 how about this:

 static Sing* gsing = new Sing();


 --
 Regards
 Samuel
 ___
 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] SingletonType functions not visible in QML

2015-05-22 Thread Dmitry Volosnykh
Example is fine.

On Fri, May 22, 2015 at 6:00 PM, rpzrpz...@gmail.com rpzrpz...@gmail.com
wrote:

 Hello:

 So do we need a static Sing* in the singleton provider or is the example
 in the documentation correct?

 I would guess the provider is called ONCE by the QML engine and not
 multiple times, but I am usually mistaken.

 But I guess the static allocation will remove all doubt?

 Ben Lau - Thank you
 Dmitry Volosnykh - Thank you

 Mark


 On 5/22/2015 8:35 AM, Samuel Stirtzel wrote:
  2015-05-22 16:30 GMT+02:00 Dmitry Volosnykh dmitry.volosn...@gmail.com
 :
  Samuel, what you ask is explained here:
  http://doc.qt.io/qt-5/qqmlengine.html#qmlRegisterSingletonType-2
 
  citation:
 
  NOTE: A QObject singleton type instance returned from a singleton type
  provider is owned by the QML engine. For this reason, the singleton type
  provider function should not be implemented as a singleton factory.
 
 
  Ah ok thanks, at the first glance this code looked quite malicious,
  but reading the documentation sure helps ;)
 
  On Fri, May 22, 2015 at 5:27 PM, Samuel Stirtzel 
 s.stirt...@googlemail.com
  wrote:
 
  2015-05-22 15:56 GMT+02:00 mark diener rpzrpz...@gmail.com:
 
  static QObject *singprovider(QQmlEngine *gengine, QJSEngine
  *gscriptEngine)
  {
   Q_UNUSED(gengine)
   Q_UNUSED(gscriptEngine)
   Sing* gsing = new Sing();
   return gsing;
  }
 
  Is the return value of the function cached in qt internally?
  Or will this just create a new singleton with every call?
 
  how about this:
 
  static Sing* gsing = new Sing();
 
 
 

 --
 No spell checkers were harmed during the creation of this message.
 ___
 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] qsort() Obsolete?

2015-04-17 Thread Dmitry Volosnykh
As far as I know, a plenty of methods from QtAlgorithms are marked as
obsolete since Qt 5.2. Regarding qSort() you may refer to official
documentation: http://doc.qt.io/qt-5/qtalgorithms-obsolete.html#qSort.

Also, you may read more about this here:
http://lists.qt-project.org/pipermail/development/2013-September/013122.html

On Fri, Apr 17, 2015 at 1:12 PM, Berkay Elbir berkayel...@gmail.com wrote:

 Hello All,

 I want to ask a question to you to be certain. Is void qsort() function
 obsolete? Should we use std::sort instead of this function? Because I have
 a priority list and need to sort it.

 Best Regards,

 Berkay

 ___
 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] How to force Transition's animations to complete?

2015-04-09 Thread Dmitry Volosnykh
There is Animation.complete() method which is intended to get final
property values. What is a proper way to do the same with Transition? I've
tried to loop through Transition.animations list property and to reference
its single animation directly by id, then called complete() method. But did
not succeed, so far.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Expected Release Date - Qt 5.4.1

2015-02-17 Thread Dmitry Volosnykh
You may see it here: http://qt-project.org/wiki/Qt-5.4-release

On Tue, Feb 17, 2015 at 4:17 PM, Stefan Walter stefan.wal...@lisec.com
wrote:

  Hi,

 I would like to upgrade to Qt 5.4, but I am thinking to wait as it seems
 that 5.4.1 is around the corner.

 Can someone give me an expected release date for 5.4.1?

 Thanks  Regards,
 Stefan

  __
 The content of this e-mail is confidential and restricted for the use of
 the intended recipient only. If you are not the intended recipient please
 inform the sender immediately and delete this e-mail and any attachments.
 We cannot accept liability for any damage incurred as a result of software
 viruses and advise that you carry out your own virus checks before opening
 any attachment.
 Der Inhalt dieses E-Mails ist vertraulich und für die alleinige Verwendung
 durch den beabsichtigten Empfänger bestimmt. Falls Sie nicht der
 beabsichtigte Empfänger sind, bitten wir Sie den Absender umgehend zu
 informieren und dieses E-Mail samt angeschlossenen Dateien zu löschen. Wir
 können keine Haftung für allfällige Schäden übernehmen, die aufgrund von
 Software-Viren entstehen, und empfehlen Ihnen, selbst Virenprüfungen
 durchzuführen, bevor Sie eine Anlage öffnen.


 ___
 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] Building the latest Qt 5.X

2015-01-22 Thread Dmitry Volosnykh
Scott,

here is an article on how to build Qt 5:
http://qt-project.org/wiki/Building_Qt_5_from_Git
PS. It is strange that you have not found it by yourself since it is the
first result given by Google on query 'build qt5 from git'.

Regards,
Dmitry.

On Fri, Jan 23, 2015 at 7:15 AM, Scott Aron Bloom scott.bl...@onshorecs.com
 wrote:



 -Original Message-
 From: interest-bounces+scott.bloom=onshorecs@qt-project.org [mailto:
 interest-bounces+scott.bloom=onshorecs@qt-project.org] On Behalf Of
 Thiago Macieira
 Sent: Thursday, January 22, 2015 7:57 PM
 To: interest@qt-project.org
 Subject: Re: [Interest] Building the latest Qt 5.X

 On Friday 23 January 2015 01:14:56 Scott Aron Bloom wrote:
   I have always built on linux, by simply running configure, then
   make, then make install.
 
  Any problems with this?
  
  Yea, it doesn't include the necessary packages, such as Webkit

 Why not? Sure it does.

  Understood.. Any recommendations on how to move to the latest GCC and
  ship all the runtime libraries for a closed source LGPL compatible
 application?

 The compiler is binary compatible. You don't have to do anything.

  And what about windows, 32 and 64 bit?

 Just use the MinGW that comes with Qt for the 32-bit build. I'm not sure
 what the state of mingw64 is -- some have had luck, some others haven't. VS
 2012, 2013, and 2015 for 64-bit have been working fine.
 =

 Fortgot to ask..

 What version of OpenSSL does Qt build against on windows?
 ___
 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] Building the latest Qt 5.X

2015-01-22 Thread Dmitry Volosnykh
Well, I think you then can omit sections on how to get sources, and how to
update, etc. Other information still would be useful: dependencies, steps
needed to build, known issues, etc.

On Fri, Jan 23, 2015 at 8:23 AM, Scott Aron Bloom scott.bl...@onshorecs.com
 wrote:

  I don’t want to build from git J



 Since we deploy this on multiple developers boxes, we tent to automate the
 build process, so a prepacked download file (tgz/zip) works best



 Scott



 *From:* Dmitry Volosnykh [mailto:dmitry.volosn...@gmail.com]
 *Sent:* Thursday, January 22, 2015 9:21 PM
 *To:* Scott Aron Bloom
 *Cc:* Thiago Macieira; interest@qt-project.org

 *Subject:* Re: [Interest] Building the latest Qt 5.X



 Scott,



 here is an article on how to build Qt 5:
 http://qt-project.org/wiki/Building_Qt_5_from_Git

 PS. It is strange that you have not found it by yourself since it is the
 first result given by Google on query 'build qt5 from git'.



 Regards,

 Dmitry.



 On Fri, Jan 23, 2015 at 7:15 AM, Scott Aron Bloom 
 scott.bl...@onshorecs.com wrote:



 -Original Message-
 From: interest-bounces+scott.bloom=onshorecs@qt-project.org [mailto:
 interest-bounces+scott.bloom=onshorecs@qt-project.org] On Behalf Of
 Thiago Macieira
 Sent: Thursday, January 22, 2015 7:57 PM
 To: interest@qt-project.org
 Subject: Re: [Interest] Building the latest Qt 5.X

 On Friday 23 January 2015 01:14:56 Scott Aron Bloom wrote:
   I have always built on linux, by simply running configure, then
   make, then make install.
 
  Any problems with this?
  
  Yea, it doesn't include the necessary packages, such as Webkit

 Why not? Sure it does.

  Understood.. Any recommendations on how to move to the latest GCC and
  ship all the runtime libraries for a closed source LGPL compatible
 application?

 The compiler is binary compatible. You don't have to do anything.

  And what about windows, 32 and 64 bit?

 Just use the MinGW that comes with Qt for the 32-bit build. I'm not sure
 what the state of mingw64 is -- some have had luck, some others haven't. VS
 2012, 2013, and 2015 for 64-bit have been working fine.
 =

 Fortgot to ask..

 What version of OpenSSL does Qt build against on windows?

 ___
 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] Column's subitem doesn't show up again once being hidden

2015-01-20 Thread Dmitry Volosnykh
Hello,

I have a movie description which provides a number of text properties like
actors, producer, etc. plus a poster. In a short description of movie I'd
like to show only that number of properties (with text limited to a small
number of lines) which fit in the vertical area with the height as of the
poster's one. When one wants to see the full details all the properties
with no limitation are shown.

Here's how I try to do it (green rectangle is used as a replacement for the
poster):

import QtQuick 2.2

Row {
width: 600
height: 400
focus: true

property bool concise: true

Column {
width: 300

Repeater {
model: 3

Text {
id: text1
objectName: text1
width: parent.width
visible: !poster.excludes(text1)
text: Lorem ipsum dolor sit amet, consectetur adipiscing
elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
maximumLineCount: concise ? 2 : undefined
wrapMode: Text.Wrap
elide: Text.ElideRight

Rectangle {
anchors.fill: parent
z: parent.z - 1
color: Qt.rgba(1 - index * 0.3, 0, index * 0.3)
}
}
}
}

Rectangle {
id: poster
width: 400
height: 75
color: green

function excludes(item) {
var outside = item.y + item.height  height
return (concise  outside)
}

}

Keys.onSpacePressed: concise = !concise
}

At initial load two of three text items are shown (which is correct) with
two lines each. Once I press space bar all three items are displayed
entirely. Now, when I press space bar again to get the initial
representation, I get only one item visible instead of two.

As far as I can understande, the second item get its 'visible' property
evaluated prior to change of its y position (which is expected to occur
once the first item shrinks along its height). This makes item invisible
since, while being fully displayed, it does not fit into the vertical area
associated with poster's height. And due to its invisibility its position
is not maintained/updated. Kind of dependency loop here... How to avoid it?

How can I make the second item appear again?

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


[Interest] Text elide with custom layout

2015-01-19 Thread Dmitry Volosnykh
Hello, everyone!

What I am trying to achieve is making a some kind of details widget which
contains an image located at the top right corner and remaining area is
used to display a list of properties, i.e. grid with left column containing
name of the property and the right one contains its value. Since the number
of properties may be very large there are two modes for details widget,
say, 'concise' and 'more'. 'Concise' mode allows each property to have only
one line of text, and the 'more' mode allows a bigger number of lines. In
any case, it is possible that the text does not fit in the number of lines
provided. So, elide mode is always on.

With text's width set in a straightforward manner eliding works okay for
one line and for several lines per text element. However, when I try to
implement custom layout via lineLaidOut handler (I need this to wrap image
nicely to take an advantage of the space below it), ellipsis appears only
when the last word fits only partially. But I need it every time the full
string does not fit in the number of lines provided.

Here is an example. Press space to toggle 'concise' and 'more' modes. The
difference in behavior I am talking about may be seen comparing rendering
results with customLayout property being set to 'false' and 'true'
accordingly.

import QtQuick 2.2

ListView {
readonly property bool customLayout: false

property bool concise: true
focus: true

model: ListModel {
ListElement {
text: one two three four five six seven eight night ten eleven
twelve
}
ListElement {
text: one two three four five six seven eight night ten eleven
twelve
}
ListElement {
text: one two three four five six seven eight night ten eleven
twelve
}
ListElement {
text: one two three four five six seven eight night ten eleven
twelve
}
ListElement {
text: one two three four five six seven eight night ten eleven
twelve
}
}

delegate: Text {
text: model.text
width: customLayout ? parent.width : (index + 1) * 30
wrapMode: Text.Wrap
maximumLineCount: concise ? 1 : 3
elide: Text.ElideRight
onLineLaidOut:
if (customLayout) {
line.width = (index + 1) * 30
console.log(index:, index, width:, line.width)
}

Rectangle {
anchors.fill: parent
z: -1
color: Qt.rgba((index + 1) * 0.1, 0, 0, 0.5)
}
}

Keys.onSpacePressed: concise = !concise
}

The question is whether this is right behavior and, thus, I've missed
something, or is this a bug?
What I expected is that the results will be identical in respect of
ellipsis being present or not.

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


Re: [Interest] XYZ is instantiated recursively

2015-01-15 Thread Dmitry Volosnykh
Following your first snippet, I think that it is in general impossible to
refer component inside its definition since QML engine will not know what
it looks like at the moment.

On Thu, Jan 15, 2015 at 1:06 PM, Nuno Santos nunosan...@imaginando.pt
wrote:

 Dimitry,

 You are right. Let’s start by the model.

 My model is made of devices which can have list of devices (recursive
 model).

 I want to list A’s so I do something like:

 ListView {
 model: model.devices
 delegate: Device {
 parameters: modelData.parameters
 devices: modelData.devices
 }

 // Device.qml

 Rectangle {
 id: root

 property alias parameters: parameters.model
 property alias devices: devices.model

 ListView {
 id: parameters
 }

 Device {
 id: devices

 }
 }

 Qml output: Device is istantiated recursively

 Regards,

 Nuno

 On 15 Jan 2015, at 10:00, Dmitry Volosnykh dmitry.volosn...@gmail.com
 wrote:

 Nuno, it is sometimes hard to get an idea of what exactly you are trying
 to do without any minimal sample code provided.

 On Thu, Jan 15, 2015 at 12:57 PM, Nuno Santos nunosan...@imaginando.pt
 wrote:

 Hi,

 I’m building a QML UI interface for a model that can have a recursive
 behaviour

 I’m trying to instantiate a custom module inside a custom module and it
 is saying XYZ is instantiated recursively.

 Why does this error doesn’t occur when you instantiate a Rectangle inside
 a Rectangle? Isn’t that the same?

 If I really want the same module to appear to model that by it’s own is
 recursive, what should I do? I cannot have a different Qml file for each
 recursive depth as I don’t know what will be the total depth of it. And it
 simply doesn’t make sense…

 Any ideas?

 Thanks,

 Nuno Santos
 ___
 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] XYZ is instantiated recursively

2015-01-15 Thread Dmitry Volosnykh
Nuno, sorry, but it is hard to follow your last code snippet since it is
overloaded with noise lines.

Anyway, did you try to achieve your goal using Item's children property?
This is how Rectangles and other items get nested.

PS. Am I right that you're trying to implement a tree structure? If so,
searching by phrase qml tree view provided me with following
articles/discussions:
http://www.codeproject.com/Articles/632795/QML-TreeModel-and-TreeView
http://qt-project.org/forums/viewthread/30521
Disclaimer: did not try any of the above myself.

On Thu, Jan 15, 2015 at 3:31 PM, Nuno Santos nunosan...@imaginando.pt
wrote:

 Dmitry,

 I was able to do recursive instantiation using the following technic
 (actual code).

 However, i’m having problems when the model is updated. With a single
 level everything is ok. If there is recursion, when the model is deleted,
 it crashes. Don’t know why.

 Flow {
 id: flow
 anchors.top: parent.top
 anchors.left: parent.left
 anchors.right: parent.right
 spacing: 5

 Repeater {
 id: repeater
 delegate: Component {
 id: cc

 Item {
 width: flow.width
 height: 200

 Rectangle {
 id: label
 width: 40
 anchors.left: parent.left
 height: 200
 color: #33
 border.color: black
 border.width: 1
 radius: 2

 Text {
 id: labelText
 color: white
 text: modelData.name
 font.family: mainFont.name
 font.pixelSize: 12
 font.capitalization: Font.AllUppercase
 rotation: -90
 anchors.top: parent.bottom
 width: label.height-icon.height-35
 anchors.topMargin: -15
 anchors.left: parent.left
 anchors.leftMargin: 10
 transformOrigin: Item.TopLeft
 elide: Text.ElideRight
 }
 }

 Flickable {
 anchors.left: label.right
 anchors.leftMargin: 10
 anchors.right: parent.right
 height: 200
 contentWidth: label.width+row.childrenRect.width
 clip: true

 Row {
 id: row
 height: 180

 Repeater {
 id: parametersList
 model: modelData.parameters
 delegate: ModuleLaunchpadDeviceParameter {
 height: 200
 parameter: modelData
 }
 }

 ListView {
 id: chainsList
 model: modelData.chains
 width: 100
 height: 200
 spacing: 5
 delegate: Rectangle {
 width: 100
 height: 40
 color: green
 MouseArea {
 anchors.fill: parent
 onClicked:
 chainsList.currentIndex=index
 }
 }
 }

 Repeater {
 id: chainsDevicesList
 model:
 chainsList.count0?chainsList.model[chainsList.currentIndex].devices:0
 delegate: cc
 }
 }
 }
 }
 }
 }
 }

 Thanks,

 Regards,

 Nuno

 On 15 Jan 2015, at 10:06, Nuno Santos nunosan...@imaginando.pt wrote:

 Dimitry,

 You are right. Let’s start by the model.

 My model is made of devices which can have list of devices (recursive
 model).

 I want to list A’s so I do something like:

 ListView {
 model: model.devices
 delegate: Device {
 parameters: modelData.parameters
 devices: modelData.devices
 }

 // Device.qml

 Rectangle {
 id: root

 property alias parameters: parameters.model
 property alias devices: devices.model

 ListView {
 id: parameters
 }

 Device {
 id: devices

 }
 }

 Qml output: Device is istantiated recursively

 Regards,

 Nuno

 On 15 Jan 2015, at 10:00, Dmitry Volosnykh dmitry.volosn...@gmail.com
 wrote:

 Nuno, it is sometimes hard to get an idea of what exactly you are trying
 to do without any minimal sample code provided.

 On Thu, Jan 15, 2015 at 12:57

Re: [Interest] QML animation flickering on Ubuntu

2015-01-13 Thread Dmitry Volosnykh
Keith, thank you for your suggestion.

At least I've missed this feature in several places: The value of the QML
property will be updated after the animation has finished. The property is
not updated while the animation is running.

Alas, it did not solve my issue. Honestly speaking, I did not believe it
may help, because with animations I had the following rendering table
(obtained after parsing qmlscene's output with QSG_RENDER_TIMING=1 set):

$ grep 'rendered' ubuntu12.02_5.4.log | egrep -o '[0-9]+ms' | sort -n |
uniq -c
 7 0ms
 2 1ms
 1 4ms
 1 5ms
 2 7ms
 1 8ms
 1 9ms
 3 10ms
 2 11ms
 3 12ms
 7 13ms
 15 14ms
 131 15ms
 791 16ms
 218 17ms
 43 18ms
 12 19ms
 4 20ms
 4 21ms
 1 23ms
 1 24ms
 1 27ms
 1 29ms
 4 33ms
 2 38ms
 1 45ms

So, most of the frames are rendered within 16 ms time frame provided.

I am getting more inclined to the idea that it is not Qt-related issue.
Something with my system, drivers, etc.

On Tue, Jan 13, 2015 at 8:21 PM, Keith Gardner kreios4...@gmail.com wrote:

 Can something further be done to avoid flickering?

 If you are just translating the item by changing the X value, try using
 the XAnimator (http://doc.qt.io/qt-5/qml-qtquick-xanimator.html).  It
 performs the movement on the render thread instead of the gui thread.  I
 have experienced big performance gains when using the animators over the
 animations.

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


Re: [Interest] QML animation flickering on Ubuntu

2015-01-13 Thread Dmitry Volosnykh
Well, I've searched for this variable, and for tearing issues on Ubuntu
with NVidia adapters. There are multiple reports and many solutions
provided. At least I know the direction for further investigations. Thank
you, Sean.

On Tue, Jan 13, 2015 at 10:21 PM, Sean Harmer sean.har...@kdab.com wrote:

 On Tuesday 13 January 2015 23:06:40 Dmitry Volosnykh wrote:
  Sean, thanks for your input.
 
  I have NVidia GeForce 9800M GTX, and VSync is enabled. Double-checked
 that.
  Another enabled options: Allow Flipping and Use Conformant Texture
  Clamping. Do not know what are they for...
 
  Regarding your question about monitor's refresh rate. Here is xrandr's
  output:
  $ xrandr
  Screen 0: minimum 8 x 8, current 1680 x 1050, maximum 8192 x 8192
  DVI-D-0 disconnected (normal left inverted right x axis y axis)
  LVDS-0 connected 1680x1050+0+0 (normal left inverted right x axis y axis)
  331mm x 207mm
 1680x1050  59.9*+
  DVI-D-1 disconnected (normal left inverted right x axis y axis)
  HDMI-0 disconnected (normal left inverted right x axis y axis)
 
  I guess, it means runs on 60Hz refresh rate.

 Hmm OK if that didn't work, can you try this trick. Try setting

 export __GL_YIELD=USLEEP

 for your X environment. I have this set in /etc/profile.d/tearing.sh on
 Gentoo.
 Not sure where the correct place is on Ubuntu. If this is set when X starts
 this solves the tearing for me on nVidia when using a compositing window
 manager.

 Cheers,

 Sean

 
  On Tue, Jan 13, 2015 at 9:35 PM, Sean Harmer sean.har...@kdab.com
 wrote:
   On Tuesday 13 January 2015 17:02:40 Dmitry Volosnykh wrote:
I've tried to capture the issue: see http://youtu.be/KUNyk2YWBaY
The flickering is more obvious in this video since capturing software
affecting performance. When running application with no video
 recording
there's no visual artifacts for about 15 seconds. Then the top of the
  
   green
  
bar visually looks like be shifted leftwards by a small offset which
  
   holds
  
on form the moment of its appearance. The height of this 'cap' may
  
   slightly
  
increase over time. This issue reproduces constantly.
  
   Sounds like a lack of v-sync is causing tearing and over time the
 offset
   between the swapbuffers and screen refresh is changing. Is your monitor
   running
   at a standard refresh rate?
  
   Try forcing vsync in the control panel for your graphics card driver.
 At
   least
   nVidia provide an option for this. I'm not sure about AMD and Intel.
  
   Cheers,
  
   Sean
   --
   Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK
   Klarälvdalens Datakonsult AB, a KDAB Group company
   Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
   KDAB - Qt Experts - Platform-independent software solutions
   ___
   Interest mailing list
   Interest@qt-project.org
   http://lists.qt-project.org/mailman/listinfo/interest

 --
 Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK
 Klarälvdalens Datakonsult AB, a KDAB Group company
 Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
 KDAB - Qt Experts - Platform-independent software solutions

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


Re: [Interest] QML animation flickering on Ubuntu

2015-01-13 Thread Dmitry Volosnykh
Sean, thanks for your input.

I have NVidia GeForce 9800M GTX, and VSync is enabled. Double-checked that.
Another enabled options: Allow Flipping and Use Conformant Texture
Clamping. Do not know what are they for...

Regarding your question about monitor's refresh rate. Here is xrandr's
output:
$ xrandr
Screen 0: minimum 8 x 8, current 1680 x 1050, maximum 8192 x 8192
DVI-D-0 disconnected (normal left inverted right x axis y axis)
LVDS-0 connected 1680x1050+0+0 (normal left inverted right x axis y axis)
331mm x 207mm
   1680x1050  59.9*+
DVI-D-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)

I guess, it means runs on 60Hz refresh rate.


On Tue, Jan 13, 2015 at 9:35 PM, Sean Harmer sean.har...@kdab.com wrote:

 On Tuesday 13 January 2015 17:02:40 Dmitry Volosnykh wrote:
  I've tried to capture the issue: see http://youtu.be/KUNyk2YWBaY
  The flickering is more obvious in this video since capturing software
  affecting performance. When running application with no video recording
  there's no visual artifacts for about 15 seconds. Then the top of the
 green
  bar visually looks like be shifted leftwards by a small offset which
 holds
  on form the moment of its appearance. The height of this 'cap' may
 slightly
  increase over time. This issue reproduces constantly.

 Sounds like a lack of v-sync is causing tearing and over time the offset
 between the swapbuffers and screen refresh is changing. Is your monitor
 running
 at a standard refresh rate?

 Try forcing vsync in the control panel for your graphics card driver. At
 least
 nVidia provide an option for this. I'm not sure about AMD and Intel.

 Cheers,

 Sean
 --
 Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK
 Klarälvdalens Datakonsult AB, a KDAB Group company
 Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
 KDAB - Qt Experts - Platform-independent software solutions
 ___
 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] QML animation flickering on Ubuntu

2015-01-13 Thread Dmitry Volosnykh
I've tried to capture the issue: see http://youtu.be/KUNyk2YWBaY
The flickering is more obvious in this video since capturing software
affecting performance. When running application with no video recording
there's no visual artifacts for about 15 seconds. Then the top of the green
bar visually looks like be shifted leftwards by a small offset which holds
on form the moment of its appearance. The height of this 'cap' may slightly
increase over time. This issue reproduces constantly.

Previously, I was facing an issue with totally jerky animations which was
solved by updating video drivers to the most recent version.

I do not experience such problems on Mac OS X 10.10. However, there is some
flickering on Windows 7, but less noticeable.

Can something further be done to avoid flickering?

PS. Here is the example application I run. You have to press spacebar to
launch animation.

import QtQuick 2.0

Rectangle {
id: root
width: 800
height: 600
color: black
focus: true

Rectangle {
id: rect
width: 150
height: parent.height
color: seagreen
visible: animation.running

NumberAnimation on x {
id: animation
from: -rect.width
to: root.width
loops: Animation.Infinite
duration: 4000
running: false
}
}

Keys.onSpacePressed: animation.running = true
}

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


Re: [Interest] QML: onLoaded signal for QQuickWindow or QQmlApplicationEngine

2015-01-12 Thread Dmitry Volosnykh
Then you may try to expose some C++ class which has some slot (See
Integrating QML and C++
http://doc.qt.io/qt-5/qtqml-cppintegration-topic.html). This slot can be
called from Component.onCompleted.

On Mon, Jan 12, 2015 at 9:32 AM, Dmitry Volosnykh 
dmitry.volosn...@gmail.com wrote:

 Try to do that inside Component.onCompleted handler. Note that, however,
 if you use images located remotely, then you should wait them to be loaded.
 On Jan 12, 2015 9:17 AM, ruslan rus...@khvmntk.ru wrote:

  Hello all!
 Is there any way to know when QML data was loaded into engine?
 In my QML app I want to make a screenshot after all the source was loaded.

 QQmlApplicationEngine engine;
 engine.loadData(data);
 QQuickWindow *rootObject = qobject_castQQuickWindow 
 *(p_engine.rootObjects().first());

 QImage image = rootObject-grabWindow();
 image.save(window.png,PNG,90);



 where data is simple QML file:


 import QtQuick 2.3
 import QtQuick.Window 2.2

 Window {
 visible: true
 width: 360
 height: 360

 Text {
 anchors.centerIn: parent
 text: Hello, world!
 }
 MouseArea {
  anchors.fill: parent
  //onClicked: someSingleton.makeScreenshot();
 }

 }

 But image not saved just because it is empty. If I call
 QQuickWindow::grabWindow() from QML, for example, after clicking at
 MouseArea it works well. So from this I conclude that when I call
 rootObject-grabWindow() it still not loaded completly yet. I've tried to
 call this function in this way:
 connect(rootObject,QQuickWindow::afterRendering,[=] () { QImage image =
 rootObject-grabWindow(); image.save(window.png,PNG,90); }); But the
 program just hungs up in this slot and no image was saved.






 Try to do that inside Component.onCompleted handler. Note that, however,
 if you use images located remotely, then you should wait them to be loaded.

 On Jan 12, 2015 9:17 AM, ruslan rus...@khvmntk.ru wrote:
 
  Hello all!
  Is there any way to know when QML data was loaded into engine?
  In my QML app I want to make a screenshot after all the source was
 loaded.
 
  QQmlApplicationEngine engine;
 
  engine.loadData(data);
 
  QQuickWindow *rootObject = qobject_castQQuickWindow
 *(p_engine.rootObjects().first());
 
  QImage image = rootObject-grabWindow();
 
  image.save(window.png,PNG,90);
 
 
 
 
 
  where data is simple QML file:
 
 
 
  import QtQuick 2.3
 
  import QtQuick.Window 2.2
 
  Window {
 
  visible: true
 
  width: 360
 
  height: 360
 
  Text {
 
  anchors.centerIn: parent
 
  text: Hello, world!
 
  }
 
  MouseArea {
 
   anchors.fill: parent
 
   //onClicked: someSingleton.makeScreenshot();
 
  }
 
  }
 
  But image not saved just because it is empty. If I call
 QQuickWindow::grabWindow() from QML, for example, after clicking at
 MouseArea it works well.
 
 
 
  So from this I conclude that when I call rootObject-grabWindow() it
 still not loaded completly yet. I've tried to call this function in this
 way:
 
 
 
  connect(rootObject,QQuickWindow::afterRendering,[=] () {
 
QImage image = rootObject-grabWindow();
 
  image.save(window.png,PNG,90);
 
  });
 
 
 
  But the program just hungs up in this slot and no image was saved.
 
 
 
 
 


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


Re: [Interest] QML ScrollView, programmatic scroll?

2015-01-12 Thread Dmitry Volosnykh
Did you try flickable.contentY = 0?

On Mon, Jan 12, 2015 at 5:06 PM, Harri Pasanen ha...@mpaja.com wrote:

 Hi,

 Is the a way to set the ScrollView scroll amount?
 Actually, for me going to beginning would suffice at this point.

 I have something like below

  ScrollView {
  id: flickable
  anchors.fill: parent

  Text {
  id: webView
  text: html
  textFormat: Text.RichText
  wrapMode: Text.Wrap
  onLinkActivated: {
  text = new long contents here, would like should be
 visible from the top
  }
  }
  }

 Now when a link is clicked and user has already scrolled down, the
 new contents also appear as if already scrolled.

 Any hints?

 Harri
 ___
 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: onLoaded signal for QQuickWindow or QQmlApplicationEngine

2015-01-11 Thread Dmitry Volosnykh
Try to do that inside Component.onCompleted handler. Note that, however, if you 
use images located remotely, then you should wait them to be loaded.

On Jan 12, 2015 9:17 AM, ruslan rus...@khvmntk.ru wrote:

 Hello all!
 Is there any way to know when QML data was loaded into engine?
 In my QML app I want to make a screenshot after all the source was loaded.

 QQmlApplicationEngine engine;

 engine.loadData(data);

 QQuickWindow *rootObject = qobject_castQQuickWindow 
 *(p_engine.rootObjects().first());

 QImage image = rootObject-grabWindow();

 image.save(window.png,PNG,90); 





 where data is simple QML file:



 import QtQuick 2.3

 import QtQuick.Window 2.2

 Window {

 visible: true

 width: 360

 height: 360

 Text {

 anchors.centerIn: parent

 text: Hello, world!

 }

 MouseArea {

  anchors.fill: parent

  //onClicked: someSingleton.makeScreenshot();

 }

 }

 But image not saved just because it is empty. If I call 
 QQuickWindow::grabWindow() from QML, for example, after clicking at MouseArea 
 it works well.



 So from this I conclude that when I call rootObject-grabWindow() it still 
 not loaded completly yet. I've tried to call this function in this way:



 connect(rootObject,QQuickWindow::afterRendering,[=] () {

   QImage image = rootObject-grabWindow();

 image.save(window.png,PNG,90);

 });



 But the program just hungs up in this slot and no image was saved.  





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


Re: [Interest] Connecting output of an external process to a QML component

2014-12-31 Thread Dmitry Volosnykh
Daniel,

as per recognition of signal on the QML side, try making the first letter
non-capitalized, i.e. call it executionFinished instead of
ExecutionFinished. I guess that should help.

If you don't see qDebug's output inside the readyToRead() slot, then it
should be your first point of attention. So the problem, most probably, is
on the C++ side.

Other stuff seems okay to me.

Regards,
Dmitry.

On Wed, Dec 31, 2014 at 6:45 PM, Daniel França daniel.fra...@gmail.com
wrote:

 Hi guys,
 I'm trying to connect the output of an external process to a QML component.
 The idea would be to have a QProcess instance being called in a singleton
 C++ class, that connects the readyReadStandardOutput to a slot in the C++
 class and this last one emits a signal that I can connect into QML

 I'm instantiating the C++ class via setContextProperty, so it's a
 singleton object.
 Then I start the process, and connect the signal/slot:
 http://pastebin.com/p2CyZwfh

 Here's the first problem... the slot is never being called.
 The slot should be called and then emit another signal (that I could
 connect to QML): http://pastebin.com/Zvj1Y11w

 The other problem is that QML can't recognize this signal:
 http://pastebin.com/QWkkk5mT
 Giving me the error: *Cannot call method 'connect' of undefined*
 and of course, the signal is defined: http://pastebin.com/rxsnQNke

 Googling around all the examples I see are using the QMLRegisterType
 instead, to connect signals/slots, should I move to this way? It's not
 possible to connect with singleton/context objects?

 Of course, if there's an easier way to show the standard output of another
 process to a QML component I would love to know.

 Happy new year
 Best,
 Daniel


 ___
 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 2 performance issue

2014-12-28 Thread Dmitry Volosnykh
I do not experience the same issue on Mac OS X 10.10.

PS. Sorry for bumping this up. Is this question out of scope of mailing
list?

On Fri, Dec 26, 2014 at 2:27 PM, Dmitry Volosnykh 
dmitry.volosn...@gmail.com wrote:

 Here is example application:

 import QtQuick 2.0

 PathView {
 width: 1280
 height: 720
 cacheItemCount: 7
 pathItemCount: 7
 preferredHighlightBegin: 0.5
 preferredHighlightEnd: 0.5
 model: ListModel {
 ListElement {
 color: orange
 text: first
 }
 ListElement {
 color: lightgreen
 text: second
 }
 ListElement {
 color: orchid
 text: third
 }
 ListElement {
 color: tomato
 text: fourth
 }
 ListElement {
 color: skyblue
 text: fifth
 }
 ListElement {
 color: hotpink
 text: sixth
 }
 ListElement {
 color: darkseagreen
 text: seventh
 }
 ListElement {
 color: salmon
 text: eightth
 }
 ListElement {
 color: darkolivegreen
 text: nineth
 }
 ListElement {
 color: navy
 text: tenth
 }
 }
 delegate: Item {
 width: 150
 height: 150

 Rectangle {
 id: rect
 anchors.fill: parent
 color: model.color
 opacity: 0.8
 }

 Text {
 anchors.centerIn: parent
 text: model.text
 color: white
 font.pixelSize: 24
 }
 }
 path: Path {
 startX: -150
 startY: height / 2
 PathLine {
 x: width + 150
 relativeY: 0
 }
 }

 NumberAnimation on offset {
 from: 0
 to: count
 loops: Animation.Infinite
 duration: 4000
 Component.onCompleted: start()
 }
 }

 On Fri, Dec 26, 2014 at 2:19 PM, Dmitry Volosnykh 
 dmitry.volosn...@gmail.com wrote:

 Hi,

 I've composed a simple example with a set of squares constantly looping
 from left to right. Unfortunately, the do not run smoothly. Jiggling at
 start might seem reasonable due to QML engine performing some kind of
 initialization (do not know its internals). However, after a while when
 initialization seems to be done, motion still gets freezed from time to
 time. As a first guess, I could think that it is the garbage collector
 affecting performance, but since UI structure does not change such
 suggestion might be irrelevant.

 I see similar behavior when using qmlscene for Qt versions 5.1.1 and
 5.3.2 (Ubuntu 14.04), and 5.2.1 (embedded Linux).

 Can this be related to QML instantiation performance discussion
 happened in the beginning of December? Maybe this is related
 to QTBUG-43096. But in this case it should not be reproducible on version
 5.1.1.

 Regards,
 Dmitry.



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


Re: [Interest] QML: Use singleton types instead of pragma library scripts

2014-12-26 Thread Dmitry Volosnykh
Dmitry, you can read more on that in this wiki article:
http://qt-project.org/wiki/QmlStyling
Primarily, you are interested in section Nesting QtObjects, but reading
the whole article would be useful too.

In our application, we found it more convenient to do that in slightly
different manner. We instantiate a single instance of that component
(rather than making it be a true singleton) which is placed in the root
.qml file and provided with some id (say, 'appStyle') which is supposed by
our internal convention to be a global name used to refer from any other
QML component. This trick allows us to live code UI components. True
singletons lack this ability since they are not re-created at the time UI
gets reloaded due to changes to .qml files. My collegue has noted that such
implicit referring to an id out of component definition may impact QML
engine performance. Maybe some one can elaborate more on this.

Regards,
Dmitry.

On Fri, Dec 26, 2014 at 1:12 PM, Dmitry Q linuxsquirrel@gmail.com
wrote:

 Hi. In the official QML documentation we see the following suggestion (
 http://doc.qt.io/qt-5/qtquick-performance.html):

 
 Use singleton types instead of pragma library scripts

 If you are using a pragma library script to store application-wide
 instance data, consider using a QObject singleton type instead. This should
 result in better performance, and will result in less JavaScript heap
 memory being used.
 

 What does is mean? How should we use QObject singletons? For example, I
 have the following .pragma library JS to store application-wide constants:

 .pragma library
 var X = 10;
 ... many other declarations...

 How should I rewrite this with QObject singletons?

 ___
 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] QtQuick 2 performance issue

2014-12-26 Thread Dmitry Volosnykh
Hi,

I've composed a simple example with a set of squares constantly looping
from left to right. Unfortunately, the do not run smoothly. Jiggling at
start might seem reasonable due to QML engine performing some kind of
initialization (do not know its internals). However, after a while when
initialization seems to be done, motion still gets freezed from time to
time. As a first guess, I could think that it is the garbage collector
affecting performance, but since UI structure does not change such
suggestion might be irrelevant.

I see similar behavior when using qmlscene for Qt versions 5.1.1 and 5.3.2
(Ubuntu 14.04), and 5.2.1 (embedded Linux).

Can this be related to QML instantiation performance discussion happened
in the beginning of December? Maybe this is related to QTBUG-43096. But in
this case it should not be reproducible on version 5.1.1.

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


Re: [Interest] QtQuick 2 performance issue

2014-12-26 Thread Dmitry Volosnykh
Here is example application:

import QtQuick 2.0

PathView {
width: 1280
height: 720
cacheItemCount: 7
pathItemCount: 7
preferredHighlightBegin: 0.5
preferredHighlightEnd: 0.5
model: ListModel {
ListElement {
color: orange
text: first
}
ListElement {
color: lightgreen
text: second
}
ListElement {
color: orchid
text: third
}
ListElement {
color: tomato
text: fourth
}
ListElement {
color: skyblue
text: fifth
}
ListElement {
color: hotpink
text: sixth
}
ListElement {
color: darkseagreen
text: seventh
}
ListElement {
color: salmon
text: eightth
}
ListElement {
color: darkolivegreen
text: nineth
}
ListElement {
color: navy
text: tenth
}
}
delegate: Item {
width: 150
height: 150

Rectangle {
id: rect
anchors.fill: parent
color: model.color
opacity: 0.8
}

Text {
anchors.centerIn: parent
text: model.text
color: white
font.pixelSize: 24
}
}
path: Path {
startX: -150
startY: height / 2
PathLine {
x: width + 150
relativeY: 0
}
}

NumberAnimation on offset {
from: 0
to: count
loops: Animation.Infinite
duration: 4000
Component.onCompleted: start()
}
}

On Fri, Dec 26, 2014 at 2:19 PM, Dmitry Volosnykh 
dmitry.volosn...@gmail.com wrote:

 Hi,

 I've composed a simple example with a set of squares constantly looping
 from left to right. Unfortunately, the do not run smoothly. Jiggling at
 start might seem reasonable due to QML engine performing some kind of
 initialization (do not know its internals). However, after a while when
 initialization seems to be done, motion still gets freezed from time to
 time. As a first guess, I could think that it is the garbage collector
 affecting performance, but since UI structure does not change such
 suggestion might be irrelevant.

 I see similar behavior when using qmlscene for Qt versions 5.1.1 and 5.3.2
 (Ubuntu 14.04), and 5.2.1 (embedded Linux).

 Can this be related to QML instantiation performance discussion happened
 in the beginning of December? Maybe this is related to QTBUG-43096. But in
 this case it should not be reproducible on version 5.1.1.

 Regards,
 Dmitry.

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


[Interest] Behavior on parent with ParentAnimation

2014-12-24 Thread Dmitry Volosnykh
Documentation mentions only usage with states, transitions and
ParentChange. Is it possible to use ParentAnimation inside Behavior or even
as a standalone animation that is launched manually?

Here's modified example from ParentAnimation's web page:

import QtQuick 2.0

Item {
objectName: root
width: 200; height: 100

Rectangle {
id: redRect
objectName: redRect
width: 100; height: 100
color: red
}


Rectangle {
id: blueRect
objectName: blueRect
x: parent === redRect ? 10 : redRect.width
y: parent === redRect ? 10 : 0
width: 50; height: 50
color: blue

Behavior on parent {
ParentAnimation {
NumberAnimation { properties: x,y; duration: 1000 }
}
}

onParentChanged: console.log(parent:, parent.objectName)

MouseArea { anchors.fill: parent; onClicked: blueRect.parent =
redRect }
}
}

Blue rectangle instantly jumps inside the red one instead of moving
smoothly.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] New connection syntax

2014-12-15 Thread Dmitry Volosnykh
Igor, have you read New Signal Slot Syntax in Qt 5 article (
http://qt-project.org/wiki/New_Signal_Slot_Syntax)? It might shed light on
some of your questions.

On Tue, Dec 16, 2014 at 10:49 AM, Igor Mironchik igor.mironc...@gmail.com
wrote:

 Hi guys,

 Qt has cool new syntax now. But some things doesn't support it yet.

 For example look at QMenu::addAction. There is now overload with
 PointerToMemberFunction.

 And I have two questions:

 Is it planned to add this support,

 and how can I use PointerToMemberFunction in my own widgets?

 I.e. I want to have, for example, next method in my widget:

 Something * addSomething( QObject * receiver, PointerToMemberFunction
 method );

 Where is PointerToMemberFunction declared, what should I include?

 Thank you.

 --
 Best Regards,
 Igor Mironchik.
 ___
 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