Re: [Development] QTCS2019 Notes from QtQml session

2019-11-30 Thread Mathias Hasselmann
Am 25.11.2019 um 15:39 schrieb André Somers: On 25-11-19 12:31, Ulf Hermann wrote: I think one of the biggest problems is that ID resolution crosses file boundaries. This essentially means that the ids chosen can very easily become part of the "API" of a component unless you are very vigilant

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-27 Thread Shawn Rutledge
> On 25 Nov 2019, at 22:18, Filippo Cucchetto > wrote: > > Having followed the evolution and first announcement of Qml/Quick QML3 seems > like an admission of guilt. > I remember when a lot of people complained about the use of Javascript as a > scripting language and further > more on the la

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-27 Thread Shawn Rutledge
On 26 Nov 2019, at 12:35, Olivier Goffart mailto:oliv...@woboq.com>> wrote: On 25.11.19 16:36, André Somers wrote: On 25-11-19 15:53, Ulf Hermann wrote: Yeah, that's going to make using QML in actual applications a whole lot harder. For instance, sometimes access to some root node is needed even

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-27 Thread Giuseppe D'Angelo via Development
On 27/11/2019 11:39, Milian Wolff wrote: Personally, I hope the answer is that this will remain supported. The only disadvantage is the runtime type introspection, which should/could be solved via Ulf's idea of something like an inline interface/trait component. Such that eventually we can do som

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-27 Thread Robin Burchell
On Tue, Nov 26, 2019, at 8:56 AM, Ulf Hermann wrote: > We're also changing the way views and delegate work. If you want to use > the "index" in a Repeater's delegate you'll have to declare that in QML > 3, using a required property: > > Repeater { > model: 10 > > Text { > req

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-27 Thread Milian Wolff via Development
On Mittwoch, 27. November 2019 10:35:23 CET Giuseppe D'Angelo via Development wrote: > Il 27/11/19 09:52, Ulf Hermann ha scritto: > > That depends on how we do the model/delegate matching mentioned above. > > As stated above, I don't have a solution, yet. If you have an idea, let > > us know. I ca

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-27 Thread Milian Wolff
On Dienstag, 26. November 2019 20:32:20 CET Arno Rehn wrote: > On 26/11/2019 08:56, Ulf Hermann wrote: > >> We have some code that evaluates JS in custom QQmlContexts with certain > >> "magic" context properties set (sort of like the "index" or "modelData" > >> context properties in delegates like

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-27 Thread Giuseppe D'Angelo via Development
Il 27/11/19 09:52, Ulf Hermann ha scritto: That depends on how we do the model/delegate matching mentioned above. As stated above, I don't have a solution, yet. If you have an idea, let us know. I can imagine generating some C++ from such code that does the model/delegate matching at run-time via

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-27 Thread Ulf Hermann
>> We brainstormed a bit about how a model could declare its items' data >> type in QML, so that we could statically check model against delegate >> types. We will need this when compiling QML 3 to C++. We didn't come up >> with anything really great, though. This needs more work. > > Just somethi

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-27 Thread Ulf Hermann
> Anyway, how would I idiomatically register a bunch of dynamically > created C++ objects with QML then? As an example, we're automatically > detecting hardware stuff and creating interface objects based on that. > These interface objects are then passed to QML which we use to implement > state mac

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-26 Thread Giuseppe D'Angelo via Development
Il 21/11/19 09:17, Ulf Hermann ha scritto: Typed Model Data We brainstormed a bit about how a model could declare its items' data type in QML, so that we could statically check model against delegate types. We will need this when compiling QML 3 to C++. We didn't come up with an

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-26 Thread Arno Rehn
On 26/11/2019 08:56, Ulf Hermann wrote: >> We have some code that evaluates JS in custom QQmlContexts with certain >> "magic" context properties set (sort of like the "index" or "modelData" >> context properties in delegates like Repeater.delegate). >> Will something similar still be possible? > >

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-26 Thread Uwe Rathmann
On 11/26/19 12:35 PM, Olivier Goffart wrote: "QML Strict is as subset of QML which is more maintainable and performs better" Isn't it that way: QML is for convenience but expensive. C++ is often less convenient but with better performance and lower memory footprint. QML Strict is a compromise

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-26 Thread Ulf Hermann
> Lookup by ID? You mean set the object name like you did in your example > in your talk at QtWS? I protested then, and I will protest now again. > Don't. Really: don't. If you are talking about re-usability and > maintainability of your code elsewhere, then advocating this practice is > really

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-26 Thread Olivier Goffart
On 25.11.19 16:36, André Somers wrote: On 25-11-19 15:53, Ulf Hermann wrote: Yeah, that's going to make using QML in actual applications a whole lot harder. For instance, sometimes access to some root node is needed even from deep leaf files. Removing that capability is quite a drastic measure.

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-26 Thread Simon Hausmann
On 26.11.19 11:48, André Somers wrote: > > On 26/11/2019 08:56, Ulf Hermann wrote: >>> We have some code that evaluates JS in custom QQmlContexts with certain >>> "magic" context properties set (sort of like the "index" or "modelData" >>> context properties in delegates like Repeater.delegate). >>

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-26 Thread André Somers
On 26/11/2019 08:56, Ulf Hermann wrote: We have some code that evaluates JS in custom QQmlContexts with certain "magic" context properties set (sort of like the "index" or "modelData" context properties in delegates like Repeater.delegate). Will something similar still be possible? You should r

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-26 Thread Simon Hausmann
On 25.11.19 16:55, Robin Burchell wrote: > On Mon, Nov 25, 2019, at 3:53 PM, Ulf Hermann wrote: >> Yes, but the problems with this construct are the same as with generic >> context properties: Your QML component requires some context that it >> doesn't declare. Therefore your code is not reusable

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-26 Thread Simon Hausmann
On 25.11.19 12:15, Robin Burchell wrote: >> We could detect this in qmllint by just continuing the search for IDs >> even if we've found a property. > We could, but if I may gently suggest, I think I can count most of the people > who use qmllint on a regular, useful basis on one hand ;-). You'r

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-26 Thread André Somers
On 26/11/2019 09:34, Chris Adams wrote: On Mon, Nov 25, 2019 at 9:34 PM Ulf Hermann wrote: I think one of the biggest problems is that ID resolution crosses file boundaries. This essentially means that the ids chosen can very easily become part of the "API" of a component unless you are very v

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-26 Thread ekke
thanks Elvis, Filippo, Ulf, now I know what to do the next months to make my apps QML3 - ready ;-) yes - then my code will be better re-usable and cleaner as now will blog about all those refactorings ciao ekke Am 26.11.19 um 09:20 schrieb Elvis Stansvik: > Den mån 25 nov. 2019 kl 22:08 skrev

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-26 Thread Chris Adams
On Mon, Nov 25, 2019 at 9:34 PM Ulf Hermann wrote: > > > I think one of the biggest problems is that ID resolution crosses > > file boundaries. This essentially means that the ids chosen can very > > easily become part of the "API" of a component unless you are very > > vigilant to not allow that

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-26 Thread Elvis Stansvik
Den mån 25 nov. 2019 kl 22:08 skrev Filippo Cucchetto : > > @Ekke > I think you should redesign your qml the other way around. For your problem > there're multiple solutions > 1) Use some sort of StackView.view attached property. This is *usually* > implemented with a simple upward hierarchy look

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Ulf Hermann
> We have some code that evaluates JS in custom QQmlContexts with certain > "magic" context properties set (sort of like the "index" or "modelData" > context properties in delegates like Repeater.delegate). > Will something similar still be possible? You should rephrase that as required properties

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Arno Rehn
On 21/11/2019 09:17, Ulf Hermann wrote: > Context properties > -- > > These are remarkably evil and actually unnecessary. You can readily > replace them with singletons or object properties (possibly required > ones) already in 5.15. We can deprecate context properties. See also

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Filippo Cucchetto
Having followed the evolution and first announcement of Qml/Quick QML3 seems like an admission of guilt. I remember when a lot of people complained about the use of Javascript as a scripting language and further more on the lack of a public C++ API. Now it seems like some of the QML problems are go

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Filippo Cucchetto
@Ekke I think you should redesign your qml the other way around. For your problem there're multiple solutions 1) Use some sort of StackView.view attached property. This is *usually* implemented with a simple upward hierarchy lookup of the first instance of a StackView. In this way you get the refer

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Giuseppe D'Angelo via Development
On 25/11/2019 12:35, Ulf Hermann wrote: Add one of the "b" to QSomething and the user code silently stops working. It's an unfortunate consequence of shadowing; this is considered bad practice (e.g. ES.12). Would it help to have a warn-on-shadowing pragma? Thanks, -- Giuseppe D'Angelo | gius

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Robin Burchell
On Mon, Nov 25, 2019, at 4:55 PM, Robin Burchell wrote: > The situation for QML3 seems to be much less clear cut (This got sent a bit too early (hotkey mixup). Pretend this was at the bottom of my last mail.) I can't really comment on all of this stuff individually, because I'd be writing an e

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Ulf Hermann
On 11/25/19 4:55 PM, Robin Burchell wrote: > On Mon, Nov 25, 2019, at 3:53 PM, Ulf Hermann wrote: >> Yes, but the problems with this construct are the same as with >> generic context properties: Your QML component requires some >> context that it doesn't declare. Therefore your code is not >> reusa

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Robin Burchell
On Mon, Nov 25, 2019, at 3:53 PM, Ulf Hermann wrote: > Yes, but the problems with this construct are the same as with generic > context properties: Your QML component requires some context that it > doesn't declare. Therefore your code is not reusable and brittle wrt > addition of properties in

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread ekke
Am 25.11.19 um 15:53 schrieb Ulf Hermann: >> Yeah, that's going to make using QML in actual applications a whole lot >> harder. For instance, sometimes access to some root node is needed even >> from deep leaf files. Removing that capability is quite a drastic measure. > Yes, but the problems wit

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread André Somers
On 25-11-19 15:53, Ulf Hermann wrote: Yeah, that's going to make using QML in actual applications a whole lot harder. For instance, sometimes access to some root node is needed even from deep leaf files. Removing that capability is quite a drastic measure. Yes, but the problems with this constr

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Ulf Hermann
> Yeah, that's going to make using QML in actual applications a whole lot > harder. For instance, sometimes access to some root node is needed even > from deep leaf files. Removing that capability is quite a drastic measure. Yes, but the problems with this construct are the same as with generic

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread André Somers
On 25-11-19 12:31, Ulf Hermann wrote: I think one of the biggest problems is that ID resolution crosses file boundaries. This essentially means that the ids chosen can very easily become part of the "API" of a component unless you are very vigilant to not allow that to happen. Well, yes, and th

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Ulf Hermann
> Il 25/11/19 10:25, Eike Ziller ha scritto: >>> ? >> Similar things can happen in C++ with method names. >> C++ got the ‘override’ keyword to make these breakages detectable by >> tooling. >> It looks to me like the case id==propertyname would also be detectable >> by tooling? > > What do you m

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Ulf Hermann
> I think one of the biggest problems is that ID resolution crosses > file boundaries. This essentially means that the ids chosen can very > easily become part of the "API" of a component unless you are very > vigilant to not allow that to happen. Well, yes, and there is an easy way to fix this: D

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Eike Ziller
> On 25. Nov 2019, at 11:03, Giuseppe D'Angelo via Development > wrote: > > Il 25/11/19 10:25, Eike Ziller ha scritto: >>> ? >> Similar things can happen in C++ with method names. >> C++ got the ‘override’ keyword to make these breakages detectable by tooling. >> It looks to me like the case i

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Robin Burchell
On Mon, Nov 25, 2019, at 10:43 AM, Ulf Hermann wrote: > Indeed we need to deal with this somehow. Maybe we do need to retain > versioning on a module level. For example, the qmldir file could specify > what versions of which other modules it expects. Or we define that it's > not a problem ... I

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Giuseppe D'Angelo via Development
Il 25/11/19 10:25, Eike Ziller ha scritto: ? Similar things can happen in C++ with method names. C++ got the ‘override’ keyword to make these breakages detectable by tooling. It looks to me like the case id==propertyname would also be detectable by tooling? What do you mean? Can you make an e

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Ulf Hermann
>> While I agree with this overall, there's still one caveat which I >> haven't seen discussed yet: >> >> Imagine I have the following code: >> >> Item { id: foo property color prettyColor: "#f0f" >> >> Rectangle { color: foo.prettyColor } } >> >> Right now "foo" refers to the Item. What if in

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-25 Thread Eike Ziller
> On 22. Nov 2019, at 11:52, Kai Uwe Broulik wrote: > > Hi, > > > these are the notes on the QtQml session: > > > Versioning > > -- > > > > Once we get rid of unqualified lookups we don't need any QML versioning > > anymore. At least the minor version will become optional already in 5

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-22 Thread Damian Ivanov
Hello Giuseppe, >> qmlRegisterSingletonInstance("Utils", 3, 14, "Obj", obj); >In 5.14 the solution is something along the lines of Exactly what I was looking for. >In pre-5.14 the same is achieved by using qmlRegisterSingletonType with >a callback (that returns the object + sets the ownership of

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-22 Thread Giuseppe D'Angelo via Development
Il 22/11/19 16:49, Damian Ivanov ha scritto: I don't see this anywhere documented how this could be done using a singleton. In 5.14 the solution is something along the lines of qmlRegisterSingletonInstance("Utils", 3, 14, "Obj", obj); then in QML import Utils 3.14 // use "Obj" instead of

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-22 Thread Damian Ivanov
Additionally https://forum.qt.io/topic/54353/solved-access-qml-singleton-object-from-c-code/4 seems also like a viable solution though a syntax where qmlRegisterSingletonType return value is a QObject would be very ease to read / write. On Fri, Nov 22, 2019 at 6:33 PM Damian Ivanov wrote: > > Hi

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-22 Thread Damian Ivanov
Hi Dmitriy, Well I can't seem to find an easy example but an easy example: Instantiating a .qml with QQmlComponent::create which is of Window (I do this for others as well) type from c++ than I set obj->properties from c++ based on various events. Creating a singleton class seems like adding 30 li

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-22 Thread Dmitriy Purgin
Hi Damian, that seems to be an interesting case. Could you provide an example of why would you need such a pattern? Why the other way round -- creating a C++ singleton and exposing it to QML -- doesn't work for you? That should be easier and more transparent. Cheers Dmitriy On Fri, Nov 22, 2019

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-22 Thread Damian Ivanov
How would .qml files that are singletons and instantiated from c++ be used currently I do this and am able to access it from qml and c++ QQmlComponent* component = new QQmlComponent(application_engine, "qrc:/Component.qml"); QObject* obj = component->create(); obj->setParent(this); application_engi

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-22 Thread Kai Uwe Broulik
Hi, > these are the notes on the QtQml session: > Versioning > -- > > Once we get rid of unqualified lookups we don't need any QML versioning > anymore. At least the minor version will become optional already in 5.15 > for well-behaved QML documents. In QML 3 it won't be allowed. While

Re: [Development] QTCS2019 Notes from QtQml session

2019-11-21 Thread Dmitriy Purgin
Hi Ulf, thanks for clarifying. You're absolutely right, no other language supports importing different versions of dependencies but I think it is a great feature of QML that helps a lot in maintaining the old code. Would be sad to see it gone in QML 3. Cheers PS I'm forwarding this email to the

[Development] QTCS2019 Notes from QtQml session

2019-11-21 Thread Ulf Hermann
Hi, these are the notes on the QtQml session: Grouped properties -- Grouped properties are incredibly buggy and basically unusable for anything but font and anchors right now. The language would be better off without the concept, allowing only the replacement of the full objec