Re: [Interest] qt.labs.controls - Material - Fonts

2016-04-13 Thread Curtis Mitch
JP has a WIP patch that would add support for standard font sizes to Qt Quick:

https://codereview.qt-project.org/#/c/150063/


From: Interest  
on behalf of ekke 
Sent: Wednesday, 13 April 2016 19:33
To: interest@qt-project.org
Subject: Re: [Interest] qt.labs.controls - Material - Fonts

Am 13.04.16 um 19:02 schrieb Nikita Krupenko:
> 2016-04-13 0:35 GMT+03:00 ekke :
>> I'm looking HowTo get the right font styles for Material Display,
>> Headline, Title, Subheading, Body
>>
>> Are there any hints about available font.family and preffered sizes to
>> follow
>> https://www.google.com/design/spec/style/typography.html#typography-styles
> Controls from Material theme should have proper fonts in most cases.
> If they hasn't - don't hesitate to file a bug ;)
already did this and JP Nurmi already fixed :)
fonts are looking great

but per ex. Label can be used for body text, subheading etc. so I have
to create my own for this
>
> If you are talking about creating own controls, proper fonts usually
> specified in dedicated page for that control, for example
> https://www.google.com/design/spec/components/lists.html Though,
> sometimes information in spec don't really clear.
so I can use same Font names ?
is there a list what's part of qt.labs Material ?
>> Am I right that Font sizes always should be done in pointSize and not
>> pixelSize for correct High DPI scaling ?
> Quite the contrary. You should specify pixelSize. Also, in design
> guidelines, size in sp, which is pixels.
thx. then I misunderstood it from a session at Qt World Summit

I really like the new controls and am blogging about http://j.mp/qt-x -
just working on some sample apps ...

ekke
___
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 there a mirror for the Qt online documentation?

2016-04-10 Thread Curtis Mitch
I'm using web.archive.org.


From: Interest  
on behalf of Nikos Chantziaras 
Sent: Sunday, 10 April 2016 1:02:25 PM
To: interest@qt-project.org
Subject: [Interest] Is there a mirror for the Qt online documentation?

http://doc.qt.io is down. Are there any mirrors for this? I was not able
to find anything with my google-fu.

___
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] CLion to replace QtCreator?

2016-04-05 Thread Curtis Mitch


> -Original Message-
> From: Interest [mailto:interest-bounces+mitch.curtis=theqtcompany.com@qt-
> project.org] On Behalf Of Burak Arslan
> Sent: Tuesday, 5 April 2016 4:24 PM
> To: interest@qt-project.org
> Subject: Re: [Interest] CLion to replace QtCreator?
> 
> 
> 
> On 04/05/16 13:25, Curtis Mitch wrote:
> >
> >> -Original Message-
> >> From: Interest
> >> [mailto:interest-bounces+mitch.curtis=theqtcompany.com@qt-
> >> project.org] On Behalf Of Julius Bullinger
> >> Sent: Tuesday, 5 April 2016 12:05 PM
> >> To: interest@qt-project.org
> >> Subject: Re: [Interest] CLion to replace QtCreator?
> >>
> >> On Monday, 4. April 2016 18:23, Thiago Macieira wrote:
> >>>>9. Multiple cursors (see the demo on SublimeText's home page -
> >>>> its
> >> epic,
> >>>>and Atom badly implements it),
> >>> Explain. Sounds intriguing.
> >> It's better shown than explained, see e.g.
> >> http://i.stack.imgur.com/TMRK3.gif and
> >> https://packagecontrol.io/readmes/img/d346da37ce3d306f23f960f2a103fbc
> >> 0f456
> >> 2034.gif for examples.
> >>
> >> This is the only feature I'm really missing in Qt Creator, and the
> >> reason I keep Sublime open besides Creator all the time.
> >> There's pretty basic multi-cursor functionality in Creator, but it's
> >> not quite as polished as Sublime's. Really, you need to try yourself
> >> to see how useful it is!
> > Looks interesting, but I find it odd that that is solely enough to
> warrant keeping another editor open, because you can easily do it in
> Creator. For renaming instances of a symbol: Ctrl + Shift + R. For stuff
> like keywords: good old find and replace! :p You can select a bunch of
> text first to limit it to a certain block.
> 
> 
> You know what I learnt from this thread so far? No one reads the QtCreator
> user manual :)
> 
> Or I could be using a QtCreator version from the future or something :)
> 
> So:
> 
> 1) [Ctrl+K] : some_function ([column][space]some_function)
> 
> searches all (imported) symbols.
> 
> 2) My QtCreator knows does the right thing when stumbling upon auto,
> std::unique_ptr etc and I don't even know which code model I'm using. It
> "just worked" for me til today.
> 
> 3) When you use Alt+Shift to block-select you can perform block edit like
> shown in the gifs above.
> 
> In Kate, KWrite and friends it's Ctrl+Shift+B to switch selection mode and
> same principles start to apply there as well.

The GIF seemed to demonstrate some kind of selective editing. I just tried this 
with the block selection in Creator and it just overwrites the text. Can you 
give an example of how you can achieve what's done in the GIF using block 
selection in Creator?

> 4) It's just brain-dead to suggest using a non-Qt ide for Qt. Qt is the
> perfect framework for writing an IDE, irrespective of the language you're
> aiming for :) JetBrains stuff is only performant in the expense of a huge
> memory footprint and relatively longer startup time. This is of course
> fine in the age of multi-gigabyte-memory SSD-backed developer
> workstations, but don't claim that using Java is NOT a trade-off. No
> JetBrains product will work as nicely (or at all) with given only the
> resources that Qt Creator is using.
> 
> 5) Saying "Hey I'm not trying to be hard on [some people] but they suck"
> is not less insulting than a straight-up "You suck". I wouldn't expect the
> community to fall for this. Come on guys, don't feed the troll :)
> 
> Dear Qt Tooling team,
> 
> Please ignore the trolls. You are doing a wonderful job. Enjoy the spring
> in Berlin :)
> 
> Best,
> Burak
> 
> ___
> 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] CLion to replace QtCreator?

2016-04-05 Thread Curtis Mitch


From: NoMercy [mailto:nome...@gmail.com]
Sent: Tuesday, 5 April 2016 3:20 PM
To: Curtis Mitch <mitch.cur...@theqtcompany.com>
Cc: interest@qt-project.org
Subject: Re: [Interest] CLion to replace QtCreator?



On Tue, Apr 5, 2016 at 3:55 PM, Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>> wrote:


From: NoMercy [mailto:nome...@gmail.com<mailto:nome...@gmail.com>]
Sent: Tuesday, 5 April 2016 2:34 PM
To: Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>>
Cc: interest@qt-project.org<mailto:interest@qt-project.org>
Subject: Re: [Interest] CLion to replace QtCreator?


On Tue, Apr 5, 2016 at 1:49 PM, Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>> wrote:
> I’m sorry to say this but QtCreator is actually eons behind the current IDE 
> trends and technology :(

> people are practically begging jetbrains to save themselves from QtCreator 
> (no offense intended but this is the case for many people)

> And I think Qt Company should just get rid of the denial of the world start 
> to see beyond horizon and do something, revolutionize QtCreator or just do 
> something like Google did for android studio and embrace/deal with jetbrains 
> ide and fork a CLion custimized for Qt development. I dont see any other way 
> :(

Hahaaa! I especially like the “I don’t see any other way” part. Fantastic. 
Also, very, very cringe-worthy. Telling a company it’s in denial because it 
doesn’t fork your favourite IDE is... ridiculous. It sounds like you haven’t 
actually attempted to properly use Qt Creator (e.g. by saying that Locator 
“only searches for filenames”), and don’t intend on putting in any work 
yourself, even though it’s an open source project.


Hey look I didn't start to offend anybody about their work, but just get some 
realistic here;

I’m not a Qt Creator developer, but if I were, it would be pretty funny to be 
told I was in denial. What are they in denial about, exactly?

That QtCreator is eons behind current technology and trends, isn't it very 
obvious? I would say just checkout features of ANY JetBrains product but you 
don't even intend to so you are in therefor denial. (Not personally you but 
many people who are objecting these)


No one from The Qt Company had even replied before you told them that they’re 
in denial. The others who have replied are not employees of The Qt Company. 
They were also suggesting ways to achieve the things that you said were 
missing, not saying that there isn’t room for improvement. So, to summarise, 
you’re telling random people on a mailing list that they’re in denial over 
something that they never denied.


1. Have you even try to read people's comments on that link I've shared? (Yes 
they are practically begging JetBrains)

I did read the bug report, yep. So what if they’re begging JetBrains? Rather 
than try to shame developers into converting one product into another, why not 
contribute specific features that you think are missing? Tell your friends 
commenting on that bug report that they can write a plugin for Qt Creator, and 
that it’s all open source.

I'm not trying to shame anyone, I'm simply trying to wake people up from their 
sleep, trying to convince to look around instead of just accept what you 
already have...

Then you need to reconsider the way you communicate, because the replies you’re 
getting are a direct result of talking like you’re owed the world, when, in 
reality, you’ve put in no effort (be it Jira suggestions or patches) nor paid a 
dollar towards what you’re asking. I would be hard pressed to think of a less 
constructive way of generating interest in the things that you want than 
wording an email in the manner you have.


2. Have you ever used ANY JetBrains product before? for how long? then you'll 
see there the huge difference between JOY of coding and JOB of coding.

No, and I have no plans to. I’m not arguing that JetBrains’ product doesn’t 
have good features.

If you accept that JetBrains products have some good features why not implement 
those SOME of good features to our QtCreator?

It seems you’re not getting the point.


3. And yes I don't see any other way IF you want to be part of the solution 
instead of being in denial!

Again, can you tell me what I’m in denial of? If I find something lacking with 
Qt Creator, I file a suggestion or fix it myself if it’s easy enough. That’s 
being part of the solution. Doing what you’re doing in the way you’re doing it 
is textbook “being part of the problem”.

The problem is the lacking things wont come without nothing short of a 
revolution. it would take eons just to write whats lacking in QtCreator (hence 
eons behind others) thats why I suggested a plugin or a fresh start with 
intellij platform. besides it is The Official Qt Company product we are talking 
about, while it is good to have the p

Re: [Interest] CLion to replace QtCreator?

2016-04-05 Thread Curtis Mitch


From: Interest 
[mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org] On 
Behalf Of NoMercy
Sent: Tuesday, 5 April 2016 3:04 PM
To: interest@qt-project.org
Subject: Re: [Interest] CLion to replace QtCreator?

I see the answers usually offering some workarounds, yes you can do that BUT in 
a few more steps or in a less pleasent way. Thats where IU/UX design comes in. 
People don't want extra steps, people don't want to use mouse etc.

So, file bug reports.

I observe that most of you guys objecting are don't even see what others are 
doing or don't even care beyond whats good for your use cases and you get angry 
when I or other people say things like eons behind while you don't even look 
what others doing or what are current trends or dont care for UI/UX of your 
IDE, You don't even now other good IDEs.

New features are constantly being added to Creator, and they’re often from 
suggestions from users who see something in another IDE that is missing in 
Creator. The way to get a feature in is to suggest it (formally, via Jira) or 
write it yourself. The way to not get a feature in is to propose that Creator 
be rewritten and “replaced by CLion”. For the record, I’m not angry, I just 
find the way you’ve approached the whole situation amusing.

So because I don’t know of JetBrains’ IDE, I don’t know of any other good IDEs? 
Ok, if you say so! :)


Regards,
Emre Besirik

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


Re: [Interest] CLion to replace QtCreator?

2016-04-05 Thread Curtis Mitch


From: NoMercy [mailto:nome...@gmail.com]
Sent: Tuesday, 5 April 2016 2:34 PM
To: Curtis Mitch <mitch.cur...@theqtcompany.com>
Cc: interest@qt-project.org
Subject: Re: [Interest] CLion to replace QtCreator?


On Tue, Apr 5, 2016 at 1:49 PM, Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>> wrote:
> I’m sorry to say this but QtCreator is actually eons behind the current IDE 
> trends and technology :(

> people are practically begging jetbrains to save themselves from QtCreator 
> (no offense intended but this is the case for many people)

> And I think Qt Company should just get rid of the denial of the world start 
> to see beyond horizon and do something, revolutionize QtCreator or just do 
> something like Google did for android studio and embrace/deal with jetbrains 
> ide and fork a CLion custimized for Qt development. I dont see any other way 
> :(

Hahaaa! I especially like the “I don’t see any other way” part. Fantastic. 
Also, very, very cringe-worthy. Telling a company it’s in denial because it 
doesn’t fork your favourite IDE is... ridiculous. It sounds like you haven’t 
actually attempted to properly use Qt Creator (e.g. by saying that Locator 
“only searches for filenames”), and don’t intend on putting in any work 
yourself, even though it’s an open source project.


Hey look I didn't start to offend anybody about their work, but just get some 
realistic here;

I’m not a Qt Creator developer, but if I were, it would be pretty funny to be 
told I was in denial. What are they in denial about, exactly?

1. Have you even try to read people's comments on that link I've shared? (Yes 
they are practically begging JetBrains)

I did read the bug report, yep. So what if they’re begging JetBrains? Rather 
than try to shame developers into converting one product into another, why not 
contribute specific features that you think are missing? Tell your friends 
commenting on that bug report that they can write a plugin for Qt Creator, and 
that it’s all open source.

2. Have you ever used ANY JetBrains product before? for how long? then you'll 
see there the huge difference between JOY of coding and JOB of coding.

No, and I have no plans to. I’m not arguing that JetBrains’ product doesn’t 
have good features.

3. And yes I don't see any other way IF you want to be part of the solution 
instead of being in denial!

Again, can you tell me what I’m in denial of? If I find something lacking with 
Qt Creator, I file a suggestion or fix it myself if it’s easy enough. That’s 
being part of the solution. Doing what you’re doing in the way you’re doing it 
is textbook “being part of the problem”.

"and don’t intend on putting in any work yourself, even though it’s an open 
source project."
I would put my work if it would mean something; trying to make such 
revolutionarising move on the existing QtCreator would practically re-writing 
it all from scratch while there are more convinient ways such as moving to 
intellij platform or just simply wrting a plugin for CLion maybe?

Why do you have to re-write Creator from scratch?

If you have a problem with the auto completion in Creator (or any other 
specific problem), file a bug report.

If you want there to be a plugin for CLion, write one. I’d bet a large sum of 
money that it’s not going to happen any other way. Plenty of external 
developers have contributed fixes and even entire plugins to Creator.

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


Re: [Interest] Available versions to QML import in older Qt releases?

2016-04-05 Thread Curtis Mitch
You might find this thread interesting to read:

http://lists.qt-project.org/pipermail/development/2015-September/023200.html

From: Interest 
[mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org] On 
Behalf Of Elvis Stansvik
Sent: Monday, 4 April 2016 6:10 PM
To: Jason H 
Cc: interest@qt-project.org Interest 
Subject: Re: [Interest] Available versions to QML import in older Qt releases?


Den 4 apr 2016 4:40 em skrev "Jason H" >:
>
> > I'm working on a product based on Ubuntu 15.10, where Qt 5.4.1 is the
> > packaged version (I know a more recent Ubuntu is soon to be released,
> > and an LTS at that, but we're on this version for now).
> >
> > Is there an online way to find out which versions of packages I can
> > import from the QtQuick 2 that comes with 5.4.1, short of downloading
> > the offline documentation?
> >
> > Experimentally I've deduced that
> >
> > QtQuick 2.4
> > QtQuick.Window 2.2
> > QtQuick.Controls 1.3
> > QtQuick.Controls.Styles 1.3
> > QtQuick.Layouts 1.1
> >
> > are the versions available in 5.4.1 for the packages I'm using, but it
> > would be great if there was a way to look up/confirm this quickly.
> >
> > I know there's older Qt docs at http://doc.qt.io/archives/ , but it
> > only stretches one version back, to Qt 5.4.
>
> QtCreator seems to know what versions are installed, and suggests these via 
> auto-complete.
>
> Hijacking this a bit, what is the behavior of imports when a later version is 
> present? What am I missing when my script does an import of a previous 
> version? Am I not getting bug fixes? It would be nice to know what the deltas 
> are between versions, as well as a wildcard for importing whatever the latest 
> and greatest is. Kind of like node's npm where you can spec a version and 
> anything after that version.

I agree.

Elvis

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


Re: [Interest] CLion to replace QtCreator?

2016-04-05 Thread Curtis Mitch
From: Interest 
[mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org] On 
Behalf Of Preet
Sent: Monday, 4 April 2016 11:30 PM
Cc: interest@qt-project.org
Subject: Re: [Interest] CLion to replace QtCreator?

Hey I want to chime in for the Creator devs that might be reading this: please 
keep doing what you do, QtCreator is *awesome*. It always seems like once 
people start liking and using certain IDEs and editors it becomes like a 
religion and people love talking down everything else. So much of 'tabs vs 
menu', 'color themes', 'UI-friendliness', etc can be subjective. Saying 
QtCreator "is actually eons behind the current IDE trends and technology" is 
just insulting. There are plenty of things in QtCreator that could use 
improvement, but thats true of most software. In general its a polished IDE 
that makes working with C++ way nicer and I can't wait to see how QtCreator 
gets even better in the future.


This. I think the Creator devs must have built up a nice level of restraint 
after dealing with these kinds of “users” (has this person actually used 
Creator properly?).
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] CLion to replace QtCreator?

2016-04-05 Thread Curtis Mitch


> -Original Message-
> From: Interest [mailto:interest-bounces+mitch.curtis=theqtcompany.com@qt-
> project.org] On Behalf Of Julius Bullinger
> Sent: Tuesday, 5 April 2016 12:05 PM
> To: interest@qt-project.org
> Subject: Re: [Interest] CLion to replace QtCreator?
> 
> On Monday, 4. April 2016 18:23, Thiago Macieira wrote:
> >>9. Multiple cursors (see the demo on SublimeText's home page - its
> epic,
> >>and Atom badly implements it),
> >
> > Explain. Sounds intriguing.
> 
> It's better shown than explained, see e.g.
> http://i.stack.imgur.com/TMRK3.gif and
> https://packagecontrol.io/readmes/img/d346da37ce3d306f23f960f2a103fbc0f456
> 2034.gif for examples.
> 
> This is the only feature I'm really missing in Qt Creator, and the reason
> I keep Sublime open besides Creator all the time.
> There's pretty basic multi-cursor functionality in Creator, but it's not
> quite as polished as Sublime's. Really, you need to try yourself to see
> how useful it is!

Looks interesting, but I find it odd that that is solely enough to warrant 
keeping another editor open, because you can easily do it in Creator. For 
renaming instances of a symbol: Ctrl + Shift + R. For stuff like keywords: good 
old find and replace! :p You can select a bunch of text first to limit it to a 
certain block.

> ___
> 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] Closing Jira bug reports

2016-03-31 Thread Curtis Mitch
I’d check who the maintainers for the relevant components are. In this case, 
there doesn’t seem to any maintainer for “GUI: Window management”, but Giuseppe 
D’Angelo is the maintainer for “Widgets: Main Window”, so you can mention him 
by beginning to type “@giuseppe” (without quotes) and then choose the right 
person from the suggestions. Alternatively, you can click the “share” icon at 
the top right to notify them that way.

In the case of QTBUG-31474, you could also mention Alex using the same method. 
For some reason, he’s not listed as a watcher for that report, even though it 
looks like he did a bulk close of bugs.

From: Interest 
[mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org] On 
Behalf Of Adam Light
Sent: Thursday, 31 March 2016 5:03 PM
To: Interest@qt-project.org
Subject: [Interest] Closing Jira bug reports

What's the protocol for getting an issue marked as closed that clearly should 
be closed. My immediate example is https://bugreports.qt.io/browse/QTBUG-31474 
but it's not uncommon that I'm browsing issues and see a report that needs to 
be closed but I don't have the permission to do so. Sometimes leaving a comment 
will prompt someone with the right permissions to close it, but that doesn't 
always work.

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


Re: [Interest] iPad Pro display support?

2016-03-29 Thread Curtis Mitch
https://bugreports.qt.io/browse/QTBUG-37095 may be the problem.

From: Interest 
[mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org] On 
Behalf Of Nuno Santos
Sent: Tuesday, 29 March 2016 12:53 PM
To: interest 
Subject: [Interest] iPad Pro display support?

Hi,

I’m wondering if there is any special care I should take for iPad Pro.

I have a user saying that the graphics is not crystal clear on it’s iPad Pro.

The graphics are mostly based on Qml Text and Canvas elements.

Thanks,

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


Re: [Interest] Ensuring that a queued invocation occurs after deferred deletion

2016-03-24 Thread Curtis Mitch
I've fixed it with the GameReference class.



From: Nye <kshegu...@gmail.com>
Sent: Thursday, 24 March 2016 18:28
To: Curtis Mitch
Cc: interest@qt-project.org
Subject: Re: [Interest] Ensuring that a queued invocation occurs after deferred 
deletion

> I've explained the problems with referencing the game object in the bug 
> report. :)

That's why I moved player.destroy(); out of the if (state == "invalid") block. 
But my last comment applies: unless there's a way to track explicitly the 
objects' lifetimes in QML I don't see how you can fix this.

On Thu, Mar 24, 2016 at 7:21 PM, Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>> wrote:

I've explained the problems with referencing the game object in the bug report. 
:)



From: Nye <kshegu...@gmail.com<mailto:kshegu...@gmail.com>>
Sent: Thursday, 24 March 2016 17:45

To: Curtis Mitch
Cc: interest@qt-project.org<mailto:interest@qt-project.org>
Subject: Re: [Interest] Ensuring that a queued invocation occurs after deferred 
deletion

> The "loadedComponents" thing is more or less the same as the GameScope thing 
> (I ended up calling it GameReference), except you need to remember to 
> increment the count yourself, whereas with GameScope, it does it 
> automatically.

Mostly yes, except that this is tied to the loader, not to the loaded item.

> The problem with the code you posted is as I mentioned earlier: Loader never 
> immediately deletes its items, so the code would still reference the game 
> object when it shouldn't.

Code referencing the game object should be perfectly fine until all the loaders 
have finished unloading their respective components (which I assume is signaled 
by loader.status == Loader.Null), then you know that you can destroy() whatever 
you wish as destroying it will happen (even if loaders queue their 
destructions) after all the loaded components have been destroyed. Isn't this 
what you wanted in the first place, or am I misunderstanding?

On Thu, Mar 24, 2016 at 1:53 PM, Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>> wrote:

The "loadedComponents" thing is more or less the same as the GameScope thing (I 
ended up calling it GameReference), except you need to remember to increment 
the count yourself, whereas with GameScope, it does it automatically.


The problem with the code you posted is as I mentioned earlier: Loader never 
immediately deletes its items, so the code would still reference the game 
object when it shouldn't.


____
From: Nye <kshegu...@gmail.com<mailto:kshegu...@gmail.com>>
Sent: Thursday, 24 March 2016 11:25

To: Curtis Mitch
Cc: interest@qt-project.org<mailto:interest@qt-project.org>
Subject: Re: [Interest] Ensuring that a queued invocation occurs after deferred 
deletion

Okay,
It might sound stupid, but why not notify the game from your loaders? 
Supposedly setting the source of the loader to NULL will unload the component 
(at least that's what the documentation says).
Something like this (please bear with my tortured QML knowledge):


Item {
id: theGame

property bool isReady: false
property int loadedComponents: 0

onStateChanged: {
if (state == "invalid") {
print("game.isReady about to change to false...")
isReady = false;
print("... game.isReady changed to " + isReady);
}  else if (state == "running") {
player = Qt.createQmlObject("import QtQuick 2.0; Item { property 
color color: 'black' }", window);

print("game.isReady about to change to true...")
isReady = true;
print("... game.isReady changed to true")
}
else if (state == "finished") {
// ... Everything was cleaned now ... supposedly
}
}

onLoadedComponentsChanged: {
if (state == "invalid" && loadedComponents == 0)  {
player.destroy();
player = null;

state = "finished";
print("... game.state changed to finished; nothing should reference 
properties of game now");
}
}

property Item player
}

Loader {
id: loader

Connections {
target: theGame
onIsReadyChanged: {
if (theGame.isReady) {
loader.setSource("qrc:/LoaderItem.qml", { "game": theGame });
theGame.loadedComponents++;
    } else {
loader.source = null;
}
}
}

onStatusChanged:  {
if (loader.status == Loader.Null)  {
theGame.loadedComponents--;
}
}
}

On Thu, Mar 24, 2016 at 10:48 AM, Curtis Mitc

Re: [Interest] Ensuring that a queued invocation occurs after deferred deletion

2016-03-24 Thread Curtis Mitch
I've explained the problems with referencing the game object in the bug report. 
:)



From: Nye <kshegu...@gmail.com>
Sent: Thursday, 24 March 2016 17:45
To: Curtis Mitch
Cc: interest@qt-project.org
Subject: Re: [Interest] Ensuring that a queued invocation occurs after deferred 
deletion

> The "loadedComponents" thing is more or less the same as the GameScope thing 
> (I ended up calling it GameReference), except you need to remember to 
> increment the count yourself, whereas with GameScope, it does it 
> automatically.

Mostly yes, except that this is tied to the loader, not to the loaded item.

> The problem with the code you posted is as I mentioned earlier: Loader never 
> immediately deletes its items, so the code would still reference the game 
> object when it shouldn't.

Code referencing the game object should be perfectly fine until all the loaders 
have finished unloading their respective components (which I assume is signaled 
by loader.status == Loader.Null), then you know that you can destroy() whatever 
you wish as destroying it will happen (even if loaders queue their 
destructions) after all the loaded components have been destroyed. Isn't this 
what you wanted in the first place, or am I misunderstanding?

On Thu, Mar 24, 2016 at 1:53 PM, Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>> wrote:

The "loadedComponents" thing is more or less the same as the GameScope thing (I 
ended up calling it GameReference), except you need to remember to increment 
the count yourself, whereas with GameScope, it does it automatically.


The problem with the code you posted is as I mentioned earlier: Loader never 
immediately deletes its items, so the code would still reference the game 
object when it shouldn't.



From: Nye <kshegu...@gmail.com<mailto:kshegu...@gmail.com>>
Sent: Thursday, 24 March 2016 11:25

To: Curtis Mitch
Cc: interest@qt-project.org<mailto:interest@qt-project.org>
Subject: Re: [Interest] Ensuring that a queued invocation occurs after deferred 
deletion

Okay,
It might sound stupid, but why not notify the game from your loaders? 
Supposedly setting the source of the loader to NULL will unload the component 
(at least that's what the documentation says).
Something like this (please bear with my tortured QML knowledge):


Item {
id: theGame

property bool isReady: false
property int loadedComponents: 0

onStateChanged: {
if (state == "invalid") {
print("game.isReady about to change to false...")
isReady = false;
print("... game.isReady changed to " + isReady);
}  else if (state == "running") {
player = Qt.createQmlObject("import QtQuick 2.0; Item { property 
color color: 'black' }", window);

print("game.isReady about to change to true...")
isReady = true;
print("... game.isReady changed to true")
}
else if (state == "finished") {
// ... Everything was cleaned now ... supposedly
}
}

onLoadedComponentsChanged: {
if (state == "invalid" && loadedComponents == 0)  {
player.destroy();
player = null;

state = "finished";
print("... game.state changed to finished; nothing should reference 
properties of game now");
}
}

property Item player
}

Loader {
id: loader

Connections {
target: theGame
onIsReadyChanged: {
if (theGame.isReady) {
loader.setSource("qrc:/LoaderItem.qml", { "game": theGame });
theGame.loadedComponents++;
} else {
loader.source = null;
}
}
}

onStatusChanged:  {
if (loader.status == Loader.Null)  {
theGame.loadedComponents--;
}
}
}

On Thu, Mar 24, 2016 at 10:48 AM, Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>> wrote:

The problem with doing this is that you'd still need to identify the Loaders 
that are relevant to (have references to) the game, so you'd end up with more 
or less the same amount of extra QML code (a line or two). It also ties it to 
Loaders, but the same problem exists with the destroy() JavaScript function, 
for example.



From: Nye <kshegu...@gmail.com<mailto:kshegu...@gmail.com>>
Sent: Thursday, 24 March 2016 01:41
To: Curtis Mitch

Cc: interest@qt-project.org<mailto:interest@qt-project.org>
Subject: Re: [Interest] Ensuring that a queued invocation occurs after deferred 
deletion

Hello,
> At one stage I thought about having a C++ object that could be 

Re: [Interest] Ensuring that a queued invocation occurs after deferred deletion

2016-03-24 Thread Curtis Mitch
The "loadedComponents" thing is more or less the same as the GameScope thing (I 
ended up calling it GameReference), except you need to remember to increment 
the count yourself, whereas with GameScope, it does it automatically.


The problem with the code you posted is as I mentioned earlier: Loader never 
immediately deletes its items, so the code would still reference the game 
object when it shouldn't.



From: Nye <kshegu...@gmail.com>
Sent: Thursday, 24 March 2016 11:25
To: Curtis Mitch
Cc: interest@qt-project.org
Subject: Re: [Interest] Ensuring that a queued invocation occurs after deferred 
deletion

Okay,
It might sound stupid, but why not notify the game from your loaders? 
Supposedly setting the source of the loader to NULL will unload the component 
(at least that's what the documentation says).
Something like this (please bear with my tortured QML knowledge):


Item {
id: theGame

property bool isReady: false
property int loadedComponents: 0

onStateChanged: {
if (state == "invalid") {
print("game.isReady about to change to false...")
isReady = false;
print("... game.isReady changed to " + isReady);
}  else if (state == "running") {
player = Qt.createQmlObject("import QtQuick 2.0; Item { property 
color color: 'black' }", window);

print("game.isReady about to change to true...")
isReady = true;
print("... game.isReady changed to true")
}
else if (state == "finished") {
// ... Everything was cleaned now ... supposedly
}
}

onLoadedComponentsChanged: {
if (state == "invalid" && loadedComponents == 0)  {
player.destroy();
player = null;

state = "finished";
print("... game.state changed to finished; nothing should reference 
properties of game now");
}
}

property Item player
}

Loader {
id: loader

Connections {
target: theGame
onIsReadyChanged: {
if (theGame.isReady) {
loader.setSource("qrc:/LoaderItem.qml", { "game": theGame });
theGame.loadedComponents++;
} else {
loader.source = null;
}
}
}

onStatusChanged:  {
if (loader.status == Loader.Null)  {
theGame.loadedComponents--;
}
}
}

On Thu, Mar 24, 2016 at 10:48 AM, Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>> wrote:

The problem with doing this is that you'd still need to identify the Loaders 
that are relevant to (have references to) the game, so you'd end up with more 
or less the same amount of extra QML code (a line or two). It also ties it to 
Loaders, but the same problem exists with the destroy() JavaScript function, 
for example.



From: Nye <kshegu...@gmail.com<mailto:kshegu...@gmail.com>>
Sent: Thursday, 24 March 2016 01:41
To: Curtis Mitch

Cc: interest@qt-project.org<mailto:interest@qt-project.org>
Subject: Re: [Interest] Ensuring that a queued invocation occurs after deferred 
deletion

Hello,
> At one stage I thought about having a C++ object that could be created in QML 
> and would somehow keep count of references to the game object. For example, 
> each Loader whose source component has access to the game object would 
> somehow register itself with the object, and the game wouldn’t start quitting 
> until all references were gone. As long as the C++ doesn’t know about the UI, 
> I think it could work quite well.

Unfortunately my QML knowledge is quite rudimentary, however I believe (correct 
me if I'm wrong) each component is a `QObject` instance and is parented to the 
parent component and so on until you reach the root context. So one thing that 
comes to mind is to "spy" (by installing an event filter) on the root context 
for when children are added or removed (QEvent::ChildAdded & 
QEvent::ChildRemoved) and if the children are Loaders then count them up. 
Respectively when they're destroyed you decrease the count and when it goes to 
zero you can unload/clean up. This approach would (hopefully) lift the need to 
do this:

GameScope {
   game: root.game
}

Kind regards.

On Wed, Mar 23, 2016 at 10:41 AM, Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>> wrote:
Hi.

That does help, thanks. It means that I’d really need to use an arbitrarily 
long timer, or find the “proper” solution.

At one stage I thought about having a C++ object that could be created in QML 
and would somehow keep count of references to the game object. For example, 
each Loader whose source component

Re: [Interest] [Quick] GridView inside the Layout

2016-03-24 Thread Curtis Mitch
"The implicit size of the 
GroupBox is 
calculated based on the size of its content. If you want to anchor items inside 
the group box, you must specify an explicit width and height on the 
GroupBox itself."

[1] http://doc.qt.io/qt-5/qml-qtquick-controls-groupbox.html#details


From: Interest  
on behalf of Sina Dogru 
Sent: Thursday, 24 March 2016 08:39
To: interest@qt-project.org
Subject: [Interest] [Quick] GridView inside the Layout

I guess my assumption about qt-quick Layouts might not be right. Consider a 
window where there are some properties, but they all inside a `ColumnLayout` so 
that `ScrollView` would be able to use on it. Also there is some 
QtQuick.Controls inside them. I guess code would be more expository.

import QtQuick 2.6
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.1

Window {
visible: true
height: 500
width: 500

ColumnLayout {
anchors.fill: parent

GroupBox {
Layout.fillWidth: true
ColumnLayout {
anchors.fill: parent
GridView {
cellWidth: 100
cellHeight: 20
Layout.fillWidth: true

model: [ "1", "2", "3", "4", "5", "6", "7" ]

delegate: Rectangle {
width: GridView.view.cellWidth
height: GridView.view.cellHeight
color: "red"
Text {
anchors.fill: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
text: modelData
}
}
}
}
}
}
}

When I run this code, qmlengine gives an error about the implicitWidth and 
implicitHeight,


qrc:/main.qml:14:9: QML GroupBox: Binding loop detected for property 
"implicitWidth"

qrc:/main.qml:14:9: QML GroupBox: Binding loop detected for property 
"implicitWidth"

qrc:/main.qml:14:9: QML GroupBox: Binding loop detected for property 
"implicitHeight"

qrc:/main.qml:14:9: QML GroupBox: Binding loop detected for property 
"implicitHeight"


I assume using `GridView` inside `ColumnLayout` causes that. Because when use a 
`Rectangle` instead of a `GridView` engine does not give any errors.

So can someone please point where am I doing wrong?

Thank you,
Sina

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


Re: [Interest] Ensuring that a queued invocation occurs after deferred deletion

2016-03-24 Thread Curtis Mitch
The problem with doing this is that you'd still need to identify the Loaders 
that are relevant to (have references to) the game, so you'd end up with more 
or less the same amount of extra QML code (a line or two). It also ties it to 
Loaders, but the same problem exists with the destroy() JavaScript function, 
for example.



From: Nye <kshegu...@gmail.com>
Sent: Thursday, 24 March 2016 01:41
To: Curtis Mitch
Cc: interest@qt-project.org
Subject: Re: [Interest] Ensuring that a queued invocation occurs after deferred 
deletion

Hello,
> At one stage I thought about having a C++ object that could be created in QML 
> and would somehow keep count of references to the game object. For example, 
> each Loader whose source component has access to the game object would 
> somehow register itself with the object, and the game wouldn’t start quitting 
> until all references were gone. As long as the C++ doesn’t know about the UI, 
> I think it could work quite well.

Unfortunately my QML knowledge is quite rudimentary, however I believe (correct 
me if I'm wrong) each component is a `QObject` instance and is parented to the 
parent component and so on until you reach the root context. So one thing that 
comes to mind is to "spy" (by installing an event filter) on the root context 
for when children are added or removed (QEvent::ChildAdded & 
QEvent::ChildRemoved) and if the children are Loaders then count them up. 
Respectively when they're destroyed you decrease the count and when it goes to 
zero you can unload/clean up. This approach would (hopefully) lift the need to 
do this:

GameScope {
   game: root.game
}

Kind regards.

On Wed, Mar 23, 2016 at 10:41 AM, Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>> wrote:
Hi.

That does help, thanks. It means that I’d really need to use an arbitrarily 
long timer, or find the “proper” solution.

At one stage I thought about having a C++ object that could be created in QML 
and would somehow keep count of references to the game object. For example, 
each Loader whose source component has access to the game object would somehow 
register itself with the object, and the game wouldn’t start quitting until all 
references were gone. As long as the C++ doesn’t know about the UI, I think it 
could work quite well.

Something like this:

Loader {
// ... contains GameView
}

// GameView.qml

Item {
id: root
property alias game

GameScope {
game: root.game
}
}

// GameScope.cpp

GameScope::setGame(Game *game)
{
if (game == mGame)
return;

if (game)
game->increaseReferenceCount();
else
game->decreaseReferenceCount();

mGame = game;
}

GameScope::~GameScope()
{
if (game)
game->decreaseReferenceCount();
}


Each event loop after a quit has been requested, Game could check the reference 
count and begin the actual quitting if it’s 0.

It still feels like it shouldn’t be necessary, but at least there’s no 
guesswork involved.

From: Nye [mailto:kshegu...@gmail.com<mailto:kshegu...@gmail.com>]
Sent: Tuesday, 22 March 2016 10:33 PM
To: Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>>
Cc: interest@qt-project.org<mailto:interest@qt-project.org>
Subject: Re: [Interest] Ensuring that a queued invocation occurs after deferred 
deletion

Hello,
I don't work with QML, but I'm pretty sure the events are processed in the 
order of their appearance in the event queue. So if you have a `deleteLater` 
call (i.e. you have a QEvent::DeferredDelete, which is scheduled through the 
event loop) any queued call to a slot (i.e. QEvent::MetaCall) that was made 
before the deletion request should be happening before the actual deletion. So, 
if you're emitting signals from a single thread, their respective slots would 
be called in the order in which the signals had happened.

Now, with multiple threads it's a bit tricky, since there's the chance that two 
threads will be trying to post a deferred function invocation at the same time 
(hence the event queue is protected by a mutex). However that mutex can't 
guarantee in what order the events will be posted, or rather no one can.

> My only thought is to use a zero-second single-shot timer. The question is: 
> is this guaranteed to happen *after* deferred deletion for a given iteration 
> of an event loop?

This posts a timer event on the queue, so you can achieve the same with 
QMetaObject::invokeMethod(receiverObject, "method", Qt::QueuedConnection), and 
the same "restrictions" apply as mentioned above.

I hope this is of help.
Kind regards.

On Tue, Mar 22, 2016 at 7:50 PM, Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>> wrote:

I recently discovered [1] that Loader defers deletion of items via 
deleteLater(). Up

Re: [Interest] Ensuring that a queued invocation occurs after deferred deletion

2016-03-23 Thread Curtis Mitch
Hi.

That does help, thanks. It means that I’d really need to use an arbitrarily 
long timer, or find the “proper” solution.

At one stage I thought about having a C++ object that could be created in QML 
and would somehow keep count of references to the game object. For example, 
each Loader whose source component has access to the game object would somehow 
register itself with the object, and the game wouldn’t start quitting until all 
references were gone. As long as the C++ doesn’t know about the UI, I think it 
could work quite well.

Something like this:

Loader {
// ... contains GameView
}

// GameView.qml

Item {
id: root
property alias game

GameScope {
game: root.game
}
}

// GameScope.cpp

GameScope::setGame(Game *game)
{
if (game == mGame)
return;

if (game)
game->increaseReferenceCount();
else
game->decreaseReferenceCount();

mGame = game;
}

GameScope::~GameScope()
{
if (game)
game->decreaseReferenceCount();
}


Each event loop after a quit has been requested, Game could check the reference 
count and begin the actual quitting if it’s 0.

It still feels like it shouldn’t be necessary, but at least there’s no 
guesswork involved.

From: Nye [mailto:kshegu...@gmail.com]
Sent: Tuesday, 22 March 2016 10:33 PM
To: Curtis Mitch <mitch.cur...@theqtcompany.com>
Cc: interest@qt-project.org
Subject: Re: [Interest] Ensuring that a queued invocation occurs after deferred 
deletion

Hello,
I don't work with QML, but I'm pretty sure the events are processed in the 
order of their appearance in the event queue. So if you have a `deleteLater` 
call (i.e. you have a QEvent::DeferredDelete, which is scheduled through the 
event loop) any queued call to a slot (i.e. QEvent::MetaCall) that was made 
before the deletion request should be happening before the actual deletion. So, 
if you're emitting signals from a single thread, their respective slots would 
be called in the order in which the signals had happened.

Now, with multiple threads it's a bit tricky, since there's the chance that two 
threads will be trying to post a deferred function invocation at the same time 
(hence the event queue is protected by a mutex). However that mutex can't 
guarantee in what order the events will be posted, or rather no one can.

> My only thought is to use a zero-second single-shot timer. The question is: 
> is this guaranteed to happen *after* deferred deletion for a given iteration 
> of an event loop?

This posts a timer event on the queue, so you can achieve the same with 
QMetaObject::invokeMethod(receiverObject, "method", Qt::QueuedConnection), and 
the same "restrictions" apply as mentioned above.

I hope this is of help.
Kind regards.

On Tue, Mar 22, 2016 at 7:50 PM, Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>> wrote:

I recently discovered [1] that Loader defers deletion of items via 
deleteLater(). Up until that point, I had been treating certain operations in 
my program as synchronous (as I haven't introduced threads yet). Now that I 
can't safely assume that UI items will be instantly destroyed, I have to 
convert these operations into asynchronous ones.

For example, previously, I had this code:

game.quitGame();

My idea is to turn it into this:

game.requestQuitGame();

Within this function, the Game object would set its "ready" property to false, 
emitting its associated property change signal so that Loaders can set active 
to false. Then, QMetaObject::invoke would be called with Qt::QueuedConnection 
to ensure that the Loader's deleteLater() calls would have been carried out 
*before* tearing down the game and its objects.

In order to confirm that invokeMethod() works the way I thought it did, I added 
the following debug statements to QEventLoop:

diff --git a/src/corelib/kernel/qeventloop.cpp 
b/src/corelib/kernel/qeventloop.cpp
index dca25ce..7dae9d0 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -151,6 +151,7 @@ bool QEventLoop::processEvents(ProcessEventsFlags flags)

 \sa QCoreApplication::quit(), exit(), processEvents()
 */
+#include 
 int QEventLoop::exec(ProcessEventsFlags flags)
 {
 Q_D(QEventLoop);
@@ -200,8 +201,11 @@ int QEventLoop::exec(ProcessEventsFlags flags)
 if (app && app->thread() == thread())
 QCoreApplication::removePostedEvents(app, QEvent::Quit);

-while (!d->exit.loadAcquire())
+while (!d->exit.loadAcquire()) {
+qDebug() << Q_FUNC_INFO << "--- beginning event loop";
 processEvents(flags | WaitForMoreEvents | EventLoopExec);
+qDebug() << Q_FUNC_INFO << "--- ending event loop";
+}

 ref.exceptionCaught = false;
 return d->returnCode.load();

It turns out that I misunderstood the documentation; it only says that the slot 
is i

Re: [Interest] Ensuring that a queued invocation occurs after deferred deletion

2016-03-23 Thread Curtis Mitch
From: Sina Dogru [mailto:sinado...@gmail.com]
Sent: Tuesday, 22 March 2016 10:09 PM
To: Curtis Mitch <mitch.cur...@theqtcompany.com>
Cc: interest@qt-project.org
Subject: Re: [Interest] Ensuring that a queued invocation occurs after deferred 
deletion

Hi, I saw your bug report. I encountered the same problem last week and I found 
a workaround by passing the properties that belong to another object one by one 
to JSon object. For example,

setSource("qrc:/LoaderItem.qml", { "color": theGame.player.color })
But in my case there was only one property. So instead of passing the object, 
passing the property was easy. But for more complicated situations that would 
be a pain...
Sina



Hi.

That’s a good work around, but you’re right in that it’s more difficult in my 
situation. I have a handful of objects that I need access to, each with their 
own objects as properties, and so on.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Ensuring that a queued invocation occurs after deferred deletion

2016-03-22 Thread Curtis Mitch

I recently discovered [1] that Loader defers deletion of items via 
deleteLater(). Up until that point, I had been treating certain operations in 
my program as synchronous (as I haven't introduced threads yet). Now that I 
can't safely assume that UI items will be instantly destroyed, I have to 
convert these operations into asynchronous ones.

For example, previously, I had this code:

game.quitGame();

My idea is to turn it into this:

game.requestQuitGame();

Within this function, the Game object would set its "ready" property to false, 
emitting its associated property change signal so that Loaders can set active 
to false. Then, QMetaObject::invoke would be called with Qt::QueuedConnection 
to ensure that the Loader's deleteLater() calls would have been carried out 
*before* tearing down the game and its objects.

In order to confirm that invokeMethod() works the way I thought it did, I added 
the following debug statements to QEventLoop:

diff --git a/src/corelib/kernel/qeventloop.cpp 
b/src/corelib/kernel/qeventloop.cpp
index dca25ce..7dae9d0 100644
--- a/src/corelib/kernel/qeventloop.cpp
+++ b/src/corelib/kernel/qeventloop.cpp
@@ -151,6 +151,7 @@ bool QEventLoop::processEvents(ProcessEventsFlags flags)

 \sa QCoreApplication::quit(), exit(), processEvents()
 */
+#include 
 int QEventLoop::exec(ProcessEventsFlags flags)
 {
 Q_D(QEventLoop);
@@ -200,8 +201,11 @@ int QEventLoop::exec(ProcessEventsFlags flags)
 if (app && app->thread() == thread())
 QCoreApplication::removePostedEvents(app, QEvent::Quit);

-while (!d->exit.loadAcquire())
+while (!d->exit.loadAcquire()) {
+qDebug() << Q_FUNC_INFO << "--- beginning event loop";
 processEvents(flags | WaitForMoreEvents | EventLoopExec);
+qDebug() << Q_FUNC_INFO << "--- ending event loop";
+}

 ref.exceptionCaught = false;
 return d->returnCode.load();

It turns out that I misunderstood the documentation; it only says that the slot 
is invoked when control returns to the event loop of the receiver's thread. So, 
as I understand it, it's possible that the invocation could happen *before* the 
deferred deletion of the Loaders' items. As the documentation doesn't specify 
the order between these two things, I should probably assume that it's not safe 
to assume anything.

So, I'm left with the problem of how to ensure that a slot is invoked after the 
Loaders' items have been destroyed. My only thought is to use a zero-second 
single-shot timer. The question is: is this guaranteed to happen *after* 
deferred deletion for a given iteration of an event loop? I can't see such a 
guarantee in the documentation. I even checked the source code of e.g. 
qeventdispatcher_win.cpp to see if I could find anything, without success.

Another question that's in the back of my mind is: is there a better way to do 
this?

[1] https://bugreports.qt.io/browse/QTBUG-51995
[2] http://doc.qt.io/qt-5/qt.html#ConnectionType-enum
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Are slots even needed these days?

2016-03-19 Thread Curtis Mitch


> -Original Message-
> From: Interest [mailto:interest-bounces+mitch.curtis=theqtcompany.com@qt-
> project.org] On Behalf Of Giuseppe D'Angelo
> Sent: Wednesday, 16 March 2016 3:51 PM
> To: interest@qt-project.org
> Subject: Re: [Interest] Are slots even needed these days?
> 
> Il 16/03/2016 15:24, Nikos Chantziaras ha scritto:
> > I can connect to Foo::bar either way. If I don't intend to ever use
> > the old-style connect syntax, is there a reason to have "public slots:"
> anymore?
> 
> It's still needed if you want to expose those methods to QML / scripting,
> use QMetaObject::invokeMethod, and possibly some other cases.

Perhaps threading, where queued connections are necessary?

> Cheers,
> --
> Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
> KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908 KDAB - The
> Qt Experts

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


Re: [Interest] MouseArea blocks 'Custom Scene Graph Item's mouse events

2016-02-22 Thread Curtis Mitch


From: Sina Dogru [mailto:sinado...@gmail.com]
Sent: Monday, 22 February 2016 1:43 PM
To: Curtis Mitch <mitch.cur...@theqtcompany.com>
Cc: interest@qt-project.org
Subject: Re: [Interest] MouseArea blocks 'Custom Scene Graph Item's mouse events

Thank you Curtis but as you can see it on my code snippet on the question, I 
have already tried to set 'propagateComposedEvents' to true. But it did not 
worked :S


And what about the answer on Stack Overflow?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] MouseArea blocks 'Custom Scene Graph Item's mouse events

2016-02-22 Thread Curtis Mitch


From: Interest 
[mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org] On 
Behalf Of Sina Dogru
Sent: Monday, 22 February 2016 1:15 PM
To: interest@qt-project.org
Subject: [Interest] MouseArea blocks 'Custom Scene Graph Item's mouse events


Hello,

I am implementing a custom scene graph item, which inherits 
QQuickItem.

class CustomItem : public QQuickItem {

Q_OBJECT

public:

CustomItem()

{

setAcceptHoverEvents(true);

setAcceptedMouseButtons(Qt::LeftButton);

setFlag(ItemHasContents);

}

protected:

QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;



void hoverEnterEvent(QHoverEvent *e) override;

void hoverLeaveEvent(QHoverEvent *e) override;

void hoverMoveEvent(QHoverEvent *e) override;



void mouseMoveEvent(QMouseEvent *e) override;

void mouseReleaseEvent(QMouseEvent *e) override;

void mousePressEvent(QMouseEvent *e) override;

};



And I use that CustomItem as a visual parent to some QML Types, like 
Rectangle.

CustomItem {

id: custom

width: 400; height: 400

Rectangle {

id: rect

z: -1

anchors.fill: parent

color: "blue"

}

}

Everything was perfect, I was able to draw over the visual childrens using 'z' 
property with overriding QQuickItem::updatePaintNode.

But the problem raised when I use 
MouseArea as a children of my 
'CustomItem'.

CustomItem {

id: custom

width: 400; height: 400

Rectangle {

id: rect

z: -1

anchors.fill: parent

color: "blue"

}

MouseArea {

anchors.fill: parent

propagateComposedEvents: true

drag.target: parent

drag.axis: Drag.XandYAxis

}

}

After that, my 'CustomItem' was not getting the mouse events like 
QQuickItem::hoverEnterEvent
 , 
QQuickItem::mousePressEvent
 or 
QQuickItem::mouseMoveEvent
 which those are crucial to implement in my case.

I am not sure if this even possible or am I doing something wrong? If there is 
a candidate solution for that particular problem, I would be happy to try it.

Note: Here is a similar question on 
StackOverFlow
 which have not been replied.



There is an answer for that question. What happens if you try it? You can also 
try setting propagateComposedEvents to true:

http://doc.qt.io/qt-5/qml-qtquick-mousearea.html#propagateComposedEvents-prop

I have already asked it question on 
QtForums.
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] User comments on web pages?

2016-01-13 Thread Curtis Mitch
I've always thought it would be cool to have some kind of web interface to the 
documentation that allowed edit suggestions from users, with a review system 
that pinged the doc team/relevant maintainers to approve or give feedback on 
those edits. It would solve the problem of the barrier to entry for new users.

Perhaps something similar to moderated edits on Wikis?

I think that comments are useful, but it's better to improve the documentation 
directly.
 
> -Original Message-
> From: Interest [mailto:interest-boun...@qt-project.org] On Behalf Of Jason
> H
> Sent: Tuesday, 12 January 2016 3:58 PM
> To: Interests Qt 
> Subject: [Interest] User comments on web pages?
> 
> There are a few things I'd like to add to the documentation, but the
> barrier to entry is too high.
> I'm wondering if we could allow comments by users (or those with
> bugreports account, or has an an account and is authorized) to be able to
> comment on the online help? I found the PHP comments helpful, when they
> were not completely off-base (let's face it, it's PHP :-))
> 
> It would also be cool is QtCreator could fetch these (assuming it ends up
> happening) ___
> 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] Asynchronously loading Qt Quick Items (without Loader)

2015-11-25 Thread Curtis Mitch
Oh, so I have missed the point of it entirely. The usage of processEvents() in 
the example threw me off, as I somehow thought that it was necessary to control 
the whole incubation process.

Thanks! :)


From: Gianluca <gmax...@gmail.com>
Sent: Wednesday, 25 November 2015 23:08
To: Curtis Mitch
Cc: interest@qt-project.org
Subject: Re: [Interest] Asynchronously loading Qt Quick Items (without Loader)

Hello Curtis,
looking at the documentation, I would suggest to create a subclass of 
QQmlIncubator and implent the statusChanged method with you code to execute 
when the object is ready.

http://doc.qt.io/qt-5/qqmlincubator.html#statusChanged

>From the documentation, it will be called whenever the status change and the 
>default implementation do nothing. So, it’s really seems that has been put 
>exactly for your purpose.

Ciao,
Gianluca.


Il giorno 25/nov/2015, alle ore 21:59, Curtis Mitch 
<mitch.cur...@theqtcompany.com> ha scritto:

>
> Hi.
>
> I'm playing around with a project that requires asynchronous loading of 
> QQuickItems. Specifically, each item has some basic visuals, and some Box2D 
> types to construct. The items should be loaded asynchronously as there will 
> be a large amount of them, and they should only be loaded when the view is 
> close by (the items are within a Flickable).
>
> I thought I'd use QQmlIncubator for this. Having never used it before, I went 
> to the detailed description [1] to find an example:
>
> QQmlIncubator incubator;
> component->create(incubator);
>
> while (incubator.isReady()) {
>QCoreApplication::processEvents(QEventLoop::AllEvents, 50);
> }
>
> QObject *object = incubator.object();
>
> My first thought is that the "Performance Considerations And Suggestions" 
> documentation [2] explicitly suggests against such code, saying things like:
>
> "never manually spin the event loop"
>
> and:
>
> "Note: A pattern which is tempting, but should never be used, is creating 
> your own QEventLoop or calling QCoreApplication::processEvents() in order to 
> avoid blocking within a C++ code block invoked from QML. This is dangerous, 
> because when an event loop is entered in a signal handler or binding, the QML 
> engine continues to run other bindings, animations, transitions, etc. Those 
> bindings can then cause side effects which, for example, destroy the 
> hierarchy containing your event loop."
>
> I'd rather not have to handle all this stuff myself, if possible.
>
> So, is there a way to asynchronously create Qt Quick Items from a 
> QQmlComponent (without using Loader), without having to write my own 
> incubator? Or have I misunderstood the point of QQmlIncubator?
>
> The reason why I want to avoid Loader is that, from my experience with Qt 
> Quick Controls, it doesn't perform so well with a large number of items.
>
> Cheers.
>
> [1] http://doc.qt.io/qt-5/qqmlincubator.html#details
> [2] http://doc.qt.io/qt-5/qtquick-performance.html#timing-considerations
> ___
> 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] Asynchronously loading Qt Quick Items (without Loader)

2015-11-25 Thread Curtis Mitch

Hi.

I'm playing around with a project that requires asynchronous loading of 
QQuickItems. Specifically, each item has some basic visuals, and some Box2D 
types to construct. The items should be loaded asynchronously as there will be 
a large amount of them, and they should only be loaded when the view is close 
by (the items are within a Flickable).

I thought I'd use QQmlIncubator for this. Having never used it before, I went 
to the detailed description [1] to find an example:

QQmlIncubator incubator;
component->create(incubator);

while (incubator.isReady()) {
QCoreApplication::processEvents(QEventLoop::AllEvents, 50);
}

QObject *object = incubator.object();

My first thought is that the "Performance Considerations And Suggestions" 
documentation [2] explicitly suggests against such code, saying things like:

"never manually spin the event loop"

and:

"Note: A pattern which is tempting, but should never be used, is creating your 
own QEventLoop or calling QCoreApplication::processEvents() in order to avoid 
blocking within a C++ code block invoked from QML. This is dangerous, because 
when an event loop is entered in a signal handler or binding, the QML engine 
continues to run other bindings, animations, transitions, etc. Those bindings 
can then cause side effects which, for example, destroy the hierarchy 
containing your event loop."

I'd rather not have to handle all this stuff myself, if possible.

So, is there a way to asynchronously create Qt Quick Items from a QQmlComponent 
(without using Loader), without having to write my own incubator? Or have I 
misunderstood the point of QQmlIncubator?

The reason why I want to avoid Loader is that, from my experience with Qt Quick 
Controls, it doesn't perform so well with a large number of items.

Cheers.

[1] http://doc.qt.io/qt-5/qqmlincubator.html#details
[2] http://doc.qt.io/qt-5/qtquick-performance.html#timing-considerations
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Why does a single Text item increase start-up time of QML application by 21 seconds?

2015-11-13 Thread Curtis Mitch
Could it be the same issue as QTBUG-43774 [1]?

[1] https://bugreports.qt.io/browse/QTBUG-43774

From: Interest [mailto:interest-boun...@qt-project.org] On Behalf Of Christian 
Nielsen
Sent: Friday, 13 November 2015 12:08 PM
To: Gunnar Roth 
Cc: interest@qt-project.org
Subject: Re: [Interest] Why does a single Text item increase start-up time of 
QML application by 21 seconds?

The issue was indeed font initialization. I commented out the line in
void QWindowsFontDatabaseFT::populateFontDatabase()
that populates the font database with all system fonts. Now Qt only loads the 
family of the default font at start-up.


From: Gunnar Roth [mailto:gunnar.r...@gmx.de]
Sent: Monday, 9 November 2015 07:42
To: Christian Nielsen
Cc: interest@qt-project.org
Subject: Re: [Interest] Why does a single Text item increase start-up time of 
QML application by 21 seconds?


Am 05.11.2015 um 08:46 schrieb Christian Nielsen 
>:

I guess you are on to something. But then why does my Qt Widget application 
start fast enough.

Is there a way to make Qt Quick do text like Qt Widgets?



Try this:
renderType : enumeration

Override the default rendering type for this component.
Supported render types are:
* Text.QtRendering - the default
* Text.NativeRendering
Select Text.NativeRendering if you prefer text to look native on the target 
platform and do not require advanced features such as transformation of the 
text. Using such features in combination with the NativeRendering render type 
will lend poor and sometimes pixelated results.



From: Gunnar Roth [mailto:gunnar.r...@gmx.de]
Sent: Thursday, 5 November 2015 17:15
To: Christian Nielsen
Cc: interest@qt-project.org
Subject: Re: [Interest] Why does a single Text item increase start-up time of 
QML application by 21 seconds?

Nice catch. My wild guess is font initialization.
Regards,
Gunnar Roth
Am 05.11.2015 um 07:52 schrieb Christian Nielsen 
>:


I am thinking that the issue is not the loading of the dlls. Because Widget 
application and Qt Quick Rectangle application loads fast enough.
The issue is not parsing QML. These sample QML files are just a few lines long.
It is not the instantiation of the Text item. Because adding a second Text item 
is instant.
So what can it be?

___
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-06 Thread Curtis Mitch


From: Interest [mailto:interest-boun...@qt-project.org] On Behalf Of André 
Somers
Sent: Friday, 6 November 2015 10:54 AM
To: interest@qt-project.org
Subject: Re: [Interest] Can QML model specify a range including negative 
numbers? For example -180 to +180 ?

Op 6-11-2015 om 10:10 schreef Curtis Mitch:
You can use the columnForeground component [1] for this purpose:

import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Extras 1.2
import QtQuick.Controls.Styles 1.2

ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")

Tumbler {
id: tumbler
anchors.centerIn: parent

TumblerColumn {
model: 90
}
TumblerColumn {
model: 60
}
TumblerColumn {
model: 60
}
TumblerColumn {
model: ["N", "S"]
}

I don't think I would keep the N/S (or E/W) option in a separate column. Why 
not integrate that into the first column? You can easily use a delegate to on 
the column to display negative values as S or W depending on latitude or 
longitude. To stick to a standard notation, you would have to put the N/S/E/W 
first in the column, like S 17|33|08.
I'm just showing Edward how he can add headers to the Tumbler by extending the 
UI he already had. As I said, there are issues having only two items in the 
model anyway, and a Switch would probably be better for such a small amount of 
options, depending on the context.

___
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-06 Thread Curtis Mitch
You can use the columnForeground component [1] for this purpose:

import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Extras 1.2
import QtQuick.Controls.Styles 1.2

ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")

Tumbler {
id: tumbler
anchors.centerIn: parent

TumblerColumn {
model: 90
}
TumblerColumn {
model: 60
}
TumblerColumn {
model: 60
}
TumblerColumn {
model: ["N", "S"]
}

property var columnTitles: ["Degrees", "Minutes", "Seconds", 
"North/South"]

style: TumblerStyle {
columnForeground: Item {
Text {
text: tumbler.columnTitles[styleData.column]
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.top
anchors.bottomMargin: height
}
}
}
}
}

Note that there is a limitation [2] that affects your current usage of Tumbler:

"For technical reasons, the model count must be equal to or greater than 
visibleItemCount plus one."

You might want to consider using a Switch for the North/South option.

By the way, is this UI for a touch device?

[1] 
http://doc.qt.io/qt-5/qml-qtquick-controls-styles-tumblerstyle.html#columnForeground-prop
[2]  http://doc.qt.io/qt-5/qml-qtquick-extras-tumbler.html#limitations

From: Interest [mailto:interest-boun...@qt-project.org] On Behalf Of Edward 
Sutton
Sent: Thursday, 5 November 2015 4:25 PM
To: André Somers 
Cc: interest@qt-project.org
Subject: Re: [Interest] Can QML model specify a range including negative 
numbers? For example -180 to +180 ?

Never mind, the answer is 
TumblerStyle.

http://doc.qt.io/qt-5/qtquick-controls-styles-qmlmodule.html

Is it possible to add column headers to a Qt 5.5  
TumblerColumn?

Degrees  Minutes Seconds

I need to learn how to compose a QML UI consisting of multiple components, text 
and other wise.

-Ed

[cid:image001.png@01D1187B.59C4F8A0]


On Nov 5, 2015, at 9:14 AM, Edward Sutton 
> wrote:


On Nov 5, 2015, at 8:34 AM, André Somers 
> wrote:

Op 4-11-2015 om 18:27 schreef Edward Sutton:





I would set the number of items visible on the spinner columns to something 
higher than 3 for this application though. 5 or 7 would look nicer I think.


Good advice!  How do you configure number of items visible?

I am using Qt 5.5 commercial.  I cannot find a property that sounds like it 
controls the number of visible items on the wheel?

http://doc.qt.io/qt-5/qml-qtquick-extras-tumbler.html
http://doc.qt.io/qt-5/qml-qtquick-extras-tumblercolumn.html
Properties
· 
activeFocus
 : bool
· 
columnForeground
 : Component
· 
currentIndex
 : int
· 
delegate
 : Component
· 
highlight
 : Component
· 
model : 
var
· 
role : 
string
· 
visible
 : bool
· 
width : 
real
With QML in general, I do not understand how you learn what QML component 
signals and properties are available on a component and what is configurable 
and what is not.

QML seems similar to Qt3D - you must read a lot of examples and do a lot of 
trial and error experimenting.  I must be missing something?

-Ed




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

This email and any files transmitted with it from The Charles Machine Works, 
Inc. are confidential and intended solely for the use of the individual or 
entity to which they are addressed. If you have received this email in error 
please notify the sender. Our company accepts no liability for the contents of 
this email, or for the consequences of any actions taken on the basis of the 
information provided, unless that information is subsequently confirmed in 
writing. Please note that any views or opinions presented in 

Re: [Interest] Can QML model specify a range including negative numbers? For example -180 to +180 ?

2015-11-06 Thread Curtis Mitch
It's Mitch, by the way. :p Outlook likes to reverse names because it sucks.

It should look like the attached image.

So you'll display the spinboxes on desktop? I think that's a good idea, because 
Tumbler is better suited for touch.

From: Edward Sutton [mailto:edward.sut...@subsite.com]
Sent: Friday, 6 November 2015 2:43 PM
To: Curtis Mitch <mitch.cur...@theqtcompany.com>
Cc: interest@qt-project.org
Subject: Re: [Interest] Can QML model specify a range including negative 
numbers? For example -180 to +180 ?

Thanks Curtis,

Thank you very much for the code!

However, I copied it but did not see any change,

What should the column title look like and where should I see them?

>By the way, is this UI for a touch device?

Yes for phones and tablets but *also* supports Windows and OS X desktops. This 
is intended to provide manual entry entry of GPS when needed.

It will be used in an *existing* widgets app by displaying the QML in a 
QQuickWidget.  I plan to conditionally display QML on Android and iOS ( or 
perhaps desktops too if users like it ).


I agree the North South indicator would be better served using a vertically 
oriented N/S toggle button.

Or as Andre suggested a delegate.  I am not familiar with QML delegates or 
quite sure what he means.  I read about delegates.

-Ed

On Nov 6, 2015, at 3:10 AM, Curtis Mitch 
<mitch.cur...@theqtcompany.com<mailto:mitch.cur...@theqtcompany.com>> wrote:

You can use the columnForeground component [1] for this purpose:

import QtQuick 2.3
import QtQuick.Controls 1.2
import QtQuick.Extras 1.2
import QtQuick.Controls.Styles 1.2

ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")

Tumbler {
id: tumbler
anchors.centerIn: parent

TumblerColumn {
model: 90
}
TumblerColumn {
model: 60
}
TumblerColumn {
model: 60
}
TumblerColumn {
model: ["N", "S"]
}

property var columnTitles: ["Degrees", "Minutes", "Seconds", 
"North/South"]

style: TumblerStyle {
columnForeground: Item {
Text {
text: tumbler.columnTitles[styleData.column]
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.top
anchors.bottomMargin: height
}
}
}
}
}

Note that there is a limitation [2] that affects your current usage of Tumbler:

"For technical reasons, the model count must be equal to or greater than 
visibleItemCount plus one."

You might want to consider using a Switch for the North/South option.

By the way, is this UI for a touch device?

[1] 
http://doc.qt.io/qt-5/qml-qtquick-controls-styles-tumblerstyle.html#columnForeground-prop
[2]  http://doc.qt.io/qt-5/qml-qtquick-extras-tumbler.html#limitations

From: Interest [mailto:interest-boun...@qt-project.org] On Behalf Of Edward 
Sutton
Sent: Thursday, 5 November 2015 4:25 PM
To: André Somers <an...@familiesomers.nl<mailto:an...@familiesomers.nl>>
Cc: interest@qt-project.org<mailto:interest@qt-project.org>
Subject: Re: [Interest] Can QML model specify a range including negative 
numbers? For example -180 to +180 ?

Never mind, the answer is 
TumblerStyle<http://doc.qt.io/qt-5/qml-qtquick-controls-styles-tumblerstyle.html>.

http://doc.qt.io/qt-5/qtquick-controls-styles-qmlmodule.html

Is it possible to add column headers to a Qt 5.5  
TumblerColumn<http://doc.qt.io/qt-5/qml-qtquick-extras-tumblercolumn.html>?

Degrees  Minutes Seconds

I need to learn how to compose a QML UI consisting of multiple components, text 
and other wise.

-Ed




On Nov 5, 2015, at 9:14 AM, Edward Sutton 
<edward.sut...@subsite.com<mailto:edward.sut...@subsite.com>> wrote:


On Nov 5, 2015, at 8:34 AM, André Somers 
<an...@familiesomers.nl<mailto:an...@familiesomers.nl>> wrote:

Op 4-11-2015 om 18:27 schreef Edward Sutton:





I would set the number of items visible on the spinner columns to something 
higher than 3 for this application though. 5 or 7 would look nicer I think.


Good advice!  How do you configure number of items visible?

I am using Qt 5.5 commercial.  I cannot find a property that sounds like it 
controls the number of visible items on the wheel?

http://doc.qt.io/qt-5/qml-qtquick-extras-tumbler.html
http://doc.qt.io/qt-5/qml-qtquick-extras-tumblercolumn.html
Properties
* 
activeFocus<http://doc.qt.io/qt-5/qml-qtquick-extras-tumblercolumn.html#activeFocus-prop>
 : bool
* 
columnForeground<http://doc.qt.io/qt-5/qml-qtquick-extras-tumblercolumn.html#columnForeground-prop>
 : Component
* 
currentIndex<http://doc.qt.io/qt-5/qml-qtquick-extras-tumblercolumn.html#currentIndex-prop>
 : 

Re: [Interest] Why does a single Text item increase start-up time of QML application by 21 seconds?

2015-11-04 Thread Curtis Mitch
Have you tried using the profiler in Creator?

From: Interest [mailto:interest-boun...@qt-project.org] On Behalf Of Christian 
Nielsen
Sent: Thursday, 5 November 2015 7:52 AM
To: interest@qt-project.org
Subject: [Interest] Why does a single Text item increase start-up time of QML 
application by 21 seconds?

Hi,

We are struggling with very long start-up time of our application.

Some details:
Treq M4 screen, 624 MHz ARM
Windows CE 6.0 R3
Qt 5.4 shared libraries
No OpenGL ES 2 support so using 2D Renderer

In order to find the bottleneck we made some simple test applications. Here are 
the descriptions with measured start-up times:

Qt Widget application with single label: < 3 s
QQuickView with no content: < 3s
QQuickView with single Rectangle: < 3s
QQuickView with single Text item: ~24 s
QQuickView with two Text items:  ~24s

I am thinking that the issue is not the loading of the dlls. Because Widget 
application and Qt Quick Rectangle application loads fast enough.
The issue is not parsing QML. These sample QML files are just a few lines long.
It is not the instantiation of the Text item. Because adding a second Text item 
is instant.
So what can it be?

Thanks in advance
-Christian




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


Re: [Interest] QListView and Drag

2015-09-11 Thread Curtis Mitch
> -Original Message-
> From: interest-bounces+mitch.curtis=theqtcompany@qt-project.org
> [mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org] On
> Behalf Of Igor Mironchik
> Sent: Thursday, 10 September 2015 11:16 PM
> To: interest@qt-project.org
> Subject: Re: [Interest] QListView and Drag
> 
> Hi,
> 
> On 10.09.2015 14:34, Igor Mironchik wrote:
> > Hi,
> >
> > I in icon mode from QListView with default drop action MoveAction.
> >
> > When I drag icon from one list view to another and drop it there -
> > icon dissapear in first list view and appears in another. All is fine.
> >
> > But removeRows() did't invokes on the model. How it works then?
> 
> I've found the problem. So much experiments on puzzle example from Qt...
> 
> Just want to say that in standard puzzle example so much bugs... So much
> drag & drop bugs...

We have a bug tracker: bugreports.qt.io ;)
 
> If you are interested in my research look at the attachment. May be you
> can give some more tips...
> 
> --
> Best Regards,
> Igor Mironchik.

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


Re: [Interest] Non rectangular clipPath for QQuickItems

2015-09-07 Thread Curtis Mitch
How about this?

http://stackoverflow.com/a/31585681/904422

> -Original Message-
> From: interest-bounces+mitch.curtis=theqtcompany@qt-project.org
> [mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org] On
> Behalf Of Richard Öhlinger
> Sent: Monday, 7 September 2015 11:46 AM
> To: interest@qt-project.org
> Subject: Re: [Interest] Non rectangular clipPath for QQuickItems
> 
> Isn't there anyone who knows how to clip an Item and all its children in a
> non-rectangular fashion?
> 
> Maybe It could be done with a ShaderEffect? I had a look at OpacityMask
> but I could not figure out how to use it in my context.
> 
> br
> Richard
> 
> On 09/02/2015 04:15 PM, Richard Öhlinger wrote:
> > Hello!
> > I'm porting our Quick 1 application to Quick 2.
> > In our application we had an triangle shaped item with a clipping path.
> > All child Items in QML (e.g. our Buttons) will be clipped to that
> > triangular shape
> >
> > //in C'tor:
> > this->setFlag(QGraphicsItem::ItemHasNoContents, false);
> > this->setFlag(QGraphicsItem::ItemClipsChildrenToShape, true);
> >
> > //in paint just drawing the triangle
> > painter->drawPath(m_painterPath);
> >
> > but the most important thing was overriding the QGraphicsItem::shape()
> > method which returned the triangular shape which Quick 1 would use for
> > clipping
> >
> > But how would I do that with a QQuickItem?
> > I've ported the drawing of the triangle by overriding
> > QQuickItem::updatePaintNode.
> > There I'd return a QSGClipNode which would perform the nessesary
> > clipping, but this will only clip the SG-children. But QML child Items
> > won't be scene graph children.
> >
> > Does anyone have a solution?
> >
> > br
> > Richard
> > ___
> > 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] Template-derived classes using MOC

2015-09-05 Thread Curtis Mitch

From: interest-bounces+mitch.curtis=theqtcompany@qt-project.org 
<interest-bounces+mitch.curtis=theqtcompany@qt-project.org> on behalf of 
Thiago Macieira <thiago.macie...@intel.com>
Sent: Saturday, 5 September 2015 09:38
To: interest@qt-project.org
Subject: Re: [Interest] Template-derived classes using MOC

On Saturday 05 September 2015 07:31:47 Curtis Mitch wrote:
> Is the following code a valid use of MOC? If not, why? I couldn't see
> anything mentioned in the old Qt Quarterly article [1] about this specific
> usage.

Hi MItch

It will compile, because:

> #include 
>
> class AbstractBase : public QObject
> {
> public:
> AbstractBase() {}
>
> virtual void virt() = 0;
> };

This is a normal class. You didn't have Q_OBJECT here, but you could have it
and it should be fine.

> template
> class Base : public AbstractBase
> {
> public:
> Base() {}
>
> virtual void virt() {}
>
> private:
> QVector mContainer;
> };

Moc is not involved in this class. You cannot add Q_OBJECT to this one.

> class Derived : public Base
> {
> Q_OBJECT
> Q_PROPERTY(int blah READ blah WRITE setBlah)
>
> public:
> Derived() : mBlah(0) {}
> ~Derived() {}
>
> int blah() const { return mBlah; }
> void setBlah(int blah) { mBlah = blah; }
>
> public slots:
> void foo() { qDebug() << Q_FUNC_INFO; }
>
> signals:
> void sig();
>
> private:
> int mBlah;
> };

This one is a bit weird, bit will also compile. The moc-generated code will
look for Base's meta object, which it *does* have, since it inherited
from AbstractBase. It's just not a meta object specific to the template class.

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

Thanks Thiago.

What about something like this:

http://stackoverflow.com/a/4238243/904422

Is that also OK?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Template-derived classes using MOC

2015-09-05 Thread Curtis Mitch

Is the following code a valid use of MOC? If not, why? I couldn't see anything 
mentioned in the old Qt Quarterly article [1] about this specific usage.

#include 

class AbstractBase : public QObject
{
public:
AbstractBase() {}

virtual void virt() = 0;
};

template
class Base : public AbstractBase
{
public:
Base() {}

virtual void virt() {}

private:
QVector mContainer;
};

class Derived : public Base
{
Q_OBJECT
Q_PROPERTY(int blah READ blah WRITE setBlah)

public:
Derived() : mBlah(0) {}
~Derived() {}

int blah() const { return mBlah; }
void setBlah(int blah) { mBlah = blah; }

public slots:
void foo() { qDebug() << Q_FUNC_INFO; }

signals:
void sig();

private:
int mBlah;
};

int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);

Derived d;
QObject::connect(, SIGNAL(sig()), , SLOT(foo()));

emit d.sig();

qDebug() << d.property("blah");
d.setProperty("blah", QVariant::fromValue(5));
qDebug() << d.property("blah");

return 0;
}

#include "main.moc"

[1] https://doc.qt.io/archives/qq/qq15-academic.html
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


[Interest] Rendering with Qt Quick vs QGraphicsView

2015-08-27 Thread Curtis Mitch

I'm moving from QGraphicsScene/QGraphicsView to QQuickItem for rendering my 
game objects. One of the things this involves is setting up a scene and the 
view onto that scene, as this was previously managed by QGraphicsScene and 
QGraphicsView.

My naive attempt was to do the following:

void SceneView::centerOn(const QPointF pos)
{
if (mScene) {
mScene-setX(-(pos.x() - width() / 2));
mScene-setY(-(pos.y() - height() / 2));
}
}

This works, but it produces this odd effect where some game objects jump 
around between neighbouring pixels while the camera comes to a halt while 
following the player:

http://i.imgur.com/AP1yIoO.gif

The player's movement is fine. The crate also does not seem to exhibit this 
problem (though its Box2D debug drawing marker does).

This is what it looks like when the player moves without the camera following 
it:

http://i.imgur.com/mA4JTC7.gif

This is what I'd expect from the other game objects when the camera is moving; 
no movement whatsoever relative to the scene.

The old, correct movement looked like this:

http://i.imgur.com/7yMcVpS.gif

The old code:

void MapView::centerOverFollowedItem()
{
QRectF geometry(mFollowing-pos(), mFollowing-boundingRect().size());
centerOn(geometry.center());
}

I thought I'd take a look at how QGraphicsView does it:

void QGraphicsView::centerOn(const QPointF pos)
{
Q_D(QGraphicsView);
qreal width = viewport()-width();
qreal height = viewport()-height();
QPointF viewPoint = d-matrix.map(pos);
QPointF oldCenterPoint = pos;

if (!d-leftIndent) {
if (isRightToLeft()) {
qint64 horizontal = 0;
horizontal += horizontalScrollBar()-minimum();
horizontal += horizontalScrollBar()-maximum();
horizontal -= int(viewPoint.x() - width / 2.0);
horizontalScrollBar()-setValue(horizontal);
} else {
horizontalScrollBar()-setValue(int(viewPoint.x() - width / 2.0));
}
}
if (!d-topIndent)
verticalScrollBar()-setValue(int(viewPoint.y() - height / 2.0));
d-lastCenterPoint = oldCenterPoint;
}

http://code.qt.io/cgit/qt/qtbase.git/tree/src/widgets/graphicsview/qgraphicsview.cpp#n1904

It casts the x and y position of its view to integers, so I tried doing that 
too:

void SceneView::centerOn(const QPointF pos)
{
if (mScene) {
mScene-setX(int(-(pos.x() - width() / 2)));
mScene-setY(int(-(pos.y() - height() / 2)));
}
}

This fixes the movement of objects that shouldn't move, but produces a subtle 
yet irritating effect where the movement of the camera looks blocky:

http://i.imgur.com/Z3Wc66h.gif

It's mostly noticeable when the player is coming to a stop.

Why does this happen with a Qt Quick scene, but not QGraphicsView, when they 
are both using integer positioning in this case?

(All objects are Images in the new code, and I set smooth to false on them 
because my assets will be pixel art)
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Accessing QML Loader from C++

2015-08-23 Thread Curtis Mitch
From: interest-bounces+mitch.curtis=theqtcompany@qt-project.org 
interest-bounces+mitch.curtis=theqtcompany@qt-project.org on behalf of 
mark diener rpzrpz...@gmail.com
Sent: Sunday, 23 August 2015 05:40
To: interest@qt-project.org
Subject: [Interest] Accessing QML Loader from C++

Hello List:

Does anybody have an idea on how to retrieve the QObject* from C++
with a QML Loader::item property?

[snip]

I'm not sure about the rest of your questions. Assuming I'm understanding this 
one correctly, you can do it like this:

QObject *item = loader-property(item).valueQObject*();

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


Re: [Interest] How to filter QFileSystemModel for use in QML

2015-08-13 Thread Curtis Mitch

From: interest-bounces+mitch.curtis=theqtcompany@qt-project.org 
interest-bounces+mitch.curtis=theqtcompany@qt-project.org on behalf of 
Julius Bullinger julius.bullin...@asctec.de
Sent: Thursday, 13 August 2015 14:14
To: interest@qt-project.org
Subject: [Interest] How to filter QFileSystemModel for use in QML

Dear list,

I'm having problems using QFileSystemModel in QML.

Take the following example code:

// QQmlEngine* engine
QFileSystemModel* fsm = new QFileSystemModel(engine);
QModelIndex root = fsm-setRootPath(C:/Qt);
engine-rootContext()-setContextProperty(fileSystemModel, fsm);

Now, using for example a QTreeView, one could set the root by using
``QTreeWidget::setRootIndex(root)`` to filter everything above the root
level. But suppose I'd like to use the model in QML, e.g. in a TreeView
QML component which doesn't have a setRoot() property.

[snip]

I'm not sure about the rest of your question, but TreeView has a rootIndex 
property in 5.6:

https://codereview.qt-project.org/#/c/121991/
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Debugging not emitted signals

2015-07-31 Thread Curtis Mitch
 -Original Message-
 From: interest-bounces+mitch.curtis=theqtcompany@qt-project.org
 [mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org]
 On Behalf Of Nuno Santos
 Sent: Friday, 31 July 2015 10:51 AM
 To: interest interest@qt-project.org
 Subject: [Interest] Debugging not emitted signals
 
 Hi,
 
 I’m facing a weird issue. I have signal in a class that is not being
 emitted.
 
 What can be causing this? How should I debug?
 
 I have tripple checked everything and can’t figure it out, why such a
 basic functionality is not working.
 
 Can someone provide me some debugging tips for this case?
 
 Thanks in advance,
 
 Nuno
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

Maybe blockSignals() [1] was called at some point?

[1] http://doc.qt.io/qt-5/qobject.html#blockSignals
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Image and Canvas get pixelated on retina iOS devices

2015-07-08 Thread Curtis Mitch
Probably this one:

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

 -Original Message-
 From: interest-bounces+mitch.curtis=theqtcompany@qt-project.org
 [mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org]
 On Behalf Of jh...@gmx.com
 Sent: Wednesday, 8 July 2015 2:28 PM
 To: Nuno Santos; Daniel França; Interests Qt
 Subject: Re: [Interest] Image and Canvas get pixelated on retina iOS
 devices
 
 There is already a bug filed.  One person reported you could render the
 canvas at 2x then scale back down to 1x.
 
 The canvas does not take into account the  devicePixelRatio
 
 -Original message-
 Sent: Wednesday, 08 July 2015 at 13:49:36
 From: Nuno Santos nunosan...@imaginando.pt
 To: Daniel França daniel.fra...@gmail.com
 Subject: Re: [Interest] Image and Canvas get pixelated on retina iOS
 devices
 I have added this to the .plist:
 
 keyNSHighResolutionCapable/key
 true /
 
 But it didn’t made any difference…
 
 Nuno Santos
 Founder / CEO / CTO
 www.imaginando.pt
 +351 91 621 69 62
 
  On 08 Jul 2015, at 12:32, Daniel França daniel.fra...@gmail.com
 wrote:
 
  Maybe you need to add NSHighResolutionCapable to Info.plist?
  http://blog.qt.io/blog/2013/04/25/retina-display-support-for-mac-os-
 ios-and-x11/ http://blog.qt.io/blog/2013/04/25/retina-display-support-
 for-mac-os-ios-and-x11/
 
  Em qua, 8 de jul de 2015 às 13:19, Nuno Santos
 nunosan...@imaginando.pt mailto:nunosan...@imaginando.pt escreveu:
  Hi,
 
  On my app, Images and Canvas gets pixelated on iOS retina devices. Is
 this a bug? Or do I need to do anything additionally? Images don’t
 behave this way on high resolution Android devices. Please look the
 attached screenshot.
 
 
  iOS Simulator Screen Shot 08 Jul 2015 12.18.19.png
 
  Nuno Santos
  Founder / CEO / CTO
  www.imaginando.pt http://www.imaginando.pt/
  +351 91 621 69 62
 
  ___
  Interest mailing list
  Interest@qt-project.org mailto:Interest@qt-project.org
  http://lists.qt-project.org/mailman/listinfo/interest
 http://lists.qt-project.org/mailman/listinfo/interest
 
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] On-screen keyboard on Windows desktop

2015-07-08 Thread Curtis Mitch
As a quick workaround, you could remove the plugin 
(plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so).

I just realised that I unchecked the Enterprise Add-ons when I installed Qt, so 
I’ll try installing them as well and then see if it happens.

From: interest-bounces+mitch.curtis=theqtcompany@qt-project.org 
[mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org] On 
Behalf Of Curtis Mitch
Sent: Wednesday, 8 July 2015 1:01 PM
To: Hamish Moffatt; interest@qt-project.org
Subject: Re: [Interest] On-screen keyboard on Windows desktop

Heh, interesting.

That’s definitely the Qt Virtual Keyboard. I’m not sure where exactly to look 
(since you said that QT_IM_MODULE is not set), but for some reason it’s being 
loaded. Like I said though, it doesn’t happen to me, and I tested Designer 
using the same Qt version as you (I assume you’re using an enterprise version 
of Qt if the VKB is showing up).

From: Hamish Moffatt [mailto:ham...@risingsoftware.com]
Sent: Wednesday, 8 July 2015 2:34 AM
To: Curtis Mitch; interest@qt-project.orgmailto:interest@qt-project.org
Subject: Re: [Interest] On-screen keyboard on Windows desktop

Here's a picture of what I see:

http://snag.gy/6zu1N.jpg

It's only in Qt Designer and Qt Assistant that I see it (but I don't use 
Creator). It's only since 5.5. It's not in our Qt application.

It's not the Windows assistance on-screen keyboard.

We have at least two machines behaving this way. They are set up for English - 
Australian.

Hamish

On 07/07/15 21:13, Curtis Mitch wrote:
I just tried with Qt 5.5 on Windows 7 and didn’t see any onscreen keyboard.

From: ham...@risingsoftware.commailto:ham...@risingsoftware.com 
[mailto:ham...@risingsoftware.com]
Sent: Tuesday, 7 July 2015 12:28 PM
To: interest@qt-project.orgmailto:interest@qt-project.org; Curtis Mitch
Subject: RE: [Interest] On-screen keyboard on Windows desktop

None, never heard of it...

Sent from my android device.

-Original Message-
From: Curtis Mitch 
mitch.cur...@theqtcompany.commailto:mitch.cur...@theqtcompany.com
To: Hamish Moffatt 
ham...@risingsoftware.commailto:ham...@risingsoftware.com, 
interest@qt-project.orgmailto:interest@qt-project.org 
interest@qt-project.orgmailto:interest@qt-project.org
Sent: Tue, 07 Jul 2015 20:23
Subject: RE: [Interest] On-screen keyboard on Windows desktop
What's the value of QT_IM_MODULE?

 -Original Message-
 From: 
 interest-bounces+mitch.curtishttp://mitch.curtis=theqtcompany@qt-project.orgmailto:theqtcompany@qt-project.org
 [mailto:interest-bounces+mitch.curtishttp://mitch.curtis=theqtcompany@qt-project.orgmailto:theqtcompany@qt-project.org]
 On Behalf Of Hamish Moffatt
 Sent: Monday, 6 July 2015 9:05 AM
 To: interest@qt-project.orgmailto:interest@qt-project.org
 Subject: [Interest] On-screen keyboard on Windows desktop

 In Qt 5.5, we're seeing an on-screen keyboard when using the supplied
 tools (Designer, Assistant). For example, launch Assistant then double
 click in the search box, or double click in a property in Designer.

 How can this be disabled and never seen again please?!


 Hamish
 ___
 Interest mailing list
 Interest@qt-project.orgmailto: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] On-screen keyboard on Windows desktop

2015-07-07 Thread Curtis Mitch
What's the value of QT_IM_MODULE?

 -Original Message-
 From: interest-bounces+mitch.curtis=theqtcompany@qt-project.org
 [mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org]
 On Behalf Of Hamish Moffatt
 Sent: Monday, 6 July 2015 9:05 AM
 To: interest@qt-project.org
 Subject: [Interest] On-screen keyboard on Windows desktop
 
 In Qt 5.5, we're seeing an on-screen keyboard when using the supplied
 tools (Designer, Assistant). For example, launch Assistant then double
 click in the search box, or double click in a property in Designer.
 
 How can this be disabled and never seen again please?!
 
 
 Hamish
 ___
 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] On-screen keyboard on Windows desktop

2015-07-07 Thread Curtis Mitch
I just tried with Qt 5.5 on Windows 7 and didn’t see any onscreen keyboard.

From: ham...@risingsoftware.com [mailto:ham...@risingsoftware.com]
Sent: Tuesday, 7 July 2015 12:28 PM
To: interest@qt-project.org; Curtis Mitch
Subject: RE: [Interest] On-screen keyboard on Windows desktop

None, never heard of it...

Sent from my android device.

-Original Message-
From: Curtis Mitch 
mitch.cur...@theqtcompany.commailto:mitch.cur...@theqtcompany.com
To: Hamish Moffatt 
ham...@risingsoftware.commailto:ham...@risingsoftware.com, 
interest@qt-project.orgmailto:interest@qt-project.org 
interest@qt-project.orgmailto:interest@qt-project.org
Sent: Tue, 07 Jul 2015 20:23
Subject: RE: [Interest] On-screen keyboard on Windows desktop
What's the value of QT_IM_MODULE?

 -Original Message-
 From: 
 interest-bounces+mitch.curtishttp://mitch.curtis=theqtcompany@qt-project.orgmailto:theqtcompany@qt-project.org
 [mailto:interest-bounces+mitch.curtishttp://mitch.curtis=theqtcompany@qt-project.orgmailto:theqtcompany@qt-project.org]
 On Behalf Of Hamish Moffatt
 Sent: Monday, 6 July 2015 9:05 AM
 To: interest@qt-project.orgmailto:interest@qt-project.org
 Subject: [Interest] On-screen keyboard on Windows desktop

 In Qt 5.5, we're seeing an on-screen keyboard when using the supplied
 tools (Designer, Assistant). For example, launch Assistant then double
 click in the search box, or double click in a property in Designer.

 How can this be disabled and never seen again please?!


 Hamish
 ___
 Interest mailing list
 Interest@qt-project.orgmailto: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] Flat Light Style How?

2015-02-09 Thread Curtis Mitch


 -Original Message-
 From: Jason H [mailto:jh...@gmx.com]
 Sent: Friday, 6 February 2015 3:09 PM
 To: Curtis Mitch
 Cc: Agocs Laszlo; interest@qt-project.org
 Subject: Re: RE: [Interest] Flat Light Style How?
 
 All pretty simple:
 
 1) Font sizes are simply too small.

I'm not sure if this is specific to your use case or if you mean that it's 
illegible in general. We've tested the style on embedded, desktop and mobile 
devices, and it was definitely legible. The text size is based off the default 
font size for the device, so if that's being set incorrectly, the text size 
will be wrong (and it will affect other things that rely on the default font 
size, like Qt Quick Controls).

Please create a bug report so that we can take a look.

 2) I want to colorize the button. Flat style uses green accents, I want
 them to be various colors, like orange or blue.
 3) Sometimes, I want the button to be that solid color with white text.

Per-control customisations like this require use of the styling API that is not 
supported, as mentioned before. This is not specific to the Enterprise 
Controls, it's just that Qt Quick Controls wasn't designed for this use case. 
The idea is that you can customise a control using the Base style, but if 
you're using a derived style, you use it more or less as-is.

However, it is possible, and we need to do it ourselves in some places. You 
need to import the Flat style into a namespace (here, it's Flat) and then 
qualify the style name with that namespace:

style: Flat.CircularGaugeStyle {
tickmarkStepSize: 20
labelStepSize: 40
minorTickmarkCount: 2
}

 
 If I can't use Flat style, we're going to stop paying for mobile because
 we only got it because my boss liked it and thought it was as
 dynamically changable as a regular QML element. But if we can't change
 fonts, font sizes and colors (basic stuff) then it's no good to us.

 And I'm going to go off-topic rant here.
 
 I was hoping the paid support option wound be worth something. So far it
 hasn't. Currently, I'm struggling with 4 day response times, in which I
 get a basic sentence or question then I have to wait another 4 days.
 Sure I could upgrade to 2-day, but that's not the point. I think if I
 reply in the same hour or day I should be able to get a response faster.
 
 The other reason why we got a Qt Desktop license was to use the Charts
 module, but it's not usable on a headless the server without some effort
 (I have to recompile everything) (compilers are not allowed on
 production servers) there is no command line installer (coming in 5.5?).
 But when I do use the chart module it elides all the text because I am
 rendering to QPdfWriter, and QPdfWriter doesn't account for pointSizes
 on various DPIs correctly, so I have to multiply it by 4 (300 logical
 dpi/72 assumed DPI=4)But now it thinks everything is too long. So the
 chart module doesn't work for us either. (I blame it on QPdfWiter
 fundamentally, but the charts module renders the graphics  line widths
 correctly so Charts has its own issue with deciding to elide text)
 
 So I'm having to take actions that would rid ourselves of our need for
 commercial licenses. I was happier when we were just using the
 OpenSource stuff... when there was  no expectation of support. IRC and
 this Mailing list are far more effective at support than the commercial
 support channel.  I've been responsible for multiple companies buying Qt
 Enterprise licenses in the Trolltech days. And when I used support back
 then, I actually got what I would call reasonable support. I'd even
 get code patches for fix bugs.  Right now I feel like I'm getting strung
 along, paying for abuse. If you're going to charge someone for something,
 you have to make sure they think the price is worth it.  I dove into the
 commercial offerings, and every time I hit bottom immediately. Or some
 rice-paper analogy.
 
 And if you say I should upgrade our plan to the next level, that's going
 to be a very hard sell at this point. Our one closed issue thus far is
 one that changed a flag on a bug I already filed to 'Requested via Qt
 Support' And that issue isn't fixed yet either.
 
  Sent: Friday, February 06, 2015 at 8:13 AM
  From: Curtis Mitch mitch.cur...@theqtcompany.com
  To: Jason H jh...@gmx.com, Agocs Laszlo
 laszlo.ag...@theqtcompany.com
  Cc: interest@qt-project.org interest@qt-project.org
  Subject: RE: [Interest] Flat Light Style How?
 
 
 
   -Original Message-
   From: interest-bounces+mitch.curtis=theqtcompany@qt-project.org
   [mailto:interest-bounces+mitch.curtis=theqtcompany.com@qt-
 project.org]
   On Behalf Of Jason H
   Sent: Thursday, 5 February 2015 7:46 PM
   To: Agocs Laszlo
   Cc: interest@qt-project.org
   Subject: Re: [Interest] Flat Light Style How?
  
   Oh thanks!
  
   So immedautely, I notice issues.
  
   Any control that has text (TextField, Button) is not properly
 accounting
   for a specified pointSize.
  
   How do I inherit from

Re: [Interest] Flat Light Style How?

2015-02-06 Thread Curtis Mitch


 -Original Message-
 From: interest-bounces+mitch.curtis=theqtcompany@qt-project.org
 [mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org]
 On Behalf Of Jason H
 Sent: Thursday, 5 February 2015 7:46 PM
 To: Agocs Laszlo
 Cc: interest@qt-project.org
 Subject: Re: [Interest] Flat Light Style How?
 
 Oh thanks!
 
 So immedautely, I notice issues.
 
 Any control that has text (TextField, Button) is not properly accounting
 for a specified pointSize.

Please create a bug report for this. The Flat style is quite new, and hasn't 
had a whole lot of exposure yet, so there will be some small bugs to iron out.

 How do I inherit from a flat style for a button?

We don't support this for non-Base styles. For example, you can't override 
style components of the Android style. We'd like expose the FlatStyle 
singleton, however, which would provide some kind of theming support, so that 
you can override certain colours and properties of the style, and perhaps 
switch between light and dark themes, etc.
 

 
  Sent: Thursday, February 05, 2015 at 12:11 PM
  From: Agocs Laszlo laszlo.ag...@theqtcompany.com
  To: Jason H jh...@gmx.com
  Cc: interest@qt-project.org interest@qt-project.org
  Subject: Re: [Interest] Flat Light Style How?
 
  QT_QUICK_CONTROLS_STYLE applies to all controls. Don't be misled by
 the fact that the page is for enterprise controls.
 
  Cheers,
  Laszlo
 
  
  From: Jason H jh...@gmx.com
  Sent: Thursday, February 5, 2015 6:06 PM
  To: Agocs Laszlo
  Cc: interest@qt-project.org
  Subject: Re: [Interest] Flat Light Style How?
 
  The Qt Quick Enterprise Controls Styles module allows custom styling
 for Qt Quick Enterprise Controls.
 
  I want standard controls to be styled too... I thought that it would
 style all controls, not just the enterprise ones as seen in
 https://www.youtube.com/watch?v=wMs1pSZMnG0 about 2:00 in. The page you
 directed me to only lists:
  CircularGaugeStyle
  DelayButtonStyle
  DialStyle
  GaugeStyle
  PieMenuStyle
  StatusIndicatorStyle
  ToggleButtonStyle
  TumblerStyle
 
  I hope there are more styles than that?
 
 
 
   Sent: Thursday, February 05, 2015 at 11:59 AM
   From: Agocs Laszlo laszlo.ag...@theqtcompany.com
   To: Jason H jh...@gmx.com, interest@qt-project.org
 interest@qt-project.org
   Subject: Re: [Interest] Flat Light Style How?
  
   Hi,
  
   See
 http://doc.qt.io/QtQuickEnterpriseControls/qtquickenterprisecontrolsstyl
 es-index.html regarding switching styles.
  
   Cheers,
   Laszlo
  
  
   
   From: interest-bounces+laszlo.agocs=theqtcompany@qt-project.org
 interest-bounces+laszlo.agocs=theqtcompany@qt-project.org on
 behalf of Jason H jh...@gmx.com
   Sent: Thursday, February 5, 2015 5:52 PM
   To: interest@qt-project.org
   Subject: [Interest] Flat Light Style How?
  
   I have a commercial license and I can not find any info on how to
 use Flat Light style.
  
   Can someone clue me in?
  
   Thanks!
   ___
   Interest mailing list
   Interest@qt-project.org
   http://lists.qt-project.org/mailman/listinfo/interest
  
 
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] Flat Light Style How?

2015-02-06 Thread Curtis Mitch


 -Original Message-
 From: interest-bounces+mitch.curtis=theqtcompany@qt-project.org
 [mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org]
 On Behalf Of Jason H
 Sent: Thursday, 5 February 2015 7:46 PM
 To: Agocs Laszlo
 Cc: interest@qt-project.org
 Subject: Re: [Interest] Flat Light Style How?
 
 Oh thanks!
 
 So immedautely, I notice issues.
 
 Any control that has text (TextField, Button) is not properly accounting
 for a specified pointSize.
 
 How do I inherit from a flat style for a button?
 

What is your use case, exactly? It's nice to know what you'd like to achieve 
using the Flat style.

 
  Sent: Thursday, February 05, 2015 at 12:11 PM
  From: Agocs Laszlo laszlo.ag...@theqtcompany.com
  To: Jason H jh...@gmx.com
  Cc: interest@qt-project.org interest@qt-project.org
  Subject: Re: [Interest] Flat Light Style How?
 
  QT_QUICK_CONTROLS_STYLE applies to all controls. Don't be misled by
 the fact that the page is for enterprise controls.
 
  Cheers,
  Laszlo
 
  
  From: Jason H jh...@gmx.com
  Sent: Thursday, February 5, 2015 6:06 PM
  To: Agocs Laszlo
  Cc: interest@qt-project.org
  Subject: Re: [Interest] Flat Light Style How?
 
  The Qt Quick Enterprise Controls Styles module allows custom styling
 for Qt Quick Enterprise Controls.
 
  I want standard controls to be styled too... I thought that it would
 style all controls, not just the enterprise ones as seen in
 https://www.youtube.com/watch?v=wMs1pSZMnG0 about 2:00 in. The page you
 directed me to only lists:
  CircularGaugeStyle
  DelayButtonStyle
  DialStyle
  GaugeStyle
  PieMenuStyle
  StatusIndicatorStyle
  ToggleButtonStyle
  TumblerStyle
 
  I hope there are more styles than that?
 
 
 
   Sent: Thursday, February 05, 2015 at 11:59 AM
   From: Agocs Laszlo laszlo.ag...@theqtcompany.com
   To: Jason H jh...@gmx.com, interest@qt-project.org
 interest@qt-project.org
   Subject: Re: [Interest] Flat Light Style How?
  
   Hi,
  
   See
 http://doc.qt.io/QtQuickEnterpriseControls/qtquickenterprisecontrolsstyl
 es-index.html regarding switching styles.
  
   Cheers,
   Laszlo
  
  
   
   From: interest-bounces+laszlo.agocs=theqtcompany@qt-project.org
 interest-bounces+laszlo.agocs=theqtcompany@qt-project.org on
 behalf of Jason H jh...@gmx.com
   Sent: Thursday, February 5, 2015 5:52 PM
   To: interest@qt-project.org
   Subject: [Interest] Flat Light Style How?
  
   I have a commercial license and I can not find any info on how to
 use Flat Light style.
  
   Can someone clue me in?
  
   Thanks!
   ___
   Interest mailing list
   Interest@qt-project.org
   http://lists.qt-project.org/mailman/listinfo/interest
  
 
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest


Re: [Interest] QML Text.Fit question

2015-01-30 Thread Curtis Mitch
If you're already using a rectangle to determine the size of the text, why not 
use one half the size to determine text that should be half the size?

Besides that, there's probably not a better way to achieve what you're after, 
other than exposing the font size.

Another option to consider, if you want to somehow get access to the font size, 
is to provide a function in QFontMetrics:

int fontSize(const QRect boundingRect) const

I'm not sure if that makes sense for QFontMetrics' API, but I'm just throwing 
ideas around. :)


From: Harri Pasanen ha...@mpaja.com
Sent: Thursday, 29 January 2015 21:12
To: Curtis Mitch; interest@qt-project.org
Subject: Re: [Interest] QML Text.Fit question

We'll putting on my designer classes here:

Imagine I have a rectangle on screen, let's say a sign to a shop.
I want to have the title text within the sign so that it leaves 5 mm
margin on both sides and top and bottom.   So I compute the rectangle
where the text needs to fit, exactly so that it complements the golden
ratio of the larger layout.

Then I need to use the same font, exactly half size elsewhere in the
image, again to please my eye.
At that point it is convenient to know what the initial font size was.

Or how would you achieve this otherwise?

Regards,

Harri




On 29/01/2015 13:47, Curtis Mitch wrote:
 I've found that a combination of scaling font size based on the default font 
 size (font.pixelSize of an empty Text item, for example, or the new 
 Font/TextMetrics types) and Text.Fit handles stuff pretty well. I'd be 
 interested to see your case where it's not working, just because I'm curious. 
 :)

 The patch to expose it shouldn't be that hard, and I don't see a reason why 
 it'd be rejected. Still, I wonder if there's a better way to solve your 
 problem.

 
 From: Harri Pasanen ha...@mpaja.com
 Sent: Wednesday, 28 January 2015 15:48
 To: Curtis Mitch; interest@qt-project.org
 Subject: Re: [Interest] QML Text.Fit question

 On 28/01/2015 13:25, Curtis Mitch wrote:
 Why do you need to know the size of the text?
 I work mostly in mobile space where the size, resolution and pixel
 densities vary greatly between displays.

 If one wants to automate layout so that it remains usable (even if not
 artful in all cases), one needs to settle on a font size where all the
 text fits.   So it is convenient to be able to ask for a font size that
 fits in a given rectangle and then standardize on that.

 I think it would be useful to expose that property in Text element.

 Just my 2 cents,

 Harri


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


Re: [Interest] QML Text.Fit question

2015-01-29 Thread Curtis Mitch
I've found that a combination of scaling font size based on the default font 
size (font.pixelSize of an empty Text item, for example, or the new 
Font/TextMetrics types) and Text.Fit handles stuff pretty well. I'd be 
interested to see your case where it's not working, just because I'm curious. :)

The patch to expose it shouldn't be that hard, and I don't see a reason why 
it'd be rejected. Still, I wonder if there's a better way to solve your problem.


From: Harri Pasanen ha...@mpaja.com
Sent: Wednesday, 28 January 2015 15:48
To: Curtis Mitch; interest@qt-project.org
Subject: Re: [Interest] QML Text.Fit question

On 28/01/2015 13:25, Curtis Mitch wrote:
 Why do you need to know the size of the text?

I work mostly in mobile space where the size, resolution and pixel
densities vary greatly between displays.

If one wants to automate layout so that it remains usable (even if not
artful in all cases), one needs to settle on a font size where all the
text fits.   So it is convenient to be able to ask for a font size that
fits in a given rectangle and then standardize on that.

I think it would be useful to expose that property in Text element.

Just my 2 cents,

Harri

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


Re: [Interest] QML Text.Fit question

2015-01-28 Thread Curtis Mitch


 -Original Message-
 From: interest-bounces+mitch.curtis=theqtcompany@qt-project.org
 [mailto:interest-bounces+mitch.curtis=theqtcompany@qt-project.org]
 On Behalf Of Harri Pasanen
 Sent: Wednesday, 28 January 2015 9:32 AM
 To: interest@qt-project.org
 Subject: [Interest] QML Text.Fit question
 
 If in QML Text item I use Text.Fit size, like
 
 Text {
  id: st
  anchors.centerIn. parent
  width:  200
  height: 100
  fontSizeMode: Text.Fit
  minimumPointSize: 6
  font.pointSize: 120
  text: Size me if you can!
 }
 
 
 That works ok.   But I did not find a way to query the size it arrived
 at?  If I do console.log(st.font.pointSize) it is still 120 after the
 real size used is obviously not that after display.
 
 Is there a way to get the size used without dropping to C++?
 
 Thanks,
 
 Harri
 
 ___
 Interest mailing list
 Interest@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/interest

I can't see a way to access that without using private C++ API.

The actual font size seems to be stored in QQuickTextPrivate::layout. You can 
see this if you add the following debug statement to qquicktext.cpp:

diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index be86b29..2a7db4e 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -1098,6 +1098,8 @@ QRectF QQuickTextPrivate::setupTextLayout(qreal *const 
baseline)
 if (truncated != wasTruncated)
 emit q-truncatedChanged();
 
+qDebug()  layout.font()  font;
+
 return br;
 }

Also, use this modified version of your example:

import QtQuick 2.0

Rectangle {
width: 200
height: 200

Text {
id: st
anchors.fill: parent
fontSizeMode: Text.Fit
minimumPointSize: 6
font.pointSize: 120
text: Size me if you can!

Rectangle {
anchors.fill: parent
color: transparent
border.color: darkorange
}
}
}

As you resize the window, you see something like:

QFont( Ubuntu,18,-1,5,50,0,0,0,0,0 ) QFont( Ubuntu,120,-1,5,50,0,0,0,0,0 )
QFont( Ubuntu,19,-1,5,50,0,0,0,0,0 ) QFont( Ubuntu,120,-1,5,50,0,0,0,0,0 )
QFont( Ubuntu,20,-1,5,50,0,0,0,0,0 ) QFont( Ubuntu,120,-1,5,50,0,0,0,0,0 )

Why do you need to know the size of the text?
___
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest